@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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
interface FlexItemProps {
|
|
3
3
|
grow?: number;
|
|
4
4
|
shrink?: number;
|
|
5
5
|
}
|
|
6
|
-
export declare const FlexItem:
|
|
6
|
+
export declare const FlexItem: ({ grow, shrink }: FlexItemProps) => JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
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:
|
|
9
|
+
export declare const InputGroup: ({ children }: InputGroupProps) => JSX.Element;
|
|
5
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { PopoverContent } from
|
|
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:
|
|
12
|
+
export declare const RunQueryButton: ({ ariaLabel, queryRunning, queryInvalid, invalidQueryTooltip, disabled, onClick, dataTestId, }: RunQueryButtonProps) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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:
|
|
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 {
|
|
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
|
|
2
|
-
import { DataFrame, DataSourceJsonData, MetricFindValue, SelectableValue, TimeRange } from
|
|
3
|
-
import { DataQuery } from
|
|
4
|
-
import { QueryWithDefaults } from
|
|
5
|
-
import { QueryEditorFunctionExpression, QueryEditorGroupByExpression, QueryEditorPropertyExpression } from
|
|
6
|
-
import { CompletionItemKind, LanguageCompletionProvider } from
|
|
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?:
|
|
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 =
|
|
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<
|
|
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:
|
|
10
|
+
export declare const EditorField: (props: EditorFieldProps) => JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
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:
|
|
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,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,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,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,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,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
|
+
}
|