@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,389 @@
|
|
|
1
|
+
import { useDynamicTreeResolver } from '../dynamic/DynamicUiProvider';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
defaultTranslator,
|
|
5
|
+
JsonSchema,
|
|
6
|
+
Generate,
|
|
7
|
+
OwnPropsOfControl,
|
|
8
|
+
getI18nKey,
|
|
9
|
+
ControlProps,
|
|
10
|
+
CombinatorRendererProps,
|
|
11
|
+
UISchemaElement,
|
|
12
|
+
and,
|
|
13
|
+
rankWith,
|
|
14
|
+
optionIs,
|
|
15
|
+
isEnumControl,
|
|
16
|
+
isOneOfControl,
|
|
17
|
+
or,
|
|
18
|
+
Resolve,
|
|
19
|
+
createDefaultValue,
|
|
20
|
+
} from '@jsonforms/core';
|
|
21
|
+
import {
|
|
22
|
+
JsonFormsDispatch,
|
|
23
|
+
ctxToControlProps,
|
|
24
|
+
useJsonForms,
|
|
25
|
+
withJsonFormsControlProps,
|
|
26
|
+
withJsonFormsOneOfProps,
|
|
27
|
+
} from '@jsonforms/react';
|
|
28
|
+
import isEqual from 'lodash/isEqual';
|
|
29
|
+
import { resolveConfirmationPolicy } from '../interaction/confirmation';
|
|
30
|
+
import { branchChangeData, discardedByBranchChange } from './combinators';
|
|
31
|
+
import { findDetailUISchema } from '../core/detailUiSchema';
|
|
32
|
+
|
|
33
|
+
export interface CardChoice {
|
|
34
|
+
value?: unknown;
|
|
35
|
+
branch?: number;
|
|
36
|
+
label?: string;
|
|
37
|
+
i18n?: string;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
content?: UISchemaElement;
|
|
40
|
+
selectedContent?: UISchemaElement;
|
|
41
|
+
detail?: string | UISchemaElement | { elements: UISchemaElement[] };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const choiceCardsTester = rankWith(
|
|
45
|
+
21,
|
|
46
|
+
and(optionIs('format', 'cards'), or(isEnumControl, isOneOfControl)),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Keep interactive controls and arbitrary templates out of a radio's label.
|
|
50
|
+
export const isCardPresentation = (element: any): boolean =>
|
|
51
|
+
!!element &&
|
|
52
|
+
(['Label', 'ImageView'].includes(element.type) ||
|
|
53
|
+
(['VerticalLayout', 'HorizontalLayout'].includes(element.type) &&
|
|
54
|
+
Array.isArray(element.elements) &&
|
|
55
|
+
element.elements.every(isCardPresentation)));
|
|
56
|
+
|
|
57
|
+
type Confirmation = () => {
|
|
58
|
+
request: (request: {
|
|
59
|
+
operation: 'branchChange';
|
|
60
|
+
catalogId: 'oneOf';
|
|
61
|
+
discarded: unknown[];
|
|
62
|
+
options?: Record<string, unknown>;
|
|
63
|
+
config?: unknown;
|
|
64
|
+
perform: () => void;
|
|
65
|
+
}) => void;
|
|
66
|
+
dialog: React.ReactNode;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export interface ChoiceCardColors {
|
|
70
|
+
border: string;
|
|
71
|
+
selected: string;
|
|
72
|
+
focus: string;
|
|
73
|
+
background: string;
|
|
74
|
+
error: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const createChoiceCards = (
|
|
78
|
+
useConfirmation: Confirmation,
|
|
79
|
+
useColors: () => ChoiceCardColors,
|
|
80
|
+
) => {
|
|
81
|
+
const Cards = (props: ControlProps & Partial<CombinatorRendererProps>) => {
|
|
82
|
+
const {
|
|
83
|
+
schema,
|
|
84
|
+
uischema,
|
|
85
|
+
data,
|
|
86
|
+
path,
|
|
87
|
+
enabled,
|
|
88
|
+
visible,
|
|
89
|
+
handleChange,
|
|
90
|
+
renderers,
|
|
91
|
+
cells,
|
|
92
|
+
label,
|
|
93
|
+
errors,
|
|
94
|
+
} = props;
|
|
95
|
+
const ctx = useJsonForms();
|
|
96
|
+
const translate = ctx.i18n?.translate ?? defaultTranslator;
|
|
97
|
+
const confirmation = useConfirmation();
|
|
98
|
+
const colors = useColors();
|
|
99
|
+
const groupId = React.useId();
|
|
100
|
+
const pointerFocus = React.useRef(false);
|
|
101
|
+
const [focusedCard, setFocusedCard] = React.useState<number>();
|
|
102
|
+
const showRadio = uischema.options?.showRadio === true;
|
|
103
|
+
const branches = schema.oneOf as JsonSchema[] | undefined;
|
|
104
|
+
const constants = branches?.every((branch) =>
|
|
105
|
+
Object.prototype.hasOwnProperty.call(branch, 'const'),
|
|
106
|
+
);
|
|
107
|
+
const branchMode = !schema.enum && !!branches && !constants;
|
|
108
|
+
const values =
|
|
109
|
+
schema.enum ?? (constants ? branches!.map((branch) => branch.const) : []);
|
|
110
|
+
const [chosen, setChosen] = React.useState<number | undefined>();
|
|
111
|
+
const selected = branchMode
|
|
112
|
+
? (chosen ?? props.indexOfFittingSchema ?? -1)
|
|
113
|
+
: values.findIndex((value) => isEqual(value, data));
|
|
114
|
+
const custom: CardChoice[] = uischema.options?.choices ?? [];
|
|
115
|
+
const infos = branchMode
|
|
116
|
+
? branches!.map((branch, index) => {
|
|
117
|
+
const resolved = branch.$ref
|
|
118
|
+
? Resolve.schema(props.rootSchema!, branch.$ref, props.rootSchema!)
|
|
119
|
+
: undefined;
|
|
120
|
+
const branchSchema = resolved || branch;
|
|
121
|
+
const detail = custom.find(
|
|
122
|
+
(choice) => choice.branch === index,
|
|
123
|
+
)?.detail;
|
|
124
|
+
return {
|
|
125
|
+
schema: branchSchema,
|
|
126
|
+
label: branch.title ?? resolved?.title ?? `oneOf-${index}`,
|
|
127
|
+
uischema: findDetailUISchema(
|
|
128
|
+
props.uischemas!,
|
|
129
|
+
branchSchema,
|
|
130
|
+
uischema.scope,
|
|
131
|
+
path,
|
|
132
|
+
undefined,
|
|
133
|
+
detail === undefined
|
|
134
|
+
? uischema
|
|
135
|
+
: {
|
|
136
|
+
...uischema,
|
|
137
|
+
options: { ...uischema.options, detail },
|
|
138
|
+
},
|
|
139
|
+
props.rootSchema,
|
|
140
|
+
),
|
|
141
|
+
};
|
|
142
|
+
})
|
|
143
|
+
: [];
|
|
144
|
+
const resolveTree = useDynamicTreeResolver(path);
|
|
145
|
+
const choices = (branchMode ? branches! : values).map((_, index) => {
|
|
146
|
+
const choice =
|
|
147
|
+
custom.find((item) =>
|
|
148
|
+
branchMode
|
|
149
|
+
? item.branch === index
|
|
150
|
+
: Object.prototype.hasOwnProperty.call(item, 'value') &&
|
|
151
|
+
isEqual(item.value, values[index]),
|
|
152
|
+
) ?? {};
|
|
153
|
+
const fallback =
|
|
154
|
+
choice.label ??
|
|
155
|
+
branches?.[index]?.title ??
|
|
156
|
+
(branchMode ? infos[index].label : String(values[index]));
|
|
157
|
+
return {
|
|
158
|
+
...choice,
|
|
159
|
+
content: choice.content ? resolveTree(choice.content) : undefined,
|
|
160
|
+
selectedContent: choice.selectedContent
|
|
161
|
+
? resolveTree(choice.selectedContent)
|
|
162
|
+
: undefined,
|
|
163
|
+
label: choice.i18n
|
|
164
|
+
? (translate(`${choice.i18n}.label`, fallback) ?? fallback)
|
|
165
|
+
: (translate(
|
|
166
|
+
getI18nKey(schema, uischema, path, `choices.${index}.label`),
|
|
167
|
+
fallback,
|
|
168
|
+
) ?? fallback),
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
const select = (index: number) => {
|
|
172
|
+
if (!enabled || choices[index].disabled || index === selected) return;
|
|
173
|
+
if (!branchMode) {
|
|
174
|
+
handleChange(path, values[index]);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
confirmation.request({
|
|
178
|
+
operation: 'branchChange',
|
|
179
|
+
catalogId: 'oneOf',
|
|
180
|
+
discarded: [
|
|
181
|
+
discardedByBranchChange(
|
|
182
|
+
data,
|
|
183
|
+
schema,
|
|
184
|
+
resolveConfirmationPolicy({
|
|
185
|
+
options: uischema.options,
|
|
186
|
+
config: props.config,
|
|
187
|
+
catalogId: 'oneOf',
|
|
188
|
+
operation: 'branchChange',
|
|
189
|
+
}) === 'complex',
|
|
190
|
+
),
|
|
191
|
+
],
|
|
192
|
+
options: uischema.options,
|
|
193
|
+
config: props.config,
|
|
194
|
+
perform: () => {
|
|
195
|
+
setChosen(index);
|
|
196
|
+
handleChange(
|
|
197
|
+
path,
|
|
198
|
+
branchChangeData(
|
|
199
|
+
data,
|
|
200
|
+
createDefaultValue(infos[index].schema, props.rootSchema!),
|
|
201
|
+
schema,
|
|
202
|
+
),
|
|
203
|
+
);
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
const enclosingSchema = { ...schema };
|
|
208
|
+
delete enclosingSchema.oneOf;
|
|
209
|
+
if (!visible) return null;
|
|
210
|
+
return (
|
|
211
|
+
<div className='jsonforms-choice-cards'>
|
|
212
|
+
{branchMode && Object.keys(schema.properties ?? {}).length > 0 && (
|
|
213
|
+
<JsonFormsDispatch
|
|
214
|
+
schema={enclosingSchema}
|
|
215
|
+
uischema={Generate.uiSchema(
|
|
216
|
+
enclosingSchema,
|
|
217
|
+
'VerticalLayout',
|
|
218
|
+
undefined,
|
|
219
|
+
props.rootSchema,
|
|
220
|
+
)}
|
|
221
|
+
path={path}
|
|
222
|
+
renderers={renderers}
|
|
223
|
+
cells={cells}
|
|
224
|
+
enabled={enabled}
|
|
225
|
+
/>
|
|
226
|
+
)}
|
|
227
|
+
<fieldset
|
|
228
|
+
role='radiogroup'
|
|
229
|
+
aria-required={props.required || undefined}
|
|
230
|
+
disabled={!enabled}
|
|
231
|
+
style={{ border: 0, padding: 0, margin: 0 }}
|
|
232
|
+
aria-invalid={!!errors}
|
|
233
|
+
aria-describedby={errors ? `${groupId}-errors` : undefined}
|
|
234
|
+
>
|
|
235
|
+
{label && (
|
|
236
|
+
<legend>
|
|
237
|
+
{label}
|
|
238
|
+
{props.required && <span aria-hidden='true'> *</span>}
|
|
239
|
+
</legend>
|
|
240
|
+
)}
|
|
241
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 12 }}>
|
|
242
|
+
{choices.map((choice, index) => {
|
|
243
|
+
const active = selected === index;
|
|
244
|
+
const content = active
|
|
245
|
+
? (choice.selectedContent ?? choice.content)
|
|
246
|
+
: (choice.content ?? choice.selectedContent);
|
|
247
|
+
return (
|
|
248
|
+
<div
|
|
249
|
+
key={index}
|
|
250
|
+
onClick={(event) => {
|
|
251
|
+
const radio = event.currentTarget.querySelector('input');
|
|
252
|
+
if (radio && event.target !== radio && !radio.disabled) {
|
|
253
|
+
radio.focus();
|
|
254
|
+
radio.click();
|
|
255
|
+
}
|
|
256
|
+
}}
|
|
257
|
+
onPointerDown={() => {
|
|
258
|
+
pointerFocus.current = true;
|
|
259
|
+
setFocusedCard(undefined);
|
|
260
|
+
}}
|
|
261
|
+
onKeyDown={() => {
|
|
262
|
+
pointerFocus.current = false;
|
|
263
|
+
setFocusedCard(index);
|
|
264
|
+
}}
|
|
265
|
+
className='jsonforms-choice-card'
|
|
266
|
+
data-selected={active}
|
|
267
|
+
style={{
|
|
268
|
+
position: 'relative',
|
|
269
|
+
outline:
|
|
270
|
+
focusedCard === index
|
|
271
|
+
? `2px solid ${colors.focus}`
|
|
272
|
+
: undefined,
|
|
273
|
+
outlineOffset: 3,
|
|
274
|
+
display: 'flex',
|
|
275
|
+
alignItems: 'flex-start',
|
|
276
|
+
gap: 8,
|
|
277
|
+
padding: 16,
|
|
278
|
+
background: colors.background,
|
|
279
|
+
boxShadow: active
|
|
280
|
+
? `inset 0 0 0 1px ${colors.selected}`
|
|
281
|
+
: undefined,
|
|
282
|
+
border: `2px solid ${
|
|
283
|
+
errors
|
|
284
|
+
? colors.error
|
|
285
|
+
: active
|
|
286
|
+
? colors.selected
|
|
287
|
+
: colors.border
|
|
288
|
+
}`,
|
|
289
|
+
borderRadius: 8,
|
|
290
|
+
cursor: enabled && !choice.disabled ? 'pointer' : 'default',
|
|
291
|
+
opacity: !enabled || choice.disabled ? 0.5 : 1,
|
|
292
|
+
}}
|
|
293
|
+
>
|
|
294
|
+
<input
|
|
295
|
+
type='radio'
|
|
296
|
+
onFocus={(event) => {
|
|
297
|
+
if (
|
|
298
|
+
!pointerFocus.current &&
|
|
299
|
+
event.currentTarget.matches(':focus-visible')
|
|
300
|
+
)
|
|
301
|
+
setFocusedCard(index);
|
|
302
|
+
pointerFocus.current = false;
|
|
303
|
+
}}
|
|
304
|
+
onBlur={() => setFocusedCard(undefined)}
|
|
305
|
+
style={
|
|
306
|
+
showRadio
|
|
307
|
+
? undefined
|
|
308
|
+
: {
|
|
309
|
+
position: 'absolute',
|
|
310
|
+
width: 1,
|
|
311
|
+
height: 1,
|
|
312
|
+
padding: 0,
|
|
313
|
+
margin: -1,
|
|
314
|
+
overflow: 'hidden',
|
|
315
|
+
clipPath: 'inset(50%)',
|
|
316
|
+
whiteSpace: 'nowrap',
|
|
317
|
+
border: 0,
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
name={groupId}
|
|
321
|
+
aria-label={choice.label}
|
|
322
|
+
checked={active}
|
|
323
|
+
disabled={!enabled || choice.disabled}
|
|
324
|
+
onChange={() => select(index)}
|
|
325
|
+
/>
|
|
326
|
+
<div
|
|
327
|
+
ref={(node) => node?.setAttribute('inert', '')}
|
|
328
|
+
style={{ pointerEvents: 'none', minWidth: 0 }}
|
|
329
|
+
aria-hidden='true'
|
|
330
|
+
>
|
|
331
|
+
{content && isCardPresentation(content) ? (
|
|
332
|
+
<JsonFormsDispatch
|
|
333
|
+
schema={schema}
|
|
334
|
+
uischema={content}
|
|
335
|
+
path={path}
|
|
336
|
+
renderers={renderers}
|
|
337
|
+
cells={cells}
|
|
338
|
+
/>
|
|
339
|
+
) : null}
|
|
340
|
+
<div>{choice.label}</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
);
|
|
344
|
+
})}
|
|
345
|
+
</div>
|
|
346
|
+
</fieldset>
|
|
347
|
+
{props.description && <div>{props.description}</div>}
|
|
348
|
+
{errors && (
|
|
349
|
+
<div
|
|
350
|
+
id={`${groupId}-errors`}
|
|
351
|
+
role='alert'
|
|
352
|
+
style={{ color: colors.error }}
|
|
353
|
+
>
|
|
354
|
+
{errors}
|
|
355
|
+
</div>
|
|
356
|
+
)}
|
|
357
|
+
{branchMode && infos[selected] && (
|
|
358
|
+
<div style={{ marginTop: 16 }}>
|
|
359
|
+
<JsonFormsDispatch
|
|
360
|
+
schema={infos[selected].schema}
|
|
361
|
+
uischema={infos[selected].uischema}
|
|
362
|
+
path={path}
|
|
363
|
+
renderers={renderers}
|
|
364
|
+
cells={cells}
|
|
365
|
+
enabled={enabled}
|
|
366
|
+
/>
|
|
367
|
+
</div>
|
|
368
|
+
)}
|
|
369
|
+
{confirmation.dialog}
|
|
370
|
+
</div>
|
|
371
|
+
);
|
|
372
|
+
};
|
|
373
|
+
const BranchCards = withJsonFormsOneOfProps(Cards);
|
|
374
|
+
const ValueCards = withJsonFormsControlProps(Cards);
|
|
375
|
+
const ChoiceCards = (props: OwnPropsOfControl) => {
|
|
376
|
+
const ctx = useJsonForms();
|
|
377
|
+
const resolved = ctxToControlProps(ctx, props).schema;
|
|
378
|
+
return !resolved.enum &&
|
|
379
|
+
resolved.oneOf &&
|
|
380
|
+
!(resolved.oneOf as JsonSchema[]).every((branch) =>
|
|
381
|
+
Object.prototype.hasOwnProperty.call(branch, 'const'),
|
|
382
|
+
) ? (
|
|
383
|
+
<BranchCards {...props} />
|
|
384
|
+
) : (
|
|
385
|
+
<ValueCards {...props} />
|
|
386
|
+
);
|
|
387
|
+
};
|
|
388
|
+
return ChoiceCards;
|
|
389
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import isEqual from 'lodash/isEqual';
|
|
2
|
+
import type { JsonSchema } from '@jsonforms/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What a `oneOf` branch change keeps, and what it throws away.
|
|
6
|
+
*
|
|
7
|
+
* Section 18: "initialize from the selected branch's generated defaults and
|
|
8
|
+
* preserve existing values of properties declared in the **enclosing
|
|
9
|
+
* schema's own properties**. Those preserved values take precedence over
|
|
10
|
+
* generated defaults."
|
|
11
|
+
*
|
|
12
|
+
* The emphasis is the whole rule. A property is preserved because the
|
|
13
|
+
* enclosing schema declares it - not because the branch being left and the
|
|
14
|
+
* branch being entered happen to use the same name. The specification is
|
|
15
|
+
* explicit about that second case: "do not infer preservation merely because
|
|
16
|
+
* two branches contain the same property name."
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** The names the enclosing schema declares itself, outside any branch. */
|
|
20
|
+
export const enclosingPropertyNames = (
|
|
21
|
+
schema: JsonSchema | undefined,
|
|
22
|
+
): string[] =>
|
|
23
|
+
Object.keys((schema as { properties?: object })?.properties ?? {});
|
|
24
|
+
|
|
25
|
+
const isPlainObject = (value: unknown): value is Record<string, unknown> =>
|
|
26
|
+
typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
27
|
+
|
|
28
|
+
/** A missing value, or an empty object without an applicable branch, clears selection. */
|
|
29
|
+
export const isUnselectedBranchValue = (
|
|
30
|
+
data: unknown,
|
|
31
|
+
fittingIndex: number | null | undefined,
|
|
32
|
+
): boolean =>
|
|
33
|
+
data === undefined ||
|
|
34
|
+
(isPlainObject(data) &&
|
|
35
|
+
Object.keys(data).length === 0 &&
|
|
36
|
+
(fittingIndex == null || fittingIndex < 0));
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The part of the current value a branch change would discard.
|
|
40
|
+
*
|
|
41
|
+
* This is what the confirmation policy has to weigh, not the whole value:
|
|
42
|
+
* section 14 says to "evaluate the data actually discarded, excluding
|
|
43
|
+
* enclosing properties preserved during a branch change". Without that, a
|
|
44
|
+
* `complex` policy prompts about `{name: "Alex"}` even though `name` survives
|
|
45
|
+
* the switch untouched and nothing is lost.
|
|
46
|
+
*/
|
|
47
|
+
export const discardedByBranchChange = (
|
|
48
|
+
data: unknown,
|
|
49
|
+
schema: JsonSchema | undefined,
|
|
50
|
+
excludeDiscriminator = false,
|
|
51
|
+
): unknown => {
|
|
52
|
+
if (!isPlainObject(data)) {
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
const preserved = new Set(enclosingPropertyNames(schema));
|
|
56
|
+
const discarded: Record<string, unknown> = {};
|
|
57
|
+
for (const [key, value] of Object.entries(data)) {
|
|
58
|
+
const branches = schema?.oneOf as JsonSchema[] | undefined;
|
|
59
|
+
// Only distinct, fixed primitive values identify a branch. An arbitrary
|
|
60
|
+
// default or an invalid imported value is still user data.
|
|
61
|
+
const fixed = branches?.map((branch) => branch.properties?.[key]);
|
|
62
|
+
const discriminator =
|
|
63
|
+
excludeDiscriminator &&
|
|
64
|
+
fixed &&
|
|
65
|
+
fixed.length > 1 &&
|
|
66
|
+
fixed.every(
|
|
67
|
+
(property) =>
|
|
68
|
+
property &&
|
|
69
|
+
Object.prototype.hasOwnProperty.call(property, 'const') &&
|
|
70
|
+
(property.const === null || typeof property.const !== 'object'),
|
|
71
|
+
) &&
|
|
72
|
+
new Set(fixed.map((property) => JSON.stringify(property!.const))).size ===
|
|
73
|
+
fixed.length &&
|
|
74
|
+
fixed.some((property) => isEqual(property!.const, value));
|
|
75
|
+
if (!preserved.has(key) && !discriminator) {
|
|
76
|
+
discarded[key] = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return discarded;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The value to commit when a branch change is performed.
|
|
84
|
+
*
|
|
85
|
+
* `defaults` is the branch's generated initial value. Preservation only
|
|
86
|
+
* applies where it means something - both sides have to be objects for there
|
|
87
|
+
* to be named properties to carry across - so a combinator of scalars simply
|
|
88
|
+
* takes the generated default.
|
|
89
|
+
*/
|
|
90
|
+
export const branchChangeData = (
|
|
91
|
+
data: unknown,
|
|
92
|
+
defaults: unknown,
|
|
93
|
+
schema: JsonSchema | undefined,
|
|
94
|
+
): unknown => {
|
|
95
|
+
const names = enclosingPropertyNames(schema);
|
|
96
|
+
if (names.length === 0 || !isPlainObject(data)) {
|
|
97
|
+
return defaults;
|
|
98
|
+
}
|
|
99
|
+
const preserved: Record<string, unknown> = {};
|
|
100
|
+
for (const name of names) {
|
|
101
|
+
// Only values that actually exist are preserved; an absent enclosing
|
|
102
|
+
// property must not be materialised as `undefined` by the switch.
|
|
103
|
+
if (Object.prototype.hasOwnProperty.call(data, name)) {
|
|
104
|
+
preserved[name] = data[name];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (Object.keys(preserved).length === 0) {
|
|
108
|
+
return defaults;
|
|
109
|
+
}
|
|
110
|
+
if (!isPlainObject(defaults)) {
|
|
111
|
+
/*
|
|
112
|
+
Clearing the selection, or a branch whose default is not an object. The
|
|
113
|
+
enclosing properties are not part of any branch, so they survive - losing
|
|
114
|
+
them here would be the same data loss the rule exists to prevent.
|
|
115
|
+
*/
|
|
116
|
+
return defaults === undefined ? preserved : defaults;
|
|
117
|
+
}
|
|
118
|
+
// Preserved values take precedence over the generated defaults.
|
|
119
|
+
return { ...defaults, ...preserved };
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** An object-only array slot remains an editable object when its choice is cleared. */
|
|
123
|
+
export const clearedBranchValue = (
|
|
124
|
+
arrayItem: boolean,
|
|
125
|
+
branches: JsonSchema[],
|
|
126
|
+
): Record<string, unknown> | undefined =>
|
|
127
|
+
arrayItem &&
|
|
128
|
+
branches.length > 0 &&
|
|
129
|
+
branches.every((branch) => branch.type === 'object')
|
|
130
|
+
? {}
|
|
131
|
+
: undefined;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { dataPathToPointer } from '../core/dataPointer';
|
|
2
|
+
import { JsonSchema, resolveSchema } from '@jsonforms/core';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
4
|
+
|
|
5
|
+
/** Infer only an unambiguous, explicit discriminator. Do not expand children or
|
|
6
|
+
* treat this editing hint as schema validation. */
|
|
7
|
+
export const discriminatorBranch = (
|
|
8
|
+
schema: JsonSchema,
|
|
9
|
+
rootSchema: JsonSchema,
|
|
10
|
+
keyword: 'oneOf' | 'anyOf',
|
|
11
|
+
data: unknown,
|
|
12
|
+
): number | undefined => {
|
|
13
|
+
if (!data || typeof data !== 'object' || Array.isArray(data))
|
|
14
|
+
return undefined;
|
|
15
|
+
const branches = schema[keyword];
|
|
16
|
+
if (!branches?.length) return undefined;
|
|
17
|
+
try {
|
|
18
|
+
const resolved = branches.map((branch) =>
|
|
19
|
+
branch.$ref ? resolveSchema(rootSchema, branch.$ref, rootSchema) : branch,
|
|
20
|
+
);
|
|
21
|
+
const first = resolved[0];
|
|
22
|
+
for (const key of Object.keys(first?.properties ?? {})) {
|
|
23
|
+
const values = resolved.map((branch) => branch?.properties?.[key]);
|
|
24
|
+
if (
|
|
25
|
+
!resolved.every((branch) => branch?.required?.includes(key)) ||
|
|
26
|
+
!values.every(
|
|
27
|
+
(value) =>
|
|
28
|
+
value && Object.prototype.hasOwnProperty.call(value, 'const'),
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
continue;
|
|
32
|
+
const constants = values.map((value) => value.const);
|
|
33
|
+
if (
|
|
34
|
+
constants.some((value, i) =>
|
|
35
|
+
constants.slice(0, i).some((other) => isEqual(value, other)),
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
continue;
|
|
39
|
+
const index = constants.findIndex((value) =>
|
|
40
|
+
isEqual(value, (data as Record<string, unknown>)[key]),
|
|
41
|
+
);
|
|
42
|
+
if (index !== -1) return index;
|
|
43
|
+
}
|
|
44
|
+
} catch {
|
|
45
|
+
// Unresolved references remain the host's responsibility.
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** A missing discriminator belongs on the branch selector, not a hidden field. */
|
|
51
|
+
export const missingDiscriminatorError = (
|
|
52
|
+
schema: JsonSchema,
|
|
53
|
+
rootSchema: JsonSchema,
|
|
54
|
+
path: string,
|
|
55
|
+
errors: import('ajv').ErrorObject[],
|
|
56
|
+
): boolean => {
|
|
57
|
+
try {
|
|
58
|
+
const branches = schema.oneOf?.map((branch) =>
|
|
59
|
+
branch.$ref ? resolveSchema(rootSchema, branch.$ref, rootSchema) : branch,
|
|
60
|
+
);
|
|
61
|
+
if (!branches?.length) return false;
|
|
62
|
+
const keys = Object.keys(branches[0].properties ?? {}).filter((key) =>
|
|
63
|
+
branches.every(
|
|
64
|
+
(branch) =>
|
|
65
|
+
branch.required?.includes(key) &&
|
|
66
|
+
Object.prototype.hasOwnProperty.call(
|
|
67
|
+
branch.properties?.[key] ?? {},
|
|
68
|
+
'const',
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
);
|
|
72
|
+
const pointer = dataPathToPointer(path);
|
|
73
|
+
return errors.some(
|
|
74
|
+
(error) =>
|
|
75
|
+
error.keyword === 'required' &&
|
|
76
|
+
error.instancePath === pointer &&
|
|
77
|
+
keys.includes(error.params.missingProperty),
|
|
78
|
+
);
|
|
79
|
+
} catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
};
|