@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
package/package.json
CHANGED
|
@@ -1,6 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chobantonov/jsonforms-react-renderer-common",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "UI-independent JSON Forms React renderer behavior",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "lib/index.cjs.js",
|
|
7
|
+
"module": "lib/index.esm.js",
|
|
8
|
+
"types": "lib/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"lib",
|
|
11
|
+
"src"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./lib/index.d.ts",
|
|
16
|
+
"import": "./lib/index.esm.js",
|
|
17
|
+
"require": "./lib/index.cjs.js"
|
|
18
|
+
},
|
|
19
|
+
"./*": {
|
|
20
|
+
"types": "./lib/*.d.ts",
|
|
21
|
+
"import": "./lib/*.esm.js",
|
|
22
|
+
"require": "./lib/*.cjs.js"
|
|
23
|
+
},
|
|
24
|
+
"./locale": {
|
|
25
|
+
"types": "./lib/locale/index.d.ts",
|
|
26
|
+
"import": "./lib/locale/index.esm.js",
|
|
27
|
+
"require": "./lib/locale/index.cjs.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"typesVersions": {
|
|
31
|
+
"*": {
|
|
32
|
+
"lib/index.d.ts": [
|
|
33
|
+
"lib/index.d.ts"
|
|
34
|
+
],
|
|
35
|
+
"locale": [
|
|
36
|
+
"lib/locale/index.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"*": [
|
|
39
|
+
"lib/*"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@marcbachmann/cel-js": "8.0.0",
|
|
45
|
+
"ajv": "^8.20.0",
|
|
46
|
+
"dayjs": "^1.11.11",
|
|
47
|
+
"lodash": "^4.18.1",
|
|
48
|
+
"maska": "^3.2.2"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@jsonforms/core": "3.9.0-alpha.4",
|
|
52
|
+
"@jsonforms/react": "3.9.0-alpha.4",
|
|
53
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@jsonforms/core": "3.9.0-alpha.4",
|
|
57
|
+
"@jsonforms/react": "3.9.0-alpha.4",
|
|
58
|
+
"@types/lodash": "^4.17.27",
|
|
59
|
+
"@types/node": "^22.0.0",
|
|
60
|
+
"@types/react": "^18.3.23",
|
|
61
|
+
"@types/react-dom": "^18.3.7",
|
|
62
|
+
"jsdom": "^22.0.0",
|
|
63
|
+
"react": "^18.3.1",
|
|
64
|
+
"react-dom": "^18.3.1",
|
|
65
|
+
"rimraf": "^6.1.4",
|
|
66
|
+
"typescript": "~6.0.3",
|
|
67
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@8.3.8001",
|
|
68
|
+
"vitest": "5.1.1",
|
|
69
|
+
"@chobantonov/jsonforms-extended-spec": "0.2.0",
|
|
70
|
+
"@vitest/coverage-v8": "5.1.1"
|
|
71
|
+
},
|
|
72
|
+
"publishConfig": {
|
|
73
|
+
"access": "public"
|
|
74
|
+
},
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "git+https://github.com/kchobantonov/jsonforms-react-renderers.git",
|
|
78
|
+
"directory": "packages/jsonforms-react-renderer-common"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "vp build && tsc --emitDeclarationOnly && tsc --noEmit -p test/tsconfig.json",
|
|
82
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p test/tsconfig.json",
|
|
83
|
+
"test": "vp test run",
|
|
84
|
+
"clean": "rimraf lib coverage",
|
|
85
|
+
"lint": "vp lint .",
|
|
86
|
+
"lint:fix": "vp run lint --fix",
|
|
87
|
+
"test-cov": "vp test run --coverage"
|
|
88
|
+
}
|
|
6
89
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
JsonFormsContext,
|
|
4
|
+
JsonFormsDispatch,
|
|
5
|
+
useJsonForms,
|
|
6
|
+
} from '@jsonforms/react';
|
|
7
|
+
import { JsonSchema, UISchemaElement, Resolve } from '@jsonforms/core';
|
|
8
|
+
|
|
9
|
+
export type ItemContext = { readonly item?: unknown };
|
|
10
|
+
|
|
11
|
+
/** Resolve a source row only when a consumer reads item. Preserve parent getters. */
|
|
12
|
+
export const ItemProvider = ({
|
|
13
|
+
path,
|
|
14
|
+
children,
|
|
15
|
+
}: React.PropsWithChildren<{ path: string }>) => {
|
|
16
|
+
const parent = useJsonForms();
|
|
17
|
+
const context = useMemo(() => {
|
|
18
|
+
let resolved = false;
|
|
19
|
+
let item: unknown;
|
|
20
|
+
const value = Object.defineProperties(
|
|
21
|
+
{},
|
|
22
|
+
Object.getOwnPropertyDescriptors(parent),
|
|
23
|
+
);
|
|
24
|
+
Object.defineProperty(value, 'item', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
get: () => {
|
|
28
|
+
if (!resolved) {
|
|
29
|
+
item = Resolve.data(parent.core?.data, path);
|
|
30
|
+
resolved = true;
|
|
31
|
+
}
|
|
32
|
+
return item;
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return value;
|
|
36
|
+
}, [parent, path]);
|
|
37
|
+
return (
|
|
38
|
+
<JsonFormsContext.Provider value={context}>
|
|
39
|
+
{children}
|
|
40
|
+
</JsonFormsContext.Provider>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const CellSummary = ({
|
|
45
|
+
schema,
|
|
46
|
+
path,
|
|
47
|
+
uischema,
|
|
48
|
+
}: {
|
|
49
|
+
schema: JsonSchema;
|
|
50
|
+
path?: string;
|
|
51
|
+
uischema: UISchemaElement;
|
|
52
|
+
}) => (
|
|
53
|
+
<JsonFormsDispatch
|
|
54
|
+
schema={schema}
|
|
55
|
+
uischema={uischema}
|
|
56
|
+
path={path ?? ''}
|
|
57
|
+
enabled={false}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const CellModeContext = createContext(false);
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Marks a subtree as rendering inside a table cell. Controls keep their normal
|
|
7
|
+
* implementation - there is deliberately no separate "cell" copy of each
|
|
8
|
+
* renderer - but drop the chrome a cell has no room for.
|
|
9
|
+
*
|
|
10
|
+
* Pass `value={false}` to leave cell mode again. A detail dialog opened from a
|
|
11
|
+
* cell needs this: it portals elsewhere in the DOM, but React context follows
|
|
12
|
+
* the component tree, so without it the dialog's fields render label-less too.
|
|
13
|
+
*/
|
|
14
|
+
export const CellModeProvider = ({
|
|
15
|
+
value = true,
|
|
16
|
+
children,
|
|
17
|
+
}: React.PropsWithChildren<{ value?: boolean }>) => (
|
|
18
|
+
<CellModeContext.Provider value={value}>{children}</CellModeContext.Provider>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const useCellMode = (): boolean => useContext(CellModeContext);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JsonSchema } from '@jsonforms/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Whether the schema forbids the value being emptied in place - a required
|
|
5
|
+
* property, a minimum size. Ported from the Svelte renderers so `Clear` is
|
|
6
|
+
* offered only where it would produce data the schema still accepts.
|
|
7
|
+
*/
|
|
8
|
+
export const preventsEmpty = (
|
|
9
|
+
schema: JsonSchema | undefined,
|
|
10
|
+
array: boolean,
|
|
11
|
+
): boolean => {
|
|
12
|
+
if (!schema) return false;
|
|
13
|
+
if (schema.allOf?.some((part) => preventsEmpty(part, array))) return true;
|
|
14
|
+
if (array) {
|
|
15
|
+
const contains = (schema as JsonSchema & { contains?: unknown }).contains;
|
|
16
|
+
const minContains = (schema as JsonSchema & { minContains?: number })
|
|
17
|
+
.minContains;
|
|
18
|
+
return (schema.minItems ?? 0) > 0 || (!!contains && (minContains ?? 1) > 0);
|
|
19
|
+
}
|
|
20
|
+
return (schema.minProperties ?? 0) > 0 || !!schema.required?.length;
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RankedTester } from '@jsonforms/core';
|
|
2
|
+
import { isMixedSchema } from '../mixed/mixedSchema';
|
|
3
|
+
export const compositeCellTester: RankedTester = (_ui, schema, context) =>
|
|
4
|
+
_ui.options?.summary?.type === 'Label'
|
|
5
|
+
? 6
|
|
6
|
+
: schema?.type === 'object' ||
|
|
7
|
+
schema?.type === 'array' ||
|
|
8
|
+
Boolean(
|
|
9
|
+
schema?.anyOf?.length ||
|
|
10
|
+
schema?.oneOf?.length ||
|
|
11
|
+
schema?.allOf?.length,
|
|
12
|
+
) ||
|
|
13
|
+
isMixedSchema({ ..._ui, scope: '#' }, schema, context)
|
|
14
|
+
? 1
|
|
15
|
+
: -1;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ControlElement,
|
|
3
|
+
JsonSchema,
|
|
4
|
+
Paths,
|
|
5
|
+
Resolve,
|
|
6
|
+
Translator,
|
|
7
|
+
createCleanLabel,
|
|
8
|
+
getI18nKey,
|
|
9
|
+
} from '@jsonforms/core';
|
|
10
|
+
import { I18nKey } from '../locale';
|
|
11
|
+
|
|
12
|
+
export interface CompositeSummary {
|
|
13
|
+
text: string;
|
|
14
|
+
/** Generated descriptions use secondary, italic typography instead of data styling. */
|
|
15
|
+
generated: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const generated = (text: string): CompositeSummary => ({
|
|
19
|
+
text,
|
|
20
|
+
generated: true,
|
|
21
|
+
});
|
|
22
|
+
const literal = (text: string): CompositeSummary => ({
|
|
23
|
+
text,
|
|
24
|
+
generated: false,
|
|
25
|
+
});
|
|
26
|
+
const usable = (value: unknown) =>
|
|
27
|
+
value != null && typeof value !== 'object' && String(value).trim() !== '';
|
|
28
|
+
function arrayPreview(data: unknown[], summary: ControlElement): string[] {
|
|
29
|
+
const path = Paths.fromScoped(summary);
|
|
30
|
+
const preview: string[] = [];
|
|
31
|
+
for (const item of data) {
|
|
32
|
+
const value = Resolve.data(item, path);
|
|
33
|
+
if (usable(value)) {
|
|
34
|
+
preview.push(String(value));
|
|
35
|
+
if (preview.length === 2) break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return preview;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function arraySummary(
|
|
42
|
+
data: unknown[],
|
|
43
|
+
summary: ControlElement | undefined,
|
|
44
|
+
t: Translator,
|
|
45
|
+
defaultMessage: (key: I18nKey) => string,
|
|
46
|
+
): CompositeSummary {
|
|
47
|
+
const preview = summary?.scope ? arrayPreview(data, summary) : [];
|
|
48
|
+
if (preview.length) {
|
|
49
|
+
const remaining = data.length - preview.length;
|
|
50
|
+
const more = remaining
|
|
51
|
+
? ' ' +
|
|
52
|
+
t('composite.summary.more', defaultMessage('composite.summary.more'), {
|
|
53
|
+
count: remaining,
|
|
54
|
+
}).replace('{count}', String(remaining))
|
|
55
|
+
: '';
|
|
56
|
+
return literal(preview.join(', ') + more);
|
|
57
|
+
}
|
|
58
|
+
const key =
|
|
59
|
+
data.length === 1 ? 'composite.summary.item' : 'composite.summary.items';
|
|
60
|
+
return generated(
|
|
61
|
+
t(key, defaultMessage(key), { count: data.length }).replace(
|
|
62
|
+
'{count}',
|
|
63
|
+
String(data.length),
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function summaryFieldLabel(
|
|
69
|
+
summary: ControlElement,
|
|
70
|
+
path: string,
|
|
71
|
+
schema: JsonSchema | undefined,
|
|
72
|
+
title: string | undefined,
|
|
73
|
+
t: Translator,
|
|
74
|
+
) {
|
|
75
|
+
const fieldSchema = schema
|
|
76
|
+
? Resolve.schema(schema, summary.scope, schema)
|
|
77
|
+
: undefined;
|
|
78
|
+
const fallback =
|
|
79
|
+
typeof summary.label === 'string'
|
|
80
|
+
? summary.label
|
|
81
|
+
: (fieldSchema?.title ??
|
|
82
|
+
(path ? createCleanLabel(path.split('.').pop()!) : title));
|
|
83
|
+
return fallback
|
|
84
|
+
? t(getI18nKey(fieldSchema, summary, path, 'label'), fallback)
|
|
85
|
+
: undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function objectSummary(
|
|
89
|
+
data: object,
|
|
90
|
+
summary: ControlElement | undefined,
|
|
91
|
+
title: string | undefined,
|
|
92
|
+
t: Translator,
|
|
93
|
+
defaultMessage: (key: I18nKey) => string,
|
|
94
|
+
schema?: JsonSchema,
|
|
95
|
+
): CompositeSummary {
|
|
96
|
+
if (Object.keys(data).length === 0)
|
|
97
|
+
return generated(
|
|
98
|
+
t(
|
|
99
|
+
'composite.summary.emptyObject',
|
|
100
|
+
defaultMessage('composite.summary.emptyObject'),
|
|
101
|
+
),
|
|
102
|
+
);
|
|
103
|
+
if (summary?.scope) {
|
|
104
|
+
const path = Paths.fromScoped(summary);
|
|
105
|
+
const value = Resolve.data(data, path);
|
|
106
|
+
if (usable(value)) return literal(String(value));
|
|
107
|
+
const label = summaryFieldLabel(summary, path, schema, title, t);
|
|
108
|
+
if (label !== undefined) {
|
|
109
|
+
return generated(
|
|
110
|
+
t(
|
|
111
|
+
'composite.summary.unspecified',
|
|
112
|
+
defaultMessage('composite.summary.unspecified'),
|
|
113
|
+
{ label },
|
|
114
|
+
).replace('{label}', label),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return generated(
|
|
119
|
+
title ??
|
|
120
|
+
t(
|
|
121
|
+
'composite.summary.details',
|
|
122
|
+
defaultMessage('composite.summary.details'),
|
|
123
|
+
),
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const compositeSummaryPresentation = (
|
|
128
|
+
data: unknown,
|
|
129
|
+
summary: ControlElement | undefined,
|
|
130
|
+
title: string | undefined,
|
|
131
|
+
t: Translator,
|
|
132
|
+
defaultMessage: (key: I18nKey) => string,
|
|
133
|
+
schema?: JsonSchema,
|
|
134
|
+
): CompositeSummary => {
|
|
135
|
+
if (data == null)
|
|
136
|
+
return generated(
|
|
137
|
+
t('composite.summary.unset', defaultMessage('composite.summary.unset')),
|
|
138
|
+
);
|
|
139
|
+
if (Array.isArray(data))
|
|
140
|
+
return arraySummary(data, summary, t, defaultMessage);
|
|
141
|
+
if (typeof data === 'object')
|
|
142
|
+
return objectSummary(data, summary, title, t, defaultMessage, schema);
|
|
143
|
+
return literal(String(data));
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/** Text-only compatibility API. Renderers use the presentation API to distinguish fallback labels. */
|
|
147
|
+
export const compositeSummary = (
|
|
148
|
+
...args: Parameters<typeof compositeSummaryPresentation>
|
|
149
|
+
): string => compositeSummaryPresentation(...args).text;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CellProps, Translator } from '@jsonforms/core';
|
|
2
|
+
import { useDynamicTreeResolver } from '../dynamic/DynamicUiProvider';
|
|
3
|
+
import {
|
|
4
|
+
usePathErrorMessages,
|
|
5
|
+
labelDetailErrorPaths,
|
|
6
|
+
} from '../validation/errorSummary';
|
|
7
|
+
import { compositeSummaryPresentation } from './compositeSummary';
|
|
8
|
+
|
|
9
|
+
/** Resolves the same authored detail, summary and error paths for both cell sets. */
|
|
10
|
+
export const useCompositeCellPresentation = (
|
|
11
|
+
props: CellProps,
|
|
12
|
+
translate: Translator,
|
|
13
|
+
i18nDefault: Parameters<typeof compositeSummaryPresentation>[4],
|
|
14
|
+
) => {
|
|
15
|
+
const resolveTree = useDynamicTreeResolver(props.path);
|
|
16
|
+
const authoredDetail = props.uischema.options?.detail;
|
|
17
|
+
const errorOptions =
|
|
18
|
+
authoredDetail &&
|
|
19
|
+
typeof authoredDetail === 'object' &&
|
|
20
|
+
typeof authoredDetail.type === 'string'
|
|
21
|
+
? { ...props.uischema.options, detail: resolveTree(authoredDetail) }
|
|
22
|
+
: props.uischema.options;
|
|
23
|
+
const errors = usePathErrorMessages(
|
|
24
|
+
props.path,
|
|
25
|
+
labelDetailErrorPaths(props.path, errorOptions),
|
|
26
|
+
);
|
|
27
|
+
const options = props.uischema.options ?? {};
|
|
28
|
+
const summary = compositeSummaryPresentation(
|
|
29
|
+
props.data,
|
|
30
|
+
options.summary?.type === 'Control' ? (options.summary as any) : undefined,
|
|
31
|
+
props.schema?.title,
|
|
32
|
+
translate,
|
|
33
|
+
i18nDefault,
|
|
34
|
+
props.schema,
|
|
35
|
+
);
|
|
36
|
+
return { errors, summary };
|
|
37
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
coreReducer,
|
|
4
|
+
update,
|
|
5
|
+
UPDATE_DATA,
|
|
6
|
+
type JsonFormsCore,
|
|
7
|
+
type JsonSchema,
|
|
8
|
+
type Translator,
|
|
9
|
+
} from '@jsonforms/core';
|
|
10
|
+
import { useJsonForms } from '@jsonforms/react';
|
|
11
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
12
|
+
import get from 'lodash/get';
|
|
13
|
+
import isEqual from 'lodash/isEqual';
|
|
14
|
+
import { useI18nDefault } from '../locale/translate';
|
|
15
|
+
import { preventsEmpty } from './compositeActions';
|
|
16
|
+
import type { PendingChange } from '../interaction/pendingChanges';
|
|
17
|
+
import type { DetailDialogOptions } from '../interaction/detailDialog';
|
|
18
|
+
|
|
19
|
+
export interface CompositeDetailDialogOptions {
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
dialog?: DetailDialogOptions;
|
|
22
|
+
showEmptyButton?: boolean;
|
|
23
|
+
disableRemove?: boolean;
|
|
24
|
+
restrict?: boolean;
|
|
25
|
+
emptyLabel?: string;
|
|
26
|
+
cancelLabel?: string;
|
|
27
|
+
okLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CompositeDraftInput {
|
|
31
|
+
open: boolean;
|
|
32
|
+
path: string;
|
|
33
|
+
schema: JsonSchema | undefined;
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
options: CompositeDetailDialogOptions;
|
|
36
|
+
t: Translator;
|
|
37
|
+
onClose: () => void;
|
|
38
|
+
onApply: (value: unknown) => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type CompositeDetailDialogProps = React.PropsWithChildren<
|
|
42
|
+
CompositeDraftInput & { title: string; label: string }
|
|
43
|
+
>;
|
|
44
|
+
|
|
45
|
+
const valueAtPath = (data: unknown, path: string) =>
|
|
46
|
+
path ? get(data, path.split('.')) : data;
|
|
47
|
+
|
|
48
|
+
export const hasInvalidCompositeEditorDraft = (
|
|
49
|
+
errors: JsonFormsCore['additionalErrors'],
|
|
50
|
+
path: string,
|
|
51
|
+
) => {
|
|
52
|
+
const pointer =
|
|
53
|
+
'/' +
|
|
54
|
+
path
|
|
55
|
+
.split('.')
|
|
56
|
+
.map((part) => part.replace(/~/g, '~0').replace(/\//g, '~1'))
|
|
57
|
+
.join('/');
|
|
58
|
+
return (errors ?? []).some(
|
|
59
|
+
(error) =>
|
|
60
|
+
error.params?.source === 'monaco' &&
|
|
61
|
+
(error.instancePath === pointer ||
|
|
62
|
+
error.instancePath.startsWith(pointer + '/')),
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function acceptsDraftUpdate(
|
|
67
|
+
path: string,
|
|
68
|
+
action: { type: string; path: string },
|
|
69
|
+
) {
|
|
70
|
+
return (
|
|
71
|
+
action.type === UPDATE_DATA &&
|
|
72
|
+
(!path || action.path === path || action.path.startsWith(`${path}.`))
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function canEmptyCompositeValue(
|
|
77
|
+
value: unknown,
|
|
78
|
+
schema: CompositeDraftInput['schema'],
|
|
79
|
+
options: CompositeDetailDialogOptions,
|
|
80
|
+
isArray: boolean,
|
|
81
|
+
) {
|
|
82
|
+
return (
|
|
83
|
+
!options.disableRemove &&
|
|
84
|
+
value != null &&
|
|
85
|
+
typeof value === 'object' &&
|
|
86
|
+
Object.keys(value).length > 0 &&
|
|
87
|
+
(options.restrict === false || !preventsEmpty(schema, isArray))
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function useIsolatedDraft(
|
|
92
|
+
parentCore: JsonFormsCore | undefined,
|
|
93
|
+
path: string,
|
|
94
|
+
open: boolean,
|
|
95
|
+
enabled: boolean,
|
|
96
|
+
) {
|
|
97
|
+
const [draft, setDraft] = useState<JsonFormsCore>();
|
|
98
|
+
const draftRef = useRef<JsonFormsCore>();
|
|
99
|
+
const [originalValue, setOriginalValue] = useState<unknown>();
|
|
100
|
+
const localDispatch = useCallback(
|
|
101
|
+
(action: any) => {
|
|
102
|
+
const core = draftRef.current;
|
|
103
|
+
if (!core || !enabled || !acceptsDraftUpdate(path, action)) return;
|
|
104
|
+
const next = coreReducer(core, action);
|
|
105
|
+
draftRef.current = next;
|
|
106
|
+
setDraft(next);
|
|
107
|
+
},
|
|
108
|
+
[enabled, path],
|
|
109
|
+
);
|
|
110
|
+
if (open && !draft && parentCore) {
|
|
111
|
+
setOriginalValue(cloneDeep(valueAtPath(parentCore.data, path)));
|
|
112
|
+
setDraft({ ...parentCore, data: cloneDeep(parentCore.data) });
|
|
113
|
+
}
|
|
114
|
+
React.useLayoutEffect(() => {
|
|
115
|
+
draftRef.current = draft;
|
|
116
|
+
}, [draft]);
|
|
117
|
+
return { draft, draftRef, setDraft, originalValue, localDispatch };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Isolates detail edits until Apply, including pending writes and external-data conflicts. */
|
|
121
|
+
export const useCompositeDraft = ({
|
|
122
|
+
open,
|
|
123
|
+
path,
|
|
124
|
+
schema,
|
|
125
|
+
enabled,
|
|
126
|
+
options,
|
|
127
|
+
t,
|
|
128
|
+
onClose,
|
|
129
|
+
onApply,
|
|
130
|
+
}: CompositeDraftInput) => {
|
|
131
|
+
const parent = useJsonForms();
|
|
132
|
+
const invalidEditorDraft = hasInvalidCompositeEditorDraft(
|
|
133
|
+
parent.core?.additionalErrors,
|
|
134
|
+
path,
|
|
135
|
+
);
|
|
136
|
+
const defaultMessage = useI18nDefault();
|
|
137
|
+
const { draft, draftRef, setDraft, originalValue, localDispatch } =
|
|
138
|
+
useIsolatedDraft(parent.core, path, open, enabled);
|
|
139
|
+
const pending = useMemo(() => new Set<PendingChange>(), []);
|
|
140
|
+
const value = draft ? valueAtPath(draft.data, path) : undefined;
|
|
141
|
+
const discardDraft = useCallback(() => {
|
|
142
|
+
pending.forEach((change) => change.cancel());
|
|
143
|
+
draftRef.current = undefined;
|
|
144
|
+
setDraft(undefined);
|
|
145
|
+
}, [draftRef, pending, setDraft]);
|
|
146
|
+
const cancel = useCallback(() => {
|
|
147
|
+
discardDraft();
|
|
148
|
+
onClose();
|
|
149
|
+
}, [discardDraft, onClose]);
|
|
150
|
+
const apply = useCallback(() => {
|
|
151
|
+
if (invalidEditorDraft) return;
|
|
152
|
+
pending.forEach((change) => change.flush());
|
|
153
|
+
const next = cloneDeep(valueAtPath(draftRef.current?.data, path));
|
|
154
|
+
const changed = !isEqual(originalValue, next);
|
|
155
|
+
discardDraft();
|
|
156
|
+
if (changed) onApply(next);
|
|
157
|
+
onClose();
|
|
158
|
+
}, [
|
|
159
|
+
invalidEditorDraft,
|
|
160
|
+
draftRef,
|
|
161
|
+
originalValue,
|
|
162
|
+
pending,
|
|
163
|
+
path,
|
|
164
|
+
discardDraft,
|
|
165
|
+
onApply,
|
|
166
|
+
onClose,
|
|
167
|
+
]);
|
|
168
|
+
const context = useMemo(
|
|
169
|
+
() => ({ ...parent, core: draft ?? parent.core, dispatch: localDispatch }),
|
|
170
|
+
[parent, draft, localDispatch],
|
|
171
|
+
);
|
|
172
|
+
const isArray = Array.isArray(value) || schema?.type === 'array';
|
|
173
|
+
const canEmpty =
|
|
174
|
+
enabled && canEmptyCompositeValue(value, schema, options, isArray);
|
|
175
|
+
const conflicted =
|
|
176
|
+
Boolean(draft) &&
|
|
177
|
+
!isEqual(valueAtPath(parent.core?.data, path), originalValue);
|
|
178
|
+
const buttonLabel = (
|
|
179
|
+
override: string | undefined,
|
|
180
|
+
key: 'composite.empty' | 'composite.cancel' | 'composite.apply',
|
|
181
|
+
) => (override ? t(override, override) : t(key, defaultMessage(key)));
|
|
182
|
+
const clear = () => {
|
|
183
|
+
pending.forEach((change) => change.cancel());
|
|
184
|
+
localDispatch(update(path, () => (isArray ? [] : {})));
|
|
185
|
+
};
|
|
186
|
+
return {
|
|
187
|
+
defaultMessage,
|
|
188
|
+
pending,
|
|
189
|
+
draft,
|
|
190
|
+
context,
|
|
191
|
+
canEmpty,
|
|
192
|
+
conflicted,
|
|
193
|
+
canApply: enabled && Boolean(draft) && !conflicted && !invalidEditorDraft,
|
|
194
|
+
buttonLabel,
|
|
195
|
+
cancel,
|
|
196
|
+
apply,
|
|
197
|
+
clear,
|
|
198
|
+
};
|
|
199
|
+
};
|