@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.
- package/README.md +3 -34
- package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js +4 -5
- package/dist/components/AsyncButtonCascader/AsyncButtonCascader.js.map +1 -1
- package/dist/components/ConfigEditor/AdvancedSettings/AdvancedHttpSettings.js +28 -0
- package/dist/components/ConfigEditor/AdvancedSettings/AdvancedHttpSettings.js.map +1 -0
- package/dist/components/ConfigEditor/AdvancedSettings/index.js +6 -0
- package/dist/components/ConfigEditor/AdvancedSettings/index.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/Auth.js +24 -0
- package/dist/components/ConfigEditor/Auth/Auth.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/auth-method/AuthMethodSettings.js +109 -0
- package/dist/components/ConfigEditor/Auth/auth-method/AuthMethodSettings.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/auth-method/BasicAuth.js +23 -0
- package/dist/components/ConfigEditor/Auth/auth-method/BasicAuth.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeader.js +41 -0
- package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeader.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeaders.js +76 -0
- package/dist/components/ConfigEditor/Auth/custom-headers/CustomHeaders.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/index.js +10 -0
- package/dist/components/ConfigEditor/Auth/index.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/styles.js +19 -0
- package/dist/components/ConfigEditor/Auth/styles.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/tls/SelfSignedCertificate.js +18 -0
- package/dist/components/ConfigEditor/Auth/tls/SelfSignedCertificate.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/tls/SkipTLSVerification.js +11 -0
- package/dist/components/ConfigEditor/Auth/tls/SkipTLSVerification.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/tls/TLSClientAuth.js +22 -0
- package/dist/components/ConfigEditor/Auth/tls/TLSClientAuth.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/tls/TLSSettings.js +25 -0
- package/dist/components/ConfigEditor/Auth/tls/TLSSettings.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/tls/TLSSettingsSection.js +35 -0
- package/dist/components/ConfigEditor/Auth/tls/TLSSettingsSection.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/types.js +11 -0
- package/dist/components/ConfigEditor/Auth/types.js.map +1 -0
- package/dist/components/ConfigEditor/Auth/utils.js +112 -0
- package/dist/components/ConfigEditor/Auth/utils.js.map +1 -0
- package/dist/components/ConfigEditor/ConfigSection/ConfigDescriptionLink.js +32 -0
- package/dist/components/ConfigEditor/ConfigSection/ConfigDescriptionLink.js.map +1 -0
- package/dist/components/ConfigEditor/ConfigSection/ConfigSection.js +12 -0
- package/dist/components/ConfigEditor/ConfigSection/ConfigSection.js.map +1 -0
- package/dist/components/ConfigEditor/ConfigSection/ConfigSubSection.js +12 -0
- package/dist/components/ConfigEditor/ConfigSection/ConfigSubSection.js.map +1 -0
- package/dist/components/ConfigEditor/ConfigSection/GenericConfigSection.js +40 -0
- package/dist/components/ConfigEditor/ConfigSection/GenericConfigSection.js.map +1 -0
- package/dist/components/ConfigEditor/ConfigSection/index.js +10 -0
- package/dist/components/ConfigEditor/ConfigSection/index.js.map +1 -0
- package/dist/components/ConfigEditor/Connection/ConnectionSettings.js +25 -0
- package/dist/components/ConfigEditor/Connection/ConnectionSettings.js.map +1 -0
- package/dist/components/ConfigEditor/Connection/index.js +6 -0
- package/dist/components/ConfigEditor/Connection/index.js.map +1 -0
- package/dist/components/ConfigEditor/DataSourceDescription.js +39 -0
- package/dist/components/ConfigEditor/DataSourceDescription.js.map +1 -0
- package/dist/components/ConfigEditor/SecureSocksProxyToggle.js +8 -13
- package/dist/components/ConfigEditor/SecureSocksProxyToggle.js.map +1 -1
- package/dist/components/ConfigEditor/index.js +15 -3
- package/dist/components/ConfigEditor/index.js.map +1 -1
- package/dist/components/ConfigEditor/types.js +3 -0
- package/dist/components/ConfigEditor/types.js.map +1 -0
- package/dist/components/CustomHeadersSettings/CustomHeadersSettings.js +12 -17
- package/dist/components/CustomHeadersSettings/CustomHeadersSettings.js.map +1 -1
- package/dist/components/DataLinks/DataLink.js +3 -3
- package/dist/components/DataLinks/DataLink.js.map +1 -1
- package/dist/components/DataLinks/DataLinks.js +6 -9
- package/dist/components/DataLinks/DataLinks.js.map +1 -1
- package/dist/components/DataLinks/index.js.map +1 -1
- package/dist/components/DataSourcePicker/DataSourcePicker.js +4 -6
- package/dist/components/DataSourcePicker/DataSourcePicker.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +5 -3
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DatePicker/styles.js +8 -10
- package/dist/components/DatePicker/styles.js.map +1 -1
- package/dist/components/DatePickerWithInput/DatePickerWithInput.js +1 -1
- package/dist/components/DatePickerWithInput/DatePickerWithInput.js.map +1 -1
- package/dist/components/DebounceInput/DebounceInput.js +3 -1
- package/dist/components/DebounceInput/DebounceInput.js.map +1 -1
- package/dist/components/Plugins/PluginSignatureBadge.js.map +1 -1
- package/dist/components/QueryEditor/AccessoryButton.js +3 -4
- package/dist/components/QueryEditor/AccessoryButton.js.map +1 -1
- package/dist/components/QueryEditor/DatasetSelector.js.map +1 -1
- package/dist/components/QueryEditor/EditorField.js +7 -9
- package/dist/components/QueryEditor/EditorField.js.map +1 -1
- package/dist/components/QueryEditor/EditorFieldGroup.js +2 -2
- package/dist/components/QueryEditor/EditorFieldGroup.js.map +1 -1
- package/dist/components/QueryEditor/EditorHeader.js +3 -4
- package/dist/components/QueryEditor/EditorHeader.js.map +1 -1
- package/dist/components/QueryEditor/EditorList.js +5 -6
- package/dist/components/QueryEditor/EditorList.js.map +1 -1
- package/dist/components/QueryEditor/EditorRow.js +3 -3
- package/dist/components/QueryEditor/EditorRow.js.map +1 -1
- package/dist/components/QueryEditor/EditorRows.js +2 -2
- package/dist/components/QueryEditor/EditorRows.js.map +1 -1
- package/dist/components/QueryEditor/EditorStack.js +13 -0
- package/dist/components/QueryEditor/EditorStack.js.map +1 -0
- package/dist/components/QueryEditor/EditorSwitch.js.map +1 -1
- package/dist/components/QueryEditor/FlexItem.js.map +1 -1
- package/dist/components/QueryEditor/InlineSelect.js +5 -8
- package/dist/components/QueryEditor/InlineSelect.js.map +1 -1
- package/dist/components/QueryEditor/InputGroup.js +29 -9
- package/dist/components/QueryEditor/InputGroup.js.map +1 -1
- package/dist/components/QueryEditor/QueryHeader.js +1 -4
- package/dist/components/QueryEditor/QueryHeader.js.map +1 -1
- package/dist/components/QueryEditor/RunQueryButton.js +3 -5
- package/dist/components/QueryEditor/RunQueryButton.js.map +1 -1
- package/dist/components/QueryEditor/TableSelector.js.map +1 -1
- package/dist/components/QueryEditor/index.js +3 -3
- package/dist/components/QueryEditor/index.js.map +1 -1
- package/dist/components/QueryEditor/query-editor-raw/QueryEditorRaw.js +2 -2
- package/dist/components/QueryEditor/query-editor-raw/QueryEditorRaw.js.map +1 -1
- package/dist/components/QueryEditor/types.js +2 -2
- package/dist/components/QueryEditor/types.js.map +1 -1
- package/dist/components/QueryEditor/utils/sql.utils.js.map +1 -1
- package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js +1 -1
- package/dist/components/QueryEditor/visual-query-builder/AwesomeQueryBuilder.js.map +1 -1
- package/dist/components/QueryEditor/visual-query-builder/EditorField.js.map +1 -1
- package/dist/components/QueryEditor/visual-query-builder/EditorRow.js +2 -2
- package/dist/components/QueryEditor/visual-query-builder/EditorRow.js.map +1 -1
- package/dist/components/QueryEditor/visual-query-builder/EditorRows.js +2 -2
- package/dist/components/QueryEditor/visual-query-builder/EditorRows.js.map +1 -1
- package/dist/components/QueryEditor/visual-query-builder/SelectRow.js +3 -3
- package/dist/components/QueryEditor/visual-query-builder/SelectRow.js.map +1 -1
- package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js +1 -1
- package/dist/components/QueryEditor/visual-query-builder/VisualEditor.js.map +1 -1
- package/dist/components/QueryEditorRow/QueryEditorRow.js +3 -4
- package/dist/components/QueryEditorRow/QueryEditorRow.js.map +1 -1
- package/dist/components/SQLEditor/components/SQLEditor.js +330 -0
- package/dist/components/SQLEditor/components/SQLEditor.js.map +1 -0
- package/dist/components/SQLEditor/index.js +25 -0
- package/dist/components/SQLEditor/index.js.map +1 -0
- package/dist/components/SQLEditor/mocks/Monaco.js +23 -0
- package/dist/components/SQLEditor/mocks/Monaco.js.map +1 -0
- package/dist/components/SQLEditor/mocks/TextModel.js +22 -0
- package/dist/components/SQLEditor/mocks/TextModel.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/multiLineFullQuery.js +216 -0
- package/dist/components/SQLEditor/mocks/queries/multiLineFullQuery.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/multiLineFullQueryWithAggregation.js +231 -0
- package/dist/components/SQLEditor/mocks/queries/multiLineFullQueryWithAggregation.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/multiLineMultipleColumns.js +271 -0
- package/dist/components/SQLEditor/mocks/queries/multiLineMultipleColumns.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineEmptyQuery.js +8 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineEmptyQuery.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineFullQuery.js +196 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineFullQuery.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineFullQueryWithAggregation.js +211 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineFullQueryWithAggregation.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineMultipleColumns.js +251 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineMultipleColumns.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueries.js +386 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueries.js.map +1 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueriesWithAggregation.js +416 -0
- package/dist/components/SQLEditor/mocks/queries/singleLineTwoQueriesWithAggregation.js.map +1 -0
- package/dist/components/SQLEditor/mocks/testData.js +22 -0
- package/dist/components/SQLEditor/mocks/testData.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/definition.js +13 -0
- package/dist/components/SQLEditor/standardSql/definition.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/getStandardSuggestions.js +26 -0
- package/dist/components/SQLEditor/standardSql/getStandardSuggestions.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/getStatementPosition.js +24 -0
- package/dist/components/SQLEditor/standardSql/getStatementPosition.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/language.js +875 -0
- package/dist/components/SQLEditor/standardSql/language.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/macros.js +166 -0
- package/dist/components/SQLEditor/standardSql/macros.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/standardSQLCompletionItemProvider.js +30 -0
- package/dist/components/SQLEditor/standardSql/standardSQLCompletionItemProvider.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/standardSuggestionsRegistry.js +378 -0
- package/dist/components/SQLEditor/standardSql/standardSuggestionsRegistry.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/statementPositionResolversRegistry.js +234 -0
- package/dist/components/SQLEditor/standardSql/statementPositionResolversRegistry.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/suggestionsKindRegistry.js +153 -0
- package/dist/components/SQLEditor/standardSql/suggestionsKindRegistry.js.map +1 -0
- package/dist/components/SQLEditor/standardSql/types.js +3 -0
- package/dist/components/SQLEditor/standardSql/types.js.map +1 -0
- package/dist/components/SQLEditor/test-utils/index.js +11 -0
- package/dist/components/SQLEditor/test-utils/index.js.map +1 -0
- package/dist/components/SQLEditor/test-utils/statementPosition.js +40 -0
- package/dist/components/SQLEditor/test-utils/statementPosition.js.map +1 -0
- package/dist/components/SQLEditor/test-utils/types.js +3 -0
- package/dist/components/SQLEditor/test-utils/types.js.map +1 -0
- package/dist/components/SQLEditor/types.js +139 -0
- package/dist/components/SQLEditor/types.js.map +1 -0
- package/dist/components/SQLEditor/utils/LinkedToken.js +147 -0
- package/dist/components/SQLEditor/utils/LinkedToken.js.map +1 -0
- package/dist/components/SQLEditor/utils/commands.js +8 -0
- package/dist/components/SQLEditor/utils/commands.js.map +1 -0
- package/dist/components/SQLEditor/utils/debugger.js +14 -0
- package/dist/components/SQLEditor/utils/debugger.js.map +1 -0
- package/dist/components/SQLEditor/utils/getSuggestionKind.js +18 -0
- package/dist/components/SQLEditor/utils/getSuggestionKind.js.map +1 -0
- package/dist/components/SQLEditor/utils/linkedTokenBuilder.js +46 -0
- package/dist/components/SQLEditor/utils/linkedTokenBuilder.js.map +1 -0
- package/dist/components/SQLEditor/utils/toCompletionItem.js +10 -0
- package/dist/components/SQLEditor/utils/toCompletionItem.js.map +1 -0
- package/dist/components/SQLEditor/utils/tokenUtils.js +72 -0
- package/dist/components/SQLEditor/utils/tokenUtils.js.map +1 -0
- package/dist/components/SQLEditor/utils/types.js +3 -0
- package/dist/components/SQLEditor/utils/types.js.map +1 -0
- package/dist/components/Segment/Segment.js +2 -1
- package/dist/components/Segment/Segment.js.map +1 -1
- package/dist/components/VisualQueryBuilder/QueryModellerBase.js +35 -0
- package/dist/components/VisualQueryBuilder/QueryModellerBase.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/LabelFilterItem.js +125 -0
- package/dist/components/VisualQueryBuilder/components/LabelFilterItem.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/LabelFilters.js +37 -0
- package/dist/components/VisualQueryBuilder/components/LabelFilters.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationEditor.js +41 -0
- package/dist/components/VisualQueryBuilder/components/OperationEditor.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationEditorBody.js +173 -0
- package/dist/components/VisualQueryBuilder/components/OperationEditorBody.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationExplainedBox.js +64 -0
- package/dist/components/VisualQueryBuilder/components/OperationExplainedBox.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationHeader.js +67 -0
- package/dist/components/VisualQueryBuilder/components/OperationHeader.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationInfoButton.js +71 -0
- package/dist/components/VisualQueryBuilder/components/OperationInfoButton.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationList.js +129 -0
- package/dist/components/VisualQueryBuilder/components/OperationList.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationListExplained.js +22 -0
- package/dist/components/VisualQueryBuilder/components/OperationListExplained.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationParamEditor.js +71 -0
- package/dist/components/VisualQueryBuilder/components/OperationParamEditor.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/OperationsEditorRow.js +24 -0
- package/dist/components/VisualQueryBuilder/components/OperationsEditorRow.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/QueryBuilderHints.js +54 -0
- package/dist/components/VisualQueryBuilder/components/QueryBuilderHints.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/QueryEditorModeToggle.js +17 -0
- package/dist/components/VisualQueryBuilder/components/QueryEditorModeToggle.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/QueryHeaderSwitch.js +32 -0
- package/dist/components/VisualQueryBuilder/components/QueryHeaderSwitch.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/QueryOptionGroup.js +81 -0
- package/dist/components/VisualQueryBuilder/components/QueryOptionGroup.js.map +1 -0
- package/dist/components/VisualQueryBuilder/components/RawQuery.js +25 -0
- package/dist/components/VisualQueryBuilder/components/RawQuery.js.map +1 -0
- package/dist/components/VisualQueryBuilder/index.js +29 -0
- package/dist/components/VisualQueryBuilder/index.js.map +1 -0
- package/dist/components/VisualQueryBuilder/types.js +10 -0
- package/dist/components/VisualQueryBuilder/types.js.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/datasource/SqlDatasource.js.map +1 -1
- package/dist/hooks/useDebounce.js +2 -0
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/src/components/AsyncButtonCascader/AsyncButtonCascader.d.ts +5 -2
- package/dist/src/components/ConfigEditor/AdvancedSettings/AdvancedHttpSettings.d.ts +8 -0
- package/dist/src/components/ConfigEditor/AdvancedSettings/index.d.ts +1 -0
- package/dist/src/components/ConfigEditor/Auth/Auth.d.ts +18 -0
- package/dist/src/components/ConfigEditor/Auth/auth-method/AuthMethodSettings.d.ts +14 -0
- package/dist/src/components/ConfigEditor/Auth/auth-method/BasicAuth.d.ts +17 -0
- package/dist/src/components/ConfigEditor/Auth/custom-headers/CustomHeader.d.ts +10 -0
- package/dist/src/components/ConfigEditor/Auth/custom-headers/CustomHeaders.d.ts +8 -0
- package/dist/src/components/ConfigEditor/Auth/index.d.ts +4 -0
- package/dist/src/components/ConfigEditor/Auth/styles.d.ts +4 -0
- package/dist/src/components/ConfigEditor/Auth/tls/SelfSignedCertificate.d.ts +13 -0
- package/dist/src/components/ConfigEditor/Auth/tls/SkipTLSVerification.d.ts +7 -0
- package/dist/src/components/ConfigEditor/Auth/tls/TLSClientAuth.d.ts +20 -0
- package/dist/src/components/ConfigEditor/Auth/tls/TLSSettings.d.ts +11 -0
- package/dist/src/components/ConfigEditor/Auth/tls/TLSSettingsSection.d.ts +9 -0
- package/dist/src/components/ConfigEditor/Auth/types.d.ts +28 -0
- package/dist/src/components/ConfigEditor/Auth/utils.d.ts +12 -0
- package/dist/src/components/ConfigEditor/ConfigSection/ConfigDescriptionLink.d.ts +8 -0
- package/dist/src/components/ConfigEditor/ConfigSection/ConfigSection.d.ts +5 -0
- package/dist/src/components/ConfigEditor/ConfigSection/ConfigSubSection.d.ts +5 -0
- package/dist/src/components/ConfigEditor/ConfigSection/GenericConfigSection.d.ts +10 -0
- package/dist/src/components/ConfigEditor/ConfigSection/index.d.ts +3 -0
- package/dist/src/components/ConfigEditor/Connection/ConnectionSettings.d.ts +13 -0
- package/dist/src/components/ConfigEditor/Connection/index.d.ts +1 -0
- package/dist/src/components/ConfigEditor/DataSourceDescription.d.ts +9 -0
- package/dist/src/components/ConfigEditor/SecureSocksProxyToggle.d.ts +4 -4
- package/dist/src/components/ConfigEditor/index.d.ts +7 -2
- package/dist/src/components/ConfigEditor/types.d.ts +3 -0
- package/dist/src/components/CustomHeadersSettings/CustomHeadersSettings.d.ts +2 -2
- package/dist/src/components/DataLinks/DataLink.d.ts +1 -1
- package/dist/src/components/Plugins/PluginSignatureBadge.d.ts +5 -2
- package/dist/src/components/QueryEditor/AccessoryButton.d.ts +2 -2
- package/dist/src/components/QueryEditor/DatasetSelector.d.ts +2 -2
- package/dist/src/components/QueryEditor/EditorField.d.ts +2 -1
- package/dist/src/components/QueryEditor/EditorFieldGroup.d.ts +2 -1
- package/dist/src/components/QueryEditor/EditorHeader.d.ts +2 -1
- package/dist/src/components/QueryEditor/EditorList.d.ts +1 -1
- package/dist/src/components/QueryEditor/EditorRow.d.ts +2 -1
- package/dist/src/components/QueryEditor/EditorRows.d.ts +2 -1
- package/dist/src/components/QueryEditor/EditorStack.d.ts +13 -0
- package/dist/src/components/QueryEditor/EditorSwitch.d.ts +2 -2
- package/dist/src/components/QueryEditor/FlexItem.d.ts +2 -2
- package/dist/src/components/QueryEditor/InputGroup.d.ts +7 -2
- package/dist/src/components/QueryEditor/RunQueryButton.d.ts +3 -3
- package/dist/src/components/QueryEditor/TableSelector.d.ts +2 -2
- package/dist/src/components/QueryEditor/index.d.ts +1 -1
- package/dist/src/components/QueryEditor/query-editor-raw/QueryEditorRaw.d.ts +1 -1
- package/dist/src/components/QueryEditor/types.d.ts +9 -14
- package/dist/src/components/QueryEditor/visual-query-builder/EditorField.d.ts +1 -1
- package/dist/src/components/QueryEditor/visual-query-builder/EditorRow.d.ts +2 -1
- package/dist/src/components/QueryEditor/visual-query-builder/EditorRows.d.ts +2 -1
- package/dist/src/components/QueryEditor/visual-query-builder/VisualEditor.d.ts +3 -4
- package/dist/src/components/SQLEditor/components/SQLEditor.d.ts +29 -0
- package/dist/src/components/SQLEditor/index.d.ts +7 -0
- package/dist/src/components/SQLEditor/mocks/Monaco.d.ts +3 -0
- package/dist/src/components/SQLEditor/mocks/TextModel.d.ts +7 -0
- package/dist/src/components/SQLEditor/mocks/queries/multiLineFullQuery.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/multiLineFullQueryWithAggregation.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/multiLineMultipleColumns.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/singleLineEmptyQuery.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/singleLineFullQuery.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/singleLineFullQueryWithAggregation.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/singleLineMultipleColumns.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/singleLineTwoQueries.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/queries/singleLineTwoQueriesWithAggregation.d.ts +2 -0
- package/dist/src/components/SQLEditor/mocks/testData.d.ts +9 -0
- package/dist/src/components/SQLEditor/standardSql/definition.d.ts +3 -0
- package/dist/src/components/SQLEditor/standardSql/getStandardSuggestions.d.ts +6 -0
- package/dist/src/components/SQLEditor/standardSql/getStatementPosition.d.ts +5 -0
- package/dist/src/components/SQLEditor/standardSql/language.d.ts +23 -0
- package/dist/src/components/SQLEditor/standardSql/macros.d.ts +2 -0
- package/dist/src/components/SQLEditor/standardSql/standardSQLCompletionItemProvider.d.ts +4 -0
- package/dist/src/components/SQLEditor/standardSql/standardSuggestionsRegistry.d.ts +7 -0
- package/dist/src/components/SQLEditor/standardSql/statementPositionResolversRegistry.d.ts +2 -0
- package/dist/src/components/SQLEditor/standardSql/suggestionsKindRegistry.d.ts +7 -0
- package/dist/src/components/SQLEditor/standardSql/types.d.ts +33 -0
- package/dist/src/components/SQLEditor/test-utils/index.d.ts +7 -0
- package/dist/src/components/SQLEditor/test-utils/statementPosition.d.ts +3 -0
- package/dist/src/components/SQLEditor/test-utils/types.d.ts +12 -0
- package/dist/src/components/SQLEditor/types.d.ts +249 -0
- package/dist/src/components/SQLEditor/utils/LinkedToken.d.ts +29 -0
- package/dist/src/components/SQLEditor/utils/commands.d.ts +4 -0
- package/dist/src/components/SQLEditor/utils/debugger.d.ts +5 -0
- package/dist/src/components/SQLEditor/utils/getSuggestionKind.d.ts +7 -0
- package/dist/src/components/SQLEditor/utils/linkedTokenBuilder.d.ts +4 -0
- package/dist/src/components/SQLEditor/utils/toCompletionItem.d.ts +2 -0
- package/dist/src/components/SQLEditor/utils/tokenUtils.d.ts +14 -0
- package/dist/src/components/SQLEditor/utils/types.d.ts +11 -0
- package/dist/src/components/VisualQueryBuilder/QueryModellerBase.d.ts +18 -0
- package/dist/src/components/VisualQueryBuilder/components/LabelFilterItem.d.ts +18 -0
- package/dist/src/components/VisualQueryBuilder/components/LabelFilters.d.ts +14 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationEditor.d.ts +19 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationEditorBody.d.ts +22 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationExplainedBox.d.ts +7 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationHeader.d.ts +14 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationInfoButton.d.ts +9 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationList.d.ts +15 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationListExplained.d.ts +17 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationParamEditor.d.ts +4 -0
- package/dist/src/components/VisualQueryBuilder/components/OperationsEditorRow.d.ts +2 -0
- package/dist/src/components/VisualQueryBuilder/components/QueryBuilderHints.d.ts +20 -0
- package/dist/src/components/VisualQueryBuilder/components/QueryEditorModeToggle.d.ts +8 -0
- package/dist/src/components/VisualQueryBuilder/components/QueryHeaderSwitch.d.ts +7 -0
- package/dist/src/components/VisualQueryBuilder/components/QueryOptionGroup.d.ts +9 -0
- package/dist/src/components/VisualQueryBuilder/components/RawQuery.d.ts +12 -0
- package/dist/src/components/VisualQueryBuilder/index.d.ts +13 -0
- package/dist/src/components/VisualQueryBuilder/types.d.ts +89 -0
- package/dist/src/components/index.d.ts +5 -3
- package/dist/src/datasource/SqlDatasource.d.ts +3 -6
- package/dist/src/index.d.ts +0 -4
- package/dist/src/utils/changeset/functions.d.ts +1 -1
- package/dist/test/mocks/Datasource.js +1 -1
- package/dist/test/mocks/Datasource.js.map +1 -1
- package/dist/test/mocks/Plugin.js +2 -11
- package/dist/test/mocks/Plugin.js.map +1 -1
- package/dist/test/mocks/QueryEditorProps.js +0 -1
- package/dist/test/mocks/QueryEditorProps.js.map +1 -1
- package/dist/test/mocks/utils.js.map +1 -1
- package/dist/utils/changeset/functions.js +1 -1
- package/dist/utils/changeset/functions.js.map +1 -1
- package/dist/utils/changeset/index.js +20 -20
- package/dist/utils/changeset/index.js.map +1 -1
- package/package.json +41 -14
- package/CHANGELOG.md +0 -25
- package/dist/8x/fixtures/index.js +0 -7
- package/dist/8x/fixtures/index.js.map +0 -1
- package/dist/8x/fixtures/select.js +0 -43
- package/dist/8x/fixtures/select.js.map +0 -1
- package/dist/8x/index.js +0 -5
- package/dist/8x/index.js.map +0 -1
- package/dist/components/ConfigEditor/InlineLabel.js +0 -24
- package/dist/components/ConfigEditor/InlineLabel.js.map +0 -1
- package/dist/components/QueryEditor/ErrorBoundary.js +0 -23
- package/dist/components/QueryEditor/ErrorBoundary.js.map +0 -1
- package/dist/components/QueryEditor/Stack.js +0 -27
- package/dist/components/QueryEditor/Stack.js.map +0 -1
- package/dist/components/QueryEditor/visual-query-builder/Stack.js +0 -27
- package/dist/components/QueryEditor/visual-query-builder/Stack.js.map +0 -1
- package/dist/src/8x/fixtures/index.d.ts +0 -1
- package/dist/src/8x/fixtures/select.d.ts +0 -11
- package/dist/src/8x/index.d.ts +0 -1
- package/dist/src/components/ConfigEditor/InlineLabel.d.ts +0 -7
- package/dist/src/components/QueryEditor/ErrorBoundary.d.ts +0 -14
- package/dist/src/components/QueryEditor/Stack.d.ts +0 -9
- package/dist/src/components/QueryEditor/visual-query-builder/Stack.d.ts +0 -9
- package/dist/src/test/mocks/TestDatasource.d.ts +0 -6
- package/dist/src/test/mocks/style.d.ts +0 -1
- package/dist/src/test/setupTests.d.ts +0 -1
- package/dist/src/unreleasedComponents/SecretInput.d.ts +0 -15
- package/dist/src/unreleasedComponents/SecretTextarea.d.ts +0 -19
- package/dist/src/unreleasedComponents/index.d.ts +0 -2
- package/dist/src/utils/compatFeatures.d.ts +0 -9
- package/dist/src/utils/compatibility.d.ts +0 -13
- package/dist/src/utils/index.d.ts +0 -3
- package/dist/src/utils/testDatasource.d.ts +0 -19
- package/dist/test/mocks/TestDatasource.js +0 -24
- package/dist/test/mocks/TestDatasource.js.map +0 -1
- package/dist/test/mocks/style.js +0 -5
- package/dist/test/mocks/style.js.map +0 -1
- package/dist/test/setupTests.js +0 -17
- package/dist/test/setupTests.js.map +0 -1
- package/dist/unreleasedComponents/SecretInput.js +0 -21
- package/dist/unreleasedComponents/SecretInput.js.map +0 -1
- package/dist/unreleasedComponents/SecretTextarea.js +0 -36
- package/dist/unreleasedComponents/SecretTextarea.js.map +0 -1
- package/dist/unreleasedComponents/index.js +0 -9
- package/dist/unreleasedComponents/index.js.map +0 -1
- package/dist/utils/compatFeatures.js +0 -20
- package/dist/utils/compatFeatures.js.map +0 -1
- package/dist/utils/compatibility.js +0 -31
- package/dist/utils/compatibility.js.map +0 -1
- package/dist/utils/index.js +0 -8
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/testDatasource.js +0 -30
- package/dist/utils/testDatasource.js.map +0 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { Monaco, monacoTypes } from '@grafana/ui';
|
|
2
|
+
import { SQLMonarchLanguage, StatementPositionResolver, SuggestionsResolver } from './standardSql/types';
|
|
3
|
+
import { LinkedToken } from './utils/LinkedToken';
|
|
4
|
+
/**
|
|
5
|
+
* Provides a context for suggestions resolver
|
|
6
|
+
* @alpha
|
|
7
|
+
*/
|
|
8
|
+
export interface PositionContext {
|
|
9
|
+
position: monacoTypes.IPosition;
|
|
10
|
+
kind: SuggestionKind[];
|
|
11
|
+
statementPosition: StatementPosition[];
|
|
12
|
+
currentToken: LinkedToken | null;
|
|
13
|
+
range: monacoTypes.IRange;
|
|
14
|
+
}
|
|
15
|
+
export type CustomSuggestion = Partial<monacoTypes.languages.CompletionItem> & {
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
export interface CustomSuggestionKind {
|
|
19
|
+
id: string;
|
|
20
|
+
suggestionsResolver: SuggestionsResolver;
|
|
21
|
+
applyTo?: Array<StatementPosition | string>;
|
|
22
|
+
overrideDefault?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface CustomStatementPlacement {
|
|
25
|
+
id: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
resolve: StatementPositionResolver;
|
|
28
|
+
overrideDefault?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type StatementPlacementProvider = () => CustomStatementPlacement[];
|
|
31
|
+
export type SuggestionKindProvider = () => CustomSuggestionKind[];
|
|
32
|
+
export interface ColumnDefinition {
|
|
33
|
+
name: string;
|
|
34
|
+
type?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
completion?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SchemaDefinition {
|
|
39
|
+
name: string;
|
|
40
|
+
completion?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface TableDefinition {
|
|
43
|
+
name: string;
|
|
44
|
+
completion?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface Operator {
|
|
47
|
+
id: string;
|
|
48
|
+
operator: string;
|
|
49
|
+
type: OperatorType;
|
|
50
|
+
description?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface TableIdentifier {
|
|
53
|
+
table?: string;
|
|
54
|
+
schema?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface SQLCompletionItemProvider extends Omit<monacoTypes.languages.CompletionItemProvider, 'provideCompletionItems'> {
|
|
57
|
+
/**
|
|
58
|
+
* Allows dialect specific functions to be added to the completion list.
|
|
59
|
+
* @alpha
|
|
60
|
+
*/
|
|
61
|
+
supportedFunctions?: () => Array<{
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Allows dialect specific operators to be added to the completion list.
|
|
68
|
+
* @alpha
|
|
69
|
+
*/
|
|
70
|
+
supportedOperators?: () => Array<{
|
|
71
|
+
id: string;
|
|
72
|
+
operator: string;
|
|
73
|
+
type: OperatorType;
|
|
74
|
+
description?: string;
|
|
75
|
+
}>;
|
|
76
|
+
supportedMacros?: () => Array<{
|
|
77
|
+
id: string;
|
|
78
|
+
text: string;
|
|
79
|
+
type: MacroType;
|
|
80
|
+
args: string[];
|
|
81
|
+
description?: string;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* Allows custom suggestion kinds to be defined and correlate them with <Custom>StatementPosition.
|
|
85
|
+
* @alpha
|
|
86
|
+
*/
|
|
87
|
+
customSuggestionKinds?: SuggestionKindProvider;
|
|
88
|
+
/**
|
|
89
|
+
* Allows custom statement placement definition.
|
|
90
|
+
* @alpha
|
|
91
|
+
*/
|
|
92
|
+
customStatementPlacement?: StatementPlacementProvider;
|
|
93
|
+
/**
|
|
94
|
+
* Allows providing a custom function for resolving schemas.
|
|
95
|
+
* It's up to the consumer to decide whether the schemas are resolved via API calls or preloaded in the query editor(i.e. full db schema is preloaded).
|
|
96
|
+
* @alpha
|
|
97
|
+
*/
|
|
98
|
+
schemas?: {
|
|
99
|
+
resolve: () => Promise<SchemaDefinition[]>;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Allows providing a custom function for resolving db tables.
|
|
103
|
+
* It's up to the consumer to decide whether the columns are resolved via API calls or preloaded in the query editor(i.e. full db schema is preloaded).
|
|
104
|
+
* @alpha
|
|
105
|
+
*/
|
|
106
|
+
tables?: {
|
|
107
|
+
resolve: (TableIdentifier: TableIdentifier | null) => Promise<TableDefinition[]>;
|
|
108
|
+
parseName?: (token: LinkedToken | null | undefined) => TableIdentifier;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Allows providing a custom function for resolving table.
|
|
112
|
+
* It's up to the consumer to decide whether the columns are resolved via API calls or preloaded in the query editor(i.e. full db schema is preloaded).
|
|
113
|
+
* @alpha
|
|
114
|
+
*/
|
|
115
|
+
columns?: {
|
|
116
|
+
resolve: (identifier?: TableIdentifier) => Promise<ColumnDefinition[]>;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* TODO: Not sure whether or not we need this. Would like to avoid this kind of flexibility.
|
|
120
|
+
* @alpha
|
|
121
|
+
*/
|
|
122
|
+
provideCompletionItems?: (model: monacoTypes.editor.ITextModel, position: monacoTypes.Position, context: monacoTypes.languages.CompletionContext, token: monacoTypes.CancellationToken, positionContext: PositionContext) => monacoTypes.languages.CompletionList;
|
|
123
|
+
}
|
|
124
|
+
export type LanguageCompletionProvider = (m: Monaco, l?: SQLMonarchLanguage) => SQLCompletionItemProvider;
|
|
125
|
+
export declare enum OperatorType {
|
|
126
|
+
Comparison = 0,
|
|
127
|
+
Logical = 1
|
|
128
|
+
}
|
|
129
|
+
export declare enum MacroType {
|
|
130
|
+
Value = 0,
|
|
131
|
+
Filter = 1,
|
|
132
|
+
Group = 2,
|
|
133
|
+
Column = 3,
|
|
134
|
+
Table = 4
|
|
135
|
+
}
|
|
136
|
+
export declare enum TokenType {
|
|
137
|
+
Parenthesis = "delimiter.parenthesis.sql",
|
|
138
|
+
Whitespace = "white.sql",
|
|
139
|
+
Keyword = "keyword.sql",
|
|
140
|
+
Delimiter = "delimiter.sql",
|
|
141
|
+
Operator = "operator.sql",
|
|
142
|
+
Identifier = "identifier.sql",
|
|
143
|
+
IdentifierQuote = "identifier.quote.sql",
|
|
144
|
+
Type = "type.sql",
|
|
145
|
+
Function = "predefined.sql",
|
|
146
|
+
Number = "number.sql",
|
|
147
|
+
String = "string.sql",
|
|
148
|
+
Variable = "variable.sql"
|
|
149
|
+
}
|
|
150
|
+
export declare enum StatementPosition {
|
|
151
|
+
Unknown = "unknown",
|
|
152
|
+
SelectKeyword = "selectKeyword",
|
|
153
|
+
WithKeyword = "withKeyword",
|
|
154
|
+
AfterSelectKeyword = "afterSelectKeyword",
|
|
155
|
+
AfterSelectArguments = "afterSelectArguments",
|
|
156
|
+
AfterSelectFuncFirstArgument = "afterSelectFuncFirstArgument",
|
|
157
|
+
SelectAlias = "selectAlias",
|
|
158
|
+
AfterFromKeyword = "afterFromKeyword",
|
|
159
|
+
AfterTable = "afterTable",
|
|
160
|
+
SchemaFuncFirstArgument = "schemaFuncFirstArgument",
|
|
161
|
+
SchemaFuncExtraArgument = "schemaFuncExtraArgument",
|
|
162
|
+
FromKeyword = "fromKeyword",
|
|
163
|
+
AfterFrom = "afterFrom",
|
|
164
|
+
WhereKeyword = "whereKeyword",
|
|
165
|
+
WhereComparisonOperator = "whereComparisonOperator",
|
|
166
|
+
WhereValue = "whereValue",
|
|
167
|
+
AfterWhereFunctionArgument = "afterWhereFunctionArgument",
|
|
168
|
+
AfterGroupByFunctionArgument = "afterGroupByFunctionArgument",
|
|
169
|
+
AfterWhereValue = "afterWhereValue",
|
|
170
|
+
AfterGroupByKeywords = "afterGroupByKeywords",
|
|
171
|
+
AfterGroupBy = "afterGroupBy",
|
|
172
|
+
AfterOrderByKeywords = "afterOrderByKeywords",
|
|
173
|
+
AfterOrderByFunction = "afterOrderByFunction",
|
|
174
|
+
AfterOrderByDirection = "afterOrderByDirection",
|
|
175
|
+
AfterIsOperator = "afterIsOperator",
|
|
176
|
+
AfterIsNotOperator = "afterIsNotOperator",
|
|
177
|
+
AfterSchema = "afterSchema"
|
|
178
|
+
}
|
|
179
|
+
export declare enum SuggestionKind {
|
|
180
|
+
Schemas = "schemas",
|
|
181
|
+
Tables = "tables",
|
|
182
|
+
Columns = "columns",
|
|
183
|
+
SelectKeyword = "selectKeyword",
|
|
184
|
+
WithKeyword = "withKeyword",
|
|
185
|
+
FunctionsWithArguments = "functionsWithArguments",
|
|
186
|
+
FromKeyword = "fromKeyword",
|
|
187
|
+
WhereKeyword = "whereKeyword",
|
|
188
|
+
GroupByKeywords = "groupByKeywords",
|
|
189
|
+
OrderByKeywords = "orderByKeywords",
|
|
190
|
+
FunctionsWithoutArguments = "functionsWithoutArguments",
|
|
191
|
+
LimitKeyword = "limitKeyword",
|
|
192
|
+
SortOrderDirectionKeyword = "sortOrderDirectionKeyword",
|
|
193
|
+
ComparisonOperators = "comparisonOperators",
|
|
194
|
+
LogicalOperators = "logicalOperators",
|
|
195
|
+
SelectMacro = "selectMacro",
|
|
196
|
+
TableMacro = "tableMacro",
|
|
197
|
+
FilterMacro = "filterMacro",
|
|
198
|
+
GroupMacro = "groupMacro",
|
|
199
|
+
BoolValues = "boolValues",
|
|
200
|
+
NullValue = "nullValue",
|
|
201
|
+
NotKeyword = "notKeyword",
|
|
202
|
+
TemplateVariables = "templateVariables",
|
|
203
|
+
StarWildCard = "starWildCard"
|
|
204
|
+
}
|
|
205
|
+
export declare enum CompletionItemPriority {
|
|
206
|
+
High = "a",
|
|
207
|
+
MediumHigh = "d",
|
|
208
|
+
Medium = "g",
|
|
209
|
+
MediumLow = "k",
|
|
210
|
+
Low = "q"
|
|
211
|
+
}
|
|
212
|
+
export declare enum CompletionItemKind {
|
|
213
|
+
Method = 0,
|
|
214
|
+
Function = 1,
|
|
215
|
+
Constructor = 2,
|
|
216
|
+
Field = 3,
|
|
217
|
+
Variable = 4,
|
|
218
|
+
Class = 5,
|
|
219
|
+
Struct = 6,
|
|
220
|
+
Interface = 7,
|
|
221
|
+
Module = 8,
|
|
222
|
+
Property = 9,
|
|
223
|
+
Event = 10,
|
|
224
|
+
Operator = 11,
|
|
225
|
+
Unit = 12,
|
|
226
|
+
Value = 13,
|
|
227
|
+
Constant = 14,
|
|
228
|
+
Enum = 15,
|
|
229
|
+
EnumMember = 16,
|
|
230
|
+
Keyword = 17,
|
|
231
|
+
Text = 18,
|
|
232
|
+
Color = 19,
|
|
233
|
+
File = 20,
|
|
234
|
+
Reference = 21,
|
|
235
|
+
Customcolor = 22,
|
|
236
|
+
Folder = 23,
|
|
237
|
+
TypeParameter = 24,
|
|
238
|
+
User = 25,
|
|
239
|
+
Issue = 26,
|
|
240
|
+
Snippet = 27
|
|
241
|
+
}
|
|
242
|
+
export declare enum CompletionItemInsertTextRule {
|
|
243
|
+
KeepWhitespace = 1,
|
|
244
|
+
InsertAsSnippet = 4
|
|
245
|
+
}
|
|
246
|
+
export declare enum SQLEditorMode {
|
|
247
|
+
Builder = "builder",
|
|
248
|
+
Code = "code"
|
|
249
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { monacoTypes } from '@grafana/ui';
|
|
2
|
+
import { TokenType } from '../types';
|
|
3
|
+
export declare class LinkedToken {
|
|
4
|
+
type: string;
|
|
5
|
+
value: string;
|
|
6
|
+
range: monacoTypes.IRange;
|
|
7
|
+
previous: LinkedToken | null;
|
|
8
|
+
next: LinkedToken | null;
|
|
9
|
+
constructor(type: string, value: string, range: monacoTypes.IRange, previous: LinkedToken | null, next: LinkedToken | null);
|
|
10
|
+
isKeyword(): boolean;
|
|
11
|
+
isWhiteSpace(): boolean;
|
|
12
|
+
isParenthesis(): boolean;
|
|
13
|
+
isIdentifier(): boolean;
|
|
14
|
+
isString(): boolean;
|
|
15
|
+
isNumber(): boolean;
|
|
16
|
+
isDoubleQuotedString(): boolean;
|
|
17
|
+
isVariable(): boolean;
|
|
18
|
+
isFunction(): boolean;
|
|
19
|
+
isOperator(): boolean;
|
|
20
|
+
isTemplateVariable(): boolean;
|
|
21
|
+
is(type: TokenType, value?: string | number | boolean): boolean;
|
|
22
|
+
getPreviousNonWhiteSpaceToken(): LinkedToken | null;
|
|
23
|
+
getPreviousOfType(type: TokenType, value?: string): LinkedToken | null;
|
|
24
|
+
getPreviousUntil(type: TokenType, ignoreTypes: TokenType[], value?: string): LinkedToken[] | null;
|
|
25
|
+
getNextUntil(type: TokenType, ignoreTypes: TokenType[], value?: string): LinkedToken[] | null;
|
|
26
|
+
getPreviousKeyword(): LinkedToken | null;
|
|
27
|
+
getNextNonWhiteSpaceToken(): LinkedToken | null;
|
|
28
|
+
getNextOfType(type: TokenType, value?: string): LinkedToken | null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Registry } from '@grafana/data';
|
|
2
|
+
import { SuggestionKindRegistryItem } from '../standardSql/suggestionsKindRegistry';
|
|
3
|
+
import { StatementPosition, SuggestionKind } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Given statement positions, returns list of suggestion kinds that apply to those positions.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSuggestionKinds(statementPosition: StatementPosition[], suggestionsKindRegistry: Registry<SuggestionKindRegistryItem>): SuggestionKind[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { monacoTypes } from '@grafana/ui';
|
|
2
|
+
import { LinkedToken } from './LinkedToken';
|
|
3
|
+
import { Monaco } from './types';
|
|
4
|
+
export declare function linkedTokenBuilder(monaco: Monaco, model: monacoTypes.editor.ITextModel, position: monacoTypes.IPosition, languageId?: string): LinkedToken | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LinkedToken } from './LinkedToken';
|
|
2
|
+
export declare const getSelectToken: (currentToken: LinkedToken | null) => LinkedToken | null;
|
|
3
|
+
export declare const getSelectStatisticToken: (currentToken: LinkedToken | null) => LinkedToken | null;
|
|
4
|
+
export declare const getMetricNameToken: (currentToken: LinkedToken | null) => LinkedToken | null;
|
|
5
|
+
export declare const getFromKeywordToken: (currentToken: LinkedToken | null) => LinkedToken | null | undefined;
|
|
6
|
+
export declare const getNamespaceToken: (currentToken: LinkedToken | null) => LinkedToken | null;
|
|
7
|
+
export declare const getTableToken: (currentToken: LinkedToken | null) => LinkedToken | null | undefined;
|
|
8
|
+
export declare const defaultTableNameParser: (token: LinkedToken | null | undefined) => {
|
|
9
|
+
table: string;
|
|
10
|
+
schema?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
schema: string;
|
|
13
|
+
table: string;
|
|
14
|
+
} | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { monacoTypes } from '@grafana/ui';
|
|
2
|
+
export interface Editor {
|
|
3
|
+
tokenize: (value: string, languageId: string) => monacoTypes.Token[][];
|
|
4
|
+
}
|
|
5
|
+
export interface Range {
|
|
6
|
+
containsPosition: (range: monacoTypes.IRange, position: monacoTypes.IPosition) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface Monaco {
|
|
9
|
+
editor: Editor;
|
|
10
|
+
Range: Range;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Registry } from '@grafana/data';
|
|
2
|
+
import { VisualQuery, VisualQueryBinary, QueryBuilderLabelFilter, QueryBuilderOperation, VisualQueryModeller, QueryBuilderOperationDefinition } from './types';
|
|
3
|
+
export declare abstract class QueryModellerBase implements VisualQueryModeller {
|
|
4
|
+
protected operationsRegistry: Registry<QueryBuilderOperationDefinition>;
|
|
5
|
+
private categories;
|
|
6
|
+
innerQueryPlaceholder: string;
|
|
7
|
+
constructor(operationDefinitions: QueryBuilderOperationDefinition[], innerQueryPlaceholder?: string);
|
|
8
|
+
protected setOperationCategories(categories: string[]): void;
|
|
9
|
+
abstract renderOperations(queryString: string, operations: QueryBuilderOperation[]): string;
|
|
10
|
+
abstract renderBinaryQueries(queryString: string, binaryQueries?: Array<VisualQueryBinary<VisualQuery>>): string;
|
|
11
|
+
abstract renderLabels(labels: QueryBuilderLabelFilter[]): string;
|
|
12
|
+
abstract renderQuery(query: VisualQuery, nested?: boolean): string;
|
|
13
|
+
getOperationsForCategory(category: string): QueryBuilderOperationDefinition<any>[];
|
|
14
|
+
getAlternativeOperations(key: string): QueryBuilderOperationDefinition<any>[];
|
|
15
|
+
getCategories(): string[];
|
|
16
|
+
getOperationDefinition(id: string): QueryBuilderOperationDefinition | undefined;
|
|
17
|
+
hasBinaryOp(query: VisualQuery): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectableValue } from '@grafana/data';
|
|
3
|
+
import { QueryBuilderLabelFilter } from '../types';
|
|
4
|
+
interface Props {
|
|
5
|
+
defaultOp: string;
|
|
6
|
+
item: Partial<QueryBuilderLabelFilter>;
|
|
7
|
+
items: Array<Partial<QueryBuilderLabelFilter>>;
|
|
8
|
+
onChange: (value: Partial<QueryBuilderLabelFilter>) => void;
|
|
9
|
+
onGetLabelNames: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<Array<SelectableValue<string>>>;
|
|
10
|
+
onGetLabelValues: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<Array<SelectableValue<string>>>;
|
|
11
|
+
onDelete: () => void;
|
|
12
|
+
invalidLabel?: boolean;
|
|
13
|
+
invalidValue?: boolean;
|
|
14
|
+
multiValueSeparator?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function LabelFilterItem({ item, items, defaultOp, onChange, onDelete, onGetLabelNames, onGetLabelValues, invalidLabel, invalidValue, multiValueSeparator, }: Props): JSX.Element;
|
|
17
|
+
export declare function isConflictingLabelFilter(newLabel: Partial<QueryBuilderLabelFilter>, labels: Array<Partial<QueryBuilderLabelFilter>>): boolean;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectableValue } from '@grafana/data';
|
|
3
|
+
import { QueryBuilderLabelFilter } from '../types';
|
|
4
|
+
export declare const MISSING_LABEL_FILTER_ERROR_MESSAGE = "Select at least 1 label filter (label and value)";
|
|
5
|
+
export interface Props {
|
|
6
|
+
labelsFilters: QueryBuilderLabelFilter[];
|
|
7
|
+
onChange: (labelFilters: QueryBuilderLabelFilter[]) => void;
|
|
8
|
+
onGetLabelNames: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<SelectableValue[]>;
|
|
9
|
+
onGetLabelValues: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<SelectableValue[]>;
|
|
10
|
+
/** If set to true, component will show error message until at least 1 filter is selected */
|
|
11
|
+
labelFilterRequired?: boolean;
|
|
12
|
+
multiValueSeparator?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function LabelFilters({ labelsFilters, onChange, onGetLabelNames, onGetLabelValues, labelFilterRequired, multiValueSeparator, }: Props): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataSourceApi, TimeRange } from '@grafana/data';
|
|
3
|
+
import { QueryBuilderOperation, VisualQuery, VisualQueryModeller } from '../types';
|
|
4
|
+
interface Props<T extends VisualQuery> {
|
|
5
|
+
operation: QueryBuilderOperation;
|
|
6
|
+
index: number;
|
|
7
|
+
query: T;
|
|
8
|
+
datasource: DataSourceApi;
|
|
9
|
+
queryModeller: VisualQueryModeller;
|
|
10
|
+
onChange: (index: number, update: QueryBuilderOperation) => void;
|
|
11
|
+
onRemove: (index: number) => void;
|
|
12
|
+
onRunQuery: () => void;
|
|
13
|
+
flash?: boolean;
|
|
14
|
+
highlight?: boolean;
|
|
15
|
+
timeRange?: TimeRange;
|
|
16
|
+
isConflictingOperation?: (operation: QueryBuilderOperation, otherOperations: QueryBuilderOperation[]) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function OperationEditor<T extends VisualQuery>({ operation, index, onRemove, onChange, onRunQuery, queryModeller, query, datasource, flash, highlight, timeRange, isConflictingOperation, }: Props<T>): JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DraggableProvided } from '@hello-pangea/dnd';
|
|
3
|
+
import { DataSourceApi, TimeRange } from '@grafana/data';
|
|
4
|
+
import { QueryBuilderOperation, QueryBuilderOperationDefinition, VisualQuery, VisualQueryModeller } from '../types';
|
|
5
|
+
type Props = {
|
|
6
|
+
provided: DraggableProvided;
|
|
7
|
+
isConflicting: boolean;
|
|
8
|
+
index: number;
|
|
9
|
+
operation: QueryBuilderOperation;
|
|
10
|
+
definition: QueryBuilderOperationDefinition;
|
|
11
|
+
queryModeller: VisualQueryModeller;
|
|
12
|
+
query: VisualQuery;
|
|
13
|
+
onChange: (index: number, update: QueryBuilderOperation) => void;
|
|
14
|
+
onRemove: (index: number) => void;
|
|
15
|
+
onRunQuery: () => void;
|
|
16
|
+
datasource: DataSourceApi;
|
|
17
|
+
flash?: boolean;
|
|
18
|
+
highlight?: boolean;
|
|
19
|
+
timeRange?: TimeRange;
|
|
20
|
+
};
|
|
21
|
+
export declare function OperationEditorBody({ provided, flash, isConflicting, highlight, index, queryModeller, onChange, onRemove, operation, definition, query, timeRange, onRunQuery, datasource, }: Props): JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DraggableProvided } from '@hello-pangea/dnd';
|
|
3
|
+
import { VisualQueryModeller, QueryBuilderOperation, QueryBuilderOperationDefinition } from '../types';
|
|
4
|
+
interface Props {
|
|
5
|
+
operation: QueryBuilderOperation;
|
|
6
|
+
definition: QueryBuilderOperationDefinition;
|
|
7
|
+
index: number;
|
|
8
|
+
queryModeller: VisualQueryModeller;
|
|
9
|
+
dragHandleProps?: DraggableProvided['dragHandleProps'];
|
|
10
|
+
onChange: (index: number, update: QueryBuilderOperation) => void;
|
|
11
|
+
onRemove: (index: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const OperationHeader: React.NamedExoticComponent<Props>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryBuilderOperation, QueryBuilderOperationDefinition } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
operation: QueryBuilderOperation;
|
|
5
|
+
definition: QueryBuilderOperationDefinition;
|
|
6
|
+
innerQueryPlaceholder: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const OperationInfoButton: React.NamedExoticComponent<Props>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataSourceApi, TimeRange } from '@grafana/data';
|
|
3
|
+
import { QueryBuilderOperation, VisualQuery, VisualQueryModeller } from '../types';
|
|
4
|
+
export interface Props<T extends VisualQuery> {
|
|
5
|
+
query: T;
|
|
6
|
+
datasource: DataSourceApi;
|
|
7
|
+
onChange: (query: T) => void;
|
|
8
|
+
onRunQuery: () => void;
|
|
9
|
+
queryModeller: VisualQueryModeller;
|
|
10
|
+
explainMode?: boolean;
|
|
11
|
+
highlightedOp?: QueryBuilderOperation;
|
|
12
|
+
timeRange?: TimeRange;
|
|
13
|
+
isConflictingOperation?: (operation: QueryBuilderOperation, otherOperations: QueryBuilderOperation[]) => boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function OperationList<T extends VisualQuery>({ query, datasource, queryModeller, onChange, onRunQuery, highlightedOp, timeRange, isConflictingOperation, }: Props<T>): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Grammar } from 'prismjs';
|
|
3
|
+
import { QueryBuilderOperation, VisualQuery, VisualQueryModeller } from '../types';
|
|
4
|
+
interface Props<T extends VisualQuery> {
|
|
5
|
+
query: T;
|
|
6
|
+
queryModeller: VisualQueryModeller;
|
|
7
|
+
explainMode?: boolean;
|
|
8
|
+
stepNumber: number;
|
|
9
|
+
language: {
|
|
10
|
+
grammar: Grammar;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
onMouseEnter?: (op: QueryBuilderOperation, index: number) => void;
|
|
14
|
+
onMouseLeave?: (op: QueryBuilderOperation, index: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function OperationListExplained<T extends VisualQuery>({ query, queryModeller, stepNumber, language, onMouseEnter, onMouseLeave, }: Props<T>): JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { QueryBuilderOperationParamDef, QueryBuilderOperationParamEditorProps } from '../types';
|
|
3
|
+
export declare function getOperationParamEditor(paramDef: QueryBuilderOperationParamDef): FunctionComponent<QueryBuilderOperationParamEditorProps>;
|
|
4
|
+
export declare function getOperationParamId(operationId: string, paramIndex: number): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataSourceApi, PanelData, DataQuery } from '@grafana/data';
|
|
3
|
+
import { VisualQuery, VisualQueryModeller } from '../types';
|
|
4
|
+
interface Props<TVisualQuery extends VisualQuery, TDataQuery extends DataQuery> {
|
|
5
|
+
query: TVisualQuery;
|
|
6
|
+
datasource: DataSourceApi<TDataQuery>;
|
|
7
|
+
queryModeller: VisualQueryModeller;
|
|
8
|
+
buildVisualQueryFromString: (queryString: string) => {
|
|
9
|
+
query: TVisualQuery;
|
|
10
|
+
};
|
|
11
|
+
buildDataQueryFromQueryString: (queryString: string) => TDataQuery;
|
|
12
|
+
buildQueryStringFromDataQuery: (dataQuery: TDataQuery) => string;
|
|
13
|
+
onChange: (update: TVisualQuery) => void;
|
|
14
|
+
data?: PanelData;
|
|
15
|
+
}
|
|
16
|
+
export declare const QueryBuilderHints: {
|
|
17
|
+
<TVisualQuery extends VisualQuery, TDataQuery extends DataQuery>({ datasource, query: visualQuery, onChange, data, queryModeller, buildVisualQueryFromString, buildDataQueryFromQueryString, buildQueryStringFromDataQuery, }: Props<TVisualQuery, TDataQuery>): JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { QueryEditorMode } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
mode: QueryEditorMode;
|
|
5
|
+
onChange: (mode: QueryEditorMode) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function QueryEditorModeToggle({ mode, onChange }: Props): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryStats } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
title: string;
|
|
5
|
+
collapsedInfo: string[];
|
|
6
|
+
queryStats?: QueryStats | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function QueryOptionGroup({ title, children, collapsedInfo, queryStats }: React.PropsWithChildren<Props>): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Grammar } from 'prismjs';
|
|
3
|
+
interface Props {
|
|
4
|
+
query: string;
|
|
5
|
+
language: {
|
|
6
|
+
grammar: Grammar;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function RawQuery({ query, language, className }: Props): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { QueryModellerBase } from './QueryModellerBase';
|
|
2
|
+
export { LabelFilters } from './components/LabelFilters';
|
|
3
|
+
export { OperationExplainedBox } from './components/OperationExplainedBox';
|
|
4
|
+
export { OperationList } from './components/OperationList';
|
|
5
|
+
export { OperationListExplained } from './components/OperationListExplained';
|
|
6
|
+
export { OperationsEditorRow } from './components/OperationsEditorRow';
|
|
7
|
+
export { QueryBuilderHints } from './components/QueryBuilderHints';
|
|
8
|
+
export { QueryEditorModeToggle } from './components/QueryEditorModeToggle';
|
|
9
|
+
export { QueryHeaderSwitch } from './components/QueryHeaderSwitch';
|
|
10
|
+
export { QueryOptionGroup } from './components/QueryOptionGroup';
|
|
11
|
+
export { RawQuery } from './components/RawQuery';
|
|
12
|
+
export type { QueryBuilderOperationParamEditorProps, QueryBuilderLabelFilter, QueryBuilderOperation, QueryBuilderOperationParamValue, QueryBuilderOperationDefinition, QueryBuilderOperationParamDef, VisualQueryModeller, VisualQueryBinary, VisualQuery, QueryStats } from './types';
|
|
13
|
+
export { QueryEditorMode, BINARY_OPERATIONS_KEY } from './types';
|