@gooddata/sdk-ui-metric-component 0.0.0-stage → 11.65.0-alpha.4
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/LICENSE +29 -0
- package/NOTICE +71721 -0
- package/README.md +13 -2
- package/esm/MaqlEditor/components/ExpandableTooltip.d.ts +50 -0
- package/esm/MaqlEditor/components/ExpandableTooltip.d.ts.map +1 -0
- package/esm/MaqlEditor/components/ExpandableTooltip.js +150 -0
- package/esm/MaqlEditor/components/ExpandableTooltipContext.d.ts +10 -0
- package/esm/MaqlEditor/components/ExpandableTooltipContext.d.ts.map +1 -0
- package/esm/MaqlEditor/components/ExpandableTooltipContext.js +17 -0
- package/esm/MaqlEditor/components/hooks/useExpandableTooltip.d.ts +3 -0
- package/esm/MaqlEditor/components/hooks/useExpandableTooltip.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/useExpandableTooltip.js +10 -0
- package/esm/MaqlEditor/components/hooks/useOutsideEvents.d.ts +10 -0
- package/esm/MaqlEditor/components/hooks/useOutsideEvents.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/useOutsideEvents.js +43 -0
- package/esm/MaqlEditor/components/hooks/useRePosition.d.ts +20 -0
- package/esm/MaqlEditor/components/hooks/useRePosition.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/useRePosition.js +108 -0
- package/esm/MaqlEditor/components/hooks/utils.d.ts +4 -0
- package/esm/MaqlEditor/components/hooks/utils.d.ts.map +1 -0
- package/esm/MaqlEditor/components/hooks/utils.js +18 -0
- package/esm/MaqlEditor/hooks/useAutoformat.d.ts +3 -0
- package/esm/MaqlEditor/hooks/useAutoformat.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useAutoformat.js +15 -0
- package/esm/MaqlEditor/hooks/useCleanCallback.d.ts +4 -0
- package/esm/MaqlEditor/hooks/useCleanCallback.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useCleanCallback.js +12 -0
- package/esm/MaqlEditor/hooks/useCodeTheme.d.ts +3 -0
- package/esm/MaqlEditor/hooks/useCodeTheme.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useCodeTheme.js +48 -0
- package/esm/MaqlEditor/hooks/useCopyToClipboard.d.ts +3 -0
- package/esm/MaqlEditor/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useCopyToClipboard.js +16 -0
- package/esm/MaqlEditor/hooks/useMountCallback.d.ts +13 -0
- package/esm/MaqlEditor/hooks/useMountCallback.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useMountCallback.js +26 -0
- package/esm/MaqlEditor/hooks/useUpdateCallback.d.ts +19 -0
- package/esm/MaqlEditor/hooks/useUpdateCallback.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useUpdateCallback.js +63 -0
- package/esm/MaqlEditor/hooks/useValueCallbacks.d.ts +6 -0
- package/esm/MaqlEditor/hooks/useValueCallbacks.d.ts.map +1 -0
- package/esm/MaqlEditor/hooks/useValueCallbacks.js +14 -0
- package/esm/MaqlEditor/languageService/LanguageServiceContext.d.ts +13 -0
- package/esm/MaqlEditor/languageService/LanguageServiceContext.d.ts.map +1 -0
- package/esm/MaqlEditor/languageService/LanguageServiceContext.js +20 -0
- package/esm/MaqlEditor/maql/MaqlEditor.d.ts +30 -0
- package/esm/MaqlEditor/maql/MaqlEditor.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/MaqlEditor.js +42 -0
- package/esm/MaqlEditor/maql/MaqlEditor.styles.d.ts +8 -0
- package/esm/MaqlEditor/maql/MaqlEditor.styles.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/MaqlEditor.styles.js +154 -0
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.d.ts +36 -0
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/MaqlEditor.tooltip.js +187 -0
- package/esm/MaqlEditor/maql/constants.d.ts +2 -0
- package/esm/MaqlEditor/maql/constants.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/constants.js +2 -0
- package/esm/MaqlEditor/maql/formatter.d.ts +6 -0
- package/esm/MaqlEditor/maql/formatter.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/formatter.js +14 -0
- package/esm/MaqlEditor/maql/hooks/hover/doHover.d.ts +12 -0
- package/esm/MaqlEditor/maql/hooks/hover/doHover.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/hover/doHover.js +126 -0
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/hover/useHoverEvent.js +32 -0
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useAutocomplete.js +60 -0
- package/esm/MaqlEditor/maql/hooks/useDecoration.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useDecoration.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useDecoration.js +73 -0
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.d.ts +3 -0
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useDocumentFormatting.js +29 -0
- package/esm/MaqlEditor/maql/hooks/useHover.d.ts +6 -0
- package/esm/MaqlEditor/maql/hooks/useHover.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useHover.js +77 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageConfiguration.js +21 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageService.d.ts +3 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageService.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageService.js +21 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageServiceInitializer.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageServiceInitializer.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useLanguageServiceInitializer.js +11 -0
- package/esm/MaqlEditor/maql/hooks/useMonaco.d.ts +21 -0
- package/esm/MaqlEditor/maql/hooks/useMonaco.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useMonaco.js +75 -0
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useSemanticHighlight.js +33 -0
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.d.ts +2 -0
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useSyntaxHighlight.js +28 -0
- package/esm/MaqlEditor/maql/hooks/useValidation.d.ts +4 -0
- package/esm/MaqlEditor/maql/hooks/useValidation.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/hooks/useValidation.js +56 -0
- package/esm/MaqlEditor/maql/utils.d.ts +4 -0
- package/esm/MaqlEditor/maql/utils.d.ts.map +1 -0
- package/esm/MaqlEditor/maql/utils.js +6 -0
- package/esm/MaqlEditor/mock/monaco-shim.d.ts +2 -0
- package/esm/MaqlEditor/mock/monaco-shim.d.ts.map +1 -0
- package/esm/MaqlEditor/mock/monaco-shim.js +36 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.d.ts +49 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.js +71 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.d.ts +47 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/MonacoEditor.styles.js +427 -0
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useAutofocus.js +33 -0
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useDefaultValue.js +14 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorInit.js +84 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useEditorOptions.js +51 -0
- package/esm/MaqlEditor/monaco/hooks/useMonaco.d.ts +3 -0
- package/esm/MaqlEditor/monaco/hooks/useMonaco.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/hooks/useMonaco.js +24 -0
- package/esm/MaqlEditor/monaco/monacoContributions.d.ts +74 -0
- package/esm/MaqlEditor/monaco/monacoContributions.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/monacoContributions.js +88 -0
- package/esm/MaqlEditor/monaco/monacoWorkers.d.ts +12 -0
- package/esm/MaqlEditor/monaco/monacoWorkers.d.ts.map +1 -0
- package/esm/MaqlEditor/monaco/monacoWorkers.js +63 -0
- package/esm/MaqlEditor/sql/SqlEditor.d.ts +21 -0
- package/esm/MaqlEditor/sql/SqlEditor.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/SqlEditor.js +45 -0
- package/esm/MaqlEditor/sql/SqlEditor.styles.d.ts +3 -0
- package/esm/MaqlEditor/sql/SqlEditor.styles.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/SqlEditor.styles.js +3 -0
- package/esm/MaqlEditor/sql/constants.d.ts +2 -0
- package/esm/MaqlEditor/sql/constants.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/constants.js +2 -0
- package/esm/MaqlEditor/sql/formatter.d.ts +6 -0
- package/esm/MaqlEditor/sql/formatter.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/formatter.js +17 -0
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.d.ts +2 -0
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useDocumentFormatting.js +26 -0
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.d.ts +4 -0
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useLanguageConfiguration.js +29 -0
- package/esm/MaqlEditor/sql/hooks/useMonaco.d.ts +14 -0
- package/esm/MaqlEditor/sql/hooks/useMonaco.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useMonaco.js +26 -0
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.d.ts +2 -0
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/hooks/useSyntaxHighlight.js +796 -0
- package/esm/MaqlEditor/sql/utils.d.ts +4 -0
- package/esm/MaqlEditor/sql/utils.d.ts.map +1 -0
- package/esm/MaqlEditor/sql/utils.js +6 -0
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.d.ts +9 -0
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.d.ts.map +1 -0
- package/esm/MaqlEditor/statusBar/SuggestionStatusBar.js +38 -0
- package/esm/MaqlEditor/theme/default.d.ts +204 -0
- package/esm/MaqlEditor/theme/default.d.ts.map +1 -0
- package/esm/MaqlEditor/theme/default.js +223 -0
- package/esm/MaqlEditor/theme/styles.d.ts +411 -0
- package/esm/MaqlEditor/theme/styles.d.ts.map +1 -0
- package/esm/MaqlEditor/theme/styles.js +5 -0
- package/esm/MaqlEditor/theme/theme.d.ts +206 -0
- package/esm/MaqlEditor/theme/theme.d.ts.map +1 -0
- package/esm/MaqlEditor/theme/theme.js +9 -0
- package/esm/MetricComponent/ConflictContext/ConflictContext.d.ts +9 -0
- package/esm/MetricComponent/ConflictContext/ConflictContext.d.ts.map +1 -0
- package/esm/MetricComponent/ConflictContext/ConflictContext.js +9 -0
- package/esm/MetricComponent/ConflictContext/useConflictDetection.d.ts +8 -0
- package/esm/MetricComponent/ConflictContext/useConflictDetection.d.ts.map +1 -0
- package/esm/MetricComponent/ConflictContext/useConflictDetection.js +48 -0
- package/esm/MetricComponent/Content/EditMetricContent.d.ts +3 -0
- package/esm/MetricComponent/Content/EditMetricContent.d.ts.map +1 -0
- package/esm/MetricComponent/Content/EditMetricContent.data.d.ts +52 -0
- package/esm/MetricComponent/Content/EditMetricContent.data.d.ts.map +1 -0
- package/esm/MetricComponent/Content/EditMetricContent.data.js +12 -0
- package/esm/MetricComponent/Content/EditMetricContent.events.d.ts +9 -0
- package/esm/MetricComponent/Content/EditMetricContent.events.d.ts.map +1 -0
- package/esm/MetricComponent/Content/EditMetricContent.events.js +21 -0
- package/esm/MetricComponent/Content/EditMetricContent.js +27 -0
- package/esm/MetricComponent/DeleteMetric.d.ts +12 -0
- package/esm/MetricComponent/DeleteMetric.d.ts.map +1 -0
- package/esm/MetricComponent/DeleteMetric.events.d.ts +10 -0
- package/esm/MetricComponent/DeleteMetric.events.d.ts.map +1 -0
- package/esm/MetricComponent/DeleteMetric.events.js +24 -0
- package/esm/MetricComponent/DeleteMetric.js +8 -0
- package/esm/MetricComponent/DeleteMetricConfirmDialog/DeleteMetricConfirmDialog.d.ts +6 -0
- package/esm/MetricComponent/DeleteMetricConfirmDialog/DeleteMetricConfirmDialog.d.ts.map +1 -0
- package/esm/MetricComponent/DeleteMetricConfirmDialog/DeleteMetricConfirmDialog.js +19 -0
- package/esm/MetricComponent/EditMetric.d.ts +48 -0
- package/esm/MetricComponent/EditMetric.d.ts.map +1 -0
- package/esm/MetricComponent/EditMetric.events.d.ts +16 -0
- package/esm/MetricComponent/EditMetric.events.d.ts.map +1 -0
- package/esm/MetricComponent/EditMetric.events.js +55 -0
- package/esm/MetricComponent/EditMetric.js +30 -0
- package/esm/MetricComponent/FeaturesAndSettings/index.d.ts +18 -0
- package/esm/MetricComponent/FeaturesAndSettings/index.d.ts.map +1 -0
- package/esm/MetricComponent/FeaturesAndSettings/index.js +25 -0
- package/esm/MetricComponent/Form/CloseButton/CloseButton.d.ts +6 -0
- package/esm/MetricComponent/Form/CloseButton/CloseButton.d.ts.map +1 -0
- package/esm/MetricComponent/Form/CloseButton/CloseButton.js +14 -0
- package/esm/MetricComponent/Form/EditMetricCenterForm.d.ts +15 -0
- package/esm/MetricComponent/Form/EditMetricCenterForm.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditMetricCenterForm.js +157 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.d.ts +45 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.events.d.ts +13 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.events.js +32 -0
- package/esm/MetricComponent/Form/EditMetricContentForm.js +106 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRow.d.ts +16 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRow.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRow.js +82 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRowError.d.ts +13 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRowError.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditableRow/EditableRowError.js +5 -0
- package/esm/MetricComponent/Form/EditableRow/InlineEditableValue.d.ts +27 -0
- package/esm/MetricComponent/Form/EditableRow/InlineEditableValue.d.ts.map +1 -0
- package/esm/MetricComponent/Form/EditableRow/InlineEditableValue.js +125 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.d.ts +9 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.events.d.ts +7 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.events.js +11 -0
- package/esm/MetricComponent/Form/Footer/EditMetricContentFooter.js +63 -0
- package/esm/MetricComponent/Form/Footer/EditMetricSaveMessage.d.ts +8 -0
- package/esm/MetricComponent/Form/Footer/EditMetricSaveMessage.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Footer/EditMetricSaveMessage.js +22 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.d.ts +28 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.events.d.ts +7 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.events.js +11 -0
- package/esm/MetricComponent/Form/Header/EditMetricContentHeader.js +48 -0
- package/esm/MetricComponent/Form/Header/LockedBubble.d.ts +3 -0
- package/esm/MetricComponent/Form/Header/LockedBubble.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/LockedBubble.js +14 -0
- package/esm/MetricComponent/Form/Header/MetricDescriptionField.d.ts +10 -0
- package/esm/MetricComponent/Form/Header/MetricDescriptionField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricDescriptionField.js +24 -0
- package/esm/MetricComponent/Form/Header/MetricIdField.d.ts +9 -0
- package/esm/MetricComponent/Form/Header/MetricIdField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricIdField.js +80 -0
- package/esm/MetricComponent/Form/Header/MetricTagsField.d.ts +8 -0
- package/esm/MetricComponent/Form/Header/MetricTagsField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricTagsField.js +61 -0
- package/esm/MetricComponent/Form/Header/MetricTitleField.d.ts +8 -0
- package/esm/MetricComponent/Form/Header/MetricTitleField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricTitleField.js +40 -0
- package/esm/MetricComponent/Form/Header/MetricTypeField.d.ts +8 -0
- package/esm/MetricComponent/Form/Header/MetricTypeField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/MetricTypeField.js +42 -0
- package/esm/MetricComponent/Form/Header/Usage/Usage.d.ts +13 -0
- package/esm/MetricComponent/Form/Header/Usage/Usage.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/Usage/Usage.js +68 -0
- package/esm/MetricComponent/Form/Header/Usage/UsageItems.d.ts +11 -0
- package/esm/MetricComponent/Form/Header/Usage/UsageItems.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/Usage/UsageItems.js +88 -0
- package/esm/MetricComponent/Form/Header/Usage/UsagesOverlay.d.ts +17 -0
- package/esm/MetricComponent/Form/Header/Usage/UsagesOverlay.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/Usage/UsagesOverlay.js +119 -0
- package/esm/MetricComponent/Form/Header/share/MetricAccessChip.d.ts +9 -0
- package/esm/MetricComponent/Form/Header/share/MetricAccessChip.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/share/MetricAccessChip.js +39 -0
- package/esm/MetricComponent/Form/Header/share/MetricShare.d.ts +17 -0
- package/esm/MetricComponent/Form/Header/share/MetricShare.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/share/MetricShare.js +36 -0
- package/esm/MetricComponent/Form/Header/share/useApplyMetricAccess.d.ts +10 -0
- package/esm/MetricComponent/Form/Header/share/useApplyMetricAccess.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Header/share/useApplyMetricAccess.js +39 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.d.ts +11 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorEditor.js +128 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.d.ts +9 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.events.d.ts +11 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.events.js +25 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorField.js +68 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorHeader.d.ts +14 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/MaqlEditorHeader.js +84 -0
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.d.ts +3 -0
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorField/suggestionDetailsFunctions.js +57 -0
- package/esm/MetricComponent/Form/MaqlEditorUtils/Placeholder.d.ts +8 -0
- package/esm/MetricComponent/Form/MaqlEditorUtils/Placeholder.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlEditorUtils/Placeholder.js +72 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResult.d.ts +19 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResult.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResult.js +144 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResultHeader.d.ts +23 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResultHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlResultHeader.js +54 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.d.ts +8 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSql.js +54 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSqlHeader.d.ts +10 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSqlHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/MaqlSqlHeader.js +46 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelect.d.ts +15 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelect.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelect.js +171 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelectItem.d.ts +10 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelectItem.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/components/AttributesSelectItem.js +23 -0
- package/esm/MetricComponent/Form/MaqlResult/components/LimitSelect.d.ts +11 -0
- package/esm/MetricComponent/Form/MaqlResult/components/LimitSelect.d.ts.map +1 -0
- package/esm/MetricComponent/Form/MaqlResult/components/LimitSelect.js +134 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.d.ts +10 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.d.ts.map +1 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.events.d.ts +7 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.events.d.ts.map +1 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.events.js +12 -0
- package/esm/MetricComponent/Form/NumberFormat/EditMetricContentNumberFormat.js +83 -0
- package/esm/MetricComponent/Form/OtherMetrics/OtherMetricsContext.d.ts +13 -0
- package/esm/MetricComponent/Form/OtherMetrics/OtherMetricsContext.d.ts.map +1 -0
- package/esm/MetricComponent/Form/OtherMetrics/OtherMetricsContext.js +23 -0
- package/esm/MetricComponent/Form/OtherMetrics/useOtherMetrics.d.ts +3 -0
- package/esm/MetricComponent/Form/OtherMetrics/useOtherMetrics.d.ts.map +1 -0
- package/esm/MetricComponent/Form/OtherMetrics/useOtherMetrics.js +6 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeader.d.ts +20 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeader.d.ts.map +1 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeader.js +90 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeaderButton.d.ts +16 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeaderButton.d.ts.map +1 -0
- package/esm/MetricComponent/Form/PartHeader/PartHeaderButton.js +29 -0
- package/esm/MetricComponent/Form/Prefixes/PrefixesContext.d.ts +12 -0
- package/esm/MetricComponent/Form/Prefixes/PrefixesContext.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Prefixes/PrefixesContext.js +10 -0
- package/esm/MetricComponent/Form/Prefixes/usePrefixes.d.ts +3 -0
- package/esm/MetricComponent/Form/Prefixes/usePrefixes.d.ts.map +1 -0
- package/esm/MetricComponent/Form/Prefixes/usePrefixes.js +6 -0
- package/esm/MetricComponent/Form/TestingFormProvider.d.ts +10 -0
- package/esm/MetricComponent/Form/TestingFormProvider.d.ts.map +1 -0
- package/esm/MetricComponent/Form/TestingFormProvider.js +7 -0
- package/esm/MetricComponent/Form/attribute.d.ts +3 -0
- package/esm/MetricComponent/Form/attribute.d.ts.map +1 -0
- package/esm/MetricComponent/Form/attribute.js +9 -0
- package/esm/MetricComponent/Form/data.d.ts +23 -0
- package/esm/MetricComponent/Form/data.d.ts.map +1 -0
- package/esm/MetricComponent/Form/data.js +12 -0
- package/esm/MetricComponent/Form/hooks/useCatalog.d.ts +9 -0
- package/esm/MetricComponent/Form/hooks/useCatalog.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useCatalog.js +72 -0
- package/esm/MetricComponent/Form/hooks/useExecute.d.ts +14 -0
- package/esm/MetricComponent/Form/hooks/useExecute.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useExecute.js +26 -0
- package/esm/MetricComponent/Form/hooks/useExplain.d.ts +10 -0
- package/esm/MetricComponent/Form/hooks/useExplain.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useExplain.js +50 -0
- package/esm/MetricComponent/Form/hooks/useInvalidFocus.d.ts +5 -0
- package/esm/MetricComponent/Form/hooks/useInvalidFocus.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useInvalidFocus.js +20 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormField.d.ts +10 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormField.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormField.js +16 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormStatus.d.ts +5 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormStatus.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormStatus.js +5 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormatState.d.ts +41 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormatState.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricFormatState.js +50 -0
- package/esm/MetricComponent/Form/hooks/useMetricValidation.d.ts +11 -0
- package/esm/MetricComponent/Form/hooks/useMetricValidation.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useMetricValidation.js +53 -0
- package/esm/MetricComponent/Form/hooks/useTitleExistsCheck.d.ts +2 -0
- package/esm/MetricComponent/Form/hooks/useTitleExistsCheck.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useTitleExistsCheck.js +19 -0
- package/esm/MetricComponent/Form/hooks/useToggleWithCollapse.d.ts +4 -0
- package/esm/MetricComponent/Form/hooks/useToggleWithCollapse.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useToggleWithCollapse.js +16 -0
- package/esm/MetricComponent/Form/hooks/useUniqIdGenerator.d.ts +2 -0
- package/esm/MetricComponent/Form/hooks/useUniqIdGenerator.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useUniqIdGenerator.js +48 -0
- package/esm/MetricComponent/Form/hooks/useValidationScheme.d.ts +10 -0
- package/esm/MetricComponent/Form/hooks/useValidationScheme.d.ts.map +1 -0
- package/esm/MetricComponent/Form/hooks/useValidationScheme.js +17 -0
- package/esm/MetricComponent/Form/inlineMeasure.d.ts +3 -0
- package/esm/MetricComponent/Form/inlineMeasure.d.ts.map +1 -0
- package/esm/MetricComponent/Form/inlineMeasure.js +11 -0
- package/esm/MetricComponent/Form/maqlFieldFunctions.d.ts +17 -0
- package/esm/MetricComponent/Form/maqlFieldFunctions.d.ts.map +1 -0
- package/esm/MetricComponent/Form/maqlFieldFunctions.js +43 -0
- package/esm/MetricComponent/Form/validationSchema.d.ts +12 -0
- package/esm/MetricComponent/Form/validationSchema.d.ts.map +1 -0
- package/esm/MetricComponent/Form/validationSchema.js +123 -0
- package/esm/MetricComponent/IdChangeConfirmDialog/IdChangeConfirmDialog.d.ts +15 -0
- package/esm/MetricComponent/IdChangeConfirmDialog/IdChangeConfirmDialog.d.ts.map +1 -0
- package/esm/MetricComponent/IdChangeConfirmDialog/IdChangeConfirmDialog.js +75 -0
- package/esm/MetricComponent/ManageMetric.d.ts +38 -0
- package/esm/MetricComponent/ManageMetric.d.ts.map +1 -0
- package/esm/MetricComponent/ManageMetric.js +29 -0
- package/esm/MetricComponent/ManageMetrics.d.ts +23 -0
- package/esm/MetricComponent/ManageMetrics.d.ts.map +1 -0
- package/esm/MetricComponent/ManageMetrics.js +32 -0
- package/esm/MetricComponent/MetricService.d.ts +7 -0
- package/esm/MetricComponent/MetricService.d.ts.map +1 -0
- package/esm/MetricComponent/MetricService.js +7 -0
- package/esm/MetricComponent/MetricState/TabContent.d.ts +37 -0
- package/esm/MetricComponent/MetricState/TabContent.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/TabContent.js +21 -0
- package/esm/MetricComponent/MetricState/hooks/useChangeIdDialog.d.ts +23 -0
- package/esm/MetricComponent/MetricState/hooks/useChangeIdDialog.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useChangeIdDialog.js +68 -0
- package/esm/MetricComponent/MetricState/hooks/useDirtyChanged.d.ts +4 -0
- package/esm/MetricComponent/MetricState/hooks/useDirtyChanged.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useDirtyChanged.js +16 -0
- package/esm/MetricComponent/MetricState/hooks/useOnChangeCallback.d.ts +17 -0
- package/esm/MetricComponent/MetricState/hooks/useOnChangeCallback.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useOnChangeCallback.js +41 -0
- package/esm/MetricComponent/MetricState/hooks/useOnDeleteCallback.d.ts +5 -0
- package/esm/MetricComponent/MetricState/hooks/useOnDeleteCallback.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useOnDeleteCallback.js +9 -0
- package/esm/MetricComponent/MetricState/hooks/useOnSaveCallback.d.ts +6 -0
- package/esm/MetricComponent/MetricState/hooks/useOnSaveCallback.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useOnSaveCallback.js +9 -0
- package/esm/MetricComponent/MetricState/hooks/useSaveTab.d.ts +9 -0
- package/esm/MetricComponent/MetricState/hooks/useSaveTab.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useSaveTab.js +93 -0
- package/esm/MetricComponent/MetricState/hooks/useTabsData.d.ts +16 -0
- package/esm/MetricComponent/MetricState/hooks/useTabsData.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useTabsData.js +62 -0
- package/esm/MetricComponent/MetricState/hooks/useUnsavedChanges.d.ts +17 -0
- package/esm/MetricComponent/MetricState/hooks/useUnsavedChanges.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useUnsavedChanges.js +86 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricData.d.ts +5 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricData.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricData.js +10 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricTab.d.ts +6 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricTab.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/hooks/useUpdateMetricTab.js +17 -0
- package/esm/MetricComponent/MetricState/metricState.data.d.ts +37 -0
- package/esm/MetricComponent/MetricState/metricState.data.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/metricState.data.js +13 -0
- package/esm/MetricComponent/MetricState/useMetricState.d.ts +27 -0
- package/esm/MetricComponent/MetricState/useMetricState.d.ts.map +1 -0
- package/esm/MetricComponent/MetricState/useMetricState.js +127 -0
- package/esm/MetricComponent/MetricsContext/MetricsContext.d.ts +11 -0
- package/esm/MetricComponent/MetricsContext/MetricsContext.d.ts.map +1 -0
- package/esm/MetricComponent/MetricsContext/MetricsContext.js +14 -0
- package/esm/MetricComponent/MetricsContext/useMetricsContext.d.ts +3 -0
- package/esm/MetricComponent/MetricsContext/useMetricsContext.d.ts.map +1 -0
- package/esm/MetricComponent/MetricsContext/useMetricsContext.js +6 -0
- package/esm/MetricComponent/MetricsState.d.ts +39 -0
- package/esm/MetricComponent/MetricsState.d.ts.map +1 -0
- package/esm/MetricComponent/MetricsState.js +73 -0
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.d.ts +12 -0
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.d.ts.map +1 -0
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.js +110 -0
- package/esm/MetricComponent/MinimizedMetrics.d.ts +10 -0
- package/esm/MetricComponent/MinimizedMetrics.d.ts.map +1 -0
- package/esm/MetricComponent/MinimizedMetrics.js +19 -0
- package/esm/MetricComponent/MultipleMetricsState.d.ts +61 -0
- package/esm/MetricComponent/MultipleMetricsState.d.ts.map +1 -0
- package/esm/MetricComponent/MultipleMetricsState.js +53 -0
- package/esm/MetricComponent/UnsavedChangesConfirmDialog/UnsavedChangesConfirmDialog.d.ts +14 -0
- package/esm/MetricComponent/UnsavedChangesConfirmDialog/UnsavedChangesConfirmDialog.d.ts.map +1 -0
- package/esm/MetricComponent/UnsavedChangesConfirmDialog/UnsavedChangesConfirmDialog.js +52 -0
- package/esm/MetricComponent/hooks/useDeleteCallbacks.d.ts +7 -0
- package/esm/MetricComponent/hooks/useDeleteCallbacks.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useDeleteCallbacks.js +52 -0
- package/esm/MetricComponent/hooks/useDirtyChanged.d.ts +2 -0
- package/esm/MetricComponent/hooks/useDirtyChanged.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useDirtyChanged.js +10 -0
- package/esm/MetricComponent/hooks/useEditCallbacks.d.ts +23 -0
- package/esm/MetricComponent/hooks/useEditCallbacks.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useEditCallbacks.js +107 -0
- package/esm/MetricComponent/hooks/useFocusedField.d.ts +4 -0
- package/esm/MetricComponent/hooks/useFocusedField.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useFocusedField.js +9 -0
- package/esm/MetricComponent/hooks/useIdCallbacks.d.ts +22 -0
- package/esm/MetricComponent/hooks/useIdCallbacks.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useIdCallbacks.js +46 -0
- package/esm/MetricComponent/hooks/useInitialValueMetric.d.ts +4 -0
- package/esm/MetricComponent/hooks/useInitialValueMetric.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useInitialValueMetric.js +12 -0
- package/esm/MetricComponent/hooks/useInitialValues.d.ts +3 -0
- package/esm/MetricComponent/hooks/useInitialValues.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useInitialValues.js +13 -0
- package/esm/MetricComponent/hooks/useMetricContentState.d.ts +38 -0
- package/esm/MetricComponent/hooks/useMetricContentState.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricContentState.js +73 -0
- package/esm/MetricComponent/hooks/useMetricDelete.d.ts +3 -0
- package/esm/MetricComponent/hooks/useMetricDelete.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricDelete.js +14 -0
- package/esm/MetricComponent/hooks/useMetricSave.d.ts +4 -0
- package/esm/MetricComponent/hooks/useMetricSave.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricSave.js +52 -0
- package/esm/MetricComponent/hooks/useMetricUsage.d.ts +8 -0
- package/esm/MetricComponent/hooks/useMetricUsage.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useMetricUsage.js +21 -0
- package/esm/MetricComponent/hooks/useOnCloseOrCancel.d.ts +7 -0
- package/esm/MetricComponent/hooks/useOnCloseOrCancel.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useOnCloseOrCancel.js +26 -0
- package/esm/MetricComponent/hooks/useOnSaveUnchanged.d.ts +12 -0
- package/esm/MetricComponent/hooks/useOnSaveUnchanged.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useOnSaveUnchanged.js +30 -0
- package/esm/MetricComponent/hooks/useSaveAsClick.d.ts +6 -0
- package/esm/MetricComponent/hooks/useSaveAsClick.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useSaveAsClick.js +62 -0
- package/esm/MetricComponent/hooks/useSaveClick.d.ts +11 -0
- package/esm/MetricComponent/hooks/useSaveClick.d.ts.map +1 -0
- package/esm/MetricComponent/hooks/useSaveClick.js +47 -0
- package/esm/MetricComponent/metric/deleteInfo.d.ts +6 -0
- package/esm/MetricComponent/metric/deleteInfo.d.ts.map +1 -0
- package/esm/MetricComponent/metric/deleteInfo.js +6 -0
- package/esm/MetricComponent/metric/emptyMetric.d.ts +8 -0
- package/esm/MetricComponent/metric/emptyMetric.d.ts.map +1 -0
- package/esm/MetricComponent/metric/emptyMetric.js +13 -0
- package/esm/MetricComponent/metric/idChangeHelper.d.ts +5 -0
- package/esm/MetricComponent/metric/idChangeHelper.d.ts.map +1 -0
- package/esm/MetricComponent/metric/idChangeHelper.js +11 -0
- package/esm/MetricComponent/metric/idValidator.d.ts +3 -0
- package/esm/MetricComponent/metric/idValidator.d.ts.map +1 -0
- package/esm/MetricComponent/metric/idValidator.js +5 -0
- package/esm/MetricComponent/metric/metricHelpers.d.ts +29 -0
- package/esm/MetricComponent/metric/metricHelpers.d.ts.map +1 -0
- package/esm/MetricComponent/metric/metricHelpers.js +114 -0
- package/esm/MetricComponent/metric/nameGenerators.d.ts +13 -0
- package/esm/MetricComponent/metric/nameGenerators.d.ts.map +1 -0
- package/esm/MetricComponent/metric/nameGenerators.js +63 -0
- package/esm/MetricComponent/metric/prefixHelper.d.ts +7 -0
- package/esm/MetricComponent/metric/prefixHelper.d.ts.map +1 -0
- package/esm/MetricComponent/metric/prefixHelper.js +43 -0
- package/esm/MetricComponent/metric/saveInfo.d.ts +13 -0
- package/esm/MetricComponent/metric/saveInfo.d.ts.map +1 -0
- package/esm/MetricComponent/metric/saveInfo.js +10 -0
- package/esm/MetricComponent/metric/transformer.d.ts +5 -0
- package/esm/MetricComponent/metric/transformer.d.ts.map +1 -0
- package/esm/MetricComponent/metric/transformer.js +17 -0
- package/esm/index.d.ts +41 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +35 -0
- package/esm/shared/Form/Form.d.ts +25 -0
- package/esm/shared/Form/Form.d.ts.map +1 -0
- package/esm/shared/Form/Form.js +48 -0
- package/esm/shared/Form/FormApi.d.ts +8 -0
- package/esm/shared/Form/FormApi.d.ts.map +1 -0
- package/esm/shared/Form/FormApi.js +14 -0
- package/esm/shared/Form/FormContext.d.ts +52 -0
- package/esm/shared/Form/FormContext.d.ts.map +1 -0
- package/esm/shared/Form/FormContext.js +50 -0
- package/esm/shared/Form/data.d.ts +5 -0
- package/esm/shared/Form/data.d.ts.map +1 -0
- package/esm/shared/Form/data.js +6 -0
- package/esm/shared/Form/hooks/useChanged.d.ts +5 -0
- package/esm/shared/Form/hooks/useChanged.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useChanged.js +14 -0
- package/esm/shared/Form/hooks/useDirty.d.ts +3 -0
- package/esm/shared/Form/hooks/useDirty.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useDirty.js +9 -0
- package/esm/shared/Form/hooks/useFormHandlersInternal.d.ts +12 -0
- package/esm/shared/Form/hooks/useFormHandlersInternal.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useFormHandlersInternal.js +16 -0
- package/esm/shared/Form/hooks/useFormState.d.ts +4 -0
- package/esm/shared/Form/hooks/useFormState.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useFormState.js +33 -0
- package/esm/shared/Form/hooks/useFormStatusInternal.d.ts +32 -0
- package/esm/shared/Form/hooks/useFormStatusInternal.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useFormStatusInternal.js +34 -0
- package/esm/shared/Form/hooks/useInvalidFocusField.d.ts +3 -0
- package/esm/shared/Form/hooks/useInvalidFocusField.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useInvalidFocusField.js +8 -0
- package/esm/shared/Form/hooks/useMutations.d.ts +4 -0
- package/esm/shared/Form/hooks/useMutations.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useMutations.js +97 -0
- package/esm/shared/Form/hooks/useRealFocus.d.ts +5 -0
- package/esm/shared/Form/hooks/useRealFocus.d.ts.map +1 -0
- package/esm/shared/Form/hooks/useRealFocus.js +38 -0
- package/esm/shared/Form/useFormChanged.d.ts +2 -0
- package/esm/shared/Form/useFormChanged.d.ts.map +1 -0
- package/esm/shared/Form/useFormChanged.js +12 -0
- package/esm/shared/Form/useFormDefaults.d.ts +2 -0
- package/esm/shared/Form/useFormDefaults.d.ts.map +1 -0
- package/esm/shared/Form/useFormDefaults.js +7 -0
- package/esm/shared/Form/useFormDirty.d.ts +2 -0
- package/esm/shared/Form/useFormDirty.d.ts.map +1 -0
- package/esm/shared/Form/useFormDirty.js +13 -0
- package/esm/shared/Form/useFormErrors.d.ts +3 -0
- package/esm/shared/Form/useFormErrors.d.ts.map +1 -0
- package/esm/shared/Form/useFormErrors.js +18 -0
- package/esm/shared/Form/useFormField.d.ts +24 -0
- package/esm/shared/Form/useFormField.d.ts.map +1 -0
- package/esm/shared/Form/useFormField.js +60 -0
- package/esm/shared/Form/useFormFieldElementRef.d.ts +3 -0
- package/esm/shared/Form/useFormFieldElementRef.d.ts.map +1 -0
- package/esm/shared/Form/useFormFieldElementRef.js +10 -0
- package/esm/shared/Form/useFormHandlers.d.ts +8 -0
- package/esm/shared/Form/useFormHandlers.d.ts.map +1 -0
- package/esm/shared/Form/useFormHandlers.js +45 -0
- package/esm/shared/Form/useFormStatus.d.ts +3 -0
- package/esm/shared/Form/useFormStatus.d.ts.map +1 -0
- package/esm/shared/Form/useFormStatus.js +10 -0
- package/esm/shared/Form/useFormValues.d.ts +3 -0
- package/esm/shared/Form/useFormValues.d.ts.map +1 -0
- package/esm/shared/Form/useFormValues.js +11 -0
- package/esm/shared/Form/utils.d.ts +2 -0
- package/esm/shared/Form/utils.d.ts.map +1 -0
- package/esm/shared/Form/utils.js +5 -0
- package/esm/shared/GlobalLoading/GlobalLoading.d.ts +2 -0
- package/esm/shared/GlobalLoading/GlobalLoading.d.ts.map +1 -0
- package/esm/shared/GlobalLoading/GlobalLoading.js +15 -0
- package/esm/shared/MaqlPreview/MaqlPreview.d.ts +19 -0
- package/esm/shared/MaqlPreview/MaqlPreview.d.ts.map +1 -0
- package/esm/shared/MaqlPreview/MaqlPreview.js +107 -0
- package/esm/shared/MaqlPreview/backend/measureExpressionTokens.d.ts +18 -0
- package/esm/shared/MaqlPreview/backend/measureExpressionTokens.d.ts.map +1 -0
- package/esm/shared/MaqlPreview/backend/measureExpressionTokens.js +83 -0
- package/esm/shared/MaqlPreview/hooks/useMetricTokens.d.ts +8 -0
- package/esm/shared/MaqlPreview/hooks/useMetricTokens.d.ts.map +1 -0
- package/esm/shared/MaqlPreview/hooks/useMetricTokens.js +14 -0
- package/esm/shared/MetricTooltip/MetricTooltip.d.ts +14 -0
- package/esm/shared/MetricTooltip/MetricTooltip.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/MetricTooltip.events.d.ts +9 -0
- package/esm/shared/MetricTooltip/MetricTooltip.events.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/MetricTooltip.events.js +18 -0
- package/esm/shared/MetricTooltip/MetricTooltip.js +46 -0
- package/esm/shared/MetricTooltip/MetricTooltipContent.d.ts +12 -0
- package/esm/shared/MetricTooltip/MetricTooltipContent.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/MetricTooltipContent.js +38 -0
- package/esm/shared/MetricTooltip/fixtures.d.ts +3 -0
- package/esm/shared/MetricTooltip/fixtures.d.ts.map +1 -0
- package/esm/shared/MetricTooltip/fixtures.js +16 -0
- package/esm/shared/Tabs/Tab.d.ts +31 -0
- package/esm/shared/Tabs/Tab.d.ts.map +1 -0
- package/esm/shared/Tabs/Tab.js +171 -0
- package/esm/shared/Tabs/Tabs.classes.d.ts +13 -0
- package/esm/shared/Tabs/Tabs.classes.d.ts.map +1 -0
- package/esm/shared/Tabs/Tabs.classes.js +13 -0
- package/esm/shared/Tabs/Tabs.d.ts +4 -0
- package/esm/shared/Tabs/Tabs.d.ts.map +1 -0
- package/esm/shared/Tabs/Tabs.data.d.ts +37 -0
- package/esm/shared/Tabs/Tabs.data.d.ts.map +1 -0
- package/esm/shared/Tabs/Tabs.data.js +4 -0
- package/esm/shared/Tabs/Tabs.js +195 -0
- package/esm/shared/Tabs/hooks/useChangeScroll.d.ts +2 -0
- package/esm/shared/Tabs/hooks/useChangeScroll.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useChangeScroll.js +19 -0
- package/esm/shared/Tabs/hooks/useMouseDownRepeat.d.ts +3 -0
- package/esm/shared/Tabs/hooks/useMouseDownRepeat.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useMouseDownRepeat.js +43 -0
- package/esm/shared/Tabs/hooks/useScrollByButtons.d.ts +9 -0
- package/esm/shared/Tabs/hooks/useScrollByButtons.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useScrollByButtons.js +76 -0
- package/esm/shared/Tabs/hooks/useScrollToActive.d.ts +2 -0
- package/esm/shared/Tabs/hooks/useScrollToActive.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useScrollToActive.js +36 -0
- package/esm/shared/Tabs/hooks/useTabCallbacks.d.ts +7 -0
- package/esm/shared/Tabs/hooks/useTabCallbacks.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useTabCallbacks.js +17 -0
- package/esm/shared/Tabs/hooks/useTabs.d.ts +24 -0
- package/esm/shared/Tabs/hooks/useTabs.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useTabs.js +130 -0
- package/esm/shared/Tabs/hooks/useTabsCallbacks.d.ts +8 -0
- package/esm/shared/Tabs/hooks/useTabsCallbacks.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useTabsCallbacks.js +19 -0
- package/esm/shared/authentication/Authentication.d.ts +8 -0
- package/esm/shared/authentication/Authentication.d.ts.map +1 -0
- package/esm/shared/authentication/Authentication.js +51 -0
- package/esm/shared/backend/tigerContractExpiredHandler.d.ts +3 -0
- package/esm/shared/backend/tigerContractExpiredHandler.d.ts.map +1 -0
- package/esm/shared/backend/tigerContractExpiredHandler.js +19 -0
- package/esm/shared/backend/tigerNotAuthenticatedHandler.d.ts +9 -0
- package/esm/shared/backend/tigerNotAuthenticatedHandler.d.ts.map +1 -0
- package/esm/shared/backend/tigerNotAuthenticatedHandler.js +36 -0
- package/esm/shared/eventing/EventContext.d.ts +25 -0
- package/esm/shared/eventing/EventContext.d.ts.map +1 -0
- package/esm/shared/eventing/EventContext.js +35 -0
- package/esm/shared/eventing/events.d.ts +52 -0
- package/esm/shared/eventing/events.d.ts.map +1 -0
- package/esm/shared/eventing/events.js +56 -0
- package/esm/shared/eventing/functions/errorToTrackingData.d.ts +12 -0
- package/esm/shared/eventing/functions/errorToTrackingData.d.ts.map +1 -0
- package/esm/shared/eventing/functions/errorToTrackingData.js +10 -0
- package/esm/shared/eventing/useEvents.d.ts +10 -0
- package/esm/shared/eventing/useEvents.d.ts.map +1 -0
- package/esm/shared/eventing/useEvents.js +16 -0
- package/esm/shared/hooks/useApi.d.ts +4 -0
- package/esm/shared/hooks/useApi.d.ts.map +1 -0
- package/esm/shared/hooks/useApi.js +15 -0
- package/esm/shared/hooks/useFocus.d.ts +3 -0
- package/esm/shared/hooks/useFocus.d.ts.map +1 -0
- package/esm/shared/hooks/useFocus.js +55 -0
- package/esm/shared/hooks/usePromiseHandlerIndicator.d.ts +2 -0
- package/esm/shared/hooks/usePromiseHandlerIndicator.d.ts.map +1 -0
- package/esm/shared/hooks/usePromiseHandlerIndicator.js +11 -0
- package/esm/shared/hooks/useProp.d.ts +3 -0
- package/esm/shared/hooks/useProp.d.ts.map +1 -0
- package/esm/shared/hooks/useProp.js +15 -0
- package/esm/shared/links.d.ts +9 -0
- package/esm/shared/links.d.ts.map +1 -0
- package/esm/shared/links.js +9 -0
- package/esm/shared/metrics/MetricsReloadContext.d.ts +8 -0
- package/esm/shared/metrics/MetricsReloadContext.d.ts.map +1 -0
- package/esm/shared/metrics/MetricsReloadContext.js +14 -0
- package/esm/shared/metrics/functions/metricListData.d.ts +4 -0
- package/esm/shared/metrics/functions/metricListData.d.ts.map +1 -0
- package/esm/shared/metrics/functions/metricListData.js +29 -0
- package/esm/shared/metrics/useMetricListData.d.ts +29 -0
- package/esm/shared/metrics/useMetricListData.d.ts.map +1 -0
- package/esm/shared/metrics/useMetricListData.events.d.ts +12 -0
- package/esm/shared/metrics/useMetricListData.events.d.ts.map +1 -0
- package/esm/shared/metrics/useMetricListData.events.js +31 -0
- package/esm/shared/metrics/useMetricListData.js +52 -0
- package/esm/shared/metrics/useMetrics.d.ts +16 -0
- package/esm/shared/metrics/useMetrics.d.ts.map +1 -0
- package/esm/shared/metrics/useMetrics.js +34 -0
- package/esm/shared/metrics/useReloadMetrics.d.ts +3 -0
- package/esm/shared/metrics/useReloadMetrics.d.ts.map +1 -0
- package/esm/shared/metrics/useReloadMetrics.js +10 -0
- package/esm/shared/permissions.d.ts +10 -0
- package/esm/shared/permissions.d.ts.map +1 -0
- package/esm/shared/permissions.js +53 -0
- package/esm/shared/platform.d.ts +2 -0
- package/esm/shared/platform.d.ts.map +1 -0
- package/esm/shared/platform.js +4 -0
- package/esm/shared/theme/index.d.ts +416 -0
- package/esm/shared/theme/index.d.ts.map +1 -0
- package/esm/shared/theme/index.js +193 -0
- package/esm/tests/render.test.utils.d.ts +9 -0
- package/esm/tests/render.test.utils.d.ts.map +1 -0
- package/esm/tests/render.test.utils.js +18 -0
- package/esm/translations/IntlWrapper.d.ts +9 -0
- package/esm/translations/IntlWrapper.d.ts.map +1 -0
- package/esm/translations/IntlWrapper.js +11 -0
- package/esm/translations/de-DE.json +131 -0
- package/esm/translations/en-AU.json +131 -0
- package/esm/translations/en-GB.json +131 -0
- package/esm/translations/en-US.json +518 -0
- package/esm/translations/es-419.json +131 -0
- package/esm/translations/es-ES.json +131 -0
- package/esm/translations/fi-FI.json +131 -0
- package/esm/translations/fr-CA.json +131 -0
- package/esm/translations/fr-FR.json +131 -0
- package/esm/translations/id-ID.json +131 -0
- package/esm/translations/it-IT.json +131 -0
- package/esm/translations/ja-JP.json +131 -0
- package/esm/translations/ko-KR.json +131 -0
- package/esm/translations/nl-NL.json +131 -0
- package/esm/translations/pl-PL.json +131 -0
- package/esm/translations/pt-BR.json +131 -0
- package/esm/translations/pt-PT.json +131 -0
- package/esm/translations/ru-RU.json +131 -0
- package/esm/translations/sl-SI.json +131 -0
- package/esm/translations/th-TH.json +131 -0
- package/esm/translations/tr-TR.json +131 -0
- package/esm/translations/translations.d.ts +21 -0
- package/esm/translations/translations.d.ts.map +1 -0
- package/esm/translations/translations.js +89 -0
- package/esm/translations/uk-UA.json +131 -0
- package/esm/translations/vi-VN.json +131 -0
- package/esm/translations/zh-HK.json +131 -0
- package/esm/translations/zh-Hans.json +131 -0
- package/esm/translations/zh-Hant.json +131 -0
- package/package.json +116 -3
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { isMeasureMetadataObjectDefinition } from "@gooddata/sdk-model";
|
|
4
|
+
import { useEvents } from "../../shared/eventing/useEvents.js";
|
|
5
|
+
import { useReloadMetrics } from "../../shared/metrics/useReloadMetrics.js";
|
|
6
|
+
import { SaveNameMode } from "../Content/EditMetricContent.data.js";
|
|
7
|
+
import { events } from "../EditMetric.events.js";
|
|
8
|
+
import { createSaveMetricInfo } from "../metric/saveInfo.js";
|
|
9
|
+
import { MetricContextMode } from "../MetricsContext/MetricsContext.js";
|
|
10
|
+
import { useMetricsContext } from "../MetricsContext/useMetricsContext.js";
|
|
11
|
+
import { useMetricSave } from "./useMetricSave.js";
|
|
12
|
+
export function useEditCallbacks(metric, setCurrentMetric, usage, onCancel, onDelete, onSave, onMetricsChange,
|
|
13
|
+
/** Runs after the metric is persisted, with what the backend returned. Failures are swallowed. */
|
|
14
|
+
onSaved) {
|
|
15
|
+
const { needMetricReload } = useReloadMetrics();
|
|
16
|
+
const { metricSavedAndClosedEvent, metricSaveFailedEvent, metricSaveAsNewFailedEvent, metricClosedWithoutSaveEvent, metricDeleteClickEvent, } = useEvents(events);
|
|
17
|
+
const { mode } = useMetricsContext();
|
|
18
|
+
const saveMetricHandler = useMetricSave();
|
|
19
|
+
return useMemo(() => {
|
|
20
|
+
function handleMetricsChange(savedMetric, serverMetric) {
|
|
21
|
+
if (onMetricsChange) {
|
|
22
|
+
onMetricsChange(savedMetric);
|
|
23
|
+
}
|
|
24
|
+
return serverMetric;
|
|
25
|
+
}
|
|
26
|
+
function handleSave(savedMetric, serverMetric, saveMode, formField, regenerateId) {
|
|
27
|
+
const resolvedMetric = keepPermissions(savedMetric, serverMetric);
|
|
28
|
+
//NOTE: In multiple metrics mode we dont want to propagate changes into current form in save as new mode
|
|
29
|
+
if (saveMode !== SaveNameMode.saveAsNew || mode === MetricContextMode.Single) {
|
|
30
|
+
setCurrentMetric(resolvedMetric);
|
|
31
|
+
}
|
|
32
|
+
return onSave?.(resolvedMetric, createSaveMetricInfo(metric, usage, saveMode, regenerateId, formField), null);
|
|
33
|
+
}
|
|
34
|
+
function handleSuccess(savedMetric, start) {
|
|
35
|
+
metricSavedAndClosedEvent(savedMetric.id, savedMetric.expression, Date.now() - start, isMeasureMetadataObjectDefinition(metric));
|
|
36
|
+
}
|
|
37
|
+
function handlerError(savedMetric, saveMode, formField, regenerateId, err) {
|
|
38
|
+
if (saveMode === SaveNameMode.saveAsNew) {
|
|
39
|
+
metricSaveAsNewFailedEvent(err);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
metricSaveFailedEvent(err);
|
|
43
|
+
}
|
|
44
|
+
if (onSave) {
|
|
45
|
+
onSave(savedMetric, createSaveMetricInfo(metric, usage, saveMode, regenerateId, formField), err);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function onSaveHandler({ metric, saveMode, formField, regenerateId }) {
|
|
49
|
+
const savedMetric = metric;
|
|
50
|
+
const startTime = Date.now();
|
|
51
|
+
return saveMetricHandler(savedMetric)
|
|
52
|
+
.then((serverMetrics) => handleMetricsChange(savedMetric, serverMetrics))
|
|
53
|
+
.then(async (serverMetric) => {
|
|
54
|
+
needMetricReload();
|
|
55
|
+
try {
|
|
56
|
+
await onSaved?.(serverMetric);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// The metric is saved by now, so a failing follow-up must not report
|
|
60
|
+
// a failed save. try/catch, not `.catch`, which a sync throw escapes.
|
|
61
|
+
}
|
|
62
|
+
return handleSave(savedMetric, serverMetric, saveMode, formField, regenerateId);
|
|
63
|
+
})
|
|
64
|
+
.then(() => handleSuccess(savedMetric, startTime))
|
|
65
|
+
.catch((err) => handlerError(savedMetric, saveMode, formField, regenerateId, err));
|
|
66
|
+
}
|
|
67
|
+
function onDeleteHandler() {
|
|
68
|
+
needMetricReload();
|
|
69
|
+
if (onDelete) {
|
|
70
|
+
onDelete(metric);
|
|
71
|
+
}
|
|
72
|
+
metricDeleteClickEvent(metric.id);
|
|
73
|
+
}
|
|
74
|
+
function onCancelHandler({ cancelMode }) {
|
|
75
|
+
if (onCancel) {
|
|
76
|
+
onCancel(cancelMode);
|
|
77
|
+
}
|
|
78
|
+
metricClosedWithoutSaveEvent();
|
|
79
|
+
}
|
|
80
|
+
return { onSaveHandler, onDeleteHandler, onCancelHandler };
|
|
81
|
+
}, [
|
|
82
|
+
mode,
|
|
83
|
+
metric,
|
|
84
|
+
metricClosedWithoutSaveEvent,
|
|
85
|
+
metricDeleteClickEvent,
|
|
86
|
+
metricSaveAsNewFailedEvent,
|
|
87
|
+
metricSaveFailedEvent,
|
|
88
|
+
metricSavedAndClosedEvent,
|
|
89
|
+
needMetricReload,
|
|
90
|
+
onCancel,
|
|
91
|
+
onDelete,
|
|
92
|
+
onMetricsChange,
|
|
93
|
+
onSave,
|
|
94
|
+
onSaved,
|
|
95
|
+
saveMetricHandler,
|
|
96
|
+
setCurrentMetric,
|
|
97
|
+
usage,
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
// Create returns the new object's own permissions, but the update endpoint cannot return them at
|
|
101
|
+
// all. Saving content does not change them, so on update keep the ones the metric was opened with.
|
|
102
|
+
function keepPermissions(savedMetric, serverMetric) {
|
|
103
|
+
if (serverMetric.permissions || !savedMetric.permissions) {
|
|
104
|
+
return serverMetric;
|
|
105
|
+
}
|
|
106
|
+
return { ...serverMetric, permissions: savedMetric.permissions };
|
|
107
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FormField } from "../Form/data.js";
|
|
2
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
3
|
+
export declare function useFocusedField(initialValueMetric: IMeasureDef, field?: FormField): [FormField, (field: FormField) => void];
|
|
4
|
+
//# sourceMappingURL=useFocusedField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFocusedField.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useFocusedField.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,wBAAgB,eAAe,CAC3B,kBAAkB,EAAE,WAAW,EAC/B,KAAK,CAAC,EAAE,SAAS,GAClB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC,CAIzC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { isMeasureMetadataObjectDefinition } from "@gooddata/sdk-model";
|
|
4
|
+
import { FormField } from "../Form/data.js";
|
|
5
|
+
export function useFocusedField(initialValueMetric, field) {
|
|
6
|
+
const isDefinition = isMeasureMetadataObjectDefinition(initialValueMetric);
|
|
7
|
+
const currentField = isDefinition ? FormField.title : FormField.expression;
|
|
8
|
+
return useState(field || currentField);
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type MutableRefObject } from "react";
|
|
2
|
+
import { type MetricIdConflicts } from "../ConflictContext/useConflictDetection.js";
|
|
3
|
+
import { type IEditMetricDialogFormApi } from "../Form/EditMetricContentForm.js";
|
|
4
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
5
|
+
export declare function useIdCallbacks(idChangedData: {
|
|
6
|
+
visible: boolean;
|
|
7
|
+
conflicts: MetricIdConflicts;
|
|
8
|
+
idChanged: boolean;
|
|
9
|
+
oldId: string;
|
|
10
|
+
newId: string;
|
|
11
|
+
}, setIdDialogData: (data: {
|
|
12
|
+
visible: boolean;
|
|
13
|
+
conflicts: MetricIdConflicts;
|
|
14
|
+
idChanged: boolean;
|
|
15
|
+
oldId: string;
|
|
16
|
+
newId: string;
|
|
17
|
+
}) => void, comp: MutableRefObject<IEditMetricDialogFormApi | undefined>, metricToSave: IMeasureDef | undefined, defaultId: string): {
|
|
18
|
+
onSaveKeepIdClick: () => void;
|
|
19
|
+
onSaveChangeIdClick: () => void;
|
|
20
|
+
onCloseIdChange: () => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useIdCallbacks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIdCallbacks.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useIdCallbacks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,wBAAgB,cAAc,CAC1B,aAAa,EAAE;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,EACD,eAAe,EAAE,CAAC,IAAI,EAAE;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,KAAK,IAAI,EACV,IAAI,EAAE,gBAAgB,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAC5D,YAAY,EAAE,WAAW,GAAG,SAAS,EACrC,SAAS,EAAE,MAAM,GAClB;IACC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,eAAe,EAAE,MAAM,IAAI,CAAC;CAC/B,CA8CA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
export function useIdCallbacks(idChangedData, setIdDialogData, comp, metricToSave, defaultId) {
|
|
4
|
+
return useMemo(() => {
|
|
5
|
+
const onSaveKeepIdClick = () => {
|
|
6
|
+
setIdDialogData({
|
|
7
|
+
...idChangedData,
|
|
8
|
+
visible: false,
|
|
9
|
+
conflicts: { conflictWith: [], usableIds: [] },
|
|
10
|
+
idChanged: false,
|
|
11
|
+
});
|
|
12
|
+
//not change ids, but conflict exists
|
|
13
|
+
if (!idChangedData.idChanged && idChangedData.conflicts.conflictWith.length > 0) {
|
|
14
|
+
const newId = idChangedData.conflicts.usableIds[0];
|
|
15
|
+
if (metricToSave && comp.current) {
|
|
16
|
+
comp.current.saveForce({ id: newId });
|
|
17
|
+
}
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
//changed id, keep default
|
|
21
|
+
if (metricToSave && comp.current) {
|
|
22
|
+
comp.current.saveForce({ id: defaultId });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const onSaveChangeIdClick = () => {
|
|
26
|
+
setIdDialogData({
|
|
27
|
+
...idChangedData,
|
|
28
|
+
visible: false,
|
|
29
|
+
conflicts: { conflictWith: [], usableIds: [] },
|
|
30
|
+
idChanged: false,
|
|
31
|
+
});
|
|
32
|
+
if (metricToSave && comp.current) {
|
|
33
|
+
comp.current.saveForce();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const onCloseIdChange = () => {
|
|
37
|
+
setIdDialogData({
|
|
38
|
+
...idChangedData,
|
|
39
|
+
visible: false,
|
|
40
|
+
conflicts: { conflictWith: [], usableIds: [] },
|
|
41
|
+
idChanged: false,
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
return { onSaveKeepIdClick, onSaveChangeIdClick, onCloseIdChange };
|
|
45
|
+
}, [comp, defaultId, metricToSave, setIdDialogData, idChangedData]);
|
|
46
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
3
|
+
export declare function useInitialValueMetric(metric: IMeasureDef): [IMeasureDef, Dispatch<SetStateAction<IMeasureDef>>];
|
|
4
|
+
//# sourceMappingURL=useInitialValueMetric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInitialValueMetric.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useInitialValueMetric.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,WAAW,GACpB,CAAC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAUtD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { isEqual } from "lodash-es";
|
|
4
|
+
export function useInitialValueMetric(metric) {
|
|
5
|
+
const [initialValueMetric, setInitialValueMetric] = useState(metric);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (!isEqual(initialValueMetric, metric)) {
|
|
8
|
+
setInitialValueMetric(metric);
|
|
9
|
+
}
|
|
10
|
+
}, [initialValueMetric, metric]);
|
|
11
|
+
return [initialValueMetric, setInitialValueMetric];
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInitialValues.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useInitialValues.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAa,MAAM,OAAO,CAAC;AAI7F,wBAAgB,gBAAgB,CAAC,CAAC,EAC9B,YAAY,EAAE,CAAC,EACf,aAAa,CAAC,EAAE,CAAC,GAClB,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAW7D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useProp } from "../../shared/hooks/useProp.js";
|
|
4
|
+
export function useInitialValues(defaultValue, initialValues) {
|
|
5
|
+
const [state, setState, initial] = useProp(initialValues || defaultValue);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (initialValues) {
|
|
8
|
+
setState(defaultValue);
|
|
9
|
+
}
|
|
10
|
+
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
11
|
+
}, []);
|
|
12
|
+
return [state, setState, initial];
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type MutableRefObject } from "react";
|
|
2
|
+
import { type MetricIdConflicts } from "../ConflictContext/useConflictDetection.js";
|
|
3
|
+
import { SaveNameMode } from "../Content/EditMetricContent.data.js";
|
|
4
|
+
import { type FormField } from "../Form/data.js";
|
|
5
|
+
import { type IEditMetricDialogFormApi } from "../Form/EditMetricContentForm.js";
|
|
6
|
+
import { type IMeasureDef, type IMeasureSetting } from "../metric/metricHelpers.js";
|
|
7
|
+
import { type CancelData, type SaveData } from "./useEditCallbacks.js";
|
|
8
|
+
export type MetricContentState = {
|
|
9
|
+
comp: MutableRefObject<IEditMetricDialogFormApi | undefined>;
|
|
10
|
+
showIdChangeConfirmDialog: {
|
|
11
|
+
visible: boolean;
|
|
12
|
+
conflicts: MetricIdConflicts;
|
|
13
|
+
idChanged: boolean;
|
|
14
|
+
oldId: string;
|
|
15
|
+
newId: string;
|
|
16
|
+
};
|
|
17
|
+
showUnsavedChangesConfirmDialog: boolean;
|
|
18
|
+
initialValueMetric: IMeasureDef;
|
|
19
|
+
initialFocusedField: FormField;
|
|
20
|
+
initialRegenerateId: boolean;
|
|
21
|
+
defaultId: string;
|
|
22
|
+
defaultPrefix: string;
|
|
23
|
+
onSaveClick: (metricToSave: IMeasureDef, force?: boolean) => Promise<void>;
|
|
24
|
+
onSaveAsClick: (metricToSave: IMeasureDef) => Promise<void>;
|
|
25
|
+
onDirtyChangedCallback: (dirty: boolean) => void;
|
|
26
|
+
onValueChangedCallback: (value: IMeasureDef, valid: boolean) => void;
|
|
27
|
+
onSaveKeepIdClick: () => void;
|
|
28
|
+
onSaveChangeIdClick: () => void;
|
|
29
|
+
onCloseIdChange: () => void;
|
|
30
|
+
onCloseCallback: (metric: Partial<IMeasureDef>, valid: boolean) => void;
|
|
31
|
+
onCancelCallback: () => void;
|
|
32
|
+
onSaveUnchangedChangesCallback: () => void;
|
|
33
|
+
onCloseUnchangedChangesCallback: () => void;
|
|
34
|
+
onCancelUnchangedChangesCallback: () => void;
|
|
35
|
+
onSettingsChangeCallback: (settings: Partial<IMeasureSetting>) => void;
|
|
36
|
+
};
|
|
37
|
+
export declare function useMetricContentState(metric: IMeasureDef, focusedField: FormField | undefined, regenerateId: boolean | undefined, saveMode: SaveNameMode | undefined, onSave: (value: Required<SaveData>) => Promise<void>, onCancel: (value: CancelData) => void, onDirtyChanged?: (dirty: boolean, id: string) => void, onValueChange?: (value: IMeasureDef, valid: boolean) => void, onSettingsChange?: (settings: Partial<IMeasureSetting>) => void): MetricContentState;
|
|
38
|
+
//# sourceMappingURL=useMetricContentState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMetricContentState.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useMetricContentState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAiC,MAAM,OAAO,CAAC;AAK7E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIpF,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AASvE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,gBAAgB,CAAC,wBAAwB,GAAG,SAAS,CAAC,CAAC;IAC7D,yBAAyB,EAAE;QACvB,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,iBAAiB,CAAC;QAC7B,SAAS,EAAE,OAAO,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,+BAA+B,EAAE,OAAO,CAAC;IACzC,kBAAkB,EAAE,WAAW,CAAC;IAChC,mBAAmB,EAAE,SAAS,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,aAAa,EAAE,CAAC,YAAY,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,sBAAsB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,sBAAsB,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxE,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,8BAA8B,EAAE,MAAM,IAAI,CAAC;IAC3C,+BAA+B,EAAE,MAAM,IAAI,CAAC;IAC5C,gCAAgC,EAAE,MAAM,IAAI,CAAC;IAC7C,wBAAwB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CAC1E,CAAC;AACF,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,WAAW,EACnB,YAAY,EAAE,SAAS,GAAG,SAAS,EACnC,YAAY,EAAE,OAAO,GAAG,SAAS,EACjC,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACpD,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACrC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,EACrD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,EAC5D,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,GAChE,kBAAkB,CAsGpB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
import { useMetrics } from "../../shared/metrics/useMetrics.js";
|
|
4
|
+
import { SaveNameMode } from "../Content/EditMetricContent.data.js";
|
|
5
|
+
import { usePrefixes } from "../Form/Prefixes/usePrefixes.js";
|
|
6
|
+
import { addPrefixToMeasure } from "../metric/prefixHelper.js";
|
|
7
|
+
import { useDirtyChanged } from "./useDirtyChanged.js";
|
|
8
|
+
import { useFocusedField } from "./useFocusedField.js";
|
|
9
|
+
import { useIdCallbacks } from "./useIdCallbacks.js";
|
|
10
|
+
import { useInitialValueMetric } from "./useInitialValueMetric.js";
|
|
11
|
+
import { useOnCloseOrCancel } from "./useOnCloseOrCancel.js";
|
|
12
|
+
import { useOnSaveUnchanged } from "./useOnSaveUnchanged.js";
|
|
13
|
+
import { useSaveAsClick } from "./useSaveAsClick.js";
|
|
14
|
+
import { useSaveClick } from "./useSaveClick.js";
|
|
15
|
+
export function useMetricContentState(metric, focusedField, regenerateId, saveMode, onSave, onCancel, onDirtyChanged, onValueChange, onSettingsChange) {
|
|
16
|
+
const comp = useRef(undefined);
|
|
17
|
+
const [idChangeData, setChangeData] = useState({
|
|
18
|
+
visible: false,
|
|
19
|
+
conflicts: { conflictWith: [], usableIds: [] },
|
|
20
|
+
idChanged: false,
|
|
21
|
+
oldId: "",
|
|
22
|
+
newId: "",
|
|
23
|
+
});
|
|
24
|
+
const [showUnsavedChangesConfirmDialog, setShowUnsavedChangesConfirmDialog] = useState(false);
|
|
25
|
+
const [metricToSave, setMetricToSave] = useState();
|
|
26
|
+
const [dirty, setDirty] = useState(false);
|
|
27
|
+
const prefixes = usePrefixes();
|
|
28
|
+
const updatedMetric = addPrefixToMeasure(metric, prefixes?.current);
|
|
29
|
+
const [initialValueMetric, setInitialValueMetric] = useInitialValueMetric(updatedMetric);
|
|
30
|
+
const [initialFocusedField, setInitialFocusedField] = useFocusedField(initialValueMetric, focusedField);
|
|
31
|
+
const [initialSaveMode, setInitialSaveMode] = useState(saveMode || (hasRef(initialValueMetric) ? SaveNameMode.save : SaveNameMode.saveAsNew));
|
|
32
|
+
const [initialRegenerateId, setInitialRegenerateId] = useState(Boolean(regenerateId ||
|
|
33
|
+
(initialSaveMode === SaveNameMode.saveAsNew && saveMode !== SaveNameMode.saveAsNew)));
|
|
34
|
+
const [defaultId] = useState(updatedMetric.id || "");
|
|
35
|
+
const [defaultPrefix] = useState(updatedMetric.prefix || "");
|
|
36
|
+
const metrics = useMetrics();
|
|
37
|
+
const onSaveClick = useSaveClick(defaultId, setChangeData, setMetricToSave, onSave, initialSaveMode);
|
|
38
|
+
const onSaveAsClick = useSaveAsClick(defaultId, initialValueMetric, metrics.result || [], onSave, setInitialValueMetric, setInitialFocusedField, setInitialSaveMode, setInitialRegenerateId);
|
|
39
|
+
const { onSaveKeepIdClick, onSaveChangeIdClick, onCloseIdChange } = useIdCallbacks(idChangeData, setChangeData, comp, metricToSave, defaultId);
|
|
40
|
+
const onDirtyChangedCallback = useDirtyChanged(onDirtyChanged, setDirty, defaultId);
|
|
41
|
+
const { onCloseCallback, onCancelCallback } = useOnCloseOrCancel(dirty, onCancel, setMetricToSave, setShowUnsavedChangesConfirmDialog);
|
|
42
|
+
const { onSaveUnchangedChangesCallback, onCloseUnchangedChangesCallback, onCancelUnchangedChangesCallback, } = useOnSaveUnchanged(setShowUnsavedChangesConfirmDialog, comp, metricToSave, onCancel);
|
|
43
|
+
const onValueChangedCallback = useCallback((value, valid) => onValueChange?.(value, valid), [onValueChange]);
|
|
44
|
+
const onSettingsChangeCallback = useCallback((setting) => onSettingsChange?.(setting), [onSettingsChange]);
|
|
45
|
+
return {
|
|
46
|
+
comp,
|
|
47
|
+
defaultId,
|
|
48
|
+
defaultPrefix,
|
|
49
|
+
// The suggestion only runs while there is no object to name. Once the metric exists its
|
|
50
|
+
// ID is its API identifier, and following the title would replace the metric on save.
|
|
51
|
+
initialRegenerateId: initialRegenerateId && !hasRef(initialValueMetric),
|
|
52
|
+
showIdChangeConfirmDialog: idChangeData,
|
|
53
|
+
showUnsavedChangesConfirmDialog,
|
|
54
|
+
initialValueMetric,
|
|
55
|
+
initialFocusedField,
|
|
56
|
+
onSaveClick,
|
|
57
|
+
onSaveAsClick,
|
|
58
|
+
onDirtyChangedCallback,
|
|
59
|
+
onValueChangedCallback,
|
|
60
|
+
onSaveKeepIdClick,
|
|
61
|
+
onSaveChangeIdClick,
|
|
62
|
+
onCloseIdChange,
|
|
63
|
+
onSaveUnchangedChangesCallback,
|
|
64
|
+
onCloseUnchangedChangesCallback,
|
|
65
|
+
onCancelUnchangedChangesCallback,
|
|
66
|
+
onSettingsChangeCallback,
|
|
67
|
+
onCloseCallback,
|
|
68
|
+
onCancelCallback,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function hasRef(metric) {
|
|
72
|
+
return Boolean(metric.ref);
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMetricDelete.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useMetricDelete.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,wBAAgB,eAAe,IAAI,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAWxE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
4
|
+
export function useMetricDelete() {
|
|
5
|
+
const backend = useBackendStrict();
|
|
6
|
+
const workspaceId = useWorkspaceStrict();
|
|
7
|
+
return useCallback((metric) => {
|
|
8
|
+
const metricToDelete = metric;
|
|
9
|
+
return deleteMetric(backend, workspaceId, metricToDelete.ref);
|
|
10
|
+
}, [backend, workspaceId]);
|
|
11
|
+
}
|
|
12
|
+
function deleteMetric(backend, workspaceId, metricRef) {
|
|
13
|
+
return backend.workspace(workspaceId).measures().deleteMeasure(metricRef);
|
|
14
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type IMeasureMetadataObject } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
3
|
+
export declare function useMetricSave(): (metric: IMeasureDef) => Promise<IMeasureMetadataObject>;
|
|
4
|
+
//# sourceMappingURL=useMetricSave.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMetricSave.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useMetricSave.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,KAAK,sBAAsB,EAG9B,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAU9D,wBAAgB,aAAa,IAAI,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,sBAAsB,CAAC,CA8BxF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { defineMessages } from "react-intl";
|
|
4
|
+
import { isMeasureMetadataObjectDefinition, } from "@gooddata/sdk-model";
|
|
5
|
+
import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
6
|
+
import { useCopyObjectPermissions } from "@gooddata/sdk-ui-ext";
|
|
7
|
+
import { useToastMessage } from "@gooddata/sdk-ui-kit";
|
|
8
|
+
import { useFeaturesAndSettings } from "../FeaturesAndSettings/index.js";
|
|
9
|
+
// `defineMessages` rather than an inline `{ id }`: the locale checker only reads the former.
|
|
10
|
+
const messages = defineMessages({
|
|
11
|
+
accessNotCopied: { id: "metricComponent.editMetric.accessNotCopied" },
|
|
12
|
+
});
|
|
13
|
+
export function useMetricSave() {
|
|
14
|
+
const backend = useBackendStrict();
|
|
15
|
+
const workspaceId = useWorkspaceStrict();
|
|
16
|
+
const { enableMetricPermissions } = useFeaturesAndSettings();
|
|
17
|
+
const copyPermissions = useCopyObjectPermissions();
|
|
18
|
+
const { addWarning } = useToastMessage();
|
|
19
|
+
const copyAccess = useCallback(async (from, to) => {
|
|
20
|
+
if (!enableMetricPermissions) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
const copied = await copyPermissions({ kind: "measure", ref: from.ref }, { kind: "measure", ref: to.ref });
|
|
24
|
+
if (!copied) {
|
|
25
|
+
addWarning(messages.accessNotCopied);
|
|
26
|
+
}
|
|
27
|
+
return copied;
|
|
28
|
+
}, [enableMetricPermissions, copyPermissions, addWarning]);
|
|
29
|
+
return useCallback((metric) => {
|
|
30
|
+
return saveMetric(backend, workspaceId, metric, enableMetricPermissions, copyAccess);
|
|
31
|
+
}, [backend, workspaceId, enableMetricPermissions, copyAccess]);
|
|
32
|
+
}
|
|
33
|
+
async function saveMetric(backend, workspaceId, metric, loadPermissions, copyAccess) {
|
|
34
|
+
const metricsService = backend.workspace(workspaceId).measures();
|
|
35
|
+
if (isMeasureMetadataObjectDefinition(metric)) {
|
|
36
|
+
return metricsService.createMeasure(metric, { loadPermissions });
|
|
37
|
+
}
|
|
38
|
+
const metricObject = metric;
|
|
39
|
+
const ref = metricObject.ref;
|
|
40
|
+
if (metricObject.id !== ref.identifier) {
|
|
41
|
+
// A metric's ID is its API identifier, so a new one means a new object. Its access is
|
|
42
|
+
// attached to the ID, so it is copied over first.
|
|
43
|
+
const createdMetric = await metricsService.createMeasure(metric, { loadPermissions });
|
|
44
|
+
// The original goes only once its access is on the replacement. A failed copy keeps
|
|
45
|
+
// both, so nobody loses a metric they could reach.
|
|
46
|
+
if (await copyAccess(metricObject, createdMetric)) {
|
|
47
|
+
await metricsService.deleteMeasure(metricObject.ref);
|
|
48
|
+
}
|
|
49
|
+
return createdMetric;
|
|
50
|
+
}
|
|
51
|
+
return metricsService.updateMeasure(metric);
|
|
52
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IMeasureReferencing } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type UseCancelablePromiseCallbacks } from "@gooddata/sdk-ui";
|
|
3
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
4
|
+
/**
|
|
5
|
+
* Hook allowing to get metric usages
|
|
6
|
+
*/
|
|
7
|
+
export declare function useMetricUsage(metric: IMeasureDef, cancelablePromiseCallbacks?: UseCancelablePromiseCallbacks<IMeasureReferencing, unknown>): IMeasureReferencing;
|
|
8
|
+
//# sourceMappingURL=useMetricUsage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMetricUsage.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useMetricUsage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EACH,KAAK,6BAA6B,EAIrC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,wBAAgB,cAAc,CAC1B,MAAM,EAAE,WAAW,EACnB,0BAA0B,GAAE,6BAA6B,CAAC,mBAAmB,EAAE,OAAO,CAAM,GAC7F,mBAAmB,CAkBrB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { isMeasureMetadataObject } from "@gooddata/sdk-model";
|
|
4
|
+
import { useBackendStrict, useCancelablePromise, useWorkspaceStrict, } from "@gooddata/sdk-ui";
|
|
5
|
+
/**
|
|
6
|
+
* Hook allowing to get metric usages
|
|
7
|
+
*/
|
|
8
|
+
export function useMetricUsage(metric, cancelablePromiseCallbacks = {}) {
|
|
9
|
+
const workspaceId = useWorkspaceStrict();
|
|
10
|
+
const backend = useBackendStrict();
|
|
11
|
+
const usagePromise = useCancelablePromise({
|
|
12
|
+
promise: () => {
|
|
13
|
+
if (isMeasureMetadataObject(metric)) {
|
|
14
|
+
return backend.workspace(workspaceId).measures().getMeasureReferencingObjects(metric.ref);
|
|
15
|
+
}
|
|
16
|
+
return Promise.resolve({});
|
|
17
|
+
},
|
|
18
|
+
...cancelablePromiseCallbacks,
|
|
19
|
+
}, [backend, workspaceId, metric]);
|
|
20
|
+
return useMemo(() => usagePromise.result || {}, [usagePromise]);
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type IEditMetricContentProps } from "../Content/EditMetricContent.data.js";
|
|
2
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
3
|
+
export declare function useOnCloseOrCancel(dirty: boolean, onCancel: IEditMetricContentProps["onCancel"], setMetricToSave: (metric: IMeasureDef | undefined) => void, setShowUnsavedChangesConfirmDialog: (value: boolean) => void): {
|
|
4
|
+
onCloseCallback: (metric: Partial<IMeasureDef>, valid: boolean) => void;
|
|
5
|
+
onCancelCallback: () => void;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=useOnCloseOrCancel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnCloseOrCancel.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useOnCloseOrCancel.ts"],"names":[],"mappings":"AAQA,OAAO,EAAc,KAAK,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,wBAAgB,kBAAkB,CAC9B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,uBAAuB,CAAC,UAAU,CAAC,EAC7C,eAAe,EAAE,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,EAC1D,kCAAkC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC7D;IACC,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxE,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAChC,CAuBA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { isEmpty } from "lodash-es";
|
|
4
|
+
import { isMeasureMetadataObject, isMeasureMetadataObjectDefinition } from "@gooddata/sdk-model";
|
|
5
|
+
import { CancelMode } from "../Content/EditMetricContent.data.js";
|
|
6
|
+
export function useOnCloseOrCancel(dirty, onCancel, setMetricToSave, setShowUnsavedChangesConfirmDialog) {
|
|
7
|
+
return useMemo(() => {
|
|
8
|
+
function onCloseCallback(metric, valid) {
|
|
9
|
+
if (isEmpty(metric.expression?.trim()) || !dirty) {
|
|
10
|
+
onCancel({ cancelMode: CancelMode.Cross });
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (valid && (isMeasureMetadataObjectDefinition(metric) || isMeasureMetadataObject(metric))) {
|
|
14
|
+
setMetricToSave(metric);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
setMetricToSave(undefined);
|
|
18
|
+
}
|
|
19
|
+
setShowUnsavedChangesConfirmDialog(true);
|
|
20
|
+
}
|
|
21
|
+
function onCancelCallback() {
|
|
22
|
+
onCancel({ cancelMode: CancelMode.Cancel });
|
|
23
|
+
}
|
|
24
|
+
return { onCloseCallback, onCancelCallback };
|
|
25
|
+
}, [dirty, onCancel, setMetricToSave, setShowUnsavedChangesConfirmDialog]);
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MutableRefObject } from "react";
|
|
2
|
+
import { CancelMode } from "../Content/EditMetricContent.data.js";
|
|
3
|
+
import { type IEditMetricDialogFormApi } from "../Form/EditMetricContentForm.js";
|
|
4
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
5
|
+
export declare function useOnSaveUnchanged(setShowUnsavedChangesConfirmDialog: (value: boolean) => void, comp: MutableRefObject<IEditMetricDialogFormApi | undefined>, metricToSave: IMeasureDef | undefined, onCancel: (value: {
|
|
6
|
+
cancelMode: CancelMode;
|
|
7
|
+
}) => void): {
|
|
8
|
+
onSaveUnchangedChangesCallback: () => void;
|
|
9
|
+
onCloseUnchangedChangesCallback: () => void;
|
|
10
|
+
onCancelUnchangedChangesCallback: () => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useOnSaveUnchanged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnSaveUnchanged.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useOnSaveUnchanged.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,wBAAgB,kBAAkB,CAC9B,kCAAkC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EAC5D,IAAI,EAAE,gBAAgB,CAAC,wBAAwB,GAAG,SAAS,CAAC,EAC5D,YAAY,EAAE,WAAW,GAAG,SAAS,EACrC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,KAAK,IAAI,GACtD;IACC,8BAA8B,EAAE,MAAM,IAAI,CAAC;IAC3C,+BAA+B,EAAE,MAAM,IAAI,CAAC;IAC5C,gCAAgC,EAAE,MAAM,IAAI,CAAC;CAChD,CA4BA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { CancelMode } from "../Content/EditMetricContent.data.js";
|
|
4
|
+
export function useOnSaveUnchanged(setShowUnsavedChangesConfirmDialog, comp, metricToSave, onCancel) {
|
|
5
|
+
return useMemo(() => {
|
|
6
|
+
function onSaveUnchangedChangesCallback() {
|
|
7
|
+
setShowUnsavedChangesConfirmDialog(false);
|
|
8
|
+
if (metricToSave && comp.current) {
|
|
9
|
+
if (metricToSave.isLocked) {
|
|
10
|
+
comp.current.saveAs();
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
comp.current?.save();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function onCloseUnchangedChangesCallback() {
|
|
18
|
+
setShowUnsavedChangesConfirmDialog(false);
|
|
19
|
+
}
|
|
20
|
+
function onCancelUnchangedChangesCallback() {
|
|
21
|
+
setShowUnsavedChangesConfirmDialog(false);
|
|
22
|
+
onCancel({ cancelMode: CancelMode.Continue });
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
onSaveUnchangedChangesCallback,
|
|
26
|
+
onCloseUnchangedChangesCallback,
|
|
27
|
+
onCancelUnchangedChangesCallback,
|
|
28
|
+
};
|
|
29
|
+
}, [comp, metricToSave, setShowUnsavedChangesConfirmDialog, onCancel]);
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type IMeasureMetadataObject } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IEditMetricContentProps, SaveNameMode } from "../Content/EditMetricContent.data.js";
|
|
3
|
+
import { FormField } from "../Form/data.js";
|
|
4
|
+
import { type IMeasureDef } from "../metric/metricHelpers.js";
|
|
5
|
+
export declare function useSaveAsClick(defaultId: string, initialValueMetric: IMeasureDef, metrics: Array<IMeasureMetadataObject>, onSave: IEditMetricContentProps["onSave"], setInitialValueMetric: (metric: IMeasureDef) => void, setFocusedField: (filed: FormField) => void, setSaveMode: (saveMode: SaveNameMode) => void, setRegenerateId: (state: boolean) => void): (metricToSaveAs: IMeasureDef) => Promise<void>;
|
|
6
|
+
//# sourceMappingURL=useSaveAsClick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSaveAsClick.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/hooks/useSaveAsClick.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIlE,OAAO,EAAE,KAAK,uBAAuB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,4BAA4B,CAAC;AAEtF,wBAAgB,cAAc,CAC1B,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,WAAW,EAC/B,OAAO,EAAE,KAAK,CAAC,sBAAsB,CAAC,EACtC,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,EACzC,qBAAqB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,EACpD,eAAe,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,EAC3C,WAAW,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,EAC7C,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC1C,CAAC,cAAc,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAwDhD"}
|