@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,33 @@
|
|
|
1
|
+
import e, { createContext as t, useContext as n, useMemo as r } from "react";
|
|
2
|
+
import { UPDATE_DATA as i, createDefaultValue as a } from "@jsonforms/core";
|
|
3
|
+
import { JsonFormsContext as o, useJsonForms as s } from "@jsonforms/react";
|
|
4
|
+
// src/objects/dynamicProperties.tsx
|
|
5
|
+
var c = t(void 0), l = ({ path: t, schema: n, rootSchema: a, children: l }) => {
|
|
6
|
+
let u = s(), f = r(() => ({
|
|
7
|
+
...u,
|
|
8
|
+
dispatch: (e) => {
|
|
9
|
+
if (n && e.type === i && e.path === t) {
|
|
10
|
+
var r;
|
|
11
|
+
(r = u.dispatch) == null || r.call(u, {
|
|
12
|
+
...e,
|
|
13
|
+
updater: (t) => {
|
|
14
|
+
let r = e.updater(t);
|
|
15
|
+
return r === void 0 ? d(n, a ?? n, t) : r;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
var o;
|
|
20
|
+
(o = u.dispatch) == null || o.call(u, e);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}), [
|
|
24
|
+
u,
|
|
25
|
+
t,
|
|
26
|
+
n,
|
|
27
|
+
a
|
|
28
|
+
]);
|
|
29
|
+
return /* @__PURE__ */ e.createElement(c.Provider, { value: t }, /* @__PURE__ */ e.createElement(o.Provider, { value: n ? f : u }, l));
|
|
30
|
+
}, u = (e) => n(c) === e, d = (e, t, n) => e.type === "string" || typeof n == "string" ? "" : a(e, t) ?? n;
|
|
31
|
+
export { l as DynamicPropertyProvider, d as clearedDynamicPropertyValue, u as useDynamicProperty };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=dynamicProperties.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamicProperties.esm.js","names":["React","DynamicPropertyPath","createContext","DynamicPropertyProvider","parent","useJsonForms","context","useMemo","schema","action","UPDATE_DATA","path","_parent$dispatch","value","previous","clearedDynamicPropertyValue","rootSchema","_parent$dispatch2","JsonFormsContext","children","useDynamicProperty","useContext","createDefaultValue"],"sources":["../../src/objects/dynamicProperties.tsx"],"sourcesContent":["import { createDefaultValue, JsonSchema, UPDATE_DATA } from '@jsonforms/core';\nimport { JsonFormsContext, useJsonForms } from '@jsonforms/react';\n\nimport React, { createContext, useContext, useMemo } from 'react';\n\nconst DynamicPropertyPath = createContext<string | undefined>(undefined);\n\nexport const DynamicPropertyProvider = ({\n path,\n schema,\n rootSchema,\n children,\n}: React.PropsWithChildren<{\n path: string;\n schema?: JsonSchema;\n rootSchema?: JsonSchema;\n}>) => {\n const parent = useJsonForms();\n const context = useMemo(\n () => ({\n ...parent,\n dispatch: (\n action: Parameters<NonNullable<typeof parent.dispatch>>[0],\n ) => {\n // Protect only this property's own value. Nested fields and the\n // collection's explicit Delete update their respective paths normally.\n if (schema && action.type === UPDATE_DATA && action.path === path) {\n parent.dispatch?.({\n ...action,\n updater: (previous) => {\n const value = action.updater(previous);\n return value === undefined\n ? clearedDynamicPropertyValue(\n schema,\n rootSchema ?? schema,\n previous,\n )\n : value;\n },\n });\n } else {\n parent.dispatch?.(action);\n }\n },\n }),\n [parent, path, schema, rootSchema],\n );\n return (\n <DynamicPropertyPath.Provider value={path}>\n <JsonFormsContext.Provider value={schema ? context : parent}>\n {children}\n </JsonFormsContext.Provider>\n </DynamicPropertyPath.Provider>\n );\n};\n\n/** Only the property itself is protected; its nested fields clear normally. */\nexport const useDynamicProperty = (path: string): boolean =>\n useContext(DynamicPropertyPath) === path;\n\nexport const clearedDynamicPropertyValue = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n previous?: unknown,\n): unknown =>\n schema.type === 'string' || typeof previous === 'string'\n ? ''\n : (createDefaultValue(schema, rootSchema) ?? previous);\n"],"mappings":";;;;AAKA,IAAMC,IAAsBC,EAAkC,KAAA,CAAS,GAE1DC,KAA2B,EACtC,SACA,WACA,eACA,kBAKK;CACL,IAAMC,IAASC,EAAa,GACtBC,IAAUC,SACP;EACL,GAAGH;EACH,WACE,MACG;GAGH,IAAII,KAAUC,EAAO,SAASC,KAAeD,EAAO,SAASE,GAAM;;IACjE,CAAA,IAAAP,EAAO,aAAA,QAAAQ,EAAA,KAAAR,GAAW;KAChB,GAAGK;KACH,UAAU,MAAa;MACrB,IAAMI,IAAQJ,EAAO,QAAQK,CAAQ;MACrC,OAAOD,MAAU,KAAA,IACbE,EACEP,GACAQ,KAAcR,GACdM,CACF,IACAD;KACN;IACF,CAAC;GACH,OAAO;;IACL,CAAA,IAAAT,EAAO,aAAA,QAAAa,EAAA,KAAAb,GAAWK,CAAM;GAC1B;EACF;CACF,IACA;EAACL;EAAQO;EAAMH;EAAQQ;CAAU,CACnC;CACA,OACE,kBAAA,cAACf,EAAoB,UAArB,EAA8B,OAAOU,EAIP,GAH5B,kBAAA,cAACO,EAAiB,UAAlB,EAA2B,OAAOV,IAASF,IAAUF,EAE1B,GADxBe,CACwB,CACC;AAElC,GAGaC,KAAsB,MACjCC,EAAWpB,CAAmB,MAAMU,GAEzBI,KACX,GACA,GACA,MAEAP,EAAO,SAAS,YAAY,OAAOM,KAAa,WAC5C,KACCQ,EAAmBd,GAAQQ,CAAU,KAAKF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new Set([`properties`,`patternProperties`,`definitions`,`$defs`,`dependentSchemas`]),t=new Set([`additionalProperties`,`additionalItems`,`contains`,`propertyNames`,`not`,`if`,`then`,`else`,`unevaluatedProperties`,`unevaluatedItems`]),n=new Set([`allOf`,`anyOf`,`oneOf`,`prefixItems`]),r=`#/definitions/__jsonforms_root`,i=a=>!a||typeof a!=`object`||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).map(([a,o])=>a===`$ref`&&typeof o==`string`&&(o===`#`||o.startsWith(`#/`))?[a,`${r}${o.slice(1)}`]:e.has(a)||a===`dependencies`?[a,Object.fromEntries(Object.entries(o??{}).map(([e,t])=>[e,i(t)]))]:t.has(a)?[a,i(o)]:n.has(a)||a===`items`?[a,Array.isArray(o)?o.map(i):i(o)]:[a,o])),a=(e,t)=>{let n=i(t);delete n.$id;let r=i(e);return delete r.$id,{...r,definitions:{...r.definitions,__jsonforms_root:n}}};exports.literalPropertySchema=a;
|
|
2
|
+
//# sourceMappingURL=literalPropertySchema.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literalPropertySchema.cjs.js","names":["source","SCHEMA_MAPS","SCHEMA_VALUES","SCHEMA_ARRAYS","ROOT_POINTER","rewrite","input","key","value","name","child","literalPropertySchema","root","rootSchema","schema"],"sources":["../../src/objects/literalPropertySchema.ts"],"sourcesContent":["import { JsonSchema, JsonSchema7 } from '@jsonforms/core';\n\n/**\n * Rebundles a property's schema so it can stand alone as its own document.\n *\n * An isolated editor gives the property's *value* its own form, which means its\n * own root schema - and that breaks every local `$ref`. A schema saying\n * `{ \"$ref\": \"#/definitions/address\" }` resolves against the document it came\n * from; in a form rooted at the value there is no such definition, so the\n * control fails to resolve and renders nothing.\n *\n * So the original root is carried along under\n * `definitions.__jsonforms_root`, and every local reference is rewritten to\n * point into it. `#/definitions/address` becomes\n * `#/definitions/__jsonforms_root/definitions/address`, and a bare `#` becomes\n * `#/definitions/__jsonforms_root`.\n *\n * Only schema *keywords* are walked. `default`, `const` and `enum` hold data,\n * and data is allowed to contain a `$ref` key that means nothing to a\n * validator - rewriting it would corrupt a value.\n */\n\nconst SCHEMA_MAPS = new Set([\n 'properties',\n 'patternProperties',\n 'definitions',\n '$defs',\n 'dependentSchemas',\n]);\n\nconst SCHEMA_VALUES = new Set([\n 'additionalProperties',\n 'additionalItems',\n 'contains',\n 'propertyNames',\n 'not',\n 'if',\n 'then',\n 'else',\n 'unevaluatedProperties',\n 'unevaluatedItems',\n]);\n\nconst SCHEMA_ARRAYS = new Set(['allOf', 'anyOf', 'oneOf', 'prefixItems']);\n\nconst ROOT_POINTER = '#/definitions/__jsonforms_root';\n\nconst rewrite = (input: unknown): unknown => {\n if (!input || typeof input !== 'object' || Array.isArray(input)) {\n return input;\n }\n const source = input as Record<string, unknown>;\n return Object.fromEntries(\n Object.entries(source).map(([key, value]) => {\n if (\n key === '$ref' &&\n typeof value === 'string' &&\n (value === '#' || value.startsWith('#/'))\n ) {\n return [key, `${ROOT_POINTER}${value.slice(1)}`];\n }\n if (SCHEMA_MAPS.has(key) || key === 'dependencies') {\n return [\n key,\n Object.fromEntries(\n Object.entries((value ?? {}) as Record<string, unknown>).map(\n ([name, child]) => [name, rewrite(child)],\n ),\n ),\n ];\n }\n if (SCHEMA_VALUES.has(key)) {\n return [key, rewrite(value)];\n }\n if (SCHEMA_ARRAYS.has(key) || key === 'items') {\n return [\n key,\n Array.isArray(value) ? value.map(rewrite) : rewrite(value),\n ];\n }\n return [key, value];\n }),\n );\n};\n\nexport const literalPropertySchema = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n): JsonSchema => {\n const root = rewrite(rootSchema) as JsonSchema7;\n // The bundled root is part of this document now, not a separate reference\n // scope, so its own identifier must not follow it in.\n delete root.$id;\n const value = rewrite(schema) as JsonSchema7;\n delete value.$id;\n return {\n ...value,\n definitions: { ...value.definitions, __jsonforms_root: root },\n } as JsonSchema;\n};\n"],"mappings":"A,mEAsBA,IAAMC,EAAc,IAAI,IAAI,CAC1B,aACA,oBACA,cACA,QACA,kBACF,CAAC,EAEKC,EAAgB,IAAI,IAAI,CAC5B,uBACA,kBACA,WACA,gBACA,MACA,KACA,OACA,OACA,wBACA,kBACF,CAAC,EAEKC,EAAgB,IAAI,IAAI,CAAC,QAAS,QAAS,QAAS,aAAa,CAAC,EAElEC,EAAe,iCAEfC,EAAW,GACX,CAACC,GAAS,OAAOA,GAAU,UAAY,MAAM,QAAQA,CAAK,EACrDA,EAGF,OAAO,YACZ,OAAO,QAAQN,CAAM,CAAC,CAAC,KAAK,CAACO,EAAKC,KAE9BD,IAAQ,QACR,OAAOC,GAAU,WAChBA,IAAU,KAAOA,EAAM,WAAW,IAAI,GAEhC,CAACD,EAAK,GAAGH,IAAeI,EAAM,MAAM,CAAC,GAAG,EAE7CP,EAAY,IAAIM,CAAG,GAAKA,IAAQ,eAC3B,CACLA,EACA,OAAO,YACL,OAAO,QAASC,GAAS,CAAC,CAA6B,CAAC,CAAC,KACtD,CAACC,EAAMC,KAAW,CAACD,EAAMJ,EAAQK,CAAK,CAAC,CAC1C,CACF,CACF,EAEER,EAAc,IAAIK,CAAG,EAChB,CAACA,EAAKF,EAAQG,CAAK,CAAC,EAEzBL,EAAc,IAAII,CAAG,GAAKA,IAAQ,QAC7B,CACLA,EACA,MAAM,QAAQC,CAAK,EAAIA,EAAM,IAAIH,CAAO,EAAIA,EAAQG,CAAK,CAC3D,EAEK,CAACD,EAAKC,CAAK,CACnB,CACH,EAGWG,GACX,EACA,IACe,CACf,IAAMC,EAAOP,EAAQQ,CAAU,EAG/B,OAAOD,EAAK,IACZ,IAAMJ,EAAQH,EAAQS,CAAM,EAE5B,OADA,OAAON,EAAM,IACN,CACL,GAAGA,EACH,YAAa,CAAE,GAAGA,EAAM,YAAa,iBAAkBI,CAAK,CAC9D,CACF,E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// src/objects/literalPropertySchema.ts
|
|
2
|
+
var e = /* @__PURE__ */ new Set([
|
|
3
|
+
"properties",
|
|
4
|
+
"patternProperties",
|
|
5
|
+
"definitions",
|
|
6
|
+
"$defs",
|
|
7
|
+
"dependentSchemas"
|
|
8
|
+
]), t = /* @__PURE__ */ new Set([
|
|
9
|
+
"additionalProperties",
|
|
10
|
+
"additionalItems",
|
|
11
|
+
"contains",
|
|
12
|
+
"propertyNames",
|
|
13
|
+
"not",
|
|
14
|
+
"if",
|
|
15
|
+
"then",
|
|
16
|
+
"else",
|
|
17
|
+
"unevaluatedProperties",
|
|
18
|
+
"unevaluatedItems"
|
|
19
|
+
]), n = /* @__PURE__ */ new Set([
|
|
20
|
+
"allOf",
|
|
21
|
+
"anyOf",
|
|
22
|
+
"oneOf",
|
|
23
|
+
"prefixItems"
|
|
24
|
+
]), r = "#/definitions/__jsonforms_root", i = (a) => !a || typeof a != "object" || Array.isArray(a) ? a : Object.fromEntries(Object.entries(a).map(([a, o]) => a === "$ref" && typeof o == "string" && (o === "#" || o.startsWith("#/")) ? [a, `${r}${o.slice(1)}`] : e.has(a) || a === "dependencies" ? [a, Object.fromEntries(Object.entries(o ?? {}).map(([e, t]) => [e, i(t)]))] : t.has(a) ? [a, i(o)] : n.has(a) || a === "items" ? [a, Array.isArray(o) ? o.map(i) : i(o)] : [a, o])), a = (e, t) => {
|
|
25
|
+
let n = i(t);
|
|
26
|
+
delete n.$id;
|
|
27
|
+
let r = i(e);
|
|
28
|
+
return delete r.$id, {
|
|
29
|
+
...r,
|
|
30
|
+
definitions: {
|
|
31
|
+
...r.definitions,
|
|
32
|
+
__jsonforms_root: n
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export { a as literalPropertySchema };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=literalPropertySchema.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literalPropertySchema.esm.js","names":["source","SCHEMA_MAPS","SCHEMA_VALUES","SCHEMA_ARRAYS","ROOT_POINTER","rewrite","input","key","value","name","child","literalPropertySchema","root","rootSchema","schema"],"sources":["../../src/objects/literalPropertySchema.ts"],"sourcesContent":["import { JsonSchema, JsonSchema7 } from '@jsonforms/core';\n\n/**\n * Rebundles a property's schema so it can stand alone as its own document.\n *\n * An isolated editor gives the property's *value* its own form, which means its\n * own root schema - and that breaks every local `$ref`. A schema saying\n * `{ \"$ref\": \"#/definitions/address\" }` resolves against the document it came\n * from; in a form rooted at the value there is no such definition, so the\n * control fails to resolve and renders nothing.\n *\n * So the original root is carried along under\n * `definitions.__jsonforms_root`, and every local reference is rewritten to\n * point into it. `#/definitions/address` becomes\n * `#/definitions/__jsonforms_root/definitions/address`, and a bare `#` becomes\n * `#/definitions/__jsonforms_root`.\n *\n * Only schema *keywords* are walked. `default`, `const` and `enum` hold data,\n * and data is allowed to contain a `$ref` key that means nothing to a\n * validator - rewriting it would corrupt a value.\n */\n\nconst SCHEMA_MAPS = new Set([\n 'properties',\n 'patternProperties',\n 'definitions',\n '$defs',\n 'dependentSchemas',\n]);\n\nconst SCHEMA_VALUES = new Set([\n 'additionalProperties',\n 'additionalItems',\n 'contains',\n 'propertyNames',\n 'not',\n 'if',\n 'then',\n 'else',\n 'unevaluatedProperties',\n 'unevaluatedItems',\n]);\n\nconst SCHEMA_ARRAYS = new Set(['allOf', 'anyOf', 'oneOf', 'prefixItems']);\n\nconst ROOT_POINTER = '#/definitions/__jsonforms_root';\n\nconst rewrite = (input: unknown): unknown => {\n if (!input || typeof input !== 'object' || Array.isArray(input)) {\n return input;\n }\n const source = input as Record<string, unknown>;\n return Object.fromEntries(\n Object.entries(source).map(([key, value]) => {\n if (\n key === '$ref' &&\n typeof value === 'string' &&\n (value === '#' || value.startsWith('#/'))\n ) {\n return [key, `${ROOT_POINTER}${value.slice(1)}`];\n }\n if (SCHEMA_MAPS.has(key) || key === 'dependencies') {\n return [\n key,\n Object.fromEntries(\n Object.entries((value ?? {}) as Record<string, unknown>).map(\n ([name, child]) => [name, rewrite(child)],\n ),\n ),\n ];\n }\n if (SCHEMA_VALUES.has(key)) {\n return [key, rewrite(value)];\n }\n if (SCHEMA_ARRAYS.has(key) || key === 'items') {\n return [\n key,\n Array.isArray(value) ? value.map(rewrite) : rewrite(value),\n ];\n }\n return [key, value];\n }),\n );\n};\n\nexport const literalPropertySchema = (\n schema: JsonSchema,\n rootSchema: JsonSchema,\n): JsonSchema => {\n const root = rewrite(rootSchema) as JsonSchema7;\n // The bundled root is part of this document now, not a separate reference\n // scope, so its own identifier must not follow it in.\n delete root.$id;\n const value = rewrite(schema) as JsonSchema7;\n delete value.$id;\n return {\n ...value,\n definitions: { ...value.definitions, __jsonforms_root: root },\n } as JsonSchema;\n};\n"],"mappings":";AAsBA,IAAMC,oBAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;AACF,CAAC,GAEKC,oBAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAEKC,oBAAgB,IAAI,IAAI;CAAC;CAAS;CAAS;CAAS;AAAa,CAAC,GAElEC,IAAe,kCAEfC,KAAW,MACX,CAACC,KAAS,OAAOA,KAAU,YAAY,MAAM,QAAQA,CAAK,IACrDA,IAGF,OAAO,YACZ,OAAO,QAAQN,CAAM,CAAC,CAAC,KAAK,CAACO,GAAKC,OAE9BD,MAAQ,UACR,OAAOC,KAAU,aAChBA,MAAU,OAAOA,EAAM,WAAW,IAAI,KAEhC,CAACD,GAAK,GAAGH,IAAeI,EAAM,MAAM,CAAC,GAAG,IAE7CP,EAAY,IAAIM,CAAG,KAAKA,MAAQ,iBAC3B,CACLA,GACA,OAAO,YACL,OAAO,QAASC,KAAS,CAAC,CAA6B,CAAC,CAAC,KACtD,CAACC,GAAMC,OAAW,CAACD,GAAMJ,EAAQK,CAAK,CAAC,CAC1C,CACF,CACF,IAEER,EAAc,IAAIK,CAAG,IAChB,CAACA,GAAKF,EAAQG,CAAK,CAAC,IAEzBL,EAAc,IAAII,CAAG,KAAKA,MAAQ,UAC7B,CACLA,GACA,MAAM,QAAQC,CAAK,IAAIA,EAAM,IAAIH,CAAO,IAAIA,EAAQG,CAAK,CAC3D,IAEK,CAACD,GAAKC,CAAK,CACnB,CACH,GAGWG,KACX,GACA,MACe;CACf,IAAMC,IAAOP,EAAQQ,CAAU;CAG/B,OAAOD,EAAK;CACZ,IAAMJ,IAAQH,EAAQS,CAAM;CAE5B,OADA,OAAON,EAAM,KACN;EACL,GAAGA;EACH,aAAa;GAAE,GAAGA,EAAM;GAAa,kBAAkBI;EAAK;CAC9D;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../collections/useCollectionDelete.cjs.js"),t=require("./additionalPropertyName.cjs.js"),n=require("../collections/collectionPagination.cjs.js"),r=require("./additionalProperties.cjs.js");let i=require("react"),a=require("@jsonforms/core");var o=({data:e,schema:t,rootSchema:n,path:a,uischema:o,config:s})=>{let c=r.toObjectSchema(t),l={...s,...o.options},u=typeof e==`object`&&e&&!Array.isArray(e)?e:void 0,d=l.allowAdditionalPropertiesIfMissing===!0&&c.additionalProperties===void 0,f=Object.keys(c.properties??{}),p=Object.keys(u??{}).filter(e=>!f.includes(e)),m=JSON.stringify(p),h=(0,i.useMemo)(()=>JSON.parse(m).map(e=>r.toAdditionalPropertyItem(e,a,t,n,d)),[m,d,a,n,t]),g=r.hasAdditionalProperties(t)||d||p.length>0,_=Object.keys(u??{}).length;return{maxPropertiesReached:c.maxProperties!==void 0&&_>=c.maxProperties&&!!u,minPropertiesReached:c.minProperties!==void 0&&_<=c.minProperties&&!!u,objectSchema:c,appliedOptions:l,objectData:u,allowIfMissing:d,reservedPropertyNames:f,additionalKeys:p,additionalPropertyItems:h,shouldShow:g}},s=e=>{var t;let r=o(e),i=n.useCollectionPagination(r.additionalKeys,(t=e.uischema.options)==null||(t=t.additionalProperties)==null?void 0:t.pagination,e.config,`additionalProperties`);return{...r,page:i}};function c(n,i,{restrict:o,propertyName:s,propertyNameError:c,setNewPropertyName:l}){let{enabled:u,readonly:d,path:f,rootSchema:p,schema:m,uischema:h,config:g,handleChange:_}=n,{objectData:v,objectSchema:y,reservedPropertyNames:b,appliedOptions:x,allowIfMissing:S}=i,C=!u||!!d||o&&i.maxPropertiesReached,w=!u||!!d||o&&i.minPropertiesReached,T=e.useCollectionDelete({data:v,identity:f,catalogId:`additionalProperties`,options:h.options,config:g,canRemove:e=>{var t;return!w&&!x.disableRemove&&!!v&&Object.prototype.hasOwnProperty.call(v,e)&&!b.includes(e)&&!(x.restrict!==!1&&(t=y.required)!=null&&t.includes(e))},value:e=>v==null?void 0:v[e],remove:e=>{let t={...v};delete t[e],_(f,t)}}),E=C||!!c;function D(){if(E)return;let e=r.toAdditionalPropertyItem(s,f,m,p,S);_(f,t.assignOwnProperty({...v},s,(0,a.createDefaultValue)(e.schema,p))),l(``)}return{addPropertyDisabled:E,removePropertyDisabled:w,deletion:T,addProperty:D,removeProperty:T.request}}exports.useAdditionalPropertyActions=c,exports.useAdditionalPropertyEntries=s,exports.useAdditionalPropertyItems=o;
|
|
2
|
+
//# sourceMappingURL=useAdditionalPropertyEntries.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAdditionalPropertyEntries.cjs.js","names":["toObjectSchema","useMemo","toAdditionalPropertyItem","hasAdditionalProperties","useCollectionPagination","useCollectionDelete","assignOwnProperty","createDefaultValue","require_collections_useCollectionDelete","require_objects_additionalPropertyName","require_collections_collectionPagination","require_objects_additionalProperties","react","_jsonforms_core","useAdditionalPropertyItems","objectSchema","schema","appliedOptions","config","uischema","objectData","data","allowIfMissing","reservedPropertyNames","additionalKeys","key","additionalKeySnapshot","additionalPropertyItems","propertyName","path","rootSchema","shouldShow","count","useAdditionalPropertyEntries","_input$uischema$optio","items","input","page","useAdditionalPropertyActions","props","entries","addDisabled","enabled","readonly","restrict","removePropertyDisabled","deletion","_objectSchema$require","updatedData","handleChange","addPropertyDisabled","propertyNameError","addProperty","item","setNewPropertyName"],"sources":["../../src/objects/useAdditionalPropertyEntries.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n createDefaultValue,\n type ControlElement,\n type JsonSchema,\n type JsonFormsCellRendererRegistryEntry,\n type JsonFormsRendererRegistryEntry,\n type JsonFormsUISchemaRegistryEntry,\n} from '@jsonforms/core';\nimport { useCollectionDelete } from '../collections/useCollectionDelete';\nimport { assignOwnProperty } from './additionalPropertyName';\n\nimport { useCollectionPagination } from '../collections/collectionPagination';\nimport {\n hasAdditionalProperties,\n toAdditionalPropertyItem,\n toObjectSchema,\n} from './additionalProperties';\n\nexport type AdditionalPropertiesProps = {\n cells?: JsonFormsCellRendererRegistryEntry[];\n config?: any;\n data: unknown;\n enabled: boolean;\n handleChange(path: string, value: unknown): void;\n label: string;\n path: string;\n readonly?: boolean;\n renderers?: JsonFormsRendererRegistryEntry[];\n rootSchema: JsonSchema;\n schema: JsonSchema;\n uischema: ControlElement;\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n embedded?: boolean;\n};\n\ntype AdditionalPropertyEntriesInput = Pick<\n AdditionalPropertiesProps,\n 'data' | 'schema' | 'rootSchema' | 'path' | 'uischema' | 'config'\n>;\n\n/** Shared property discovery and pagination; renderers own editors and actions. */\nexport const useAdditionalPropertyItems = ({\n data,\n schema,\n rootSchema,\n path,\n uischema,\n config,\n}: AdditionalPropertyEntriesInput) => {\n const objectSchema = toObjectSchema(schema);\n const appliedOptions = { ...config, ...uischema.options };\n const objectData =\n typeof data === 'object' && data !== null && !Array.isArray(data)\n ? (data as Record<string, unknown>)\n : undefined;\n const allowIfMissing =\n appliedOptions.allowAdditionalPropertiesIfMissing === true &&\n objectSchema.additionalProperties === undefined;\n const reservedPropertyNames = Object.keys(objectSchema.properties ?? {});\n const additionalKeys = Object.keys(objectData ?? {}).filter(\n (key) => !reservedPropertyNames.includes(key),\n );\n const additionalKeySnapshot = JSON.stringify(additionalKeys);\n const additionalPropertyItems = useMemo(\n () =>\n (JSON.parse(additionalKeySnapshot) as string[]).map((propertyName) =>\n toAdditionalPropertyItem(\n propertyName,\n path,\n schema,\n rootSchema,\n allowIfMissing,\n ),\n ),\n [additionalKeySnapshot, allowIfMissing, path, rootSchema, schema],\n );\n const shouldShow =\n hasAdditionalProperties(schema) ||\n allowIfMissing ||\n additionalKeys.length > 0;\n const count = Object.keys(objectData ?? {}).length;\n const maxPropertiesReached =\n objectSchema.maxProperties !== undefined &&\n count >= objectSchema.maxProperties &&\n Boolean(objectData);\n const minPropertiesReached =\n objectSchema.minProperties !== undefined &&\n count <= objectSchema.minProperties &&\n Boolean(objectData);\n return {\n maxPropertiesReached,\n minPropertiesReached,\n objectSchema,\n appliedOptions,\n objectData,\n allowIfMissing,\n reservedPropertyNames,\n additionalKeys,\n additionalPropertyItems,\n shouldShow,\n };\n};\n\nexport const useAdditionalPropertyEntries = (\n input: AdditionalPropertyEntriesInput,\n) => {\n const items = useAdditionalPropertyItems(input);\n const page = useCollectionPagination(\n items.additionalKeys,\n input.uischema.options?.additionalProperties?.pagination,\n input.config,\n 'additionalProperties',\n );\n return { ...items, page };\n};\n\nexport function useAdditionalPropertyActions(\n props: AdditionalPropertiesProps,\n entries: ReturnType<typeof useAdditionalPropertyEntries>,\n {\n restrict,\n propertyName,\n propertyNameError,\n setNewPropertyName,\n }: {\n restrict: boolean;\n propertyName: string;\n propertyNameError?: string;\n setNewPropertyName: (name: string) => void;\n },\n) {\n const {\n enabled,\n readonly,\n path,\n rootSchema,\n schema,\n uischema,\n config,\n handleChange,\n } = props;\n const {\n objectData,\n objectSchema,\n reservedPropertyNames,\n appliedOptions,\n allowIfMissing,\n } = entries;\n const addDisabled =\n !enabled || Boolean(readonly) || (restrict && entries.maxPropertiesReached);\n const removePropertyDisabled =\n !enabled || Boolean(readonly) || (restrict && entries.minPropertiesReached);\n const deletion = useCollectionDelete<string>({\n data: objectData,\n identity: path,\n catalogId: 'additionalProperties',\n options: uischema.options,\n config,\n canRemove: (key) =>\n !removePropertyDisabled &&\n !appliedOptions.disableRemove &&\n !!objectData &&\n Object.prototype.hasOwnProperty.call(objectData, key) &&\n !reservedPropertyNames.includes(key) &&\n !(\n appliedOptions.restrict !== false &&\n objectSchema.required?.includes(key)\n ),\n value: (key) => objectData?.[key],\n remove: (key) => {\n const updatedData = { ...objectData };\n delete updatedData[key];\n handleChange(path, updatedData);\n },\n });\n const addPropertyDisabled = addDisabled || Boolean(propertyNameError);\n function addProperty() {\n if (addPropertyDisabled) return;\n const item = toAdditionalPropertyItem(\n propertyName,\n path,\n schema,\n rootSchema,\n allowIfMissing,\n );\n handleChange(\n path,\n assignOwnProperty(\n { ...objectData },\n propertyName,\n createDefaultValue(item.schema, rootSchema),\n ),\n );\n setNewPropertyName('');\n }\n return {\n addPropertyDisabled,\n removePropertyDisabled,\n deletion,\n addProperty,\n removeProperty: deletion.request,\n };\n}\n"],"mappings":"A,oUA0CA,IAAac,GAA8B,CACzC,OACA,SACA,aACA,OACA,WACA,YACoC,CACpC,IAAMC,EAAef,EAAAA,eAAegB,CAAM,EACpCC,EAAiB,CAAE,GAAGC,EAAQ,GAAGC,EAAS,OAAQ,EAClDC,EACJ,OAAOC,GAAS,UAAYA,GAAiB,CAAC,MAAM,QAAQA,CAAI,EAC3DA,EACD,IAAA,GACAC,EACJL,EAAe,qCAAuC,IACtDF,EAAa,uBAAyB,IAAA,GAClCQ,EAAwB,OAAO,KAAKR,EAAa,YAAc,CAAC,CAAC,EACjES,EAAiB,OAAO,KAAKJ,GAAc,CAAC,CAAC,CAAC,CAAC,OAClD,GAAQ,CAACG,EAAsB,SAASE,CAAG,CAC9C,EACMC,EAAwB,KAAK,UAAUF,CAAc,EACrDG,GAAA,EAA0B1B,EAAAA,QAAAA,KAE3B,KAAK,MAAMyB,CAAqB,CAAC,CAAc,IAAK,GACnDxB,EAAAA,yBACE0B,EACAC,EACAb,EACAc,EACAR,CACF,CACF,EACF,CAACI,EAAuBJ,EAAgBO,EAAMC,EAAYd,CAAM,CAClE,EACMe,EACJ5B,EAAAA,wBAAwBa,CAAM,GAC9BM,GACAE,EAAe,OAAS,EACpBQ,EAAQ,OAAO,KAAKZ,GAAc,CAAC,CAAC,CAAC,CAAC,OAS5C,MAAO,CACL,qBARAL,EAAa,gBAAkB,IAAA,IAC/BiB,GAASjB,EAAa,eACtB,EAAQK,EAOR,qBALAL,EAAa,gBAAkB,IAAA,IAC/BiB,GAASjB,EAAa,eACtB,EAAQK,EAIR,eACA,iBACA,aACA,iBACA,wBACA,iBACA,0BACA,YACF,CACF,EAEaa,EACX,GACG,C,MACH,IAAME,EAAQrB,EAA2BsB,CAAK,EACxCC,EAAOjC,EAAAA,wBACX+B,EAAM,gBAAA,EACNC,EAAM,SAAS,UAAA,OAAA,EAAAF,EAAS,uBAAA,KAAA,IAAA,GAAAA,EAAsB,WAC9CE,EAAM,OACN,sBACF,EACA,MAAO,CAAE,GAAGD,EAAO,MAAK,CAC1B,EAEA,SAAgBG,EACd,EACA,EACA,CACE,WACA,eACA,oBACA,sBAOF,CACA,GAAM,CACJ,UACA,WACA,OACA,aACA,SACA,WACA,SACA,gBACEC,EACE,CACJ,aACA,eACA,wBACA,iBACA,kBACEC,EACEC,EACJ,CAACC,GAAW,EAAQC,GAAcC,GAAYJ,EAAQ,qBAClDK,EACJ,CAACH,GAAW,EAAQC,GAAcC,GAAYJ,EAAQ,qBAClDM,EAAWzC,EAAAA,oBAA4B,CAC3C,KAAMe,EACN,SAAUS,EACV,UAAW,uBACX,QAASV,EAAS,QAClB,SACA,UAAY,GACV,C,MAAC,MAAA,CAAA0B,GACD,CAAC5B,EAAe,eAChB,CAAC,CAACG,GACF,OAAO,UAAU,eAAe,KAAKA,EAAYK,CAAG,GACpD,CAACF,EAAsB,SAASE,CAAG,GACnC,EACER,EAAe,WAAa,KAAA,EAC5BF,EAAa,WAAA,MAAAgC,EAAU,SAAStB,CAAG,EAAA,EAEvC,MAAQ,GAAAL,GAAA,KAAA,IAAA,GAAQA,EAAaK,GAC7B,OAAS,GAAQ,CACf,IAAMuB,EAAc,CAAE,GAAG5B,CAAW,EACpC,OAAO4B,EAAYvB,GACnBwB,EAAapB,EAAMmB,CAAW,CAChC,CACF,CAAC,EACKE,EAAsBT,GAAe,EAAQU,EACnD,SAASC,GAAc,CACrB,GAAIF,EAAqB,OACzB,IAAMG,EAAOnD,EAAAA,yBACX0B,EACAC,EACAb,EACAc,EACAR,CACF,EACA2B,EACEpB,EACAvB,EAAAA,kBACE,CAAE,GAAGc,CAAW,EAChBQ,GAAA,EACArB,EAAAA,mBAAAA,CAAmB8C,EAAK,OAAQvB,CAAU,CAC5C,CACF,EACAwB,EAAmB,EAAE,CACvB,CACA,MAAO,CACL,sBACA,yBACA,WACA,cACA,eAAgBR,EAAS,OAC3B,CACF,C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type ControlElement, type JsonSchema, type JsonFormsCellRendererRegistryEntry, type JsonFormsRendererRegistryEntry, type JsonFormsUISchemaRegistryEntry } from '@jsonforms/core';
|
|
2
|
+
export type AdditionalPropertiesProps = {
|
|
3
|
+
cells?: JsonFormsCellRendererRegistryEntry[];
|
|
4
|
+
config?: any;
|
|
5
|
+
data: unknown;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
handleChange(path: string, value: unknown): void;
|
|
8
|
+
label: string;
|
|
9
|
+
path: string;
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
renderers?: JsonFormsRendererRegistryEntry[];
|
|
12
|
+
rootSchema: JsonSchema;
|
|
13
|
+
schema: JsonSchema;
|
|
14
|
+
uischema: ControlElement;
|
|
15
|
+
uischemas?: JsonFormsUISchemaRegistryEntry[];
|
|
16
|
+
embedded?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type AdditionalPropertyEntriesInput = Pick<AdditionalPropertiesProps, 'data' | 'schema' | 'rootSchema' | 'path' | 'uischema' | 'config'>;
|
|
19
|
+
/** Shared property discovery and pagination; renderers own editors and actions. */
|
|
20
|
+
export declare const useAdditionalPropertyItems: ({ data, schema, rootSchema, path, uischema, config, }: AdditionalPropertyEntriesInput) => {
|
|
21
|
+
maxPropertiesReached: boolean;
|
|
22
|
+
minPropertiesReached: boolean;
|
|
23
|
+
objectSchema: import("@jsonforms/core").JsonSchema7;
|
|
24
|
+
appliedOptions: any;
|
|
25
|
+
objectData: Record<string, unknown> | undefined;
|
|
26
|
+
allowIfMissing: boolean;
|
|
27
|
+
reservedPropertyNames: string[];
|
|
28
|
+
additionalKeys: string[];
|
|
29
|
+
additionalPropertyItems: import("./additionalProperties").AdditionalPropertyItem[];
|
|
30
|
+
shouldShow: boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare const useAdditionalPropertyEntries: (input: AdditionalPropertyEntriesInput) => {
|
|
33
|
+
page: {
|
|
34
|
+
pending: Set<import("..").PendingChange>;
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
current: number;
|
|
37
|
+
size: any;
|
|
38
|
+
total: number;
|
|
39
|
+
pages: number;
|
|
40
|
+
choices: any[];
|
|
41
|
+
indices: number[];
|
|
42
|
+
change: (nextPage: number, nextSize?: any) => void;
|
|
43
|
+
};
|
|
44
|
+
maxPropertiesReached: boolean;
|
|
45
|
+
minPropertiesReached: boolean;
|
|
46
|
+
objectSchema: import("@jsonforms/core").JsonSchema7;
|
|
47
|
+
appliedOptions: any;
|
|
48
|
+
objectData: Record<string, unknown> | undefined;
|
|
49
|
+
allowIfMissing: boolean;
|
|
50
|
+
reservedPropertyNames: string[];
|
|
51
|
+
additionalKeys: string[];
|
|
52
|
+
additionalPropertyItems: import("./additionalProperties").AdditionalPropertyItem[];
|
|
53
|
+
shouldShow: boolean;
|
|
54
|
+
};
|
|
55
|
+
export declare function useAdditionalPropertyActions(props: AdditionalPropertiesProps, entries: ReturnType<typeof useAdditionalPropertyEntries>, { restrict, propertyName, propertyNameError, setNewPropertyName, }: {
|
|
56
|
+
restrict: boolean;
|
|
57
|
+
propertyName: string;
|
|
58
|
+
propertyNameError?: string;
|
|
59
|
+
setNewPropertyName: (name: string) => void;
|
|
60
|
+
}): {
|
|
61
|
+
addPropertyDisabled: boolean;
|
|
62
|
+
removePropertyDisabled: boolean;
|
|
63
|
+
deletion: {
|
|
64
|
+
confirming: boolean;
|
|
65
|
+
request: (key: string) => void;
|
|
66
|
+
confirm: () => void;
|
|
67
|
+
cancel: () => void;
|
|
68
|
+
};
|
|
69
|
+
addProperty: () => void;
|
|
70
|
+
removeProperty: (key: string) => void;
|
|
71
|
+
};
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useCollectionDelete as e } from "../collections/useCollectionDelete.esm.js";
|
|
2
|
+
import { assignOwnProperty as t } from "./additionalPropertyName.esm.js";
|
|
3
|
+
import { useCollectionPagination as n } from "../collections/collectionPagination.esm.js";
|
|
4
|
+
import { hasAdditionalProperties as r, toAdditionalPropertyItem as i, toObjectSchema as a } from "./additionalProperties.esm.js";
|
|
5
|
+
import { useMemo as o } from "react";
|
|
6
|
+
import { createDefaultValue as s } from "@jsonforms/core";
|
|
7
|
+
// src/objects/useAdditionalPropertyEntries.ts
|
|
8
|
+
var c = ({ data: e, schema: t, rootSchema: n, path: s, uischema: c, config: l }) => {
|
|
9
|
+
let u = a(t), d = {
|
|
10
|
+
...l,
|
|
11
|
+
...c.options
|
|
12
|
+
}, f = typeof e == "object" && e && !Array.isArray(e) ? e : void 0, p = d.allowAdditionalPropertiesIfMissing === !0 && u.additionalProperties === void 0, m = Object.keys(u.properties ?? {}), h = Object.keys(f ?? {}).filter((e) => !m.includes(e)), g = JSON.stringify(h), _ = o(() => JSON.parse(g).map((e) => i(e, s, t, n, p)), [
|
|
13
|
+
g,
|
|
14
|
+
p,
|
|
15
|
+
s,
|
|
16
|
+
n,
|
|
17
|
+
t
|
|
18
|
+
]), v = r(t) || p || h.length > 0, y = Object.keys(f ?? {}).length;
|
|
19
|
+
return {
|
|
20
|
+
maxPropertiesReached: u.maxProperties !== void 0 && y >= u.maxProperties && !!f,
|
|
21
|
+
minPropertiesReached: u.minProperties !== void 0 && y <= u.minProperties && !!f,
|
|
22
|
+
objectSchema: u,
|
|
23
|
+
appliedOptions: d,
|
|
24
|
+
objectData: f,
|
|
25
|
+
allowIfMissing: p,
|
|
26
|
+
reservedPropertyNames: m,
|
|
27
|
+
additionalKeys: h,
|
|
28
|
+
additionalPropertyItems: _,
|
|
29
|
+
shouldShow: v
|
|
30
|
+
};
|
|
31
|
+
}, l = (e) => {
|
|
32
|
+
var t;
|
|
33
|
+
let r = c(e), i = n(r.additionalKeys, (t = e.uischema.options) == null || (t = t.additionalProperties) == null ? void 0 : t.pagination, e.config, "additionalProperties");
|
|
34
|
+
return {
|
|
35
|
+
...r,
|
|
36
|
+
page: i
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
function u(n, r, { restrict: a, propertyName: o, propertyNameError: c, setNewPropertyName: l }) {
|
|
40
|
+
let { enabled: u, readonly: d, path: f, rootSchema: p, schema: m, uischema: h, config: g, handleChange: _ } = n, { objectData: v, objectSchema: y, reservedPropertyNames: b, appliedOptions: x, allowIfMissing: S } = r, C = !u || !!d || a && r.maxPropertiesReached, w = !u || !!d || a && r.minPropertiesReached, T = e({
|
|
41
|
+
data: v,
|
|
42
|
+
identity: f,
|
|
43
|
+
catalogId: "additionalProperties",
|
|
44
|
+
options: h.options,
|
|
45
|
+
config: g,
|
|
46
|
+
canRemove: (e) => {
|
|
47
|
+
var t;
|
|
48
|
+
return !w && !x.disableRemove && !!v && Object.prototype.hasOwnProperty.call(v, e) && !b.includes(e) && !(x.restrict !== !1 && (t = y.required) != null && t.includes(e));
|
|
49
|
+
},
|
|
50
|
+
value: (e) => v == null ? void 0 : v[e],
|
|
51
|
+
remove: (e) => {
|
|
52
|
+
let t = { ...v };
|
|
53
|
+
delete t[e], _(f, t);
|
|
54
|
+
}
|
|
55
|
+
}), E = C || !!c;
|
|
56
|
+
function D() {
|
|
57
|
+
if (E) return;
|
|
58
|
+
let e = i(o, f, m, p, S);
|
|
59
|
+
_(f, t({ ...v }, o, s(e.schema, p))), l("");
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
addPropertyDisabled: E,
|
|
63
|
+
removePropertyDisabled: w,
|
|
64
|
+
deletion: T,
|
|
65
|
+
addProperty: D,
|
|
66
|
+
removeProperty: T.request
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export { u as useAdditionalPropertyActions, l as useAdditionalPropertyEntries, c as useAdditionalPropertyItems };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=useAdditionalPropertyEntries.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAdditionalPropertyEntries.esm.js","names":["useAdditionalPropertyItems","objectSchema","toObjectSchema","schema","appliedOptions","config","uischema","objectData","data","allowIfMissing","reservedPropertyNames","additionalKeys","key","additionalKeySnapshot","additionalPropertyItems","useMemo","toAdditionalPropertyItem","propertyName","path","rootSchema","shouldShow","hasAdditionalProperties","count","useAdditionalPropertyEntries","_input$uischema$optio","items","input","page","useCollectionPagination","useAdditionalPropertyActions","props","entries","addDisabled","enabled","readonly","restrict","removePropertyDisabled","deletion","useCollectionDelete","_objectSchema$require","updatedData","handleChange","addPropertyDisabled","propertyNameError","addProperty","item","assignOwnProperty","createDefaultValue","setNewPropertyName"],"sources":["../../src/objects/useAdditionalPropertyEntries.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n createDefaultValue,\n type ControlElement,\n type JsonSchema,\n type JsonFormsCellRendererRegistryEntry,\n type JsonFormsRendererRegistryEntry,\n type JsonFormsUISchemaRegistryEntry,\n} from '@jsonforms/core';\nimport { useCollectionDelete } from '../collections/useCollectionDelete';\nimport { assignOwnProperty } from './additionalPropertyName';\n\nimport { useCollectionPagination } from '../collections/collectionPagination';\nimport {\n hasAdditionalProperties,\n toAdditionalPropertyItem,\n toObjectSchema,\n} from './additionalProperties';\n\nexport type AdditionalPropertiesProps = {\n cells?: JsonFormsCellRendererRegistryEntry[];\n config?: any;\n data: unknown;\n enabled: boolean;\n handleChange(path: string, value: unknown): void;\n label: string;\n path: string;\n readonly?: boolean;\n renderers?: JsonFormsRendererRegistryEntry[];\n rootSchema: JsonSchema;\n schema: JsonSchema;\n uischema: ControlElement;\n uischemas?: JsonFormsUISchemaRegistryEntry[];\n embedded?: boolean;\n};\n\ntype AdditionalPropertyEntriesInput = Pick<\n AdditionalPropertiesProps,\n 'data' | 'schema' | 'rootSchema' | 'path' | 'uischema' | 'config'\n>;\n\n/** Shared property discovery and pagination; renderers own editors and actions. */\nexport const useAdditionalPropertyItems = ({\n data,\n schema,\n rootSchema,\n path,\n uischema,\n config,\n}: AdditionalPropertyEntriesInput) => {\n const objectSchema = toObjectSchema(schema);\n const appliedOptions = { ...config, ...uischema.options };\n const objectData =\n typeof data === 'object' && data !== null && !Array.isArray(data)\n ? (data as Record<string, unknown>)\n : undefined;\n const allowIfMissing =\n appliedOptions.allowAdditionalPropertiesIfMissing === true &&\n objectSchema.additionalProperties === undefined;\n const reservedPropertyNames = Object.keys(objectSchema.properties ?? {});\n const additionalKeys = Object.keys(objectData ?? {}).filter(\n (key) => !reservedPropertyNames.includes(key),\n );\n const additionalKeySnapshot = JSON.stringify(additionalKeys);\n const additionalPropertyItems = useMemo(\n () =>\n (JSON.parse(additionalKeySnapshot) as string[]).map((propertyName) =>\n toAdditionalPropertyItem(\n propertyName,\n path,\n schema,\n rootSchema,\n allowIfMissing,\n ),\n ),\n [additionalKeySnapshot, allowIfMissing, path, rootSchema, schema],\n );\n const shouldShow =\n hasAdditionalProperties(schema) ||\n allowIfMissing ||\n additionalKeys.length > 0;\n const count = Object.keys(objectData ?? {}).length;\n const maxPropertiesReached =\n objectSchema.maxProperties !== undefined &&\n count >= objectSchema.maxProperties &&\n Boolean(objectData);\n const minPropertiesReached =\n objectSchema.minProperties !== undefined &&\n count <= objectSchema.minProperties &&\n Boolean(objectData);\n return {\n maxPropertiesReached,\n minPropertiesReached,\n objectSchema,\n appliedOptions,\n objectData,\n allowIfMissing,\n reservedPropertyNames,\n additionalKeys,\n additionalPropertyItems,\n shouldShow,\n };\n};\n\nexport const useAdditionalPropertyEntries = (\n input: AdditionalPropertyEntriesInput,\n) => {\n const items = useAdditionalPropertyItems(input);\n const page = useCollectionPagination(\n items.additionalKeys,\n input.uischema.options?.additionalProperties?.pagination,\n input.config,\n 'additionalProperties',\n );\n return { ...items, page };\n};\n\nexport function useAdditionalPropertyActions(\n props: AdditionalPropertiesProps,\n entries: ReturnType<typeof useAdditionalPropertyEntries>,\n {\n restrict,\n propertyName,\n propertyNameError,\n setNewPropertyName,\n }: {\n restrict: boolean;\n propertyName: string;\n propertyNameError?: string;\n setNewPropertyName: (name: string) => void;\n },\n) {\n const {\n enabled,\n readonly,\n path,\n rootSchema,\n schema,\n uischema,\n config,\n handleChange,\n } = props;\n const {\n objectData,\n objectSchema,\n reservedPropertyNames,\n appliedOptions,\n allowIfMissing,\n } = entries;\n const addDisabled =\n !enabled || Boolean(readonly) || (restrict && entries.maxPropertiesReached);\n const removePropertyDisabled =\n !enabled || Boolean(readonly) || (restrict && entries.minPropertiesReached);\n const deletion = useCollectionDelete<string>({\n data: objectData,\n identity: path,\n catalogId: 'additionalProperties',\n options: uischema.options,\n config,\n canRemove: (key) =>\n !removePropertyDisabled &&\n !appliedOptions.disableRemove &&\n !!objectData &&\n Object.prototype.hasOwnProperty.call(objectData, key) &&\n !reservedPropertyNames.includes(key) &&\n !(\n appliedOptions.restrict !== false &&\n objectSchema.required?.includes(key)\n ),\n value: (key) => objectData?.[key],\n remove: (key) => {\n const updatedData = { ...objectData };\n delete updatedData[key];\n handleChange(path, updatedData);\n },\n });\n const addPropertyDisabled = addDisabled || Boolean(propertyNameError);\n function addProperty() {\n if (addPropertyDisabled) return;\n const item = toAdditionalPropertyItem(\n propertyName,\n path,\n schema,\n rootSchema,\n allowIfMissing,\n );\n handleChange(\n path,\n assignOwnProperty(\n { ...objectData },\n propertyName,\n createDefaultValue(item.schema, rootSchema),\n ),\n );\n setNewPropertyName('');\n }\n return {\n addPropertyDisabled,\n removePropertyDisabled,\n deletion,\n addProperty,\n removeProperty: deletion.request,\n };\n}\n"],"mappings":";;;;;;;AA0CA,IAAaA,KAA8B,EACzC,SACA,WACA,eACA,SACA,aACA,gBACoC;CACpC,IAAMC,IAAeC,EAAeC,CAAM,GACpCC,IAAiB;EAAE,GAAGC;EAAQ,GAAGC,EAAS;CAAQ,GAClDC,IACJ,OAAOC,KAAS,YAAYA,KAAiB,CAAC,MAAM,QAAQA,CAAI,IAC3DA,IACD,KAAA,GACAC,IACJL,EAAe,uCAAuC,MACtDH,EAAa,yBAAyB,KAAA,GAClCS,IAAwB,OAAO,KAAKT,EAAa,cAAc,CAAC,CAAC,GACjEU,IAAiB,OAAO,KAAKJ,KAAc,CAAC,CAAC,CAAC,CAAC,QAClD,MAAQ,CAACG,EAAsB,SAASE,CAAG,CAC9C,GACMC,IAAwB,KAAK,UAAUF,CAAc,GACrDG,IAA0BC,QAE3B,KAAK,MAAMF,CAAqB,CAAC,CAAc,KAAK,MACnDG,EACEC,GACAC,GACAf,GACAgB,GACAV,CACF,CACF,GACF;EAACI;EAAuBJ;EAAgBS;EAAMC;EAAYhB;CAAM,CAClE,GACMiB,IACJC,EAAwBlB,CAAM,KAC9BM,KACAE,EAAe,SAAS,GACpBW,IAAQ,OAAO,KAAKf,KAAc,CAAC,CAAC,CAAC,CAAC;CAS5C,OAAO;EACL,sBARAN,EAAa,kBAAkB,KAAA,KAC/BqB,KAASrB,EAAa,iBACtB,EAAQM;EAOR,sBALAN,EAAa,kBAAkB,KAAA,KAC/BqB,KAASrB,EAAa,iBACtB,EAAQM;EAIR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,GAEagB,KACX,MACG;;CACH,IAAME,IAAQzB,EAA2B0B,CAAK,GACxCC,IAAOC,EACXH,EAAM,iBAAA,IACNC,EAAM,SAAS,YAAA,SAAA,IAAAF,EAAS,yBAAA,OAAA,KAAA,IAAAA,EAAsB,YAC9CE,EAAM,QACN,sBACF;CACA,OAAO;EAAE,GAAGD;EAAO;CAAK;AAC1B;AAEA,SAAgBI,EACd,GACA,GACA,EACE,aACA,iBACA,sBACA,yBAOF;CACA,IAAM,EACJ,YACA,aACA,SACA,eACA,WACA,aACA,WACA,oBACEC,GACE,EACJ,eACA,iBACA,0BACA,mBACA,sBACEC,GACEC,IACJ,CAACC,KAAW,EAAQC,KAAcC,KAAYJ,EAAQ,sBAClDK,IACJ,CAACH,KAAW,EAAQC,KAAcC,KAAYJ,EAAQ,sBAClDM,IAAWC,EAA4B;EAC3C,MAAM/B;EACN,UAAUW;EACV,WAAW;EACX,SAASZ,EAAS;EAClB;EACA,YAAY,MACV;;GAAC,OAAA,CAAA8B,KACD,CAAChC,EAAe,iBAChB,CAAC,CAACG,KACF,OAAO,UAAU,eAAe,KAAKA,GAAYK,CAAG,KACpD,CAACF,EAAsB,SAASE,CAAG,KACnC,EACER,EAAe,aAAa,OAAA,IAC5BH,EAAa,aAAA,QAAAsC,EAAU,SAAS3B,CAAG;EAAA;EAEvC,QAAQ,MAAAL,KAAA,OAAA,KAAA,IAAQA,EAAaK;EAC7B,SAAS,MAAQ;GACf,IAAM4B,IAAc,EAAE,GAAGjC,EAAW;GAEpC,AADA,OAAOiC,EAAY5B,IACnB6B,EAAavB,GAAMsB,CAAW;EAChC;CACF,CAAC,GACKE,IAAsBV,KAAe,EAAQW;CACnD,SAASC,IAAc;EACrB,IAAIF,GAAqB;EACzB,IAAMG,IAAO7B,EACXC,GACAC,GACAf,GACAgB,GACAV,CACF;EASA,AARAgC,EACEvB,GACA4B,EACE,EAAE,GAAGvC,EAAW,GAChBU,GACA8B,EAAmBF,EAAK,QAAQ1B,CAAU,CAC5C,CACF,GACA6B,EAAmB,EAAE;CACvB;CACA,OAAO;EACL;EACA;EACA;EACA;EACA,gBAAgBX,EAAS;CAC3B;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.js"),t=require("./useTupleControl.cjs.js"),n=require("./tupleSchema.cjs.js");let r=require("react");r=e.t(r);let i=require("@jsonforms/react");function a({props:e,model:a,TupleField:o,TupleAdditionalItems:s,diagnostic:c,gap:l}){let{path:u,rootSchema:d,schema:f}=e,{t:p,options:m,vertical:h,definition:g,values:_,editable:v,positionLabel:y,fieldSchema:b,fieldUiSchema:x,positionLayout:S}=a,C=e=>r.default.createElement(o,{key:e,schema:b(e),prefix:(g==null?void 0:g.prefix)??[],index:e,arrayPath:u,rootSchema:d,uischema:x(e),enabled:v,options:m});return g?r.default.createElement(r.default.Fragment,null,S?r.default.createElement(`div`,{"data-tuple-fields":!0,"data-tuple-layout":!0},r.default.createElement(t.TuplePositionContext.Provider,{value:{count:g.prefix.length,render:C,renderWithin:(t,a)=>r.default.createElement(i.JsonFormsDispatch,{schema:n.tupleRenderSchema(b(t)),uischema:{type:`Control`,scope:a},path:`${u}.${t}`,renderers:e.renderers,cells:e.cells,enabled:v})}},r.default.createElement(i.JsonFormsDispatch,{schema:f,uischema:S,path:u,renderers:[...e.renderers??[],t.tuplePositionEntry],cells:e.cells,enabled:v}))):r.default.createElement(`div`,{"data-tuple-fields":!0,style:{display:`flex`,flexDirection:h?`column`:`row`,flexWrap:h?`nowrap`:`wrap`,gap:l,alignItems:h?`stretch`:`flex-start`}},g.prefix.map((e,t)=>C(t))),(g.tail!==!1||_.length>g.prefix.length)&&r.default.createElement(s,{definition:g,config:e.config,path:u,data:_,schema:f,rootSchema:d,options:m,enabled:v,onChange:t=>e.handleChange(u,t),renderItem:C,positionLabel:y})):r.default.createElement(r.default.Fragment,null,c(p(`tuple.configuration`)))}var o=e=>function({ctx:t,props:n}){return t.dispatch?r.default.createElement(e,{...n,...(0,i.ctxToControlWithDetailProps)(t,n),...(0,i.ctxDispatchToControlProps)(t.dispatch)}):null},s=e=>(0,i.withJsonFormsContext)(o(r.default.memo(e)));exports.TupleControlContent=a,exports.connectTupleControl=s;
|
|
2
|
+
//# sourceMappingURL=TupleControlContent.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TupleControlContent.cjs.js","names":["React","TuplePositionContext","JsonFormsDispatch","tupleRenderSchema","tuplePositionEntry","ctxToControlWithDetailProps","ctxDispatchToControlProps","withJsonFormsContext","require_rolldown_runtime","require_tuple_useTupleControl","require_tuple_tupleSchema","react","_jsonforms_react","TupleControlContent","props","model","field","TupleField","index","fieldSchema","definition","path","fieldUiSchema","editable","positionLayout","vertical","values","TupleAdditionalItems","next","diagnostic","t","withTupleProps","ctx","Component","connectTupleControl"],"sources":["../../src/tuple/TupleControlContent.tsx"],"sourcesContent":["import React from 'react';\nimport type {\n ControlElement,\n JsonSchema,\n StatePropsOfControlWithDetail,\n} from '@jsonforms/core';\nimport {\n JsonFormsDispatch,\n type JsonFormsStateContext,\n ctxDispatchToControlProps,\n ctxToControlWithDetailProps,\n withJsonFormsContext,\n} from '@jsonforms/react';\nimport {\n TuplePositionContext,\n tuplePositionEntry,\n type useTupleControl,\n} from './useTupleControl';\nimport { tupleRenderSchema } from './tupleSchema';\nimport type { TupleAdditionalItemsProps } from './useTupleAdditionalItems';\nimport type { TupleFieldProps } from './TupleField';\nexport type TupleControlProps = StatePropsOfControlWithDetail & {\n handleChange: (path: string, value: unknown) => void;\n};\n\nexport function TupleControlContent({\n props,\n model,\n TupleField,\n TupleAdditionalItems,\n diagnostic,\n gap,\n}: {\n props: TupleControlProps;\n model: ReturnType<typeof useTupleControl>;\n TupleField: React.ComponentType<TupleFieldProps>;\n TupleAdditionalItems: React.ComponentType<TupleAdditionalItemsProps>;\n diagnostic: (message: string) => React.ReactNode;\n gap: number;\n}) {\n const { path, rootSchema, schema } = props;\n const {\n t,\n options,\n vertical,\n definition,\n values,\n editable,\n positionLabel,\n fieldSchema,\n fieldUiSchema,\n positionLayout,\n } = model;\n const field = (index: number) => (\n <TupleField\n key={index}\n schema={fieldSchema(index)}\n prefix={definition?.prefix ?? []}\n index={index}\n arrayPath={path}\n rootSchema={rootSchema}\n uischema={fieldUiSchema(index)}\n enabled={editable}\n options={options}\n />\n );\n\n if (!definition) return <>{diagnostic(t('tuple.configuration'))}</>;\n return (\n <>\n {positionLayout ? (\n <div data-tuple-fields data-tuple-layout>\n <TuplePositionContext.Provider\n value={{\n count: definition.prefix.length,\n render: field,\n renderWithin: (index, scope) => (\n <JsonFormsDispatch\n schema={tupleRenderSchema(fieldSchema(index)) as JsonSchema}\n uischema={{ type: 'Control', scope } as ControlElement}\n path={`${path}.${index}`}\n renderers={props.renderers}\n cells={props.cells}\n enabled={editable}\n />\n ),\n }}\n >\n <JsonFormsDispatch\n schema={schema as JsonSchema}\n uischema={positionLayout}\n path={path}\n renderers={[...(props.renderers ?? []), tuplePositionEntry]}\n cells={props.cells}\n enabled={editable}\n />\n </TuplePositionContext.Provider>\n </div>\n ) : (\n <div\n data-tuple-fields\n style={{\n display: 'flex',\n flexDirection: vertical ? 'column' : 'row',\n flexWrap: vertical ? 'nowrap' : 'wrap',\n gap,\n alignItems: vertical ? 'stretch' : 'flex-start',\n }}\n >\n {definition.prefix.map((_, index) => field(index))}\n </div>\n )}\n {(definition.tail !== false ||\n values.length > definition.prefix.length) && (\n <TupleAdditionalItems\n definition={definition}\n config={props.config}\n path={path}\n data={values}\n schema={schema}\n rootSchema={rootSchema}\n options={options}\n enabled={editable}\n onChange={(next) => props.handleChange(path, next)}\n renderItem={field}\n positionLabel={positionLabel}\n />\n )}\n </>\n );\n}\nconst withTupleProps = (Component: React.ComponentType<TupleControlProps>) =>\n function WithTupleProps({\n ctx,\n props,\n }: {\n ctx: JsonFormsStateContext;\n props: any;\n }) {\n if (!ctx.dispatch) return null;\n return (\n <Component\n {...props}\n {...ctxToControlWithDetailProps(ctx, props)}\n {...ctxDispatchToControlProps(ctx.dispatch)}\n />\n );\n };\n\nexport const connectTupleControl = (\n Component: React.ComponentType<TupleControlProps>,\n) => withJsonFormsContext(withTupleProps(React.memo(Component)) as any);\n"],"mappings":"A,gQAyBA,SAAgBa,EAAoB,CAClC,QACA,QACA,aACA,uBACA,aACA,OAQC,CACD,GAAM,CAAE,OAAM,aAAY,UAAWC,EAC/B,CACJ,IACA,UACA,WACA,aACA,SACA,WACA,gBACA,cACA,gBACA,kBACEC,EACEC,EAAS,GACbL,EAAA,QAAA,cAACM,EAAD,CACE,IAAKC,EACL,OAAQC,EAAYD,CAAK,EACzB,QAAAE,GAAA,KAAA,IAAA,GAAQA,EAAY,SAAU,CAAC,EACxB,QACP,UAAWC,EACC,aACZ,SAAUC,EAAcJ,CAAK,EAC7B,QAASK,EACA,SACV,CAAA,EAIH,OADKH,EAEHT,EAAA,QAAA,cAAAX,EAAAA,QAAA,SAAA,KACGwB,EACCb,EAAA,QAAA,cAAC,MAAD,CAAK,oBAAA,GAAkB,oBAAA,EA0BlB,EAzBHA,EAAA,QAAA,cAACV,EAAAA,qBAAqB,SAAtB,CACE,MAAO,CACL,MAAOmB,EAAW,OAAO,OACzB,OAAQJ,EACR,cAAe,EAAO,IACpBL,EAAA,QAAA,cAACT,EAAAA,kBAAD,CACE,OAAQC,EAAAA,kBAAkBgB,EAAYD,CAAK,CAAC,EAC5C,SAAU,CAAE,KAAM,UAAW,OAAM,EACnC,KAAM,GAAGG,EAAK,GAAGH,IACjB,UAAWJ,EAAM,UACjB,MAAOA,EAAM,MACb,QAASS,CACV,CAAA,CAEL,CAU6B,EAR7BZ,EAAA,QAAA,cAACT,EAAAA,kBAAD,CACU,SACR,SAAUsB,EACJ,OACN,UAAW,CAAC,GAAIV,EAAM,WAAa,CAAC,EAAIV,EAAAA,kBAAkB,EAC1D,MAAOU,EAAM,MACb,QAASS,CACV,CAAA,CAC4B,CAC5B,EAELZ,EAAA,QAAA,cAAC,MAAD,CACE,oBAAA,GACA,MAAO,CACL,QAAS,OACT,cAAec,EAAW,SAAW,MACrC,SAAUA,EAAW,SAAW,OAChC,MACA,WAAYA,EAAW,UAAY,YACrC,CAGG,EADFL,EAAW,OAAO,KAAK,EAAG,IAAUJ,EAAME,CAAK,CAAC,CAC9C,GAELE,EAAW,OAAS,IACpBM,EAAO,OAASN,EAAW,OAAO,SAClCT,EAAA,QAAA,cAACgB,EAAD,CACc,aACZ,OAAQb,EAAM,OACR,OACN,KAAMY,EACE,SACI,aACH,UACT,QAASH,EACT,SAAW,GAAST,EAAM,aAAaO,EAAMO,CAAI,EACjD,WAAYZ,EACG,eAChB,CAAA,CAEH,EA7DoBL,EAAA,QAAA,cAAAX,EAAAA,QAAA,SAAA,KAAG6B,EAAWC,EAAE,qBAAqB,CAAC,CAAI,CA+DpE,CACA,IAAMC,EAAkB,GACtB,SAAwB,CACtB,MACA,SAIC,CAED,OADKC,EAAI,SAEPrB,EAAA,QAAA,cAACsB,EAAD,CACE,GAAInB,EACJ,IAAA,EAAIT,EAAAA,4BAAAA,CAA4B2B,EAAKlB,CAAK,EAC1C,IAAA,EAAIR,EAAAA,0BAAAA,CAA0B0B,EAAI,QAAQ,CAC3C,CAAA,EANuB,IAQ5B,EAEWE,EACX,IAAA,EACG3B,EAAAA,qBAAAA,CAAqBwB,EAAe/B,EAAAA,QAAM,KAAKiC,CAAS,CAAC,CAAQ,E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StatePropsOfControlWithDetail } from '@jsonforms/core';
|
|
3
|
+
import { type useTupleControl } from './useTupleControl';
|
|
4
|
+
import type { TupleAdditionalItemsProps } from './useTupleAdditionalItems';
|
|
5
|
+
import type { TupleFieldProps } from './TupleField';
|
|
6
|
+
export type TupleControlProps = StatePropsOfControlWithDetail & {
|
|
7
|
+
handleChange: (path: string, value: unknown) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function TupleControlContent({ props, model, TupleField, TupleAdditionalItems, diagnostic, gap, }: {
|
|
10
|
+
props: TupleControlProps;
|
|
11
|
+
model: ReturnType<typeof useTupleControl>;
|
|
12
|
+
TupleField: React.ComponentType<TupleFieldProps>;
|
|
13
|
+
TupleAdditionalItems: React.ComponentType<TupleAdditionalItemsProps>;
|
|
14
|
+
diagnostic: (message: string) => React.ReactNode;
|
|
15
|
+
gap: number;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
export declare const connectTupleControl: (Component: React.ComponentType<TupleControlProps>) => React.ComponentType<any>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { TuplePositionContext as e, tuplePositionEntry as t } from "./useTupleControl.esm.js";
|
|
2
|
+
import { tupleRenderSchema as n } from "./tupleSchema.esm.js";
|
|
3
|
+
import r from "react";
|
|
4
|
+
import { JsonFormsDispatch as i, ctxDispatchToControlProps as a, ctxToControlWithDetailProps as o, withJsonFormsContext as s } from "@jsonforms/react";
|
|
5
|
+
// src/tuple/TupleControlContent.tsx
|
|
6
|
+
function c({ props: a, model: o, TupleField: s, TupleAdditionalItems: c, diagnostic: l, gap: u }) {
|
|
7
|
+
let { path: d, rootSchema: f, schema: p } = a, { t: m, options: h, vertical: g, definition: _, values: v, editable: y, positionLabel: b, fieldSchema: x, fieldUiSchema: S, positionLayout: C } = o, w = (e) => /* @__PURE__ */ r.createElement(s, {
|
|
8
|
+
key: e,
|
|
9
|
+
schema: x(e),
|
|
10
|
+
prefix: (_ == null ? void 0 : _.prefix) ?? [],
|
|
11
|
+
index: e,
|
|
12
|
+
arrayPath: d,
|
|
13
|
+
rootSchema: f,
|
|
14
|
+
uischema: S(e),
|
|
15
|
+
enabled: y,
|
|
16
|
+
options: h
|
|
17
|
+
});
|
|
18
|
+
return _ ? /* @__PURE__ */ r.createElement(r.Fragment, null, C ? /* @__PURE__ */ r.createElement("div", {
|
|
19
|
+
"data-tuple-fields": !0,
|
|
20
|
+
"data-tuple-layout": !0
|
|
21
|
+
}, /* @__PURE__ */ r.createElement(e.Provider, { value: {
|
|
22
|
+
count: _.prefix.length,
|
|
23
|
+
render: w,
|
|
24
|
+
renderWithin: (e, t) => /* @__PURE__ */ r.createElement(i, {
|
|
25
|
+
schema: n(x(e)),
|
|
26
|
+
uischema: {
|
|
27
|
+
type: "Control",
|
|
28
|
+
scope: t
|
|
29
|
+
},
|
|
30
|
+
path: `${d}.${e}`,
|
|
31
|
+
renderers: a.renderers,
|
|
32
|
+
cells: a.cells,
|
|
33
|
+
enabled: y
|
|
34
|
+
})
|
|
35
|
+
} }, /* @__PURE__ */ r.createElement(i, {
|
|
36
|
+
schema: p,
|
|
37
|
+
uischema: C,
|
|
38
|
+
path: d,
|
|
39
|
+
renderers: [...a.renderers ?? [], t],
|
|
40
|
+
cells: a.cells,
|
|
41
|
+
enabled: y
|
|
42
|
+
}))) : /* @__PURE__ */ r.createElement("div", {
|
|
43
|
+
"data-tuple-fields": !0,
|
|
44
|
+
style: {
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: g ? "column" : "row",
|
|
47
|
+
flexWrap: g ? "nowrap" : "wrap",
|
|
48
|
+
gap: u,
|
|
49
|
+
alignItems: g ? "stretch" : "flex-start"
|
|
50
|
+
}
|
|
51
|
+
}, _.prefix.map((e, t) => w(t))), (_.tail !== !1 || v.length > _.prefix.length) && /* @__PURE__ */ r.createElement(c, {
|
|
52
|
+
definition: _,
|
|
53
|
+
config: a.config,
|
|
54
|
+
path: d,
|
|
55
|
+
data: v,
|
|
56
|
+
schema: p,
|
|
57
|
+
rootSchema: f,
|
|
58
|
+
options: h,
|
|
59
|
+
enabled: y,
|
|
60
|
+
onChange: (e) => a.handleChange(d, e),
|
|
61
|
+
renderItem: w,
|
|
62
|
+
positionLabel: b
|
|
63
|
+
})) : /* @__PURE__ */ r.createElement(r.Fragment, null, l(m("tuple.configuration")));
|
|
64
|
+
}
|
|
65
|
+
var l = (e) => function({ ctx: t, props: n }) {
|
|
66
|
+
return t.dispatch ? /* @__PURE__ */ r.createElement(e, {
|
|
67
|
+
...n,
|
|
68
|
+
...o(t, n),
|
|
69
|
+
...a(t.dispatch)
|
|
70
|
+
}) : null;
|
|
71
|
+
}, u = (e) => s(l(r.memo(e)));
|
|
72
|
+
export { c as TupleControlContent, u as connectTupleControl };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=TupleControlContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TupleControlContent.esm.js","names":["React","TupleControlContent","props","model","field","TupleField","index","fieldSchema","definition","path","fieldUiSchema","editable","positionLayout","TuplePositionContext","JsonFormsDispatch","tupleRenderSchema","tuplePositionEntry","vertical","values","TupleAdditionalItems","next","diagnostic","t","withTupleProps","ctx","Component","ctxToControlWithDetailProps","ctxDispatchToControlProps","connectTupleControl","withJsonFormsContext"],"sources":["../../src/tuple/TupleControlContent.tsx"],"sourcesContent":["import React from 'react';\nimport type {\n ControlElement,\n JsonSchema,\n StatePropsOfControlWithDetail,\n} from '@jsonforms/core';\nimport {\n JsonFormsDispatch,\n type JsonFormsStateContext,\n ctxDispatchToControlProps,\n ctxToControlWithDetailProps,\n withJsonFormsContext,\n} from '@jsonforms/react';\nimport {\n TuplePositionContext,\n tuplePositionEntry,\n type useTupleControl,\n} from './useTupleControl';\nimport { tupleRenderSchema } from './tupleSchema';\nimport type { TupleAdditionalItemsProps } from './useTupleAdditionalItems';\nimport type { TupleFieldProps } from './TupleField';\nexport type TupleControlProps = StatePropsOfControlWithDetail & {\n handleChange: (path: string, value: unknown) => void;\n};\n\nexport function TupleControlContent({\n props,\n model,\n TupleField,\n TupleAdditionalItems,\n diagnostic,\n gap,\n}: {\n props: TupleControlProps;\n model: ReturnType<typeof useTupleControl>;\n TupleField: React.ComponentType<TupleFieldProps>;\n TupleAdditionalItems: React.ComponentType<TupleAdditionalItemsProps>;\n diagnostic: (message: string) => React.ReactNode;\n gap: number;\n}) {\n const { path, rootSchema, schema } = props;\n const {\n t,\n options,\n vertical,\n definition,\n values,\n editable,\n positionLabel,\n fieldSchema,\n fieldUiSchema,\n positionLayout,\n } = model;\n const field = (index: number) => (\n <TupleField\n key={index}\n schema={fieldSchema(index)}\n prefix={definition?.prefix ?? []}\n index={index}\n arrayPath={path}\n rootSchema={rootSchema}\n uischema={fieldUiSchema(index)}\n enabled={editable}\n options={options}\n />\n );\n\n if (!definition) return <>{diagnostic(t('tuple.configuration'))}</>;\n return (\n <>\n {positionLayout ? (\n <div data-tuple-fields data-tuple-layout>\n <TuplePositionContext.Provider\n value={{\n count: definition.prefix.length,\n render: field,\n renderWithin: (index, scope) => (\n <JsonFormsDispatch\n schema={tupleRenderSchema(fieldSchema(index)) as JsonSchema}\n uischema={{ type: 'Control', scope } as ControlElement}\n path={`${path}.${index}`}\n renderers={props.renderers}\n cells={props.cells}\n enabled={editable}\n />\n ),\n }}\n >\n <JsonFormsDispatch\n schema={schema as JsonSchema}\n uischema={positionLayout}\n path={path}\n renderers={[...(props.renderers ?? []), tuplePositionEntry]}\n cells={props.cells}\n enabled={editable}\n />\n </TuplePositionContext.Provider>\n </div>\n ) : (\n <div\n data-tuple-fields\n style={{\n display: 'flex',\n flexDirection: vertical ? 'column' : 'row',\n flexWrap: vertical ? 'nowrap' : 'wrap',\n gap,\n alignItems: vertical ? 'stretch' : 'flex-start',\n }}\n >\n {definition.prefix.map((_, index) => field(index))}\n </div>\n )}\n {(definition.tail !== false ||\n values.length > definition.prefix.length) && (\n <TupleAdditionalItems\n definition={definition}\n config={props.config}\n path={path}\n data={values}\n schema={schema}\n rootSchema={rootSchema}\n options={options}\n enabled={editable}\n onChange={(next) => props.handleChange(path, next)}\n renderItem={field}\n positionLabel={positionLabel}\n />\n )}\n </>\n );\n}\nconst withTupleProps = (Component: React.ComponentType<TupleControlProps>) =>\n function WithTupleProps({\n ctx,\n props,\n }: {\n ctx: JsonFormsStateContext;\n props: any;\n }) {\n if (!ctx.dispatch) return null;\n return (\n <Component\n {...props}\n {...ctxToControlWithDetailProps(ctx, props)}\n {...ctxDispatchToControlProps(ctx.dispatch)}\n />\n );\n };\n\nexport const connectTupleControl = (\n Component: React.ComponentType<TupleControlProps>,\n) => withJsonFormsContext(withTupleProps(React.memo(Component)) as any);\n"],"mappings":";;;;;AAyBA,SAAgBC,EAAoB,EAClC,UACA,UACA,eACA,yBACA,eACA,UAQC;CACD,IAAM,EAAE,SAAM,eAAY,cAAWC,GAC/B,EACJ,MACA,YACA,aACA,eACA,WACA,aACA,kBACA,gBACA,kBACA,sBACEC,GACEC,KAAS,MACb,kBAAA,cAACC,GAAD;EACE,KAAKC;EACL,QAAQC,EAAYD,CAAK;EACzB,SAAAE,KAAA,OAAA,KAAA,IAAQA,EAAY,WAAU,CAAC;EACxB;EACP,WAAWC;EACC;EACZ,UAAUC,EAAcJ,CAAK;EAC7B,SAASK;EACA;CACV,CAAA;CAIH,OADKH,IAEH,kBAAA,cAAAR,EAAA,UAAA,MACGY,IACC,kBAAA,cAAC,OAAD;EAAK,qBAAA;EAAkB,qBAAA;CA0BlB,GAzBH,kBAAA,cAACC,EAAqB,UAAtB,EACE,OAAO;EACL,OAAOL,EAAW,OAAO;EACzB,QAAQJ;EACR,eAAe,GAAO,MACpB,kBAAA,cAACU,GAAD;GACE,QAAQC,EAAkBR,EAAYD,CAAK,CAAC;GAC5C,UAAU;IAAE,MAAM;IAAW;GAAM;GACnC,MAAM,GAAGG,EAAK,GAAGH;GACjB,WAAWJ,EAAM;GACjB,OAAOA,EAAM;GACb,SAASS;EACV,CAAA;CAEL,EAU6B,GAR7B,kBAAA,cAACG,GAAD;EACU;EACR,UAAUF;EACJ;EACN,WAAW,CAAC,GAAIV,EAAM,aAAa,CAAC,GAAIc,CAAkB;EAC1D,OAAOd,EAAM;EACb,SAASS;CACV,CAAA,CAC4B,CAC5B,IAEL,kBAAA,cAAC,OAAD;EACE,qBAAA;EACA,OAAO;GACL,SAAS;GACT,eAAeM,IAAW,WAAW;GACrC,UAAUA,IAAW,WAAW;GAChC;GACA,YAAYA,IAAW,YAAY;EACrC;CAGG,GADFT,EAAW,OAAO,KAAK,GAAG,MAAUJ,EAAME,CAAK,CAAC,CAC9C,IAELE,EAAW,SAAS,MACpBU,EAAO,SAASV,EAAW,OAAO,WAClC,kBAAA,cAACW,GAAD;EACc;EACZ,QAAQjB,EAAM;EACR;EACN,MAAMgB;EACE;EACI;EACH;EACT,SAASP;EACT,WAAW,MAAST,EAAM,aAAaO,GAAMW,CAAI;EACjD,YAAYhB;EACG;CAChB,CAAA,CAEH,IA7DoB,kBAAA,cAAAJ,EAAA,UAAA,MAAGqB,EAAWC,EAAE,qBAAqB,CAAC,CAAI;AA+DpE;AACA,IAAMC,KAAkB,MACtB,SAAwB,EACtB,QACA,YAIC;CAED,OADKC,EAAI,WAEP,kBAAA,cAACC,GAAD;EACE,GAAIvB;EACJ,GAAIwB,EAA4BF,GAAKtB,CAAK;EAC1C,GAAIyB,EAA0BH,EAAI,QAAQ;CAC3C,CAAA,IANuB;AAQ5B,GAEWI,KACX,MACGC,EAAqBN,EAAevB,EAAM,KAAKyB,CAAS,CAAC,CAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.js"),t=require("./useTupleField.cjs.js"),n=require("../cells/compositeSummary.cjs.js");let r=require("react");r=e.t(r);let i=require("@jsonforms/core"),a=require("@jsonforms/react");function o(e){let{schema:o,index:s,uischema:c,enabled:l,options:u,CompositeDetailDialog:d,gap:f,legendStyle:p,renderEditButton:m,renderError:h}=e,{t:g,translator:_,i18nDefault:v,open:y,setOpen:b,message:x,path:S,value:C,renderSchema:w,complex:T,ownsLabel:E,label:D,intercept:O,scoped:k,detail:A}=t.useTupleField(e),j={...u,...c.options},M=()=>{if(o===!1)return h(g(`tuple.forbidden`),!1);if(T){var e;return r.default.createElement(`div`,{style:{display:`flex`,alignItems:`center`,gap:f}},r.default.createElement(`span`,{style:{flex:1,minWidth:0,overflowWrap:`anywhere`}},n.compositeSummary(C,(e=c.options)==null?void 0:e.summary,w.title,_,v)),m(g(`composite.edit`,{label:D}),!l,()=>b(!0)),r.default.createElement(d,{open:y,title:w.title??D,label:D,path:S,schema:w,enabled:l,options:j,t:_,onClose:()=>b(!1),onApply:e=>O({type:i.UPDATE_DATA,path:S,updater:()=>e})},r.default.createElement(a.JsonFormsDispatch,{schema:w,uischema:A,path:S,enabled:l})))}return r.default.createElement(a.JsonFormsDispatch,{schema:w,uischema:E?{...c,label:!1}:c,path:S,enabled:l})};return r.default.createElement(a.JsonFormsContext.Provider,{value:k},r.default.createElement(`fieldset`,{"data-tuple-field":s,style:{border:0,padding:0,margin:0,minWidth:0,flex:`1 1 0`}},E&&r.default.createElement(`legend`,{style:{display:`block`,width:`100%`,...p}},D),M(),x&&h(x,!0)))}exports.TupleField=o;
|
|
2
|
+
//# sourceMappingURL=TupleField.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TupleField.cjs.js","names":["useTupleField","compositeSummary","UPDATE_DATA","JsonFormsDispatch","JsonFormsContext","require_rolldown_runtime","require_tuple_useTupleField","require_cells_compositeSummary","react","_jsonforms_core","_jsonforms_react","TupleField","props","dialogOptions","options","uischema","body","schema","renderError","t","complex","_uischema$options","value","renderSchema","translator","i18nDefault","renderEditButton","enabled","setOpen","CompositeDetailDialog","label","intercept","applied","detail","ownsLabel","scoped","index","legendStyle","message"],"sources":["../../src/tuple/TupleField.tsx"],"sourcesContent":["import React from 'react';\nimport { type ControlElement, UPDATE_DATA } from '@jsonforms/core';\nimport { JsonFormsContext, JsonFormsDispatch } from '@jsonforms/react';\nimport { useTupleField, type TupleFieldBehaviorProps } from './useTupleField';\nimport { compositeSummary } from '../cells/compositeSummary';\nimport type { CompositeDetailDialogProps } from '../cells/useCompositeDraft';\n\nexport interface TupleFieldProps extends TupleFieldBehaviorProps {\n options: Record<string, any>;\n}\n\ninterface TupleFieldPresentation {\n CompositeDetailDialog: React.ComponentType<CompositeDetailDialogProps>;\n gap: number;\n legendStyle: React.CSSProperties;\n renderEditButton: (\n label: string,\n disabled: boolean,\n open: () => void,\n ) => React.ReactNode;\n renderError: (message: string, draft: boolean) => React.ReactNode;\n}\n\nexport function TupleField(props: TupleFieldProps & TupleFieldPresentation) {\n const {\n schema,\n index,\n uischema,\n enabled,\n options,\n CompositeDetailDialog,\n gap,\n legendStyle,\n renderEditButton,\n renderError,\n } = props;\n const {\n t,\n translator,\n i18nDefault,\n open,\n setOpen,\n message,\n path,\n value,\n renderSchema,\n complex,\n ownsLabel,\n label,\n intercept,\n scoped,\n detail,\n } = useTupleField(props);\n const dialogOptions = {\n ...options,\n ...uischema.options,\n };\n\n const body = () => {\n if (schema === false) {\n return renderError(t('tuple.forbidden'), false);\n }\n if (complex) {\n return (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap,\n }}\n >\n <span style={{ flex: 1, minWidth: 0, overflowWrap: 'anywhere' }}>\n {compositeSummary(\n value,\n uischema.options?.summary as ControlElement | undefined,\n renderSchema.title,\n translator,\n i18nDefault,\n )}\n </span>\n {renderEditButton(t('composite.edit', { label }), !enabled, () =>\n setOpen(true),\n )}\n <CompositeDetailDialog\n open={open}\n title={renderSchema.title ?? label}\n label={label}\n path={path}\n schema={renderSchema}\n enabled={enabled}\n options={dialogOptions}\n t={translator}\n onClose={() => setOpen(false)}\n onApply={(applied) =>\n intercept({\n type: UPDATE_DATA,\n path,\n updater: () => applied,\n })\n }\n >\n <JsonFormsDispatch\n schema={renderSchema}\n uischema={detail}\n path={path}\n enabled={enabled}\n />\n </CompositeDetailDialog>\n </div>\n );\n }\n return (\n <JsonFormsDispatch\n schema={renderSchema}\n // The label is drawn by the fieldset legend when this position owns it,\n // so the delegated control must not draw it again.\n uischema={\n ownsLabel\n ? ({ ...uischema, label: false } as ControlElement)\n : uischema\n }\n path={path}\n enabled={enabled}\n />\n );\n };\n\n return (\n <JsonFormsContext.Provider value={scoped}>\n <fieldset\n data-tuple-field={index}\n style={{ border: 0, padding: 0, margin: 0, minWidth: 0, flex: '1 1 0' }}\n >\n {ownsLabel && (\n <legend\n style={{\n display: 'block',\n width: '100%',\n ...legendStyle,\n }}\n >\n {label}\n </legend>\n )}\n {body()}\n {message && renderError(message, true)}\n </fieldset>\n </JsonFormsContext.Provider>\n );\n}\n"],"mappings":"A,uSAuBA,SAAgBW,EAAW,EAAiD,CAC1E,GAAM,CACJ,SACA,QACA,WACA,UACA,UACA,wBACA,MACA,cACA,mBACA,eACEC,EACE,CACJ,IACA,aACA,cACA,OACA,UACA,UACA,OACA,QACA,eACA,UACA,YACA,QACA,YACA,SACA,UACEZ,EAAAA,cAAcY,CAAK,EACjBC,EAAgB,CACpB,GAAGC,EACH,GAAGC,EAAS,OACd,EAEMC,MAAa,CACjB,GAAIC,IAAW,GACb,OAAOC,EAAYC,EAAE,iBAAiB,EAAG,EAAK,EAEhD,GAAIC,EAAS,C,MACX,OACEZ,EAAA,QAAA,cAAC,MAAD,CACE,MAAO,CACL,QAAS,OACT,WAAY,SACZ,KACF,CAuCG,EArCHA,EAAA,QAAA,cAAC,OAAD,CAAM,MAAO,CAAE,KAAM,EAAG,SAAU,EAAG,aAAc,UAAW,CAQxD,EAPHP,EAAAA,iBACCqB,GAAA,EACAP,EAAS,UAAA,KAAA,IAAA,GAAAM,EAAS,QAClBE,EAAa,MACbC,EACAC,CACF,CACI,EACLC,EAAiBP,EAAE,iBAAkB,CAAE,OAAM,CAAC,EAAG,CAACQ,MACjDC,EAAQ,EAAI,CACd,EACApB,EAAA,QAAA,cAACqB,EAAD,CACQ,OACN,MAAON,EAAa,OAASO,EACtB,QACD,OACN,OAAQP,EACC,UACT,QAASV,EACT,EAAGW,EACH,YAAeI,EAAQ,EAAK,EAC5B,QAAU,GACRG,EAAU,CACR,KAAM7B,EAAAA,YACN,OACA,YAAe8B,CACjB,CAAC,CASkB,EANrBxB,EAAA,QAAA,cAACL,EAAAA,kBAAD,CACE,OAAQoB,EACR,SAAUU,EACJ,OACG,SACV,CAAA,CACoB,CACpB,CAET,CACA,OACEzB,EAAA,QAAA,cAACL,EAAAA,kBAAD,CACE,OAAQoB,EAGR,SACEW,EACK,CAAE,GAAGnB,EAAU,MAAO,EAAM,EAC7BA,EAEA,OACG,SACV,CAAA,CAEL,EAEA,OACEP,EAAA,QAAA,cAACJ,EAAAA,iBAAiB,SAAlB,CAA2B,MAAO+B,CAmBP,EAlBzB3B,EAAA,QAAA,cAAC,WAAD,CACE,mBAAkB4B,EAClB,MAAO,CAAE,OAAQ,EAAG,QAAS,EAAG,OAAQ,EAAG,SAAU,EAAG,KAAM,OAAQ,CAe9D,EAbPF,GACC1B,EAAA,QAAA,cAAC,SAAD,CACE,MAAO,CACL,QAAS,QACT,MAAO,OACP,GAAG6B,CACL,CAGM,EADLP,CACK,EAETd,EAAK,EACLsB,GAAWpB,EAAYoB,EAAS,EAAI,CAC7B,CACe,CAE/B,C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TupleFieldBehaviorProps } from './useTupleField';
|
|
3
|
+
import type { CompositeDetailDialogProps } from '../cells/useCompositeDraft';
|
|
4
|
+
export interface TupleFieldProps extends TupleFieldBehaviorProps {
|
|
5
|
+
options: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
interface TupleFieldPresentation {
|
|
8
|
+
CompositeDetailDialog: React.ComponentType<CompositeDetailDialogProps>;
|
|
9
|
+
gap: number;
|
|
10
|
+
legendStyle: React.CSSProperties;
|
|
11
|
+
renderEditButton: (label: string, disabled: boolean, open: () => void) => React.ReactNode;
|
|
12
|
+
renderError: (message: string, draft: boolean) => React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function TupleField(props: TupleFieldProps & TupleFieldPresentation): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useTupleField as e } from "./useTupleField.esm.js";
|
|
2
|
+
import { compositeSummary as t } from "../cells/compositeSummary.esm.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import { UPDATE_DATA as r } from "@jsonforms/core";
|
|
5
|
+
import { JsonFormsContext as i, JsonFormsDispatch as a } from "@jsonforms/react";
|
|
6
|
+
// src/tuple/TupleField.tsx
|
|
7
|
+
function o(o) {
|
|
8
|
+
let { schema: s, index: c, uischema: l, enabled: u, options: d, CompositeDetailDialog: f, gap: p, legendStyle: m, renderEditButton: h, renderError: g } = o, { t: _, translator: v, i18nDefault: y, open: b, setOpen: x, message: S, path: C, value: w, renderSchema: T, complex: E, ownsLabel: D, label: O, intercept: k, scoped: A, detail: j } = e(o), M = {
|
|
9
|
+
...d,
|
|
10
|
+
...l.options
|
|
11
|
+
}, N = () => {
|
|
12
|
+
if (s === !1) return g(_("tuple.forbidden"), !1);
|
|
13
|
+
if (E) {
|
|
14
|
+
var e;
|
|
15
|
+
return /* @__PURE__ */ n.createElement("div", { style: {
|
|
16
|
+
display: "flex",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
gap: p
|
|
19
|
+
} }, /* @__PURE__ */ n.createElement("span", { style: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
minWidth: 0,
|
|
22
|
+
overflowWrap: "anywhere"
|
|
23
|
+
} }, t(w, (e = l.options) == null ? void 0 : e.summary, T.title, v, y)), h(_("composite.edit", { label: O }), !u, () => x(!0)), /* @__PURE__ */ n.createElement(f, {
|
|
24
|
+
open: b,
|
|
25
|
+
title: T.title ?? O,
|
|
26
|
+
label: O,
|
|
27
|
+
path: C,
|
|
28
|
+
schema: T,
|
|
29
|
+
enabled: u,
|
|
30
|
+
options: M,
|
|
31
|
+
t: v,
|
|
32
|
+
onClose: () => x(!1),
|
|
33
|
+
onApply: (e) => k({
|
|
34
|
+
type: r,
|
|
35
|
+
path: C,
|
|
36
|
+
updater: () => e
|
|
37
|
+
})
|
|
38
|
+
}, /* @__PURE__ */ n.createElement(a, {
|
|
39
|
+
schema: T,
|
|
40
|
+
uischema: j,
|
|
41
|
+
path: C,
|
|
42
|
+
enabled: u
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ n.createElement(a, {
|
|
46
|
+
schema: T,
|
|
47
|
+
uischema: D ? {
|
|
48
|
+
...l,
|
|
49
|
+
label: !1
|
|
50
|
+
} : l,
|
|
51
|
+
path: C,
|
|
52
|
+
enabled: u
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ n.createElement(i.Provider, { value: A }, /* @__PURE__ */ n.createElement("fieldset", {
|
|
56
|
+
"data-tuple-field": c,
|
|
57
|
+
style: {
|
|
58
|
+
border: 0,
|
|
59
|
+
padding: 0,
|
|
60
|
+
margin: 0,
|
|
61
|
+
minWidth: 0,
|
|
62
|
+
flex: "1 1 0"
|
|
63
|
+
}
|
|
64
|
+
}, D && /* @__PURE__ */ n.createElement("legend", { style: {
|
|
65
|
+
display: "block",
|
|
66
|
+
width: "100%",
|
|
67
|
+
...m
|
|
68
|
+
} }, O), N(), S && g(S, !0)));
|
|
69
|
+
}
|
|
70
|
+
export { o as TupleField };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=TupleField.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TupleField.esm.js","names":["React","TupleField","props","useTupleField","dialogOptions","options","uischema","body","schema","renderError","t","complex","_uischema$options","compositeSummary","value","renderSchema","translator","i18nDefault","renderEditButton","enabled","setOpen","CompositeDetailDialog","label","intercept","UPDATE_DATA","applied","JsonFormsDispatch","detail","ownsLabel","JsonFormsContext","scoped","index","legendStyle","message"],"sources":["../../src/tuple/TupleField.tsx"],"sourcesContent":["import React from 'react';\nimport { type ControlElement, UPDATE_DATA } from '@jsonforms/core';\nimport { JsonFormsContext, JsonFormsDispatch } from '@jsonforms/react';\nimport { useTupleField, type TupleFieldBehaviorProps } from './useTupleField';\nimport { compositeSummary } from '../cells/compositeSummary';\nimport type { CompositeDetailDialogProps } from '../cells/useCompositeDraft';\n\nexport interface TupleFieldProps extends TupleFieldBehaviorProps {\n options: Record<string, any>;\n}\n\ninterface TupleFieldPresentation {\n CompositeDetailDialog: React.ComponentType<CompositeDetailDialogProps>;\n gap: number;\n legendStyle: React.CSSProperties;\n renderEditButton: (\n label: string,\n disabled: boolean,\n open: () => void,\n ) => React.ReactNode;\n renderError: (message: string, draft: boolean) => React.ReactNode;\n}\n\nexport function TupleField(props: TupleFieldProps & TupleFieldPresentation) {\n const {\n schema,\n index,\n uischema,\n enabled,\n options,\n CompositeDetailDialog,\n gap,\n legendStyle,\n renderEditButton,\n renderError,\n } = props;\n const {\n t,\n translator,\n i18nDefault,\n open,\n setOpen,\n message,\n path,\n value,\n renderSchema,\n complex,\n ownsLabel,\n label,\n intercept,\n scoped,\n detail,\n } = useTupleField(props);\n const dialogOptions = {\n ...options,\n ...uischema.options,\n };\n\n const body = () => {\n if (schema === false) {\n return renderError(t('tuple.forbidden'), false);\n }\n if (complex) {\n return (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap,\n }}\n >\n <span style={{ flex: 1, minWidth: 0, overflowWrap: 'anywhere' }}>\n {compositeSummary(\n value,\n uischema.options?.summary as ControlElement | undefined,\n renderSchema.title,\n translator,\n i18nDefault,\n )}\n </span>\n {renderEditButton(t('composite.edit', { label }), !enabled, () =>\n setOpen(true),\n )}\n <CompositeDetailDialog\n open={open}\n title={renderSchema.title ?? label}\n label={label}\n path={path}\n schema={renderSchema}\n enabled={enabled}\n options={dialogOptions}\n t={translator}\n onClose={() => setOpen(false)}\n onApply={(applied) =>\n intercept({\n type: UPDATE_DATA,\n path,\n updater: () => applied,\n })\n }\n >\n <JsonFormsDispatch\n schema={renderSchema}\n uischema={detail}\n path={path}\n enabled={enabled}\n />\n </CompositeDetailDialog>\n </div>\n );\n }\n return (\n <JsonFormsDispatch\n schema={renderSchema}\n // The label is drawn by the fieldset legend when this position owns it,\n // so the delegated control must not draw it again.\n uischema={\n ownsLabel\n ? ({ ...uischema, label: false } as ControlElement)\n : uischema\n }\n path={path}\n enabled={enabled}\n />\n );\n };\n\n return (\n <JsonFormsContext.Provider value={scoped}>\n <fieldset\n data-tuple-field={index}\n style={{ border: 0, padding: 0, margin: 0, minWidth: 0, flex: '1 1 0' }}\n >\n {ownsLabel && (\n <legend\n style={{\n display: 'block',\n width: '100%',\n ...legendStyle,\n }}\n >\n {label}\n </legend>\n )}\n {body()}\n {message && renderError(message, true)}\n </fieldset>\n </JsonFormsContext.Provider>\n );\n}\n"],"mappings":";;;;;;AAuBA,SAAgBC,EAAW,GAAiD;CAC1E,IAAM,EACJ,WACA,UACA,aACA,YACA,YACA,0BACA,QACA,gBACA,qBACA,mBACEC,GACE,EACJ,MACA,eACA,gBACA,SACA,YACA,YACA,SACA,UACA,iBACA,YACA,cACA,UACA,cACA,WACA,cACEC,EAAcD,CAAK,GACjBE,IAAgB;EACpB,GAAGC;EACH,GAAGC,EAAS;CACd,GAEMC,UAAa;EACjB,IAAIC,MAAW,IACb,OAAOC,EAAYC,EAAE,iBAAiB,GAAG,EAAK;EAEhD,IAAIC,GAAS;;GACX,OACE,kBAAA,cAAC,OAAD,EACE,OAAO;IACL,SAAS;IACT,YAAY;IACZ;GACF,EAuCG,GArCH,kBAAA,cAAC,QAAD,EAAM,OAAO;IAAE,MAAM;IAAG,UAAU;IAAG,cAAc;GAAW,EAQxD,GAPHE,EACCC,IAAA,IACAR,EAAS,YAAA,OAAA,KAAA,IAAAM,EAAS,SAClBG,EAAa,OACbC,GACAC,CACF,CACI,GACLC,EAAiBR,EAAE,kBAAkB,EAAE,SAAM,CAAC,GAAG,CAACS,SACjDC,EAAQ,EAAI,CACd,GACA,kBAAA,cAACC,GAAD;IACQ;IACN,OAAON,EAAa,SAASO;IACtB;IACD;IACN,QAAQP;IACC;IACT,SAASX;IACT,GAAGY;IACH,eAAeI,EAAQ,EAAK;IAC5B,UAAU,MACRG,EAAU;KACR,MAAMC;KACN;KACA,eAAeC;IACjB,CAAC;GASkB,GANrB,kBAAA,cAACC,GAAD;IACE,QAAQX;IACR,UAAUY;IACJ;IACG;GACV,CAAA,CACoB,CACpB;EAET;EACA,OACE,kBAAA,cAACD,GAAD;GACE,QAAQX;GAGR,UACEa,IACK;IAAE,GAAGtB;IAAU,OAAO;GAAM,IAC7BA;GAEA;GACG;EACV,CAAA;CAEL;CAEA,OACE,kBAAA,cAACuB,EAAiB,UAAlB,EAA2B,OAAOC,EAmBP,GAlBzB,kBAAA,cAAC,YAAD;EACE,oBAAkBC;EAClB,OAAO;GAAE,QAAQ;GAAG,SAAS;GAAG,QAAQ;GAAG,UAAU;GAAG,MAAM;EAAQ;CAe9D,GAbPH,KACC,kBAAA,cAAC,UAAD,EACE,OAAO;EACL,SAAS;EACT,OAAO;EACP,GAAGI;CACL,EAGM,GADLV,CACK,GAETf,EAAK,GACL0B,KAAWxB,EAAYwB,GAAS,EAAI,CAC7B,CACe;AAE/B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BocRIvOZ.js");let t=require("@jsonforms/core"),n=require("lodash/cloneDeep");n=e.t(n);var r=(e,t=!1)=>{let n=e;if((n==null?void 0:n.type)!==`array`)return;if(Array.isArray(n.prefixItems))return{prefix:n.prefixItems,tail:n.items??!0};if(Array.isArray(n.items))return{prefix:n.items,tail:n.additionalItems??!0};let{minItems:r,maxItems:i}=n;if(t&&Number.isInteger(r)&&r>=0&&r===i)return{prefix:Array.from({length:r},()=>n.items??!0),tail:!1}},i=(e,n,i)=>{var a;if(!(0,t.isControl)(e))return-1;let o=t.Resolve.schema(n,e.scope,(i==null?void 0:i.rootSchema)??n);return((a=e.options)==null?void 0:a.variant)===`tuple`||o&&r(o)?25:-1},a=(e,n)=>typeof e==`object`&&e.$ref?t.Resolve.schema(n,e.$ref,n)??e:e,o=(e,r)=>{let i=a(e,r);if(typeof i==`object`){if(i.default!==void 0)return(0,n.default)(i.default);switch(i.type){case`string`:return``;case`integer`:case`number`:return 0;case`boolean`:return!1;case`null`:return null;case`array`:return[];case`object`:return(0,t.extractDefaults)(i,r);default:return}}},s=(e,t)=>{let n=a(e,t);if(typeof n==`object`){if(n.type===`string`)return``;if(n.type===`array`)return[];if(n.type===`object`)return{};if(n.type===`null`||Array.isArray(n.type)&&n.type.includes(`null`))return null}},c=[`string`,`number`,`integer`,`boolean`,`object`,`array`,`null`],l=e=>e===!0||typeof e==`object`&&Object.keys(e).length===0?{type:c}:e,u=e=>typeof e==`object`&&(e.type===`object`||e.type===`array`),d=e=>{if(e===!1||u(e))return!0;let t=l(e);return!t.type||Array.isArray(t.type)};exports.UNCONSTRAINED_TYPES=c,exports.isComplexTupleSchema=u,exports.resolveTupleSchema=a,exports.tupleControlTester=i,exports.tupleDefinition=r,exports.tupleEmptyValue=s,exports.tupleFieldOwnsLabel=d,exports.tupleInitialValue=o,exports.tupleRenderSchema=l;
|
|
2
|
+
//# sourceMappingURL=tupleSchema.cjs.js.map
|