@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
package/esm/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
|
+
// oxlint-disable no-barrel-files/no-barrel-files
|
|
3
|
+
export { prepareMetricForSaveAs, createDefinitionByMetric, createNewMetricInfo, createEditMetricInfo, createDraftEditMetricInfo, createDraftNewMetricInfo, } from "./MetricComponent/metric/metricHelpers.js";
|
|
4
|
+
export { SaveNameMode, CancelMode } from "./MetricComponent/Content/EditMetricContent.data.js";
|
|
5
|
+
export { emptyMetric, emptyMetricWithId } from "./MetricComponent/metric/emptyMetric.js";
|
|
6
|
+
export { DeleteMetric } from "./MetricComponent/DeleteMetric.js";
|
|
7
|
+
export { EditMetric } from "./MetricComponent/EditMetric.js";
|
|
8
|
+
export { ManageMetric } from "./MetricComponent/ManageMetric.js";
|
|
9
|
+
export { MetricService } from "./MetricComponent/MetricService.js";
|
|
10
|
+
export { ManageMetrics, } from "./MetricComponent/ManageMetrics.js";
|
|
11
|
+
export { MinimizeMetrics } from "./MetricComponent/MinimizedMetrics.js";
|
|
12
|
+
export { MultipleMetricsState } from "./MetricComponent/MultipleMetricsState.js";
|
|
13
|
+
export { MetricInfoKind, CloseAllStatus, } from "./MetricComponent/MetricState/metricState.data.js";
|
|
14
|
+
export { FeaturesAndSettingsContextProvider } from "./MetricComponent/FeaturesAndSettings/index.js";
|
|
15
|
+
export { ConflictContextProvider } from "./MetricComponent/ConflictContext/ConflictContext.js";
|
|
16
|
+
export { SqlEditor } from "./MaqlEditor/sql/SqlEditor.js";
|
|
17
|
+
export { MaqlEditor } from "./MaqlEditor/maql/MaqlEditor.js";
|
|
18
|
+
export { LanguageServiceProvider, } from "./MaqlEditor/languageService/LanguageServiceContext.js";
|
|
19
|
+
export { shimMaqlEditor } from "./MaqlEditor/mock/monaco-shim.js";
|
|
20
|
+
export { IntlWrapper } from "./translations/IntlWrapper.js";
|
|
21
|
+
export { GlobalLoading } from "./shared/GlobalLoading/GlobalLoading.js";
|
|
22
|
+
export { useMetrics } from "./shared/metrics/useMetrics.js";
|
|
23
|
+
export { EventContext, EventContextProvider } from "./shared/eventing/EventContext.js";
|
|
24
|
+
export { Events, EventCategories } from "./shared/eventing/events.js";
|
|
25
|
+
export { contactLink, pricingLink, licenseLink, privacyPolicyLink, supportLink, howToCreateMetricLink, maqlStartingLink, maqlWritingLink, } from "./shared/links.js";
|
|
26
|
+
export { emptyWorkspacePermissions, emptyOrganizationPermissions, } from "./shared/permissions.js";
|
|
27
|
+
export { makeStyles } from "./shared/theme/index.js";
|
|
28
|
+
export { MetricTooltip } from "./shared/MetricTooltip/MetricTooltip.js";
|
|
29
|
+
export { useEvents } from "./shared/eventing/useEvents.js";
|
|
30
|
+
export { useMetricListData, } from "./shared/metrics/useMetricListData.js";
|
|
31
|
+
export { MetricsReloadContextProvider } from "./shared/metrics/MetricsReloadContext.js";
|
|
32
|
+
export { DEFAULT_LANGUAGE, resolveMessages, validateLocaleForMessagesMap, DEFAULT_MESSAGES, } from "./translations/translations.js";
|
|
33
|
+
export { Authentication } from "./shared/authentication/Authentication.js";
|
|
34
|
+
export { initOpenContractExpiredDialog, contractExpiredHandler, } from "./shared/backend/tigerContractExpiredHandler.js";
|
|
35
|
+
export { initOpenNotAuthenticatedOverlay, notAuthenticatedHandler, NotAuthenticatedError, } from "./shared/backend/tigerNotAuthenticatedHandler.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type PropsWithChildren, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type FormMode } from "./data.js";
|
|
3
|
+
import { type IFormApi } from "./FormApi.js";
|
|
4
|
+
import { type ValidationInfo } from "./hooks/useFormStatusInternal.js";
|
|
5
|
+
export interface IForm<T, S> {
|
|
6
|
+
data: T;
|
|
7
|
+
mode?: FormMode;
|
|
8
|
+
transformer?: (data: T) => T;
|
|
9
|
+
validator?: (data: T) => ValidationInfo<T, S>;
|
|
10
|
+
initialFocus?: keyof T;
|
|
11
|
+
invalidFocus?: (validation: ValidationInfo<T, S>) => keyof T | null;
|
|
12
|
+
writeable?: boolean;
|
|
13
|
+
editable?: boolean;
|
|
14
|
+
locked?: boolean;
|
|
15
|
+
onSave: (data: T, force?: boolean) => Promise<void>;
|
|
16
|
+
onSaveAs: (data: T) => Promise<void>;
|
|
17
|
+
onClose: (data: Partial<T>, valid: boolean) => void;
|
|
18
|
+
onDirtyChanged?: (state: boolean) => void;
|
|
19
|
+
onValueChange?: (data: T, valid: boolean) => void;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
ref?: Ref<IFormApi<T> | undefined>;
|
|
22
|
+
}
|
|
23
|
+
export type FormProviderComponent<T, S> = ForwardRefExoticComponent<PropsWithChildren<IForm<T, S>>>;
|
|
24
|
+
export declare const FormProvider: ForwardRefExoticComponent<Omit<IForm<unknown, unknown>, "ref"> & import("react").RefAttributes<IFormApi<unknown> | undefined>>;
|
|
25
|
+
//# sourceMappingURL=Form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/shared/Form/Form.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,yBAAyB,EAE9B,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,GAAG,EAIX,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMtD,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,kCAAkC,CAAC;AAI9F,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE9C,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,GAAG,IAAI,CAAC;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,QAAQ,EAAE,SAAS,CAAC;IAEpB,GAAG,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,qBAAqB,CAAC,CAAC,EAAE,CAAC,IAAI,yBAAyB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpG,eAAO,MAAM,YAAY,gIAuCxB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2022-2026 GoodData Corporation
|
|
3
|
+
import { forwardRef, useEffect, useRef, } from "react";
|
|
4
|
+
import { isEqual } from "lodash-es";
|
|
5
|
+
import { FormApi } from "./FormApi.js";
|
|
6
|
+
import { FormContext } from "./FormContext.js";
|
|
7
|
+
import { useChanged } from "./hooks/useChanged.js";
|
|
8
|
+
import { useDirty } from "./hooks/useDirty.js";
|
|
9
|
+
import { useFormHandlersInternal } from "./hooks/useFormHandlersInternal.js";
|
|
10
|
+
import { useFormState } from "./hooks/useFormState.js";
|
|
11
|
+
import { useFormStatusInternal } from "./hooks/useFormStatusInternal.js";
|
|
12
|
+
import { useMutations } from "./hooks/useMutations.js";
|
|
13
|
+
import { useRealFocus } from "./hooks/useRealFocus.js";
|
|
14
|
+
export const FormProvider = forwardRef(function FormProvider(props, ref) {
|
|
15
|
+
const { children, data, initialFocus, onDirtyChanged, onValueChange } = props;
|
|
16
|
+
const [state, setState, getFormState] = useFormState(data, initialFocus);
|
|
17
|
+
const formHandlers = useFormHandlersInternal(props);
|
|
18
|
+
const formStatus = useFormStatusInternal(formHandlers, props, state);
|
|
19
|
+
const { setValues, setChanged, setTouched, setActive, setFocus, setBlur, setSaving } = useMutations(setState);
|
|
20
|
+
useDirty(formStatus, onDirtyChanged);
|
|
21
|
+
useRealFocus(formStatus, state, setState);
|
|
22
|
+
useChanged(formHandlers, formStatus, state, onValueChange);
|
|
23
|
+
const value = useMemoCompare({
|
|
24
|
+
...state,
|
|
25
|
+
getFormState,
|
|
26
|
+
formStatus,
|
|
27
|
+
formHandlers,
|
|
28
|
+
setValues,
|
|
29
|
+
setChanged,
|
|
30
|
+
setTouched,
|
|
31
|
+
setActive,
|
|
32
|
+
setFocus,
|
|
33
|
+
setBlur,
|
|
34
|
+
setSaving,
|
|
35
|
+
}, isEqual);
|
|
36
|
+
return (_jsxs(FormContext.Provider, { value: value, children: [_jsx(FormApi, { ref: ref }), children] }));
|
|
37
|
+
});
|
|
38
|
+
function useMemoCompare(next, compare) {
|
|
39
|
+
const previousRef = useRef(undefined);
|
|
40
|
+
const previous = previousRef.current;
|
|
41
|
+
const isEqual = compare(previous, next);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!isEqual) {
|
|
44
|
+
previousRef.current = next;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return isEqual ? previous : next;
|
|
48
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface IFormApi<T> {
|
|
2
|
+
close: () => void;
|
|
3
|
+
save: () => Promise<void>;
|
|
4
|
+
saveAs: () => Promise<void>;
|
|
5
|
+
saveForce: (data?: Partial<T>) => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare const FormApi: import("react").ForwardRefExoticComponent<import("react").RefAttributes<IFormApi<unknown> | undefined>>;
|
|
8
|
+
//# sourceMappingURL=FormApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormApi.d.ts","sourceRoot":"","sources":["../../../src/shared/Form/FormApi.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,QAAQ,CAAC,CAAC;IACvB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,OAAO,yGAelB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useApi } from "../hooks/useApi.js";
|
|
4
|
+
import { useFormHandlers } from "./useFormHandlers.js";
|
|
5
|
+
export const FormApi = forwardRef(function FormApi(_, ref) {
|
|
6
|
+
const { onSave, onSaveAs, onClose, onForceSave } = useFormHandlers();
|
|
7
|
+
useApi(ref, {
|
|
8
|
+
close: onClose,
|
|
9
|
+
save: onSave,
|
|
10
|
+
saveAs: onSaveAs,
|
|
11
|
+
saveForce: onForceSave,
|
|
12
|
+
}, [onSave, onSaveAs, onClose, onForceSave]);
|
|
13
|
+
return null;
|
|
14
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import { type FormHandlers } from "./hooks/useFormHandlersInternal.js";
|
|
3
|
+
import { type FormStatus, type ValidationInfo } from "./hooks/useFormStatusInternal.js";
|
|
4
|
+
export type FormState<T> = {
|
|
5
|
+
defaultValues: Readonly<T>;
|
|
6
|
+
currentValues: T;
|
|
7
|
+
changedValues: {
|
|
8
|
+
[key in keyof Partial<T>]: boolean;
|
|
9
|
+
};
|
|
10
|
+
touchedValues: {
|
|
11
|
+
[key in keyof Partial<T>]: boolean;
|
|
12
|
+
};
|
|
13
|
+
elements: {
|
|
14
|
+
[key in keyof Partial<T>]: RefObject<HTMLElement | null>;
|
|
15
|
+
};
|
|
16
|
+
active: keyof Partial<T> | null;
|
|
17
|
+
initialFocus: {
|
|
18
|
+
field: keyof Partial<T> | null;
|
|
19
|
+
focused: boolean;
|
|
20
|
+
};
|
|
21
|
+
isSaving: boolean;
|
|
22
|
+
submitCount: number;
|
|
23
|
+
};
|
|
24
|
+
export type FormStatusWrapper<T, S> = {
|
|
25
|
+
formStatus: FormStatus<T, S> | null;
|
|
26
|
+
};
|
|
27
|
+
export type FormHandlersWrapper<T, S> = {
|
|
28
|
+
formHandlers: FormHandlers<T, S>;
|
|
29
|
+
};
|
|
30
|
+
export type FormMutations<T> = {
|
|
31
|
+
setValues: (props: Partial<T>) => void;
|
|
32
|
+
setChanged: (props: {
|
|
33
|
+
[key in keyof Partial<T>]: boolean;
|
|
34
|
+
}) => void;
|
|
35
|
+
setTouched: (props: {
|
|
36
|
+
[key in keyof Partial<T>]: boolean;
|
|
37
|
+
}) => void;
|
|
38
|
+
setActive: (field: keyof Partial<T> | null) => void;
|
|
39
|
+
setFocus: (field: keyof Partial<T> | null) => void;
|
|
40
|
+
setBlur: (field: keyof Partial<T> | null) => void;
|
|
41
|
+
setSaving: (state: boolean) => void;
|
|
42
|
+
};
|
|
43
|
+
export declare const DefaultState: FormState<unknown>;
|
|
44
|
+
export declare const DefaultStatus: FormStatusWrapper<unknown, unknown>;
|
|
45
|
+
export declare const DefaultHandlers: FormHandlersWrapper<unknown, unknown>;
|
|
46
|
+
export type FormContextState<T, S> = FormState<T> & {
|
|
47
|
+
getFormState: () => FormState<T>;
|
|
48
|
+
} & FormStatusWrapper<T, S> & FormMutations<T> & FormHandlersWrapper<T, S>;
|
|
49
|
+
export declare const FormContext: import("react").Context<FormContextState<unknown, unknown>>;
|
|
50
|
+
export declare function emptyTransformer<T>(data: T): T;
|
|
51
|
+
export declare function emptyValidator<T, S>(): ValidationInfo<T, S>;
|
|
52
|
+
//# sourceMappingURL=FormContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormContext.d.ts","sourceRoot":"","sources":["../../../src/shared/Form/FormContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAExF,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACvB,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3B,aAAa,EAAE,CAAC,CAAC;IACjB,aAAa,EAAE;SAAG,GAAG,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO;KAAE,CAAC;IACtD,aAAa,EAAE;SAAG,GAAG,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO;KAAE,CAAC;IACtD,QAAQ,EAAE;SAAG,GAAG,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;KAAE,CAAC;IACvE,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE;QACV,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;KACpB,CAAC;IAEF,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,IAAI;IAClC,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,CAAC,EAAE,CAAC,IAAI;IACpC,YAAY,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,CAAC,KAAK,EAAE;SAAG,GAAG,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO;KAAE,KAAK,IAAI,CAAC;IACpE,UAAU,EAAE,CAAC,KAAK,EAAE;SAAG,GAAG,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO;KAAE,KAAK,IAAI,CAAC;IACpE,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAClD,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SAAS,CAAC,OAAO,CAU3C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAE7D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAQjE,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG;IAChD,YAAY,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GACvB,aAAa,CAAC,CAAC,CAAC,GAChB,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9B,eAAO,MAAM,WAAW,6DAYtB,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAE9C;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAQ3D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
export const DefaultState = {
|
|
4
|
+
active: null,
|
|
5
|
+
initialFocus: { field: null, focused: false },
|
|
6
|
+
defaultValues: {},
|
|
7
|
+
currentValues: {},
|
|
8
|
+
changedValues: {},
|
|
9
|
+
touchedValues: {},
|
|
10
|
+
elements: {},
|
|
11
|
+
isSaving: false,
|
|
12
|
+
submitCount: 0,
|
|
13
|
+
};
|
|
14
|
+
export const DefaultStatus = {
|
|
15
|
+
formStatus: null,
|
|
16
|
+
};
|
|
17
|
+
export const DefaultHandlers = {
|
|
18
|
+
formHandlers: {
|
|
19
|
+
onClose: () => { },
|
|
20
|
+
onSave: () => Promise.resolve(),
|
|
21
|
+
onSaveAs: () => Promise.resolve(),
|
|
22
|
+
transformer: emptyTransformer,
|
|
23
|
+
validator: emptyValidator,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const FormContext = createContext({
|
|
27
|
+
getFormState: () => DefaultState,
|
|
28
|
+
...DefaultState,
|
|
29
|
+
...DefaultStatus,
|
|
30
|
+
...DefaultHandlers,
|
|
31
|
+
setValues: () => { },
|
|
32
|
+
setChanged: () => { },
|
|
33
|
+
setTouched: () => { },
|
|
34
|
+
setActive: () => { },
|
|
35
|
+
setFocus: () => { },
|
|
36
|
+
setBlur: () => { },
|
|
37
|
+
setSaving: () => { },
|
|
38
|
+
});
|
|
39
|
+
export function emptyTransformer(data) {
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
export function emptyValidator() {
|
|
43
|
+
return {
|
|
44
|
+
loading: false,
|
|
45
|
+
errors: [],
|
|
46
|
+
critical: [],
|
|
47
|
+
fields: {},
|
|
48
|
+
specials: {},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/shared/Form/data.ts"],"names":[],"mappings":"AAEA,oBAAY,QAAQ;IAChB,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type FormState } from "../FormContext.js";
|
|
2
|
+
import { type FormHandlers } from "./useFormHandlersInternal.js";
|
|
3
|
+
import { type FormStatus } from "./useFormStatusInternal.js";
|
|
4
|
+
export declare function useChanged<T, S>({ transformer }: FormHandlers<T, S>, { isValid, isLoading }: FormStatus<T, S>, { currentValues }: FormState<T>, onValueChange?: (data: T, valid: boolean) => void): void;
|
|
5
|
+
//# sourceMappingURL=useChanged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChanged.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useChanged.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAC3B,EAAE,WAAW,EAAE,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EACnC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EACxC,EAAE,aAAa,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,EAC/B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,GAClD,IAAI,CAWN"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { isChanged } from "../utils.js";
|
|
4
|
+
export function useChanged({ transformer }, { isValid, isLoading }, { currentValues }, onValueChange) {
|
|
5
|
+
const [data, setData] = useState([currentValues, isValid]);
|
|
6
|
+
const [previousValues, previousValid] = data;
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const changed = isChanged(previousValues, currentValues, transformer) || previousValid !== isValid;
|
|
9
|
+
if (onValueChange && changed && !isLoading) {
|
|
10
|
+
setData([currentValues, isValid]);
|
|
11
|
+
onValueChange(transformer(currentValues), isValid);
|
|
12
|
+
}
|
|
13
|
+
}, [transformer, currentValues, isLoading, isValid, onValueChange, previousValid, previousValues]);
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDirty.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useDirty.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wBAAgB,QAAQ,CACpB,EAAE,OAAO,EAAE,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,EACzC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAC1C,IAAI,CAMN"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IForm } from "../Form.js";
|
|
2
|
+
import { type ValidationInfo } from "./useFormStatusInternal.js";
|
|
3
|
+
export type FormHandlers<T, S> = {
|
|
4
|
+
transformer: (data: T) => T;
|
|
5
|
+
validator: (data: T) => ValidationInfo<T, S>;
|
|
6
|
+
onSave: (data: T, force?: boolean) => Promise<void>;
|
|
7
|
+
onSaveAs: (data: T) => Promise<void>;
|
|
8
|
+
onClose: (data: Partial<T>, valid: boolean) => void;
|
|
9
|
+
invalidFocus?: (validation: ValidationInfo<T, S>) => keyof T | null;
|
|
10
|
+
};
|
|
11
|
+
export declare function useFormHandlersInternal<T, S>(props: IForm<T, S>): FormHandlers<T, S>;
|
|
12
|
+
//# sourceMappingURL=useFormHandlersInternal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormHandlersInternal.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useFormHandlersInternal.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI;IAC7B,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,GAAG,IAAI,CAAC;CACvE,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAEpF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { emptyTransformer, emptyValidator } from "../FormContext.js";
|
|
4
|
+
export function useFormHandlersInternal(props) {
|
|
5
|
+
return useFormHandlers(props);
|
|
6
|
+
}
|
|
7
|
+
function useFormHandlers({ onClose, onSaveAs, onSave, transformer = emptyTransformer, validator = emptyValidator, invalidFocus, }) {
|
|
8
|
+
return useMemo(() => ({
|
|
9
|
+
onClose,
|
|
10
|
+
onSaveAs,
|
|
11
|
+
onSave,
|
|
12
|
+
invalidFocus,
|
|
13
|
+
transformer,
|
|
14
|
+
validator,
|
|
15
|
+
}), [onClose, onSave, onSaveAs, transformer, validator, invalidFocus]);
|
|
16
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
import { type FormState } from "../FormContext.js";
|
|
3
|
+
export declare function useFormState<T>(data: T, initialFocus?: keyof T): [FormState<T>, Dispatch<SetStateAction<FormState<T>>>, () => FormState<T>];
|
|
4
|
+
//# sourceMappingURL=useFormState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormState.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useFormState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAA4C,MAAM,OAAO,CAAC;AAErG,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,wBAAgB,YAAY,CAAC,CAAC,EAC1B,IAAI,EAAE,CAAC,EACP,YAAY,CAAC,EAAE,MAAM,CAAC,GACvB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC,CAkC5E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { DefaultState } from "../FormContext.js";
|
|
4
|
+
export function useFormState(data, initialFocus) {
|
|
5
|
+
const [state, setState] = useState({
|
|
6
|
+
...DefaultState,
|
|
7
|
+
defaultValues: { ...data },
|
|
8
|
+
currentValues: { ...data },
|
|
9
|
+
initialFocus: {
|
|
10
|
+
field: initialFocus || null,
|
|
11
|
+
focused: false,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const stateRef = useRef(state);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
stateRef.current = state;
|
|
17
|
+
}, [state]);
|
|
18
|
+
const getState = useCallback(() => stateRef.current, []);
|
|
19
|
+
//reset occurred
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
setState({
|
|
22
|
+
...DefaultState,
|
|
23
|
+
defaultValues: { ...state.defaultValues },
|
|
24
|
+
currentValues: { ...data },
|
|
25
|
+
initialFocus: {
|
|
26
|
+
field: initialFocus || null,
|
|
27
|
+
focused: false,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
+
}, [initialFocus, data]);
|
|
32
|
+
return [state, setState, getState];
|
|
33
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ValidationError } from "yup";
|
|
2
|
+
import { FormMode } from "../data.js";
|
|
3
|
+
import { type IForm } from "../Form.js";
|
|
4
|
+
import { type FormState } from "../FormContext.js";
|
|
5
|
+
import { type FormHandlers } from "./useFormHandlersInternal.js";
|
|
6
|
+
export type FormStatus<T, S> = {
|
|
7
|
+
mode: FormMode;
|
|
8
|
+
isWriteable: boolean;
|
|
9
|
+
isEditable: boolean;
|
|
10
|
+
isReadOnly: boolean;
|
|
11
|
+
isError: boolean;
|
|
12
|
+
isValid: boolean;
|
|
13
|
+
validation: ValidationInfo<T, S>;
|
|
14
|
+
isLocked: boolean;
|
|
15
|
+
isDirty: boolean;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
isSaving: boolean;
|
|
18
|
+
isSaveAsDisabled: boolean;
|
|
19
|
+
isSaveDisabled: boolean;
|
|
20
|
+
submitCount: number;
|
|
21
|
+
};
|
|
22
|
+
export type ValidationInfo<T, S> = {
|
|
23
|
+
loading: boolean;
|
|
24
|
+
errors: ValidationError[];
|
|
25
|
+
critical: ValidationError[];
|
|
26
|
+
fields: {
|
|
27
|
+
[key in keyof Partial<T>]: string;
|
|
28
|
+
};
|
|
29
|
+
specials: S;
|
|
30
|
+
};
|
|
31
|
+
export declare function useFormStatusInternal<T, S>(handlers: FormHandlers<T, S>, props: IForm<T, S>, state: FormState<T>): FormStatus<T, S>;
|
|
32
|
+
//# sourceMappingURL=useFormStatusInternal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormStatusInternal.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useFormStatusInternal.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,KAAK,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI;IAC3B,IAAI,EAAE,QAAQ,CAAC;IAEf,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEjC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,IAAI;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,MAAM,EAAE;SAAG,GAAG,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM;KAAE,CAAC;IAC9C,QAAQ,EAAE,CAAC,CAAC;CACf,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EACtC,QAAQ,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAC5B,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAClB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GACpB,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAElB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { FormMode } from "../data.js";
|
|
4
|
+
import { isChanged } from "../utils.js";
|
|
5
|
+
export function useFormStatusInternal(handlers, props, state) {
|
|
6
|
+
return useStatus(handlers, props, state);
|
|
7
|
+
}
|
|
8
|
+
function useStatus({ transformer, validator }, { writeable = true, editable = true, locked = false, mode = FormMode.New }, { defaultValues, currentValues, isSaving, submitCount }) {
|
|
9
|
+
const isDirty = isChanged(defaultValues, currentValues, transformer);
|
|
10
|
+
const validation = useMemo(() => validator(currentValues), [currentValues, validator]);
|
|
11
|
+
const isEditable = !locked && editable;
|
|
12
|
+
const isReadOnly = !isEditable;
|
|
13
|
+
const isError = validation.errors.length > 0;
|
|
14
|
+
const isValid = !isError;
|
|
15
|
+
const isLoading = isSaving || validation.loading;
|
|
16
|
+
const isSaveAsDisabled = isError || isLoading;
|
|
17
|
+
const isSaveDisabled = isSaveAsDisabled || (!isDirty && mode !== FormMode.New);
|
|
18
|
+
return {
|
|
19
|
+
mode,
|
|
20
|
+
isWriteable: writeable,
|
|
21
|
+
isEditable,
|
|
22
|
+
isReadOnly,
|
|
23
|
+
isError,
|
|
24
|
+
isValid,
|
|
25
|
+
validation,
|
|
26
|
+
isLocked: locked,
|
|
27
|
+
isDirty,
|
|
28
|
+
isLoading,
|
|
29
|
+
isSaving,
|
|
30
|
+
isSaveAsDisabled,
|
|
31
|
+
isSaveDisabled,
|
|
32
|
+
submitCount,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInvalidFocusField.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useInvalidFocusField.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EACrC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,GAAG,IAAI,GACpE,MAAM,CAAC,GAAG,IAAI,CAKhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { FormContext } from "../FormContext.js";
|
|
4
|
+
export function useInvalidFocusField(invalidFocus) {
|
|
5
|
+
const { formStatus } = useContext(FormContext);
|
|
6
|
+
const { validation } = formStatus || {};
|
|
7
|
+
return invalidFocus && validation ? invalidFocus(validation) : null;
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
import { type FormMutations, type FormState } from "../FormContext.js";
|
|
3
|
+
export declare function useMutations<T>(setState: Dispatch<SetStateAction<FormState<T>>>): FormMutations<T>;
|
|
4
|
+
//# sourceMappingURL=useMutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMutations.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useMutations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAe,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEvE,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CA0HlG"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
export function useMutations(setState) {
|
|
4
|
+
const setValues = useCallback((props) => {
|
|
5
|
+
setState((state) => {
|
|
6
|
+
return {
|
|
7
|
+
...state,
|
|
8
|
+
currentValues: {
|
|
9
|
+
...state.currentValues,
|
|
10
|
+
...props,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}, [setState]);
|
|
15
|
+
const setChanged = useCallback((props) => {
|
|
16
|
+
setState((state) => {
|
|
17
|
+
return {
|
|
18
|
+
...state,
|
|
19
|
+
changedValues: {
|
|
20
|
+
...state.changedValues,
|
|
21
|
+
...props,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}, [setState]);
|
|
26
|
+
const setTouched = useCallback((props) => {
|
|
27
|
+
setState((state) => {
|
|
28
|
+
return {
|
|
29
|
+
...state,
|
|
30
|
+
touchedValues: {
|
|
31
|
+
...state.touchedValues,
|
|
32
|
+
...props,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}, [setState]);
|
|
37
|
+
const setActive = useCallback((active) => {
|
|
38
|
+
setState((state) => {
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
active,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}, [setState]);
|
|
45
|
+
const setSaving = useCallback((isSaving) => {
|
|
46
|
+
setState((state) => {
|
|
47
|
+
return {
|
|
48
|
+
...state,
|
|
49
|
+
isSaving,
|
|
50
|
+
...(isSaving
|
|
51
|
+
? {
|
|
52
|
+
submitCount: state.submitCount + 1,
|
|
53
|
+
}
|
|
54
|
+
: {}),
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}, [setState]);
|
|
58
|
+
const setFocus = useCallback((field) => {
|
|
59
|
+
setState((state) => {
|
|
60
|
+
//same field, do nothing
|
|
61
|
+
if (state.initialFocus.field === field) {
|
|
62
|
+
return state;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
...state,
|
|
66
|
+
initialFocus: {
|
|
67
|
+
field,
|
|
68
|
+
focused: false,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}, [setState]);
|
|
73
|
+
const setBlur = useCallback((field) => {
|
|
74
|
+
setState((state) => {
|
|
75
|
+
//same field, do nothing
|
|
76
|
+
if (state.initialFocus.field !== field) {
|
|
77
|
+
return state;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
...state,
|
|
81
|
+
initialFocus: {
|
|
82
|
+
field: null,
|
|
83
|
+
focused: false,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}, [setState]);
|
|
88
|
+
return {
|
|
89
|
+
setValues,
|
|
90
|
+
setChanged,
|
|
91
|
+
setTouched,
|
|
92
|
+
setActive,
|
|
93
|
+
setFocus,
|
|
94
|
+
setBlur,
|
|
95
|
+
setSaving,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
import { type FormState } from "../FormContext.js";
|
|
3
|
+
import { type FormStatus } from "./useFormStatusInternal.js";
|
|
4
|
+
export declare function useRealFocus<T>({ isReadOnly }: FormStatus<T, unknown>, state: FormState<T>, setState: Dispatch<SetStateAction<FormState<T>>>): void;
|
|
5
|
+
//# sourceMappingURL=useRealFocus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRealFocus.d.ts","sourceRoot":"","sources":["../../../../src/shared/Form/hooks/useRealFocus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAyB,KAAK,cAAc,EAAqB,MAAM,OAAO,CAAC;AAErG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wBAAgB,YAAY,CAAC,CAAC,EAC1B,EAAE,UAAU,EAAE,EAAE,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,EACtC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EACnB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GACjD,IAAI,CAaN"}
|