@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,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color parsing and serialization for the color control.
|
|
3
|
+
*
|
|
4
|
+
* Section 18 of the portable specification makes "color syntax, parsing,
|
|
5
|
+
* serialization, and validator registration one coherent contract", so all of
|
|
6
|
+
* it lives in one module with no React and no antd in it: the control wires
|
|
7
|
+
* widgets to these functions and nothing else decides what a stored color
|
|
8
|
+
* looks like.
|
|
9
|
+
*
|
|
10
|
+
* Why not delegate to the picker's own color object? Two reasons.
|
|
11
|
+
*
|
|
12
|
+
* - **It cannot report failure.** antd's `AggregationColor` wraps
|
|
13
|
+
* `@ant-design/fast-color`, which silently yields opaque black for anything
|
|
14
|
+
* it does not recognize. The specification requires the opposite: "invalid or
|
|
15
|
+
* unsupported incoming values remain visible with errors rather than being
|
|
16
|
+
* replaced by the picker's fallback color". A parser that answers `#000000`
|
|
17
|
+
* to `not a color` cannot support that, so {@link parseColor} returns
|
|
18
|
+
* `undefined` instead and the raw text stays in the data for validation to
|
|
19
|
+
* report.
|
|
20
|
+
* - **Its output text is not the specified text.** `toRgbString()` emits
|
|
21
|
+
* `rgb(0,255,0)` - no spaces - while the specification fixes the serialized
|
|
22
|
+
* form as `rgb(r, g, b)`. `@ant-design/fast-color` is also a transitive
|
|
23
|
+
* dependency of antd rather than one this package declares, so its exact
|
|
24
|
+
* spelling is not ours to rely on.
|
|
25
|
+
*
|
|
26
|
+
* Hue normalization policy, which section 18 asks each implementation to
|
|
27
|
+
* document: hue is reduced into `[0, 360)` and rounded to a whole degree, so
|
|
28
|
+
* `hsb(-30, ...)` and `hsb(330, ...)` serialize identically. Saturation,
|
|
29
|
+
* lightness and brightness are rounded to whole percentages; alpha is rounded
|
|
30
|
+
* to two decimals. Round-tripping through a representation with fewer bits than
|
|
31
|
+
* 8-bit RGB is therefore lossy by construction - see {@link serializeColor}.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The representations a stored color can be serialized to.
|
|
36
|
+
*
|
|
37
|
+
* `hsl` is **accepted as input but never emitted**, which differs from section
|
|
38
|
+
* 18's list of four save formats. antd's picker edits in HSB and offers no HSL
|
|
39
|
+
* panel, and a save format the editor cannot display is a trap: the user drags
|
|
40
|
+
* one model and the data records another, with a double rounding between them.
|
|
41
|
+
* Every format here is one the picker can show, so what is edited is what is
|
|
42
|
+
* stored. See Adjustment 8.1.
|
|
43
|
+
*/
|
|
44
|
+
export type ColorSaveFormat = 'hex' | 'hex3' | 'rgb' | 'hsb';
|
|
45
|
+
|
|
46
|
+
/** Every supported save format, in the order the documentation lists them. */
|
|
47
|
+
export const COLOR_SAVE_FORMATS: ColorSaveFormat[] = [
|
|
48
|
+
'hex',
|
|
49
|
+
'hex3',
|
|
50
|
+
'rgb',
|
|
51
|
+
'hsb',
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
export const DEFAULT_COLOR_SAVE_FORMAT: ColorSaveFormat = 'hex';
|
|
55
|
+
|
|
56
|
+
/** A parsed color: 8-bit channels plus alpha in `[0, 1]`. */
|
|
57
|
+
export interface Rgba {
|
|
58
|
+
r: number;
|
|
59
|
+
g: number;
|
|
60
|
+
b: number;
|
|
61
|
+
a: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Narrows an authored `colorSaveFormat` to a supported one.
|
|
66
|
+
*
|
|
67
|
+
* An unrecognized value falls back to `hex` rather than being passed through:
|
|
68
|
+
* before this existed, `colorSaveFormat: "rgb"` was simply not matched and
|
|
69
|
+
* silently produced hex, which is the same outcome but by accident. Doing it
|
|
70
|
+
* here keeps the fallback in one place and lets a caller detect the mismatch.
|
|
71
|
+
*/
|
|
72
|
+
export const asColorSaveFormat = (value: unknown): ColorSaveFormat =>
|
|
73
|
+
COLOR_SAVE_FORMATS.includes(value as ColorSaveFormat)
|
|
74
|
+
? (value as ColorSaveFormat)
|
|
75
|
+
: DEFAULT_COLOR_SAVE_FORMAT;
|
|
76
|
+
|
|
77
|
+
const clamp = (value: number, min: number, max: number): number =>
|
|
78
|
+
Math.min(max, Math.max(min, value));
|
|
79
|
+
|
|
80
|
+
/** Reduces a hue in degrees into `[0, 360)`, rounded to a whole degree. */
|
|
81
|
+
export const normalizeHue = (hue: number): number => {
|
|
82
|
+
const rounded = Math.round(hue);
|
|
83
|
+
return ((rounded % 360) + 360) % 360;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
87
|
+
const FUNCTIONAL = /^(rgba?|hsla?|hsba?)\(([^()]*)\)$/i;
|
|
88
|
+
|
|
89
|
+
/** `12`, `12.5`, `-3`, `50%` - a single functional-notation argument. */
|
|
90
|
+
const NUMBER = /^[+-]?(?:\d+\.?\d*|\.\d+)%?$/;
|
|
91
|
+
|
|
92
|
+
const parseArgs = (
|
|
93
|
+
text: string,
|
|
94
|
+
): { value: number; percent: boolean }[] | undefined => {
|
|
95
|
+
// CSS Color 4 permits `rgb(0 255 0 / 50%)`; the specification's initial
|
|
96
|
+
// profile is the comma-separated form only, so a space-separated argument
|
|
97
|
+
// list is a parse failure rather than a second accepted syntax.
|
|
98
|
+
const parts = text.split(',').map((part) => part.trim());
|
|
99
|
+
const parsed = parts.map((part) => {
|
|
100
|
+
if (!NUMBER.test(part)) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
const percent = part.endsWith('%');
|
|
104
|
+
return {
|
|
105
|
+
value: Number(percent ? part.slice(0, -1) : part),
|
|
106
|
+
percent,
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
return parsed.every((part) => part !== undefined)
|
|
110
|
+
? (parsed as { value: number; percent: boolean }[])
|
|
111
|
+
: undefined;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const parseAlpha = (
|
|
115
|
+
arg: { value: number; percent: boolean } | undefined,
|
|
116
|
+
): number | undefined => {
|
|
117
|
+
if (arg === undefined) {
|
|
118
|
+
return 1;
|
|
119
|
+
}
|
|
120
|
+
const alpha = arg.percent ? arg.value / 100 : arg.value;
|
|
121
|
+
return alpha >= 0 && alpha <= 1 ? alpha : undefined;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const expand3 = (hex: string): string =>
|
|
125
|
+
[...hex].map((digit) => digit + digit).join('');
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Parses any representation in the supported input profile.
|
|
129
|
+
*
|
|
130
|
+
* The profile, per section 18: `#RGB`, `#RRGGBB` and `#RRGGBBAA` in either
|
|
131
|
+
* letter case, plus `rgb()`/`rgba()`, `hsl()`/`hsla()` and - by Adjustment 8 -
|
|
132
|
+
* `hsb()`/`hsba()`. Named CSS colors, further color spaces and the remaining
|
|
133
|
+
* CSS syntaxes are explicitly outside it.
|
|
134
|
+
*
|
|
135
|
+
* Returns `undefined` for anything else, including `#RGBA`: four-digit hex is
|
|
136
|
+
* not in the profile, and accepting it here would mean emitting a
|
|
137
|
+
* representation the registered format validator is not required to accept.
|
|
138
|
+
*/
|
|
139
|
+
export const parseColor = (value: unknown): Rgba | undefined => {
|
|
140
|
+
if (typeof value !== 'string') {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
const text = value.trim();
|
|
144
|
+
if (HEX.test(text)) {
|
|
145
|
+
const digits = text.slice(1);
|
|
146
|
+
const full = digits.length === 3 ? expand3(digits) : digits;
|
|
147
|
+
return {
|
|
148
|
+
r: parseInt(full.slice(0, 2), 16),
|
|
149
|
+
g: parseInt(full.slice(2, 4), 16),
|
|
150
|
+
b: parseInt(full.slice(4, 6), 16),
|
|
151
|
+
a: full.length === 8 ? parseInt(full.slice(6, 8), 16) / 255 : 1,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const functional = FUNCTIONAL.exec(text);
|
|
155
|
+
if (!functional) {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
const name = functional[1].toLowerCase();
|
|
159
|
+
const args = parseArgs(functional[2]);
|
|
160
|
+
if (!args || args.length < 3 || args.length > 4) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
// `rgba(...)` with three arguments is opaque, and `rgb(...)` with four
|
|
164
|
+
// carries alpha; CSS Color 4 made the two names synonyms, and rejecting the
|
|
165
|
+
// combination would refuse text browsers accept.
|
|
166
|
+
const alpha = parseAlpha(args[3]);
|
|
167
|
+
if (alpha === undefined) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
if (name.startsWith('rgb')) {
|
|
171
|
+
// Section 18: "RGB channels are integers from 0 to 255". Percentage
|
|
172
|
+
// channels are not in the profile, and a value outside the range is a
|
|
173
|
+
// typing error worth reporting rather than clamping into a different
|
|
174
|
+
// color the author did not write.
|
|
175
|
+
const channels = args.slice(0, 3);
|
|
176
|
+
if (
|
|
177
|
+
channels.some(
|
|
178
|
+
({ value: channel, percent }) =>
|
|
179
|
+
percent || !Number.isInteger(channel) || channel < 0 || channel > 255,
|
|
180
|
+
)
|
|
181
|
+
) {
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
r: channels[0].value,
|
|
186
|
+
g: channels[1].value,
|
|
187
|
+
b: channels[2].value,
|
|
188
|
+
a: alpha,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
// The `%` sign is optional on input for saturation, lightness and
|
|
192
|
+
// brightness - a hand-typed `hsl(120, 100, 50)` means the obvious thing -
|
|
193
|
+
// but serialization always writes it.
|
|
194
|
+
const hue = args[0].percent ? undefined : args[0].value;
|
|
195
|
+
if (hue === undefined) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
const second = args[1].value;
|
|
199
|
+
const third = args[2].value;
|
|
200
|
+
if (second < 0 || second > 100 || third < 0 || third > 100) {
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
const rgb = name.startsWith('hsl')
|
|
204
|
+
? hslToRgb(hue, second, third)
|
|
205
|
+
: hsbToRgb(hue, second, third);
|
|
206
|
+
return { ...rgb, a: alpha };
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/** Whether a value is a color this profile recognizes. */
|
|
210
|
+
export const isColor = (value: unknown): boolean =>
|
|
211
|
+
parseColor(value) !== undefined;
|
|
212
|
+
|
|
213
|
+
/** Whether a parsed color carries transparency. */
|
|
214
|
+
export const isTransparent = (color: Rgba): boolean => color.a < 1;
|
|
215
|
+
|
|
216
|
+
const hueToRgbChannel = (p: number, q: number, t: number): number => {
|
|
217
|
+
let shifted = t;
|
|
218
|
+
if (shifted < 0) shifted += 1;
|
|
219
|
+
if (shifted > 1) shifted -= 1;
|
|
220
|
+
if (shifted < 1 / 6) return p + (q - p) * 6 * shifted;
|
|
221
|
+
if (shifted < 1 / 2) return q;
|
|
222
|
+
if (shifted < 2 / 3) return p + (q - p) * (2 / 3 - shifted) * 6;
|
|
223
|
+
return p;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/** `h` in degrees, `s`/`l` as percentages. */
|
|
227
|
+
export const hslToRgb = (
|
|
228
|
+
h: number,
|
|
229
|
+
s: number,
|
|
230
|
+
l: number,
|
|
231
|
+
): { r: number; g: number; b: number } => {
|
|
232
|
+
const hue = normalizeHue(h) / 360;
|
|
233
|
+
const saturation = clamp(s, 0, 100) / 100;
|
|
234
|
+
const lightness = clamp(l, 0, 100) / 100;
|
|
235
|
+
if (saturation === 0) {
|
|
236
|
+
const gray = Math.round(lightness * 255);
|
|
237
|
+
return { r: gray, g: gray, b: gray };
|
|
238
|
+
}
|
|
239
|
+
const q =
|
|
240
|
+
lightness < 0.5
|
|
241
|
+
? lightness * (1 + saturation)
|
|
242
|
+
: lightness + saturation - lightness * saturation;
|
|
243
|
+
const p = 2 * lightness - q;
|
|
244
|
+
return {
|
|
245
|
+
r: Math.round(hueToRgbChannel(p, q, hue + 1 / 3) * 255),
|
|
246
|
+
g: Math.round(hueToRgbChannel(p, q, hue) * 255),
|
|
247
|
+
b: Math.round(hueToRgbChannel(p, q, hue - 1 / 3) * 255),
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/** `h` in degrees, `s`/`b` as percentages. HSB is HSV under antd's name. */
|
|
252
|
+
export const hsbToRgb = (
|
|
253
|
+
h: number,
|
|
254
|
+
s: number,
|
|
255
|
+
b: number,
|
|
256
|
+
): { r: number; g: number; b: number } => {
|
|
257
|
+
const hue = normalizeHue(h) / 60;
|
|
258
|
+
const saturation = clamp(s, 0, 100) / 100;
|
|
259
|
+
const brightness = clamp(b, 0, 100) / 100;
|
|
260
|
+
const sector = Math.floor(hue) % 6;
|
|
261
|
+
const offset = hue - Math.floor(hue);
|
|
262
|
+
const p = brightness * (1 - saturation);
|
|
263
|
+
const q = brightness * (1 - saturation * offset);
|
|
264
|
+
const t = brightness * (1 - saturation * (1 - offset));
|
|
265
|
+
const [r, g, blue] = [
|
|
266
|
+
[brightness, t, p],
|
|
267
|
+
[q, brightness, p],
|
|
268
|
+
[p, brightness, t],
|
|
269
|
+
[p, q, brightness],
|
|
270
|
+
[t, p, brightness],
|
|
271
|
+
[brightness, p, q],
|
|
272
|
+
][sector];
|
|
273
|
+
return {
|
|
274
|
+
r: Math.round(r * 255),
|
|
275
|
+
g: Math.round(g * 255),
|
|
276
|
+
b: Math.round(blue * 255),
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export const rgbToHsb = (color: Rgba): { h: number; s: number; b: number } => {
|
|
281
|
+
const r = color.r / 255;
|
|
282
|
+
const g = color.g / 255;
|
|
283
|
+
const b = color.b / 255;
|
|
284
|
+
const max = Math.max(r, g, b);
|
|
285
|
+
const delta = max - Math.min(r, g, b);
|
|
286
|
+
return {
|
|
287
|
+
h: delta === 0 ? 0 : normalizeHue(hueOf(r, g, b, max, delta)),
|
|
288
|
+
s: max === 0 ? 0 : Math.round((delta / max) * 100),
|
|
289
|
+
b: Math.round(max * 100),
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const hueOf = (
|
|
294
|
+
r: number,
|
|
295
|
+
g: number,
|
|
296
|
+
b: number,
|
|
297
|
+
max: number,
|
|
298
|
+
delta: number,
|
|
299
|
+
): number => {
|
|
300
|
+
const sixth =
|
|
301
|
+
max === r
|
|
302
|
+
? ((g - b) / delta + (g < b ? 6 : 0)) / 6
|
|
303
|
+
: max === g
|
|
304
|
+
? ((b - r) / delta + 2) / 6
|
|
305
|
+
: ((r - g) / delta + 4) / 6;
|
|
306
|
+
return sixth * 360;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const pad = (channel: number): string => channel.toString(16).padStart(2, '0');
|
|
310
|
+
|
|
311
|
+
/** Two decimals, with no trailing zeros: `0.5`, `0.25`, `1`. */
|
|
312
|
+
const formatAlpha = (a: number): string => String(Math.round(a * 100) / 100);
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Quantizes an 8-bit channel to its nearest three-digit-hex digit.
|
|
316
|
+
*
|
|
317
|
+
* Section 18 fixes the arithmetic as `round(channel / 17)`, and names the
|
|
318
|
+
* vector: `#ed5050` becomes `#e55`, which represents `#ee5555`. This picks the
|
|
319
|
+
* nearest of the 4,096 representable colors; it is not a lossless abbreviation.
|
|
320
|
+
*/
|
|
321
|
+
const toHex3Digit = (channel: number): string =>
|
|
322
|
+
Math.round(channel / 17).toString(16);
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Writes a parsed color in the requested representation.
|
|
326
|
+
*
|
|
327
|
+
* Returns `undefined` only for `hex3` with transparency, which the
|
|
328
|
+
* specification says must never silently discard alpha: the caller refuses the
|
|
329
|
+
* edit and shows `color.hex3Transparency` instead of committing an opaque
|
|
330
|
+
* replacement.
|
|
331
|
+
*
|
|
332
|
+
* Every other format round-trips through 8-bit RGB, so `hsb` output is
|
|
333
|
+
* quantized twice - once into 8-bit channels and once into whole percentages.
|
|
334
|
+
* Re-saving the same color is stable.
|
|
335
|
+
*
|
|
336
|
+
* There is no `hsl` case: HSL is accepted as *input*, via {@link hslToRgb},
|
|
337
|
+
* but is never written, because the picker cannot edit it. There is
|
|
338
|
+
* deliberately no rgb-to-hsl conversion here at all - an unused inverse would
|
|
339
|
+
* read as an output format that exists. See {@link ColorSaveFormat}.
|
|
340
|
+
*/
|
|
341
|
+
export const serializeColor = (
|
|
342
|
+
color: Rgba,
|
|
343
|
+
format: ColorSaveFormat,
|
|
344
|
+
): string | undefined => {
|
|
345
|
+
const opaque = !isTransparent(color);
|
|
346
|
+
switch (format) {
|
|
347
|
+
case 'hex3':
|
|
348
|
+
if (!opaque) {
|
|
349
|
+
return undefined;
|
|
350
|
+
}
|
|
351
|
+
return `#${toHex3Digit(color.r)}${toHex3Digit(color.g)}${toHex3Digit(
|
|
352
|
+
color.b,
|
|
353
|
+
)}`;
|
|
354
|
+
case 'rgb':
|
|
355
|
+
return opaque
|
|
356
|
+
? `rgb(${color.r}, ${color.g}, ${color.b})`
|
|
357
|
+
: `rgba(${color.r}, ${color.g}, ${color.b}, ${formatAlpha(color.a)})`;
|
|
358
|
+
case 'hsb': {
|
|
359
|
+
const { h, s, b } = rgbToHsb(color);
|
|
360
|
+
return opaque
|
|
361
|
+
? `hsb(${h}, ${s}%, ${b}%)`
|
|
362
|
+
: `hsba(${h}, ${s}%, ${b}%, ${formatAlpha(color.a)})`;
|
|
363
|
+
}
|
|
364
|
+
case 'hex':
|
|
365
|
+
default: {
|
|
366
|
+
const base = `#${pad(color.r)}${pad(color.g)}${pad(color.b)}`;
|
|
367
|
+
// Eight-digit hex quantizes alpha to 1/255, so `rgba(..., 0.5)` stores as
|
|
368
|
+
// `#...80` and reads back as 0.502. That is the precision limit section
|
|
369
|
+
// 18 asks to be documented, not a rounding bug.
|
|
370
|
+
return opaque ? base : `${base}${pad(Math.round(color.a * 255))}`;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* A CSS color string for a stored value, for a swatch's `background`.
|
|
377
|
+
*
|
|
378
|
+
* `hsb()` is not CSS, and a browser given it paints nothing, so a swatch must
|
|
379
|
+
* never be handed the stored text directly once HSB output is available.
|
|
380
|
+
* Returns `undefined` when the value is not a color, so the caller can draw an
|
|
381
|
+
* empty swatch rather than a misleading one.
|
|
382
|
+
*/
|
|
383
|
+
export const toCssColor = (value: unknown): string | undefined => {
|
|
384
|
+
const parsed = parseColor(value);
|
|
385
|
+
return parsed ? serializeColor(parsed, 'hex') : undefined;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/** The i18n key whose default is the entry syntax for a save format. */
|
|
389
|
+
export const placeholderKeyFor = (format: ColorSaveFormat) =>
|
|
390
|
+
`color.placeholder.${format}` as const;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import customParsing from 'dayjs/plugin/customParseFormat';
|
|
3
|
+
import advancedFormat from 'dayjs/plugin/advancedFormat';
|
|
4
|
+
import localeData from 'dayjs/plugin/localeData';
|
|
5
|
+
import weekday from 'dayjs/plugin/weekday';
|
|
6
|
+
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
|
7
|
+
import weekYear from 'dayjs/plugin/weekYear';
|
|
8
|
+
import utc from 'dayjs/plugin/utc';
|
|
9
|
+
import timezone from 'dayjs/plugin/timezone'; // dependent on utc plugin
|
|
10
|
+
|
|
11
|
+
// required for the custom save formats in the date, time and date-time pickers
|
|
12
|
+
dayjs.extend(customParsing);
|
|
13
|
+
dayjs.extend(advancedFormat);
|
|
14
|
+
dayjs.extend(weekday);
|
|
15
|
+
dayjs.extend(localeData);
|
|
16
|
+
dayjs.extend(weekOfYear);
|
|
17
|
+
dayjs.extend(weekYear);
|
|
18
|
+
dayjs.extend(utc);
|
|
19
|
+
dayjs.extend(timezone);
|
|
20
|
+
|
|
21
|
+
export const formatDate = (date: dayjs.Dayjs, saveFormat: string) => {
|
|
22
|
+
const yearToken = '__JSONFORMS_FOUR_DIGIT_YEAR__';
|
|
23
|
+
const formatWithYearPlaceholder = saveFormat.replace(
|
|
24
|
+
/YYYY/g,
|
|
25
|
+
`[${yearToken}]`,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return date
|
|
29
|
+
.format(formatWithYearPlaceholder)
|
|
30
|
+
.replace(new RegExp(yearToken, 'g'), String(date.year()).padStart(4, '0'));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const parseDateValue = (
|
|
34
|
+
data: dayjs.ConfigType,
|
|
35
|
+
format?: string | string[],
|
|
36
|
+
): dayjs.Dayjs | null => {
|
|
37
|
+
if (!data) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const dayjsData = dayjs(data, format);
|
|
41
|
+
if (!dayjsData.isValid()) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return dayjsData;
|
|
45
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface DurationParts {
|
|
2
|
+
years: number;
|
|
3
|
+
months: number;
|
|
4
|
+
days: number;
|
|
5
|
+
hours: number;
|
|
6
|
+
minutes: number;
|
|
7
|
+
seconds: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const EMPTY_DURATION: DurationParts = {
|
|
11
|
+
years: 0,
|
|
12
|
+
months: 0,
|
|
13
|
+
days: 0,
|
|
14
|
+
hours: 0,
|
|
15
|
+
minutes: 0,
|
|
16
|
+
seconds: 0,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const DURATION =
|
|
20
|
+
/^P(?:(?<years>\d+)Y)?(?:(?<months>\d+)M)?(?:(?<days>\d+)D)?(?:T(?:(?<hours>\d+)H)?(?:(?<minutes>\d+)M)?(?:(?<seconds>\d+)S)?)?$/i;
|
|
21
|
+
|
|
22
|
+
export const parseDuration = (value: unknown): DurationParts | null => {
|
|
23
|
+
if (typeof value !== 'string' || !value.trim()) return null;
|
|
24
|
+
const match = value.trim().match(DURATION);
|
|
25
|
+
if (!match?.groups || !Object.values(match.groups).some(Boolean)) return null;
|
|
26
|
+
const number = (part?: string) => (part ? Number.parseInt(part, 10) : 0);
|
|
27
|
+
return {
|
|
28
|
+
years: number(match.groups.years),
|
|
29
|
+
months: number(match.groups.months),
|
|
30
|
+
days: number(match.groups.days),
|
|
31
|
+
hours: number(match.groups.hours),
|
|
32
|
+
minutes: number(match.groups.minutes),
|
|
33
|
+
seconds: number(match.groups.seconds),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const sanitizeComponents = <T extends DurationParts>(parts: T): T =>
|
|
38
|
+
Object.fromEntries(
|
|
39
|
+
Object.entries(parts).map(([key, value]) => [
|
|
40
|
+
key,
|
|
41
|
+
Math.max(0, Math.floor(value || 0)),
|
|
42
|
+
]),
|
|
43
|
+
) as unknown as T;
|
|
44
|
+
|
|
45
|
+
export const formatDuration = (parts: DurationParts) => {
|
|
46
|
+
const safe = sanitizeComponents(parts);
|
|
47
|
+
return formatDurationComponents(safe);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const formatDurationComponents = (parts: DurationParts) => {
|
|
51
|
+
const unit = (value: number, suffix: string) =>
|
|
52
|
+
value ? `${value}${suffix}` : '';
|
|
53
|
+
const date =
|
|
54
|
+
unit(parts.years, 'Y') + unit(parts.months, 'M') + unit(parts.days, 'D');
|
|
55
|
+
const time =
|
|
56
|
+
unit(parts.hours, 'H') +
|
|
57
|
+
unit(parts.minutes, 'M') +
|
|
58
|
+
unit(parts.seconds, 'S');
|
|
59
|
+
return date || time ? `P${date}${time ? `T${time}` : ''}` : 'P0D';
|
|
60
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tester,
|
|
3
|
+
UISchemaElement,
|
|
4
|
+
and,
|
|
5
|
+
formatIs,
|
|
6
|
+
isStringControl,
|
|
7
|
+
not,
|
|
8
|
+
optionIs,
|
|
9
|
+
or,
|
|
10
|
+
rankWith,
|
|
11
|
+
} from '@jsonforms/core';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A mask pattern as the UI model may serialize it: one pattern, or a set of
|
|
15
|
+
* alternatives the masking engine picks between by length.
|
|
16
|
+
*
|
|
17
|
+
* A function-valued mask is deliberately not part of this type. The
|
|
18
|
+
* specification is explicit that "function-valued masking-library options are
|
|
19
|
+
* not portable serialized UI-model features", and a UI schema is JSON.
|
|
20
|
+
*/
|
|
21
|
+
export type MaskPattern = string | string[];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Whether `options.mask` carries an actual pattern.
|
|
25
|
+
*
|
|
26
|
+
* This is the whole of the fix for the selection defect the Svelte review
|
|
27
|
+
* recorded. Those families select with `hasOption('mask')`, which tests
|
|
28
|
+
* *presence*: the temporal controls take a **boolean** `mask` that turns their
|
|
29
|
+
* format-derived mask off, so `"mask": false` - an author asking for less
|
|
30
|
+
* masking - made the field eligible for the generic masked renderer instead.
|
|
31
|
+
* The specification names the case directly: "a boolean temporal option must
|
|
32
|
+
* not by itself request a generic masked field."
|
|
33
|
+
*
|
|
34
|
+
* Requiring a non-empty string (or a non-empty array of them) excludes `false`,
|
|
35
|
+
* `true`, `""`, `[]` and a function in one predicate.
|
|
36
|
+
*/
|
|
37
|
+
export const isMaskPattern = (value: unknown): value is MaskPattern => {
|
|
38
|
+
if (typeof value === 'string') {
|
|
39
|
+
return value.length > 0;
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
Array.isArray(value) &&
|
|
43
|
+
value.length > 0 &&
|
|
44
|
+
value.every((entry) => typeof entry === 'string' && entry.length > 0)
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const hasMaskPattern: Tester = (uischema: UISchemaElement) =>
|
|
49
|
+
isMaskPattern(
|
|
50
|
+
(uischema as { options?: Record<string, unknown> }).options?.mask,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The string formats that name their own editor.
|
|
55
|
+
*
|
|
56
|
+
* A `format` says what the value *is*; a mask only says how it is typed. So
|
|
57
|
+
* when both are present the format wins and the mask is ignored, rather than a
|
|
58
|
+
* date being edited through a generic text mask that knows nothing about
|
|
59
|
+
* calendars. The specification leaves this to us - "handling of competing
|
|
60
|
+
* specialized string presentations belong in renderer-family specifications" -
|
|
61
|
+
* and it is the reason this tester can sit at a rank of its own without
|
|
62
|
+
* tie-breaking against the temporal controls by registration order.
|
|
63
|
+
*/
|
|
64
|
+
const SPECIALIZED_STRING_FORMATS = [
|
|
65
|
+
'color',
|
|
66
|
+
'date',
|
|
67
|
+
'date-time',
|
|
68
|
+
'duration',
|
|
69
|
+
'password',
|
|
70
|
+
'time',
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const hasSpecializedFormat: Tester = or(
|
|
74
|
+
...SPECIALIZED_STRING_FORMATS.flatMap((format) => [
|
|
75
|
+
formatIs(format),
|
|
76
|
+
optionIs('format', format),
|
|
77
|
+
]),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Rank 4, above the plain text control at 1 and the color and duration
|
|
82
|
+
* controls at 3, and never in a tie with the temporal controls at 4 because
|
|
83
|
+
* {@link hasSpecializedFormat} excludes every schema they match.
|
|
84
|
+
*/
|
|
85
|
+
export const extendedMaskTester = rankWith(
|
|
86
|
+
4,
|
|
87
|
+
and(isStringControl, hasMaskPattern, not(hasSpecializedFormat)),
|
|
88
|
+
);
|