@chobantonov/jsonforms-react-antd-renderers 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 +103 -2
- package/lib/additional/LabelRenderer.d.ts +13 -0
- package/lib/additional/ListWithDetailMasterItem.d.ts +9 -0
- package/lib/additional/ListWithDetailRenderer.d.ts +8 -0
- package/lib/additional/index.d.ts +4 -0
- package/lib/additional/unwrapped.d.ts +6 -0
- package/lib/antd-controls/AntdCheckbox.d.ts +10 -0
- package/lib/antd-controls/AntdClearValueButton.d.ts +44 -0
- package/lib/antd-controls/AntdClearableInput.d.ts +19 -0
- package/lib/antd-controls/AntdDatePicker.d.ts +7 -0
- package/lib/antd-controls/AntdDateTimePicker.d.ts +7 -0
- package/lib/antd-controls/AntdFile.d.ts +7 -0
- package/lib/antd-controls/AntdInputInteger.d.ts +3 -0
- package/lib/antd-controls/AntdInputNumber.d.ts +3 -0
- package/lib/antd-controls/AntdInputNumberFormat.d.ts +6 -0
- package/lib/antd-controls/AntdInputText.d.ts +6 -0
- package/lib/antd-controls/AntdNumericInput.d.ts +9 -0
- package/lib/antd-controls/AntdOtp.d.ts +33 -0
- package/lib/antd-controls/AntdPassword.d.ts +6 -0
- package/lib/antd-controls/AntdRadioGroup.d.ts +6 -0
- package/lib/antd-controls/AntdRevealButton.d.ts +32 -0
- package/lib/antd-controls/AntdSelect.d.ts +7 -0
- package/lib/antd-controls/AntdSlider.d.ts +21 -0
- package/lib/antd-controls/AntdTimePicker.d.ts +6 -0
- package/lib/antd-controls/AntdToggle.d.ts +6 -0
- package/lib/antd-controls/FileFeedback.d.ts +6 -0
- package/lib/antd-controls/index.d.ts +18 -0
- package/lib/antd-controls/useTemporalPicker.d.ts +49 -0
- package/lib/cells/AntdCompositeCell.d.ts +8 -0
- package/lib/cells/BooleanCell.d.ts +6 -0
- package/lib/cells/BooleanToggleCell.d.ts +5 -0
- package/lib/cells/CompositeDetailDialog.d.ts +15 -0
- package/lib/cells/CustomizableCells.d.ts +9 -0
- package/lib/cells/DateCell.d.ts +6 -0
- package/lib/cells/EnumCell.d.ts +11 -0
- package/lib/cells/IntegerCell.d.ts +6 -0
- package/lib/cells/NumberCell.d.ts +10 -0
- package/lib/cells/NumberFormatCell.d.ts +10 -0
- package/lib/cells/OneOfEnumCell.d.ts +11 -0
- package/lib/cells/PasswordCell.d.ts +5 -0
- package/lib/cells/TextCell.d.ts +10 -0
- package/lib/cells/TimeCell.d.ts +6 -0
- package/lib/cells/index.d.ts +14 -0
- package/lib/complex/AdditionalProperties.d.ts +4 -0
- package/lib/complex/AnyOfRenderer.d.ts +31 -0
- package/lib/complex/ArrayControlRenderer.d.ts +8 -0
- package/lib/complex/ChipsControl.d.ts +22 -0
- package/lib/complex/CollectionPager.d.ts +5 -0
- package/lib/complex/DataCell.d.ts +16 -0
- package/lib/complex/DeleteDialog.d.ts +14 -0
- package/lib/complex/DetailModal.d.ts +6 -0
- package/lib/complex/EnumArrayRenderer.d.ts +6 -0
- package/lib/complex/ErrorFeedback.d.ts +6 -0
- package/lib/complex/MixedRenderer.d.ts +6 -0
- package/lib/complex/MultiSelectControl.d.ts +17 -0
- package/lib/complex/ObjectRenderer.d.ts +5 -0
- package/lib/complex/OneOfRenderer.d.ts +6 -0
- package/lib/complex/OneOfTabRenderer.d.ts +5 -0
- package/lib/complex/RecursiveTreeRenderer.d.ts +4 -0
- package/lib/complex/RowDetailFrame.d.ts +10 -0
- package/lib/complex/ScalarCompositionRenderer.d.ts +4 -0
- package/lib/complex/TabSwitchConfirmDialog.d.ts +9 -0
- package/lib/complex/TableControl.d.ts +9 -0
- package/lib/complex/TableToolbar.d.ts +21 -0
- package/lib/complex/TupleAdditionalItems.d.ts +13 -0
- package/lib/complex/TupleControlRenderer.d.ts +6 -0
- package/lib/complex/TupleField.d.ts +4 -0
- package/lib/complex/ValidationIcon.d.ts +8 -0
- package/lib/complex/additionalProperties/AntdAdditionalPropertyActions.d.ts +9 -0
- package/lib/complex/additionalProperties/AntdAdditionalPropertyRenameDialog.d.ts +11 -0
- package/lib/complex/index.d.ts +20 -0
- package/lib/complex/mixed/AntdJsonTypeIcon.d.ts +4 -0
- package/lib/complex/mixed/AntdMixedNavigationContext.d.ts +5 -0
- package/lib/complex/mixed/AntdMixedSplitPane.d.ts +5 -0
- package/lib/complex/mixed/AntdMixedTree.d.ts +15 -0
- package/lib/complex/mixed/AntdMixedTypeSelector.d.ts +12 -0
- package/lib/complex/mixed/AntdNestedMixedNavigation.d.ts +7 -0
- package/lib/complex/mixed/mixedTree.d.ts +2 -0
- package/lib/complex/unwrapped.d.ts +10 -0
- package/lib/controls/AnyOfStringOrEnumControl.d.ts +9 -0
- package/lib/controls/BooleanControl.d.ts +6 -0
- package/lib/controls/BooleanToggleControl.d.ts +6 -0
- package/lib/controls/ChoiceCards.d.ts +1 -0
- package/lib/controls/DateControl.d.ts +6 -0
- package/lib/controls/DateTimeControl.d.ts +6 -0
- package/lib/controls/EnumControl.d.ts +7 -0
- package/lib/controls/FileControl.d.ts +7 -0
- package/lib/controls/InputControl.d.ts +6 -0
- package/lib/controls/IntegerControl.d.ts +6 -0
- package/lib/controls/NativeControl.d.ts +6 -0
- package/lib/controls/NumberControl.d.ts +6 -0
- package/lib/controls/OneOfEnumControl.d.ts +7 -0
- package/lib/controls/OneOfRadioGroupControl.d.ts +6 -0
- package/lib/controls/PasswordControl.d.ts +18 -0
- package/lib/controls/PasswordOtpControl.d.ts +38 -0
- package/lib/controls/RadioGroup.d.ts +3 -0
- package/lib/controls/RadioGroupControl.d.ts +6 -0
- package/lib/controls/SliderControl.d.ts +6 -0
- package/lib/controls/TextControl.d.ts +6 -0
- package/lib/controls/TimeControl.d.ts +6 -0
- package/lib/controls/index.d.ts +20 -0
- package/lib/controls/unwrapped.d.ts +19 -0
- package/lib/index.d.ts +50 -0
- package/lib/jsonforms-react-antd.cjs.js +39 -0
- package/lib/jsonforms-react-antd.cjs.js.map +1 -0
- package/lib/jsonforms-react-antd.esm.js +4235 -0
- package/lib/jsonforms-react-antd.esm.js.map +1 -0
- package/lib/layouts/ArrayLayout.d.ts +5 -0
- package/lib/layouts/ArrayLayoutRenderer.d.ts +8 -0
- package/lib/layouts/ArrayPanel.d.ts +7 -0
- package/lib/layouts/ArrayToolbar.d.ts +17 -0
- package/lib/layouts/CategorizationAccordionLayout.d.ts +21 -0
- package/lib/layouts/CategorizationLayout.d.ts +14 -0
- package/lib/layouts/CategorizationStepperLayout.d.ts +10 -0
- package/lib/layouts/CategoryHeader.d.ts +39 -0
- package/lib/layouts/ContainerIndicator.d.ts +37 -0
- package/lib/layouts/GroupLayout.d.ts +6 -0
- package/lib/layouts/HorizontalLayout.d.ts +10 -0
- package/lib/layouts/ValidationIndicator.d.ts +13 -0
- package/lib/layouts/VerticalLayout.d.ts +10 -0
- package/lib/layouts/arrayTitle.d.ts +2 -0
- package/lib/layouts/index.d.ts +11 -0
- package/lib/layouts/unwrapped.d.ts +11 -0
- package/lib/locale/index.d.ts +1 -0
- package/lib/util/additionalPropertyName.d.ts +2 -0
- package/lib/util/arrayChoices.d.ts +2 -0
- package/lib/util/categoryState.d.ts +3 -0
- package/lib/util/cellFrame.d.ts +27 -0
- package/lib/util/cellMode.d.ts +29 -0
- package/lib/util/clearAffordance.d.ts +1 -0
- package/lib/util/combinators.d.ts +1 -0
- package/lib/util/compositeActions.d.ts +1 -0
- package/lib/util/compositeSummary.d.ts +1 -0
- package/lib/util/configNamespaces.d.ts +1 -0
- package/lib/util/confirmation.d.ts +2 -0
- package/lib/util/datejs.d.ts +4 -0
- package/lib/util/debounce.d.ts +1 -0
- package/lib/util/dynamicProperties.d.ts +1 -0
- package/lib/util/focus.d.ts +1 -0
- package/lib/util/groupState.d.ts +1 -0
- package/lib/util/index.d.ts +25 -0
- package/lib/util/layout.d.ts +18 -0
- package/lib/util/layoutSizing.d.ts +6 -0
- package/lib/util/literalPropertySchema.d.ts +1 -0
- package/lib/util/locale.d.ts +68 -0
- package/lib/util/numeric.d.ts +1 -0
- package/lib/util/pendingChanges.d.ts +2 -0
- package/lib/util/preTouchErrors.d.ts +2 -0
- package/lib/util/rendererLocale.d.ts +2 -0
- package/lib/util/temporalBounds.d.ts +35 -0
- package/lib/util/temporalFormats.d.ts +26 -0
- package/lib/util/theme.d.ts +9 -0
- package/lib/util/translate.d.ts +1 -0
- package/lib/util/tuple.d.ts +2 -0
- package/lib/util/useConfirmation.d.ts +7 -0
- package/lib/util/validationIndicator.d.ts +2 -0
- package/lib/util/visuallyHidden.d.ts +1 -0
- package/package.json +89 -3
- package/src/additional/LabelRenderer.tsx +21 -0
- package/src/additional/ListWithDetailMasterItem.tsx +124 -0
- package/src/additional/ListWithDetailRenderer.tsx +243 -0
- package/src/additional/index.ts +14 -0
- package/src/additional/unwrapped.ts +8 -0
- package/src/antd-controls/AntdCheckbox.tsx +56 -0
- package/src/antd-controls/AntdClearValueButton.tsx +96 -0
- package/src/antd-controls/AntdClearableInput.tsx +63 -0
- package/src/antd-controls/AntdDatePicker.tsx +26 -0
- package/src/antd-controls/AntdDateTimePicker.tsx +31 -0
- package/src/antd-controls/AntdFile.tsx +395 -0
- package/src/antd-controls/AntdInputInteger.tsx +10 -0
- package/src/antd-controls/AntdInputNumber.tsx +10 -0
- package/src/antd-controls/AntdInputNumberFormat.tsx +63 -0
- package/src/antd-controls/AntdInputText.tsx +124 -0
- package/src/antd-controls/AntdNumericInput.tsx +83 -0
- package/src/antd-controls/AntdOtp.tsx +132 -0
- package/src/antd-controls/AntdPassword.tsx +106 -0
- package/src/antd-controls/AntdRadioGroup.tsx +60 -0
- package/src/antd-controls/AntdRevealButton.tsx +74 -0
- package/src/antd-controls/AntdSelect.tsx +113 -0
- package/src/antd-controls/AntdSlider.tsx +114 -0
- package/src/antd-controls/AntdTimePicker.tsx +25 -0
- package/src/antd-controls/AntdToggle.tsx +70 -0
- package/src/antd-controls/FileFeedback.tsx +37 -0
- package/src/antd-controls/index.ts +18 -0
- package/src/antd-controls/useTemporalPicker.ts +130 -0
- package/src/cells/AntdCompositeCell.tsx +228 -0
- package/src/cells/BooleanCell.tsx +33 -0
- package/src/cells/BooleanToggleCell.tsx +38 -0
- package/src/cells/CompositeDetailDialog.tsx +100 -0
- package/src/cells/CustomizableCells.ts +9 -0
- package/src/cells/DateCell.tsx +17 -0
- package/src/cells/EnumCell.tsx +30 -0
- package/src/cells/IntegerCell.tsx +17 -0
- package/src/cells/NumberCell.tsx +20 -0
- package/src/cells/NumberFormatCell.tsx +37 -0
- package/src/cells/OneOfEnumCell.tsx +32 -0
- package/src/cells/PasswordCell.tsx +22 -0
- package/src/cells/TextCell.tsx +22 -0
- package/src/cells/TimeCell.tsx +17 -0
- package/src/cells/index.ts +40 -0
- package/src/complex/AdditionalProperties.tsx +422 -0
- package/src/complex/AnyOfRenderer.tsx +158 -0
- package/src/complex/ArrayControlRenderer.tsx +121 -0
- package/src/complex/ChipsControl.tsx +205 -0
- package/src/complex/CollectionPager.tsx +26 -0
- package/src/complex/DataCell.tsx +82 -0
- package/src/complex/DeleteDialog.tsx +44 -0
- package/src/complex/DetailModal.tsx +110 -0
- package/src/complex/EnumArrayRenderer.tsx +148 -0
- package/src/complex/ErrorFeedback.tsx +51 -0
- package/src/complex/MixedRenderer.tsx +325 -0
- package/src/complex/MultiSelectControl.tsx +205 -0
- package/src/complex/ObjectRenderer.tsx +55 -0
- package/src/complex/OneOfRenderer.tsx +299 -0
- package/src/complex/OneOfTabRenderer.tsx +123 -0
- package/src/complex/RecursiveTreeRenderer.tsx +20 -0
- package/src/complex/RowDetailFrame.tsx +99 -0
- package/src/complex/ScalarCompositionRenderer.tsx +14 -0
- package/src/complex/TabSwitchConfirmDialog.tsx +36 -0
- package/src/complex/TableControl.tsx +646 -0
- package/src/complex/TableToolbar.tsx +80 -0
- package/src/complex/TupleAdditionalItems.tsx +100 -0
- package/src/complex/TupleControlRenderer.tsx +78 -0
- package/src/complex/TupleField.tsx +44 -0
- package/src/complex/ValidationIcon.tsx +30 -0
- package/src/complex/additionalProperties/AntdAdditionalPropertyActions.tsx +56 -0
- package/src/complex/additionalProperties/AntdAdditionalPropertyRenameDialog.tsx +56 -0
- package/src/complex/index.ts +48 -0
- package/src/complex/mixed/AntdJsonTypeIcon.tsx +40 -0
- package/src/complex/mixed/AntdMixedNavigationContext.ts +8 -0
- package/src/complex/mixed/AntdMixedSplitPane.tsx +51 -0
- package/src/complex/mixed/AntdMixedTree.tsx +287 -0
- package/src/complex/mixed/AntdMixedTypeSelector.tsx +60 -0
- package/src/complex/mixed/AntdNestedMixedNavigation.tsx +39 -0
- package/src/complex/mixed/mixedTree.ts +9 -0
- package/src/complex/unwrapped.ts +15 -0
- package/src/controls/AnyOfStringOrEnumControl.tsx +123 -0
- package/src/controls/BooleanControl.tsx +17 -0
- package/src/controls/BooleanToggleControl.tsx +24 -0
- package/src/controls/ChoiceCards.tsx +13 -0
- package/src/controls/DateControl.tsx +19 -0
- package/src/controls/DateTimeControl.tsx +22 -0
- package/src/controls/EnumControl.tsx +29 -0
- package/src/controls/FileControl.tsx +44 -0
- package/src/controls/InputControl.tsx +94 -0
- package/src/controls/IntegerControl.tsx +16 -0
- package/src/controls/NativeControl.tsx +79 -0
- package/src/controls/NumberControl.tsx +18 -0
- package/src/controls/OneOfEnumControl.tsx +32 -0
- package/src/controls/OneOfRadioGroupControl.tsx +25 -0
- package/src/controls/PasswordControl.tsx +43 -0
- package/src/controls/PasswordOtpControl.tsx +61 -0
- package/src/controls/RadioGroup.tsx +8 -0
- package/src/controls/RadioGroupControl.tsx +21 -0
- package/src/controls/SliderControl.tsx +19 -0
- package/src/controls/TextControl.tsx +17 -0
- package/src/controls/TimeControl.tsx +20 -0
- package/src/controls/index.ts +69 -0
- package/src/controls/unwrapped.ts +35 -0
- package/src/index.ts +267 -0
- package/src/layouts/ArrayLayout.tsx +435 -0
- package/src/layouts/ArrayLayoutRenderer.tsx +54 -0
- package/src/layouts/ArrayPanel.tsx +51 -0
- package/src/layouts/ArrayToolbar.tsx +67 -0
- package/src/layouts/CategorizationAccordionLayout.tsx +217 -0
- package/src/layouts/CategorizationLayout.tsx +149 -0
- package/src/layouts/CategorizationStepperLayout.tsx +164 -0
- package/src/layouts/CategoryHeader.tsx +107 -0
- package/src/layouts/ContainerIndicator.tsx +83 -0
- package/src/layouts/GroupLayout.tsx +307 -0
- package/src/layouts/HorizontalLayout.tsx +50 -0
- package/src/layouts/ValidationIndicator.tsx +43 -0
- package/src/layouts/VerticalLayout.tsx +50 -0
- package/src/layouts/arrayTitle.tsx +30 -0
- package/src/layouts/index.ts +35 -0
- package/src/layouts/unwrapped.ts +17 -0
- package/src/locale/index.ts +1 -0
- package/src/util/additionalPropertyName.ts +11 -0
- package/src/util/arrayChoices.ts +21 -0
- package/src/util/categoryState.ts +17 -0
- package/src/util/cellFrame.tsx +52 -0
- package/src/util/cellMode.tsx +145 -0
- package/src/util/clearAffordance.ts +2 -0
- package/src/util/combinators.ts +6 -0
- package/src/util/compositeActions.ts +2 -0
- package/src/util/compositeSummary.ts +2 -0
- package/src/util/configNamespaces.ts +4 -0
- package/src/util/confirmation.ts +15 -0
- package/src/util/datejs.tsx +42 -0
- package/src/util/debounce.ts +2 -0
- package/src/util/dynamicProperties.ts +6 -0
- package/src/util/focus.ts +2 -0
- package/src/util/groupState.ts +8 -0
- package/src/util/index.ts +25 -0
- package/src/util/layout.tsx +121 -0
- package/src/util/layoutSizing.ts +33 -0
- package/src/util/literalPropertySchema.ts +2 -0
- package/src/util/locale.ts +222 -0
- package/src/util/numeric.ts +2 -0
- package/src/util/pendingChanges.tsx +6 -0
- package/src/util/preTouchErrors.ts +10 -0
- package/src/util/rendererLocale.ts +10 -0
- package/src/util/temporalBounds.ts +106 -0
- package/src/util/temporalFormats.ts +95 -0
- package/src/util/theme.ts +9 -0
- package/src/util/translate.ts +6 -0
- package/src/util/tuple.ts +16 -0
- package/src/util/uiSchemaCycle.tsx +2 -0
- package/src/util/useConfirmation.tsx +25 -0
- package/src/util/validationIndicator.ts +10 -0
- package/src/util/visuallyHidden.ts +2 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArrayLayoutProps, ArrayTranslations, RankedTester } from '@jsonforms/core';
|
|
3
|
+
export declare const ArrayLayoutRenderer: ({ visible, addItem, ...props }: ArrayLayoutProps & {
|
|
4
|
+
translations: ArrayTranslations;
|
|
5
|
+
}) => React.JSX.Element | null;
|
|
6
|
+
export declare const arrayLayoutTester: RankedTester;
|
|
7
|
+
declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CardProps } from 'antd';
|
|
3
|
+
export declare const ArrayPanel: ({ options, config, panelLabel, children, extra, ...props }: CardProps & {
|
|
4
|
+
options?: Record<string, any>;
|
|
5
|
+
config?: any;
|
|
6
|
+
panelLabel?: string;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ArrayTranslations } from '@jsonforms/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ArrayLayoutToolbarProps {
|
|
4
|
+
options?: Record<string, any>;
|
|
5
|
+
config?: any;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string | undefined;
|
|
8
|
+
errors: string;
|
|
9
|
+
path: string;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
addItem(path: string, data: any): () => void;
|
|
12
|
+
createDefault(): any;
|
|
13
|
+
translations: ArrayTranslations;
|
|
14
|
+
disableAdd?: boolean;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const ArrayLayoutToolbar: React.MemoExoticComponent<({ label, description, addItem, path, enabled, createDefault, translations, disableAdd, children, options, config, }: ArrayLayoutToolbarProps) => React.JSX.Element>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RankedTester, StatePropsOfLayout } from '@jsonforms/core';
|
|
3
|
+
import { TranslateProps } from '@jsonforms/react';
|
|
4
|
+
import { AjvProps } from '../util/layout';
|
|
5
|
+
/**
|
|
6
|
+
* Rank 3, above the stepper at 2 and the generic tabs renderer at 1, because
|
|
7
|
+
* the specification requires this explicit match to "take precedence over the
|
|
8
|
+
* generic Categorization renderer". Before this existed, `variant: "accordion"`
|
|
9
|
+
* fell through to tabs and the request was silently ignored.
|
|
10
|
+
*
|
|
11
|
+
* No schema type requirement, no scope, no array binding: categories are
|
|
12
|
+
* structural UI sections and may hold unbound content or be used with an empty
|
|
13
|
+
* data object.
|
|
14
|
+
*/
|
|
15
|
+
export declare const categorizationAccordionTester: RankedTester;
|
|
16
|
+
export interface CategorizationAccordionLayoutRendererProps extends StatePropsOfLayout, AjvProps, TranslateProps {
|
|
17
|
+
data?: unknown;
|
|
18
|
+
}
|
|
19
|
+
export declare const CategorizationAccordionLayoutRenderer: (props: CategorizationAccordionLayoutRendererProps) => React.JSX.Element | null;
|
|
20
|
+
declare const _default: (props: CategorizationAccordionLayoutRendererProps & import("@jsonforms/core").OwnPropsOfLayout) => React.JSX.Element;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RankedTester, StatePropsOfLayout } from '@jsonforms/core';
|
|
3
|
+
import { TranslateProps } from '@jsonforms/react';
|
|
4
|
+
import { AjvProps } from '../util/layout';
|
|
5
|
+
export declare const categorizationTester: RankedTester;
|
|
6
|
+
export interface CategorizationLayoutRendererProps extends StatePropsOfLayout, AjvProps, TranslateProps {
|
|
7
|
+
selected?: number;
|
|
8
|
+
ownState?: boolean;
|
|
9
|
+
data?: any;
|
|
10
|
+
onChange?(selected: number, prevSelected: number): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const CategorizationLayoutRenderer: (props: CategorizationLayoutRendererProps) => React.JSX.Element | null;
|
|
13
|
+
declare const _default: (props: CategorizationLayoutRendererProps & import("@jsonforms/core").OwnPropsOfLayout) => React.JSX.Element;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RankedTester, StatePropsOfLayout } from '@jsonforms/core';
|
|
3
|
+
import { TranslateProps } from '@jsonforms/react';
|
|
4
|
+
import { AjvProps } from '../util/layout';
|
|
5
|
+
export declare const categorizationStepperTester: RankedTester;
|
|
6
|
+
interface CategorizationStepperLayoutRendererProps extends StatePropsOfLayout, AjvProps, TranslateProps {
|
|
7
|
+
data: any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: (props: CategorizationStepperLayoutRendererProps & import("@jsonforms/core").OwnPropsOfLayout) => React.JSX.Element;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Category } from '@jsonforms/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface CategoryHeaderProps {
|
|
4
|
+
category: Category;
|
|
5
|
+
label?: string;
|
|
6
|
+
path: string;
|
|
7
|
+
config?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export type CategoryIndicatorsProps = Omit<CategoryHeaderProps, 'label'>;
|
|
10
|
+
/**
|
|
11
|
+
* The container markers for a Category: an error marker, and the dot that says
|
|
12
|
+
* the section holds data.
|
|
13
|
+
*
|
|
14
|
+
* A Category has no data scope - the same reason it needs an explicit `i18n`
|
|
15
|
+
* prefix - so both are aggregated from the Controls bound below it, through
|
|
16
|
+
* the one traversal shared with the Group's indicators.
|
|
17
|
+
*
|
|
18
|
+
* Rendered on its own rather than baked into the label, because where they
|
|
19
|
+
* belong depends on the shape of the header rather than on the presentation:
|
|
20
|
+
* see {@link CategoryHeader}. Returns `null` when there is nothing to show, so
|
|
21
|
+
* a caller can hand it straight to an `extra` slot.
|
|
22
|
+
*
|
|
23
|
+
* Both default to off: no indicator existed on categories before, and
|
|
24
|
+
* defaulting to on would change every existing form.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CategoryIndicators: ({ category, path, config, }: CategoryIndicatorsProps) => React.JSX.Element | null;
|
|
27
|
+
/**
|
|
28
|
+
* A category's **tab or step** label, with the indicators after it.
|
|
29
|
+
*
|
|
30
|
+
* A tab and a step label are just text: they are sized to their content and
|
|
31
|
+
* have no trailing edge, so the markers can only follow the words.
|
|
32
|
+
*
|
|
33
|
+
* An accordion header is a different shape - a full-width bar, like a Group's -
|
|
34
|
+
* and there the markers go at the end of the bar instead, through antd's
|
|
35
|
+
* `extra` slot, so that two collapsible sections in one form do not put their
|
|
36
|
+
* status in two different places. That is why this component is not used by
|
|
37
|
+
* the accordion; it renders {@link CategoryIndicators} directly.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CategoryHeader: ({ category, label, path, config, }: CategoryHeaderProps) => React.JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A marker on a container's header.
|
|
4
|
+
*
|
|
5
|
+
* Both markers are **SVG**, not text glyphs and not CSS shapes. A glyph like
|
|
6
|
+
* `●` renders at whatever size and baseline the platform font gives it, so it
|
|
7
|
+
* never lines up with an icon beside it; a CSS circle is crisp but is a third
|
|
8
|
+
* mechanism to keep in sync. An SVG in antd's own icon box - `1em` square,
|
|
9
|
+
* `currentColor`, `viewBox="64 64 896 896"` - is resolution independent, takes
|
|
10
|
+
* its size from `fontSize` and its color from `color`, so two markers sharing
|
|
11
|
+
* this shell are aligned and sized identically by construction.
|
|
12
|
+
*
|
|
13
|
+
* The shell must not make its header taller. It uses the body font size, which
|
|
14
|
+
* is smaller than the header's line box, and `lineHeight: 0` so the inline box
|
|
15
|
+
* adds no leading of its own.
|
|
16
|
+
*/
|
|
17
|
+
export interface ContainerIndicatorProps {
|
|
18
|
+
/** Tooltip text and accessible name. One string, so they cannot diverge. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** `colorError` for a failure, a muted color for data presence. */
|
|
21
|
+
color: string;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
/** Marks the element for tests and host styling. */
|
|
24
|
+
marker?: Record<string, boolean | number | string | undefined>;
|
|
25
|
+
}
|
|
26
|
+
export declare const ContainerIndicator: ({ label, color, children, marker, }: ContainerIndicatorProps) => React.JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* A plain filled dot in antd's icon box.
|
|
29
|
+
*
|
|
30
|
+
* `@ant-design/icons` has no plain circle - every `*CircleFilled` carries a
|
|
31
|
+
* symbol - so this draws one, matching the box and attributes of the icons it
|
|
32
|
+
* sits beside. Deliberately smaller than a full icon: data presence is a
|
|
33
|
+
* quieter signal than a failure.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DataDotIcon: () => React.JSX.Element;
|
|
36
|
+
/** The failure marker: antd's outlined exclamation, shared with array error summaries. */
|
|
37
|
+
export declare const ErrorIcon: () => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutProps, RankedTester } from '@jsonforms/core';
|
|
3
|
+
export declare const GroupLayoutRenderer: (props: LayoutProps) => React.JSX.Element | null;
|
|
4
|
+
declare const _default: React.ComponentType<LayoutProps & import("@jsonforms/core").OwnPropsOfLayout>;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const antdGroupTester: RankedTester;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutProps, RankedTester } from '@jsonforms/core';
|
|
3
|
+
/**
|
|
4
|
+
* Default tester for a horizontal layout.
|
|
5
|
+
* @type {RankedTester}
|
|
6
|
+
*/
|
|
7
|
+
export declare const horizontalLayoutTester: RankedTester;
|
|
8
|
+
export declare const HorizontalLayoutRenderer: ({ uischema, renderers, cells, schema, path, enabled, visible, config, }: LayoutProps) => React.JSX.Element;
|
|
9
|
+
declare const _default: React.ComponentType<LayoutProps & import("@jsonforms/core").OwnPropsOfLayout>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ValidationIndicatorProps {
|
|
3
|
+
/** Eligible errors at or below the container, or undefined to omit it. */
|
|
4
|
+
count?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The marker a container shows when something below it fails validation.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately not color alone: it carries a localized accessible name and a
|
|
10
|
+
* tooltip available on hover and keyboard focus, as a bare colored glyph
|
|
11
|
+
* communicates nothing to a screen reader and nothing on touch.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ContainerValidationIndicator: ({ count, }: ValidationIndicatorProps) => React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutProps, RankedTester } from '@jsonforms/core';
|
|
3
|
+
/**
|
|
4
|
+
* Default tester for a vertical layout.
|
|
5
|
+
* @type {RankedTester}
|
|
6
|
+
*/
|
|
7
|
+
export declare const verticalLayoutTester: RankedTester;
|
|
8
|
+
export declare const VerticalLayoutRenderer: ({ uischema, schema, path, enabled, visible, renderers, cells, config, }: LayoutProps) => React.JSX.Element;
|
|
9
|
+
declare const _default: React.ComponentType<LayoutProps & import("@jsonforms/core").OwnPropsOfLayout>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import GroupLayout, { antdGroupTester } from './GroupLayout';
|
|
2
|
+
import HorizontalLayout, { horizontalLayoutTester } from './HorizontalLayout';
|
|
3
|
+
import VerticalLayout, { verticalLayoutTester } from './VerticalLayout';
|
|
4
|
+
import CategorizationLayout, { categorizationTester } from './CategorizationLayout';
|
|
5
|
+
import ArrayLayout, { arrayLayoutTester } from './ArrayLayoutRenderer';
|
|
6
|
+
import CategorizationStepperLayout, { categorizationStepperTester } from './CategorizationStepperLayout';
|
|
7
|
+
import CategorizationAccordionLayout, { categorizationAccordionTester } from './CategorizationAccordionLayout';
|
|
8
|
+
export { ArrayLayout, arrayLayoutTester, CategorizationLayout, categorizationTester, CategorizationStepperLayout, categorizationStepperTester, CategorizationAccordionLayout, categorizationAccordionTester, GroupLayout, antdGroupTester, HorizontalLayout, horizontalLayoutTester, VerticalLayout, verticalLayoutTester, };
|
|
9
|
+
export * from './CategoryHeader';
|
|
10
|
+
export * from './ArrayToolbar';
|
|
11
|
+
export * from './ArrayPanel';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const UnwrappedLayouts: {
|
|
2
|
+
ArrayLayout: ({ visible, addItem, ...props }: import("@jsonforms/core").ArrayLayoutProps & {
|
|
3
|
+
translations: import("@jsonforms/core").ArrayTranslations;
|
|
4
|
+
}) => import("react").JSX.Element | null;
|
|
5
|
+
CategorizationLayout: (props: import("./CategorizationLayout").CategorizationLayoutRendererProps) => import("react").JSX.Element | null;
|
|
6
|
+
CategorizationAccordionLayout: (props: import("./CategorizationAccordionLayout").CategorizationAccordionLayoutRendererProps) => import("react").JSX.Element | null;
|
|
7
|
+
GroupLayout: (props: import("@jsonforms/core").LayoutProps) => import("react").JSX.Element | null;
|
|
8
|
+
HorizontalLayout: ({ uischema, renderers, cells, schema, path, enabled, visible, config, }: import("@jsonforms/core").LayoutProps) => import("react").JSX.Element;
|
|
9
|
+
VerticalLayout: ({ uischema, schema, path, enabled, visible, renderers, cells, config, }: import("@jsonforms/core").LayoutProps) => import("react").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export * from './ArrayToolbar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { bgRendererLocale } from '@chobantonov/jsonforms-react-renderer-common/locale/index';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { needsIsolatedEditor, assignOwnProperty, createAdditionalPropertyNameSchema, validateAdditionalPropertyName, } from '@chobantonov/jsonforms-react-renderer-common/objects/additionalPropertyName';
|
|
2
|
+
export type { AdditionalPropertyNameError, AdditionalPropertyNameResult, } from '@chobantonov/jsonforms-react-renderer-common/objects/additionalPropertyName';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { resolveItemSchema, arrayChoicesOf, arrayChoiceItemErrors, hasStringItems, isMultiSelectControl, isChipsControl, asArrayValue, sameChoice, isSelected, addChoice, removeChoiceAt, removeChoice, canAddChoice, canRemoveChoice, } from '@chobantonov/jsonforms-react-renderer-common/collections/arrayChoices';
|
|
2
|
+
export type { ArrayChoice, ArrayChoiceLimits, } from '@chobantonov/jsonforms-react-renderer-common/collections/arrayChoices';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type Category, type Translator } from '@jsonforms/core';
|
|
2
|
+
export declare const useCategoryLabels: (categories: Category[], t: Translator) => (string | undefined)[];
|
|
3
|
+
export { categoryKey, useCategorySelection, } from '@chobantonov/jsonforms-react-renderer-common/layout/categoryState';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
3
|
+
/**
|
|
4
|
+
* The chrome around one table or grid cell.
|
|
5
|
+
*
|
|
6
|
+
* The scalar cells in the cells registry are bare inputs - they draw no
|
|
7
|
+
* Form.Item of their own - so without this a cell shows no validation state at
|
|
8
|
+
* all. It supplies the compact form: the error border plus an icon whose
|
|
9
|
+
* tooltip carries the message, and no label or inline message, neither of
|
|
10
|
+
* which a row has room for. `CellModeProvider` keeps anything dispatched
|
|
11
|
+
* inside it on the same footing.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CellFrame: ({ errors, path, children, }: React.PropsWithChildren<{
|
|
14
|
+
errors?: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
}>) => React.JSX.Element;
|
|
17
|
+
export type ConnectedCellFrameProps = React.PropsWithChildren<{
|
|
18
|
+
schema?: JsonSchema;
|
|
19
|
+
uischema?: UISchemaElement;
|
|
20
|
+
path: string;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* CellFrame for callers that do not already hold the cell's errors - the AG
|
|
24
|
+
* Grid renderer, whose cells are dispatched from a cellRenderer rather than
|
|
25
|
+
* from a connected component.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ConnectedCellFrame: ({ schema, uischema, path, children, }: ConnectedCellFrameProps) => React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export { CellModeProvider, useCellMode, } from '@chobantonov/jsonforms-react-renderer-common/cells/cellMode';
|
|
3
|
+
export interface ControlFormItemProps {
|
|
4
|
+
path?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
htmlFor?: string;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
hideRequiredAsterisk?: boolean;
|
|
10
|
+
/** Validation messages; drives the error state and, in cells, the tooltip. */
|
|
11
|
+
errors?: string;
|
|
12
|
+
/** Message shown under the control outside cells (errors or description). */
|
|
13
|
+
help?: React.ReactNode;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
adornmentSchema?: {
|
|
17
|
+
type?: unknown;
|
|
18
|
+
};
|
|
19
|
+
adornmentOptions?: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The single Form.Item every antd control renders through.
|
|
23
|
+
*
|
|
24
|
+
* Outside a table it behaves as before: label above, message below. Inside a
|
|
25
|
+
* cell the column header already supplies the label and a message underneath
|
|
26
|
+
* would break the row height, so both are dropped and the validation message
|
|
27
|
+
* moves into a tooltip on the control's error state instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ControlFormItem: ({ path, id, htmlFor, label, required, hideRequiredAsterisk, errors, help, style, children, adornmentSchema, adornmentOptions, }: ControlFormItemProps) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useClearAffordance } from '@chobantonov/jsonforms-react-renderer-common/controls/useClearAffordance';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { enclosingPropertyNames, discardedByBranchChange, branchChangeData, } from '@chobantonov/jsonforms-react-renderer-common/composition/combinators';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { preventsEmpty } from '@chobantonov/jsonforms-react-renderer-common/cells/compositeActions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { compositeSummary } from '@chobantonov/jsonforms-react-renderer-common/cells/compositeSummary';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JSONFORMS_CONFIG_KEY, JSONFORMS_EXTENDED_CONFIG_KEY, } from '@chobantonov/jsonforms-react-renderer-common/core/configNamespaces';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { fallbackConfirmationPolicy, resolveConfirmationPolicy, isDiscardableValue, isComplexValue, confirmationRequired, shouldConfirm, } from '@chobantonov/jsonforms-react-renderer-common/interaction/confirmation';
|
|
2
|
+
export type { ConfirmationPolicy, ConfirmationOperation, BaseConfirmationCatalogId, ConfirmationCatalogId, ResolveConfirmationOptions, } from '@chobantonov/jsonforms-react-renderer-common/interaction/confirmation';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
export { formatDate, parseDateValue as getData, } from '@chobantonov/jsonforms-react-renderer-common/formats/dateValues';
|
|
3
|
+
export declare const createOnChangeHandler: (path: string, handleChange: (path: string, value: any) => void, saveFormat: string) => (value: dayjs.Dayjs | null) => void;
|
|
4
|
+
export declare const createOnBlurHandler: (path: string, handleChange: (path: string, value: any) => void, format: string, saveFormat: string, rerenderChild: () => void, onBlur: () => void) => (e: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement, Element>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useDebouncedChange } from '@chobantonov/jsonforms-react-renderer-common/controls/useDebouncedChange';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DynamicPropertyProvider, useDynamicProperty, clearedDynamicPropertyValue, } from '@chobantonov/jsonforms-react-renderer-common/objects/dynamicProperties';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFocus } from '@chobantonov/jsonforms-react-renderer-common/controls/useFocus';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { hasGroupValue, collectBoundPaths, boundDataPaths, groupHasData, useGroupState, } from '@chobantonov/jsonforms-react-renderer-common/layout/groupState';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './datejs';
|
|
2
|
+
export * from './layout';
|
|
3
|
+
export * from './theme';
|
|
4
|
+
export * from './debounce';
|
|
5
|
+
export * from './focus';
|
|
6
|
+
export * from './preTouchErrors';
|
|
7
|
+
export { i18nDefaults } from '@chobantonov/jsonforms-react-renderer-common/locale/index';
|
|
8
|
+
export type { I18nKey } from '@chobantonov/jsonforms-react-renderer-common/locale/index';
|
|
9
|
+
export * from './cellMode';
|
|
10
|
+
export * from './cellFrame';
|
|
11
|
+
export * from './clearAffordance';
|
|
12
|
+
export * from './compositeActions';
|
|
13
|
+
export * from './pendingChanges';
|
|
14
|
+
export * from './configNamespaces';
|
|
15
|
+
export * from './validationIndicator';
|
|
16
|
+
export * from './numeric';
|
|
17
|
+
export * from './translate';
|
|
18
|
+
export * from './visuallyHidden';
|
|
19
|
+
export * from './tuple';
|
|
20
|
+
export * from './compositeSummary';
|
|
21
|
+
export * from './arrayChoices';
|
|
22
|
+
export * from './confirmation';
|
|
23
|
+
export * from './useConfirmation';
|
|
24
|
+
export * from './locale';
|
|
25
|
+
export * from './rendererLocale';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { useEffectiveElements, withAjvProps, } from '@chobantonov/jsonforms-react-renderer-common/layout/layoutContext';
|
|
2
|
+
export type { AjvProps } from '@chobantonov/jsonforms-react-renderer-common/layout/layoutContext';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { UISchemaElement } from '@jsonforms/core';
|
|
5
|
+
import { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonSchema, OwnPropsOfRenderer } from '@jsonforms/core';
|
|
6
|
+
import { type LayoutContainerOptions } from './layoutSizing';
|
|
7
|
+
export interface AntdLayoutRendererProps extends OwnPropsOfRenderer {
|
|
8
|
+
elements: UISchemaElement[];
|
|
9
|
+
direction: 'row' | 'column';
|
|
10
|
+
/** The layout element's own flat options - the container half of the model. */
|
|
11
|
+
layoutOptions?: LayoutContainerOptions;
|
|
12
|
+
config?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare const renderLayoutElements: (elements: UISchemaElement[], schema: JsonSchema, path: string, enabled: boolean, direction: "row" | "column", layoutOptions: LayoutContainerOptions | undefined, config: unknown, renderers?: JsonFormsRendererRegistryEntry[], cells?: JsonFormsCellRendererRegistryEntry[]) => React.JSX.Element;
|
|
15
|
+
export declare const AntdLayoutRenderer: React.MemoExoticComponent<({ visible, elements, schema, path, enabled, direction, layoutOptions, config, renderers, cells, }: AntdLayoutRendererProps) => React.JSX.Element | null>;
|
|
16
|
+
export interface AntdLabelableLayoutRendererProps extends AntdLayoutRendererProps {
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LayoutContainerOptions, LayoutDirection } from '@chobantonov/jsonforms-react-renderer-common/layout/layoutSizing';
|
|
2
|
+
export { resolveGridColumns, resolveWrap, spanBasis, itemSizing, } from '@chobantonov/jsonforms-react-renderer-common/layout/layoutSizing';
|
|
3
|
+
export type { LayoutContainerOptions, LayoutDirection, } from '@chobantonov/jsonforms-react-renderer-common/layout/layoutSizing';
|
|
4
|
+
export declare const DEFAULT_ROW_GAP = 16;
|
|
5
|
+
export declare const resolveGap: (options: LayoutContainerOptions | undefined, config: unknown, direction: LayoutDirection) => import("@chobantonov/jsonforms-react-renderer-common").Dimension;
|
|
6
|
+
export declare const containerStyle: (options: LayoutContainerOptions | undefined, config: unknown, direction: LayoutDirection) => import("react").CSSProperties;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { literalPropertySchema } from '@chobantonov/jsonforms-react-renderer-common/objects/literalPropertySchema';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Locale } from 'antd/es/locale';
|
|
2
|
+
/**
|
|
3
|
+
* Teaching antd which language it is in.
|
|
4
|
+
*
|
|
5
|
+
* JSON Forms carries a locale (`i18n.locale`) and translates the strings the
|
|
6
|
+
* *renderers* own. It says nothing to antd, which owns a second set of strings
|
|
7
|
+
* nobody authored here: the month and weekday names in a calendar, "Today",
|
|
8
|
+
* "OK", a select's empty text, a table's sort tooltips. Without this they stay
|
|
9
|
+
* English however the form is configured, which looks like a translation gap
|
|
10
|
+
* in the form rather than a missing setting.
|
|
11
|
+
*
|
|
12
|
+
* dayjs has to be told separately, because antd's locale supplies the widget
|
|
13
|
+
* chrome while dayjs supplies the formatted date itself.
|
|
14
|
+
*
|
|
15
|
+
* ## Why loaders rather than imports
|
|
16
|
+
*
|
|
17
|
+
* antd ships 75 locales and dayjs 143. Importing them statically puts every
|
|
18
|
+
* one in the bundle to use at most one, so each entry here is a **loader**: a
|
|
19
|
+
* function whose `import()` the bundler turns into its own chunk, fetched only
|
|
20
|
+
* if that locale is asked for.
|
|
21
|
+
*
|
|
22
|
+
* The specifiers are deliberately literal. A computed `import(path)` cannot be
|
|
23
|
+
* analysed statically, and a bundler answers that by emitting either nothing
|
|
24
|
+
* or all 75 - so the list below *is* the build-time selection of supported
|
|
25
|
+
* locales, and adding one means adding a line.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* A loaded locale: antd's chrome, plus the name dayjs knows it by.
|
|
29
|
+
*
|
|
30
|
+
* The dayjs name is carried rather than applied by the loader, because
|
|
31
|
+
* `dayjs.locale()` is global state and has to be set **every time this locale
|
|
32
|
+
* becomes the active one** - not only the first time it is fetched. Applying
|
|
33
|
+
* it inside the loader looked right and left the last-loaded language in
|
|
34
|
+
* charge, so switching back to an already-cached one formatted its dates in
|
|
35
|
+
* the wrong language.
|
|
36
|
+
*/
|
|
37
|
+
export interface LoadedLocale {
|
|
38
|
+
antd: Locale;
|
|
39
|
+
dayjsName: string;
|
|
40
|
+
}
|
|
41
|
+
export type AntdLocaleLoader = () => Promise<LoadedLocale>;
|
|
42
|
+
/**
|
|
43
|
+
* The locales this build includes.
|
|
44
|
+
*
|
|
45
|
+
* Keyed by language tag, matched case-insensitively and by language alone -
|
|
46
|
+
* `bg-BG`, `bg_BG` and `bg` all reach the same entry - so a host that carries
|
|
47
|
+
* a regional tag does not have to normalise it first.
|
|
48
|
+
*
|
|
49
|
+
* Replace or extend it with {@link setAntdLocaleLoaders} at startup; the key
|
|
50
|
+
* is what `i18n.locale` will hold.
|
|
51
|
+
*/
|
|
52
|
+
export declare const defaultAntdLocaleLoaders: Record<string, AntdLocaleLoader>;
|
|
53
|
+
/**
|
|
54
|
+
* Replaces the supported set, for a build that wants fewer chunks or more
|
|
55
|
+
* languages than the list above.
|
|
56
|
+
*/
|
|
57
|
+
export declare const setAntdLocaleLoaders: (next: Record<string, AntdLocaleLoader>) => void;
|
|
58
|
+
export declare const getAntdLocaleLoaders: () => Record<string, AntdLocaleLoader>;
|
|
59
|
+
/** `bg-BG` and `bg_BG` both mean `bg`, and case never matters. */
|
|
60
|
+
export declare const localeKey: (locale: string | undefined) => string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Resolves the antd locale for a language tag, loading it on first use.
|
|
63
|
+
*
|
|
64
|
+
* Returns `undefined` until it arrives and for a tag this build does not
|
|
65
|
+
* carry, which is what antd's own default handles - English chrome is a
|
|
66
|
+
* better answer than a form that will not render.
|
|
67
|
+
*/
|
|
68
|
+
export declare const useAntdLocale: (locale: string | undefined) => Locale | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { toCommittableNumber } from '@chobantonov/jsonforms-react-renderer-common/controls/numeric';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { filterErrorsBeforeTouch, usePreTouchErrors, } from '@chobantonov/jsonforms-react-renderer-common/validation/preTouchErrors';
|
|
2
|
+
export type { FilterErrorsBeforeTouchInput, PreTouchErrorsProps, PreTouchErrors, } from '@chobantonov/jsonforms-react-renderer-common/validation/preTouchErrors';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { defaultRendererLocales, setRendererLocales, getRendererLocales, registerRendererLocale, resolveRendererLocale, rendererDefault, } from '@chobantonov/jsonforms-react-renderer-common/locale/rendererLocale';
|
|
2
|
+
export type { RendererLocaleCatalog } from '@chobantonov/jsonforms-react-renderer-common/locale/rendererLocale';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import type { TemporalBounds, BoundPrecision } from '@chobantonov/jsonforms-react-renderer-common/formats/temporalBounds';
|
|
3
|
+
export { temporalBounds, effectiveRestrict, resolveDataBounds, } from '@chobantonov/jsonforms-react-renderer-common/formats/temporalBounds';
|
|
4
|
+
export type { BoundPrecision, TemporalBounds, } from '@chobantonov/jsonforms-react-renderer-common/formats/temporalBounds';
|
|
5
|
+
/** A `disabledDate` for antd, or undefined when nothing is bounded. */
|
|
6
|
+
export declare const disabledDateFor: (bounds: TemporalBounds) => ((current: dayjs.Dayjs) => boolean) | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* A `disabledTime` for antd.
|
|
9
|
+
*
|
|
10
|
+
* For a date-time the bounds only bite on the **boundary days** - the section
|
|
11
|
+
* asks for exactly that, "date-time bounds applied per boundary day". On any
|
|
12
|
+
* day strictly inside the range every hour is available, and on a day outside
|
|
13
|
+
* it `disabledDate` has already removed the day itself.
|
|
14
|
+
*
|
|
15
|
+
* The parameter is **not** nullable, although at runtime it can be: antd
|
|
16
|
+
* types it as `(date: DateType) => DisabledTimes`, and declaring
|
|
17
|
+
* `DateType | null` makes TypeScript infer the picker's whole generic as
|
|
18
|
+
* `Dayjs | null`. That then rejects the `onChange` handler beside it, whose
|
|
19
|
+
* value is a plain `Dayjs` - an error that points at `onChange` and is caused
|
|
20
|
+
* here. The runtime guard below stays, because a bare time picker really can
|
|
21
|
+
* be called with nothing.
|
|
22
|
+
*/
|
|
23
|
+
export declare const disabledTimeFor: (bounds: TemporalBounds, timeOnly: boolean, precision: BoundPrecision) => ((current: dayjs.Dayjs) => {
|
|
24
|
+
disabledHours?: undefined;
|
|
25
|
+
disabledMinutes?: undefined;
|
|
26
|
+
disabledSeconds?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
disabledHours: () => number[];
|
|
29
|
+
disabledMinutes: (hour: number) => number[];
|
|
30
|
+
disabledSeconds: (hour: number, minute: number) => number[];
|
|
31
|
+
} | {
|
|
32
|
+
disabledHours: () => number[];
|
|
33
|
+
disabledMinutes: (hour: number) => number[];
|
|
34
|
+
disabledSeconds?: undefined;
|
|
35
|
+
}) | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { specDateSaveFormat, specTimeSaveFormat, specDateTimeSaveFormat, saveFormatSatisfies, SAVE_FORMAT_DIAGNOSTIC, warnOnSaveFormat, } from '@chobantonov/jsonforms-react-renderer-common/formats/temporalFormats';
|
|
2
|
+
/**
|
|
3
|
+
* Which time columns `views` asks for, or `undefined` to leave it to the
|
|
4
|
+
* display format.
|
|
5
|
+
*
|
|
6
|
+
* The specification narrows `views` to a date-only array, but the convention
|
|
7
|
+
* it comes from uses time views as well - a time picker defaults to
|
|
8
|
+
* `['hours','minutes']` there, and a date-time picker to
|
|
9
|
+
* `['year','day','hours','minutes']`. Honouring them costs nothing and means a
|
|
10
|
+
* UI schema carrying `views: ['hours','minutes']` hides the seconds column
|
|
11
|
+
* rather than being accepted and ignored.
|
|
12
|
+
*
|
|
13
|
+
* `undefined` rather than all-true when no time view is named: a picker
|
|
14
|
+
* already derives its columns from the display format, and overriding that
|
|
15
|
+
* with an explicit set would make `views: ['year']` on a time picker blank the
|
|
16
|
+
* whole panel. An array naming no time view leaves the format in charge.
|
|
17
|
+
*
|
|
18
|
+
* Independent of the save format, as `views` is everywhere: asking for hours
|
|
19
|
+
* and minutes does not stop seconds being stored.
|
|
20
|
+
*/
|
|
21
|
+
export declare const timePickerColumns: (views: unknown) => {
|
|
22
|
+
showHour: boolean;
|
|
23
|
+
showMinute: boolean;
|
|
24
|
+
showSecond: boolean;
|
|
25
|
+
} | undefined;
|
|
26
|
+
export declare const datePickerMode: (views: unknown, saveFormat: string) => "date" | "month" | "year";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTranslator, useI18n, useI18nDefault, } from '@chobantonov/jsonforms-react-renderer-common/locale/translate';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { tupleDefinition, tupleControlTester, resolveTupleSchema, tupleInitialValue, tupleEmptyValue, UNCONSTRAINED_TYPES, tupleRenderSchema, isComplexTupleSchema, tupleFieldOwnsLabel, } from '@chobantonov/jsonforms-react-renderer-common/tuple/tupleSchema';
|
|
2
|
+
export type { TupleSchema, TupleDefinition, } from '@chobantonov/jsonforms-react-renderer-common/tuple/tupleSchema';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type { ConfirmationRequest as ConfirmRequest } from '@chobantonov/jsonforms-react-renderer-common/interaction/confirmation';
|
|
3
|
+
/** Presents the shared destructive-change policy with an AntD dialog. */
|
|
4
|
+
export declare const useConfirmation: () => {
|
|
5
|
+
request: (next: import("@chobantonov/jsonforms-react-renderer-common").ConfirmationRequest) => void;
|
|
6
|
+
dialog: React.JSX.Element | null;
|
|
7
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { errorDataPath, buildErrorIndex, sharedErrorIndex, displayableErrors, resolveIndicatorOption, useContainerValidation, } from '@chobantonov/jsonforms-react-renderer-common/validation/validationIndicator';
|
|
2
|
+
export type { ContainerValidation } from '@chobantonov/jsonforms-react-renderer-common/validation/validationIndicator';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { visuallyHidden } from '@chobantonov/jsonforms-react-renderer-common/interaction/visuallyHidden';
|