@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,123 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
usePathErrorIndicator,
|
|
4
|
+
useCollectionErrors,
|
|
5
|
+
} from '../validation/errorSummary';
|
|
6
|
+
import { useI18n } from '../locale/translate';
|
|
7
|
+
|
|
8
|
+
export const CollectionErrorNavigation = ({
|
|
9
|
+
path,
|
|
10
|
+
reveal,
|
|
11
|
+
renderAction,
|
|
12
|
+
options,
|
|
13
|
+
}: {
|
|
14
|
+
options?: Record<string, any>;
|
|
15
|
+
path: string;
|
|
16
|
+
reveal: (index: number) => void;
|
|
17
|
+
renderAction?: (
|
|
18
|
+
label: string,
|
|
19
|
+
onClick: () => void,
|
|
20
|
+
icon: React.ReactNode,
|
|
21
|
+
) => React.ReactNode;
|
|
22
|
+
}) => {
|
|
23
|
+
const errors = useCollectionErrors(path);
|
|
24
|
+
const message = usePathErrorIndicator(path, options);
|
|
25
|
+
const t = useI18n();
|
|
26
|
+
if (!errors.count) return null;
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
role='status'
|
|
30
|
+
style={{
|
|
31
|
+
display: 'flex',
|
|
32
|
+
gap: 8,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
flexWrap: 'wrap',
|
|
35
|
+
paddingBlock: 8,
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<span style={{ whiteSpace: 'pre-line' }}>{message}</span>
|
|
39
|
+
{errors.firstIndex !== undefined &&
|
|
40
|
+
(renderAction ? (
|
|
41
|
+
renderAction(
|
|
42
|
+
t('collection.firstError'),
|
|
43
|
+
() => reveal(errors.firstIndex!),
|
|
44
|
+
<FirstErrorIcon />,
|
|
45
|
+
)
|
|
46
|
+
) : (
|
|
47
|
+
<button
|
|
48
|
+
type='button'
|
|
49
|
+
title={t('collection.firstError')}
|
|
50
|
+
aria-label={t('collection.firstError')}
|
|
51
|
+
style={{
|
|
52
|
+
color: 'inherit',
|
|
53
|
+
background: 'transparent',
|
|
54
|
+
border: '1px solid currentColor',
|
|
55
|
+
borderRadius: 4,
|
|
56
|
+
width: 28,
|
|
57
|
+
height: 28,
|
|
58
|
+
display: 'inline-grid',
|
|
59
|
+
placeItems: 'center',
|
|
60
|
+
cursor: 'pointer',
|
|
61
|
+
}}
|
|
62
|
+
onClick={() => reveal(errors.firstIndex!)}
|
|
63
|
+
>
|
|
64
|
+
<FirstErrorIcon />
|
|
65
|
+
</button>
|
|
66
|
+
))}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const RowErrorCount = ({
|
|
72
|
+
path,
|
|
73
|
+
index,
|
|
74
|
+
renderIndicator,
|
|
75
|
+
}: {
|
|
76
|
+
path: string;
|
|
77
|
+
index: number;
|
|
78
|
+
renderIndicator?: (message: string) => React.ReactNode;
|
|
79
|
+
}) => {
|
|
80
|
+
const errors = useCollectionErrors(path);
|
|
81
|
+
const t = useI18n();
|
|
82
|
+
const count = errors.rowCount(index);
|
|
83
|
+
if (!count) return null;
|
|
84
|
+
const message = t(
|
|
85
|
+
count === 1 ? 'validation.containerError' : 'validation.containerErrors',
|
|
86
|
+
{ count },
|
|
87
|
+
);
|
|
88
|
+
return renderIndicator ? (
|
|
89
|
+
<>{renderIndicator(message)}</>
|
|
90
|
+
) : (
|
|
91
|
+
<span role='img' aria-label={message} title={message}>
|
|
92
|
+
<svg
|
|
93
|
+
width='16'
|
|
94
|
+
height='16'
|
|
95
|
+
viewBox='0 0 24 24'
|
|
96
|
+
fill='none'
|
|
97
|
+
stroke='currentColor'
|
|
98
|
+
strokeWidth='2'
|
|
99
|
+
aria-hidden='true'
|
|
100
|
+
>
|
|
101
|
+
<circle cx='12' cy='12' r='9' />
|
|
102
|
+
<path d='M12 7v6m0 3v1' />
|
|
103
|
+
</svg>
|
|
104
|
+
</span>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const FirstErrorIcon = () => (
|
|
109
|
+
<svg
|
|
110
|
+
width='16'
|
|
111
|
+
height='16'
|
|
112
|
+
viewBox='0 0 24 24'
|
|
113
|
+
fill='none'
|
|
114
|
+
stroke='currentColor'
|
|
115
|
+
strokeWidth='2'
|
|
116
|
+
strokeLinecap='round'
|
|
117
|
+
strokeLinejoin='round'
|
|
118
|
+
aria-hidden='true'
|
|
119
|
+
focusable='false'
|
|
120
|
+
>
|
|
121
|
+
<path d='M4 12h14M12 6l6 6-6 6M21 4v16' />
|
|
122
|
+
</svg>
|
|
123
|
+
);
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getControlPath,
|
|
3
|
+
JsonSchema,
|
|
4
|
+
Resolve,
|
|
5
|
+
Tester,
|
|
6
|
+
UISchemaElement,
|
|
7
|
+
} from '@jsonforms/core';
|
|
8
|
+
import type { ErrorObject } from 'ajv';
|
|
9
|
+
import isEqual from 'lodash/isEqual';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Array-choice selection and mutation, with no React in it.
|
|
13
|
+
*
|
|
14
|
+
* The specification's "multi-choice identity, applicability, and safe removal"
|
|
15
|
+
* rules are all about *which value* an interaction refers to, which is decidable
|
|
16
|
+
* from the data alone - so it is settled here and tested without rendering.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export interface ArrayChoice {
|
|
20
|
+
value: unknown;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Attribute direct item errors to their displayed pill without treating them as array errors. */
|
|
25
|
+
export const arrayChoiceItemErrors = (
|
|
26
|
+
errors: readonly ErrorObject[],
|
|
27
|
+
path: string,
|
|
28
|
+
length: number,
|
|
29
|
+
): ErrorObject[][] => {
|
|
30
|
+
const result: ErrorObject[][] = Array.from({ length }, () => []);
|
|
31
|
+
const prefix = path ? `${path}.` : '';
|
|
32
|
+
for (const error of errors) {
|
|
33
|
+
const target = getControlPath(error);
|
|
34
|
+
if (!target.startsWith(prefix)) continue;
|
|
35
|
+
const relative = target.slice(prefix.length);
|
|
36
|
+
if (!/^(0|[1-9]\d*)$/.test(relative)) continue;
|
|
37
|
+
result[Number(relative)]?.push(error);
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** The item schema, with a `$ref` followed. */
|
|
43
|
+
export const resolveItemSchema = (
|
|
44
|
+
schema: JsonSchema | undefined,
|
|
45
|
+
rootSchema: JsonSchema,
|
|
46
|
+
): JsonSchema | undefined => {
|
|
47
|
+
const items = schema?.items;
|
|
48
|
+
if (!items || Array.isArray(items) || typeof items === 'boolean') {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
const resolved = items as JsonSchema;
|
|
52
|
+
return resolved.$ref
|
|
53
|
+
? (Resolve.schema(rootSchema, resolved.$ref, rootSchema) ?? resolved)
|
|
54
|
+
: resolved;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The permitted values, or `undefined` when the items are not a finite choice.
|
|
59
|
+
*
|
|
60
|
+
* **String choices only.** The specification is explicit that "recognizing item
|
|
61
|
+
* oneOf branches containing const is not by itself evidence of support for
|
|
62
|
+
* object or array constants", and that a tester "must match only choice value
|
|
63
|
+
* types that its selection, addition, and removal logic supports". These
|
|
64
|
+
* renderers compare with `isEqual` and render labels as text, which is honest
|
|
65
|
+
* for strings and would be a bluff for structured constants - so those are left
|
|
66
|
+
* to a renderer that can edit them.
|
|
67
|
+
*/
|
|
68
|
+
export const arrayChoicesOf = (
|
|
69
|
+
itemSchema: JsonSchema | undefined,
|
|
70
|
+
): ArrayChoice[] | undefined => {
|
|
71
|
+
if (!itemSchema) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
if (Array.isArray(itemSchema.enum)) {
|
|
75
|
+
if (!itemSchema.enum.every((value) => typeof value === 'string')) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return itemSchema.enum.map((value) => ({
|
|
79
|
+
value,
|
|
80
|
+
label: String(value),
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
const branches = itemSchema.oneOf as JsonSchema[] | undefined;
|
|
84
|
+
if (Array.isArray(branches) && branches.length > 0) {
|
|
85
|
+
if (!branches.every((branch) => typeof branch?.const === 'string')) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
return branches.map((branch) => ({
|
|
89
|
+
value: branch.const,
|
|
90
|
+
// A branch title is the label; the constant stays the stored value.
|
|
91
|
+
label: branch.title ?? String(branch.const),
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return undefined;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** Whether the items are homogeneous strings, finite or not. */
|
|
98
|
+
export const hasStringItems = (itemSchema: JsonSchema | undefined): boolean =>
|
|
99
|
+
itemSchema?.type === 'string' ||
|
|
100
|
+
(Array.isArray(itemSchema?.type) &&
|
|
101
|
+
itemSchema?.type.length === 1 &&
|
|
102
|
+
itemSchema.type[0] === 'string');
|
|
103
|
+
|
|
104
|
+
const optionIsVariant = (uischema: UISchemaElement, variant: string) =>
|
|
105
|
+
(uischema as { options?: Record<string, unknown> }).options?.variant ===
|
|
106
|
+
variant;
|
|
107
|
+
|
|
108
|
+
const arraySchemaAt = (
|
|
109
|
+
uischema: UISchemaElement,
|
|
110
|
+
schema: JsonSchema,
|
|
111
|
+
rootSchema: JsonSchema,
|
|
112
|
+
): JsonSchema | undefined => {
|
|
113
|
+
const scope = (uischema as { scope?: string }).scope;
|
|
114
|
+
if (!scope) {
|
|
115
|
+
return schema;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
return Resolve.schema(schema, scope, rootSchema ?? schema) ?? schema;
|
|
119
|
+
} catch {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* `variant: "multi-select"` over the same shapes the automatic checkbox group
|
|
126
|
+
* matches: a unique-item array of finite string choices.
|
|
127
|
+
*
|
|
128
|
+
* "Explicit selection takes precedence over automatic checkboxes", so this
|
|
129
|
+
* ranks above `EnumArrayRenderer`.
|
|
130
|
+
*/
|
|
131
|
+
export const isMultiSelectControl: Tester = (uischema, schema, context) => {
|
|
132
|
+
if (!optionIsVariant(uischema, 'multi-select')) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
const resolved = arraySchemaAt(
|
|
136
|
+
uischema,
|
|
137
|
+
schema,
|
|
138
|
+
context?.rootSchema ?? schema,
|
|
139
|
+
);
|
|
140
|
+
if (resolved?.type !== 'array' || resolved.uniqueItems !== true) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
const items = resolveItemSchema(resolved, context?.rootSchema ?? schema);
|
|
144
|
+
return arrayChoicesOf(items) !== undefined;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* `variant: "chips"` over an array of homogeneous strings, whether or not a
|
|
149
|
+
* finite choice list narrows them. `uniqueItems` is *not* required: without it,
|
|
150
|
+
* repeated tokens are permitted, which is the difference the specification
|
|
151
|
+
* draws between chips and a multi-select.
|
|
152
|
+
*/
|
|
153
|
+
export const isChipsControl: Tester = (uischema, schema, context) => {
|
|
154
|
+
if (!optionIsVariant(uischema, 'chips')) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
const resolved = arraySchemaAt(
|
|
158
|
+
uischema,
|
|
159
|
+
schema,
|
|
160
|
+
context?.rootSchema ?? schema,
|
|
161
|
+
);
|
|
162
|
+
if (resolved?.type !== 'array' || Array.isArray(resolved.items)) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
const items = resolveItemSchema(resolved, context?.rootSchema ?? schema);
|
|
166
|
+
return hasStringItems(items) || arrayChoicesOf(items) !== undefined;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/** The current value as an array, without inventing one. */
|
|
170
|
+
export const asArrayValue = (data: unknown): unknown[] =>
|
|
171
|
+
Array.isArray(data) ? data : [];
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Value identity for selection, duplicate prevention and removal.
|
|
175
|
+
*
|
|
176
|
+
* `isEqual` rather than `===` so a structured constant loaded as a different
|
|
177
|
+
* object instance still matches its choice, and rather than `String(value)` so
|
|
178
|
+
* numeric `1` and string `"1"` stay apart - both of which the specification
|
|
179
|
+
* calls out by name.
|
|
180
|
+
*/
|
|
181
|
+
export const sameChoice = (a: unknown, b: unknown): boolean => isEqual(a, b);
|
|
182
|
+
|
|
183
|
+
export const isSelected = (values: unknown[], value: unknown): boolean =>
|
|
184
|
+
values.some((entry) => sameChoice(entry, value));
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Adds a value, appending in interaction order.
|
|
188
|
+
*
|
|
189
|
+
* `unique` refuses a duplicate rather than silently collapsing one, so a
|
|
190
|
+
* `uniqueItems` array cannot be pushed into an invalid state by this control
|
|
191
|
+
* while a free-entry chips field can still repeat a token.
|
|
192
|
+
*/
|
|
193
|
+
export const addChoice = (
|
|
194
|
+
values: unknown[],
|
|
195
|
+
value: unknown,
|
|
196
|
+
unique: boolean,
|
|
197
|
+
): unknown[] =>
|
|
198
|
+
unique && isSelected(values, value) ? values : [...values, value];
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Removes **one occurrence**, identified by position when given.
|
|
202
|
+
*
|
|
203
|
+
* The specification: "in presentations allowing repeated values, removal must
|
|
204
|
+
* identify the intended occurrence", and "a removal request for a value that is
|
|
205
|
+
* no longer present must not change unrelated items" - so a missing target
|
|
206
|
+
* returns the array untouched rather than falling back to an index, which would
|
|
207
|
+
* delete somebody else's value.
|
|
208
|
+
*/
|
|
209
|
+
export const removeChoiceAt = (values: unknown[], index: number): unknown[] =>
|
|
210
|
+
index < 0 || index >= values.length
|
|
211
|
+
? values
|
|
212
|
+
: values.filter((_, position) => position !== index);
|
|
213
|
+
|
|
214
|
+
export const removeChoice = (values: unknown[], value: unknown): unknown[] =>
|
|
215
|
+
removeChoiceAt(
|
|
216
|
+
values,
|
|
217
|
+
values.findIndex((entry) => sameChoice(entry, value)),
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
export interface ArrayChoiceLimits {
|
|
221
|
+
minItems?: number;
|
|
222
|
+
maxItems?: number;
|
|
223
|
+
/** False lets the validator report a breach instead of preventing it. */
|
|
224
|
+
restrict: boolean;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export const canAddChoice = (
|
|
228
|
+
values: unknown[],
|
|
229
|
+
{ maxItems, restrict }: ArrayChoiceLimits,
|
|
230
|
+
): boolean => !restrict || maxItems === undefined || values.length < maxItems;
|
|
231
|
+
|
|
232
|
+
export const canRemoveChoice = (
|
|
233
|
+
values: unknown[],
|
|
234
|
+
{ minItems, restrict }: ArrayChoiceLimits,
|
|
235
|
+
): boolean => !restrict || minItems === undefined || values.length > minItems;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { PendingChange } from '../interaction/pendingChanges';
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
export type PaginationOption =
|
|
5
|
+
| boolean
|
|
6
|
+
| { pageSize?: number; pageSizeOptions?: number[] };
|
|
7
|
+
export const resolvePagination = (
|
|
8
|
+
local: PaginationOption | undefined,
|
|
9
|
+
config: any,
|
|
10
|
+
kind: 'array' | 'additionalProperties' | 'additionalItems',
|
|
11
|
+
defaultEnabled = true,
|
|
12
|
+
) => {
|
|
13
|
+
const option =
|
|
14
|
+
local ?? config?.jsonformsExtended?.[kind]?.pagination ?? defaultEnabled;
|
|
15
|
+
const settings = typeof option === 'object' ? option : {};
|
|
16
|
+
const size =
|
|
17
|
+
Number.isInteger(settings.pageSize) && settings.pageSize! > 0
|
|
18
|
+
? settings.pageSize!
|
|
19
|
+
: 5;
|
|
20
|
+
const choices = [
|
|
21
|
+
...new Set([
|
|
22
|
+
...(settings.pageSizeOptions ?? [5, 10, 25, 50]).filter(
|
|
23
|
+
(n) => Number.isInteger(n) && n > 0,
|
|
24
|
+
),
|
|
25
|
+
size,
|
|
26
|
+
]),
|
|
27
|
+
].sort((a, b) => a - b);
|
|
28
|
+
return { enabled: option !== false, size, choices };
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const useCollectionPagination = (
|
|
32
|
+
keys: readonly (string | number)[],
|
|
33
|
+
local: PaginationOption | undefined,
|
|
34
|
+
config: any,
|
|
35
|
+
kind: 'array' | 'additionalProperties' | 'additionalItems',
|
|
36
|
+
defaultEnabled = true,
|
|
37
|
+
) => {
|
|
38
|
+
const pending = useMemo(() => new Set<PendingChange>(), []);
|
|
39
|
+
const resolved = resolvePagination(local, config, kind, defaultEnabled);
|
|
40
|
+
const [size, setSize] = useState(resolved.size);
|
|
41
|
+
const [page, setPage] = useState(1);
|
|
42
|
+
const keySnapshot = JSON.stringify(keys);
|
|
43
|
+
const [previous, setPrevious] = useState({
|
|
44
|
+
keySnapshot,
|
|
45
|
+
size: resolved.size,
|
|
46
|
+
enabled: resolved.enabled,
|
|
47
|
+
});
|
|
48
|
+
const pages = Math.max(1, Math.ceil(keys.length / size));
|
|
49
|
+
if (
|
|
50
|
+
previous.size !== resolved.size ||
|
|
51
|
+
previous.enabled !== resolved.enabled
|
|
52
|
+
) {
|
|
53
|
+
setPrevious({
|
|
54
|
+
keySnapshot,
|
|
55
|
+
size: resolved.size,
|
|
56
|
+
enabled: resolved.enabled,
|
|
57
|
+
});
|
|
58
|
+
setSize(resolved.size);
|
|
59
|
+
setPage(1);
|
|
60
|
+
} else if (previous.keySnapshot !== keySnapshot) {
|
|
61
|
+
const previousKeys = JSON.parse(previous.keySnapshot) as (
|
|
62
|
+
| string
|
|
63
|
+
| number
|
|
64
|
+
)[];
|
|
65
|
+
const added = keys.findIndex((key) => !previousKeys.includes(key));
|
|
66
|
+
setPrevious({ ...previous, keySnapshot });
|
|
67
|
+
setPage(
|
|
68
|
+
keys.length > previousKeys.length && added >= 0
|
|
69
|
+
? Math.floor(added / size) + 1
|
|
70
|
+
: Math.min(page, pages),
|
|
71
|
+
);
|
|
72
|
+
} else if (page > pages) {
|
|
73
|
+
setPage(pages);
|
|
74
|
+
}
|
|
75
|
+
const current = Math.min(page, pages);
|
|
76
|
+
const start = resolved.enabled ? (current - 1) * size : 0;
|
|
77
|
+
return {
|
|
78
|
+
pending,
|
|
79
|
+
enabled: resolved.enabled,
|
|
80
|
+
current,
|
|
81
|
+
size,
|
|
82
|
+
total: keys.length,
|
|
83
|
+
pages,
|
|
84
|
+
choices: resolved.choices,
|
|
85
|
+
indices: keys
|
|
86
|
+
.map((_, i) => i)
|
|
87
|
+
.slice(start, resolved.enabled ? start + size : undefined),
|
|
88
|
+
change: (nextPage: number, nextSize = size) => {
|
|
89
|
+
pending.forEach((change) => change.flush());
|
|
90
|
+
setPage(nextSize === size ? nextPage : Math.floor(start / nextSize) + 1);
|
|
91
|
+
setSize(nextSize);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
export type CollectionPage = ReturnType<typeof useCollectionPagination>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { useI18n } from '../locale/translate';
|
|
3
|
+
import { TableColumnDefinition } from './tableColumns';
|
|
4
|
+
|
|
5
|
+
export const useColumnWidths = () => useState<Record<string, number>>({});
|
|
6
|
+
|
|
7
|
+
/** Pointer and keyboard interaction shared by native table header integrations. */
|
|
8
|
+
export const ColumnResizeHandle = ({
|
|
9
|
+
field,
|
|
10
|
+
definition,
|
|
11
|
+
width,
|
|
12
|
+
onResize,
|
|
13
|
+
onResizeStart,
|
|
14
|
+
colors,
|
|
15
|
+
}: {
|
|
16
|
+
colors: { border: string; active: string; focus: string };
|
|
17
|
+
field: string;
|
|
18
|
+
definition?: TableColumnDefinition;
|
|
19
|
+
width?: number;
|
|
20
|
+
onResize: (width: number) => void;
|
|
21
|
+
onResizeStart?: (widths: Record<string, number>) => void;
|
|
22
|
+
}) => {
|
|
23
|
+
const t = useI18n();
|
|
24
|
+
const [hovered, setHovered] = useState(false);
|
|
25
|
+
const [resizing, setResizing] = useState(false);
|
|
26
|
+
const [focused, setFocused] = useState(false);
|
|
27
|
+
const drag = useRef<{ x: number; width: number; direction: number }>();
|
|
28
|
+
const min = definition?.minWidth ?? 48;
|
|
29
|
+
const max = Math.max(min, definition?.maxWidth ?? 2000);
|
|
30
|
+
const clamp = (value: number) => Math.min(max, Math.max(min, value));
|
|
31
|
+
const measured = (element: HTMLElement) =>
|
|
32
|
+
element.closest('th')?.getBoundingClientRect().width ||
|
|
33
|
+
width ||
|
|
34
|
+
definition?.width ||
|
|
35
|
+
160;
|
|
36
|
+
const start = (element: HTMLElement) => {
|
|
37
|
+
const widths: Record<string, number> = {};
|
|
38
|
+
element
|
|
39
|
+
.closest('table')
|
|
40
|
+
?.querySelectorAll<HTMLElement>('thead th')
|
|
41
|
+
.forEach((cell, index) => {
|
|
42
|
+
const value = cell.getBoundingClientRect().width;
|
|
43
|
+
if (value > 0)
|
|
44
|
+
widths[
|
|
45
|
+
cell.dataset.columnKey ??
|
|
46
|
+
(index === 0 ? '__selection' : '__actions')
|
|
47
|
+
] = value;
|
|
48
|
+
});
|
|
49
|
+
if (Object.keys(widths).length) onResizeStart?.(widths);
|
|
50
|
+
};
|
|
51
|
+
return (
|
|
52
|
+
<span
|
|
53
|
+
role='separator'
|
|
54
|
+
aria-orientation='vertical'
|
|
55
|
+
tabIndex={0}
|
|
56
|
+
aria-label={t('collection.resizeColumn', { field })}
|
|
57
|
+
aria-valuemin={min}
|
|
58
|
+
aria-valuemax={max}
|
|
59
|
+
aria-valuenow={Math.round(clamp(width ?? definition?.width ?? 160))}
|
|
60
|
+
style={{
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
insetInlineEnd: 0,
|
|
63
|
+
top: 0,
|
|
64
|
+
bottom: 0,
|
|
65
|
+
width: 8,
|
|
66
|
+
cursor: 'col-resize',
|
|
67
|
+
touchAction: 'none',
|
|
68
|
+
outline: focused ? `2px solid ${colors.focus}` : 'none',
|
|
69
|
+
outlineOffset: -2,
|
|
70
|
+
}}
|
|
71
|
+
onPointerEnter={() => setHovered(true)}
|
|
72
|
+
onPointerLeave={() => setHovered(false)}
|
|
73
|
+
onFocus={(event) =>
|
|
74
|
+
setFocused(event.currentTarget.matches(':focus-visible'))
|
|
75
|
+
}
|
|
76
|
+
onBlur={() => setFocused(false)}
|
|
77
|
+
onClick={(event) => event.stopPropagation()}
|
|
78
|
+
onPointerDown={(event) => {
|
|
79
|
+
if (event.button !== 0) return;
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
event.stopPropagation();
|
|
82
|
+
event.currentTarget.focus();
|
|
83
|
+
setResizing(true);
|
|
84
|
+
start(event.currentTarget);
|
|
85
|
+
drag.current = {
|
|
86
|
+
x: event.clientX,
|
|
87
|
+
width: measured(event.currentTarget),
|
|
88
|
+
direction:
|
|
89
|
+
getComputedStyle(event.currentTarget).direction === 'rtl' ? -1 : 1,
|
|
90
|
+
};
|
|
91
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
92
|
+
}}
|
|
93
|
+
onPointerMove={(event) => {
|
|
94
|
+
if (drag.current)
|
|
95
|
+
onResize(
|
|
96
|
+
clamp(
|
|
97
|
+
drag.current.width +
|
|
98
|
+
(event.clientX - drag.current.x) * drag.current.direction,
|
|
99
|
+
),
|
|
100
|
+
);
|
|
101
|
+
}}
|
|
102
|
+
onPointerUp={(event) => {
|
|
103
|
+
drag.current = undefined;
|
|
104
|
+
setResizing(false);
|
|
105
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId))
|
|
106
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
107
|
+
}}
|
|
108
|
+
onPointerCancel={() => {
|
|
109
|
+
drag.current = undefined;
|
|
110
|
+
setResizing(false);
|
|
111
|
+
}}
|
|
112
|
+
onLostPointerCapture={() => {
|
|
113
|
+
drag.current = undefined;
|
|
114
|
+
setResizing(false);
|
|
115
|
+
}}
|
|
116
|
+
onKeyDown={(event) => {
|
|
117
|
+
if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
|
|
118
|
+
return;
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
event.stopPropagation();
|
|
121
|
+
start(event.currentTarget);
|
|
122
|
+
const direction =
|
|
123
|
+
getComputedStyle(event.currentTarget).direction === 'rtl' ? -1 : 1;
|
|
124
|
+
onResize(
|
|
125
|
+
clamp(
|
|
126
|
+
event.key === 'Home'
|
|
127
|
+
? min
|
|
128
|
+
: event.key === 'End'
|
|
129
|
+
? max
|
|
130
|
+
: measured(event.currentTarget) +
|
|
131
|
+
(event.key === 'ArrowRight' ? 10 : -10) * direction,
|
|
132
|
+
),
|
|
133
|
+
);
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
<span
|
|
137
|
+
aria-hidden='true'
|
|
138
|
+
style={{
|
|
139
|
+
position: 'absolute',
|
|
140
|
+
insetInlineEnd: 0,
|
|
141
|
+
top: '25%',
|
|
142
|
+
bottom: '25%',
|
|
143
|
+
width: resizing || hovered || focused ? 2 : 1,
|
|
144
|
+
backgroundColor:
|
|
145
|
+
resizing || hovered || focused ? colors.active : colors.border,
|
|
146
|
+
pointerEvents: 'none',
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
</span>
|
|
150
|
+
);
|
|
151
|
+
};
|