@finos/legend-query-builder 3.0.8 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +20 -20
  2. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderTelemetryHelper.js +40 -40
  4. package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
  5. package/lib/components/QueryBuilder.d.ts.map +1 -1
  6. package/lib/components/QueryBuilder.js +51 -4
  7. package/lib/components/QueryBuilder.js.map +1 -1
  8. package/lib/components/QueryLoader.d.ts +30 -0
  9. package/lib/components/QueryLoader.d.ts.map +1 -0
  10. package/lib/components/QueryLoader.js +160 -0
  11. package/lib/components/QueryLoader.js.map +1 -0
  12. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +18 -0
  13. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  14. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +152 -15
  15. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  16. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -1
  17. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js +2 -1
  18. package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js.map +1 -1
  19. package/lib/graph/QueryBuilderMetaModelConst.d.ts +33 -0
  20. package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
  21. package/lib/graph/QueryBuilderMetaModelConst.js +34 -0
  22. package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
  23. package/lib/graph-manager/QueryBuilderConst.d.ts +20 -0
  24. package/lib/graph-manager/QueryBuilderConst.d.ts.map +1 -0
  25. package/lib/graph-manager/QueryBuilderConst.js +21 -0
  26. package/lib/graph-manager/QueryBuilderConst.js.map +1 -0
  27. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  28. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +3 -2
  29. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  30. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  31. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +27 -14
  32. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  33. package/lib/index.css +2 -2
  34. package/lib/index.css.map +1 -1
  35. package/lib/index.d.ts +3 -0
  36. package/lib/index.d.ts.map +1 -1
  37. package/lib/index.js +3 -0
  38. package/lib/index.js.map +1 -1
  39. package/lib/package.json +1 -1
  40. package/lib/stores/QueryBuilderState.d.ts +2 -0
  41. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  42. package/lib/stores/QueryBuilderState.js +7 -0
  43. package/lib/stores/QueryBuilderState.js.map +1 -1
  44. package/lib/stores/QueryBuilderStateBuilder.d.ts +1 -1
  45. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  46. package/lib/stores/QueryBuilderStateBuilder.js +11 -2
  47. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  48. package/lib/stores/QueryBuilderStateHashUtils.d.ts +32 -1
  49. package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
  50. package/lib/stores/QueryBuilderStateHashUtils.js +32 -0
  51. package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
  52. package/lib/stores/QueryBuilderTextEditorState.d.ts.map +1 -1
  53. package/lib/stores/QueryBuilderTextEditorState.js +12 -6
  54. package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
  55. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +30 -0
  56. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -0
  57. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.js +17 -0
  58. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.js.map +1 -0
  59. package/lib/stores/QueryLoaderState.d.ts +67 -0
  60. package/lib/stores/QueryLoaderState.d.ts.map +1 -0
  61. package/lib/stores/QueryLoaderState.js +205 -0
  62. package/lib/stores/QueryLoaderState.js.map +1 -0
  63. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +1 -1
  64. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  65. package/lib/stores/explorer/QueryBuilderExplorerState.js +2 -2
  66. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  67. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
  68. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +1 -0
  69. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
  70. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +2 -0
  71. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  72. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +14 -4
  73. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  74. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts +38 -0
  75. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts.map +1 -0
  76. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js +54 -0
  77. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js.map +1 -0
  78. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.d.ts +18 -0
  79. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.d.ts.map +1 -0
  80. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.js +80 -0
  81. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.js.map +1 -0
  82. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts +8 -1
  83. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts.map +1 -1
  84. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js +24 -1
  85. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js.map +1 -1
  86. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  87. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +23 -0
  88. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  89. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts +22 -0
  90. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts.map +1 -0
  91. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js +61 -0
  92. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js.map +1 -0
  93. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts +28 -0
  94. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts.map +1 -0
  95. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js +55 -0
  96. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js.map +1 -0
  97. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts +28 -0
  98. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts.map +1 -0
  99. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js +55 -0
  100. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js.map +1 -0
  101. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts +28 -0
  102. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts.map +1 -0
  103. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js +55 -0
  104. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js.map +1 -0
  105. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts +28 -0
  106. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts.map +1 -0
  107. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js +55 -0
  108. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js.map +1 -0
  109. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts +28 -0
  110. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts.map +1 -0
  111. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js +55 -0
  112. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js.map +1 -0
  113. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts +28 -0
  114. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts.map +1 -0
  115. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js +55 -0
  116. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js.map +1 -0
  117. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts +28 -0
  118. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts.map +1 -0
  119. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js +55 -0
  120. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js.map +1 -0
  121. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts +28 -0
  122. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts.map +1 -0
  123. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js +55 -0
  124. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js.map +1 -0
  125. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts +28 -0
  126. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts.map +1 -0
  127. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js +55 -0
  128. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js.map +1 -0
  129. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts +28 -0
  130. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts.map +1 -0
  131. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js +55 -0
  132. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js.map +1 -0
  133. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts +28 -0
  134. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts.map +1 -0
  135. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js +55 -0
  136. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js.map +1 -0
  137. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts +28 -0
  138. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts.map +1 -0
  139. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js +55 -0
  140. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js.map +1 -0
  141. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts +28 -0
  142. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts.map +1 -0
  143. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js +55 -0
  144. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js.map +1 -0
  145. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts +28 -0
  146. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts.map +1 -0
  147. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js +55 -0
  148. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js.map +1 -0
  149. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts +28 -0
  150. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts.map +1 -0
  151. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js +55 -0
  152. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js.map +1 -0
  153. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts +28 -0
  154. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts.map +1 -0
  155. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js +55 -0
  156. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js.map +1 -0
  157. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts +28 -0
  158. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts.map +1 -0
  159. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js +55 -0
  160. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js.map +1 -0
  161. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts +28 -0
  162. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts.map +1 -0
  163. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js +55 -0
  164. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js.map +1 -0
  165. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts +28 -0
  166. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts.map +1 -0
  167. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js +55 -0
  168. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js.map +1 -0
  169. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts +28 -0
  170. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts.map +1 -0
  171. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js +55 -0
  172. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js.map +1 -0
  173. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts +28 -0
  174. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts.map +1 -0
  175. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js +55 -0
  176. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js.map +1 -0
  177. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts +28 -0
  178. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts.map +1 -0
  179. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js +55 -0
  180. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js.map +1 -0
  181. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts +28 -0
  182. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts.map +1 -0
  183. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js +55 -0
  184. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js.map +1 -0
  185. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts +28 -0
  186. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts.map +1 -0
  187. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js +55 -0
  188. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js.map +1 -0
  189. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts +28 -0
  190. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts.map +1 -0
  191. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js +55 -0
  192. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js.map +1 -0
  193. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts +28 -0
  194. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts.map +1 -0
  195. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js +55 -0
  196. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js.map +1 -0
  197. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts +28 -0
  198. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts.map +1 -0
  199. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js +55 -0
  200. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js.map +1 -0
  201. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts +28 -0
  202. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts.map +1 -0
  203. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js +55 -0
  204. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js.map +1 -0
  205. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts +28 -0
  206. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts.map +1 -0
  207. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js +55 -0
  208. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js.map +1 -0
  209. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts +28 -0
  210. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts.map +1 -0
  211. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js +55 -0
  212. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js.map +1 -0
  213. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts +28 -0
  214. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts.map +1 -0
  215. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js +55 -0
  216. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js.map +1 -0
  217. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  218. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +9 -1
  219. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  220. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  221. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  222. package/lib/stores/shared/ValueSpecificationEditorHelper.js +7 -1
  223. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  224. package/package.json +8 -8
  225. package/src/__lib__/QueryBuilderTelemetryHelper.ts +40 -59
  226. package/src/components/QueryBuilder.tsx +79 -0
  227. package/src/components/QueryLoader.tsx +501 -0
  228. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +456 -92
  229. package/src/components/shared/QueryBuilderPanelIssueCountBadge.tsx +2 -1
  230. package/src/graph/QueryBuilderMetaModelConst.ts +34 -0
  231. package/src/graph-manager/QueryBuilderConst.ts +20 -0
  232. package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +10 -1
  233. package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +73 -28
  234. package/src/index.ts +3 -0
  235. package/src/stores/QueryBuilderState.ts +8 -0
  236. package/src/stores/QueryBuilderStateBuilder.ts +33 -2
  237. package/src/stores/QueryBuilderStateHashUtils.ts +33 -0
  238. package/src/stores/QueryBuilderTextEditorState.ts +21 -14
  239. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +36 -0
  240. package/src/stores/QueryLoaderState.ts +298 -0
  241. package/src/stores/explorer/QueryBuilderExplorerState.ts +2 -1
  242. package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +1 -0
  243. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +22 -3
  244. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.ts +98 -0
  245. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.ts +83 -0
  246. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.ts +31 -0
  247. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +41 -0
  248. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.ts +175 -0
  249. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.ts +98 -0
  250. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.ts +98 -0
  251. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.ts +98 -0
  252. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.ts +99 -0
  253. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.ts +98 -0
  254. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.ts +98 -0
  255. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.ts +98 -0
  256. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.ts +98 -0
  257. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.ts +98 -0
  258. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.ts +98 -0
  259. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.ts +98 -0
  260. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.ts +98 -0
  261. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.ts +98 -0
  262. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.ts +98 -0
  263. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.ts +98 -0
  264. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.ts +98 -0
  265. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.ts +98 -0
  266. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.ts +98 -0
  267. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.ts +98 -0
  268. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.ts +98 -0
  269. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.ts +98 -0
  270. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.ts +98 -0
  271. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.ts +98 -0
  272. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.ts +98 -0
  273. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.ts +98 -0
  274. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.ts +98 -0
  275. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.ts +98 -0
  276. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.ts +98 -0
  277. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.ts +98 -0
  278. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.ts +98 -0
  279. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.ts +98 -0
  280. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +18 -1
  281. package/src/stores/shared/ValueSpecificationEditorHelper.ts +39 -2
  282. package/tsconfig.json +38 -0
