@digigov/react-experimental 2.0.0-d57821ba → 2.0.0-daaf7bdf
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/index.js +1 -1
- package/libs/ui/src/app/Loader/Loader.stories.d.ts +1 -0
- package/libs/ui/src/app/Loader/__stories__/FullPageLoader.d.ts +2 -0
- package/libs/ui/src/app/Modal/index.d.ts +0 -1
- package/libs/ui/src/app/OutdatedBrowserBanner/index.d.ts +0 -1
- package/libs/ui/src/content/Accordion/auto.d.ts +2 -2
- package/libs/ui/src/content/Accordion/index.d.ts +0 -1
- package/libs/ui/src/content/Markdown/Markdown.stories.d.ts +9 -0
- package/libs/ui/src/content/Markdown/index.d.ts +1 -1
- package/libs/ui/src/content/SafeHTML/SafeHTML.stories.d.ts +9 -0
- package/libs/ui/src/{patterns/FilteredResults → content/SafeHTML}/__stories__/Default.d.ts +1 -0
- package/libs/ui/src/content/StepNav/auto.d.ts +2 -2
- package/libs/ui/src/content/StepNav/index.d.ts +0 -1
- package/libs/ui/src/content/SummaryList/SummaryList.stories.d.ts +15 -9
- package/libs/ui/src/content/SummaryList/__stories__/SummaryListExample.d.ts +14 -0
- package/libs/ui/src/feedback/WarningText/index.d.ts +1 -0
- package/libs/ui/src/form/Checkbox/index.d.ts +1 -0
- package/libs/ui/src/index.d.ts +0 -1
- package/libs/ui/src/navigation/Breadcrumbs/Breadcrumbs.stories.d.ts +2 -0
- package/libs/ui/src/navigation/Breadcrumbs/__stories__/Auto.d.ts +3 -0
- package/libs/ui/src/navigation/Breadcrumbs/__stories__/WithHook.d.ts +3 -0
- package/libs/ui/src/navigation/Breadcrumbs/auto.d.ts +16 -0
- package/libs/ui/src/navigation/Breadcrumbs/hooks.d.ts +26 -0
- package/libs/ui/src/navigation/Breadcrumbs/index.d.ts +1 -0
- package/libs/ui/src/navigation/Breadcrumbs/slug.d.ts +1 -0
- package/libs/ui/src/navigation/Breadcrumbs/utils.d.ts +1 -0
- package/libs/ui/src/navigation/Drawer/index.d.ts +0 -1
- package/libs/ui/src/navigation/Pagination/auto.d.ts +2 -2
- package/libs/ui/src/navigation/Pagination/index.d.ts +0 -1
- package/libs/ui/src/navigation/Tabs/index.d.ts +0 -1
- package/libs/ui/src/registry.d.ts +8 -8
- package/libs/ui/src/typography/CodeBlock/CodeBlock.stories.d.ts +3 -0
- package/libs/ui/src/typography/CodeBlock/__stories__/Highlighted.d.ts +3 -0
- package/libs/ui/src/typography/CodeBlock/__stories__/WithCopyToClipboard.d.ts +3 -0
- package/libs/ui/src/typography/CodeBlock/__stories__/WithPhaseBanner.d.ts +3 -0
- package/libs/ui/src/typography/CodeBlock/index.d.ts +4 -5
- package/libs/ui/src/utils/Base/index.d.ts +1 -0
- package/libs/ui/src/utils/hooks/useDebounce.d.ts +1 -1
- package/libs/ui/src/utils/hooks/useKeypress.d.ts +1 -1
- package/libs-ui/react-core/src/Base/index.d.ts +2 -95
- package/libs-ui/react-core/src/Base/index.web.d.ts +97 -0
- package/libs-ui/react-core/src/Base/utils.d.ts +41 -0
- package/libs-ui/react-core/src/CheckboxItemInput/index.d.ts +2 -0
- package/libs-ui/react-core/src/CheckboxItemInput/index.web.d.ts +10 -0
- package/libs-ui/react-core/src/CodeBlockContainer/index.d.ts +1 -9
- package/libs-ui/react-core/src/CodeBlockContent/index.d.ts +1 -1
- package/libs-ui/react-core/src/CodeBlockHeader/index.d.ts +1 -1
- package/libs-ui/react-core/src/CopyToClipboardContainer/index.d.ts +2 -31
- package/libs-ui/react-core/src/CopyToClipboardContainer/index.web.d.ts +31 -0
- package/libs-ui/react-core/src/CopyToClipboardMessage/index.d.ts +2 -18
- package/libs-ui/react-core/src/CopyToClipboardMessage/index.web.d.ts +18 -0
- package/libs-ui/react-core/src/DateInputItem/index.d.ts +2 -26
- package/libs-ui/react-core/src/DateInputItem/index.web.d.ts +26 -0
- package/libs-ui/react-core/src/Details/index.d.ts +2 -10
- package/libs-ui/react-core/src/Details/index.web.d.ts +10 -0
- package/libs-ui/react-core/src/NavListItemActionContainer/index.d.ts +2 -10
- package/libs-ui/react-core/src/NavListItemActionContainer/index.web.d.ts +10 -0
- package/libs-ui/react-core/src/NotificationBannerLink/index.d.ts +2 -11
- package/libs-ui/react-core/src/NotificationBannerLink/index.web.d.ts +11 -0
- package/libs-ui/react-core/src/PhaseBannerTag/index.d.ts +2 -2
- package/libs-ui/react-core/src/SummaryList/index.d.ts +1 -1
- package/libs-ui/react-core/src/SummaryListItemKey/index.d.ts +14 -0
- package/libs-ui/react-core/src/TextArea/index.d.ts +2 -24
- package/libs-ui/react-core/src/TextArea/index.web.d.ts +24 -0
- package/libs-ui/react-core/src/TextInput/index.d.ts +2 -46
- package/libs-ui/react-core/src/TextInput/index.web.d.ts +46 -0
- package/libs-ui/react-core/src/WarningTextAssistive/index.d.ts +15 -0
- package/package.json +5 -5
- package/libs/form/src/Field/FieldBase.d.ts +0 -3
- package/libs/form/src/Field/FieldBaseContainer.d.ts +0 -4
- package/libs/form/src/Field/FieldConditional.d.ts +0 -4
- package/libs/form/src/Field/index.d.ts +0 -4
- package/libs/form/src/Field/types.d.ts +0 -119
- package/libs/form/src/Field/utils/calculateField.d.ts +0 -2
- package/libs/form/src/Field/utils/evaluateFieldWithConditions.d.ts +0 -2
- package/libs/form/src/Field/utils/index.d.ts +0 -3
- package/libs/form/src/Field/utils/useField.d.ts +0 -2
- package/libs/form/src/FieldArray/index.d.ts +0 -11
- package/libs/form/src/FieldObject/index.d.ts +0 -23
- package/libs/form/src/Fieldset/index.d.ts +0 -8
- package/libs/form/src/Fieldset/types.d.ts +0 -10
- package/libs/form/src/FormBuilder/index.d.ts +0 -3
- package/libs/form/src/FormContext.d.ts +0 -3
- package/libs/form/src/MultiplicityField/add-objects.d.ts +0 -14
- package/libs/form/src/MultiplicityField/index.d.ts +0 -15
- package/libs/form/src/MultiplicityField/types.d.ts +0 -19
- package/libs/form/src/index.d.ts +0 -9
- package/libs/form/src/inputs/AutoCompleteInput/index.d.ts +0 -14
- package/libs/form/src/inputs/Checkboxes/index.d.ts +0 -13
- package/libs/form/src/inputs/DateInput/index.d.ts +0 -14
- package/libs/form/src/inputs/FileInput/index.d.ts +0 -14
- package/libs/form/src/inputs/ImageInput/index.d.ts +0 -25
- package/libs/form/src/inputs/Input/index.d.ts +0 -16
- package/libs/form/src/inputs/Label/index.d.ts +0 -21
- package/libs/form/src/inputs/OtpInput/index.d.ts +0 -16
- package/libs/form/src/inputs/Radio/index.d.ts +0 -13
- package/libs/form/src/inputs/Select/index.d.ts +0 -11
- package/libs/form/src/internal.d.ts +0 -5
- package/libs/form/src/types.d.ts +0 -55
- package/libs/form/src/utils.d.ts +0 -8
- package/libs/form/src/validators/index.d.ts +0 -9
- package/libs/form/src/validators/types.d.ts +0 -2
- package/libs/form/src/validators/utils/afm.d.ts +0 -6
- package/libs/form/src/validators/utils/file.d.ts +0 -3
- package/libs/form/src/validators/utils/iban.d.ts +0 -4
- package/libs/form/src/validators/utils/image.d.ts +0 -3
- package/libs/form/src/validators/utils/index.d.ts +0 -27
- package/libs/form/src/validators/utils/int.d.ts +0 -3
- package/libs/form/src/validators/utils/number.d.ts +0 -3
- package/libs/form/src/validators/utils/otp.d.ts +0 -4
- package/libs/form/src/validators/utils/phone.d.ts +0 -11
- package/libs/form/src/validators/utils/postal_code.d.ts +0 -4
- package/libs/form/src/validators/utils/text_limit.d.ts +0 -4
- package/libs/form/src/validators/utils/uuid4.d.ts +0 -6
- package/libs/ui/src/content/SummaryList/__stories__/RowVariations.d.ts +0 -3
- package/libs/ui/src/content/SummaryList/__stories__/WithActions.d.ts +0 -3
- package/libs/ui/src/content/SummaryList/__stories__/WithKeyAndAction.d.ts +0 -3
- package/libs/ui/src/content/SummaryList/__stories__/WithNoLastBorder.d.ts +0 -3
- package/libs/ui/src/content/SummaryList/__stories__/WithoutActions.d.ts +0 -3
- package/libs/ui/src/content/SummaryList/__stories__/WithoutBorders.d.ts +0 -3
- package/libs/ui/src/patterns/FilteredResults/DataTable.d.ts +0 -5
- package/libs/ui/src/patterns/FilteredResults/FilterChips.d.ts +0 -3
- package/libs/ui/src/patterns/FilteredResults/FilterFields.d.ts +0 -5
- package/libs/ui/src/patterns/FilteredResults/FilteredResults.stories.d.ts +0 -8
- package/libs/ui/src/patterns/FilteredResults/hooks.d.ts +0 -22
- package/libs/ui/src/patterns/FilteredResults/index.d.ts +0 -25
- package/libs/ui/src/patterns/index.d.ts +0 -1
- package/libs-ui/react-core/src/index.d.ts +0 -218
- /package/libs/ui/src/content/{SummaryList → Markdown}/__stories__/Default.d.ts +0 -0
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ErrorOption, UseFormReturn, UseFormProps } from 'react-hook-form';
|
|
3
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
4
|
-
import { GridProps } from '@digigov/ui/layouts/Grid';
|
|
5
|
-
export type FieldLabelProps = {
|
|
6
|
-
primary?: string;
|
|
7
|
-
secondary?: string;
|
|
8
|
-
};
|
|
9
|
-
export interface FieldSpec {
|
|
10
|
-
key: string;
|
|
11
|
-
type?: 'int' | 'string' | 'text' | 'boolean' | 'email' | 'uuid4' | 'choice:multiple' | 'choice:single' | 'mobile_phone' | 'date' | 'otp' | 'afm' | 'iban' | 'file' | 'image' | 'postal_code' | 'phone_number' | 'array' | 'object';
|
|
12
|
-
component?: any;
|
|
13
|
-
maxLength?: number;
|
|
14
|
-
condition?: Record<string, FieldCondition>;
|
|
15
|
-
controlled?: boolean;
|
|
16
|
-
label?: FieldLabelProps;
|
|
17
|
-
extra?: {
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
};
|
|
20
|
-
editable?: boolean;
|
|
21
|
-
required?: boolean;
|
|
22
|
-
enabled?: boolean;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
layout?: Record<string, GridProps['xs'] | GridProps['sm'] | GridProps['md'] | GridProps['lg'] | GridProps['xl']>;
|
|
25
|
-
validators?: ValidatorSchema[];
|
|
26
|
-
wrapper?: 'label' | 'fieldset';
|
|
27
|
-
maxWidth?: string;
|
|
28
|
-
maxHeight?: string;
|
|
29
|
-
width?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface FieldCondition {
|
|
32
|
-
is: string | string[] | number | number[] | boolean | boolean[];
|
|
33
|
-
then?: Partial<FieldSpec>;
|
|
34
|
-
else?: Partial<FieldSpec>;
|
|
35
|
-
}
|
|
36
|
-
export interface ChildFieldMemoProps extends FieldConditionalProps {
|
|
37
|
-
dependencies: FormData;
|
|
38
|
-
}
|
|
39
|
-
export type FormData = UseFormProps['defaultValues'];
|
|
40
|
-
export interface FieldWithCondition extends Omit<CalculatedField, 'condition'> {
|
|
41
|
-
condition: Record<string, FieldCondition>;
|
|
42
|
-
}
|
|
43
|
-
export interface FieldConditionalProps {
|
|
44
|
-
field: FieldWithCondition;
|
|
45
|
-
control: UseFormReturn['control'];
|
|
46
|
-
register: UseFormReturn['register'];
|
|
47
|
-
reset: UseFormReturn['reset'];
|
|
48
|
-
error?: ErrorOption;
|
|
49
|
-
}
|
|
50
|
-
export type FieldComponentItem = {
|
|
51
|
-
component: any;
|
|
52
|
-
controlled?: boolean;
|
|
53
|
-
wrapper?: FieldSpec['wrapper'];
|
|
54
|
-
};
|
|
55
|
-
export interface FieldContainerProps {
|
|
56
|
-
name?: FieldSpec['key'];
|
|
57
|
-
layout?: FieldSpec['layout'];
|
|
58
|
-
label?: FieldSpec['label'];
|
|
59
|
-
error?: ErrorOption | Record<string, any>;
|
|
60
|
-
children?: React.ReactNode;
|
|
61
|
-
wrapper?: FieldSpec['wrapper'];
|
|
62
|
-
}
|
|
63
|
-
export type FieldComponentRegistry = Record<string, FieldComponentItem>;
|
|
64
|
-
export type OmittedFieldSpec = Omit<FieldSpec, 'component'>;
|
|
65
|
-
export type UnknownValue = never | never[];
|
|
66
|
-
export interface ControlledFieldProps {
|
|
67
|
-
type?: string;
|
|
68
|
-
value: UnknownValue;
|
|
69
|
-
onChange: (v: UnknownValue) => void;
|
|
70
|
-
defaultValue?: UnknownValue;
|
|
71
|
-
onBlur?: (e: Event) => void;
|
|
72
|
-
extra?: never;
|
|
73
|
-
error?: boolean;
|
|
74
|
-
name?: string;
|
|
75
|
-
disabled?: boolean;
|
|
76
|
-
}
|
|
77
|
-
export interface UncontrolledFieldProps {
|
|
78
|
-
name: string;
|
|
79
|
-
register: FieldBaseProps['register'];
|
|
80
|
-
control?: FieldBaseProps['control'];
|
|
81
|
-
error?: boolean;
|
|
82
|
-
extra?: Record<string, never>;
|
|
83
|
-
type?: string;
|
|
84
|
-
disabled?: boolean;
|
|
85
|
-
}
|
|
86
|
-
export interface CalculatedField extends OmittedFieldSpec {
|
|
87
|
-
name: string;
|
|
88
|
-
component: any;
|
|
89
|
-
defaultValue?: never;
|
|
90
|
-
error?: ErrorOption;
|
|
91
|
-
wrapper?: FieldComponentItem['wrapper'];
|
|
92
|
-
multiplicity?: boolean;
|
|
93
|
-
}
|
|
94
|
-
export interface FieldBaseProps extends CalculatedField {
|
|
95
|
-
control: UseFormReturn['control'];
|
|
96
|
-
register: UseFormReturn['register'];
|
|
97
|
-
reset: UseFormReturn['reset'];
|
|
98
|
-
fieldComponent?: React.FC<FieldBaseProps>;
|
|
99
|
-
}
|
|
100
|
-
export interface FieldProps extends FieldSpec {
|
|
101
|
-
name: string;
|
|
102
|
-
children?: React.ReactNode;
|
|
103
|
-
}
|
|
104
|
-
export interface UseFieldProps {
|
|
105
|
-
field: FieldSpec;
|
|
106
|
-
control: FieldBaseProps['control'];
|
|
107
|
-
register: FieldBaseProps['register'];
|
|
108
|
-
reset: FieldBaseProps['reset'];
|
|
109
|
-
watch: UseFormReturn['watch'];
|
|
110
|
-
formState: UseFormReturn['formState'];
|
|
111
|
-
getFieldState: UseFormReturn['getFieldState'];
|
|
112
|
-
setValue: UseFormReturn['setValue'];
|
|
113
|
-
getValues: UseFormReturn['getValues'];
|
|
114
|
-
unregister: UseFormReturn['unregister'];
|
|
115
|
-
trigger: UseFormReturn['trigger'];
|
|
116
|
-
clearErrors: UseFormReturn['clearErrors'];
|
|
117
|
-
error?: ErrorOption;
|
|
118
|
-
componentRegistry?: FieldComponentRegistry;
|
|
119
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { FieldProps, FieldSpec, FieldComponentRegistry, CalculatedField } from '@digigov/form/Field/types';
|
|
2
|
-
export declare function calculateField(children: FieldProps['children'], field: FieldSpec, fieldComponentRegistry: FieldComponentRegistry, alternativeComponents: FieldComponentRegistry): CalculatedField;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ErrorOption, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { FieldProps } from '@digigov/form/Field/types';
|
|
4
|
-
export interface FieldArrayProps extends FieldProps {
|
|
5
|
-
control: UseFormReturn['control'];
|
|
6
|
-
register: UseFormReturn['register'];
|
|
7
|
-
formState: UseFormReturn['formState'];
|
|
8
|
-
error?: ErrorOption;
|
|
9
|
-
}
|
|
10
|
-
export declare const FieldArray: React.FC<FieldArrayProps>;
|
|
11
|
-
export default FieldArray;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ErrorOption, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { FieldProps } from '@digigov/form/Field/types';
|
|
4
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
5
|
-
export interface FieldObjectProps extends Omit<FieldProps, 'key'> {
|
|
6
|
-
control: UseFormReturn['control'];
|
|
7
|
-
register: UseFormReturn['register'];
|
|
8
|
-
reset: UseFormReturn['reset'];
|
|
9
|
-
formState: UseFormReturn['formState'];
|
|
10
|
-
error?: ErrorOption;
|
|
11
|
-
}
|
|
12
|
-
export declare const FieldObject: React.FC<FieldObjectProps>;
|
|
13
|
-
export interface FieldObjectItemProps {
|
|
14
|
-
name: string;
|
|
15
|
-
field: FieldSpec;
|
|
16
|
-
control: UseFormReturn['control'];
|
|
17
|
-
register: UseFormReturn['register'];
|
|
18
|
-
reset: UseFormReturn['reset'];
|
|
19
|
-
formState: UseFormReturn['formState'];
|
|
20
|
-
error?: ErrorOption;
|
|
21
|
-
children?: React.ReactNode;
|
|
22
|
-
}
|
|
23
|
-
export default FieldObject;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldsetLabelProps, FieldsetCaptionProps, FieldsetBodyProps } from '@digigov/form/Fieldset/types';
|
|
3
|
-
import Fieldset from '@digigov/react-core/Fieldset';
|
|
4
|
-
export declare const FieldsetLabel: React.FC<FieldsetLabelProps>;
|
|
5
|
-
export declare const FieldsetCaption: React.FC<FieldsetCaptionProps>;
|
|
6
|
-
export declare const FieldsetBody: React.FC<FieldsetBodyProps>;
|
|
7
|
-
export { Fieldset };
|
|
8
|
-
export default Fieldset;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FieldsetLegendProps } from '@digigov/react-core/FieldsetLegend';
|
|
3
|
-
import { HintProps } from '@digigov/react-core/Hint';
|
|
4
|
-
export interface FieldsetLabelProps extends FieldsetLegendProps {
|
|
5
|
-
}
|
|
6
|
-
export interface FieldsetCaptionProps extends HintProps {
|
|
7
|
-
}
|
|
8
|
-
export interface FieldsetBodyProps {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ErrorOption, FieldArrayWithId, UseFieldArrayReturn } from 'react-hook-form';
|
|
3
|
-
import type { MultiplicityProps, StashedObject } from '@digigov/form/MultiplicityField/types';
|
|
4
|
-
export interface AddObjectsProps extends Omit<MultiplicityProps, 'key' | 'component'> {
|
|
5
|
-
fields: FieldArrayWithId[];
|
|
6
|
-
error?: ErrorOption;
|
|
7
|
-
append: UseFieldArrayReturn['append'];
|
|
8
|
-
remove: UseFieldArrayReturn['remove'];
|
|
9
|
-
stashedObjects: StashedObject[];
|
|
10
|
-
onStash: (arg0: StashedObject) => void;
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
export declare const AddObjects: React.FC<AddObjectsProps>;
|
|
14
|
-
export default AddObjects;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { MultiplicityProps } from '@digigov/form/MultiplicityField/types';
|
|
4
|
-
export declare const Multiplicity: React.FC<MultiplicityProps>;
|
|
5
|
-
export default Multiplicity;
|
|
6
|
-
export interface ListObjectProps {
|
|
7
|
-
index: number;
|
|
8
|
-
name: string;
|
|
9
|
-
control: UseFormReturn['control'];
|
|
10
|
-
register: UseFormReturn['register'];
|
|
11
|
-
formState: UseFormReturn['formState'];
|
|
12
|
-
onDelete: (index: number) => void;
|
|
13
|
-
extra?: Record<string, any>;
|
|
14
|
-
}
|
|
15
|
-
export declare const ListObject: React.FC<ListObjectProps>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ErrorOption, UseFormReturn } from 'react-hook-form';
|
|
2
|
-
import { FieldSpec } from '@digigov/form/Field/types';
|
|
3
|
-
import { ControlledFieldProps } from '@digigov/form/Field/types';
|
|
4
|
-
export interface MultiplicityProps extends Omit<ControlledFieldProps, 'value' | 'onChange' | 'error' | 'extra'> {
|
|
5
|
-
name: string;
|
|
6
|
-
control: UseFormReturn['control'];
|
|
7
|
-
register: UseFormReturn['register'];
|
|
8
|
-
trigger: UseFormReturn['trigger'];
|
|
9
|
-
clearErrors: UseFormReturn['clearErrors'];
|
|
10
|
-
formState: UseFormReturn['formState'];
|
|
11
|
-
setValue: UseFormReturn['setValue'];
|
|
12
|
-
getValues: UseFormReturn['getValues'];
|
|
13
|
-
unregister: UseFormReturn['unregister'];
|
|
14
|
-
error?: ErrorOption;
|
|
15
|
-
extra?: Record<string, any>;
|
|
16
|
-
label?: FieldSpec['label'];
|
|
17
|
-
layout?: FieldSpec['layout'];
|
|
18
|
-
}
|
|
19
|
-
export type StashedObject = Record<string, any>;
|
package/libs/form/src/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormBaseProps, FormBuilderProps } from '@digigov/form/types';
|
|
3
|
-
declare const FormBase: React.ForwardRefExoticComponent<FormBaseProps & React.RefAttributes<HTMLFormElement>>;
|
|
4
|
-
declare const useFormContext: () => import("@digigov/form/types").FormContextProps;
|
|
5
|
-
declare const useFormValues: () => import("react-hook-form").FieldValues;
|
|
6
|
-
declare const FormBuilder: React.ForwardRefExoticComponent<FormBuilderProps & React.RefAttributes<HTMLFormElement>>;
|
|
7
|
-
export { FormBase, useFormContext, useFormValues, FormBuilder };
|
|
8
|
-
export * from '@digigov/form/internal';
|
|
9
|
-
export default FormBuilder;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ControlledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
import { FieldOptionProps } from '@digigov/form/inputs/Label';
|
|
4
|
-
import { AutoCompleteProps as UIAutoCompleteProps } from '@digigov/ui/form/AutoComplete';
|
|
5
|
-
export interface AutoCompleteInputExtra extends Omit<UIAutoCompleteProps, 'source' | 'id' | 'templates' | 'defaultValue' | 'onConfirm' | 'dropdownArrow'> {
|
|
6
|
-
options: Array<FieldOptionProps>;
|
|
7
|
-
}
|
|
8
|
-
export interface AutoCompleteInputProps extends Omit<ControlledFieldProps, 'value' | 'onChange' | 'extra'> {
|
|
9
|
-
extra: AutoCompleteInputExtra;
|
|
10
|
-
value: string;
|
|
11
|
-
onChange: (v: string | string[] | undefined) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const AutoCompleteInput: React.FC<AutoCompleteInputProps>;
|
|
14
|
-
export default AutoCompleteInput;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ControlledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
import { FieldOptionProps } from '@digigov/form/inputs/Label';
|
|
4
|
-
export interface CheckboxesProps extends Omit<ControlledFieldProps, 'extra' | 'value'> {
|
|
5
|
-
value?: string[];
|
|
6
|
-
extra: {
|
|
7
|
-
className?: string;
|
|
8
|
-
options: Array<FieldOptionProps>;
|
|
9
|
-
};
|
|
10
|
-
fieldComponent: React.FC<Omit<ControlledFieldProps, 'value' | 'onChange'>>;
|
|
11
|
-
}
|
|
12
|
-
export declare const Checkboxes: React.FC<CheckboxesProps>;
|
|
13
|
-
export default Checkboxes;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
export interface DateInputProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
4
|
-
extra?: {
|
|
5
|
-
max?: string;
|
|
6
|
-
min?: string;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export declare const DateInput: ({ name, type, ...props }: {
|
|
10
|
-
[x: string]: any;
|
|
11
|
-
name: any;
|
|
12
|
-
type: any;
|
|
13
|
-
}) => React.JSX.Element;
|
|
14
|
-
export default DateInput;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
export interface FileInputProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
4
|
-
extra?: {
|
|
5
|
-
className?: string;
|
|
6
|
-
multiple?: boolean;
|
|
7
|
-
accept?: string;
|
|
8
|
-
limit: {
|
|
9
|
-
maxSize?: number;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare const FileInput: React.FC<any>;
|
|
14
|
-
export default FileInput;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
export interface ImageProps {
|
|
4
|
-
src?: any;
|
|
5
|
-
}
|
|
6
|
-
export interface Limit {
|
|
7
|
-
maxSize?: number;
|
|
8
|
-
maxWidth?: number;
|
|
9
|
-
maxHeight?: number;
|
|
10
|
-
minWidth?: number;
|
|
11
|
-
minHeight?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare const Image: React.FC<ImageProps>;
|
|
14
|
-
export interface ImageInputProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
15
|
-
extra?: {
|
|
16
|
-
className?: string;
|
|
17
|
-
multiple?: boolean;
|
|
18
|
-
accept?: string;
|
|
19
|
-
limit?: Limit;
|
|
20
|
-
};
|
|
21
|
-
reset: (values?: any) => void;
|
|
22
|
-
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
23
|
-
}
|
|
24
|
-
export declare const ImageInput: React.FC<ImageInputProps>;
|
|
25
|
-
export default ImageInput;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
export interface InputProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
4
|
-
extra?: {
|
|
5
|
-
fullWidth?: boolean;
|
|
6
|
-
multiline?: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
rows?: any;
|
|
9
|
-
limit: {
|
|
10
|
-
min?: number;
|
|
11
|
-
max?: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare const Input: React.ExoticComponent<InputProps>;
|
|
16
|
-
export default Input;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldLabelProps } from '@digigov/form/types';
|
|
3
|
-
export interface FieldOptionProps {
|
|
4
|
-
label?: FieldLabelProps;
|
|
5
|
-
value: string;
|
|
6
|
-
show?: string[];
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
selected?: () => React.ReactNode;
|
|
9
|
-
divider?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface LabelProps {
|
|
12
|
-
primary?: string;
|
|
13
|
-
secondary?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface LabelProps {
|
|
16
|
-
className?: string;
|
|
17
|
-
value?: string;
|
|
18
|
-
label?: FieldLabelProps;
|
|
19
|
-
}
|
|
20
|
-
export declare const Label: React.FC<LabelProps>;
|
|
21
|
-
export default Label;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const RE_DIGIT: RegExp;
|
|
3
|
-
export declare const REMOVE_SPACES: RegExp;
|
|
4
|
-
export declare function useOtp(onChange: any, maxLength: any): {
|
|
5
|
-
otpValues: string[];
|
|
6
|
-
handleOtpChange: (e: React.ChangeEvent<HTMLInputElement>, idx: number) => void;
|
|
7
|
-
handleKeyDown: (e: React.KeyboardEvent<HTMLInputElement>, idx: number) => void;
|
|
8
|
-
handleFocus: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
9
|
-
handlePaste: (e: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const OtpInput: ({ name, maxLength, ...props }: {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
name: any;
|
|
14
|
-
maxLength?: number | undefined;
|
|
15
|
-
}) => React.JSX.Element;
|
|
16
|
-
export default OtpInput;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
import { FieldOptionProps } from '@digigov/form/inputs/Label';
|
|
4
|
-
export interface RadioButtonsGroupProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
5
|
-
extra: {
|
|
6
|
-
className?: string;
|
|
7
|
-
options: Array<FieldOptionProps>;
|
|
8
|
-
dense?: boolean;
|
|
9
|
-
};
|
|
10
|
-
fieldComponent?: React.FC<Omit<UncontrolledFieldProps, 'register'>>;
|
|
11
|
-
}
|
|
12
|
-
export declare const RadioButtonsGroup: React.FC<RadioButtonsGroupProps>;
|
|
13
|
-
export default RadioButtonsGroup;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
import { FieldOptionProps } from '@digigov/form/inputs/Label';
|
|
4
|
-
export interface SelectProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
5
|
-
extra: {
|
|
6
|
-
className?: string;
|
|
7
|
-
options: Array<FieldOptionProps>;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare const Select: React.ExoticComponent<SelectProps>;
|
|
11
|
-
export default Select;
|
package/libs/form/src/types.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { UseFormReturn, UseFormProps } from 'react-hook-form';
|
|
3
|
-
import { FieldComponentRegistry, FieldLabelProps, FieldSpec, FormData } from '@digigov/form/Field/types';
|
|
4
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
5
|
-
export * from '@digigov/form/Field/types';
|
|
6
|
-
export type FieldError = {
|
|
7
|
-
message: string;
|
|
8
|
-
};
|
|
9
|
-
export interface FieldsetSpec {
|
|
10
|
-
key: string;
|
|
11
|
-
fields: string[];
|
|
12
|
-
label?: FieldLabelProps;
|
|
13
|
-
body?: React.ReactNode;
|
|
14
|
-
}
|
|
15
|
-
export interface FormContextProps {
|
|
16
|
-
fieldsetsMap?: Record<string, FieldsetSpec>;
|
|
17
|
-
fieldsMap: Record<string, FieldSpec>;
|
|
18
|
-
control: UseFormReturn['control'];
|
|
19
|
-
register: UseFormReturn['register'];
|
|
20
|
-
trigger: UseFormReturn['trigger'];
|
|
21
|
-
clearErrors: UseFormReturn['clearErrors'];
|
|
22
|
-
watch: UseFormReturn['watch'];
|
|
23
|
-
getFieldState: UseFormReturn['getFieldState'];
|
|
24
|
-
setValue: UseFormReturn['setValue'];
|
|
25
|
-
getValues: UseFormReturn['getValues'];
|
|
26
|
-
unregister: UseFormReturn['unregister'];
|
|
27
|
-
formState: UseFormReturn['formState'];
|
|
28
|
-
reset: UseFormReturn['reset'];
|
|
29
|
-
resetField: UseFormReturn['resetField'];
|
|
30
|
-
registerField: (field: FieldSpec) => void;
|
|
31
|
-
errors: UseFormReturn['formState']['errors'];
|
|
32
|
-
componentRegistry?: FieldComponentRegistry;
|
|
33
|
-
submit: () => Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
export interface FormBuilderProps {
|
|
36
|
-
fields?: FieldSpec[];
|
|
37
|
-
fieldsets?: FieldsetSpec[];
|
|
38
|
-
initial?: FormData;
|
|
39
|
-
onSubmit?: (data: FormData) => void | null | FieldError[];
|
|
40
|
-
mode?: UseFormProps['mode'];
|
|
41
|
-
reValidateMode?: UseFormProps['reValidateMode'];
|
|
42
|
-
criteriaMode?: UseFormProps['criteriaMode'];
|
|
43
|
-
children?: React.ReactNode;
|
|
44
|
-
shouldFocusError?: boolean;
|
|
45
|
-
auto?: boolean;
|
|
46
|
-
validatorRegistry?: Record<string, ValidatorSchema[]>;
|
|
47
|
-
componentRegistry?: FieldComponentRegistry;
|
|
48
|
-
grid?: boolean;
|
|
49
|
-
}
|
|
50
|
-
export interface FormBaseProps extends Omit<FormBuilderProps, 'fields' | 'fieldsets' | 'auto'> {
|
|
51
|
-
fieldsetsMap?: Record<string, FieldsetSpec>;
|
|
52
|
-
fieldsMap: Record<string, FieldSpec>;
|
|
53
|
-
registerField: (field: FieldSpec) => void;
|
|
54
|
-
resolver: any;
|
|
55
|
-
}
|
package/libs/form/src/utils.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FieldError } from 'react-hook-form';
|
|
2
|
-
export declare const yupResolver: (schema: any, schemaOptions?: any, resolverOptions?: any) => (values: any, context: any, options: any) => Promise<{
|
|
3
|
-
values: any;
|
|
4
|
-
errors: {};
|
|
5
|
-
} | {
|
|
6
|
-
values: {};
|
|
7
|
-
errors: Record<string, FieldError>;
|
|
8
|
-
}>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { AnyObjectSchema } from 'yup';
|
|
3
|
-
import Lazy from 'yup/lib/Lazy';
|
|
4
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
5
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
6
|
-
export declare const getYUPTypeMap: () => Record<string, any>;
|
|
7
|
-
export interface MutableRefObjectProps {
|
|
8
|
-
}
|
|
9
|
-
export declare function useValidationSchema(fields: FieldSpec[] | MutableRefObject<MutableRefObjectProps>, validatorRegistry?: Record<string, ValidatorSchema[]>): Lazy<any, unknown> | AnyObjectSchema | void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
2
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
3
|
-
export declare function validateIban(value: string, countryCode: string): boolean;
|
|
4
|
-
export declare const IBAN_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
3
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
4
|
-
export * from '@digigov/form/validators/utils/afm';
|
|
5
|
-
export * from '@digigov/form/validators/utils/file';
|
|
6
|
-
export * from '@digigov/form/validators/utils/iban';
|
|
7
|
-
export * from '@digigov/form/validators/utils/otp';
|
|
8
|
-
export * from '@digigov/form/validators/utils/image';
|
|
9
|
-
export * from '@digigov/form/validators/utils/phone';
|
|
10
|
-
export * from '@digigov/form/validators/utils/postal_code';
|
|
11
|
-
export * from '@digigov/form/validators/utils/uuid4';
|
|
12
|
-
export * from '@digigov/form/validators/utils/text_limit';
|
|
13
|
-
export declare function getYupField(field: FieldSpec, yupTypeMap: Record<string, any>): any;
|
|
14
|
-
export declare function computeShape(fields: FieldSpec[], yupTypeMap: Record<string, ValidatorSchema>, validatorRegistry: Record<string, ValidatorSchema[]> | undefined): {};
|
|
15
|
-
export declare function getYupObjectShape(fields: FieldSpec[] | any, yupTypeMap: Record<string, any>, validatorRegistry?: Record<string, ValidatorSchema[]>): yup.ObjectSchema<{
|
|
16
|
-
[x: string]: yup.AnySchema | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
17
|
-
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
18
|
-
[x: string]: yup.AnySchema | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
19
|
-
}>, import("yup/lib/object").AssertsShape<{
|
|
20
|
-
[x: string]: yup.AnySchema | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
21
|
-
}>> | import("yup/lib/Lazy").default<yup.ObjectSchema<{
|
|
22
|
-
[x: string]: yup.AnySchema | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
23
|
-
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
24
|
-
[x: string]: yup.AnySchema | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
25
|
-
}>, import("yup/lib/object").AssertsShape<{
|
|
26
|
-
[x: string]: yup.AnySchema | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
27
|
-
}>>, import("yup/lib/object").AnyObject>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
2
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
3
|
-
export declare function validateOtp(value: string, maxLength: number): boolean;
|
|
4
|
-
export declare const OTP_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
2
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
3
|
-
export type PhoneNumberType = 'landline' | 'mobile' | null;
|
|
4
|
-
export declare function discoverPhoneType(phoneNumber: string, config: any): string;
|
|
5
|
-
export declare function validatePhoneNumber(phoneNumber: string, countries?: Array<string>, typeOfPhoneNumber?: PhoneNumberType): boolean;
|
|
6
|
-
export declare const MOBILE_PHONE_VALIDATOR: {
|
|
7
|
-
name: string;
|
|
8
|
-
message: string;
|
|
9
|
-
test: (value: any) => boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const PHONE_NUMBER_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
2
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
3
|
-
export declare function validatePostalCode(number: string, countries: Array<string>): boolean;
|
|
4
|
-
export declare const POSTALCODE_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
2
|
-
import { ValidatorSchema } from '@digigov/form/validators/types';
|
|
3
|
-
export declare function validateText(value: string, min: number, max: number): boolean;
|
|
4
|
-
export declare const TEXT_LIMIT_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|