jamespot-react-core 1.1.97 → 1.1.99
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/898.bundle.js +1 -1
- package/build/898.bundle.js.map +1 -1
- package/build/app.bundle.js +359 -258
- package/build/app.bundle.js.map +1 -1
- package/build/assets/group-background.daf782321c7f65cde0fc3d5918d27762.png +0 -0
- package/build/jest.config.d.ts +16 -0
- package/build/jest.setup.d.ts +1 -0
- package/build/socket.sharedworker.bb25eb0781ce40fec4a2.js.map +1 -1
- package/build/src/displayer/DisplayForm.component.d.ts +26 -0
- package/build/src/displayer/components/inputs/InputRichText.d.ts +2 -0
- package/build/{displayer → src/displayer}/formatter.d.ts +14 -14
- package/build/{displayer → src/displayer}/types.d.ts +4 -5
- package/build/{displayer → src/displayer}/useDisplay.d.ts +6 -2
- package/build/{redux → src/redux}/slice/Article.slice.d.ts +2 -2
- package/build/{redux → src/redux}/slice/User.slice.d.ts +2 -2
- package/build/{redux → src/redux}/store.d.ts +4 -4
- package/build/{registry → src/registry}/ext-component-list.d.ts +1 -0
- package/build/{utils → src/utils}/ensure.d.ts +2 -0
- package/build/{utils → src/utils}/types.d.ts +4 -8
- package/jest.config.ts +15 -0
- package/jest.setup.ts +1 -0
- package/package.json +6 -5
- package/build/displayer/DisplayForm.component.d.ts +0 -16
- /package/build/{App.d.ts → src/App.d.ts} +0 -0
- /package/build/{ReactCore.d.ts → src/ReactCore.d.ts} +0 -0
- /package/build/{Router.d.ts → src/Router.d.ts} +0 -0
- /package/build/{Toast.d.ts → src/Toast.d.ts} +0 -0
- /package/build/{components → src/components}/ExtensionProvider.component.d.ts +0 -0
- /package/build/{components → src/components}/IfAppIsActivated.component.d.ts +0 -0
- /package/build/{components → src/components}/RTProvider.component.d.ts +0 -0
- /package/build/{components → src/components}/Toaster.d.ts +0 -0
- /package/build/{components → src/components}/TwoColLayout.d.ts +0 -0
- /package/build/{components → src/components}/index.d.ts +0 -0
- /package/build/{components → src/components}/types.d.ts +0 -0
- /package/build/{displayer → src/displayer}/Empty.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/DisplayRender.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/Date.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/DefaultInput.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/InputEmail.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/InputSelect.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/InputTaxonomy.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/InputTextarea.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/OrientedLink.d.ts +0 -0
- /package/build/{displayer → src/displayer}/components/inputs/Radio.d.ts +0 -0
- /package/build/{displayer → src/displayer}/displayer.utils.d.ts +0 -0
- /package/build/{redux → src/redux}/actions/Articles.actions.d.ts +0 -0
- /package/build/{redux → src/redux}/actions/Articles.types.d.ts +0 -0
- /package/build/{redux → src/redux}/actions/Users.actions.d.ts +0 -0
- /package/build/{redux → src/redux}/actions/Users.types.d.ts +0 -0
- /package/build/{redux → src/redux}/actions/actions.d.ts +0 -0
- /package/build/{redux → src/redux}/middleware/index.d.ts +0 -0
- /package/build/{redux → src/redux}/middleware/logger.d.ts +0 -0
- /package/build/{redux → src/redux}/slice/Generic.actions.d.ts +0 -0
- /package/build/{registry → src/registry}/Registry.d.ts +0 -0
- /package/build/{registry → src/registry}/core-component-list.d.ts +0 -0
- /package/build/{registry → src/registry}/coreComponents.d.ts +0 -0
- /package/build/{registry → src/registry}/index.d.ts +0 -0
- /package/build/{registry → src/registry}/types.d.ts +0 -0
- /package/build/{types.d.ts → src/types.d.ts} +0 -0
- /package/build/{utils → src/utils}/router.d.ts +0 -0
- /package/build/{utils → src/utils}/socket.d.ts +0 -0
- /package/build/{utils → src/utils}/socket.sharedworker.d.ts +0 -0
- /package/build/{utils → src/utils}/translation.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DisplayFormRef, FieldsWithOptionalRender } from './types';
|
|
3
|
+
import { Control } from 'react-hook-form';
|
|
4
|
+
/****
|
|
5
|
+
* The jamespot model depend on the platform
|
|
6
|
+
* For example a user can have the size attribute only for a given platform
|
|
7
|
+
* The model specifics of a platform are stored in J.model
|
|
8
|
+
*
|
|
9
|
+
* 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
|
+
*/
|
|
18
|
+
export declare const DisplayForm: React.ForwardRefExoticComponent<{
|
|
19
|
+
type: string;
|
|
20
|
+
fields: FieldsWithOptionalRender<any, any>;
|
|
21
|
+
extraInputs?: ((control: Control<any>) => React.ReactNode) | undefined;
|
|
22
|
+
defaultValues?: any;
|
|
23
|
+
onSubmit: any;
|
|
24
|
+
buttons: React.ReactNode;
|
|
25
|
+
dataCy?: string | undefined;
|
|
26
|
+
} & React.RefAttributes<DisplayFormRef>>;
|
|
@@ -9,7 +9,7 @@ export declare function formatCheckbox<Properties extends string>(configuration:
|
|
|
9
9
|
search: typeof NotImplemented;
|
|
10
10
|
};
|
|
11
11
|
label: string;
|
|
12
|
-
description?: string;
|
|
12
|
+
description?: string | undefined;
|
|
13
13
|
widget: import("jamespot-user-api").Widget;
|
|
14
14
|
name: Properties;
|
|
15
15
|
mandatory: boolean;
|
|
@@ -21,7 +21,7 @@ export declare function formatDate<Properties extends string = string>(configura
|
|
|
21
21
|
search: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
22
22
|
};
|
|
23
23
|
label: string;
|
|
24
|
-
description?: string;
|
|
24
|
+
description?: string | undefined;
|
|
25
25
|
widget: import("jamespot-user-api").Widget;
|
|
26
26
|
name: Properties;
|
|
27
27
|
mandatory: boolean;
|
|
@@ -33,7 +33,7 @@ export declare function formatDefault<Properties extends string>(configuration:
|
|
|
33
33
|
search: typeof NotImplemented;
|
|
34
34
|
};
|
|
35
35
|
label: string;
|
|
36
|
-
description?: string;
|
|
36
|
+
description?: string | undefined;
|
|
37
37
|
widget: import("jamespot-user-api").Widget;
|
|
38
38
|
name: Properties;
|
|
39
39
|
mandatory: boolean;
|
|
@@ -45,7 +45,7 @@ export declare function formatEmail<Properties extends string>(configuration: Fi
|
|
|
45
45
|
search: typeof NotImplemented;
|
|
46
46
|
};
|
|
47
47
|
label: string;
|
|
48
|
-
description?: string;
|
|
48
|
+
description?: string | undefined;
|
|
49
49
|
widget: import("jamespot-user-api").Widget;
|
|
50
50
|
name: Properties;
|
|
51
51
|
mandatory: boolean;
|
|
@@ -57,7 +57,7 @@ export declare function formatNumber<Properties extends string>(configuration: F
|
|
|
57
57
|
search: typeof NotImplemented;
|
|
58
58
|
};
|
|
59
59
|
label: string;
|
|
60
|
-
description?: string;
|
|
60
|
+
description?: string | undefined;
|
|
61
61
|
widget: import("jamespot-user-api").Widget;
|
|
62
62
|
name: Properties;
|
|
63
63
|
mandatory: boolean;
|
|
@@ -69,7 +69,7 @@ export declare function formatOrientedlinks<Properties extends string>(configura
|
|
|
69
69
|
search: ({ widget, ...props }: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
70
70
|
};
|
|
71
71
|
label: string;
|
|
72
|
-
description?: string;
|
|
72
|
+
description?: string | undefined;
|
|
73
73
|
widget: import("jamespot-user-api").Widget;
|
|
74
74
|
name: Properties;
|
|
75
75
|
mandatory: boolean;
|
|
@@ -81,7 +81,7 @@ export declare function formatRadio<Properties extends string>(configuration: Fi
|
|
|
81
81
|
search: ({ widget, ...props }: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
82
82
|
};
|
|
83
83
|
label: string;
|
|
84
|
-
description?: string;
|
|
84
|
+
description?: string | undefined;
|
|
85
85
|
widget: import("jamespot-user-api").Widget;
|
|
86
86
|
name: Properties;
|
|
87
87
|
mandatory: boolean;
|
|
@@ -93,7 +93,7 @@ export declare function formatSelect<Properties extends string>(configuration: F
|
|
|
93
93
|
search: typeof NotImplemented;
|
|
94
94
|
};
|
|
95
95
|
label: string;
|
|
96
|
-
description?: string;
|
|
96
|
+
description?: string | undefined;
|
|
97
97
|
widget: import("jamespot-user-api").Widget;
|
|
98
98
|
name: Properties;
|
|
99
99
|
mandatory: boolean;
|
|
@@ -101,11 +101,11 @@ export declare function formatSelect<Properties extends string>(configuration: F
|
|
|
101
101
|
export declare function formatRichText<Properties extends string>(configuration: FieldConfiguration<Properties>): {
|
|
102
102
|
components: {
|
|
103
103
|
render: typeof DisplayRichText;
|
|
104
|
-
input:
|
|
104
|
+
input: (props: import("./types").DisplayInputComponentProps) => JSX.Element;
|
|
105
105
|
search: typeof NotImplemented;
|
|
106
106
|
};
|
|
107
107
|
label: string;
|
|
108
|
-
description?: string;
|
|
108
|
+
description?: string | undefined;
|
|
109
109
|
widget: import("jamespot-user-api").Widget;
|
|
110
110
|
name: Properties;
|
|
111
111
|
mandatory: boolean;
|
|
@@ -117,7 +117,7 @@ export declare function formatTaxonomy<Properties extends string>(configuration:
|
|
|
117
117
|
search: typeof NotImplemented;
|
|
118
118
|
};
|
|
119
119
|
label: string;
|
|
120
|
-
description?: string;
|
|
120
|
+
description?: string | undefined;
|
|
121
121
|
widget: import("jamespot-user-api").Widget;
|
|
122
122
|
name: Properties;
|
|
123
123
|
mandatory: boolean;
|
|
@@ -129,7 +129,7 @@ export declare function formatTextarea<Properties extends string>(configuration:
|
|
|
129
129
|
search: typeof NotImplemented;
|
|
130
130
|
};
|
|
131
131
|
label: string;
|
|
132
|
-
description?: string;
|
|
132
|
+
description?: string | undefined;
|
|
133
133
|
widget: import("jamespot-user-api").Widget;
|
|
134
134
|
name: Properties;
|
|
135
135
|
mandatory: boolean;
|
|
@@ -141,7 +141,7 @@ export declare function formatUri<Properties extends string>(configuration: Fiel
|
|
|
141
141
|
search: typeof NotImplemented;
|
|
142
142
|
};
|
|
143
143
|
label: string;
|
|
144
|
-
description?: string;
|
|
144
|
+
description?: string | undefined;
|
|
145
145
|
widget: import("jamespot-user-api").Widget;
|
|
146
146
|
name: Properties;
|
|
147
147
|
mandatory: boolean;
|
|
@@ -153,7 +153,7 @@ export declare function formatUrl<Properties extends string>(configuration: Fiel
|
|
|
153
153
|
search: typeof NotImplemented;
|
|
154
154
|
};
|
|
155
155
|
label: string;
|
|
156
|
-
description?: string;
|
|
156
|
+
description?: string | undefined;
|
|
157
157
|
widget: import("jamespot-user-api").Widget;
|
|
158
158
|
name: Properties;
|
|
159
159
|
mandatory: boolean;
|
|
@@ -5,7 +5,7 @@ export declare type Fields<Object, Properties extends string> = Array<Properties
|
|
|
5
5
|
name: Properties;
|
|
6
6
|
componentsOverride: Partial<DisplayElementComponent<Object>>;
|
|
7
7
|
}>;
|
|
8
|
-
export declare type
|
|
8
|
+
export declare type FieldsWithOptionalRender<Object, Properties extends string> = Array<Properties | {
|
|
9
9
|
name: Properties;
|
|
10
10
|
render: React.FunctionComponent<RenderAttributeProps<Object>>;
|
|
11
11
|
}>;
|
|
@@ -17,6 +17,7 @@ export declare type DisplayInputComponentProps = {
|
|
|
17
17
|
name: string;
|
|
18
18
|
widget: Widget;
|
|
19
19
|
mandatory: boolean;
|
|
20
|
+
dataCy?: string;
|
|
20
21
|
width?: string;
|
|
21
22
|
margin?: string;
|
|
22
23
|
};
|
|
@@ -43,15 +44,13 @@ export declare type RenderAttributeProps<Object, Properties extends string = str
|
|
|
43
44
|
attribute: Omit<DisplayerElement<Object, Properties>, 'components'>;
|
|
44
45
|
};
|
|
45
46
|
export declare type DisplayFormProps<Object> = {
|
|
46
|
-
|
|
47
|
+
type: string;
|
|
47
48
|
componentsOverride?: Record<string, Partial<DisplayElementComponent<Object>>>;
|
|
48
49
|
attributesName: string[];
|
|
49
50
|
onSubmit: any;
|
|
51
|
+
buttons: React.ReactNode;
|
|
50
52
|
};
|
|
51
53
|
export declare type DisplayFormRef = {
|
|
52
54
|
reset: UseFormReset<any>;
|
|
53
55
|
};
|
|
54
|
-
export declare type RenderInputProps<Object> = DisplayerElement<Object> & {
|
|
55
|
-
control: any;
|
|
56
|
-
};
|
|
57
56
|
export declare type Displayer<Object, Properties extends string = string> = Array<DisplayerElement<Object, Properties>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldsWithOptionalRender } from 'App';
|
|
2
2
|
import { Displayer, Fields } from './types';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -6,10 +6,14 @@ import { Displayer, Fields } from './types';
|
|
|
6
6
|
* @param type - model type (user, article, spot...)
|
|
7
7
|
*/
|
|
8
8
|
export declare function useDisplay<Object, Properties extends string = string>(fields: Fields<Object, Properties>, type: string): Displayer<Object, Properties>;
|
|
9
|
-
export declare function useDisplayList<Object, Properties extends string = string>(fields:
|
|
9
|
+
export declare function useDisplayList<Object, Properties extends string = string>(fields: FieldsWithOptionalRender<Object, Properties>, type: string): {
|
|
10
10
|
accessor: (object: Object) => JSX.Element;
|
|
11
11
|
disableSortBy: boolean;
|
|
12
12
|
id: Properties;
|
|
13
13
|
Header: string;
|
|
14
14
|
name: Properties;
|
|
15
15
|
}[];
|
|
16
|
+
export declare function useDisplayForm<Object, Properties extends string = string>(fields: FieldsWithOptionalRender<Object, Properties>, type: string): [Array<{
|
|
17
|
+
Input: any;
|
|
18
|
+
name: string;
|
|
19
|
+
}>, Record<string, '' | Array<void>>];
|
|
@@ -29,7 +29,7 @@ export declare const articleSlice: import("@reduxjs/toolkit").Slice<import("@red
|
|
|
29
29
|
}, "articles">;
|
|
30
30
|
export declare const articlesSelector: import("@reduxjs/toolkit").EntitySelectors<Article, import("redux").CombinedState<{
|
|
31
31
|
entities: import("redux").CombinedState<{
|
|
32
|
-
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").
|
|
32
|
+
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").ApplicationType>;
|
|
33
33
|
models: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").Model<string>>;
|
|
34
34
|
users: import("@reduxjs/toolkit").EntityState<import("./User.slice").User>;
|
|
35
35
|
articles: import("@reduxjs/toolkit").EntityState<Article>;
|
|
@@ -38,7 +38,7 @@ export declare const articlesSelector: import("@reduxjs/toolkit").EntitySelector
|
|
|
38
38
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
39
39
|
id: string;
|
|
40
40
|
label: string;
|
|
41
|
-
description?: string;
|
|
41
|
+
description?: string | undefined;
|
|
42
42
|
timeout: number;
|
|
43
43
|
type: "error" | "success" | "warning";
|
|
44
44
|
}>;
|
|
@@ -29,7 +29,7 @@ export declare const userSlice: import("@reduxjs/toolkit").Slice<import("@reduxj
|
|
|
29
29
|
}, "users">;
|
|
30
30
|
export declare const usersSelector: import("@reduxjs/toolkit").EntitySelectors<User, import("redux").CombinedState<{
|
|
31
31
|
entities: import("redux").CombinedState<{
|
|
32
|
-
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").
|
|
32
|
+
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").ApplicationType>;
|
|
33
33
|
models: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").Model<string>>;
|
|
34
34
|
users: import("@reduxjs/toolkit").EntityState<User>;
|
|
35
35
|
articles: import("@reduxjs/toolkit").EntityState<import("./Article.slice").Article>;
|
|
@@ -38,7 +38,7 @@ export declare const usersSelector: import("@reduxjs/toolkit").EntitySelectors<U
|
|
|
38
38
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
39
39
|
id: string;
|
|
40
40
|
label: string;
|
|
41
|
-
description?: string;
|
|
41
|
+
description?: string | undefined;
|
|
42
42
|
timeout: number;
|
|
43
43
|
type: "error" | "success" | "warning";
|
|
44
44
|
}>;
|
|
@@ -29,7 +29,7 @@ export interface AsyncReducers {
|
|
|
29
29
|
export declare function makeStore(initialState: AsyncReducers): JInjectStore;
|
|
30
30
|
declare function createStore(initialAsyncReducers: {}, initialState: any): import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<import("redux").CombinedState<{
|
|
31
31
|
entities: import("redux").CombinedState<{
|
|
32
|
-
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").
|
|
32
|
+
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").ApplicationType>;
|
|
33
33
|
models: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").Model<string>>;
|
|
34
34
|
users: import("@reduxjs/toolkit").EntityState<import("./slice/User.slice").User>;
|
|
35
35
|
articles: import("@reduxjs/toolkit").EntityState<import("./slice/Article.slice").Article>;
|
|
@@ -38,14 +38,14 @@ declare function createStore(initialAsyncReducers: {}, initialState: any): impor
|
|
|
38
38
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
39
39
|
id: string;
|
|
40
40
|
label: string;
|
|
41
|
-
description?: string;
|
|
41
|
+
description?: string | undefined;
|
|
42
42
|
timeout: number;
|
|
43
43
|
type: "error" | "success" | "warning";
|
|
44
44
|
}>;
|
|
45
45
|
userCurrent: import("jamespot-user-api").jUserList;
|
|
46
46
|
}>, import("redux").AnyAction, import("@reduxjs/toolkit").ThunkMiddleware<import("redux").EmptyObject & {
|
|
47
47
|
entities: import("redux").CombinedState<{
|
|
48
|
-
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").
|
|
48
|
+
applications: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").ApplicationType>;
|
|
49
49
|
models: import("@reduxjs/toolkit").EntityState<import("jamespot-user-api").Model<string>>;
|
|
50
50
|
users: import("@reduxjs/toolkit").EntityState<import("./slice/User.slice").User>;
|
|
51
51
|
articles: import("@reduxjs/toolkit").EntityState<import("./slice/Article.slice").Article>;
|
|
@@ -54,7 +54,7 @@ declare function createStore(initialAsyncReducers: {}, initialState: any): impor
|
|
|
54
54
|
toasts: import("@reduxjs/toolkit").EntityState<{
|
|
55
55
|
id: string;
|
|
56
56
|
label: string;
|
|
57
|
-
description?: string;
|
|
57
|
+
description?: string | undefined;
|
|
58
58
|
timeout: number;
|
|
59
59
|
type: "error" | "success" | "warning";
|
|
60
60
|
}>;
|
|
@@ -64,6 +64,7 @@ declare const _default: {
|
|
|
64
64
|
readonly InputCommunity: "JRCInputCommunity";
|
|
65
65
|
readonly InputDate: "JRCInputDate";
|
|
66
66
|
readonly InputEmail: "JRCInputEmail";
|
|
67
|
+
readonly InputImage: "JRCInputImage";
|
|
67
68
|
readonly InputRichText: "JRCInputRichText";
|
|
68
69
|
readonly InputSelect: "JRCInputSelect";
|
|
69
70
|
readonly InputText: "JRCInputText";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { UriOrTypeId } from 'jamespot-react-components';
|
|
2
|
+
import { jObjectLittle } from 'jamespot-user-api';
|
|
2
3
|
export declare function getUnknownProperty(object: unknown, attribute: string): unknown | undefined;
|
|
3
4
|
export declare function ensureIsString(object: unknown): object is string;
|
|
4
5
|
export declare function ensureIsNumber(object: unknown): object is number;
|
|
5
6
|
export declare function ensureHasUriOrTypeId(object: unknown): object is UriOrTypeId;
|
|
7
|
+
export declare function ensureObjectLittle(object: unknown): object is jObjectLittle;
|
|
6
8
|
export declare function ensureIsArray(object: unknown): object is Array<unknown>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApplicationType, jUserList, Model } from 'jamespot-user-api';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useDisplay, useDisplayList } from '../displayer/useDisplay';
|
|
4
4
|
import { ReactRegistry } from '../registry/Registry';
|
|
5
5
|
import { JrComponentListType } from '../registry/types';
|
|
6
6
|
import { ReactRouter } from './router';
|
|
7
7
|
import { ReactTranslation, SupportedLanguages, TranslationKeys } from './translation';
|
|
8
|
+
import { AnyRTHandlerFunction } from 'jamespot-user-api';
|
|
8
9
|
export declare type Gabarit = 'core-1-cols' | 'core-2-cols' | 'core-3-cols' | 'content-1-cols' | 'content-2-cols' | 'content-3-cols' | 'app-1-cols' | 'app-2-cols' | 'empty';
|
|
9
10
|
export interface ReactCore {
|
|
10
11
|
extensions: ReactExtensions;
|
|
@@ -38,7 +39,7 @@ export interface ReactExtension {
|
|
|
38
39
|
export interface ReactExtensionContainer {
|
|
39
40
|
default: ReactExtension;
|
|
40
41
|
}
|
|
41
|
-
export declare type ReactSocketEventHandler =
|
|
42
|
+
export declare type ReactSocketEventHandler = AnyRTHandlerFunction;
|
|
42
43
|
export interface ReactSocket {
|
|
43
44
|
io: any;
|
|
44
45
|
supportSharedWorker?: Boolean;
|
|
@@ -79,11 +80,6 @@ export declare type ReactSocketEvents = {
|
|
|
79
80
|
all: ReactSocketEventHandler[];
|
|
80
81
|
};
|
|
81
82
|
};
|
|
82
|
-
export interface SocketEventData {
|
|
83
|
-
function: string;
|
|
84
|
-
namespace: string;
|
|
85
|
-
[key: string]: any;
|
|
86
|
-
}
|
|
87
83
|
export interface SharedWorkerEvent {
|
|
88
84
|
data: SharedWorkerEventData;
|
|
89
85
|
}
|
|
@@ -128,7 +124,7 @@ export interface WindowJ {
|
|
|
128
124
|
jUserCurrent: jUserList;
|
|
129
125
|
jamespotReactComponentList: JrComponentListType;
|
|
130
126
|
jamespotReactTheme: any;
|
|
131
|
-
applications:
|
|
127
|
+
applications: ApplicationType[];
|
|
132
128
|
models: Model<string>[];
|
|
133
129
|
debug: any;
|
|
134
130
|
urlBase: string;
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
roots: ['<rootDir>'],
|
|
3
|
+
testMatch: ['**/*.test.tsx'],
|
|
4
|
+
transform: {
|
|
5
|
+
'^.+\\.(ts|tsx)?$': 'ts-jest',
|
|
6
|
+
},
|
|
7
|
+
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
|
8
|
+
moduleDirectories: ['src', 'node_modules'],
|
|
9
|
+
snapshotSerializers: ['enzyme-to-json/serializer'],
|
|
10
|
+
moduleNameMapper: {
|
|
11
|
+
'\\.(less)$': 'identity-obj-proxy',
|
|
12
|
+
},
|
|
13
|
+
cacheDirectory: './node_modules/.cache/jest',
|
|
14
|
+
collectCoverage: true,
|
|
15
|
+
};
|
package/jest.setup.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.99",
|
|
4
4
|
"description": "Jamespot React Core",
|
|
5
5
|
"main": "./build/app.bundle.js",
|
|
6
|
-
"types": "./build/App.d.ts",
|
|
6
|
+
"types": "./build/src/App.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "webpack --env NODE_ENV=development",
|
|
9
9
|
"local": "webpack s --env NODE_ENV=development",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"source-map-loader": "^1.0.1",
|
|
56
56
|
"ts-jest": "^27.0.7",
|
|
57
57
|
"ts-loader": "^8.0.2",
|
|
58
|
+
"ts-node": "^10.3.0",
|
|
58
59
|
"typescript": "^4.4.4",
|
|
59
60
|
"webpack": "^5.62.1",
|
|
60
61
|
"webpack-cli": "^4.9.1",
|
|
@@ -64,9 +65,9 @@
|
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"@reduxjs/toolkit": "^1.9.0",
|
|
66
67
|
"history": "^5.3.0",
|
|
67
|
-
"jamespot-front-business": "^1.1.
|
|
68
|
-
"jamespot-react-components": "^1.0.
|
|
69
|
-
"jamespot-user-api": "^1.0.
|
|
68
|
+
"jamespot-front-business": "^1.1.9",
|
|
69
|
+
"jamespot-react-components": "^1.0.127",
|
|
70
|
+
"jamespot-user-api": "^1.0.99",
|
|
70
71
|
"react": "^17.0.2",
|
|
71
72
|
"react-dom": "^17.0.2",
|
|
72
73
|
"react-hook-form": "^7.25.0",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { DisplayFormRef } from './types';
|
|
3
|
-
/****
|
|
4
|
-
* The jamespot model depend on the platform
|
|
5
|
-
* For example a user can have the size attribute only for a given platform
|
|
6
|
-
* The model specifics of a platform are stored in J.model
|
|
7
|
-
*
|
|
8
|
-
* This component display an array of attributes only if this attribute is activated on the platform
|
|
9
|
-
*
|
|
10
|
-
* @param props.object the object to display (ie the user)
|
|
11
|
-
* @param props.attributesName an array of string : the list of attributes we want to display
|
|
12
|
-
* @param props.componentsOverride we can override the default render of the attribute
|
|
13
|
-
* @param props.componentsOverride.input the component input
|
|
14
|
-
* Note :If we override the "render" you can't override "wrapper" and "element" because the render rewrite everything
|
|
15
|
-
*/
|
|
16
|
-
export declare const DisplayForm: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<DisplayFormRef>>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|