jamespot-react-core 1.1.154 → 1.1.156
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/517.bundle.js +457 -0
- package/build/517.bundle.js.map +1 -0
- package/build/app.bundle.js +374 -380
- package/build/app.bundle.js.map +1 -1
- package/build/src/components/Avatar.d.ts +3 -0
- package/build/src/components/modals/ModalAudience.d.ts +11 -0
- package/build/src/components/widgets/wrapper/utils.d.ts +1 -1
- package/build/src/displayer/DisplayForm.component.d.ts +3 -1
- package/build/src/displayer/components/inputs/InputAudience.d.ts +4 -0
- package/build/src/displayer/components/inputs/InputTaxonomy.d.ts +1 -0
- package/build/src/displayer/formatter.d.ts +1 -0
- package/build/src/displayer/types.d.ts +3 -1
- package/build/src/displayer/useDisplay.d.ts +15 -5
- package/build/src/registry/core-component-list.d.ts +2 -0
- package/build/src/registry/coreComponents.d.ts +6 -4
- package/build/src/registry/ext-component-list.d.ts +1 -2
- package/package.json +4 -4
- package/build/833.bundle.js +0 -457
- package/build/833.bundle.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Control } from 'react-hook-form';
|
|
3
|
+
export type ModalAudienceProps = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
closeHandler: () => void;
|
|
6
|
+
title?: string;
|
|
7
|
+
control: Control<any>;
|
|
8
|
+
warningMessage?: string;
|
|
9
|
+
onSubmit: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const ModalAudience: ({ open, closeHandler, title, control, warningMessage, onSubmit }: ModalAudienceProps) => React.JSX.Element;
|
|
@@ -7,7 +7,7 @@ export declare const getVisibleColumns: (tableColumnsData: {
|
|
|
7
7
|
dateFormat?: "time" | "date" | "date-time" | "date-time-sec" | "time-sec" | undefined;
|
|
8
8
|
numberFormat?: "fr-FR" | "en-EN" | "filesize" | undefined;
|
|
9
9
|
}[], columns: WidgetTableColumn[]) => {
|
|
10
|
-
type: "number" | "uri" | "title" | "select" | "text" | "
|
|
10
|
+
type: "number" | "uri" | "title" | "select" | "text" | "url" | "date" | "file" | "datetime" | "email" | "transient";
|
|
11
11
|
name: string;
|
|
12
12
|
label: string;
|
|
13
13
|
widget: {} | {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DisplayFormRef, FieldsWith } from './types';
|
|
3
3
|
import { Control, FieldValues } from 'react-hook-form';
|
|
4
|
+
export type DisplayFormFieldsConfig<TFieldValues extends FieldValues> = 'all' | FieldsWith<'input', TFieldValues>;
|
|
4
5
|
export type DisplayFormProps<TFieldValues extends FieldValues> = {
|
|
5
6
|
type: string;
|
|
6
|
-
fields:
|
|
7
|
+
fields: DisplayFormFieldsConfig<TFieldValues>;
|
|
7
8
|
extraInputs?: (control: Control<TFieldValues>) => React.ReactNode;
|
|
8
9
|
defaultValues?: any;
|
|
9
10
|
onSubmit?: any;
|
|
@@ -12,6 +13,7 @@ export type DisplayFormProps<TFieldValues extends FieldValues> = {
|
|
|
12
13
|
dataCy?: string;
|
|
13
14
|
stretch?: boolean;
|
|
14
15
|
children?: React.ReactNode;
|
|
16
|
+
forceMandatory?: boolean;
|
|
15
17
|
};
|
|
16
18
|
/****
|
|
17
19
|
* The jamespot model depend on the platform
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DisplayInputComponentProps } from '../../types';
|
|
3
|
+
import type { FieldValues } from 'react-hook-form';
|
|
4
|
+
export declare const InputAudience: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => React.JSX.Element;
|
|
@@ -6,6 +6,7 @@ type InputTaxonomyConfig<T extends FieldValues = FieldValues> = {
|
|
|
6
6
|
name: Path<T>;
|
|
7
7
|
placeholder: string;
|
|
8
8
|
type: string;
|
|
9
|
+
limit?: number;
|
|
9
10
|
};
|
|
10
11
|
export declare const InputTaxonomy: <TFieldValues extends FieldValues>(widget: WidgetTaxonomy, config: InputTaxonomyConfig<TFieldValues>) => (props: Required<Pick<import("react-hook-form").UseControllerProps<TFieldValues, Path<TFieldValues>>, "name" | "control">> & {
|
|
11
12
|
label: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FieldConfiguration } from 'jamespot-user-api';
|
|
2
2
|
import { DisplayerElement } from './types';
|
|
3
3
|
import type { FieldValues, FieldPath } from 'react-hook-form';
|
|
4
|
+
export declare function formatAudience<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
4
5
|
export declare function formatCheckbox<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
5
6
|
export declare function formatDate<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
6
7
|
export declare function formatDefault<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
|
|
@@ -59,5 +59,7 @@ export type DisplayFormProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
|
59
59
|
onSubmit: any;
|
|
60
60
|
buttons: React.ReactNode;
|
|
61
61
|
};
|
|
62
|
-
export type DisplayFormRef = UseFormReturn<any
|
|
62
|
+
export type DisplayFormRef = UseFormReturn<any> & {
|
|
63
|
+
getFormattedValues: () => any;
|
|
64
|
+
};
|
|
63
65
|
export type Displayer<TFieldValues extends FieldValues = FieldValues> = Array<DisplayerElement<TFieldValues>>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Widget } from 'jamespot-user-api';
|
|
2
3
|
import { Displayer, Fields, FieldsWith } from './types';
|
|
3
4
|
import type { FieldValues, FieldPath } from 'react-hook-form';
|
|
5
|
+
import { DisplayFormFieldsConfig } from './DisplayForm.component';
|
|
4
6
|
/**
|
|
5
7
|
*
|
|
6
8
|
* @param fields - fields that we want to display (firstname, name, age...)
|
|
7
9
|
* @param type - model type (user, article, spot...)
|
|
10
|
+
* @param bypassRequiredFields
|
|
8
11
|
*/
|
|
9
|
-
export declare function useDisplay<TFieldValues extends FieldValues = FieldValues, Properties extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(fields: Fields<TFieldValues
|
|
12
|
+
export declare function useDisplay<TFieldValues extends FieldValues = FieldValues, Properties extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(fields: Fields<TFieldValues> | 'all', type: string, bypassRequiredFields?: boolean): Displayer<TFieldValues>;
|
|
10
13
|
export declare function useDisplayList<TFieldValues extends FieldValues = FieldValues>(fields: FieldsWith<'render', TFieldValues>, type: string): {
|
|
11
14
|
accessor: (object: Object) => React.JSX.Element;
|
|
12
15
|
disableSortBy: true | undefined;
|
|
@@ -14,7 +17,14 @@ export declare function useDisplayList<TFieldValues extends FieldValues = FieldV
|
|
|
14
17
|
Header: string;
|
|
15
18
|
name: string;
|
|
16
19
|
}[];
|
|
17
|
-
export declare function useDisplayForm<TFieldValues extends FieldValues = FieldValues>(fields:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
export declare function useDisplayForm<TFieldValues extends FieldValues = FieldValues>(fields: DisplayFormFieldsConfig<TFieldValues>, type: string, forceMandatory?: boolean): [
|
|
21
|
+
Array<{
|
|
22
|
+
Input: any;
|
|
23
|
+
description?: string;
|
|
24
|
+
label: string;
|
|
25
|
+
name: string;
|
|
26
|
+
mandatory: boolean;
|
|
27
|
+
widget: Widget;
|
|
28
|
+
}>,
|
|
29
|
+
Record<string, '' | Array<void>>
|
|
30
|
+
];
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* please fill this file and coreComponents.ts
|
|
3
3
|
*/
|
|
4
4
|
export declare const coreComponentsMapping: {
|
|
5
|
+
readonly Avatar: "Avatar";
|
|
5
6
|
readonly CommentsBloc: "CommentsBloc";
|
|
6
7
|
readonly DisplayForm: "DisplayForm";
|
|
7
8
|
readonly EditorsPortal: "EditorsPortal";
|
|
8
9
|
readonly Empty: "Empty";
|
|
9
10
|
readonly InputTinyMCEWithExtRaw: "JRCInputTinyMCEWithExtRaw";
|
|
10
11
|
readonly InputTinyMCEWithExt: "JRCInputTinyMCEWithExt";
|
|
12
|
+
readonly ModalAudience: "ModalAudience";
|
|
11
13
|
readonly TinyMCEAIModal: "AIModal";
|
|
12
14
|
readonly TwoColLayout: "TwoColLayout";
|
|
13
15
|
readonly WidgetWrapperCore: "WidgetWrapperCore";
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* please fill this file and core-component-list.ts
|
|
3
3
|
*/
|
|
4
|
+
export { AIModal } from '../components/tinymce/extension/AIModal';
|
|
5
|
+
export { Avatar } from '../components/Avatar';
|
|
4
6
|
export { CommentsBloc } from '../components/CommentsBloc';
|
|
5
|
-
export {
|
|
6
|
-
export { TwoColLayout } from '../components/TwoColLayout';
|
|
7
|
+
export { DisplayForm } from '../displayer/DisplayForm.component';
|
|
7
8
|
export { EditorsPortal } from '../components/editors/EditorsPortal';
|
|
9
|
+
export { Empty } from '../components/Empty';
|
|
8
10
|
export { JRCInputTinyMCEWithExt } from '../components/tinymce/JRCInputTinyMCEWithExt';
|
|
9
11
|
export { JRCInputTinyMCEWithExtRaw } from '../components/tinymce/JRCInputTinyMCEWithExtRaw';
|
|
10
|
-
export {
|
|
12
|
+
export { ModalAudience } from '../components/modals/ModalAudience';
|
|
13
|
+
export { TwoColLayout } from '../components/TwoColLayout';
|
|
11
14
|
export { WidgetList } from '../components/widgets/WidgetList/WidgetList';
|
|
12
15
|
export { WidgetWrapperCore } from '../components/widgets/WidgetWrapperCore';
|
|
13
|
-
export { DisplayForm } from '../displayer/DisplayForm.component';
|
|
14
16
|
/**
|
|
15
17
|
* please fill this file and core-component-list.ts
|
|
16
18
|
*/
|
|
@@ -5,7 +5,6 @@ declare const _default: {
|
|
|
5
5
|
readonly AppHeader: "JRCAppHeader";
|
|
6
6
|
readonly AppLeftColumn: "JRCAppLeftColumn";
|
|
7
7
|
readonly Attachments: "JRCAttachments";
|
|
8
|
-
readonly Avatar: "JRCAvatar";
|
|
9
8
|
readonly BaseTooltip: "JRCBaseTooltip";
|
|
10
9
|
readonly BETA_DragAndDrop: "BETA_JRCDragAndDrop";
|
|
11
10
|
readonly Button: "JRCButton";
|
|
@@ -88,7 +87,6 @@ declare const _default: {
|
|
|
88
87
|
readonly InputSelectHierarchicalTree: "JRCInputSelectHierarchicalTree";
|
|
89
88
|
readonly InputSelectList: "JRCInputSelectList";
|
|
90
89
|
readonly InputSelectRaw: "JRCInputSelectRaw";
|
|
91
|
-
readonly InputTaxonomy: "JRCInputTaxonomy";
|
|
92
90
|
readonly InputText: "JRCInputText";
|
|
93
91
|
readonly InputTextarea: "JRCInputTextarea";
|
|
94
92
|
readonly InputPassword: "JRCInputPassword";
|
|
@@ -103,6 +101,7 @@ declare const _default: {
|
|
|
103
101
|
readonly Loader: "JRCLoader";
|
|
104
102
|
readonly MainColumn: "JRCMainColumn";
|
|
105
103
|
readonly Menu: "JRCMenu";
|
|
104
|
+
readonly Message: "JRCMessage";
|
|
106
105
|
readonly Modal: "JRCModal";
|
|
107
106
|
readonly ModalContent: "JRCModalContent";
|
|
108
107
|
readonly ModalContentForm: "JRCModalContentForm";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.156",
|
|
4
4
|
"description": "Jamespot React Core",
|
|
5
5
|
"main": "./build/app.bundle.js",
|
|
6
6
|
"types": "./build/src/App.d.ts",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@reduxjs/toolkit": "^1.9.0",
|
|
56
56
|
"history": "^5.3.0",
|
|
57
|
-
"jamespot-front-business": "^1.1.
|
|
58
|
-
"jamespot-react-components": "^1.0.
|
|
59
|
-
"jamespot-user-api": "^1.0.
|
|
57
|
+
"jamespot-front-business": "^1.1.59",
|
|
58
|
+
"jamespot-react-components": "^1.0.200",
|
|
59
|
+
"jamespot-user-api": "^1.0.175",
|
|
60
60
|
"react": "^17.0.2",
|
|
61
61
|
"react-dom": "^17.0.2",
|
|
62
62
|
"react-hook-form": "^7.25.0",
|