@grafana/plugin-ui 0.7.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/README.md +3 -34
  2. package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js +4 -5
  3. package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js.map +1 -1
  4. package/dist/components/ConfigEditor/AdvancedSettings/AdvancedHttpSettings.js +28 -0
  5. package/dist/components/ConfigEditor/AdvancedSettings/AdvancedHttpSettings.js.map +1 -0
  6. package/dist/components/ConfigEditor/AdvancedSettings/index.js +6 -0
  7. package/dist/components/ConfigEditor/AdvancedSettings/index.js.map +1 -0
  8. package/dist/components/ConfigEditor/Auth/Auth.js +24 -0
  9. package/dist/components/ConfigEditor/Auth/Auth.js.map +1 -0
  10. package/dist/components/ConfigEditor/Auth/auth-method/AuthMethodSettings.js +109 -0
  11. package/dist/components/ConfigEditor/Auth/auth-method/AuthMethodSettings.js.map +1 -0
  12. package/dist/components/ConfigEditor/Auth/auth-method/BasicAuth.js +23 -0
  13. package/dist/components/ConfigEditor/Auth/auth-method/BasicAuth.js.map +1 -0
  14. package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeader.js +41 -0
  15. package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeader.js.map +1 -0
  16. package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeaders.js +76 -0
  17. package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeaders.js.map +1 -0
  18. package/dist/components/ConfigEditor/Auth/index.js +10 -0
  19. package/dist/components/ConfigEditor/Auth/index.js.map +1 -0
  20. package/dist/components/ConfigEditor/Auth/styles.js +19 -0
  21. package/dist/components/ConfigEditor/Auth/styles.js.map +1 -0
  22. package/dist/components/ConfigEditor/Auth/tls/SelfSignedCertificate.js +18 -0
  23. package/dist/components/ConfigEditor/Auth/tls/SelfSignedCertificate.js.map +1 -0
  24. package/dist/components/ConfigEditor/Auth/tls/SkipTLSVerification.js +11 -0
  25. package/dist/components/ConfigEditor/Auth/tls/SkipTLSVerification.js.map +1 -0
  26. package/dist/components/ConfigEditor/Auth/tls/TLSClientAuth.js +22 -0
  27. package/dist/components/ConfigEditor/Auth/tls/TLSClientAuth.js.map +1 -0
  28. package/dist/components/ConfigEditor/Auth/tls/TLSSettings.js +25 -0
  29. package/dist/components/ConfigEditor/Auth/tls/TLSSettings.js.map +1 -0
  30. package/dist/components/ConfigEditor/Auth/tls/TLSSettingsSection.js +35 -0
  31. package/dist/components/ConfigEditor/Auth/tls/TLSSettingsSection.js.map +1 -0
  32. package/dist/components/ConfigEditor/Auth/types.js +11 -0
  33. package/dist/components/ConfigEditor/Auth/types.js.map +1 -0
  34. package/dist/components/ConfigEditor/Auth/utils.js +112 -0
  35. package/dist/components/ConfigEditor/Auth/utils.js.map +1 -0
  36. package/dist/components/ConfigEditor/ConfigSection/ConfigDescriptionLink.js +32 -0
  37. package/dist/components/ConfigEditor/ConfigSection/ConfigDescriptionLink.js.map +1 -0
  38. package/dist/components/ConfigEditor/ConfigSection/ConfigSection.js +12 -0
  39. package/dist/components/ConfigEditor/ConfigSection/ConfigSection.js.map +1 -0
  40. package/dist/components/ConfigEditor/ConfigSection/ConfigSubSection.js +12 -0
  41. package/dist/components/ConfigEditor/ConfigSection/ConfigSubSection.js.map +1 -0
  42. package/dist/components/ConfigEditor/ConfigSection/GenericConfigSection.js +40 -0
  43. package/dist/components/ConfigEditor/ConfigSection/GenericConfigSection.js.map +1 -0
  44. package/dist/components/ConfigEditor/ConfigSection/index.js +10 -0
  45. package/dist/components/ConfigEditor/ConfigSection/index.js.map +1 -0
  46. package/dist/components/ConfigEditor/Connection/ConnectionSettings.js +25 -0
  47. package/dist/components/ConfigEditor/Connection/ConnectionSettings.js.map +1 -0
  48. package/dist/components/ConfigEditor/Connection/index.js +6 -0
  49. package/dist/components/ConfigEditor/Connection/index.js.map +1 -0
  50. package/dist/components/ConfigEditor/DataSourceDescription.js +39 -0
  51. package/dist/components/ConfigEditor/DataSourceDescription.js.map +1 -0
  52. package/dist/components/ConfigEditor/SecureSocksProxyToggle.js +8 -13
  53. package/dist/components/ConfigEditor/SecureSocksProxyToggle.js.map +1 -1
  54. package/dist/components/ConfigEditor/index.js +15 -3
  55. package/dist/components/ConfigEditor/index.js.map +1 -1
  56. package/dist/components/ConfigEditor/types.js +3 -0
  57. package/dist/components/ConfigEditor/types.js.map +1 -0
  58. package/dist/components/CustomHeadersSettings/CustomHeadersSettings.js +12 -17
  59. package/dist/components/CustomHeadersSettings/CustomHeadersSettings.js.map +1 -1
  60. package/dist/components/DataLinks/DataLink.js +3 -3
  61. package/dist/components/DataLinks/DataLink.js.map +1 -1
  62. package/dist/components/DataLinks/DataLinks.js +6 -9
  63. package/dist/components/DataLinks/DataLinks.js.map +1 -1
  64. package/dist/components/DataLinks/index.js.map +1 -1
  65. package/dist/components/DataSourcePicker/DataSourcePicker.js +4 -6
  66. package/dist/components/DataSourcePicker/DataSourcePicker.js.map +1 -1
  67. package/dist/components/DatePicker/DatePicker.js +5 -3
  68. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  69. package/dist/components/DatePicker/styles.js +8 -10
  70. package/dist/components/DatePicker/styles.js.map +1 -1
  71. package/dist/components/DatePickerWithInput/DatePickerWithInput.js +1 -1
  72. package/dist/components/DatePickerWithInput/DatePickerWithInput.js.map +1 -1
  73. package/dist/components/DebounceInput/DebounceInput.js +3 -1
  74. package/dist/components/DebounceInput/DebounceInput.js.map +1 -1
  75. package/dist/components/Plugins/PluginSignatureBadge.js.map +1 -1
  76. package/dist/components/QueryEditor/AccessoryButton.js +3 -4
  77. package/dist/components/QueryEditor/AccessoryButton.js.map +1 -1
  78. package/dist/components/QueryEditor/DatasetSelector.js.map +1 -1
  79. package/dist/components/QueryEditor/EditorField.js +7 -9
  80. package/dist/components/QueryEditor/EditorField.js.map +1 -1
  81. package/dist/components/QueryEditor/EditorFieldGroup.js +2 -2
  82. package/dist/components/QueryEditor/EditorFieldGroup.js.map +1 -1
  83. package/dist/components/QueryEditor/EditorHeader.js +3 -4
  84. package/dist/components/QueryEditor/EditorHeader.js.map +1 -1
  85. package/dist/components/QueryEditor/EditorList.js +5 -6
  86. package/dist/components/QueryEditor/EditorList.js.map +1 -1
  87. package/dist/components/QueryEditor/EditorRow.js +3 -3
  88. package/dist/components/QueryEditor/EditorRow.js.map +1 -1
  89. package/dist/components/QueryEditor/EditorRows.js +2 -2
  90. package/dist/components/QueryEditor/EditorRows.js.map +1 -1
  91. package/dist/components/QueryEditor/EditorStack.js +13 -0
  92. package/dist/components/QueryEditor/EditorStack.js.map +1 -0
  93. package/dist/components/QueryEditor/EditorSwitch.js.map +1 -1
  94. package/dist/components/QueryEditor/FlexItem.js.map +1 -1
  95. package/dist/components/QueryEditor/InlineSelect.js +5 -8
  96. package/dist/components/QueryEditor/InlineSelect.js.map +1 -1
  97. package/dist/components/QueryEditor/InputGroup.js +29 -9
  98. package/dist/components/QueryEditor/InputGroup.js.map +1 -1
  99. package/dist/components/QueryEditor/QueryHeader.js +1 -4
  100. package/dist/components/QueryEditor/QueryHeader.js.map +1 -1
  101. package/dist/components/QueryEditor/RunQueryButton.js +3 -5
  102. package/dist/components/QueryEditor/RunQueryButton.js.map +1 -1
  103. package/dist/components/QueryEditor/TableSelector.js.map +1 -1
  104. package/dist/components/QueryEditor/index.js +3 -3
  105. package/dist/components/QueryEditor/index.js.map +1 -1
  106. package/dist/components/QueryEditor/query-editor-raw/QueryEditorRaw.js +2 -2
  107. package/dist/components/QueryEditor/query-editor-raw/QueryEditorRaw.js.map +1 -1
  108. package/dist/components/QueryEditor/types.js +2 -2
  109. package/dist/components/QueryEditor/types.js.map +1 -1
  110. package/dist/components/QueryEditor/utils/sql.utils.js.map +1 -1
  111. package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js +1 -1
  112. package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js.map +1 -1
  113. package/dist/components/QueryEditor/visual-query-builder/EditorField.js.map +1 -1
  114. package/dist/components/QueryEditor/visual-query-builder/EditorRow.js +2 -2
  115. package/dist/components/QueryEditor/visual-query-builder/EditorRow.js.map +1 -1
  116. package/dist/components/QueryEditor/visual-query-builder/EditorRows.js +2 -2
  117. package/dist/components/QueryEditor/visual-query-builder/EditorRows.js.map +1 -1
  118. package/dist/components/QueryEditor/visual-query-builder/SelectRow.js +3 -3
  119. package/dist/components/QueryEditor/visual-query-builder/SelectRow.js.map +1 -1
  120. package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js +1 -1
  121. package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js.map +1 -1
  122. package/dist/components/QueryEditorRow/QueryEditorRow.js +3 -4
  123. package/dist/components/QueryEditorRow/QueryEditorRow.js.map +1 -1
  124. package/dist/components/SQLEditor/components/SQLEditor.js +330 -0
  125. package/dist/components/SQLEditor/components/SQLEditor.js.map +1 -0
  126. package/dist/components/SQLEditor/index.js +25 -0
  127. package/dist/components/SQLEditor/index.js.map +1 -0
  128. package/dist/components/SQLEditor/mocks/Monaco.js +23 -0
  129. package/dist/components/SQLEditor/mocks/Monaco.js.map +1 -0
  130. package/dist/components/SQLEditor/mocks/TextModel.js +22 -0
  131. package/dist/components/SQLEditor/mocks/TextModel.js.map +1 -0
  132. package/dist/components/SQLEditor/mocks/queries/multiLineFullQuery.js +216 -0
  133. package/dist/components/SQLEditor/mocks/queries/multiLineFullQuery.js.map +1 -0
  134. package/dist/components/SQLEditor/mocks/queries/multiLineFullQueryWithAggregation.js +231 -0
  135. package/dist/components/SQLEditor/mocks/queries/multiLineFullQueryWithAggregation.js.map +1 -0
  136. package/dist/components/SQLEditor/mocks/queries/multiLineMultipleColumns.js +271 -0
  137. package/dist/components/SQLEditor/mocks/queries/multiLineMultipleColumns.js.map +1 -0
  138. package/dist/components/SQLEditor/mocks/queries/singleLineEmptyQuery.js +8 -0
  139. package/dist/components/SQLEditor/mocks/queries/singleLineEmptyQuery.js.map +1 -0
  140. package/dist/components/SQLEditor/mocks/queries/singleLineFullQuery.js +196 -0
  141. package/dist/components/SQLEditor/mocks/queries/singleLineFullQuery.js.map +1 -0
  142. package/dist/components/SQLEditor/mocks/queries/singleLineFullQueryWithAggregation.js +211 -0
  143. package/dist/components/SQLEditor/mocks/queries/singleLineFullQueryWithAggregation.js.map +1 -0
  144. package/dist/components/SQLEditor/mocks/queries/singleLineMultipleColumns.js +251 -0
  145. package/dist/components/SQLEditor/mocks/queries/singleLineMultipleColumns.js.map +1 -0
  146. package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueries.js +386 -0
  147. package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueries.js.map +1 -0
  148. package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueriesWithAggregation.js +416 -0
  149. package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueriesWithAggregation.js.map +1 -0
  150. package/dist/components/SQLEditor/mocks/testData.js +22 -0
  151. package/dist/components/SQLEditor/mocks/testData.js.map +1 -0
  152. package/dist/components/SQLEditor/standardSql/definition.js +13 -0
  153. package/dist/components/SQLEditor/standardSql/definition.js.map +1 -0
  154. package/dist/components/SQLEditor/standardSql/getStandardSuggestions.js +26 -0
  155. package/dist/components/SQLEditor/standardSql/getStandardSuggestions.js.map +1 -0
  156. package/dist/components/SQLEditor/standardSql/getStatementPosition.js +24 -0
  157. package/dist/components/SQLEditor/standardSql/getStatementPosition.js.map +1 -0
  158. package/dist/components/SQLEditor/standardSql/language.js +875 -0
  159. package/dist/components/SQLEditor/standardSql/language.js.map +1 -0
  160. package/dist/components/SQLEditor/standardSql/macros.js +166 -0
  161. package/dist/components/SQLEditor/standardSql/macros.js.map +1 -0
  162. package/dist/components/SQLEditor/standardSql/standardSQLCompletionItemProvider.js +30 -0
  163. package/dist/components/SQLEditor/standardSql/standardSQLCompletionItemProvider.js.map +1 -0
  164. package/dist/components/SQLEditor/standardSql/standardSuggestionsRegistry.js +378 -0
  165. package/dist/components/SQLEditor/standardSql/standardSuggestionsRegistry.js.map +1 -0
  166. package/dist/components/SQLEditor/standardSql/statementPositionResolversRegistry.js +234 -0
  167. package/dist/components/SQLEditor/standardSql/statementPositionResolversRegistry.js.map +1 -0
  168. package/dist/components/SQLEditor/standardSql/suggestionsKindRegistry.js +153 -0
  169. package/dist/components/SQLEditor/standardSql/suggestionsKindRegistry.js.map +1 -0
  170. package/dist/components/SQLEditor/standardSql/types.js +3 -0
  171. package/dist/components/SQLEditor/standardSql/types.js.map +1 -0
  172. package/dist/components/SQLEditor/test-utils/index.js +11 -0
  173. package/dist/components/SQLEditor/test-utils/index.js.map +1 -0
  174. package/dist/components/SQLEditor/test-utils/statementPosition.js +40 -0
  175. package/dist/components/SQLEditor/test-utils/statementPosition.js.map +1 -0
  176. package/dist/components/SQLEditor/test-utils/types.js +3 -0
  177. package/dist/components/SQLEditor/test-utils/types.js.map +1 -0
  178. package/dist/components/SQLEditor/types.js +139 -0
  179. package/dist/components/SQLEditor/types.js.map +1 -0
  180. package/dist/components/SQLEditor/utils/LinkedToken.js +147 -0
  181. package/dist/components/SQLEditor/utils/LinkedToken.js.map +1 -0
  182. package/dist/components/SQLEditor/utils/commands.js +8 -0
  183. package/dist/components/SQLEditor/utils/commands.js.map +1 -0
  184. package/dist/components/SQLEditor/utils/debugger.js +14 -0
  185. package/dist/components/SQLEditor/utils/debugger.js.map +1 -0
  186. package/dist/components/SQLEditor/utils/getSuggestionKind.js +18 -0
  187. package/dist/components/SQLEditor/utils/getSuggestionKind.js.map +1 -0
  188. package/dist/components/SQLEditor/utils/linkedTokenBuilder.js +46 -0
  189. package/dist/components/SQLEditor/utils/linkedTokenBuilder.js.map +1 -0
  190. package/dist/components/SQLEditor/utils/toCompletionItem.js +10 -0
  191. package/dist/components/SQLEditor/utils/toCompletionItem.js.map +1 -0
  192. package/dist/components/SQLEditor/utils/tokenUtils.js +72 -0
  193. package/dist/components/SQLEditor/utils/tokenUtils.js.map +1 -0
  194. package/dist/components/SQLEditor/utils/types.js +3 -0
  195. package/dist/components/SQLEditor/utils/types.js.map +1 -0
  196. package/dist/components/Segment/Segment.js +2 -1
  197. package/dist/components/Segment/Segment.js.map +1 -1
  198. package/dist/components/VisualQueryBuilder/QueryModellerBase.js +35 -0
  199. package/dist/components/VisualQueryBuilder/QueryModellerBase.js.map +1 -0
  200. package/dist/components/VisualQueryBuilder/components/LabelFilterItem.js +125 -0
  201. package/dist/components/VisualQueryBuilder/components/LabelFilterItem.js.map +1 -0
  202. package/dist/components/VisualQueryBuilder/components/LabelFilters.js +37 -0
  203. package/dist/components/VisualQueryBuilder/components/LabelFilters.js.map +1 -0
  204. package/dist/components/VisualQueryBuilder/components/OperationEditor.js +41 -0
  205. package/dist/components/VisualQueryBuilder/components/OperationEditor.js.map +1 -0
  206. package/dist/components/VisualQueryBuilder/components/OperationEditorBody.js +173 -0
  207. package/dist/components/VisualQueryBuilder/components/OperationEditorBody.js.map +1 -0
  208. package/dist/components/VisualQueryBuilder/components/OperationExplainedBox.js +64 -0
  209. package/dist/components/VisualQueryBuilder/components/OperationExplainedBox.js.map +1 -0
  210. package/dist/components/VisualQueryBuilder/components/OperationHeader.js +67 -0
  211. package/dist/components/VisualQueryBuilder/components/OperationHeader.js.map +1 -0
  212. package/dist/components/VisualQueryBuilder/components/OperationInfoButton.js +71 -0
  213. package/dist/components/VisualQueryBuilder/components/OperationInfoButton.js.map +1 -0
  214. package/dist/components/VisualQueryBuilder/components/OperationList.js +129 -0
  215. package/dist/components/VisualQueryBuilder/components/OperationList.js.map +1 -0
  216. package/dist/components/VisualQueryBuilder/components/OperationListExplained.js +22 -0
  217. package/dist/components/VisualQueryBuilder/components/OperationListExplained.js.map +1 -0
  218. package/dist/components/VisualQueryBuilder/components/OperationParamEditor.js +71 -0
  219. package/dist/components/VisualQueryBuilder/components/OperationParamEditor.js.map +1 -0
  220. package/dist/components/VisualQueryBuilder/components/OperationsEditorRow.js +24 -0
  221. package/dist/components/VisualQueryBuilder/components/OperationsEditorRow.js.map +1 -0
  222. package/dist/components/VisualQueryBuilder/components/QueryBuilderHints.js +54 -0
  223. package/dist/components/VisualQueryBuilder/components/QueryBuilderHints.js.map +1 -0
  224. package/dist/components/VisualQueryBuilder/components/QueryEditorModeToggle.js +17 -0
  225. package/dist/components/VisualQueryBuilder/components/QueryEditorModeToggle.js.map +1 -0
  226. package/dist/components/VisualQueryBuilder/components/QueryHeaderSwitch.js +32 -0
  227. package/dist/components/VisualQueryBuilder/components/QueryHeaderSwitch.js.map +1 -0
  228. package/dist/components/VisualQueryBuilder/components/QueryOptionGroup.js +81 -0
  229. package/dist/components/VisualQueryBuilder/components/QueryOptionGroup.js.map +1 -0
  230. package/dist/components/VisualQueryBuilder/components/RawQuery.js +25 -0
  231. package/dist/components/VisualQueryBuilder/components/RawQuery.js.map +1 -0
  232. package/dist/components/VisualQueryBuilder/index.js +29 -0
  233. package/dist/components/VisualQueryBuilder/index.js.map +1 -0
  234. package/dist/components/VisualQueryBuilder/types.js +10 -0
  235. package/dist/components/VisualQueryBuilder/types.js.map +1 -0
  236. package/dist/components/index.js +2 -0
  237. package/dist/components/index.js.map +1 -1
  238. package/dist/datasource/SqlDatasource.js.map +1 -1
  239. package/dist/hooks/useDebounce.js +2 -0
  240. package/dist/hooks/useDebounce.js.map +1 -1
  241. package/dist/index.js +1 -7
  242. package/dist/index.js.map +1 -1
  243. package/dist/src/components/AsyncButtonCascader/AsyncButtonCascader.d.ts +5 -2
  244. package/dist/src/components/ConfigEditor/AdvancedSettings/AdvancedHttpSettings.d.ts +8 -0
  245. package/dist/src/components/ConfigEditor/AdvancedSettings/index.d.ts +1 -0
  246. package/dist/src/components/ConfigEditor/Auth/Auth.d.ts +18 -0
  247. package/dist/src/components/ConfigEditor/Auth/auth-method/AuthMethodSettings.d.ts +14 -0
  248. package/dist/src/components/ConfigEditor/Auth/auth-method/BasicAuth.d.ts +17 -0
  249. package/dist/src/components/ConfigEditor/Auth/custom-headers/CustomHeader.d.ts +10 -0
  250. package/dist/src/components/ConfigEditor/Auth/custom-headers/CustomHeaders.d.ts +8 -0
  251. package/dist/src/components/ConfigEditor/Auth/index.d.ts +4 -0
  252. package/dist/src/components/ConfigEditor/Auth/styles.d.ts +4 -0
  253. package/dist/src/components/ConfigEditor/Auth/tls/SelfSignedCertificate.d.ts +13 -0
  254. package/dist/src/components/ConfigEditor/Auth/tls/SkipTLSVerification.d.ts +7 -0
  255. package/dist/src/components/ConfigEditor/Auth/tls/TLSClientAuth.d.ts +20 -0
  256. package/dist/src/components/ConfigEditor/Auth/tls/TLSSettings.d.ts +11 -0
  257. package/dist/src/components/ConfigEditor/Auth/tls/TLSSettingsSection.d.ts +9 -0
  258. package/dist/src/components/ConfigEditor/Auth/types.d.ts +28 -0
  259. package/dist/src/components/ConfigEditor/Auth/utils.d.ts +12 -0
  260. package/dist/src/components/ConfigEditor/ConfigSection/ConfigDescriptionLink.d.ts +8 -0
  261. package/dist/src/components/ConfigEditor/ConfigSection/ConfigSection.d.ts +5 -0
  262. package/dist/src/components/ConfigEditor/ConfigSection/ConfigSubSection.d.ts +5 -0
  263. package/dist/src/components/ConfigEditor/ConfigSection/GenericConfigSection.d.ts +10 -0
  264. package/dist/src/components/ConfigEditor/ConfigSection/index.d.ts +3 -0
  265. package/dist/src/components/ConfigEditor/Connection/ConnectionSettings.d.ts +13 -0
  266. package/dist/src/components/ConfigEditor/Connection/index.d.ts +1 -0
  267. package/dist/src/components/ConfigEditor/DataSourceDescription.d.ts +9 -0
  268. package/dist/src/components/ConfigEditor/SecureSocksProxyToggle.d.ts +4 -4
  269. package/dist/src/components/ConfigEditor/index.d.ts +7 -2
  270. package/dist/src/components/ConfigEditor/types.d.ts +3 -0
  271. package/dist/src/components/CustomHeadersSettings/CustomHeadersSettings.d.ts +2 -2
  272. package/dist/src/components/DataLinks/DataLink.d.ts +1 -1
  273. package/dist/src/components/Plugins/PluginSignatureBadge.d.ts +5 -2
  274. package/dist/src/components/QueryEditor/AccessoryButton.d.ts +2 -2
  275. package/dist/src/components/QueryEditor/DatasetSelector.d.ts +2 -2
  276. package/dist/src/components/QueryEditor/EditorField.d.ts +2 -1
  277. package/dist/src/components/QueryEditor/EditorFieldGroup.d.ts +2 -1
  278. package/dist/src/components/QueryEditor/EditorHeader.d.ts +2 -1
  279. package/dist/src/components/QueryEditor/EditorList.d.ts +1 -1
  280. package/dist/src/components/QueryEditor/EditorRow.d.ts +2 -1
  281. package/dist/src/components/QueryEditor/EditorRows.d.ts +2 -1
  282. package/dist/src/components/QueryEditor/EditorStack.d.ts +13 -0
  283. package/dist/src/components/QueryEditor/EditorSwitch.d.ts +2 -2
  284. package/dist/src/components/QueryEditor/FlexItem.d.ts +2 -2
  285. package/dist/src/components/QueryEditor/InputGroup.d.ts +7 -2
  286. package/dist/src/components/QueryEditor/RunQueryButton.d.ts +3 -3
  287. package/dist/src/components/QueryEditor/TableSelector.d.ts +2 -2
  288. package/dist/src/components/QueryEditor/index.d.ts +1 -1
  289. package/dist/src/components/QueryEditor/query-editor-raw/QueryEditorRaw.d.ts +1 -1
  290. package/dist/src/components/QueryEditor/types.d.ts +9 -14
  291. package/dist/src/components/QueryEditor/visual-query-builder/EditorField.d.ts +1 -1
  292. package/dist/src/components/QueryEditor/visual-query-builder/EditorRow.d.ts +2 -1
  293. package/dist/src/components/QueryEditor/visual-query-builder/EditorRows.d.ts +2 -1
  294. package/dist/src/components/QueryEditor/visual-query-builder/VisualEditor.d.ts +3 -4
  295. package/dist/src/components/SQLEditor/components/SQLEditor.d.ts +29 -0
  296. package/dist/src/components/SQLEditor/index.d.ts +7 -0
  297. package/dist/src/components/SQLEditor/mocks/Monaco.d.ts +3 -0
  298. package/dist/src/components/SQLEditor/mocks/TextModel.d.ts +7 -0
  299. package/dist/src/components/SQLEditor/mocks/queries/multiLineFullQuery.d.ts +2 -0
  300. package/dist/src/components/SQLEditor/mocks/queries/multiLineFullQueryWithAggregation.d.ts +2 -0
  301. package/dist/src/components/SQLEditor/mocks/queries/multiLineMultipleColumns.d.ts +2 -0
  302. package/dist/src/components/SQLEditor/mocks/queries/singleLineEmptyQuery.d.ts +2 -0
  303. package/dist/src/components/SQLEditor/mocks/queries/singleLineFullQuery.d.ts +2 -0
  304. package/dist/src/components/SQLEditor/mocks/queries/singleLineFullQueryWithAggregation.d.ts +2 -0
  305. package/dist/src/components/SQLEditor/mocks/queries/singleLineMultipleColumns.d.ts +2 -0
  306. package/dist/src/components/SQLEditor/mocks/queries/singleLineTwoQueries.d.ts +2 -0
  307. package/dist/src/components/SQLEditor/mocks/queries/singleLineTwoQueriesWithAggregation.d.ts +2 -0
  308. package/dist/src/components/SQLEditor/mocks/testData.d.ts +9 -0
  309. package/dist/src/components/SQLEditor/standardSql/definition.d.ts +3 -0
  310. package/dist/src/components/SQLEditor/standardSql/getStandardSuggestions.d.ts +6 -0
  311. package/dist/src/components/SQLEditor/standardSql/getStatementPosition.d.ts +5 -0
  312. package/dist/src/components/SQLEditor/standardSql/language.d.ts +23 -0
  313. package/dist/src/components/SQLEditor/standardSql/macros.d.ts +2 -0
  314. package/dist/src/components/SQLEditor/standardSql/standardSQLCompletionItemProvider.d.ts +4 -0
  315. package/dist/src/components/SQLEditor/standardSql/standardSuggestionsRegistry.d.ts +7 -0
  316. package/dist/src/components/SQLEditor/standardSql/statementPositionResolversRegistry.d.ts +2 -0
  317. package/dist/src/components/SQLEditor/standardSql/suggestionsKindRegistry.d.ts +7 -0
  318. package/dist/src/components/SQLEditor/standardSql/types.d.ts +33 -0
  319. package/dist/src/components/SQLEditor/test-utils/index.d.ts +7 -0
  320. package/dist/src/components/SQLEditor/test-utils/statementPosition.d.ts +3 -0
  321. package/dist/src/components/SQLEditor/test-utils/types.d.ts +12 -0
  322. package/dist/src/components/SQLEditor/types.d.ts +249 -0
  323. package/dist/src/components/SQLEditor/utils/LinkedToken.d.ts +29 -0
  324. package/dist/src/components/SQLEditor/utils/commands.d.ts +4 -0
  325. package/dist/src/components/SQLEditor/utils/debugger.d.ts +5 -0
  326. package/dist/src/components/SQLEditor/utils/getSuggestionKind.d.ts +7 -0
  327. package/dist/src/components/SQLEditor/utils/linkedTokenBuilder.d.ts +4 -0
  328. package/dist/src/components/SQLEditor/utils/toCompletionItem.d.ts +2 -0
  329. package/dist/src/components/SQLEditor/utils/tokenUtils.d.ts +14 -0
  330. package/dist/src/components/SQLEditor/utils/types.d.ts +11 -0
  331. package/dist/src/components/VisualQueryBuilder/QueryModellerBase.d.ts +18 -0
  332. package/dist/src/components/VisualQueryBuilder/components/LabelFilterItem.d.ts +18 -0
  333. package/dist/src/components/VisualQueryBuilder/components/LabelFilters.d.ts +14 -0
  334. package/dist/src/components/VisualQueryBuilder/components/OperationEditor.d.ts +19 -0
  335. package/dist/src/components/VisualQueryBuilder/components/OperationEditorBody.d.ts +22 -0
  336. package/dist/src/components/VisualQueryBuilder/components/OperationExplainedBox.d.ts +7 -0
  337. package/dist/src/components/VisualQueryBuilder/components/OperationHeader.d.ts +14 -0
  338. package/dist/src/components/VisualQueryBuilder/components/OperationInfoButton.d.ts +9 -0
  339. package/dist/src/components/VisualQueryBuilder/components/OperationList.d.ts +15 -0
  340. package/dist/src/components/VisualQueryBuilder/components/OperationListExplained.d.ts +17 -0
  341. package/dist/src/components/VisualQueryBuilder/components/OperationParamEditor.d.ts +4 -0
  342. package/dist/src/components/VisualQueryBuilder/components/OperationsEditorRow.d.ts +2 -0
  343. package/dist/src/components/VisualQueryBuilder/components/QueryBuilderHints.d.ts +20 -0
  344. package/dist/src/components/VisualQueryBuilder/components/QueryEditorModeToggle.d.ts +8 -0
  345. package/dist/src/components/VisualQueryBuilder/components/QueryHeaderSwitch.d.ts +7 -0
  346. package/dist/src/components/VisualQueryBuilder/components/QueryOptionGroup.d.ts +9 -0
  347. package/dist/src/components/VisualQueryBuilder/components/RawQuery.d.ts +12 -0
  348. package/dist/src/components/VisualQueryBuilder/index.d.ts +13 -0
  349. package/dist/src/components/VisualQueryBuilder/types.d.ts +89 -0
  350. package/dist/src/components/index.d.ts +5 -3
  351. package/dist/src/datasource/SqlDatasource.d.ts +3 -6
  352. package/dist/src/index.d.ts +0 -4
  353. package/dist/src/utils/changeset/functions.d.ts +1 -1
  354. package/dist/test/mocks/Datasource.js +1 -1
  355. package/dist/test/mocks/Datasource.js.map +1 -1
  356. package/dist/test/mocks/Plugin.js +2 -11
  357. package/dist/test/mocks/Plugin.js.map +1 -1
  358. package/dist/test/mocks/QueryEditorProps.js +0 -1
  359. package/dist/test/mocks/QueryEditorProps.js.map +1 -1
  360. package/dist/test/mocks/utils.js.map +1 -1
  361. package/dist/utils/changeset/functions.js +1 -1
  362. package/dist/utils/changeset/functions.js.map +1 -1
  363. package/dist/utils/changeset/index.js +20 -20
  364. package/dist/utils/changeset/index.js.map +1 -1
  365. package/package.json +41 -14
  366. package/CHANGELOG.md +0 -25
  367. package/dist/8x/fixtures/index.js +0 -7
  368. package/dist/8x/fixtures/index.js.map +0 -1
  369. package/dist/8x/fixtures/select.js +0 -43
  370. package/dist/8x/fixtures/select.js.map +0 -1
  371. package/dist/8x/index.js +0 -5
  372. package/dist/8x/index.js.map +0 -1
  373. package/dist/components/ConfigEditor/InlineLabel.js +0 -24
  374. package/dist/components/ConfigEditor/InlineLabel.js.map +0 -1
  375. package/dist/components/QueryEditor/ErrorBoundary.js +0 -23
  376. package/dist/components/QueryEditor/ErrorBoundary.js.map +0 -1
  377. package/dist/components/QueryEditor/Stack.js +0 -27
  378. package/dist/components/QueryEditor/Stack.js.map +0 -1
  379. package/dist/components/QueryEditor/visual-query-builder/Stack.js +0 -27
  380. package/dist/components/QueryEditor/visual-query-builder/Stack.js.map +0 -1
  381. package/dist/src/8x/fixtures/index.d.ts +0 -1
  382. package/dist/src/8x/fixtures/select.d.ts +0 -11
  383. package/dist/src/8x/index.d.ts +0 -1
  384. package/dist/src/components/ConfigEditor/InlineLabel.d.ts +0 -7
  385. package/dist/src/components/QueryEditor/ErrorBoundary.d.ts +0 -14
  386. package/dist/src/components/QueryEditor/Stack.d.ts +0 -9
  387. package/dist/src/components/QueryEditor/visual-query-builder/Stack.d.ts +0 -9
  388. package/dist/src/test/mocks/TestDatasource.d.ts +0 -6
  389. package/dist/src/test/mocks/style.d.ts +0 -1
  390. package/dist/src/test/setupTests.d.ts +0 -1
  391. package/dist/src/unreleasedComponents/SecretInput.d.ts +0 -15
  392. package/dist/src/unreleasedComponents/SecretTextarea.d.ts +0 -19
  393. package/dist/src/unreleasedComponents/index.d.ts +0 -2
  394. package/dist/src/utils/compatFeatures.d.ts +0 -9
  395. package/dist/src/utils/compatibility.d.ts +0 -13
  396. package/dist/src/utils/index.d.ts +0 -3
  397. package/dist/src/utils/testDatasource.d.ts +0 -19
  398. package/dist/test/mocks/TestDatasource.js +0 -24
  399. package/dist/test/mocks/TestDatasource.js.map +0 -1
  400. package/dist/test/mocks/style.js +0 -5
  401. package/dist/test/mocks/style.js.map +0 -1
  402. package/dist/test/setupTests.js +0 -17
  403. package/dist/test/setupTests.js.map +0 -1
  404. package/dist/unreleasedComponents/SecretInput.js +0 -21
  405. package/dist/unreleasedComponents/SecretInput.js.map +0 -1
  406. package/dist/unreleasedComponents/SecretTextarea.js +0 -36
  407. package/dist/unreleasedComponents/SecretTextarea.js.map +0 -1
  408. package/dist/unreleasedComponents/index.js +0 -9
  409. package/dist/unreleasedComponents/index.js.map +0 -1
  410. package/dist/utils/compatFeatures.js +0 -20
  411. package/dist/utils/compatFeatures.js.map +0 -1
  412. package/dist/utils/compatibility.js +0 -31
  413. package/dist/utils/compatibility.js.map +0 -1
  414. package/dist/utils/index.js +0 -8
  415. package/dist/utils/index.js.map +0 -1
  416. package/dist/utils/testDatasource.js +0 -30
  417. package/dist/utils/testDatasource.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  interface FlexItemProps {
3
3
  grow?: number;
4
4
  shrink?: number;
5
5
  }
