@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,49 @@
|
|
|
1
|
+
import { useDynamicElements } from '../dynamic/DynamicUiProvider';
|
|
2
|
+
import React, { ComponentType } from 'react';
|
|
3
|
+
import Ajv from 'ajv';
|
|
4
|
+
import { getAjv, isVisible, UISchemaElement } from '@jsonforms/core';
|
|
5
|
+
import { useJsonForms } from '@jsonforms/react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Children that take part in layout.
|
|
9
|
+
*
|
|
10
|
+
* "Only effective visible UI-schema children participate. Hidden children
|
|
11
|
+
* leave layout." The count matters as well as the rendering: a hidden child
|
|
12
|
+
* must not consume a share or contribute a gap, which is what the previous
|
|
13
|
+
* `24 / elements.length` did.
|
|
14
|
+
*/
|
|
15
|
+
export const useEffectiveElements = (
|
|
16
|
+
elements: UISchemaElement[],
|
|
17
|
+
path: string,
|
|
18
|
+
config?: unknown,
|
|
19
|
+
): UISchemaElement[] => {
|
|
20
|
+
const ctx = useJsonForms();
|
|
21
|
+
const data = ctx.core?.data;
|
|
22
|
+
const ajv = ctx.core?.ajv;
|
|
23
|
+
const effective = useDynamicElements(elements ?? [], path);
|
|
24
|
+
return effective.filter((element) => {
|
|
25
|
+
if (!element) return false;
|
|
26
|
+
try {
|
|
27
|
+
return ajv ? isVisible(element, data, path, ajv, config) : true;
|
|
28
|
+
} catch {
|
|
29
|
+
// A malformed rule is the author's problem, not a reason to drop a child.
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export interface AjvProps {
|
|
36
|
+
ajv: Ajv;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// TODO fix @typescript-eslint/ban-types
|
|
40
|
+
// oxlint-disable-next-line @typescript-eslint/ban-types
|
|
41
|
+
export const withAjvProps = <P extends {}>(
|
|
42
|
+
Component: ComponentType<AjvProps & P>,
|
|
43
|
+
) =>
|
|
44
|
+
function WithAjvProps(props: P) {
|
|
45
|
+
const ctx = useJsonForms();
|
|
46
|
+
const ajv = getAjv({ jsonforms: { ...ctx } });
|
|
47
|
+
|
|
48
|
+
return <Component {...props} ajv={ajv} />;
|
|
49
|
+
};
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import type { UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The portable layout sizing model, sections 6 and 7.
|
|
5
|
+
*
|
|
6
|
+
* Two kinds of option, on two different elements:
|
|
7
|
+
*
|
|
8
|
+
* - **`options.layout` on a child** says how that child participates in its
|
|
9
|
+
* parent - `span`, `weight`, `width`, `height` and the min/max constraints.
|
|
10
|
+
* - **flat options on the layout** configure the container itself - `gap`,
|
|
11
|
+
* `wrap`, `align`, `justify`, `minItemWidth`, and `gridColumns` for a
|
|
12
|
+
* horizontal layout.
|
|
13
|
+
*
|
|
14
|
+
* "Flat layout options configure immediate children. `options.layout`
|
|
15
|
+
* configures child participation."
|
|
16
|
+
*
|
|
17
|
+
* This module is pure: it turns those options into CSS and a list of
|
|
18
|
+
* diagnostics, and knows nothing about React or antd.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** "On web numeric Dimension means CSS px". */
|
|
22
|
+
export type Dimension = number | string;
|
|
23
|
+
|
|
24
|
+
export interface LayoutItemOptions {
|
|
25
|
+
span?: number;
|
|
26
|
+
weight?: number;
|
|
27
|
+
width?: Dimension;
|
|
28
|
+
minWidth?: Dimension;
|
|
29
|
+
maxWidth?: Dimension;
|
|
30
|
+
height?: Dimension;
|
|
31
|
+
minHeight?: Dimension;
|
|
32
|
+
maxHeight?: Dimension;
|
|
33
|
+
/** Reserved by the specification; accepted and ignored. */
|
|
34
|
+
start?: number;
|
|
35
|
+
/** Reserved by the specification; accepted and ignored. */
|
|
36
|
+
responsive?: unknown;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface LayoutContainerOptions {
|
|
40
|
+
gap?: Dimension;
|
|
41
|
+
wrap?: boolean;
|
|
42
|
+
minItemWidth?: Dimension;
|
|
43
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
44
|
+
justify?:
|
|
45
|
+
| 'start'
|
|
46
|
+
| 'center'
|
|
47
|
+
| 'end'
|
|
48
|
+
| 'space-between'
|
|
49
|
+
| 'space-around'
|
|
50
|
+
| 'space-evenly';
|
|
51
|
+
resizable?: boolean;
|
|
52
|
+
/** Horizontal layouts only. */
|
|
53
|
+
gridColumns?: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type LayoutDirection = 'row' | 'column';
|
|
57
|
+
|
|
58
|
+
/** The renderer default, the last step of the `gridColumns` chain. */
|
|
59
|
+
export const DEFAULT_GRID_COLUMNS = 16;
|
|
60
|
+
|
|
61
|
+
/** Portable fallbacks; an explicit adapter override remains available. */
|
|
62
|
+
export type LayoutGapDefaults = Record<LayoutDirection, Dimension>;
|
|
63
|
+
const DEFAULT_GAPS: LayoutGapDefaults = { row: 16, column: 16 };
|
|
64
|
+
|
|
65
|
+
export interface LayoutDiagnostic {
|
|
66
|
+
/** Index of the child it concerns, or -1 for the container. */
|
|
67
|
+
index: number;
|
|
68
|
+
message: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const isPositiveInteger = (value: unknown): value is number =>
|
|
72
|
+
typeof value === 'number' && Number.isInteger(value) && value > 0;
|
|
73
|
+
|
|
74
|
+
const isUsableWeight = (value: unknown): value is number =>
|
|
75
|
+
typeof value === 'number' && Number.isFinite(value) && value > 0;
|
|
76
|
+
|
|
77
|
+
/** "dimensions non-negative where appropriate". */
|
|
78
|
+
const isDimension = (value: unknown): value is Dimension =>
|
|
79
|
+
(typeof value === 'number' && Number.isFinite(value) && value >= 0) ||
|
|
80
|
+
(typeof value === 'string' && value.trim().length > 0);
|
|
81
|
+
|
|
82
|
+
/** A number is CSS pixels; a string is passed through as authored. */
|
|
83
|
+
export const toCss = (value: Dimension): string =>
|
|
84
|
+
typeof value === 'number' ? `${value}px` : value;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* `gridColumns`: explicit -> `jsonformsExtended.layoutDefaults.gridColumns` ->
|
|
88
|
+
* renderer default -> 16.
|
|
89
|
+
*/
|
|
90
|
+
export const resolveGridColumns = (
|
|
91
|
+
options: LayoutContainerOptions | undefined,
|
|
92
|
+
config: unknown,
|
|
93
|
+
): number => {
|
|
94
|
+
if (isPositiveInteger(options?.gridColumns)) {
|
|
95
|
+
return options!.gridColumns as number;
|
|
96
|
+
}
|
|
97
|
+
const fromDefaults = layoutDefaultsOf(config)?.gridColumns;
|
|
98
|
+
return isPositiveInteger(fromDefaults) ? fromDefaults : DEFAULT_GRID_COLUMNS;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** `wrap`: explicit -> `jsonformsExtended.layoutDefaults.wrap` -> false. */
|
|
102
|
+
export const resolveWrap = (
|
|
103
|
+
options: LayoutContainerOptions | undefined,
|
|
104
|
+
config: unknown,
|
|
105
|
+
): boolean => {
|
|
106
|
+
if (typeof options?.wrap === 'boolean') {
|
|
107
|
+
return options.wrap;
|
|
108
|
+
}
|
|
109
|
+
const fromDefaults = layoutDefaultsOf(config)?.wrap;
|
|
110
|
+
return typeof fromDefaults === 'boolean' ? fromDefaults : false;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* `gap`: explicit -> `jsonformsExtended.layoutDefaults.gap` -> the renderer
|
|
115
|
+
* default for this direction.
|
|
116
|
+
*
|
|
117
|
+
* `direction` is required rather than defaulted: renderer families may supply
|
|
118
|
+
* different defaults for the two directions, and a caller that forgot to pass it would silently give
|
|
119
|
+
* a column the row's gutter.
|
|
120
|
+
*/
|
|
121
|
+
export const resolveGap = (
|
|
122
|
+
options: LayoutContainerOptions | undefined,
|
|
123
|
+
config: unknown,
|
|
124
|
+
direction: LayoutDirection,
|
|
125
|
+
defaults: LayoutGapDefaults = DEFAULT_GAPS,
|
|
126
|
+
): Dimension => {
|
|
127
|
+
if (isDimension(options?.gap)) {
|
|
128
|
+
return options!.gap as Dimension;
|
|
129
|
+
}
|
|
130
|
+
const fromDefaults = layoutDefaultsOf(config)?.gap;
|
|
131
|
+
if (isDimension(fromDefaults)) {
|
|
132
|
+
return fromDefaults;
|
|
133
|
+
}
|
|
134
|
+
return defaults[direction];
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* `jsonformsExtended.layoutDefaults`, per Adjustment 1: everything this
|
|
139
|
+
* project adds to the global config lives under its own namespace rather than
|
|
140
|
+
* at the top level.
|
|
141
|
+
*/
|
|
142
|
+
const layoutDefaultsOf = (
|
|
143
|
+
config: unknown,
|
|
144
|
+
): (LayoutContainerOptions & { gridColumns?: number }) | undefined => {
|
|
145
|
+
const extended = (config as Record<string, unknown> | undefined)?.[
|
|
146
|
+
'jsonformsExtended'
|
|
147
|
+
] as Record<string, unknown> | undefined;
|
|
148
|
+
const defaults = extended?.['layoutDefaults'];
|
|
149
|
+
return defaults && typeof defaults === 'object'
|
|
150
|
+
? (defaults as LayoutContainerOptions)
|
|
151
|
+
: undefined;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const ALIGN: Record<string, string> = {
|
|
155
|
+
start: 'flex-start',
|
|
156
|
+
center: 'center',
|
|
157
|
+
end: 'flex-end',
|
|
158
|
+
stretch: 'stretch',
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const JUSTIFY: Record<string, string> = {
|
|
162
|
+
start: 'flex-start',
|
|
163
|
+
center: 'center',
|
|
164
|
+
end: 'flex-end',
|
|
165
|
+
'space-between': 'space-between',
|
|
166
|
+
'space-around': 'space-around',
|
|
167
|
+
'space-evenly': 'space-evenly',
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/** "justify = main axis; align = cross axis." */
|
|
171
|
+
export const containerStyle = (
|
|
172
|
+
options: LayoutContainerOptions | undefined,
|
|
173
|
+
config: unknown,
|
|
174
|
+
direction: LayoutDirection,
|
|
175
|
+
defaults: LayoutGapDefaults = DEFAULT_GAPS,
|
|
176
|
+
): React.CSSProperties => {
|
|
177
|
+
const wrap = resolveWrap(options, config);
|
|
178
|
+
return {
|
|
179
|
+
display: 'flex',
|
|
180
|
+
flexDirection: direction,
|
|
181
|
+
// "Structural layouts have no implicit outer padding."
|
|
182
|
+
padding: 0,
|
|
183
|
+
// "Gap applies only between effective visible immediate children", which
|
|
184
|
+
// is exactly what CSS `gap` does.
|
|
185
|
+
gap: toCss(resolveGap(options, config, direction, defaults)),
|
|
186
|
+
flexWrap: wrap ? 'wrap' : 'nowrap',
|
|
187
|
+
alignItems: ALIGN[options?.align ?? ''] ?? undefined,
|
|
188
|
+
justifyContent: JUSTIFY[options?.justify ?? ''] ?? undefined,
|
|
189
|
+
minWidth: 0,
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The span width formula, with the gap accounted for.
|
|
195
|
+
*
|
|
196
|
+
* For usable row width W, G grid columns and gap g the specification gives
|
|
197
|
+
*
|
|
198
|
+
* c = (W - (G - 1) * g) / G
|
|
199
|
+
* spanWidth(n) = n * c + (n - 1) * g
|
|
200
|
+
*
|
|
201
|
+
* which rearranges to a form CSS can evaluate without knowing W:
|
|
202
|
+
*
|
|
203
|
+
* spanWidth(n) = (n / G) * W - g * (G - n) / G
|
|
204
|
+
*/
|
|
205
|
+
export const spanBasis = (
|
|
206
|
+
span: number,
|
|
207
|
+
grid: number,
|
|
208
|
+
gap: Dimension,
|
|
209
|
+
): string => {
|
|
210
|
+
const percent = (span / grid) * 100;
|
|
211
|
+
const gapShare = (grid - span) / grid;
|
|
212
|
+
if (gapShare === 0) {
|
|
213
|
+
return `${percent}%`;
|
|
214
|
+
}
|
|
215
|
+
return `calc(${percent}% - ${gapShare} * ${toCss(gap)})`;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export const itemOptionsOf = (
|
|
219
|
+
element: UISchemaElement | undefined,
|
|
220
|
+
): LayoutItemOptions | undefined => {
|
|
221
|
+
const layout = (element as { options?: Record<string, unknown> })?.options?.[
|
|
222
|
+
'layout'
|
|
223
|
+
];
|
|
224
|
+
return layout && typeof layout === 'object'
|
|
225
|
+
? (layout as LayoutItemOptions)
|
|
226
|
+
: undefined;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export interface ItemSizing {
|
|
230
|
+
style: React.CSSProperties;
|
|
231
|
+
diagnostics: string[];
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* One child's participation, resolved.
|
|
236
|
+
*
|
|
237
|
+
* "Primary modes: Auto, Span, Weight, Fixed. Conflict precedence:
|
|
238
|
+
* Fixed > Span > Weight > Auto. Min/max are constraints."
|
|
239
|
+
*
|
|
240
|
+
* The min/max are applied as CSS constraints rather than by redistributing
|
|
241
|
+
* here, because the browser performs the same redistribution the
|
|
242
|
+
* specification describes - flexible children shrink first, then span and
|
|
243
|
+
* fixed ones down to their minimum.
|
|
244
|
+
*/
|
|
245
|
+
export const itemSizing = (
|
|
246
|
+
element: UISchemaElement | undefined,
|
|
247
|
+
direction: LayoutDirection,
|
|
248
|
+
grid: number,
|
|
249
|
+
gap: Dimension,
|
|
250
|
+
minItemWidth?: Dimension,
|
|
251
|
+
): ItemSizing => {
|
|
252
|
+
const item = itemOptionsOf(element);
|
|
253
|
+
const diagnostics: string[] = [];
|
|
254
|
+
const style: React.CSSProperties = { minWidth: 0 };
|
|
255
|
+
|
|
256
|
+
const horizontal = direction === 'row';
|
|
257
|
+
/*
|
|
258
|
+
A Spacer carries its size at the top level rather than in `options.layout`,
|
|
259
|
+
and it applies to the parent's **main axis** - width in a row, height in a
|
|
260
|
+
column. Resolving it here is what makes the axis follow the parent without
|
|
261
|
+
the Spacer having to know which layout contains it, and without the
|
|
262
|
+
agnostic package reaching into this one.
|
|
263
|
+
|
|
264
|
+
`options.layout` still wins, so a Spacer may take a weight instead.
|
|
265
|
+
*/
|
|
266
|
+
const spacerSize =
|
|
267
|
+
(element as { type?: string })?.type === 'Spacer'
|
|
268
|
+
? (element as unknown as { size?: Dimension }).size
|
|
269
|
+
: undefined;
|
|
270
|
+
const main =
|
|
271
|
+
(horizontal ? item?.width : item?.height) ??
|
|
272
|
+
(item?.span === undefined && item?.weight === undefined
|
|
273
|
+
? spacerSize
|
|
274
|
+
: undefined);
|
|
275
|
+
let span = item?.span;
|
|
276
|
+
|
|
277
|
+
if (span !== undefined && !isPositiveInteger(span)) {
|
|
278
|
+
diagnostics.push('`span` must be a positive integer; ignored.');
|
|
279
|
+
span = undefined;
|
|
280
|
+
} else if (span !== undefined && !horizontal) {
|
|
281
|
+
/*
|
|
282
|
+
"Unsupported hints are ignored with diagnostic; e.g. span under
|
|
283
|
+
Group/VerticalLayout does not create a horizontal grid."
|
|
284
|
+
*/
|
|
285
|
+
diagnostics.push('`span` has no effect in a vertical layout; ignored.');
|
|
286
|
+
span = undefined;
|
|
287
|
+
} else if (span !== undefined && span > grid) {
|
|
288
|
+
// "Clamp span above gridColumns and diagnose."
|
|
289
|
+
diagnostics.push(
|
|
290
|
+
`\`span\` ${span} exceeds gridColumns ${grid}; clamped to ${grid}.`,
|
|
291
|
+
);
|
|
292
|
+
span = grid;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
let weight = item?.weight;
|
|
296
|
+
if (weight !== undefined && !isUsableWeight(weight)) {
|
|
297
|
+
diagnostics.push(
|
|
298
|
+
'`weight` must be a finite number greater than 0; ignored.',
|
|
299
|
+
);
|
|
300
|
+
weight = undefined;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (main !== undefined && !isDimension(main)) {
|
|
304
|
+
diagnostics.push(
|
|
305
|
+
`\`${
|
|
306
|
+
horizontal ? 'width' : 'height'
|
|
307
|
+
}\` must be a non-negative dimension; ignored.`,
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Fixed
|
|
312
|
+
if (main !== undefined && isDimension(main)) {
|
|
313
|
+
style.flex = `0 0 ${toCss(main)}`;
|
|
314
|
+
} else if (span !== undefined) {
|
|
315
|
+
// Span, against the complete logical grid
|
|
316
|
+
style.flex = `0 0 ${spanBasis(span, grid, gap)}`;
|
|
317
|
+
} else if (weight !== undefined) {
|
|
318
|
+
/*
|
|
319
|
+
Weight. The two axes are **not** the same basis, which is the whole of
|
|
320
|
+
the specification's vertical qualifier: "vertical weight distributes
|
|
321
|
+
remaining height only when parent height is definite/resolvable".
|
|
322
|
+
|
|
323
|
+
A `0` basis in a column would collapse the child to nothing whenever the
|
|
324
|
+
parent's height is indefinite, which is the ordinary case for a form. An
|
|
325
|
+
`auto` basis is the rule expressed in CSS: the child starts at its
|
|
326
|
+
content height, and weight divides whatever space is left over - none
|
|
327
|
+
when the height is indefinite, the remainder when it is not.
|
|
328
|
+
*/
|
|
329
|
+
style.flex = horizontal ? `${weight} 1 0` : `${weight} 1 auto`;
|
|
330
|
+
} else {
|
|
331
|
+
/*
|
|
332
|
+
Auto. "Horizontal Auto behaves as weight 1. Vertical Auto means
|
|
333
|
+
natural/content height."
|
|
334
|
+
*/
|
|
335
|
+
style.flex = horizontal ? '1 1 0' : '0 0 auto';
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const constraint = (
|
|
339
|
+
value: Dimension | undefined,
|
|
340
|
+
key: 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight',
|
|
341
|
+
) => {
|
|
342
|
+
if (value === undefined) return;
|
|
343
|
+
if (!isDimension(value)) {
|
|
344
|
+
diagnostics.push(`\`${key}\` must be a non-negative dimension; ignored.`);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
(style as Record<string, unknown>)[key] = toCss(value);
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
constraint(item?.minWidth, 'minWidth');
|
|
351
|
+
constraint(item?.maxWidth, 'maxWidth');
|
|
352
|
+
constraint(item?.minHeight, 'minHeight');
|
|
353
|
+
constraint(item?.maxHeight, 'maxHeight');
|
|
354
|
+
|
|
355
|
+
/*
|
|
356
|
+
"`minItemWidth` is parent default minimum" - a default the child's own
|
|
357
|
+
`minWidth` overrides.
|
|
358
|
+
*/
|
|
359
|
+
if (
|
|
360
|
+
horizontal &&
|
|
361
|
+
item?.minWidth === undefined &&
|
|
362
|
+
minItemWidth !== undefined &&
|
|
363
|
+
isDimension(minItemWidth)
|
|
364
|
+
) {
|
|
365
|
+
style.minWidth = toCss(minItemWidth);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return { style, diagnostics };
|
|
369
|
+
};
|