@chobantonov/jsonforms-react-renderer-common 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +79 -2
- package/lib/cells/CellSummary.cjs.js +2 -0
- package/lib/cells/CellSummary.cjs.js.map +1 -0
- package/lib/cells/CellSummary.d.ts +14 -0
- package/lib/cells/CellSummary.esm.js +29 -0
- package/lib/cells/CellSummary.esm.js.map +1 -0
- package/lib/cells/cellMode.cjs.js +2 -0
- package/lib/cells/cellMode.cjs.js.map +1 -0
- package/lib/cells/cellMode.d.ts +14 -0
- package/lib/cells/cellMode.esm.js +6 -0
- package/lib/cells/cellMode.esm.js.map +1 -0
- package/lib/cells/compositeActions.cjs.js +2 -0
- package/lib/cells/compositeActions.cjs.js.map +1 -0
- package/lib/cells/compositeActions.d.ts +7 -0
- package/lib/cells/compositeActions.esm.js +14 -0
- package/lib/cells/compositeActions.esm.js.map +1 -0
- package/lib/cells/compositeCellTester.cjs.js +2 -0
- package/lib/cells/compositeCellTester.cjs.js.map +1 -0
- package/lib/cells/compositeCellTester.d.ts +2 -0
- package/lib/cells/compositeCellTester.esm.js +12 -0
- package/lib/cells/compositeCellTester.esm.js.map +1 -0
- package/lib/cells/compositeSummary.cjs.js +2 -0
- package/lib/cells/compositeSummary.cjs.js.map +1 -0
- package/lib/cells/compositeSummary.d.ts +10 -0
- package/lib/cells/compositeSummary.esm.js +44 -0
- package/lib/cells/compositeSummary.esm.js.map +1 -0
- package/lib/cells/useCompositeCellPresentation.cjs.js +2 -0
- package/lib/cells/useCompositeCellPresentation.cjs.js.map +1 -0
- package/lib/cells/useCompositeCellPresentation.d.ts +7 -0
- package/lib/cells/useCompositeCellPresentation.esm.js +18 -0
- package/lib/cells/useCompositeCellPresentation.esm.js.map +1 -0
- package/lib/cells/useCompositeDraft.cjs.js +2 -0
- package/lib/cells/useCompositeDraft.cjs.js.map +1 -0
- package/lib/cells/useCompositeDraft.d.ts +52 -0
- package/lib/cells/useCompositeDraft.esm.js +95 -0
- package/lib/cells/useCompositeDraft.esm.js.map +1 -0
- package/lib/collections/CollectionErrorNavigation.cjs.js +2 -0
- package/lib/collections/CollectionErrorNavigation.cjs.js.map +1 -0
- package/lib/collections/CollectionErrorNavigation.d.ts +12 -0
- package/lib/collections/CollectionErrorNavigation.esm.js +68 -0
- package/lib/collections/CollectionErrorNavigation.esm.js.map +1 -0
- package/lib/collections/arrayChoices.cjs.js +2 -0
- package/lib/collections/arrayChoices.cjs.js.map +1 -0
- package/lib/collections/arrayChoices.d.ts +85 -0
- package/lib/collections/arrayChoices.esm.js +54 -0
- package/lib/collections/arrayChoices.esm.js.map +1 -0
- package/lib/collections/collectionPagination.cjs.js +2 -0
- package/lib/collections/collectionPagination.cjs.js.map +1 -0
- package/lib/collections/collectionPagination.d.ts +22 -0
- package/lib/collections/collectionPagination.esm.js +51 -0
- package/lib/collections/collectionPagination.esm.js.map +1 -0
- package/lib/collections/columnResize.cjs.js +2 -0
- package/lib/collections/columnResize.cjs.js.map +1 -0
- package/lib/collections/columnResize.d.ts +16 -0
- package/lib/collections/columnResize.esm.js +85 -0
- package/lib/collections/columnResize.esm.js.map +1 -0
- package/lib/collections/rowDetail.cjs.js +2 -0
- package/lib/collections/rowDetail.cjs.js.map +1 -0
- package/lib/collections/rowDetail.d.ts +34 -0
- package/lib/collections/rowDetail.esm.js +106 -0
- package/lib/collections/rowDetail.esm.js.map +1 -0
- package/lib/collections/tableColumns.cjs.js +2 -0
- package/lib/collections/tableColumns.cjs.js.map +1 -0
- package/lib/collections/tableColumns.d.ts +13 -0
- package/lib/collections/tableColumns.esm.js +16 -0
- package/lib/collections/tableColumns.esm.js.map +1 -0
- package/lib/collections/useArrayPanelState.cjs.js +2 -0
- package/lib/collections/useArrayPanelState.cjs.js.map +1 -0
- package/lib/collections/useArrayPanelState.d.ts +7 -0
- package/lib/collections/useArrayPanelState.esm.js +18 -0
- package/lib/collections/useArrayPanelState.esm.js.map +1 -0
- package/lib/collections/useCollectionDelete.cjs.js +2 -0
- package/lib/collections/useCollectionDelete.cjs.js.map +1 -0
- package/lib/collections/useCollectionDelete.d.ts +17 -0
- package/lib/collections/useCollectionDelete.esm.js +38 -0
- package/lib/collections/useCollectionDelete.esm.js.map +1 -0
- package/lib/collections/useTableSelection.cjs.js +2 -0
- package/lib/collections/useTableSelection.cjs.js.map +1 -0
- package/lib/collections/useTableSelection.d.ts +11 -0
- package/lib/collections/useTableSelection.esm.js +41 -0
- package/lib/collections/useTableSelection.esm.js.map +1 -0
- package/lib/composition/AllOfRenderer.cjs.js +2 -0
- package/lib/composition/AllOfRenderer.cjs.js.map +1 -0
- package/lib/composition/AllOfRenderer.d.ts +5 -0
- package/lib/composition/AllOfRenderer.esm.js +33 -0
- package/lib/composition/AllOfRenderer.esm.js.map +1 -0
- package/lib/composition/CombinatorBranch.cjs.js +2 -0
- package/lib/composition/CombinatorBranch.cjs.js.map +1 -0
- package/lib/composition/CombinatorBranch.d.ts +17 -0
- package/lib/composition/CombinatorBranch.esm.js +54 -0
- package/lib/composition/CombinatorBranch.esm.js.map +1 -0
- package/lib/composition/CombinatorProperties.cjs.js +2 -0
- package/lib/composition/CombinatorProperties.cjs.js.map +1 -0
- package/lib/composition/CombinatorProperties.d.ts +12 -0
- package/lib/composition/CombinatorProperties.esm.js +20 -0
- package/lib/composition/CombinatorProperties.esm.js.map +1 -0
- package/lib/composition/ScalarCompositionControl.cjs.js +2 -0
- package/lib/composition/ScalarCompositionControl.cjs.js.map +1 -0
- package/lib/composition/ScalarCompositionControl.d.ts +6 -0
- package/lib/composition/ScalarCompositionControl.esm.js +22 -0
- package/lib/composition/ScalarCompositionControl.esm.js.map +1 -0
- package/lib/composition/choiceCards.cjs.js +2 -0
- package/lib/composition/choiceCards.cjs.js.map +1 -0
- package/lib/composition/choiceCards.d.ts +36 -0
- package/lib/composition/choiceCards.esm.js +162 -0
- package/lib/composition/choiceCards.esm.js.map +1 -0
- package/lib/composition/combinators.cjs.js +2 -0
- package/lib/composition/combinators.cjs.js.map +1 -0
- package/lib/composition/combinators.d.ts +40 -0
- package/lib/composition/combinators.esm.js +26 -0
- package/lib/composition/combinators.esm.js.map +1 -0
- package/lib/composition/discriminatorBranch.cjs.js +2 -0
- package/lib/composition/discriminatorBranch.cjs.js.map +1 -0
- package/lib/composition/discriminatorBranch.d.ts +6 -0
- package/lib/composition/discriminatorBranch.esm.js +41 -0
- package/lib/composition/discriminatorBranch.esm.js.map +1 -0
- package/lib/composition/scalarComposition.cjs.js +2 -0
- package/lib/composition/scalarComposition.cjs.js.map +1 -0
- package/lib/composition/scalarComposition.d.ts +27 -0
- package/lib/composition/scalarComposition.esm.js +76 -0
- package/lib/composition/scalarComposition.esm.js.map +1 -0
- package/lib/composition/useCombinatorSelection.cjs.js +2 -0
- package/lib/composition/useCombinatorSelection.cjs.js.map +1 -0
- package/lib/composition/useCombinatorSelection.d.ts +6 -0
- package/lib/composition/useCombinatorSelection.esm.js +22 -0
- package/lib/composition/useCombinatorSelection.esm.js.map +1 -0
- package/lib/composition/useScalarComposition.cjs.js +2 -0
- package/lib/composition/useScalarComposition.cjs.js.map +1 -0
- package/lib/composition/useScalarComposition.d.ts +18 -0
- package/lib/composition/useScalarComposition.esm.js +24 -0
- package/lib/composition/useScalarComposition.esm.js.map +1 -0
- package/lib/controls/FileArrayInput.cjs.js +2 -0
- package/lib/controls/FileArrayInput.cjs.js.map +1 -0
- package/lib/controls/FileArrayInput.d.ts +19 -0
- package/lib/controls/FileArrayInput.esm.js +232 -0
- package/lib/controls/FileArrayInput.esm.js.map +1 -0
- package/lib/controls/controlHelp.cjs.js +2 -0
- package/lib/controls/controlHelp.cjs.js.map +1 -0
- package/lib/controls/controlHelp.d.ts +15 -0
- package/lib/controls/controlHelp.esm.js +9 -0
- package/lib/controls/controlHelp.esm.js.map +1 -0
- package/lib/controls/inputAdornments.cjs.js +2 -0
- package/lib/controls/inputAdornments.cjs.js.map +1 -0
- package/lib/controls/inputAdornments.d.ts +32 -0
- package/lib/controls/inputAdornments.esm.js +192 -0
- package/lib/controls/inputAdornments.esm.js.map +1 -0
- package/lib/controls/numeric.cjs.js +2 -0
- package/lib/controls/numeric.cjs.js.map +1 -0
- package/lib/controls/numeric.d.ts +36 -0
- package/lib/controls/numeric.esm.js +9 -0
- package/lib/controls/numeric.esm.js.map +1 -0
- package/lib/controls/useClearAffordance.cjs.js +2 -0
- package/lib/controls/useClearAffordance.cjs.js.map +1 -0
- package/lib/controls/useClearAffordance.d.ts +15 -0
- package/lib/controls/useClearAffordance.esm.js +17 -0
- package/lib/controls/useClearAffordance.esm.js.map +1 -0
- package/lib/controls/useDebouncedChange.cjs.js +2 -0
- package/lib/controls/useDebouncedChange.cjs.js.map +1 -0
- package/lib/controls/useDebouncedChange.d.ts +37 -0
- package/lib/controls/useDebouncedChange.esm.js +40 -0
- package/lib/controls/useDebouncedChange.esm.js.map +1 -0
- package/lib/controls/useFocus.cjs.js +2 -0
- package/lib/controls/useFocus.cjs.js.map +1 -0
- package/lib/controls/useFocus.d.ts +1 -0
- package/lib/controls/useFocus.esm.js +13 -0
- package/lib/controls/useFocus.esm.js.map +1 -0
- package/lib/core/configNamespaces.cjs.js +2 -0
- package/lib/core/configNamespaces.cjs.js.map +1 -0
- package/lib/core/configNamespaces.d.ts +32 -0
- package/lib/core/configNamespaces.esm.js +15 -0
- package/lib/core/configNamespaces.esm.js.map +1 -0
- package/lib/core/dataPointer.cjs.js +2 -0
- package/lib/core/dataPointer.cjs.js.map +1 -0
- package/lib/core/dataPointer.d.ts +1 -0
- package/lib/core/dataPointer.esm.js +5 -0
- package/lib/core/dataPointer.esm.js.map +1 -0
- package/lib/core/detailUiSchema.cjs.js +2 -0
- package/lib/core/detailUiSchema.cjs.js.map +1 -0
- package/lib/core/detailUiSchema.d.ts +7 -0
- package/lib/core/detailUiSchema.esm.js +23 -0
- package/lib/core/detailUiSchema.esm.js.map +1 -0
- package/lib/core/plainRecord.cjs.js +2 -0
- package/lib/core/plainRecord.cjs.js.map +1 -0
- package/lib/core/plainRecord.d.ts +1 -0
- package/lib/core/plainRecord.esm.js +5 -0
- package/lib/core/plainRecord.esm.js.map +1 -0
- package/lib/core/uiSchemaCycle.cjs.js +2 -0
- package/lib/core/uiSchemaCycle.cjs.js.map +1 -0
- package/lib/core/uiSchemaCycle.d.ts +18 -0
- package/lib/core/uiSchemaCycle.esm.js +27 -0
- package/lib/core/uiSchemaCycle.esm.js.map +1 -0
- package/lib/dynamic/DynamicUiProvider.cjs.js +4 -0
- package/lib/dynamic/DynamicUiProvider.cjs.js.map +1 -0
- package/lib/dynamic/DynamicUiProvider.d.ts +35 -0
- package/lib/dynamic/DynamicUiProvider.esm.js +182 -0
- package/lib/dynamic/DynamicUiProvider.esm.js.map +1 -0
- package/lib/dynamic/dynamicCel.cjs.js +2 -0
- package/lib/dynamic/dynamicCel.cjs.js.map +1 -0
- package/lib/dynamic/dynamicCel.d.ts +1 -0
- package/lib/dynamic/dynamicCel.esm.js +43 -0
- package/lib/dynamic/dynamicCel.esm.js.map +1 -0
- package/lib/dynamic/dynamicConfig.cjs.js +2 -0
- package/lib/dynamic/dynamicConfig.cjs.js.map +1 -0
- package/lib/dynamic/dynamicConfig.d.ts +7 -0
- package/lib/dynamic/dynamicConfig.esm.js +13 -0
- package/lib/dynamic/dynamicConfig.esm.js.map +1 -0
- package/lib/dynamic/dynamicRuntime.cjs.js +2 -0
- package/lib/dynamic/dynamicRuntime.cjs.js.map +1 -0
- package/lib/dynamic/dynamicRuntime.d.ts +4 -0
- package/lib/dynamic/dynamicRuntime.esm.js +16 -0
- package/lib/dynamic/dynamicRuntime.esm.js.map +1 -0
- package/lib/dynamic/dynamicScope.cjs.js +2 -0
- package/lib/dynamic/dynamicScope.cjs.js.map +1 -0
- package/lib/dynamic/dynamicScope.d.ts +2 -0
- package/lib/dynamic/dynamicScope.esm.js +17 -0
- package/lib/dynamic/dynamicScope.esm.js.map +1 -0
- package/lib/dynamic/dynamicTree.cjs.js +2 -0
- package/lib/dynamic/dynamicTree.cjs.js.map +1 -0
- package/lib/dynamic/dynamicTree.d.ts +12 -0
- package/lib/dynamic/dynamicTree.esm.js +57 -0
- package/lib/dynamic/dynamicTree.esm.js.map +1 -0
- package/lib/dynamic/dynamicUi.cjs.js +2 -0
- package/lib/dynamic/dynamicUi.cjs.js.map +1 -0
- package/lib/dynamic/dynamicUi.d.ts +39 -0
- package/lib/dynamic/dynamicUi.esm.js +397 -0
- package/lib/dynamic/dynamicUi.esm.js.map +1 -0
- package/lib/formats/colorFormat.cjs.js +2 -0
- package/lib/formats/colorFormat.cjs.js.map +1 -0
- package/lib/formats/colorFormat.d.ts +127 -0
- package/lib/formats/colorFormat.esm.js +139 -0
- package/lib/formats/colorFormat.esm.js.map +1 -0
- package/lib/formats/dateValues.cjs.js +2 -0
- package/lib/formats/dateValues.cjs.js.map +1 -0
- package/lib/formats/dateValues.d.ts +3 -0
- package/lib/formats/dateValues.esm.js +21 -0
- package/lib/formats/dateValues.esm.js.map +1 -0
- package/lib/formats/duration.cjs.js +2 -0
- package/lib/formats/duration.cjs.js.map +1 -0
- package/lib/formats/duration.d.ts +13 -0
- package/lib/formats/duration.esm.js +28 -0
- package/lib/formats/duration.esm.js.map +1 -0
- package/lib/formats/maskControls.cjs.js +2 -0
- package/lib/formats/maskControls.cjs.js.map +1 -0
- package/lib/formats/maskControls.d.ts +32 -0
- package/lib/formats/maskControls.esm.js +16 -0
- package/lib/formats/maskControls.esm.js.map +1 -0
- package/lib/formats/maskFormat.cjs.js +2 -0
- package/lib/formats/maskFormat.cjs.js.map +1 -0
- package/lib/formats/maskFormat.d.ts +198 -0
- package/lib/formats/maskFormat.esm.js +79 -0
- package/lib/formats/maskFormat.esm.js.map +1 -0
- package/lib/formats/temporalBounds.cjs.js +2 -0
- package/lib/formats/temporalBounds.cjs.js.map +1 -0
- package/lib/formats/temporalBounds.d.ts +82 -0
- package/lib/formats/temporalBounds.esm.js +76 -0
- package/lib/formats/temporalBounds.esm.js.map +1 -0
- package/lib/formats/temporalFormats.cjs.js +2 -0
- package/lib/formats/temporalFormats.cjs.js.map +1 -0
- package/lib/formats/temporalFormats.d.ts +62 -0
- package/lib/formats/temporalFormats.esm.js +18 -0
- package/lib/formats/temporalFormats.esm.js.map +1 -0
- package/lib/formats/useMaskedInput.cjs.js +2 -0
- package/lib/formats/useMaskedInput.cjs.js.map +1 -0
- package/lib/formats/useMaskedInput.d.ts +11 -0
- package/lib/formats/useMaskedInput.esm.js +80 -0
- package/lib/formats/useMaskedInput.esm.js.map +1 -0
- package/lib/index.cjs.js +1 -0
- package/lib/index.d.ts +42 -0
- package/lib/index.esm.js +44 -0
- package/lib/interaction/confirmation.cjs.js +2 -0
- package/lib/interaction/confirmation.cjs.js.map +1 -0
- package/lib/interaction/confirmation.d.ts +112 -0
- package/lib/interaction/confirmation.esm.js +18 -0
- package/lib/interaction/confirmation.esm.js.map +1 -0
- package/lib/interaction/createDeleteConfirmation.cjs.js +2 -0
- package/lib/interaction/createDeleteConfirmation.cjs.js.map +1 -0
- package/lib/interaction/createDeleteConfirmation.d.ts +10 -0
- package/lib/interaction/createDeleteConfirmation.esm.js +17 -0
- package/lib/interaction/createDeleteConfirmation.esm.js.map +1 -0
- package/lib/interaction/detailDialog.cjs.js +2 -0
- package/lib/interaction/detailDialog.cjs.js.map +1 -0
- package/lib/interaction/detailDialog.d.ts +30 -0
- package/lib/interaction/detailDialog.esm.js +89 -0
- package/lib/interaction/detailDialog.esm.js.map +1 -0
- package/lib/interaction/pendingChanges.cjs.js +2 -0
- package/lib/interaction/pendingChanges.cjs.js.map +1 -0
- package/lib/interaction/pendingChanges.d.ts +19 -0
- package/lib/interaction/pendingChanges.esm.js +17 -0
- package/lib/interaction/pendingChanges.esm.js.map +1 -0
- package/lib/interaction/useConfirmationState.cjs.js +2 -0
- package/lib/interaction/useConfirmationState.cjs.js.map +1 -0
- package/lib/interaction/useConfirmationState.d.ts +11 -0
- package/lib/interaction/useConfirmationState.esm.js +39 -0
- package/lib/interaction/useConfirmationState.esm.js.map +1 -0
- package/lib/interaction/visuallyHidden.cjs.js +2 -0
- package/lib/interaction/visuallyHidden.cjs.js.map +1 -0
- package/lib/interaction/visuallyHidden.d.ts +9 -0
- package/lib/interaction/visuallyHidden.esm.js +14 -0
- package/lib/interaction/visuallyHidden.esm.js.map +1 -0
- package/lib/layout/categoryState.cjs.js +2 -0
- package/lib/layout/categoryState.cjs.js.map +1 -0
- package/lib/layout/categoryState.d.ts +66 -0
- package/lib/layout/categoryState.esm.js +42 -0
- package/lib/layout/categoryState.esm.js.map +1 -0
- package/lib/layout/groupState.cjs.js +2 -0
- package/lib/layout/groupState.cjs.js.map +1 -0
- package/lib/layout/groupState.d.ts +34 -0
- package/lib/layout/groupState.esm.js +63 -0
- package/lib/layout/groupState.esm.js.map +1 -0
- package/lib/layout/layoutContext.cjs.js +2 -0
- package/lib/layout/layoutContext.cjs.js.map +1 -0
- package/lib/layout/layoutContext.d.ts +16 -0
- package/lib/layout/layoutContext.esm.js +26 -0
- package/lib/layout/layoutContext.esm.js.map +1 -0
- package/lib/layout/layoutSizing.cjs.js +2 -0
- package/lib/layout/layoutSizing.cjs.js.map +1 -0
- package/lib/layout/layoutSizing.d.ts +104 -0
- package/lib/layout/layoutSizing.esm.js +69 -0
- package/lib/layout/layoutSizing.esm.js.map +1 -0
- package/lib/locale/bg.cjs.js +2 -0
- package/lib/locale/bg.cjs.js.map +1 -0
- package/lib/locale/bg.d.ts +279 -0
- package/lib/locale/bg.esm.js +271 -0
- package/lib/locale/bg.esm.js.map +1 -0
- package/lib/locale/calendar.cjs.js +2 -0
- package/lib/locale/calendar.cjs.js.map +1 -0
- package/lib/locale/calendar.d.ts +23 -0
- package/lib/locale/calendar.esm.js +57 -0
- package/lib/locale/calendar.esm.js.map +1 -0
- package/lib/locale/en.cjs.js +2 -0
- package/lib/locale/en.cjs.js.map +1 -0
- package/lib/locale/en.d.ts +275 -0
- package/lib/locale/en.esm.js +271 -0
- package/lib/locale/en.esm.js.map +1 -0
- package/lib/locale/index.cjs.js +1 -0
- package/lib/locale/index.d.ts +3 -0
- package/lib/locale/index.esm.js +3 -0
- package/lib/locale/intl.cjs.js +2 -0
- package/lib/locale/intl.cjs.js.map +1 -0
- package/lib/locale/intl.d.ts +2 -0
- package/lib/locale/intl.esm.js +11 -0
- package/lib/locale/intl.esm.js.map +1 -0
- package/lib/locale/rendererLocale.cjs.js +2 -0
- package/lib/locale/rendererLocale.cjs.js.map +1 -0
- package/lib/locale/rendererLocale.d.ts +40 -0
- package/lib/locale/rendererLocale.esm.js +24 -0
- package/lib/locale/rendererLocale.esm.js.map +1 -0
- package/lib/locale/translate.cjs.js +2 -0
- package/lib/locale/translate.cjs.js.map +1 -0
- package/lib/locale/translate.d.ts +43 -0
- package/lib/locale/translate.esm.js +25 -0
- package/lib/locale/translate.esm.js.map +1 -0
- package/lib/mixed/MixedDetailControl.cjs.js +2 -0
- package/lib/mixed/MixedDetailControl.cjs.js.map +1 -0
- package/lib/mixed/MixedDetailControl.d.ts +20 -0
- package/lib/mixed/MixedDetailControl.esm.js +73 -0
- package/lib/mixed/MixedDetailControl.esm.js.map +1 -0
- package/lib/mixed/RecursiveTreeRenderer.cjs.js +2 -0
- package/lib/mixed/RecursiveTreeRenderer.cjs.js.map +1 -0
- package/lib/mixed/RecursiveTreeRenderer.d.ts +35 -0
- package/lib/mixed/RecursiveTreeRenderer.esm.js +206 -0
- package/lib/mixed/RecursiveTreeRenderer.esm.js.map +1 -0
- package/lib/mixed/createMixedTypeChangeHandler.cjs.js +2 -0
- package/lib/mixed/createMixedTypeChangeHandler.cjs.js.map +1 -0
- package/lib/mixed/createMixedTypeChangeHandler.d.ts +16 -0
- package/lib/mixed/createMixedTypeChangeHandler.esm.js +34 -0
- package/lib/mixed/createMixedTypeChangeHandler.esm.js.map +1 -0
- package/lib/mixed/mixedComposition.cjs.js +2 -0
- package/lib/mixed/mixedComposition.cjs.js.map +1 -0
- package/lib/mixed/mixedComposition.d.ts +7 -0
- package/lib/mixed/mixedComposition.esm.js +37 -0
- package/lib/mixed/mixedComposition.esm.js.map +1 -0
- package/lib/mixed/mixedNodeEditor.cjs.js +2 -0
- package/lib/mixed/mixedNodeEditor.cjs.js.map +1 -0
- package/lib/mixed/mixedNodeEditor.d.ts +12 -0
- package/lib/mixed/mixedNodeEditor.esm.js +20 -0
- package/lib/mixed/mixedNodeEditor.esm.js.map +1 -0
- package/lib/mixed/mixedScalar.cjs.js +2 -0
- package/lib/mixed/mixedScalar.cjs.js.map +1 -0
- package/lib/mixed/mixedScalar.d.ts +4 -0
- package/lib/mixed/mixedScalar.esm.js +6 -0
- package/lib/mixed/mixedScalar.esm.js.map +1 -0
- package/lib/mixed/mixedSchema.cjs.js +2 -0
- package/lib/mixed/mixedSchema.cjs.js.map +1 -0
- package/lib/mixed/mixedSchema.d.ts +22 -0
- package/lib/mixed/mixedSchema.esm.js +88 -0
- package/lib/mixed/mixedSchema.esm.js.map +1 -0
- package/lib/mixed/mixedTree.cjs.js +2 -0
- package/lib/mixed/mixedTree.cjs.js.map +1 -0
- package/lib/mixed/mixedTree.d.ts +19 -0
- package/lib/mixed/mixedTree.esm.js +78 -0
- package/lib/mixed/mixedTree.esm.js.map +1 -0
- package/lib/mixed/mixedTreeActions.cjs.js +2 -0
- package/lib/mixed/mixedTreeActions.cjs.js.map +1 -0
- package/lib/mixed/mixedTreeActions.d.ts +6 -0
- package/lib/mixed/mixedTreeActions.esm.js +17 -0
- package/lib/mixed/mixedTreeActions.esm.js.map +1 -0
- package/lib/mixed/recursiveTree.cjs.js +2 -0
- package/lib/mixed/recursiveTree.cjs.js.map +1 -0
- package/lib/mixed/recursiveTree.d.ts +9 -0
- package/lib/mixed/recursiveTree.esm.js +49 -0
- package/lib/mixed/recursiveTree.esm.js.map +1 -0
- package/lib/mixed/useMixedNavigation.cjs.js +2 -0
- package/lib/mixed/useMixedNavigation.cjs.js.map +1 -0
- package/lib/mixed/useMixedNavigation.d.ts +6 -0
- package/lib/mixed/useMixedNavigation.esm.js +21 -0
- package/lib/mixed/useMixedNavigation.esm.js.map +1 -0
- package/lib/mixed/useMixedRenderer.cjs.js +2 -0
- package/lib/mixed/useMixedRenderer.cjs.js.map +1 -0
- package/lib/mixed/useMixedRenderer.d.ts +61 -0
- package/lib/mixed/useMixedRenderer.esm.js +185 -0
- package/lib/mixed/useMixedRenderer.esm.js.map +1 -0
- package/lib/mixed/useMixedType.cjs.js +2 -0
- package/lib/mixed/useMixedType.cjs.js.map +1 -0
- package/lib/mixed/useMixedType.d.ts +6 -0
- package/lib/mixed/useMixedType.esm.js +23 -0
- package/lib/mixed/useMixedType.esm.js.map +1 -0
- package/lib/objects/IsolatedPropertyEditor.cjs.js +2 -0
- package/lib/objects/IsolatedPropertyEditor.cjs.js.map +1 -0
- package/lib/objects/IsolatedPropertyEditor.d.ts +35 -0
- package/lib/objects/IsolatedPropertyEditor.esm.js +27 -0
- package/lib/objects/IsolatedPropertyEditor.esm.js.map +1 -0
- package/lib/objects/ObjectDetail.cjs.js +2 -0
- package/lib/objects/ObjectDetail.cjs.js.map +1 -0
- package/lib/objects/ObjectDetail.d.ts +42 -0
- package/lib/objects/ObjectDetail.esm.js +103 -0
- package/lib/objects/ObjectDetail.esm.js.map +1 -0
- package/lib/objects/additionalProperties.cjs.js +2 -0
- package/lib/objects/additionalProperties.cjs.js.map +1 -0
- package/lib/objects/additionalProperties.d.ts +14 -0
- package/lib/objects/additionalProperties.esm.js +41 -0
- package/lib/objects/additionalProperties.esm.js.map +1 -0
- package/lib/objects/additionalPropertyName.cjs.js +2 -0
- package/lib/objects/additionalPropertyName.cjs.js.map +1 -0
- package/lib/objects/additionalPropertyName.d.ts +63 -0
- package/lib/objects/additionalPropertyName.esm.js +46 -0
- package/lib/objects/additionalPropertyName.esm.js.map +1 -0
- package/lib/objects/conditionalFields.cjs.js +2 -0
- package/lib/objects/conditionalFields.cjs.js.map +1 -0
- package/lib/objects/conditionalFields.d.ts +18 -0
- package/lib/objects/conditionalFields.esm.js +105 -0
- package/lib/objects/conditionalFields.esm.js.map +1 -0
- package/lib/objects/dynamicProperties.cjs.js +2 -0
- package/lib/objects/dynamicProperties.cjs.js.map +1 -0
- package/lib/objects/dynamicProperties.d.ts +10 -0
- package/lib/objects/dynamicProperties.esm.js +33 -0
- package/lib/objects/dynamicProperties.esm.js.map +1 -0
- package/lib/objects/literalPropertySchema.cjs.js +2 -0
- package/lib/objects/literalPropertySchema.cjs.js.map +1 -0
- package/lib/objects/literalPropertySchema.d.ts +2 -0
- package/lib/objects/literalPropertySchema.esm.js +38 -0
- package/lib/objects/literalPropertySchema.esm.js.map +1 -0
- package/lib/objects/useAdditionalPropertyEntries.cjs.js +2 -0
- package/lib/objects/useAdditionalPropertyEntries.cjs.js.map +1 -0
- package/lib/objects/useAdditionalPropertyEntries.d.ts +72 -0
- package/lib/objects/useAdditionalPropertyEntries.esm.js +71 -0
- package/lib/objects/useAdditionalPropertyEntries.esm.js.map +1 -0
- package/lib/rolldown-runtime-BocRIvOZ.js +1 -0
- package/lib/tuple/TupleControlContent.cjs.js +2 -0
- package/lib/tuple/TupleControlContent.cjs.js.map +1 -0
- package/lib/tuple/TupleControlContent.d.ts +17 -0
- package/lib/tuple/TupleControlContent.esm.js +74 -0
- package/lib/tuple/TupleControlContent.esm.js.map +1 -0
- package/lib/tuple/TupleField.cjs.js +2 -0
- package/lib/tuple/TupleField.cjs.js.map +1 -0
- package/lib/tuple/TupleField.d.ts +15 -0
- package/lib/tuple/TupleField.esm.js +72 -0
- package/lib/tuple/TupleField.esm.js.map +1 -0
- package/lib/tuple/tupleSchema.cjs.js +2 -0
- package/lib/tuple/tupleSchema.cjs.js.map +1 -0
- package/lib/tuple/tupleSchema.d.ts +93 -0
- package/lib/tuple/tupleSchema.esm.js +63 -0
- package/lib/tuple/tupleSchema.esm.js.map +1 -0
- package/lib/tuple/useTupleAdditionalItems.cjs.js +2 -0
- package/lib/tuple/useTupleAdditionalItems.cjs.js.map +1 -0
- package/lib/tuple/useTupleAdditionalItems.d.ts +45 -0
- package/lib/tuple/useTupleAdditionalItems.esm.js +47 -0
- package/lib/tuple/useTupleAdditionalItems.esm.js.map +1 -0
- package/lib/tuple/useTupleControl.cjs.js +3 -0
- package/lib/tuple/useTupleControl.cjs.js.map +1 -0
- package/lib/tuple/useTupleControl.d.ts +26 -0
- package/lib/tuple/useTupleControl.esm.js +84 -0
- package/lib/tuple/useTupleControl.esm.js.map +1 -0
- package/lib/tuple/useTupleField.cjs.js +2 -0
- package/lib/tuple/useTupleField.cjs.js.map +1 -0
- package/lib/tuple/useTupleField.d.ts +38 -0
- package/lib/tuple/useTupleField.esm.js +80 -0
- package/lib/tuple/useTupleField.esm.js.map +1 -0
- package/lib/validation/ItemValidationIndicator.cjs.js +2 -0
- package/lib/validation/ItemValidationIndicator.cjs.js.map +1 -0
- package/lib/validation/ItemValidationIndicator.d.ts +9 -0
- package/lib/validation/ItemValidationIndicator.esm.js +14 -0
- package/lib/validation/ItemValidationIndicator.esm.js.map +1 -0
- package/lib/validation/errorSummary.cjs.js +9 -0
- package/lib/validation/errorSummary.cjs.js.map +1 -0
- package/lib/validation/errorSummary.d.ts +44 -0
- package/lib/validation/errorSummary.esm.js +194 -0
- package/lib/validation/errorSummary.esm.js.map +1 -0
- package/lib/validation/preTouchErrors.cjs.js +2 -0
- package/lib/validation/preTouchErrors.cjs.js.map +1 -0
- package/lib/validation/preTouchErrors.d.ts +77 -0
- package/lib/validation/preTouchErrors.esm.js +42 -0
- package/lib/validation/preTouchErrors.esm.js.map +1 -0
- package/lib/validation/validationIndicator.cjs.js +2 -0
- package/lib/validation/validationIndicator.cjs.js.map +1 -0
- package/lib/validation/validationIndicator.d.ts +72 -0
- package/lib/validation/validationIndicator.esm.js +66 -0
- package/lib/validation/validationIndicator.esm.js.map +1 -0
- package/lib/webcomponent/element.cjs.js +2 -0
- package/lib/webcomponent/element.cjs.js.map +1 -0
- package/lib/webcomponent/element.d.ts +48 -0
- package/lib/webcomponent/element.esm.js +85 -0
- package/lib/webcomponent/element.esm.js.map +1 -0
- package/lib/webcomponent/input.cjs.js +2 -0
- package/lib/webcomponent/input.cjs.js.map +1 -0
- package/lib/webcomponent/input.d.ts +6 -0
- package/lib/webcomponent/input.esm.js +25 -0
- package/lib/webcomponent/input.esm.js.map +1 -0
- package/package.json +86 -3
- package/src/cells/CellSummary.tsx +59 -0
- package/src/cells/cellMode.tsx +21 -0
- package/src/cells/compositeActions.ts +21 -0
- package/src/cells/compositeCellTester.ts +15 -0
- package/src/cells/compositeSummary.ts +149 -0
- package/src/cells/useCompositeCellPresentation.ts +37 -0
- package/src/cells/useCompositeDraft.ts +199 -0
- package/src/collections/CollectionErrorNavigation.tsx +123 -0
- package/src/collections/arrayChoices.ts +235 -0
- package/src/collections/collectionPagination.ts +95 -0
- package/src/collections/columnResize.tsx +151 -0
- package/src/collections/rowDetail.tsx +208 -0
- package/src/collections/tableColumns.ts +39 -0
- package/src/collections/useArrayPanelState.ts +25 -0
- package/src/collections/useCollectionDelete.ts +62 -0
- package/src/collections/useTableSelection.ts +77 -0
- package/src/composition/AllOfRenderer.tsx +79 -0
- package/src/composition/CombinatorBranch.tsx +93 -0
- package/src/composition/CombinatorProperties.tsx +56 -0
- package/src/composition/ScalarCompositionControl.tsx +34 -0
- package/src/composition/choiceCards.tsx +389 -0
- package/src/composition/combinators.ts +131 -0
- package/src/composition/discriminatorBranch.ts +82 -0
- package/src/composition/scalarComposition.ts +193 -0
- package/src/composition/useCombinatorSelection.ts +53 -0
- package/src/composition/useScalarComposition.ts +67 -0
- package/src/controls/FileArrayInput.tsx +407 -0
- package/src/controls/controlHelp.ts +28 -0
- package/src/controls/inputAdornments.tsx +337 -0
- package/src/controls/numeric.ts +43 -0
- package/src/controls/useClearAffordance.ts +22 -0
- package/src/controls/useDebouncedChange.ts +138 -0
- package/src/controls/useFocus.ts +32 -0
- package/src/core/configNamespaces.ts +67 -0
- package/src/core/dataPointer.ts +8 -0
- package/src/core/detailUiSchema.ts +88 -0
- package/src/core/plainRecord.ts +8 -0
- package/src/core/uiSchemaCycle.tsx +122 -0
- package/src/dynamic/DynamicUiProvider.tsx +414 -0
- package/src/dynamic/dynamicCel.ts +68 -0
- package/src/dynamic/dynamicConfig.ts +26 -0
- package/src/dynamic/dynamicRuntime.ts +25 -0
- package/src/dynamic/dynamicScope.ts +22 -0
- package/src/dynamic/dynamicTree.ts +128 -0
- package/src/dynamic/dynamicUi.ts +711 -0
- package/src/formats/colorFormat.ts +390 -0
- package/src/formats/dateValues.ts +45 -0
- package/src/formats/duration.ts +60 -0
- package/src/formats/maskControls.ts +88 -0
- package/src/formats/maskFormat.ts +375 -0
- package/src/formats/temporalBounds.ts +219 -0
- package/src/formats/temporalFormats.ts +128 -0
- package/src/formats/useMaskedInput.ts +194 -0
- package/src/index.ts +42 -0
- package/src/interaction/confirmation.ts +211 -0
- package/src/interaction/createDeleteConfirmation.ts +23 -0
- package/src/interaction/detailDialog.ts +138 -0
- package/src/interaction/pendingChanges.tsx +55 -0
- package/src/interaction/useConfirmationState.ts +55 -0
- package/src/interaction/visuallyHidden.ts +19 -0
- package/src/layout/categoryState.ts +189 -0
- package/src/layout/groupState.ts +201 -0
- package/src/layout/layoutContext.tsx +49 -0
- package/src/layout/layoutSizing.ts +369 -0
- package/src/locale/bg.ts +309 -0
- package/src/locale/calendar.ts +57 -0
- package/src/locale/en.ts +375 -0
- package/src/locale/index.ts +5 -0
- package/src/locale/intl.ts +10 -0
- package/src/locale/rendererLocale.ts +74 -0
- package/src/locale/translate.ts +98 -0
- package/src/mixed/MixedDetailControl.tsx +182 -0
- package/src/mixed/RecursiveTreeRenderer.tsx +388 -0
- package/src/mixed/createMixedTypeChangeHandler.ts +77 -0
- package/src/mixed/mixedComposition.ts +76 -0
- package/src/mixed/mixedNodeEditor.ts +47 -0
- package/src/mixed/mixedScalar.ts +7 -0
- package/src/mixed/mixedSchema.ts +283 -0
- package/src/mixed/mixedTree.ts +199 -0
- package/src/mixed/mixedTreeActions.ts +60 -0
- package/src/mixed/recursiveTree.ts +105 -0
- package/src/mixed/useMixedNavigation.ts +36 -0
- package/src/mixed/useMixedRenderer.ts +300 -0
- package/src/mixed/useMixedType.ts +45 -0
- package/src/objects/IsolatedPropertyEditor.tsx +86 -0
- package/src/objects/ObjectDetail.tsx +232 -0
- package/src/objects/additionalProperties.ts +151 -0
- package/src/objects/additionalPropertyName.ts +185 -0
- package/src/objects/conditionalFields.ts +173 -0
- package/src/objects/dynamicProperties.tsx +68 -0
- package/src/objects/literalPropertySchema.ts +100 -0
- package/src/objects/useAdditionalPropertyEntries.ts +204 -0
- package/src/tuple/TupleControlContent.tsx +152 -0
- package/src/tuple/TupleField.tsx +150 -0
- package/src/tuple/tupleSchema.ts +245 -0
- package/src/tuple/useTupleAdditionalItems.ts +131 -0
- package/src/tuple/useTupleControl.tsx +173 -0
- package/src/tuple/useTupleField.ts +164 -0
- package/src/validation/ItemValidationIndicator.tsx +21 -0
- package/src/validation/errorSummary.tsx +489 -0
- package/src/validation/preTouchErrors.ts +185 -0
- package/src/validation/validationIndicator.ts +202 -0
- package/src/webcomponent/element.ts +107 -0
- package/src/webcomponent/input.ts +56 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Paths,
|
|
4
|
+
UPDATE_DATA,
|
|
5
|
+
getI18nKey,
|
|
6
|
+
update,
|
|
7
|
+
type JsonSchema,
|
|
8
|
+
type UISchemaElement,
|
|
9
|
+
} from '@jsonforms/core';
|
|
10
|
+
import { useJsonForms } from '@jsonforms/react';
|
|
11
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
12
|
+
import get from 'lodash/get';
|
|
13
|
+
import set from 'lodash/set';
|
|
14
|
+
import unset from 'lodash/unset';
|
|
15
|
+
import { resolveEditorDetail } from '../core/detailUiSchema';
|
|
16
|
+
import { useI18n, useI18nDefault, useTranslator } from '../locale/translate';
|
|
17
|
+
import {
|
|
18
|
+
isComplexTupleSchema,
|
|
19
|
+
tupleEmptyValue,
|
|
20
|
+
tupleFieldOwnsLabel,
|
|
21
|
+
tupleInitialValue,
|
|
22
|
+
tupleRenderSchema,
|
|
23
|
+
type TupleSchema,
|
|
24
|
+
} from './tupleSchema';
|
|
25
|
+
|
|
26
|
+
export interface TupleFieldBehaviorProps {
|
|
27
|
+
schema: TupleSchema;
|
|
28
|
+
prefix: TupleSchema[];
|
|
29
|
+
index: number;
|
|
30
|
+
arrayPath: string;
|
|
31
|
+
rootSchema: JsonSchema;
|
|
32
|
+
uischema: UISchemaElement;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Intercepts positional writes so missing tuple positions never become sparse array holes. */
|
|
37
|
+
export const useTupleField = ({
|
|
38
|
+
schema,
|
|
39
|
+
prefix,
|
|
40
|
+
index,
|
|
41
|
+
arrayPath,
|
|
42
|
+
rootSchema,
|
|
43
|
+
uischema,
|
|
44
|
+
enabled,
|
|
45
|
+
}: TupleFieldBehaviorProps) => {
|
|
46
|
+
const t = useI18n();
|
|
47
|
+
const translator = useTranslator();
|
|
48
|
+
const i18nDefault = useI18nDefault();
|
|
49
|
+
const context = useJsonForms();
|
|
50
|
+
const [open, setOpen] = useState(false);
|
|
51
|
+
const [message, setMessage] = useState<string | undefined>();
|
|
52
|
+
const path = Paths.compose(arrayPath, String(index));
|
|
53
|
+
const array = arrayPath
|
|
54
|
+
? get(context.core?.data, arrayPath.split('.'))
|
|
55
|
+
: context.core?.data;
|
|
56
|
+
const data: unknown[] = useMemo(
|
|
57
|
+
() => (Array.isArray(array) ? array : []),
|
|
58
|
+
[array],
|
|
59
|
+
);
|
|
60
|
+
const value = data[index];
|
|
61
|
+
const renderSchema = tupleRenderSchema(schema);
|
|
62
|
+
const complex = isComplexTupleSchema(schema);
|
|
63
|
+
const ownsLabel = tupleFieldOwnsLabel(schema);
|
|
64
|
+
const fallbackLabel = String((uischema as { label?: unknown }).label ?? '');
|
|
65
|
+
const label =
|
|
66
|
+
translator(
|
|
67
|
+
getI18nKey(renderSchema, uischema, path, 'label'),
|
|
68
|
+
fallbackLabel,
|
|
69
|
+
) ?? fallbackLabel;
|
|
70
|
+
const parentDispatch = context.dispatch;
|
|
71
|
+
|
|
72
|
+
/* eslint-disable react/preserve-manual-memoization -- The updater only mutates a deep-cloned tuple; lodash cloneDeep aliasing is opaque to the compiler. */
|
|
73
|
+
const intercept = useCallback(
|
|
74
|
+
(action: any) => {
|
|
75
|
+
const inside =
|
|
76
|
+
action?.type === UPDATE_DATA &&
|
|
77
|
+
(action.path === path || action.path?.startsWith(`${path}.`));
|
|
78
|
+
if (!inside) {
|
|
79
|
+
parentDispatch?.(action);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!enabled) return;
|
|
83
|
+
const source = [...cloneDeep(data)];
|
|
84
|
+
const relative =
|
|
85
|
+
action.path === path ? '' : action.path.slice(path.length + 1);
|
|
86
|
+
let next = action.updater(
|
|
87
|
+
cloneDeep(
|
|
88
|
+
relative ? get(source[index], relative.split('.')) : source[index],
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
if (!relative && next === undefined) {
|
|
92
|
+
next = tupleEmptyValue(schema, rootSchema);
|
|
93
|
+
if (next === undefined) {
|
|
94
|
+
setMessage(t('tuple.valueRequired'));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
for (let position = source.length; position < index; position += 1) {
|
|
99
|
+
const initial = tupleInitialValue(prefix[position] ?? true, rootSchema);
|
|
100
|
+
if (initial === undefined) {
|
|
101
|
+
setMessage(t('tuple.missingPosition', { position: position + 1 }));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
source.push(initial);
|
|
105
|
+
}
|
|
106
|
+
if (relative) {
|
|
107
|
+
if (source[index] === undefined) {
|
|
108
|
+
source[index] =
|
|
109
|
+
tupleInitialValue(schema, rootSchema) ??
|
|
110
|
+
(/^\d+(\.|$)/.test(relative) ? [] : {});
|
|
111
|
+
}
|
|
112
|
+
const segments = relative.split('.');
|
|
113
|
+
if (next === undefined) unset(source[index], segments);
|
|
114
|
+
else set(source[index] as object, segments, next);
|
|
115
|
+
} else source[index] = next;
|
|
116
|
+
setMessage(undefined);
|
|
117
|
+
parentDispatch?.(update(arrayPath, () => source));
|
|
118
|
+
},
|
|
119
|
+
[
|
|
120
|
+
arrayPath,
|
|
121
|
+
data,
|
|
122
|
+
enabled,
|
|
123
|
+
index,
|
|
124
|
+
parentDispatch,
|
|
125
|
+
path,
|
|
126
|
+
prefix,
|
|
127
|
+
rootSchema,
|
|
128
|
+
schema,
|
|
129
|
+
t,
|
|
130
|
+
],
|
|
131
|
+
);
|
|
132
|
+
/* eslint-enable react/preserve-manual-memoization */
|
|
133
|
+
|
|
134
|
+
const scoped = useMemo(
|
|
135
|
+
() => ({ ...context, dispatch: intercept }),
|
|
136
|
+
[context, intercept],
|
|
137
|
+
);
|
|
138
|
+
const detail = resolveEditorDetail(
|
|
139
|
+
uischema.options?.detail,
|
|
140
|
+
context.uischemas ?? [],
|
|
141
|
+
renderSchema,
|
|
142
|
+
'#',
|
|
143
|
+
path,
|
|
144
|
+
rootSchema,
|
|
145
|
+
{ ...uischema, options: { ...uischema.options, detail: undefined } },
|
|
146
|
+
);
|
|
147
|
+
return {
|
|
148
|
+
t,
|
|
149
|
+
translator,
|
|
150
|
+
i18nDefault,
|
|
151
|
+
open,
|
|
152
|
+
setOpen,
|
|
153
|
+
message,
|
|
154
|
+
path,
|
|
155
|
+
value,
|
|
156
|
+
renderSchema,
|
|
157
|
+
complex,
|
|
158
|
+
ownsLabel,
|
|
159
|
+
label,
|
|
160
|
+
intercept,
|
|
161
|
+
scoped,
|
|
162
|
+
detail,
|
|
163
|
+
};
|
|
164
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useContainerValidation } from './validationIndicator';
|
|
3
|
+
export const ItemValidationIndicator = ({
|
|
4
|
+
Indicator,
|
|
5
|
+
path,
|
|
6
|
+
options,
|
|
7
|
+
config,
|
|
8
|
+
}: {
|
|
9
|
+
Indicator: React.ComponentType<{ count?: number }>;
|
|
10
|
+
path: string;
|
|
11
|
+
options?: Record<string, any>;
|
|
12
|
+
config?: Record<string, any>;
|
|
13
|
+
}) => {
|
|
14
|
+
const indicator = useContainerValidation(
|
|
15
|
+
{ type: 'Control', scope: '#', options } as any,
|
|
16
|
+
path,
|
|
17
|
+
config,
|
|
18
|
+
false,
|
|
19
|
+
);
|
|
20
|
+
return indicator.show ? <Indicator count={indicator.count} /> : null;
|
|
21
|
+
};
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { useDynamicTreeResolver } from '../dynamic/DynamicUiProvider';
|
|
2
|
+
import { displayableErrors } from './validationIndicator';
|
|
3
|
+
import React, { useState, useMemo } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
getI18nKey,
|
|
6
|
+
defaultErrorTranslator,
|
|
7
|
+
getCombinedErrorMessage,
|
|
8
|
+
getControlPath,
|
|
9
|
+
Resolve,
|
|
10
|
+
toDataPathSegments,
|
|
11
|
+
} from '@jsonforms/core';
|
|
12
|
+
import { useJsonForms } from '@jsonforms/react';
|
|
13
|
+
import { useI18n, useTranslator } from '../locale/translate';
|
|
14
|
+
|
|
15
|
+
export interface ErrorSummaryEntry {
|
|
16
|
+
path: string;
|
|
17
|
+
message: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Translate structured errors without losing their paths or message boundaries. */
|
|
21
|
+
export const formatErrorSummary = (
|
|
22
|
+
errors: import('ajv').ErrorObject[],
|
|
23
|
+
rootSchema: import('@jsonforms/core').JsonSchema | undefined,
|
|
24
|
+
rootUiSchema: import('@jsonforms/core').UISchemaElement | undefined,
|
|
25
|
+
translate: import('@jsonforms/core').Translator,
|
|
26
|
+
translateError = defaultErrorTranslator,
|
|
27
|
+
): ErrorSummaryEntry[] => {
|
|
28
|
+
const findControl = (node: any, scope: string): any => {
|
|
29
|
+
if (node?.type === 'Control' && node.scope === scope) return node;
|
|
30
|
+
for (const child of node?.elements ?? []) {
|
|
31
|
+
const found = findControl(child, scope);
|
|
32
|
+
if (found) return found;
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
return errors.map((error) => {
|
|
37
|
+
const path = getControlPath(error);
|
|
38
|
+
// Walk data segments, preserving one-based row numbers in the label.
|
|
39
|
+
let schema: any = rootSchema;
|
|
40
|
+
let scope = '#';
|
|
41
|
+
let prefix = '';
|
|
42
|
+
const labels: string[] = [];
|
|
43
|
+
for (const segment of path.split('.').filter(Boolean)) {
|
|
44
|
+
if (schema?.$ref && rootSchema)
|
|
45
|
+
schema = Resolve.schema(rootSchema, schema.$ref, rootSchema);
|
|
46
|
+
prefix = prefix ? prefix + '.' + segment : segment;
|
|
47
|
+
if (schema?.type === 'array' && /^\d+$/.test(segment)) {
|
|
48
|
+
schema = Array.isArray(schema.items)
|
|
49
|
+
? schema.items[Number(segment)]
|
|
50
|
+
: schema.items;
|
|
51
|
+
scope += '/items';
|
|
52
|
+
labels.push(String(Number(segment) + 1));
|
|
53
|
+
} else {
|
|
54
|
+
schema = schema?.properties?.[segment] ?? schema?.additionalProperties;
|
|
55
|
+
scope +=
|
|
56
|
+
'/properties/' + segment.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
57
|
+
const control = findControl(rootUiSchema, scope);
|
|
58
|
+
const fallbackLabel =
|
|
59
|
+
typeof control?.label === 'string'
|
|
60
|
+
? control.label
|
|
61
|
+
: (schema?.title ?? segment);
|
|
62
|
+
labels.push(
|
|
63
|
+
translate(
|
|
64
|
+
getI18nKey(schema, control, prefix, 'label'),
|
|
65
|
+
fallbackLabel,
|
|
66
|
+
) ?? fallbackLabel,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const control = findControl(rootUiSchema, scope);
|
|
71
|
+
const message = getCombinedErrorMessage(
|
|
72
|
+
[error],
|
|
73
|
+
translateError,
|
|
74
|
+
translate,
|
|
75
|
+
schema,
|
|
76
|
+
control,
|
|
77
|
+
path,
|
|
78
|
+
);
|
|
79
|
+
return { path: labels.join(' / '), message };
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
function useErrorSummaryContext() {
|
|
84
|
+
const context = useJsonForms();
|
|
85
|
+
const resolveTree = useDynamicTreeResolver();
|
|
86
|
+
const effectiveUi = context.core?.uischema
|
|
87
|
+
? resolveTree(context.core.uischema)
|
|
88
|
+
: undefined;
|
|
89
|
+
const translate = useTranslator();
|
|
90
|
+
const [primary, additional] = displayableErrors(context.core ?? {});
|
|
91
|
+
return { context, effectiveUi, translate, primary, additional };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const useErrorSummary = (
|
|
95
|
+
fallback: string,
|
|
96
|
+
path?: string,
|
|
97
|
+
active = true,
|
|
98
|
+
) => {
|
|
99
|
+
const { context, effectiveUi, translate, primary, additional } =
|
|
100
|
+
useErrorSummaryContext();
|
|
101
|
+
const errors =
|
|
102
|
+
path === undefined
|
|
103
|
+
? noErrors
|
|
104
|
+
: (indexedPathErrors(primary, additional).get(path) ?? noErrors);
|
|
105
|
+
return useMemo(() => {
|
|
106
|
+
if (!active || !fallback) return [];
|
|
107
|
+
const entries = formatErrorSummary(
|
|
108
|
+
errors,
|
|
109
|
+
context.core?.schema,
|
|
110
|
+
effectiveUi,
|
|
111
|
+
translate,
|
|
112
|
+
context.i18n?.translateError,
|
|
113
|
+
);
|
|
114
|
+
return entries.length
|
|
115
|
+
? entries
|
|
116
|
+
: fallback
|
|
117
|
+
.split('\n')
|
|
118
|
+
.filter(Boolean)
|
|
119
|
+
.map((message) => ({ path: '', message }));
|
|
120
|
+
}, [
|
|
121
|
+
active,
|
|
122
|
+
fallback,
|
|
123
|
+
errors,
|
|
124
|
+
context.core?.schema,
|
|
125
|
+
effectiveUi,
|
|
126
|
+
translate,
|
|
127
|
+
context.i18n?.translateError,
|
|
128
|
+
]);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/** Cheap count for choosing tooltip presentation; never translates individual errors. */
|
|
132
|
+
export const useErrorSummaryCount = (fallback: string, path?: string) => {
|
|
133
|
+
const context = useJsonForms();
|
|
134
|
+
if (!fallback) return 0;
|
|
135
|
+
const errors =
|
|
136
|
+
path === undefined
|
|
137
|
+
? undefined
|
|
138
|
+
: indexedPathErrors(...displayableErrors(context.core ?? {})).get(path);
|
|
139
|
+
return errors?.length || fallback.split('\n').filter(Boolean).length;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** Header indicators need a short accessible summary, not every formatted descendant. */
|
|
143
|
+
export const usePathErrorIndicator = (
|
|
144
|
+
path: string,
|
|
145
|
+
options?: Record<string, any>,
|
|
146
|
+
includeChildren = true,
|
|
147
|
+
) => {
|
|
148
|
+
const context = useJsonForms();
|
|
149
|
+
const resolveTree = useDynamicTreeResolver();
|
|
150
|
+
const effectiveUi = context.core?.uischema
|
|
151
|
+
? resolveTree(context.core.uischema)
|
|
152
|
+
: undefined;
|
|
153
|
+
const t = useI18n();
|
|
154
|
+
const translate = useTranslator();
|
|
155
|
+
const errors =
|
|
156
|
+
indexedPathErrors(...displayableErrors(context.core ?? {})).get(path) ??
|
|
157
|
+
noErrors;
|
|
158
|
+
const own = useMemo(
|
|
159
|
+
() =>
|
|
160
|
+
errors.filter(
|
|
161
|
+
(error) =>
|
|
162
|
+
getControlPath(error) === path &&
|
|
163
|
+
error.keyword !== 'propertyNames' &&
|
|
164
|
+
(error as any).propertyName === undefined,
|
|
165
|
+
),
|
|
166
|
+
[errors, path],
|
|
167
|
+
);
|
|
168
|
+
const children = errors.length - own.length;
|
|
169
|
+
const showCount =
|
|
170
|
+
options?.showValidationIndicatorCount ??
|
|
171
|
+
context.config?.showValidationIndicatorCount ??
|
|
172
|
+
false;
|
|
173
|
+
const ownMessages = useMemo(
|
|
174
|
+
() =>
|
|
175
|
+
formatErrorSummary(
|
|
176
|
+
own,
|
|
177
|
+
context.core?.schema,
|
|
178
|
+
effectiveUi,
|
|
179
|
+
translate,
|
|
180
|
+
context.i18n?.translateError,
|
|
181
|
+
).map((entry) => entry.message),
|
|
182
|
+
[
|
|
183
|
+
own,
|
|
184
|
+
context.core?.schema,
|
|
185
|
+
effectiveUi,
|
|
186
|
+
translate,
|
|
187
|
+
context.i18n?.translateError,
|
|
188
|
+
],
|
|
189
|
+
);
|
|
190
|
+
const messages = [...ownMessages];
|
|
191
|
+
if (includeChildren && children)
|
|
192
|
+
messages.push(
|
|
193
|
+
t(
|
|
194
|
+
showCount
|
|
195
|
+
? children === 1
|
|
196
|
+
? 'validation.childrenErrorCount'
|
|
197
|
+
: 'validation.childrenErrorsCount'
|
|
198
|
+
: 'validation.childrenErrors',
|
|
199
|
+
{ count: children },
|
|
200
|
+
),
|
|
201
|
+
);
|
|
202
|
+
return messages.join('\n');
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const noErrors: import('ajv').ErrorObject[] = [];
|
|
206
|
+
const pathCache = new WeakMap<
|
|
207
|
+
import('ajv').ErrorObject[],
|
|
208
|
+
WeakMap<import('ajv').ErrorObject[], Map<string, import('ajv').ErrorObject[]>>
|
|
209
|
+
>();
|
|
210
|
+
/** Share descendant lists across all cells for each validation result. */
|
|
211
|
+
export const indexedPathErrors = (
|
|
212
|
+
primary = noErrors,
|
|
213
|
+
additional = noErrors,
|
|
214
|
+
) => {
|
|
215
|
+
let secondary = pathCache.get(primary);
|
|
216
|
+
if (!secondary) {
|
|
217
|
+
secondary = new WeakMap();
|
|
218
|
+
pathCache.set(primary, secondary);
|
|
219
|
+
}
|
|
220
|
+
let index = secondary.get(additional);
|
|
221
|
+
if (!index) {
|
|
222
|
+
index = new Map();
|
|
223
|
+
for (const error of [...primary, ...additional]) {
|
|
224
|
+
const path = getControlPath(error);
|
|
225
|
+
const ancestors = [''];
|
|
226
|
+
let prefix = '';
|
|
227
|
+
for (const segment of path.split('.')) {
|
|
228
|
+
if (!segment) continue;
|
|
229
|
+
prefix = prefix ? prefix + '.' + segment : segment;
|
|
230
|
+
ancestors.push(prefix);
|
|
231
|
+
}
|
|
232
|
+
for (const ancestor of ancestors) {
|
|
233
|
+
const entries = index.get(ancestor) ?? [];
|
|
234
|
+
entries.push(error);
|
|
235
|
+
index.set(ancestor, entries);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
secondary.set(additional, index);
|
|
239
|
+
}
|
|
240
|
+
return index;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export const useCollectionErrors = (path: string) => {
|
|
244
|
+
const context = useJsonForms();
|
|
245
|
+
const index = indexedPathErrors(...displayableErrors(context.core ?? {}));
|
|
246
|
+
const errors = index.get(path) ?? noErrors;
|
|
247
|
+
const first = errors
|
|
248
|
+
.map(
|
|
249
|
+
(error) =>
|
|
250
|
+
getControlPath(error)
|
|
251
|
+
.slice(path ? path.length + 1 : 0)
|
|
252
|
+
.split('.')[0],
|
|
253
|
+
)
|
|
254
|
+
.find((segment) => /^\d+$/.test(segment));
|
|
255
|
+
return {
|
|
256
|
+
count: errors.length,
|
|
257
|
+
firstIndex: first === undefined ? undefined : Number(first),
|
|
258
|
+
rowCount: (row: number) =>
|
|
259
|
+
index.get(path ? path + '.' + row : String(row))?.length ?? 0,
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/** Only explicit detail controls can make Label summary errors actionable. */
|
|
264
|
+
export const labelDetailErrorPaths = (
|
|
265
|
+
path: string,
|
|
266
|
+
options: any,
|
|
267
|
+
): string[] | undefined => {
|
|
268
|
+
if (options?.summary?.type !== 'Label') return undefined;
|
|
269
|
+
const paths: string[] = [];
|
|
270
|
+
const visit = (element: any) => {
|
|
271
|
+
if (!element || typeof element !== 'object') return;
|
|
272
|
+
if (element.type === 'Control' && typeof element.scope === 'string') {
|
|
273
|
+
const relative = toDataPathSegments(element.scope).join('.');
|
|
274
|
+
paths.push([path, relative].filter(Boolean).join('.'));
|
|
275
|
+
}
|
|
276
|
+
if (Array.isArray(element.elements)) element.elements.forEach(visit);
|
|
277
|
+
};
|
|
278
|
+
visit(options.detail);
|
|
279
|
+
return paths;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/** Include errors on a composite value and all descendants, with core path semantics. */
|
|
283
|
+
export const usePathErrorMessages = (
|
|
284
|
+
path: string,
|
|
285
|
+
includedPaths?: string[],
|
|
286
|
+
): string => {
|
|
287
|
+
const context = useJsonForms();
|
|
288
|
+
const resolveTree = useDynamicTreeResolver();
|
|
289
|
+
const effectiveUi = context.core?.uischema
|
|
290
|
+
? resolveTree(context.core.uischema)
|
|
291
|
+
: undefined;
|
|
292
|
+
const translate = useTranslator();
|
|
293
|
+
const index = indexedPathErrors(...displayableErrors(context.core ?? {}));
|
|
294
|
+
const errors =
|
|
295
|
+
includedPaths === undefined
|
|
296
|
+
? (index.get(path) ?? noErrors)
|
|
297
|
+
: Array.from(
|
|
298
|
+
new Set(
|
|
299
|
+
includedPaths.flatMap(
|
|
300
|
+
(included) => index.get(included) ?? noErrors,
|
|
301
|
+
),
|
|
302
|
+
),
|
|
303
|
+
);
|
|
304
|
+
return formatErrorSummary(
|
|
305
|
+
errors,
|
|
306
|
+
context.core?.schema,
|
|
307
|
+
effectiveUi,
|
|
308
|
+
translate,
|
|
309
|
+
context.i18n?.translateError,
|
|
310
|
+
)
|
|
311
|
+
.map((entry) =>
|
|
312
|
+
entry.path ? `${entry.path}: ${entry.message}` : entry.message,
|
|
313
|
+
)
|
|
314
|
+
.join('\n');
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
/** Shared presentation structure; the renderer supplies its native action component. */
|
|
318
|
+
export const ErrorSummaryList = ({
|
|
319
|
+
entries,
|
|
320
|
+
renderToggle,
|
|
321
|
+
}: {
|
|
322
|
+
entries: ErrorSummaryEntry[];
|
|
323
|
+
renderToggle: (
|
|
324
|
+
label: string,
|
|
325
|
+
toggle: () => void,
|
|
326
|
+
expanded: boolean,
|
|
327
|
+
) => React.ReactNode;
|
|
328
|
+
}) => {
|
|
329
|
+
const [expanded, setExpanded] = useState(false);
|
|
330
|
+
const t = useI18n();
|
|
331
|
+
const limit = 3;
|
|
332
|
+
return (
|
|
333
|
+
<div style={{ maxWidth: 'min(28rem, 80vw)' }}>
|
|
334
|
+
<strong>
|
|
335
|
+
{t(
|
|
336
|
+
entries.length === 1
|
|
337
|
+
? 'validation.containerError'
|
|
338
|
+
: 'validation.containerErrors',
|
|
339
|
+
{ count: entries.length },
|
|
340
|
+
)}
|
|
341
|
+
</strong>
|
|
342
|
+
<ul
|
|
343
|
+
style={{
|
|
344
|
+
margin: '8px 0',
|
|
345
|
+
paddingInlineStart: 20,
|
|
346
|
+
maxHeight: 'min(20rem, 50vh)',
|
|
347
|
+
overflowY: 'auto',
|
|
348
|
+
overflowWrap: 'anywhere',
|
|
349
|
+
}}
|
|
350
|
+
>
|
|
351
|
+
{(expanded ? entries : entries.slice(0, limit)).map((entry, index) => (
|
|
352
|
+
<li key={index} style={{ marginBlock: 4 }}>
|
|
353
|
+
{entry.path && <strong>{entry.path}: </strong>}
|
|
354
|
+
{entry.message}
|
|
355
|
+
</li>
|
|
356
|
+
))}
|
|
357
|
+
</ul>
|
|
358
|
+
{entries.length > limit &&
|
|
359
|
+
renderToggle(
|
|
360
|
+
t(expanded ? 'validation.showLess' : 'validation.showMore', {
|
|
361
|
+
count: entries.length - limit,
|
|
362
|
+
}),
|
|
363
|
+
() => setExpanded(!expanded),
|
|
364
|
+
expanded,
|
|
365
|
+
)}
|
|
366
|
+
</div>
|
|
367
|
+
);
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
/** Object-owned group feedback; descendants keep their own validation messages. */
|
|
371
|
+
export const ObjectErrorContext = React.createContext<
|
|
372
|
+
{ uischema: unknown; message: string } | undefined
|
|
373
|
+
>(undefined);
|
|
374
|
+
|
|
375
|
+
const instanceDataPath = (pointer: string) =>
|
|
376
|
+
pointer
|
|
377
|
+
.split('/')
|
|
378
|
+
.slice(1)
|
|
379
|
+
.map((segment) => segment.replace(/~1/g, '/').replace(/~0/g, '~'))
|
|
380
|
+
.join('.');
|
|
381
|
+
|
|
382
|
+
/** Disallowed keys belong to the dynamic-property editor, including literal keys. */
|
|
383
|
+
export const useAdditionalPropertyErrors = (path: string) => {
|
|
384
|
+
const { context, effectiveUi, translate, primary, additional } =
|
|
385
|
+
useErrorSummaryContext();
|
|
386
|
+
return useMemo(() => {
|
|
387
|
+
const errors = [...(primary ?? []), ...(additional ?? [])].filter(
|
|
388
|
+
(error) =>
|
|
389
|
+
error.keyword === 'additionalProperties' &&
|
|
390
|
+
instanceDataPath(error.instancePath) === path,
|
|
391
|
+
);
|
|
392
|
+
return formatErrorSummary(
|
|
393
|
+
errors,
|
|
394
|
+
context.core?.schema,
|
|
395
|
+
effectiveUi,
|
|
396
|
+
translate,
|
|
397
|
+
context.i18n?.translateError,
|
|
398
|
+
)
|
|
399
|
+
.map(
|
|
400
|
+
(entry, index) =>
|
|
401
|
+
`${errors[index].params.additionalProperty}: ${entry.message}`,
|
|
402
|
+
)
|
|
403
|
+
.join('\n');
|
|
404
|
+
}, [
|
|
405
|
+
primary,
|
|
406
|
+
additional,
|
|
407
|
+
path,
|
|
408
|
+
context.core?.schema,
|
|
409
|
+
effectiveUi,
|
|
410
|
+
translate,
|
|
411
|
+
context.i18n?.translateError,
|
|
412
|
+
]);
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export const usePropertyNameErrors = (path: string) => {
|
|
416
|
+
const { context, effectiveUi, translate, primary, additional } =
|
|
417
|
+
useErrorSummaryContext();
|
|
418
|
+
return useMemo(() => {
|
|
419
|
+
const result = new Map<string, string>();
|
|
420
|
+
const errors = [...(primary ?? []), ...(additional ?? [])].filter(
|
|
421
|
+
(error) =>
|
|
422
|
+
((error as any).propertyName !== undefined ||
|
|
423
|
+
error.keyword === 'propertyNames') &&
|
|
424
|
+
instanceDataPath(error.instancePath) === path,
|
|
425
|
+
);
|
|
426
|
+
const specificNames = new Set(
|
|
427
|
+
errors
|
|
428
|
+
.filter((error) => error.keyword !== 'propertyNames')
|
|
429
|
+
.map((error) => (error as any).propertyName),
|
|
430
|
+
);
|
|
431
|
+
for (const error of errors) {
|
|
432
|
+
const name = (error as any).propertyName ?? error.params.propertyName;
|
|
433
|
+
if (error.keyword === 'propertyNames' && specificNames.has(name))
|
|
434
|
+
continue;
|
|
435
|
+
const message = formatErrorSummary(
|
|
436
|
+
[error],
|
|
437
|
+
context.core?.schema,
|
|
438
|
+
effectiveUi,
|
|
439
|
+
translate,
|
|
440
|
+
context.i18n?.translateError,
|
|
441
|
+
)[0].message;
|
|
442
|
+
result.set(name, [result.get(name), message].filter(Boolean).join('\n'));
|
|
443
|
+
}
|
|
444
|
+
return result;
|
|
445
|
+
}, [
|
|
446
|
+
primary,
|
|
447
|
+
additional,
|
|
448
|
+
path,
|
|
449
|
+
context.core?.schema,
|
|
450
|
+
effectiveUi,
|
|
451
|
+
translate,
|
|
452
|
+
context.i18n?.translateError,
|
|
453
|
+
]);
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
export const useNameConstraintMessage = () => {
|
|
457
|
+
const context = useJsonForms();
|
|
458
|
+
const translate = useTranslator();
|
|
459
|
+
return (errors?: import('ajv').ErrorObject[]) =>
|
|
460
|
+
errors?.length
|
|
461
|
+
? formatErrorSummary(
|
|
462
|
+
errors,
|
|
463
|
+
undefined,
|
|
464
|
+
undefined,
|
|
465
|
+
translate,
|
|
466
|
+
context.i18n?.translateError,
|
|
467
|
+
)
|
|
468
|
+
.map((entry) => entry.message)
|
|
469
|
+
.join('\n')
|
|
470
|
+
: undefined;
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
export function useErrorFeedback(
|
|
474
|
+
errors: string,
|
|
475
|
+
path: string | undefined,
|
|
476
|
+
local: boolean,
|
|
477
|
+
) {
|
|
478
|
+
const [open, setOpen] = React.useState(false);
|
|
479
|
+
const count = useErrorSummaryCount(
|
|
480
|
+
local ? '' : errors,
|
|
481
|
+
local ? undefined : path,
|
|
482
|
+
);
|
|
483
|
+
const entries = useErrorSummary(errors, path, open && !local);
|
|
484
|
+
const message =
|
|
485
|
+
!local && entries[0]
|
|
486
|
+
? [entries[0].path, entries[0].message].filter(Boolean).join(': ')
|
|
487
|
+
: errors;
|
|
488
|
+
return { open, setOpen, count, entries, message };
|
|
489
|
+
}
|