@@ -0,0 +1,501 @@
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 { useApplicationStore } from '@finos/legend-application';
18
+ import {
19
+ CODE_EDITOR_LANGUAGE,
20
+ CodeEditor,
21
+ } from '@finos/legend-lego/code-editor';
22
+ import {
23
+ Dialog,
24
+ Modal,
25
+ ModalTitle,
26
+ clsx,
27
+ SearchIcon,
28
+ TimesIcon,
29
+ DropdownMenu,
30
+ MenuContent,
31
+ MenuContentItem,
32
+ BlankPanelContent,
33
+ PanelLoadingIndicator,
34
+ ModalHeader,
35
+ ModalBody,
36
+ ModalFooter,
37
+ ModalFooterButton,
38
+ UserIcon,
39
+ LastModifiedIcon,
40
+ MoreVerticalIcon,
41
+ ThinChevronRightIcon,
42
+ InfoCircleIcon,
43
+ } from '@finos/legend-art';
44
+ import type { LightQuery } from '@finos/legend-graph';
45
+ import {
46
+ debounce,
47
+ formatDistanceToNow,
48
+ guaranteeNonNullable,
49
+ quantifyList,
50
+ } from '@finos/legend-shared';
51
+ import { flowResult } from 'mobx';
52
+ import { observer } from 'mobx-react-lite';
53
+ import { useRef, useState, useMemo, useEffect } from 'react';
54
+ import {
55
+ QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT,
56
+ type QueryLoaderState,
57
+ } from '../stores/QueryLoaderState.js';
58
+
59
+ const QueryPreviewViewer = observer(
60
+ (props: { queryLoaderState: QueryLoaderState }) => {
61
+ const { queryLoaderState } = props;
62
+ const close = (): void => {
63
+ queryLoaderState.setShowPreviewViewer(false);
64
+ };
65
+ return (
66
+ <Dialog
67
+ open={queryLoaderState.showPreviewViewer}
68
+ onClose={close}
69
+ classes={{
70
+ root: 'editor-modal__root-container',
71
+ container: 'editor-modal__container',
72
+ paper: 'editor-modal__content',
73
+ }}
74
+ >
75
+ <Modal className="editor-modal" darkMode={true}>
76
+ <ModalHeader
77
+ title={
78
+ guaranteeNonNullable(queryLoaderState.queryPreviewContent).name
79
+ }
80
+ />
81
+ <ModalBody>
82
+ <CodeEditor
83
+ inputValue={
84
+ guaranteeNonNullable(queryLoaderState.queryPreviewContent)
85
+ .content
86
+ }
87
+ isReadOnly={true}
88
+ language={CODE_EDITOR_LANGUAGE.PURE}
89
+ showMiniMap={true}
90
+ />
91
+ </ModalBody>
92
+ <ModalFooter>
93
+ <ModalFooterButton onClick={close} text="Close" />
94
+ </ModalFooter>
95
+ </Modal>
96
+ </Dialog>
97
+ );
98
+ },
99
+ );
100
+
101
+ export const QueryLoader = observer(
102
+ (props: { queryLoaderState: QueryLoaderState; loadActionLabel: string }) => {
103
+ const { queryLoaderState, loadActionLabel } = props;
104
+ const applicationStore = useApplicationStore();
105
+ const searchInputRef = useRef<HTMLInputElement>(null);
106
+ const queryRenameInputRef = useRef<HTMLInputElement>(null);
107
+ const results = queryLoaderState.queries;
108
+ const [isMineOnly, setIsMineOnly] = useState(false);
109
+ const [showQueryNameEditInput, setShowQueryNameEditInput] = useState<
110
+ number | undefined
111
+ >();
112
+ useEffect(() => {
113
+ queryRenameInputRef.current?.focus();
114
+ queryRenameInputRef.current?.select();
115
+ }, [showQueryNameEditInput]);
116
+ const [queryNameInputValue, setQueryNameInputValue] = useState<string>('');
117
+ const showEditQueryNameInput =
118
+ (value: string, idx: number): (() => void) =>
119
+ (): void => {
120
+ setQueryNameInputValue(value);
121
+ setShowQueryNameEditInput(idx);
122
+ };
123
+ const hideEditQueryNameInput = (): void => {
124
+ setShowQueryNameEditInput(undefined);
125
+ setQueryNameInputValue('');
126
+ };
127
+ const changeQueryNameInputValue: React.ChangeEventHandler<
128
+ HTMLInputElement
129
+ > = (event) => setQueryNameInputValue(event.target.value);
130
+
131
+ // search text
132
+ const debouncedLoadQueries = useMemo(
133
+ () =>
134
+ debounce((input: string): void => {
135
+ flowResult(queryLoaderState.searchQueries(input)).catch(
136
+ applicationStore.alertUnhandledError,
137
+ );
138
+ }, 500),
139
+ [applicationStore.alertUnhandledError, queryLoaderState],
140
+ );
141
+ const onSearchTextChange: React.ChangeEventHandler<HTMLInputElement> = (
142
+ event,
143
+ ) => {
144
+ if (event.target.value !== queryLoaderState.searchText) {
145
+ queryLoaderState.setSearchText(event.target.value);
146
+ debouncedLoadQueries.cancel();
147
+ debouncedLoadQueries(event.target.value);
148
+ }
149
+ };
150
+ const clearQuerySearching = (): void => {
151
+ queryLoaderState.setSearchText('');
152
+ debouncedLoadQueries.cancel();
153
+ debouncedLoadQueries('');
154
+ };
155
+ const toggleShowCurrentUserQueriesOnly = (): void => {
156
+ queryLoaderState.setShowCurrentUserQueriesOnly(
157
+ !queryLoaderState.showCurrentUserQueriesOnly,
158
+ );
159
+ setIsMineOnly(!isMineOnly);
160
+ debouncedLoadQueries.cancel();
161
+ debouncedLoadQueries(queryLoaderState.searchText);
162
+ };
163
+ const toggleExtraFilters = (key: string): void => {
164
+ queryLoaderState.extraFilters.set(
165
+ key,
166
+ !queryLoaderState.extraFilters.get(key),
167
+ );
168
+ debouncedLoadQueries.cancel();
169
+ debouncedLoadQueries(queryLoaderState.searchText);
170
+ };
171
+
172
+ useEffect(() => {
173
+ flowResult(queryLoaderState.searchQueries('')).catch(
174
+ applicationStore.alertUnhandledError,
175
+ );
176
+ }, [applicationStore, queryLoaderState]);
177
+
178
+ useEffect(() => {
179
+ searchInputRef.current?.focus();
180
+ }, [queryLoaderState]);
181
+
182
+ // actions
183
+ const renameQuery =
184
+ (query: LightQuery): (() => void) =>
185
+ (): void => {
186
+ if (!queryLoaderState.isReadOnly) {
187
+ flowResult(
188
+ queryLoaderState.renameQuery(query.id, queryNameInputValue),
189
+ )
190
+ .catch(applicationStore.alertUnhandledError)
191
+ .finally(() => hideEditQueryNameInput());
192
+ }
193
+ };
194
+
195
+ const deleteQuery =
196
+ (query: LightQuery): (() => void) =>
197
+ (): void => {
198
+ if (!queryLoaderState.isReadOnly) {
199
+ flowResult(queryLoaderState.deleteQuery(query.id)).catch(
200
+ applicationStore.alertUnhandledError,
201
+ );
202
+ }
203
+ };
204
+
205
+ const showPreview = (queryId: string): void => {
206
+ flowResult(queryLoaderState.getPreviewQueryContent(queryId)).catch(
207
+ applicationStore.alertUnhandledError,
208
+ );
209
+ queryLoaderState.setShowPreviewViewer(true);
210
+ };
211
+
212
+ return (
213
+ <div className="query-loader">
214
+ <div className="query-loader__header">
215
+ <div className="query-loader__search">
216
+ <div className="query-loader__search__input__container">
217
+ <input
218
+ ref={searchInputRef}
219
+ className={clsx('query-loader__search__input input--dark', {
220
+ 'query-loader__search__input--searching':
221
+ queryLoaderState.searchText,
222
+ })}
223
+ onChange={onSearchTextChange}
224
+ value={queryLoaderState.searchText}
225
+ placeholder="Search for queries by name or ID"
226
+ />
227
+ {!queryLoaderState.searchText ? (
228
+ <div className="query-loader__search__input__search__icon">
229
+ <SearchIcon />
230
+ </div>
231
+ ) : (
232
+ <>
233
+ <button
234
+ className="query-loader__search__input__clear-btn"
235
+ tabIndex={-1}
236
+ onClick={clearQuerySearching}
237
+ title="Clear"
238
+ >
239
+ <TimesIcon />
240
+ </button>
241
+ </>
242
+ )}
243
+ </div>
244
+ </div>
245
+ <div className="query-loader__filter">
246
+ <div className="query-loader__filter__toggler">
247
+ <button
248
+ className={clsx('query-loader__filter__toggler__btn', {
249
+ 'query-loader__filter__toggler__btn--toggled': isMineOnly,
250
+ })}
251
+ onClick={toggleShowCurrentUserQueriesOnly}
252
+ tabIndex={-1}
253
+ >
254
+ Mine Only
255
+ </button>
256
+ {queryLoaderState.extraFilterOptions.length > 0 && (
257
+ <div className="query-loader__filter__extra__filters">
258
+ {Array.from(queryLoaderState.extraFilters.entries()).map(
259
+ ([key, value]) => (
260
+ <button
261
+ key={key}
262
+ className={clsx('query-loader__filter__toggler__btn', {
263
+ 'query-loader__filter__toggler__btn--toggled': value,
264
+ })}
265
+ onClick={(): void => toggleExtraFilters(key)}
266
+ tabIndex={-1}
267
+ >
268
+ {key}
269
+ </button>
270
+ ),
271
+ )}
272
+ </div>
273
+ )}
274
+ </div>
275
+ </div>
276
+ </div>
277
+ <div className="query-loader__content">
278
+ <PanelLoadingIndicator
279
+ isLoading={
280
+ queryLoaderState.searchQueriesState.isInProgress ||
281
+ queryLoaderState.renameQueryState.isInProgress ||
282
+ queryLoaderState.deleteQueryState.isInProgress ||
283
+ queryLoaderState.previewQueryState.isInProgress
284
+ }
285
+ />
286
+
287
+ <div className="query-loader__results">
288
+ {queryLoaderState.searchQueriesState.hasCompleted && (
289
+ <>
290
+ <div className="query-loader__results__summary">
291
+ {queryLoaderState.showingDefaultQueries ? (
292
+ queryLoaderState.generateDefaultQueriesSummaryText?.(
293
+ results,
294
+ ) ?? 'Refine your search to get better matches'
295
+ ) : results.length >= QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT ? (
296
+ <>
297
+ {`Found ${QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT}+ matches`}{' '}
298
+ <InfoCircleIcon
299
+ title="Some queries are not listed, refine your search to get better matches"
300
+ className="query-loader__results__summary__info"
301
+ />
302
+ </>
303
+ ) : (
304
+ `Found ${quantifyList(results, 'match', 'matches')}`
305
+ )}
306
+ </div>
307
+ {results
308
+ .slice(0, QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT)
309
+ .map((query, idx) => (
310
+ <div
311
+ className="query-loader__result"
312
+ title={`Click to ${loadActionLabel}...`}
313
+ key={query.id}
314
+ onClick={() => queryLoaderState.loadQuery(query)}
315
+ >
316
+ <div className="query-loader__result__content">
317
+ {showQueryNameEditInput === idx ? (
318
+ <div className="query-loader__result__title__editor">
319
+ <input
320
+ className="query-loader__result__title__editor__input input--dark"
321
+ spellCheck={false}
322
+ ref={queryRenameInputRef}
323
+ value={queryNameInputValue}
324
+ onChange={changeQueryNameInputValue}
325
+ onKeyDown={(event) => {
326
+ if (event.code === 'Enter') {
327
+ renameQuery(query)();
328
+ } else if (event.code === 'Escape') {
329
+ hideEditQueryNameInput();
330
+ }
331
+ }}
332
+ onBlur={() => hideEditQueryNameInput()}
333
+ />
334
+ </div>
335
+ ) : (
336
+ <div
337
+ className="query-loader__result__title"
338
+ title={query.name}
339
+ >
340
+ {query.name}
341
+ </div>
342
+ )}
343
+ <div className="query-loader__result__description">
344
+ <div className="query-loader__result__description__date__icon">
345
+ <LastModifiedIcon />
346
+ </div>
347
+ <div className="query-loader__result__description__date">
348
+ {query.lastUpdatedAt
349
+ ? formatDistanceToNow(
350
+ new Date(query.lastUpdatedAt),
351
+ {
352
+ includeSeconds: true,
353
+ addSuffix: true,
354
+ },
355
+ )
356
+ : '(unknown)'}
357
+ </div>
358
+ <div
359
+ className={clsx(
360
+ 'query-loader__result__description__author__icon',
361
+ {
362
+ 'query-loader__result__description__author__icon--owner':
363
+ query.isCurrentUserQuery,
364
+ },
365
+ )}
366
+ >
367
+ <UserIcon />
368
+ </div>
369
+ <div className="query-loader__result__description__author__name">
370
+ {query.isCurrentUserQuery ? (
371
+ <div
372
+ title={query.owner}
373
+ className="query-loader__result__description__owner"
374
+ >
375
+ Me
376
+ </div>
377
+ ) : (
378
+ query.owner
379
+ )}
380
+ </div>
381
+ </div>
382
+ </div>
383
+ <DropdownMenu
384
+ className="query-loader__result__actions-menu"
385
+ title="More Actions..."
386
+ content={
387
+ <MenuContent>
388
+ <MenuContentItem
389
+ onClick={(): void => showPreview(query.id)}
390
+ >
391
+ Show Query Preview
392
+ </MenuContentItem>
393
+ {!queryLoaderState.isReadOnly && (
394
+ <MenuContentItem
395
+ disabled={!query.isCurrentUserQuery}
396
+ onClick={deleteQuery(query)}
397
+ >
398
+ Delete
399
+ </MenuContentItem>
400
+ )}
401
+ {!queryLoaderState.isReadOnly && (
402
+ <MenuContentItem
403
+ disabled={!query.isCurrentUserQuery}
404
+ onClick={showEditQueryNameInput(
405
+ query.name,
406
+ idx,
407
+ )}
408
+ >
409
+ Rename
410
+ </MenuContentItem>
411
+ )}
412
+ </MenuContent>
413
+ }
414
+ menuProps={{
415
+ anchorOrigin: {
416
+ vertical: 'bottom',
417
+ horizontal: 'left',
418
+ },
419
+ transformOrigin: {
420
+ vertical: 'top',
421
+ horizontal: 'left',
422
+ },
423
+ elevation: 7,
424
+ }}
425
+ >
426
+ <MoreVerticalIcon />
427
+ </DropdownMenu>
428
+ <div className="query-loader__result__arrow">
429
+ <ThinChevronRightIcon />
430
+ </div>
431
+ </div>
432
+ ))}
433
+ </>
434
+ )}
435
+ {!queryLoaderState.searchQueriesState.hasCompleted && (
436
+ <BlankPanelContent>Loading queries...</BlankPanelContent>
437
+ )}
438
+ </div>
439
+ {queryLoaderState.showPreviewViewer &&
440
+ queryLoaderState.queryPreviewContent && (
441
+ <QueryPreviewViewer queryLoaderState={queryLoaderState} />
442
+ )}
443
+ </div>
444
+ </div>
445
+ );
446
+ },
447
+ );
448
+
449
+ export const QueryLoaderDialog = observer(
450
+ (props: {
451
+ queryLoaderState: QueryLoaderState;
452
+ title: string;
453
+ loadActionLabel?: string | undefined;
454
+ }) => {
455
+ const { queryLoaderState, title, loadActionLabel } = props;
456
+
457
+ const close = (): void => {
458
+ queryLoaderState.setQueryLoaderDialogOpen(false);
459
+ queryLoaderState.reset();
460
+ };
461
+
462
+ return (
463
+ <Dialog
464
+ open={queryLoaderState.isQueryLoaderDialogOpen}
465
+ onClose={close}
466
+ classes={{
467
+ root: 'query-loader__dialog',
468
+ container: 'query-loader__dialog__container',
469
+ }}
470
+ PaperProps={{
471
+ classes: { root: 'query-loader__dialog__body' },
472
+ }}
473
+ >
474
+ <Modal
475
+ darkMode={true}
476
+ className="modal query-loader__dialog__body__content"
477
+ >
478
+ <div className="modal query-loader__dialog__header">
479
+ <ModalTitle
480
+ className="query-loader__dialog__header__title"
481
+ title={title}
482
+ />
483
+ <button
484
+ className="query-loader__dialog__header__close-btn"
485
+ title="Close"
486
+ onClick={close}
487
+ >
488
+ <TimesIcon />
489
+ </button>
490
+ </div>
491
+ <div className="modal query-loader__dialog__content">
492
+ <QueryLoader
493
+ queryLoaderState={queryLoaderState}
494
+ loadActionLabel={loadActionLabel ?? title.toLowerCase()}
495
+ />
496
+ </div>
497
+ </Modal>
498
+ </Dialog>
499
+ );
500
+ },
501
+ );