jamespot-react-core 1.1.113 → 1.1.115
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/build/{706.bundle.js → 155.bundle.js} +2 -2
- package/build/155.bundle.js.map +1 -0
- package/build/app.bundle.js +438 -435
- package/build/app.bundle.js.map +1 -1
- package/build/src/displayer/DisplayForm.component.d.ts +19 -20
- package/build/src/displayer/components/DisplayRender.d.ts +7 -7
- package/build/src/displayer/components/inputs/Date.d.ts +3 -2
- package/build/src/displayer/components/inputs/DefaultInput.d.ts +2 -1
- package/build/src/displayer/components/inputs/InputEmail.d.ts +2 -1
- package/build/src/displayer/components/inputs/InputRichText.d.ts +2 -1
- package/build/src/displayer/components/inputs/InputSelect.d.ts +2 -1
- package/build/src/displayer/components/inputs/InputTaxonomy.d.ts +15 -4
- package/build/src/displayer/components/inputs/InputTextarea.d.ts +2 -1
- package/build/src/displayer/components/inputs/OrientedLink.d.ts +2 -1
- package/build/src/displayer/components/inputs/Radio.d.ts +2 -1
- package/build/src/displayer/formatter.d.ts +15 -162
- package/build/src/displayer/types.d.ts +34 -34
- package/build/src/displayer/useDisplay.d.ts +8 -8
- package/build/src/redux/slice/Article.slice.d.ts +12 -2
- package/build/src/redux/slice/User.slice.d.ts +12 -2
- package/build/src/redux/store.d.ts +24 -4
- package/build/src/registry/coreComponents.d.ts +1 -1
- package/package.json +4 -4
- package/build/706.bundle.js.map +0 -1
- /package/build/src/{displayer → components}/Empty.d.ts +0 -0
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DisplayFormRef,
|
|
3
|
-
import { Control } from 'react-hook-form';
|
|
2
|
+
import { DisplayFormRef, FieldsWith } from './types';
|
|
3
|
+
import { Control, FieldValues } from 'react-hook-form';
|
|
4
|
+
export declare type DisplayFormProps<TFieldValues extends FieldValues> = {
|
|
5
|
+
type: string;
|
|
6
|
+
fields: FieldsWith<'input', TFieldValues>;
|
|
7
|
+
extraInputs?: (control: Control<TFieldValues>) => React.ReactNode;
|
|
8
|
+
defaultValues?: any;
|
|
9
|
+
onSubmit: any;
|
|
10
|
+
buttons: React.ReactNode;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
dataCy?: string;
|
|
13
|
+
stretch?: boolean;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
};
|
|
4
16
|
/****
|
|
5
17
|
* The jamespot model depend on the platform
|
|
6
18
|
* For example a user can have the size attribute only for a given platform
|
|
7
19
|
* The model specifics of a platform are stored in J.model
|
|
8
20
|
*
|
|
9
21
|
* This component display an array of attributes only if this attribute is activated on the platform
|
|
10
|
-
*
|
|
11
|
-
* @param type form model type (sport, mpArticle, etc.)
|
|
12
|
-
* @param fields an array of string : the list of attributes we want to display
|
|
13
|
-
* @param defaultValues react hook form default values
|
|
14
|
-
* @param onSubmit callback provided to react hook, called after successful validation
|
|
15
|
-
* @param buttons the buttons, should always include a <button type="submit">
|
|
16
|
-
* Note :If we override the "render" you can't override "wrapper" and "element" because the render rewrite everything
|
|
17
22
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
onSubmit: any;
|
|
24
|
-
buttons: React.ReactNode;
|
|
25
|
-
readOnly?: boolean | undefined;
|
|
26
|
-
dataCy?: string | undefined;
|
|
27
|
-
stretch?: boolean | undefined;
|
|
28
|
-
} & React.RefAttributes<DisplayFormRef>>;
|
|
23
|
+
declare const _DisplayForm: <TFieldValues extends FieldValues>(props: DisplayFormProps<TFieldValues>, ref: React.ForwardedRef<DisplayFormRef>) => JSX.Element;
|
|
24
|
+
export declare const DisplayForm: <TFieldValues extends FieldValues>(props: DisplayFormProps<TFieldValues> & {
|
|
25
|
+
ref?: React.ForwardedRef<DisplayFormRef> | undefined;
|
|
26
|
+
}) => ReturnType<typeof _DisplayForm>;
|
|
27
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RenderAttributeProps } from 'displayer/types';
|
|
3
|
-
export declare function DisplayDate
|
|
4
|
-
export declare function DisplayDefault
|
|
5
|
-
export declare function DisplayEmail
|
|
6
|
-
export declare function DisplayRadio
|
|
7
|
-
export declare function DisplayRichText
|
|
8
|
-
export declare function DisplayTag
|
|
9
|
-
export declare function DisplayUrl
|
|
3
|
+
export declare function DisplayDate({ object, attribute }: RenderAttributeProps): JSX.Element | null;
|
|
4
|
+
export declare function DisplayDefault({ object, attribute }: RenderAttributeProps): JSX.Element | null;
|
|
5
|
+
export declare function DisplayEmail({ object, attribute }: RenderAttributeProps): JSX.Element | null;
|
|
6
|
+
export declare function DisplayRadio({ object, attribute }: RenderAttributeProps): JSX.Element | null;
|
|
7
|
+
export declare function DisplayRichText({ object, attribute }: RenderAttributeProps): JSX.Element | null;
|
|
8
|
+
export declare function DisplayTag({ object, attribute }: RenderAttributeProps): JSX.Element | null;
|
|
9
|
+
export declare function DisplayUrl({ object, attribute }: RenderAttributeProps): JSX.Element | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
export declare const InputDate: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
4
|
+
export declare const SearchDate: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
-
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
export declare const DefaultInput: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
-
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
export declare const InputEmail: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
-
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
export declare const InputRichText: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
2
3
|
declare type InputSelectConfig = {
|
|
3
4
|
name: string;
|
|
4
5
|
placeholder: string;
|
|
@@ -6,5 +7,5 @@ declare type InputSelectConfig = {
|
|
|
6
7
|
export declare const InputSelect: (options: Array<{
|
|
7
8
|
label: string;
|
|
8
9
|
value: string;
|
|
9
|
-
}>, config: InputSelectConfig) => (props: DisplayInputComponentProps) => JSX.Element;
|
|
10
|
+
}>, config: InputSelectConfig) => <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
-
import {
|
|
1
|
+
import type { DisplayInputComponentProps } from '../../types';
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
import type { WidgetTaxonomy } from 'jamespot-user-api';
|
|
3
4
|
declare type InputTaxonomyConfig = {
|
|
4
5
|
name: string;
|
|
5
6
|
placeholder: string;
|
|
6
7
|
};
|
|
7
|
-
export declare const InputTaxonomy: (widget: WidgetTaxonomy, config: InputTaxonomyConfig) => (props:
|
|
8
|
-
|
|
8
|
+
export declare const InputTaxonomy: (widget: WidgetTaxonomy, config: InputTaxonomyConfig) => <TFieldValues extends FieldValues>(props: Required<Pick<import("react-hook-form").UseControllerProps<TFieldValues, import("react-hook-form").Path<TFieldValues>>, "name" | "control">> & {
|
|
9
|
+
label: string;
|
|
10
|
+
placeholder?: string | undefined;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
widget: import("jamespot-user-api").Widget;
|
|
13
|
+
mandatory: boolean;
|
|
14
|
+
dataCy?: string | undefined;
|
|
15
|
+
width?: string | undefined;
|
|
16
|
+
margin?: string | undefined;
|
|
17
|
+
readOnly?: boolean | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
displayModal?: boolean | undefined;
|
|
9
20
|
}) => JSX.Element;
|
|
10
21
|
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
-
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
export declare const InputTextarea: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
-
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
export declare const OrientedLinkInput: (type?: string, isRequired?: boolean) => <TFieldValues extends FieldValues>({ widget, ...props }: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DisplayInputComponentProps } from '../../types';
|
|
2
|
+
import type { FieldValues } from 'react-hook-form';
|
|
2
3
|
declare type RadioConfig = {
|
|
3
4
|
checkboxMode: 'radio' | 'checkbox';
|
|
4
5
|
direction?: 'row' | 'column' | 'two-columns';
|
|
@@ -7,5 +8,5 @@ declare type RadioConfig = {
|
|
|
7
8
|
export declare const RadioInput: (options: Array<{
|
|
8
9
|
value: string;
|
|
9
10
|
label: string;
|
|
10
|
-
}>, config: RadioConfig) => ({ widget, ...props }: DisplayInputComponentProps) => JSX.Element;
|
|
11
|
+
}>, config: RadioConfig) => <TFieldValues extends FieldValues>({ widget, ...props }: DisplayInputComponentProps<TFieldValues>) => JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,163 +1,16 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DisplayDate, DisplayDefault, DisplayEmail, DisplayRadio, DisplayRichText, DisplayTag, DisplayUrl } from 'displayer/components/DisplayRender';
|
|
3
1
|
import { FieldConfiguration } from 'jamespot-user-api';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare function
|
|
18
|
-
|
|
19
|
-
render: typeof DisplayDate;
|
|
20
|
-
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
21
|
-
search: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
22
|
-
};
|
|
23
|
-
label: string;
|
|
24
|
-
description?: string | undefined;
|
|
25
|
-
widget: import("jamespot-user-api").Widget;
|
|
26
|
-
name: Properties;
|
|
27
|
-
mandatory: boolean;
|
|
28
|
-
};
|
|
29
|
-
export declare function formatDefault<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
30
|
-
components: {
|
|
31
|
-
render: typeof DisplayDefault;
|
|
32
|
-
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
33
|
-
search: typeof NotImplemented;
|
|
34
|
-
};
|
|
35
|
-
label: string;
|
|
36
|
-
description?: string | undefined;
|
|
37
|
-
widget: import("jamespot-user-api").Widget;
|
|
38
|
-
name: Properties;
|
|
39
|
-
mandatory: boolean;
|
|
40
|
-
};
|
|
41
|
-
export declare function formatEmail<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
42
|
-
components: {
|
|
43
|
-
render: typeof DisplayEmail;
|
|
44
|
-
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
45
|
-
search: typeof NotImplemented;
|
|
46
|
-
};
|
|
47
|
-
label: string;
|
|
48
|
-
description?: string | undefined;
|
|
49
|
-
widget: import("jamespot-user-api").Widget;
|
|
50
|
-
name: Properties;
|
|
51
|
-
mandatory: boolean;
|
|
52
|
-
};
|
|
53
|
-
export declare function formatNumber<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
54
|
-
components: {
|
|
55
|
-
render: typeof DisplayDefault;
|
|
56
|
-
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
57
|
-
search: typeof NotImplemented;
|
|
58
|
-
};
|
|
59
|
-
label: string;
|
|
60
|
-
description?: string | undefined;
|
|
61
|
-
widget: import("jamespot-user-api").Widget;
|
|
62
|
-
name: Properties;
|
|
63
|
-
mandatory: boolean;
|
|
64
|
-
};
|
|
65
|
-
export declare function formatOrientedlinks<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
66
|
-
components: {
|
|
67
|
-
render: typeof DisplayTag;
|
|
68
|
-
input: ({ widget, ...props }: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
69
|
-
search: ({ widget, ...props }: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
70
|
-
};
|
|
71
|
-
label: string;
|
|
72
|
-
description?: string | undefined;
|
|
73
|
-
widget: import("jamespot-user-api").Widget;
|
|
74
|
-
name: Properties;
|
|
75
|
-
mandatory: boolean;
|
|
76
|
-
};
|
|
77
|
-
export declare function formatRadio<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
78
|
-
components: {
|
|
79
|
-
render: typeof DisplayRadio;
|
|
80
|
-
input: ({ widget, ...props }: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
81
|
-
search: ({ widget, ...props }: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
82
|
-
};
|
|
83
|
-
label: string;
|
|
84
|
-
description?: string | undefined;
|
|
85
|
-
widget: import("jamespot-user-api").Widget;
|
|
86
|
-
name: Properties;
|
|
87
|
-
mandatory: boolean;
|
|
88
|
-
};
|
|
89
|
-
export declare function formatSelect<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
90
|
-
components: {
|
|
91
|
-
render: typeof DisplayDefault;
|
|
92
|
-
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
93
|
-
search: typeof NotImplemented;
|
|
94
|
-
};
|
|
95
|
-
label: string;
|
|
96
|
-
description?: string | undefined;
|
|
97
|
-
widget: import("jamespot-user-api").Widget;
|
|
98
|
-
name: Properties;
|
|
99
|
-
mandatory: boolean;
|
|
100
|
-
};
|
|
101
|
-
export declare function formatRichText<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
102
|
-
components: {
|
|
103
|
-
render: typeof DisplayRichText;
|
|
104
|
-
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
105
|
-
search: typeof NotImplemented;
|
|
106
|
-
};
|
|
107
|
-
label: string;
|
|
108
|
-
description?: string | undefined;
|
|
109
|
-
widget: import("jamespot-user-api").Widget;
|
|
110
|
-
name: Properties;
|
|
111
|
-
mandatory: boolean;
|
|
112
|
-
};
|
|
113
|
-
export declare function formatTaxonomy<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
114
|
-
components: {
|
|
115
|
-
render: typeof DisplayDefault;
|
|
116
|
-
input: (props: import("./types").DisplayInputComponentProps & {
|
|
117
|
-
displayModal?: boolean | undefined;
|
|
118
|
-
}) => JSX.Element;
|
|
119
|
-
search: typeof NotImplemented;
|
|
120
|
-
};
|
|
121
|
-
label: string;
|
|
122
|
-
description?: string | undefined;
|
|
123
|
-
widget: import("jamespot-user-api").Widget;
|
|
124
|
-
name: Properties;
|
|
125
|
-
mandatory: boolean;
|
|
126
|
-
};
|
|
127
|
-
export declare function formatTextarea<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
128
|
-
components: {
|
|
129
|
-
render: typeof DisplayDefault;
|
|
130
|
-
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
131
|
-
search: typeof NotImplemented;
|
|
132
|
-
};
|
|
133
|
-
label: string;
|
|
134
|
-
description?: string | undefined;
|
|
135
|
-
widget: import("jamespot-user-api").Widget;
|
|
136
|
-
name: Properties;
|
|
137
|
-
mandatory: boolean;
|
|
138
|
-
};
|
|
139
|
-
export declare function formatUri<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
140
|
-
components: {
|
|
141
|
-
render: typeof DisplayDefault;
|
|
142
|
-
input: ({ widget, ...props }: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
143
|
-
search: typeof NotImplemented;
|
|
144
|
-
};
|
|
145
|
-
label: string;
|
|
146
|
-
description?: string | undefined;
|
|
147
|
-
widget: import("jamespot-user-api").Widget;
|
|
148
|
-
name: Properties;
|
|
149
|
-
mandatory: boolean;
|
|
150
|
-
};
|
|
151
|
-
export declare function formatUrl<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
152
|
-
components: {
|
|
153
|
-
render: typeof DisplayUrl;
|
|
154
|
-
input: typeof NotImplemented;
|
|
155
|
-
search: typeof NotImplemented;
|
|
156
|
-
};
|
|
157
|
-
label: string;
|
|
158
|
-
description?: string | undefined;
|
|
159
|
-
widget: import("jamespot-user-api").Widget;
|
|
160
|
-
name: Properties;
|
|
161
|
-
mandatory: boolean;
|
|
162
|
-
};
|
|
163
|
-
export {};
|
|
2
|
+
import { DisplayerElement } from './types';
|
|
3
|
+
import type { FieldValues, FieldPath } from 'react-hook-form';
|
|
4
|
+
export declare function formatCheckbox<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
5
|
+
export declare function formatDate<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
6
|
+
export declare function formatDefault<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
7
|
+
export declare function formatEmail<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
8
|
+
export declare function formatNumber<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
9
|
+
export declare function formatOrientedlinks<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
10
|
+
export declare function formatRadio<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
11
|
+
export declare function formatSelect<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
12
|
+
export declare function formatRichText<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
13
|
+
export declare function formatTaxonomy<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
14
|
+
export declare function formatTextarea<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
15
|
+
export declare function formatUri<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
16
|
+
export declare function formatUrl<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { UseFormReset } from 'react-hook-form';
|
|
3
|
-
import { Widget } from 'jamespot-user-api';
|
|
2
|
+
import type { UseFormReset, FieldValues } from 'react-hook-form';
|
|
3
|
+
import type { Widget } from 'jamespot-user-api';
|
|
4
|
+
import type { NameControl } from 'jamespot-react-components';
|
|
4
5
|
export declare type IncludeCustom = {
|
|
5
6
|
includes: 'tags';
|
|
6
7
|
};
|
|
7
|
-
export declare type
|
|
8
|
-
name: Properties;
|
|
9
|
-
componentsOverride: Partial<DisplayElementComponent<Object>>;
|
|
10
|
-
disableSortBy?: boolean;
|
|
11
|
-
} | IncludeCustom;
|
|
12
|
-
export declare type FieldWithOptionalRender<Object, Properties extends string> = Properties | {
|
|
13
|
-
name: Properties;
|
|
14
|
-
render: React.FunctionComponent<RenderAttributeProps<Object>>;
|
|
8
|
+
export declare type FieldConfig = {
|
|
15
9
|
disableSortBy?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare type Field<TFieldValues extends FieldValues = FieldValues> = string | {
|
|
12
|
+
name: string;
|
|
13
|
+
componentsOverride: Partial<DisplayElementComponent<TFieldValues>>;
|
|
14
|
+
config?: FieldConfig;
|
|
16
15
|
} | IncludeCustom;
|
|
17
|
-
export declare type Fields<
|
|
18
|
-
export declare type
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
export declare type Fields<TFieldValues extends FieldValues = FieldValues> = Array<Field<TFieldValues>>;
|
|
17
|
+
export declare type FieldWith<With extends 'input' | 'render', TFieldValues extends FieldValues = FieldValues> = string | ({
|
|
18
|
+
[x in With]: DisplayElementComponent<TFieldValues>[With];
|
|
19
|
+
} & {
|
|
20
|
+
name: string;
|
|
21
|
+
config?: FieldConfig;
|
|
22
|
+
}) | IncludeCustom;
|
|
23
|
+
export declare type FieldsWith<With extends 'input' | 'render', TFieldValues extends FieldValues = FieldValues> = Array<FieldWith<With, TFieldValues>>;
|
|
24
|
+
export declare type RenderAttributeProps = {
|
|
25
|
+
object: any;
|
|
26
|
+
attribute: DisplayerElementAttributes;
|
|
27
|
+
};
|
|
28
|
+
export declare type DisplayInputComponentProps<TFieldValues extends FieldValues = FieldValues> = NameControl<TFieldValues> & {
|
|
21
29
|
label: string;
|
|
22
|
-
placeholder?:
|
|
30
|
+
placeholder?: string;
|
|
23
31
|
description?: string;
|
|
24
|
-
name: string;
|
|
25
32
|
widget: Widget;
|
|
26
33
|
mandatory: boolean;
|
|
27
34
|
dataCy?: string;
|
|
@@ -29,31 +36,24 @@ export declare type DisplayInputComponentProps = {
|
|
|
29
36
|
margin?: string;
|
|
30
37
|
readOnly?: boolean;
|
|
31
38
|
};
|
|
32
|
-
export declare type DisplayElementComponent<
|
|
33
|
-
render: React.FunctionComponent<RenderAttributeProps
|
|
34
|
-
input: React.FunctionComponent<DisplayInputComponentProps
|
|
35
|
-
search
|
|
39
|
+
export declare type DisplayElementComponent<TFieldValues extends FieldValues = FieldValues> = {
|
|
40
|
+
render: React.FunctionComponent<RenderAttributeProps>;
|
|
41
|
+
input: React.FunctionComponent<DisplayInputComponentProps<TFieldValues>>;
|
|
42
|
+
search: React.FunctionComponent<DisplayInputComponentProps<TFieldValues>>;
|
|
36
43
|
};
|
|
37
|
-
export declare type
|
|
38
|
-
name:
|
|
44
|
+
export declare type DisplayerElementAttributes = {
|
|
45
|
+
name: string;
|
|
39
46
|
label: string;
|
|
40
47
|
description?: string;
|
|
41
48
|
mandatory: boolean;
|
|
42
49
|
widget: Widget;
|
|
43
|
-
components: DisplayElementComponent<Object>;
|
|
44
|
-
};
|
|
45
|
-
export declare type DisplayAttributesProps<Object> = {
|
|
46
|
-
object: Object;
|
|
47
|
-
componentsOverride?: Record<string, Partial<DisplayElementComponent<Object>>>;
|
|
48
|
-
attributesName: string[];
|
|
49
50
|
};
|
|
50
|
-
export declare type
|
|
51
|
-
|
|
52
|
-
attribute: Omit<DisplayerElement<Object, Properties>, 'components'>;
|
|
51
|
+
export declare type DisplayerElement<TFieldValues extends FieldValues = FieldValues> = DisplayerElementAttributes & {
|
|
52
|
+
components: DisplayElementComponent<TFieldValues>;
|
|
53
53
|
};
|
|
54
|
-
export declare type DisplayFormProps<
|
|
54
|
+
export declare type DisplayFormProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
55
55
|
type: string;
|
|
56
|
-
componentsOverride?: Record<string, Partial<DisplayElementComponent<
|
|
56
|
+
componentsOverride?: Record<string, Partial<DisplayElementComponent<TFieldValues>>>;
|
|
57
57
|
attributesName: string[];
|
|
58
58
|
onSubmit: any;
|
|
59
59
|
buttons: React.ReactNode;
|
|
@@ -61,4 +61,4 @@ export declare type DisplayFormProps<Object> = {
|
|
|
61
61
|
export declare type DisplayFormRef = {
|
|
62
62
|
reset: UseFormReset<any>;
|
|
63
63
|
};
|
|
64
|
-
export declare type Displayer<
|
|
64
|
+
export declare type Displayer<TFieldValues extends FieldValues = FieldValues> = Array<DisplayerElement<TFieldValues>>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Displayer, Fields, FieldsWith } from './types';
|
|
2
|
+
import type { FieldValues, FieldPath } from 'react-hook-form';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
* @param fields - fields that we want to display (firstname, name, age...)
|
|
6
6
|
* @param type - model type (user, article, spot...)
|
|
7
7
|
*/
|
|
8
|
-
export declare function useDisplay<
|
|
9
|
-
export declare function useDisplayList<
|
|
8
|
+
export declare function useDisplay<TFieldValues extends FieldValues = FieldValues, Properties extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(fields: Fields<TFieldValues>, type: string): Displayer<TFieldValues>;
|
|
9
|
+
export declare function useDisplayList<TFieldValues extends FieldValues = FieldValues>(fields: FieldsWith<'render', TFieldValues>, type: string): {
|
|
10
10
|
accessor: (object: Object) => JSX.Element;
|
|
11
|
-
disableSortBy:
|
|
12
|
-
id:
|
|
11
|
+
disableSortBy: true | undefined;
|
|
12
|
+
id: string;
|
|
13
13
|
Header: string;
|
|
14
|
-
name:
|
|
14
|
+
name: string;
|
|
15
15
|
}[];
|
|
16
|
-
export declare function useDisplayForm<
|
|
16
|
+
export declare function useDisplayForm<TFieldValues extends FieldValues = FieldValues>(fields: FieldsWith<'input', TFieldValues>, type: string): [Array<{
|
|
17
17
|
Input: any;
|
|
18
18
|
name: string;
|
|
19
19
|
}>, Record<string, '' | Array<void>>];
|
|
@@ -37,8 +37,18 @@ export declare const articlesSelector: import("@reduxjs/toolkit").EntitySelector
|
|
|
37
37
|
form: import("redux-form").FormStateMap;
|
|
38
38
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
39
39
|
id: string;
|
|
40
|
-
label: string
|
|
41
|
-
|
|
40
|
+
label: string | {
|
|
41
|
+
id: string;
|
|
42
|
+
values: {
|
|
43
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
description?: string | {
|
|
47
|
+
id: string;
|
|
48
|
+
values: {
|
|
49
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
50
|
+
};
|
|
51
|
+
} | undefined;
|
|
42
52
|
timeout: number;
|
|
43
53
|
type: "error" | "success" | "warning";
|
|
44
54
|
}>;
|
|
@@ -37,8 +37,18 @@ export declare const usersSelector: import("@reduxjs/toolkit").EntitySelectors<U
|
|
|
37
37
|
form: import("redux-form").FormStateMap;
|
|
38
38
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
39
39
|
id: string;
|
|
40
|
-
label: string
|
|
41
|
-
|
|
40
|
+
label: string | {
|
|
41
|
+
id: string;
|
|
42
|
+
values: {
|
|
43
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
description?: string | {
|
|
47
|
+
id: string;
|
|
48
|
+
values: {
|
|
49
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
50
|
+
};
|
|
51
|
+
} | undefined;
|
|
42
52
|
timeout: number;
|
|
43
53
|
type: "error" | "success" | "warning";
|
|
44
54
|
}>;
|
|
@@ -37,8 +37,18 @@ declare function createStore(initialAsyncReducers: {}, initialState: any): impor
|
|
|
37
37
|
form: import("redux-form").FormStateMap;
|
|
38
38
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
39
39
|
id: string;
|
|
40
|
-
label: string
|
|
41
|
-
|
|
40
|
+
label: string | {
|
|
41
|
+
id: string;
|
|
42
|
+
values: {
|
|
43
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
description?: string | {
|
|
47
|
+
id: string;
|
|
48
|
+
values: {
|
|
49
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
50
|
+
};
|
|
51
|
+
} | undefined;
|
|
42
52
|
timeout: number;
|
|
43
53
|
type: "error" | "success" | "warning";
|
|
44
54
|
}>;
|
|
@@ -53,8 +63,18 @@ declare function createStore(initialAsyncReducers: {}, initialState: any): impor
|
|
|
53
63
|
form: import("redux-form").FormStateMap;
|
|
54
64
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
55
65
|
id: string;
|
|
56
|
-
label: string
|
|
57
|
-
|
|
66
|
+
label: string | {
|
|
67
|
+
id: string;
|
|
68
|
+
values: {
|
|
69
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
description?: string | {
|
|
73
|
+
id: string;
|
|
74
|
+
values: {
|
|
75
|
+
[x: string]: string | number | boolean | Date | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((children: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) | null | undefined;
|
|
76
|
+
};
|
|
77
|
+
} | undefined;
|
|
58
78
|
timeout: number;
|
|
59
79
|
type: "error" | "success" | "warning";
|
|
60
80
|
}>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* please fill this file and core-component-list.ts
|
|
3
3
|
*/
|
|
4
4
|
export { DisplayForm } from '../displayer/DisplayForm.component';
|
|
5
|
-
export { Empty } from '../
|
|
5
|
+
export { Empty } from '../components/Empty';
|
|
6
6
|
export { TwoColLayout } from '../components/TwoColLayout';
|
|
7
7
|
export { WidgetWrapperCore } from '../components/widgets/WidgetWrapperCore';
|
|
8
8
|
export { WidgetList } from '../components/widgets/WidgetList/WidgetList';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.115",
|
|
4
4
|
"description": "Jamespot React Core",
|
|
5
5
|
"main": "./build/app.bundle.js",
|
|
6
6
|
"types": "./build/src/App.d.ts",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@reduxjs/toolkit": "^1.9.0",
|
|
68
68
|
"history": "^5.3.0",
|
|
69
|
-
"jamespot-front-business": "^1.1.
|
|
70
|
-
"jamespot-react-components": "^1.0.
|
|
71
|
-
"jamespot-user-api": "^1.0.
|
|
69
|
+
"jamespot-front-business": "^1.1.20",
|
|
70
|
+
"jamespot-react-components": "^1.0.144",
|
|
71
|
+
"jamespot-user-api": "^1.0.114",
|
|
72
72
|
"react": "^17.0.2",
|
|
73
73
|
"react-dom": "^17.0.2",
|
|
74
74
|
"react-hook-form": "^7.25.0",
|