@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,150 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ControlElement, UPDATE_DATA } from '@jsonforms/core';
|
|
3
|
+
import { JsonFormsContext, JsonFormsDispatch } from '@jsonforms/react';
|
|
4
|
+
import { useTupleField, type TupleFieldBehaviorProps } from './useTupleField';
|
|
5
|
+
import { compositeSummary } from '../cells/compositeSummary';
|
|
6
|
+
import type { CompositeDetailDialogProps } from '../cells/useCompositeDraft';
|
|
7
|
+
|
|
8
|
+
export interface TupleFieldProps extends TupleFieldBehaviorProps {
|
|
9
|
+
options: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface TupleFieldPresentation {
|
|
13
|
+
CompositeDetailDialog: React.ComponentType<CompositeDetailDialogProps>;
|
|
14
|
+
gap: number;
|
|
15
|
+
legendStyle: React.CSSProperties;
|
|
16
|
+
renderEditButton: (
|
|
17
|
+
label: string,
|
|
18
|
+
disabled: boolean,
|
|
19
|
+
open: () => void,
|
|
20
|
+
) => React.ReactNode;
|
|
21
|
+
renderError: (message: string, draft: boolean) => React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function TupleField(props: TupleFieldProps & TupleFieldPresentation) {
|
|
25
|
+
const {
|
|
26
|
+
schema,
|
|
27
|
+
index,
|
|
28
|
+
uischema,
|
|
29
|
+
enabled,
|
|
30
|
+
options,
|
|
31
|
+
CompositeDetailDialog,
|
|
32
|
+
gap,
|
|
33
|
+
legendStyle,
|
|
34
|
+
renderEditButton,
|
|
35
|
+
renderError,
|
|
36
|
+
} = props;
|
|
37
|
+
const {
|
|
38
|
+
t,
|
|
39
|
+
translator,
|
|
40
|
+
i18nDefault,
|
|
41
|
+
open,
|
|
42
|
+
setOpen,
|
|
43
|
+
message,
|
|
44
|
+
path,
|
|
45
|
+
value,
|
|
46
|
+
renderSchema,
|
|
47
|
+
complex,
|
|
48
|
+
ownsLabel,
|
|
49
|
+
label,
|
|
50
|
+
intercept,
|
|
51
|
+
scoped,
|
|
52
|
+
detail,
|
|
53
|
+
} = useTupleField(props);
|
|
54
|
+
const dialogOptions = {
|
|
55
|
+
...options,
|
|
56
|
+
...uischema.options,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const body = () => {
|
|
60
|
+
if (schema === false) {
|
|
61
|
+
return renderError(t('tuple.forbidden'), false);
|
|
62
|
+
}
|
|
63
|
+
if (complex) {
|
|
64
|
+
return (
|
|
65
|
+
<div
|
|
66
|
+
style={{
|
|
67
|
+
display: 'flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
gap,
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<span style={{ flex: 1, minWidth: 0, overflowWrap: 'anywhere' }}>
|
|
73
|
+
{compositeSummary(
|
|
74
|
+
value,
|
|
75
|
+
uischema.options?.summary as ControlElement | undefined,
|
|
76
|
+
renderSchema.title,
|
|
77
|
+
translator,
|
|
78
|
+
i18nDefault,
|
|
79
|
+
)}
|
|
80
|
+
</span>
|
|
81
|
+
{renderEditButton(t('composite.edit', { label }), !enabled, () =>
|
|
82
|
+
setOpen(true),
|
|
83
|
+
)}
|
|
84
|
+
<CompositeDetailDialog
|
|
85
|
+
open={open}
|
|
86
|
+
title={renderSchema.title ?? label}
|
|
87
|
+
label={label}
|
|
88
|
+
path={path}
|
|
89
|
+
schema={renderSchema}
|
|
90
|
+
enabled={enabled}
|
|
91
|
+
options={dialogOptions}
|
|
92
|
+
t={translator}
|
|
93
|
+
onClose={() => setOpen(false)}
|
|
94
|
+
onApply={(applied) =>
|
|
95
|
+
intercept({
|
|
96
|
+
type: UPDATE_DATA,
|
|
97
|
+
path,
|
|
98
|
+
updater: () => applied,
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
>
|
|
102
|
+
<JsonFormsDispatch
|
|
103
|
+
schema={renderSchema}
|
|
104
|
+
uischema={detail}
|
|
105
|
+
path={path}
|
|
106
|
+
enabled={enabled}
|
|
107
|
+
/>
|
|
108
|
+
</CompositeDetailDialog>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
return (
|
|
113
|
+
<JsonFormsDispatch
|
|
114
|
+
schema={renderSchema}
|
|
115
|
+
// The label is drawn by the fieldset legend when this position owns it,
|
|
116
|
+
// so the delegated control must not draw it again.
|
|
117
|
+
uischema={
|
|
118
|
+
ownsLabel
|
|
119
|
+
? ({ ...uischema, label: false } as ControlElement)
|
|
120
|
+
: uischema
|
|
121
|
+
}
|
|
122
|
+
path={path}
|
|
123
|
+
enabled={enabled}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<JsonFormsContext.Provider value={scoped}>
|
|
130
|
+
<fieldset
|
|
131
|
+
data-tuple-field={index}
|
|
132
|
+
style={{ border: 0, padding: 0, margin: 0, minWidth: 0, flex: '1 1 0' }}
|
|
133
|
+
>
|
|
134
|
+
{ownsLabel && (
|
|
135
|
+
<legend
|
|
136
|
+
style={{
|
|
137
|
+
display: 'block',
|
|
138
|
+
width: '100%',
|
|
139
|
+
...legendStyle,
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
{label}
|
|
143
|
+
</legend>
|
|
144
|
+
)}
|
|
145
|
+
{body()}
|
|
146
|
+
{message && renderError(message, true)}
|
|
147
|
+
</fieldset>
|
|
148
|
+
</JsonFormsContext.Provider>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import {
|
|
2
|
+
JsonSchema,
|
|
3
|
+
RankedTester,
|
|
4
|
+
Resolve,
|
|
5
|
+
extractDefaults,
|
|
6
|
+
isControl,
|
|
7
|
+
} from '@jsonforms/core';
|
|
8
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Positional arrays, with no React in it.
|
|
12
|
+
*
|
|
13
|
+
* Which schemas are tuples, what each position renders, and what value a
|
|
14
|
+
* missing position starts life with are all decidable from the schema alone, so
|
|
15
|
+
* they are settled here and tested without rendering anything.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A position's schema. `false` is a real value here - draft-07's
|
|
20
|
+
* `additionalItems: false` and 2020-12's `items: false` both mean "nothing is
|
|
21
|
+
* permitted past the prefix" - so this cannot be narrowed to `JsonSchema`.
|
|
22
|
+
*/
|
|
23
|
+
export type TupleSchema = JsonSchema | boolean;
|
|
24
|
+
|
|
25
|
+
export interface TupleDefinition {
|
|
26
|
+
/** One schema per declared position. */
|
|
27
|
+
prefix: TupleSchema[];
|
|
28
|
+
/** What a trailing value past the prefix must satisfy; `false` forbids one. */
|
|
29
|
+
tail: TupleSchema;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** 2020-12 spells the positional list `prefixItems`; the types predate it. */
|
|
33
|
+
type PositionalSchema = JsonSchema & { prefixItems?: TupleSchema[] };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The declared positions and the tail, or `undefined` when the schema does not
|
|
37
|
+
* describe a tuple at all.
|
|
38
|
+
*
|
|
39
|
+
* **Both dialects are recognized**, which the gap review asks to be declared:
|
|
40
|
+
* draft 2020-12's `prefixItems` + `items`, and draft-07's positional `items` +
|
|
41
|
+
* `additionalItems`. `prefixItems` is checked first, because a 2020-12 schema
|
|
42
|
+
* uses `items` for the *tail* and reading it as the prefix would turn one
|
|
43
|
+
* position into every position.
|
|
44
|
+
*
|
|
45
|
+
* `explicit` is `options.variant === 'tuple'` and unlocks only the third case -
|
|
46
|
+
* a uniform array asked to be presented positionally. A positional schema needs
|
|
47
|
+
* no variant, and per section 18 equal bounds alone must not change how an
|
|
48
|
+
* ordinary uniform array is presented.
|
|
49
|
+
*/
|
|
50
|
+
export const tupleDefinition = (
|
|
51
|
+
schema: JsonSchema | undefined,
|
|
52
|
+
explicit = false,
|
|
53
|
+
): TupleDefinition | undefined => {
|
|
54
|
+
const candidate = schema as PositionalSchema | undefined;
|
|
55
|
+
if (candidate?.type !== 'array') {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
if (Array.isArray(candidate.prefixItems)) {
|
|
59
|
+
return {
|
|
60
|
+
prefix: candidate.prefixItems,
|
|
61
|
+
tail: (candidate.items ?? true) as TupleSchema,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (Array.isArray(candidate.items)) {
|
|
65
|
+
return {
|
|
66
|
+
prefix: candidate.items as TupleSchema[],
|
|
67
|
+
tail: (candidate.additionalItems ?? true) as TupleSchema,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const { minItems, maxItems } = candidate;
|
|
71
|
+
if (
|
|
72
|
+
explicit &&
|
|
73
|
+
Number.isInteger(minItems) &&
|
|
74
|
+
(minItems as number) >= 0 &&
|
|
75
|
+
minItems === maxItems
|
|
76
|
+
) {
|
|
77
|
+
return {
|
|
78
|
+
// The shared item schema, repeated. The count comes from the bounds, so
|
|
79
|
+
// the tail is closed: a uniform tuple has exactly as many positions as it
|
|
80
|
+
// declares.
|
|
81
|
+
prefix: Array.from(
|
|
82
|
+
{ length: minItems as number },
|
|
83
|
+
() => (candidate.items ?? true) as TupleSchema,
|
|
84
|
+
),
|
|
85
|
+
tail: false,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Rank 25, above the mixed control at 20 and every array renderer below it.
|
|
93
|
+
*
|
|
94
|
+
* It deliberately also claims a control that merely *asks* for `variant:
|
|
95
|
+
* "tuple"` without a schema that can support one. Section 18 calls that an
|
|
96
|
+
* "unsupported configuration" and says to "report a configuration diagnostic
|
|
97
|
+
* rather than guessing a positional count" - which is only possible if this
|
|
98
|
+
* renderer wins and explains itself. Falling through would render an ordinary
|
|
99
|
+
* array control and silently ignore the request.
|
|
100
|
+
*/
|
|
101
|
+
export const tupleControlTester: RankedTester = (uischema, schema, context) => {
|
|
102
|
+
if (!isControl(uischema)) {
|
|
103
|
+
return -1;
|
|
104
|
+
}
|
|
105
|
+
const resolved = Resolve.schema(
|
|
106
|
+
schema,
|
|
107
|
+
uischema.scope,
|
|
108
|
+
context?.rootSchema ?? schema,
|
|
109
|
+
);
|
|
110
|
+
const explicit = uischema.options?.variant === 'tuple';
|
|
111
|
+
return explicit || (resolved && tupleDefinition(resolved)) ? 25 : -1;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/** Follows a `$ref` on a positional schema, leaving anything else alone. */
|
|
115
|
+
export const resolveTupleSchema = (
|
|
116
|
+
schema: TupleSchema,
|
|
117
|
+
root: JsonSchema,
|
|
118
|
+
): TupleSchema =>
|
|
119
|
+
typeof schema === 'object' && schema.$ref
|
|
120
|
+
? (Resolve.schema(root, schema.$ref, root) ?? schema)
|
|
121
|
+
: schema;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* What a position holds when an edit further along the array forces it into
|
|
125
|
+
* existence - the shared **Array Add-item initialization** contract.
|
|
126
|
+
*
|
|
127
|
+
* `undefined` means the schema gives no unambiguous answer. That is not a
|
|
128
|
+
* failure to handle: section 18 says to "retain the edit as a local draft and
|
|
129
|
+
* identify the position needing input rather than inventing a type or null
|
|
130
|
+
* value", so the caller reports which position is blocking instead of filling
|
|
131
|
+
* it with a guess.
|
|
132
|
+
*/
|
|
133
|
+
export const tupleInitialValue = (
|
|
134
|
+
schema: TupleSchema,
|
|
135
|
+
root: JsonSchema,
|
|
136
|
+
): unknown => {
|
|
137
|
+
const resolved = resolveTupleSchema(schema, root);
|
|
138
|
+
if (typeof resolved !== 'object') {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
if (resolved.default !== undefined) {
|
|
142
|
+
// Deep-copied, so two positions sharing one schema cannot end up sharing
|
|
143
|
+
// the object the schema author wrote.
|
|
144
|
+
return cloneDeep(resolved.default);
|
|
145
|
+
}
|
|
146
|
+
switch (resolved.type) {
|
|
147
|
+
case 'string':
|
|
148
|
+
return '';
|
|
149
|
+
case 'integer':
|
|
150
|
+
case 'number':
|
|
151
|
+
return 0;
|
|
152
|
+
case 'boolean':
|
|
153
|
+
return false;
|
|
154
|
+
case 'null':
|
|
155
|
+
return null;
|
|
156
|
+
case 'array':
|
|
157
|
+
return [];
|
|
158
|
+
case 'object':
|
|
159
|
+
return extractDefaults(resolved, root);
|
|
160
|
+
default:
|
|
161
|
+
// A union, an unconstrained schema, or a combinator: no single supported
|
|
162
|
+
// type, so no initial value.
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The value a *cleared* position keeps, which is not the same question as
|
|
169
|
+
* {@link tupleInitialValue}.
|
|
170
|
+
*
|
|
171
|
+
* Section 18: "absence and emptiness are distinct" and clearing "must never
|
|
172
|
+
* splice the array, shift later positions, or write undefined into it".
|
|
173
|
+
* Clearing a string leaves `""`; clearing a number has no natural empty value,
|
|
174
|
+
* so this returns `undefined` and the caller keeps the edit as a draft rather
|
|
175
|
+
* than silently writing `0` or `null`.
|
|
176
|
+
*/
|
|
177
|
+
export const tupleEmptyValue = (
|
|
178
|
+
schema: TupleSchema,
|
|
179
|
+
root: JsonSchema,
|
|
180
|
+
): unknown => {
|
|
181
|
+
const resolved = resolveTupleSchema(schema, root);
|
|
182
|
+
if (typeof resolved !== 'object') {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
if (resolved.type === 'string') return '';
|
|
186
|
+
if (resolved.type === 'array') return [];
|
|
187
|
+
if (resolved.type === 'object') return {};
|
|
188
|
+
if (
|
|
189
|
+
resolved.type === 'null' ||
|
|
190
|
+
(Array.isArray(resolved.type) && resolved.type.includes('null'))
|
|
191
|
+
) {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
return undefined;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/** Every JSON type, for a position the schema does not constrain. */
|
|
198
|
+
export const UNCONSTRAINED_TYPES = [
|
|
199
|
+
'string',
|
|
200
|
+
'number',
|
|
201
|
+
'integer',
|
|
202
|
+
'boolean',
|
|
203
|
+
'object',
|
|
204
|
+
'array',
|
|
205
|
+
'null',
|
|
206
|
+
];
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The schema to hand a delegated renderer.
|
|
210
|
+
*
|
|
211
|
+
* An unconstrained tail - `true`, or `{}` - carries no type, and JSON Forms
|
|
212
|
+
* would find no renderer for it. Section 18 says such a tail uses "the mixed
|
|
213
|
+
* renderer with type selection", and the way to ask for that renderer is a
|
|
214
|
+
* schema naming every type.
|
|
215
|
+
*/
|
|
216
|
+
export const tupleRenderSchema = (schema: TupleSchema): JsonSchema => {
|
|
217
|
+
if (
|
|
218
|
+
schema === true ||
|
|
219
|
+
(typeof schema === 'object' && Object.keys(schema).length === 0)
|
|
220
|
+
) {
|
|
221
|
+
return { type: UNCONSTRAINED_TYPES } as JsonSchema;
|
|
222
|
+
}
|
|
223
|
+
return schema as JsonSchema;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/** Whether a position is edited through a summary and a dialog. */
|
|
227
|
+
export const isComplexTupleSchema = (schema: TupleSchema): boolean =>
|
|
228
|
+
typeof schema === 'object' &&
|
|
229
|
+
(schema.type === 'object' || schema.type === 'array');
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Whether a position draws its own label above the delegated editor.
|
|
233
|
+
*
|
|
234
|
+
* A scalar control renders its own `Form.Item` label, so labelling it here too
|
|
235
|
+
* would print the name twice. A complex position shows a summary rather than a
|
|
236
|
+
* control, a forbidden position shows a message, and a mixed position's own
|
|
237
|
+
* label belongs to the type selector - all three need the label supplied.
|
|
238
|
+
*/
|
|
239
|
+
export const tupleFieldOwnsLabel = (schema: TupleSchema): boolean => {
|
|
240
|
+
if (schema === false || isComplexTupleSchema(schema)) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
const rendered = tupleRenderSchema(schema);
|
|
244
|
+
return !rendered.type || Array.isArray(rendered.type);
|
|
245
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { JsonSchema } from '@jsonforms/core';
|
|
2
|
+
import { useState, type ReactNode } from 'react';
|
|
3
|
+
import { useCollectionDelete } from '../collections/useCollectionDelete';
|
|
4
|
+
import { useCollectionPagination } from '../collections/collectionPagination';
|
|
5
|
+
import { useI18n } from '../locale/translate';
|
|
6
|
+
import { tupleInitialValue, type TupleDefinition } from './tupleSchema';
|
|
7
|
+
|
|
8
|
+
export interface TupleAdditionalItemsInput {
|
|
9
|
+
definition: TupleDefinition;
|
|
10
|
+
data: unknown[];
|
|
11
|
+
schema: JsonSchema;
|
|
12
|
+
rootSchema: JsonSchema;
|
|
13
|
+
options: Record<string, any>;
|
|
14
|
+
config?: any;
|
|
15
|
+
path?: string;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
onChange: (next: unknown[]) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface TupleAdditionalItemsProps extends TupleAdditionalItemsInput {
|
|
21
|
+
renderItem: (index: number) => ReactNode;
|
|
22
|
+
positionLabel: (index: number) => string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Shared tuple-tail operations; each renderer owns its presentation. */
|
|
26
|
+
export const useTupleAdditionalItems = ({
|
|
27
|
+
definition,
|
|
28
|
+
data,
|
|
29
|
+
schema,
|
|
30
|
+
rootSchema,
|
|
31
|
+
options,
|
|
32
|
+
config,
|
|
33
|
+
path,
|
|
34
|
+
enabled,
|
|
35
|
+
onChange,
|
|
36
|
+
}: TupleAdditionalItemsInput) => {
|
|
37
|
+
const t = useI18n();
|
|
38
|
+
const [message, setMessage] = useState<string | undefined>();
|
|
39
|
+
|
|
40
|
+
// Restrict prevents an edit at the bounds; otherwise validation reports it.
|
|
41
|
+
const restricted = options.restrict !== false;
|
|
42
|
+
const { maxItems, minItems } = schema;
|
|
43
|
+
|
|
44
|
+
const canAdd =
|
|
45
|
+
enabled &&
|
|
46
|
+
!options.disableAdd &&
|
|
47
|
+
definition.tail !== false &&
|
|
48
|
+
(!restricted ||
|
|
49
|
+
maxItems === undefined ||
|
|
50
|
+
Math.max(data.length, definition.prefix.length) < maxItems);
|
|
51
|
+
|
|
52
|
+
const canDelete =
|
|
53
|
+
enabled &&
|
|
54
|
+
!options.disableRemove &&
|
|
55
|
+
(!restricted || minItems === undefined || data.length > minItems);
|
|
56
|
+
|
|
57
|
+
const add = () => {
|
|
58
|
+
const next = [...data];
|
|
59
|
+
// Fill any missing declared positions before appending the tail.
|
|
60
|
+
for (
|
|
61
|
+
let position = next.length;
|
|
62
|
+
position < definition.prefix.length;
|
|
63
|
+
position += 1
|
|
64
|
+
) {
|
|
65
|
+
const initial = tupleInitialValue(
|
|
66
|
+
definition.prefix[position],
|
|
67
|
+
rootSchema,
|
|
68
|
+
);
|
|
69
|
+
if (initial === undefined) {
|
|
70
|
+
setMessage(t('tuple.missingPosition', { position: position + 1 }));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
next.push(initial);
|
|
74
|
+
}
|
|
75
|
+
const { tail } = definition;
|
|
76
|
+
const unconstrained =
|
|
77
|
+
tail === true ||
|
|
78
|
+
(typeof tail === 'object' && Object.keys(tail).length === 0);
|
|
79
|
+
const initial = tupleInitialValue(tail, rootSchema);
|
|
80
|
+
if (initial === undefined && !unconstrained) {
|
|
81
|
+
setMessage(t('tuple.initialType'));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
// The mixed renderer can choose a type after an unconstrained tail starts.
|
|
85
|
+
next.push(initial === undefined ? '' : initial);
|
|
86
|
+
setMessage(undefined);
|
|
87
|
+
onChange(next);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const deletion = useCollectionDelete<number>({
|
|
91
|
+
data,
|
|
92
|
+
identity: path,
|
|
93
|
+
catalogId: 'additionalItems',
|
|
94
|
+
options,
|
|
95
|
+
config,
|
|
96
|
+
canRemove: (index) =>
|
|
97
|
+
canDelete && index >= definition.prefix.length && index < data.length,
|
|
98
|
+
value: (index) => data[index],
|
|
99
|
+
remove: (index) =>
|
|
100
|
+
onChange(data.filter((_, position) => position !== index)),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const trailing: number[] = [];
|
|
104
|
+
for (
|
|
105
|
+
let index = definition.prefix.length;
|
|
106
|
+
index < Math.max(data.length, definition.prefix.length);
|
|
107
|
+
index += 1
|
|
108
|
+
) {
|
|
109
|
+
trailing.push(index);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const page = useCollectionPagination(
|
|
113
|
+
trailing,
|
|
114
|
+
options.additionalItems?.pagination,
|
|
115
|
+
config,
|
|
116
|
+
'additionalItems',
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const visibleIndices = page.indices.map((offset) => trailing[offset]);
|
|
120
|
+
return {
|
|
121
|
+
visibleIndices,
|
|
122
|
+
t,
|
|
123
|
+
message,
|
|
124
|
+
canAdd,
|
|
125
|
+
canDelete,
|
|
126
|
+
add,
|
|
127
|
+
deletion,
|
|
128
|
+
trailing,
|
|
129
|
+
page,
|
|
130
|
+
};
|
|
131
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDynamicTreeResolver } from '../dynamic/DynamicUiProvider';
|
|
3
|
+
import { useI18n } from '../locale/translate';
|
|
4
|
+
import {
|
|
5
|
+
isComplexTupleSchema,
|
|
6
|
+
resolveTupleSchema,
|
|
7
|
+
tupleDefinition,
|
|
8
|
+
tupleRenderSchema,
|
|
9
|
+
type TupleSchema,
|
|
10
|
+
} from './tupleSchema';
|
|
11
|
+
import {
|
|
12
|
+
type ControlElement,
|
|
13
|
+
type JsonFormsRendererRegistryEntry,
|
|
14
|
+
type UISchemaElement,
|
|
15
|
+
type StatePropsOfControlWithDetail,
|
|
16
|
+
findUISchema,
|
|
17
|
+
getControlPath,
|
|
18
|
+
} from '@jsonforms/core';
|
|
19
|
+
import { useJsonForms } from '@jsonforms/react';
|
|
20
|
+
|
|
21
|
+
const POSITION_SCOPE = /\/(?:items|prefixItems)\/(\d+)(\/.*)?$/;
|
|
22
|
+
|
|
23
|
+
interface TuplePositionContextValue {
|
|
24
|
+
count: number;
|
|
25
|
+
render: (index: number) => React.ReactElement | null;
|
|
26
|
+
renderWithin: (index: number, scope: string) => React.ReactElement | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A module-level renderer keeps focused position controls mounted on re-render. */
|
|
30
|
+
export const TuplePositionContext = React.createContext<
|
|
31
|
+
TuplePositionContextValue | undefined
|
|
32
|
+
>(undefined);
|
|
33
|
+
|
|
34
|
+
const TuplePositionRenderer = ({ uischema }: { uischema: UISchemaElement }) => {
|
|
35
|
+
const ctx = React.useContext(TuplePositionContext);
|
|
36
|
+
const scope = (uischema as ControlElement)?.scope;
|
|
37
|
+
const match = typeof scope === 'string' ? POSITION_SCOPE.exec(scope) : null;
|
|
38
|
+
if (!ctx || !match) return null;
|
|
39
|
+
const index = Number(match[1]);
|
|
40
|
+
if (index < 0 || index >= ctx.count) return null;
|
|
41
|
+
return match[2] ? ctx.renderWithin(index, `#${match[2]}`) : ctx.render(index);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const tuplePositionEntry: JsonFormsRendererRegistryEntry = {
|
|
45
|
+
tester: (uischema) => {
|
|
46
|
+
const scope = (uischema as ControlElement)?.scope;
|
|
47
|
+
return uischema?.type === 'Control' &&
|
|
48
|
+
typeof scope === 'string' &&
|
|
49
|
+
POSITION_SCOPE.test(scope)
|
|
50
|
+
? 9999
|
|
51
|
+
: -1;
|
|
52
|
+
},
|
|
53
|
+
renderer: TuplePositionRenderer as any,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const namedPositions = (element: unknown, found = new Set<number>()) => {
|
|
57
|
+
if (!element || typeof element !== 'object') return found;
|
|
58
|
+
const node = element as UISchemaElement & {
|
|
59
|
+
scope?: string;
|
|
60
|
+
elements?: unknown[];
|
|
61
|
+
};
|
|
62
|
+
const match =
|
|
63
|
+
typeof node.scope === 'string' ? POSITION_SCOPE.exec(node.scope) : null;
|
|
64
|
+
if (match) found.add(Number(match[1]));
|
|
65
|
+
if (Array.isArray(node.elements))
|
|
66
|
+
for (const child of node.elements) namedPositions(child, found);
|
|
67
|
+
return found;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const positionLayoutOf = (
|
|
71
|
+
options: Record<string, any>,
|
|
72
|
+
): UISchemaElement | undefined => {
|
|
73
|
+
const layout = options.detail;
|
|
74
|
+
return layout &&
|
|
75
|
+
typeof layout === 'object' &&
|
|
76
|
+
typeof (layout as UISchemaElement).type === 'string'
|
|
77
|
+
? (layout as UISchemaElement)
|
|
78
|
+
: undefined;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** Resolve positional schemas and registry entries without any UI toolkit dependency. */
|
|
82
|
+
export const useTupleControl = (props: StatePropsOfControlWithDetail) => {
|
|
83
|
+
const {
|
|
84
|
+
data,
|
|
85
|
+
enabled,
|
|
86
|
+
errors,
|
|
87
|
+
path,
|
|
88
|
+
rootSchema,
|
|
89
|
+
schema,
|
|
90
|
+
uischema,
|
|
91
|
+
uischemas,
|
|
92
|
+
} = props;
|
|
93
|
+
const resolveTree = useDynamicTreeResolver(path);
|
|
94
|
+
const t = useI18n();
|
|
95
|
+
const jsonforms = useJsonForms();
|
|
96
|
+
const options = { ...props.config, ...uischema.options } as Record<
|
|
97
|
+
string,
|
|
98
|
+
any
|
|
99
|
+
>;
|
|
100
|
+
const vertical =
|
|
101
|
+
(uischema.options?.vertical ??
|
|
102
|
+
props.config?.jsonformsExtended?.tuple?.vertical ??
|
|
103
|
+
false) === true;
|
|
104
|
+
const definition = tupleDefinition(schema, options.variant === 'tuple');
|
|
105
|
+
const values: unknown[] = Array.isArray(data) ? data : [];
|
|
106
|
+
const editable = enabled !== false;
|
|
107
|
+
const positionLabel = (index: number) =>
|
|
108
|
+
t('tuple.position', { position: index + 1 });
|
|
109
|
+
const fieldSchema = (index: number): TupleSchema => {
|
|
110
|
+
if (!definition) return true;
|
|
111
|
+
const declared = definition.prefix[index];
|
|
112
|
+
const fallback = definition.tail === false ? true : definition.tail;
|
|
113
|
+
return resolveTupleSchema(declared ?? fallback, rootSchema);
|
|
114
|
+
};
|
|
115
|
+
const positionName = (index: number) =>
|
|
116
|
+
tupleRenderSchema(fieldSchema(index)).title ?? positionLabel(index);
|
|
117
|
+
const fieldUiSchema = (index: number): UISchemaElement => {
|
|
118
|
+
const positionSchema = tupleRenderSchema(fieldSchema(index));
|
|
119
|
+
const name = positionName(index);
|
|
120
|
+
if (!isComplexTupleSchema(fieldSchema(index)))
|
|
121
|
+
return { type: 'Control', scope: '#', label: name } as ControlElement;
|
|
122
|
+
const found = findUISchema(
|
|
123
|
+
// A host registry can contain serialized entries without callable testers.
|
|
124
|
+
(uischemas ?? []).filter((entry) => typeof entry?.tester === 'function'),
|
|
125
|
+
positionSchema,
|
|
126
|
+
'#',
|
|
127
|
+
`${path}.${index}`,
|
|
128
|
+
() => ({ type: 'Control', scope: '#', label: name }) as ControlElement,
|
|
129
|
+
{ type: 'Control', scope: '#' } as ControlElement,
|
|
130
|
+
rootSchema,
|
|
131
|
+
);
|
|
132
|
+
return {
|
|
133
|
+
...found,
|
|
134
|
+
label: (found as { label?: unknown }).label ?? name,
|
|
135
|
+
} as UISchemaElement;
|
|
136
|
+
};
|
|
137
|
+
const authoredPositionLayout = positionLayoutOf(options);
|
|
138
|
+
const positionLayout = authoredPositionLayout
|
|
139
|
+
? resolveTree(authoredPositionLayout)
|
|
140
|
+
: undefined;
|
|
141
|
+
const hiddenPositionErrors = (): string[] => {
|
|
142
|
+
if (!positionLayout || !definition) return [];
|
|
143
|
+
const named = namedPositions(positionLayout);
|
|
144
|
+
const messages: string[] = [];
|
|
145
|
+
definition.prefix.forEach((_, index) => {
|
|
146
|
+
if (named.has(index)) return;
|
|
147
|
+
const target = `${path}.${index}`;
|
|
148
|
+
const own = (jsonforms.core?.errors ?? []).filter((error) => {
|
|
149
|
+
const at = getControlPath(error);
|
|
150
|
+
return at === target || at.startsWith(`${target}.`);
|
|
151
|
+
});
|
|
152
|
+
for (const error of own)
|
|
153
|
+
messages.push(`${positionName(index)}: ${error.message}`);
|
|
154
|
+
});
|
|
155
|
+
return messages;
|
|
156
|
+
};
|
|
157
|
+
const shownErrors = [errors, ...hiddenPositionErrors()]
|
|
158
|
+
.filter(Boolean)
|
|
159
|
+
.join('\n');
|
|
160
|
+
return {
|
|
161
|
+
t,
|
|
162
|
+
options,
|
|
163
|
+
vertical,
|
|
164
|
+
definition,
|
|
165
|
+
values,
|
|
166
|
+
editable,
|
|
167
|
+
positionLabel,
|
|
168
|
+
fieldSchema,
|
|
169
|
+
fieldUiSchema,
|
|
170
|
+
positionLayout,
|
|
171
|
+
shownErrors,
|
|
172
|
+
};
|
|
173
|
+
};
|