6
- export declare const FlexItem: React.FC<FlexItemProps>;
6
+ export declare const FlexItem: ({ grow, shrink }: FlexItemProps) => JSX.Element;
7
7
  export {};
@@ -1,5 +1,10 @@
1
- import React from 'react';
1
+ import { ReactElement } from 'react';
2
+ type Child = string | undefined | ReactElement<{
3
+ className?: string;
4
+ invalid?: unknown;
5
+ }>;
2
6
  interface InputGroupProps {
7
+ children: Child | Child[];
3
8
  }
4
- export declare const InputGroup: React.FC<InputGroupProps>;
9
+ export declare const InputGroup: ({ children }: InputGroupProps) => JSX.Element;
5
10
  export {};
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { PopoverContent } from "@grafana/ui";
1
+ /// <reference types="react" />
2
+ import { PopoverContent } from '@grafana/ui';
3
3
  type RunQueryButtonProps = {
4
4
  ariaLabel?: string;
5
5
  queryInvalid?: boolean;
@@ -9,5 +9,5 @@ type RunQueryButtonProps = {
9
9
  onClick: () => void;
10
10
  dataTestId?: string;
11
11
  };
12
- export declare const RunQueryButton: React.FC<RunQueryButtonProps>;
12
+ export declare const RunQueryButton: ({ ariaLabel, queryRunning, queryInvalid, invalidQueryTooltip, disabled, onClick, dataTestId, }: RunQueryButtonProps) => JSX.Element;
13
13
  export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { SelectableValue } from '@grafana/data';
3
3
  import { DB, ResourceSelectorProps } from './types';
4
4
  import { QueryWithDefaults } from './defaults';
@@ -9,5 +9,5 @@ interface TableSelectorProps extends ResourceSelectorProps {
9
9
  query: QueryWithDefaults;
10
10
  onChange: (v: SelectableValue) => void;
11
11
  }
12
- export declare const TableSelector: React.FC<TableSelectorProps>;
12
+ export declare const TableSelector: ({ db, dataset, value, className, onChange }: TableSelectorProps) => JSX.Element;
13
13
  export {};
@@ -8,7 +8,7 @@ export { EditorList } from './EditorList';
8
8
  export { EditorRows } from './EditorRows';
9
9
  export { EditorSwitch } from './EditorSwitch';
10
10
  export { FlexItem } from './FlexItem';
11
- export { Stack } from './Stack';
11
+ export { EditorStack } from './EditorStack';
12
12
  export { InlineSelect } from './InlineSelect';
13
13
  export { InputGroup } from './InputGroup';
14
14
  export { Space } from './Space';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { LanguageCompletionProvider } from '@grafana/experimental';
3
2
  import { SQLQuery } from '../types';
3
+ import { LanguageCompletionProvider } from '../../SQLEditor';
4
4
  type Props = {
5
5
  query: SQLQuery;
6
6
  onChange: (value: SQLQuery, processQuery: boolean) => void;
@@ -1,9 +1,9 @@
1
- import { JsonTree } from "react-awesome-query-builder";
2
- import { DataFrame, DataSourceJsonData, MetricFindValue, SelectableValue, TimeRange } from "@grafana/data";
3
- import { DataQuery } from "@grafana/schema";
4
- import { QueryWithDefaults } from "./defaults";
5
- import { QueryEditorFunctionExpression, QueryEditorGroupByExpression, QueryEditorPropertyExpression } from "./expressions";
6
- import { CompletionItemKind, LanguageCompletionProvider } from "@grafana/experimental";
1
+ import { JsonTree } from 'react-awesome-query-builder';
2
+ import { DataFrame, DataSourceJsonData, MetricFindValue, SelectableValue, TimeRange } from '@grafana/data';
3
+ import { DataQuery } from '@grafana/schema';
4
+ import { QueryWithDefaults } from './defaults';
5
+ import { QueryEditorFunctionExpression, QueryEditorGroupByExpression, QueryEditorPropertyExpression } from './expressions';
6
+ import { CompletionItemKind, LanguageCompletionProvider } from '../SQLEditor';
7
7
  export interface SqlQueryForInterpolation {
8
8
  dataset?: string;
9
9
  alias?: string;
@@ -60,7 +60,7 @@ export interface SQLExpression {
60
60
  filters?: SQLFilters;
61
61
  groupBy?: QueryEditorGroupByExpression[];
62
62
  orderBy?: QueryEditorPropertyExpression;
63
- orderByDirection?: "ASC" | "DESC";
63
+ orderByDirection?: 'ASC' | 'DESC';
64
64
  limit?: number;
65
65
  offset?: number;
66
66
  }
@@ -91,7 +91,7 @@ export interface ResourceSelectorProps {
91
91
  className?: string;
92
92
  applyDefault?: boolean;
93
93
  }
94
- export type RAQBFieldTypes = "text" | "number" | "boolean" | "datetime" | "date" | "time";
94
+ export type RAQBFieldTypes = 'text' | 'number' | 'boolean' | 'datetime' | 'date' | 'time';
95
95
  export interface SQLSelectableValue extends SelectableValue {
96
96
  type?: string;
97
97
  raqbFieldType?: RAQBFieldTypes;
@@ -116,7 +116,7 @@ export interface DB {
116
116
  getSqlCompletionProvider: () => LanguageCompletionProvider;
117
117
  toRawSql?: (query: SQLQuery) => string;
118
118
  functions: () => Promise<Aggregate[]>;
119
- labels?: Map<"dataset", string>;
119
+ labels?: Map<'dataset', string>;
120
120
  disableDatasets?: boolean;
121
121
  }
122
122
  export interface QueryEditorProps {
@@ -147,8 +147,3 @@ export interface MetaDefinition {
147
147
  completion?: string;
148
148
  kind: CompletionItemKind;
149
149
  }
150
- export interface SQLConnectionLimits {
151
- maxOpenConns: number;
152
- maxIdleConns: number;
153
- connMaxLifetime: number;
154
- }
@@ -7,5 +7,5 @@ interface EditorFieldProps extends ComponentProps<typeof Field> {
7
7
  optional?: boolean;
8
8
  tooltip?: PopoverContent;
9
9
  }
10
- export declare const EditorField: React.FC<EditorFieldProps>;
10
+ export declare const EditorField: (props: EditorFieldProps) => JSX.Element;
11
11
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorRowProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorRow: React.FC<EditorRowProps>;
5
+ export declare const EditorRow: ({ children }: EditorRowProps) => JSX.Element;
5
6
  export {};
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  interface EditorRowsProps {
3
+ children?: React.ReactNode;
3
4
  }
4
- export declare const EditorRows: React.FC<EditorRowsProps>;
5
+ export declare const EditorRows: ({ children }: EditorRowsProps) => JSX.Element;
5
6
  export {};
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { DB, QueryEditorProps, QueryRowFilter } from '../types';
3
- import { SQLQuery } from '../types';
1
+ /// <reference types="react" />
2
+ import { DB, QueryEditorProps, QueryRowFilter, SQLQuery } from '../types';
4
3
  import { TimeRange } from '@grafana/data';
5
4
  interface VisualEditorProps extends QueryEditorProps {
6
5
  query: SQLQuery;
@@ -10,5 +9,5 @@ interface VisualEditorProps extends QueryEditorProps {
10
9
  onValidate: (isValid: boolean) => void;
11
10
  range?: TimeRange;
12
11
  }
13
- export declare const VisualEditor: React.FC<VisualEditorProps>;
12
+ export declare const VisualEditor: ({ query, db, queryRowFilter, onChange, onValidate, range }: VisualEditorProps) => JSX.Element;
14
13
  export {};
@@ -0,0 +1,29 @@
1
+ import { Monaco, monacoTypes } from '@grafana/ui';
2
+ import React from 'react';
3
+ import { SQLCompletionItemProvider } from '../types';
4
+ import { SQLMonarchLanguage } from '../standardSql/types';
5
+ export interface LanguageDefinition extends monacoTypes.languages.ILanguageExtensionPoint {
6
+ loader?: (module: any) => Promise<{
7
+ language: SQLMonarchLanguage;
8
+ conf: monacoTypes.languages.LanguageConfiguration;
9
+ }>;
10
+ completionProvider?: (m: Monaco, language: SQLMonarchLanguage) => SQLCompletionItemProvider;
11
+ formatter?: (q: string) => string;
12
+ }
13
+ interface SQLEditorProps {
14
+ query: string;
15
+ /**
16
+ * Use for inspecting the query as it changes. I.e. for validation.
17
+ */
18
+ onChange?: (q: string, processQuery: boolean) => void;
19
+ onBlur?: (text: string) => void;
20
+ language?: LanguageDefinition;
21
+ children?: (props: {
22
+ formatQuery: () => void;
23
+ }) => React.ReactNode;
24
+ width?: number;
25
+ height?: number;
26
+ }
27
+ export declare const SQLEditor: ({ children, onBlur, onChange, query, language, width, height, }: SQLEditorProps) => JSX.Element;
28
+ export declare const registerLanguageAndSuggestions: (monaco: Monaco, l: LanguageDefinition, lid: string) => Promise<void>;
29
+ export {};
@@ -0,0 +1,7 @@
1
+ export { SQLEditor, type LanguageDefinition } from './components/SQLEditor';
2
+ export { SQLEditorTestUtils, type TestQueryModel } from './test-utils';
3
+ export { LinkedToken } from './utils/LinkedToken';
4
+ export { language as grafanaStandardSQLLanguage, conf as grafanaStandardSQLLanguageConf } from './standardSql/language';
5
+ export { getStandardSQLCompletionProvider } from './standardSql/standardSQLCompletionItemProvider';
6
+ export type { SQLMonarchLanguage } from './standardSql/types';
7
+ export { type SchemaDefinition, type TableDefinition, type ColumnDefinition, type TableIdentifier, type StatementPlacementProvider, type SuggestionKindProvider, type LanguageCompletionProvider, OperatorType, MacroType, TokenType, StatementPosition, SuggestionKind, CompletionItemKind, CompletionItemPriority, CompletionItemInsertTextRule, type PositionContext, SQLEditorMode, } from './types';
@@ -0,0 +1,3 @@
1
+ import { monacoTypes } from '@grafana/ui';
2
+ declare const getMonacoMock: (testData: Map<string, Array<Array<Pick<monacoTypes.Token, 'language' | 'offset' | 'type'>>>>) => any;
3
+ export { getMonacoMock };
@@ -0,0 +1,7 @@
1
+ import { monacoTypes } from '@grafana/ui';
2
+ declare function TextModel(value: string): {
3
+ getValue: (eol?: monacoTypes.editor.EndOfLinePreference, preserveBOM?: boolean) => string;
4
+ getValueInRange: (range: monacoTypes.IRange, eol?: monacoTypes.editor.EndOfLinePreference) => string;
5
+ getLineLength: (lineNumber: number) => number;
6
+ };
7
+ export { TextModel };
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const multiLineFullQuery: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const multiLineFullQueryWithAggregation: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const multiLineMultipleColumns: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const singleLineEmptyQuery: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const singleLineFullQuery: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const singleLineFullQueryWithAggregation: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const singleLineMultipleColumns: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const singleLineTwoQueries: TestQueryModel;
@@ -0,0 +1,2 @@
1
+ import { TestQueryModel } from '../../test-utils/types';
2
+ export declare const singleLineTwoQueriesWithAggregation: TestQueryModel;
@@ -0,0 +1,9 @@
1
+ export { singleLineFullQuery } from './queries/singleLineFullQuery';
2
+ export { singleLineFullQueryWithAggregation } from './queries/singleLineFullQueryWithAggregation';
3
+ export { multiLineFullQuery } from './queries/multiLineFullQuery';
4
+ export { multiLineFullQueryWithAggregation } from './queries/multiLineFullQueryWithAggregation';
5
+ export { singleLineEmptyQuery } from './queries/singleLineEmptyQuery';
6
+ export { singleLineTwoQueries } from './queries/singleLineTwoQueries';
7
+ export { singleLineTwoQueriesWithAggregation } from './queries/singleLineTwoQueriesWithAggregation';
8
+ export { singleLineMultipleColumns } from './queries/singleLineMultipleColumns';
9
+ export { multiLineMultipleColumns } from './queries/multiLineMultipleColumns';
@@ -0,0 +1,3 @@
1
+ import { LanguageDefinition } from '../components/SQLEditor';
2
+ declare const standardSQLLanguageDefinition: LanguageDefinition;
3
+ export default standardSQLLanguageDefinition;
@@ -0,0 +1,6 @@
1
+ import { Registry } from '@grafana/data';
2
+ import { Monaco, monacoTypes } from '@grafana/ui';
3
+ import { PositionContext, SuggestionKind } from '../types';
4
+ import { LinkedToken } from '../utils/LinkedToken';
5
+ import { SuggestionsRegistryItem } from './types';
6
+ export declare const getStandardSuggestions: (monaco: Monaco, currentToken: LinkedToken | null, suggestionKinds: SuggestionKind[], positionContext: PositionContext, suggestionsRegistry: Registry<SuggestionsRegistryItem>) => Promise<monacoTypes.languages.CompletionItem[]>;
@@ -0,0 +1,5 @@
1
+ import { StatementPosition } from '../types';
2
+ import { LinkedToken } from '../utils/LinkedToken';
3
+ import { StatementPositionResolversRegistryItem } from './types';
4
+ import { Registry } from '@grafana/data';
5
+ export declare function getStatementPosition(currentToken: LinkedToken | null, statementPositionResolversRegistry: Registry<StatementPositionResolversRegistryItem>): StatementPosition[];
@@ -0,0 +1,23 @@
1
+ import { monacoTypes } from '@grafana/ui';
2
+ import { SQLMonarchLanguage } from './types';
3
+ export declare const SELECT = "select";
4
+ export declare const FROM = "from";
5
+ export declare const WHERE = "where";
6
+ export declare const GROUP = "group";
7
+ export declare const ORDER = "order";
8
+ export declare const BY = "by";
9
+ export declare const DESC = "desc";
10
+ export declare const ASC = "asc";
11
+ export declare const LIMIT = "limit";
12
+ export declare const WITH = "with";
13
+ export declare const AS = "as";
14
+ export declare const SCHEMA = "schema";
15
+ export declare const AND = "AND";
16
+ export declare const OR = "OR";
17
+ export declare const LOGICAL_OPERATORS: string[];
18
+ export declare const EQUALS = "=";
19
+ export declare const NOT_EQUALS = "!=";
20
+ export declare const COMPARISON_OPERATORS: string[];
21
+ export declare const STD_OPERATORS: string[];
22
+ export declare const conf: monacoTypes.languages.LanguageConfiguration;
23
+ export declare const language: SQLMonarchLanguage;
@@ -0,0 +1,2 @@
1
+ import { MacrosRegistryItem } from './types';
2
+ export declare const MACROS: MacrosRegistryItem[];
@@ -0,0 +1,4 @@
1
+ import { Monaco } from '@grafana/ui';
2
+ import { SQLCompletionItemProvider } from '../types';
3
+ import { SQLMonarchLanguage } from './types';
4
+ export declare function getStandardSQLCompletionProvider(monaco: Monaco, language: SQLMonarchLanguage): SQLCompletionItemProvider;
@@ -0,0 +1,7 @@
1
+ import { Registry } from '@grafana/data';
2
+ import { FunctionsRegistryItem, MacrosRegistryItem, OperatorsRegistryItem, SuggestionsRegistryItem } from './types';
3
+ /**
4
+ * This registry glues particular SuggestionKind with an async function that provides completion items for it.
5
+ * To add a new suggestion kind, SQLEditor should be configured with a provider that implements customSuggestionKinds.
6
+ */
7
+ export declare const initStandardSuggestions: (functions: Registry<FunctionsRegistryItem>, operators: Registry<OperatorsRegistryItem>, macros: Registry<MacrosRegistryItem>) => () => SuggestionsRegistryItem[];
@@ -0,0 +1,2 @@
1
+ import { StatementPositionResolversRegistryItem } from './types';
2
+ export declare function initStatementPositionResolvers(): StatementPositionResolversRegistryItem[];
@@ -0,0 +1,7 @@
1
+ import { RegistryItem } from '@grafana/data';
2
+ import { StatementPosition, SuggestionKind } from '../types';
3
+ export interface SuggestionKindRegistryItem extends RegistryItem {
4
+ id: StatementPosition;
5
+ kind: SuggestionKind[];
6
+ }
7
+ export declare const initSuggestionsKindRegistry: () => SuggestionKindRegistryItem[];
@@ -0,0 +1,33 @@
1
+ import { RegistryItem } from '@grafana/data';
2
+ import { monacoTypes } from '@grafana/ui';
3
+ import { CustomSuggestion, MacroType, OperatorType, PositionContext, StatementPosition, SuggestionKind } from '../types';
4
+ import { LinkedToken } from '../utils/LinkedToken';
5
+ export interface SuggestionsRegistryItem extends RegistryItem {
6
+ id: SuggestionKind;
7
+ suggestions: (position: PositionContext, m: typeof monacoTypes) => Promise<CustomSuggestion[]>;
8
+ }
9
+ export interface MacrosRegistryItem extends RegistryItem {
10
+ type: MacroType;
11
+ text: string;
12
+ args: string[];
13
+ }
14
+ export interface FunctionsRegistryItem extends RegistryItem {
15
+ }
16
+ export interface OperatorsRegistryItem extends RegistryItem {
17
+ operator: string;
18
+ type: OperatorType;
19
+ }
20
+ export type StatementPositionResolver = (currentToken: LinkedToken | null, previousKeyword: LinkedToken | null, previousNonWhiteSpace: LinkedToken | null, previousIsSlash: Boolean) => Boolean;
21
+ export interface StatementPositionResolversRegistryItem extends RegistryItem {
22
+ id: StatementPosition;
23
+ resolve: StatementPositionResolver;
24
+ }
25
+ export type SuggestionsResolver = <T extends PositionContext = PositionContext>(positionContext: T) => Promise<CustomSuggestion[]>;
26
+ export interface SQLMonarchLanguage extends monacoTypes.languages.IMonarchLanguage {
27
+ keywords?: string[];
28
+ builtinFunctions?: string[];
29
+ logicalOperators?: string[];
30
+ comparisonOperators?: string[];
31
+ /** Used by basic languages in the monaco registry **/
32
+ operators?: string[];
33
+ }
@@ -0,0 +1,7 @@
1
+ import * as testData from '../mocks/testData';
2
+ import { TestQueryModel } from './types';
3
+ export declare const SQLEditorTestUtils: {
4
+ testData: typeof testData;
5
+ testStatementPosition: (expected: string, cases: import("./types").StatementPositionResolverTestCase[], resolvers: () => import("../types").CustomStatementPlacement[]) => void;
6
+ };
7
+ export type { TestQueryModel };
@@ -0,0 +1,3 @@
1
+ import { CustomStatementPlacement, StatementPosition } from '../types';
2
+ import { StatementPositionResolverTestCase } from './types';
3
+ export declare const testStatementPosition: (expected: StatementPosition | string, cases: StatementPositionResolverTestCase[], resolvers: () => CustomStatementPlacement[]) => void;
@@ -0,0 +1,12 @@
1
+ import { monacoTypes } from '@grafana/ui';
2
+ export interface TestQueryModel {
3
+ query: string;
4
+ tokens: Array<Array<Pick<monacoTypes.Token, 'language' | 'offset' | 'type'>>>;
5
+ }
6
+ export interface StatementPositionResolverTestCase {
7
+ query: TestQueryModel;
8
+ position: {
9
+ line: number;
10
+ column: number;
11
+ };
12
+ }