jamespot-react-core 1.1.101 → 1.1.102
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 +194 -0
- package/build/706.bundle.js.map +1 -0
- package/build/app.bundle.js +1009 -444
- package/build/app.bundle.js.map +1 -1
- package/build/src/components/editors/Editor.d.ts +3 -0
- package/build/src/components/editors/EditorPopup.d.ts +3 -0
- package/build/src/components/editors/EditorTabWidgets.d.ts +4 -0
- package/build/src/components/editors/EditorTabWrapper.d.ts +3 -0
- package/build/src/components/editors/EditorWrapper.d.ts +3 -0
- package/build/src/components/editors/EditorsPortal.d.ts +7 -0
- package/build/src/components/editors/const.d.ts +3 -0
- package/build/src/components/editors/style.d.ts +22 -0
- package/build/src/components/index.d.ts +2 -1
- package/build/src/components/widgets/Widget.d.ts +9 -0
- package/build/src/components/widgets/Widget.style.d.ts +6 -0
- package/build/src/components/widgets/WidgetInplace/WidgetInplace.style.d.ts +1 -0
- package/build/src/components/widgets/WidgetInplace/WidgetInplaceUpload.d.ts +14 -0
- package/build/src/components/widgets/WidgetInplace/WidgetInplaceWrapper.d.ts +6 -0
- package/build/src/components/widgets/WidgetLayer/WidgetLayer.d.ts +15 -0
- package/build/src/components/widgets/WidgetLayer/WidgetLayer.style.d.ts +5 -0
- package/build/src/components/widgets/WidgetList/WidgetList.d.ts +9 -0
- package/build/src/components/widgets/WidgetList/WidgetList.style.d.ts +13 -0
- package/build/src/components/widgets/WidgetState.d.ts +6 -0
- package/build/src/components/widgets/WidgetWrapperCore.d.ts +9 -0
- package/build/src/components/widgets/const.d.ts +6 -0
- package/build/src/components/widgets/hooks.d.ts +5 -0
- package/build/src/components/widgets/namespace.d.ts +2 -0
- package/build/src/components/widgets/utils.d.ts +16 -0
- package/build/src/components/widgets/utils.test.d.ts +1 -0
- package/build/src/registry/core-component-list.d.ts +3 -0
- package/build/src/registry/coreComponents.d.ts +3 -0
- package/build/src/registry/ext-component-list.d.ts +16 -0
- package/package.json +4 -4
- package/build/898.bundle.js +0 -2
- package/build/898.bundle.js.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const CSSEditorPortalWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const CSSEditorPortalPopupWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
on: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const CSSEditorPortalRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const CSSEditorPortalFreeSpace: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const EditorsPortal: () => JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const CSSEditorComponentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const CSSEditorComponentLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const CSSEditorPortal: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
on: boolean;
|
|
5
|
+
}, never>;
|
|
6
|
+
export declare const CSSEditorHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const CSSEditorAction: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const CSSEditorLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const CSSEditor: import("styled-components").StyledComponent<"div", any, {
|
|
10
|
+
visible: boolean;
|
|
11
|
+
}, never>;
|
|
12
|
+
export declare const CSSEditorContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
|
+
export declare const CSSEditorMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
+
export declare const CSSEditorMenuButton: import("styled-components").StyledComponent<"button", any, {
|
|
15
|
+
on?: boolean | undefined;
|
|
16
|
+
}, never>;
|
|
17
|
+
export declare const CSSInputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const CSSEditorWidget: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
|
+
export declare const CSSEditorWidgetLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const CSSEditorWidgetOption: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
|
+
export declare const CSSEditorLayer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
|
+
export declare const CSSEditorLayerTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExtensionProvider } from './ExtensionProvider.component';
|
|
2
2
|
import { IfAppIsActivated } from './IfAppIsActivated.component';
|
|
3
3
|
import { RTProvider } from './RTProvider.component';
|
|
4
|
-
|
|
4
|
+
import { useComponentVisible } from './widgets/hooks';
|
|
5
|
+
export { ExtensionProvider, IfAppIsActivated, RTProvider, useComponentVisible };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CombinedWidgetType, WidgetDisplayMode } from 'jamespot-user-api';
|
|
2
|
+
export declare const DisplayWidget: ({ widget, width, inplace, isComponentVisible, mode, onClick, }: {
|
|
3
|
+
widget: CombinedWidgetType;
|
|
4
|
+
width?: number | undefined;
|
|
5
|
+
inplace: boolean;
|
|
6
|
+
isComponentVisible: boolean | undefined;
|
|
7
|
+
mode: WidgetDisplayMode;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CSSHiddenDiv: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const CSSEmptyText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const CSSWrapperText: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
color?: string | undefined;
|
|
5
|
+
}, never>;
|
|
6
|
+
export declare const CSSUploadFileWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CSSInplace: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WidgetFileType } from 'jamespot-user-api';
|
|
2
|
+
declare type WidgetInplaceUploadProps = {
|
|
3
|
+
uniqid: string;
|
|
4
|
+
initialFiles: WidgetFileType[];
|
|
5
|
+
accept: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
multiple: boolean;
|
|
9
|
+
token: string;
|
|
10
|
+
allowAutoOpening: boolean;
|
|
11
|
+
onChange: (files: WidgetFileType[]) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const WidgetInplaceUpload: ({ uniqid, initialFiles, accept, label, description, multiple, token, allowAutoOpening, onChange, }: WidgetInplaceUploadProps) => JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WidgetDisplayMode } from 'jamespot-user-api';
|
|
2
|
+
export declare const CSSUploadFileWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const WidgetInplaceWrapper: ({ uniqid, mode }: {
|
|
4
|
+
uniqid: string;
|
|
5
|
+
mode: WidgetDisplayMode;
|
|
6
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WidgetDisplayMode } from 'jamespot-user-api';
|
|
3
|
+
export declare const WidgetLayer: ({ uniqid, mode }: {
|
|
4
|
+
uniqid: string;
|
|
5
|
+
mode: WidgetDisplayMode;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
export declare type Vector = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const DraggableHandler: ({ position, children, onMouseUp, }: {
|
|
12
|
+
position: Vector;
|
|
13
|
+
children: React.ReactElement;
|
|
14
|
+
onMouseUp: (position: Vector) => void;
|
|
15
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetWrapperProps } from 'jamespot-user-api';
|
|
2
|
+
declare type WidgetListMode = 'button' | 'list' | 'gallery' | 'custom' | 'article';
|
|
3
|
+
export declare const WidgetList: ({ mode, children, namespace, onChange, }: {
|
|
4
|
+
mode?: WidgetListMode | undefined;
|
|
5
|
+
children?: any;
|
|
6
|
+
namespace?: string | undefined;
|
|
7
|
+
onChange: (widget: WidgetWrapperProps) => void;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const CSSSquareWidgetWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const CSSSquareWidget: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
available: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const CSSWidgetButton: import("styled-components").StyledComponent<"div", any, {
|
|
6
|
+
open: boolean;
|
|
7
|
+
}, never>;
|
|
8
|
+
export declare const CSSWrapWidgetWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const CSSWrapTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const CSSWrapWidget: import("styled-components").StyledComponent<"button", any, {
|
|
11
|
+
open: boolean;
|
|
12
|
+
index: number;
|
|
13
|
+
}, never>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetDisplayMode, WidgetWrapperProps } from 'jamespot-user-api';
|
|
2
|
+
export declare const WidgetWrapperCore: ({ uniqid, widget, inplace, mode, width, }: {
|
|
3
|
+
uniqid: string;
|
|
4
|
+
widget: WidgetWrapperProps;
|
|
5
|
+
inplace?: boolean | undefined;
|
|
6
|
+
mode: WidgetDisplayMode;
|
|
7
|
+
width?: number | undefined;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
export default WidgetWrapperCore;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FileResponse, WidgetFileType } from 'jamespot-user-api';
|
|
2
|
+
export declare const loadImage: (setImageDimensions: React.Dispatch<React.SetStateAction<{
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}>>, imageUrl: string, setError: React.Dispatch<React.SetStateAction<boolean>>) => void;
|
|
6
|
+
export declare function getFileFamily(mime: string): string;
|
|
7
|
+
export declare const allowedFileExtensions: string[];
|
|
8
|
+
export declare function getExtensionFromName(name: string): string | undefined;
|
|
9
|
+
export declare function apiFileToWidgetFile(fileResponse: FileResponse): WidgetFileType;
|
|
10
|
+
export declare function getMimetypeFromExtension(ext: string | undefined): string;
|
|
11
|
+
export declare function reduce(obj: Record<string, unknown>, prop: string): Record<string, unknown>;
|
|
12
|
+
export declare function imagecache(file: WidgetFileType, width: number): string;
|
|
13
|
+
export declare function imageResize(width: number, height: number, maxWidth: number, maxHeight: number): {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,6 +5,9 @@ export declare const coreComponentsMapping: {
|
|
|
5
5
|
readonly DisplayForm: "DisplayForm";
|
|
6
6
|
readonly Empty: "Empty";
|
|
7
7
|
readonly TwoColLayout: "TwoColLayout";
|
|
8
|
+
readonly EditorsPortal: "EditorsPortal";
|
|
9
|
+
readonly WidgetWrapperCore: "WidgetWrapperCore";
|
|
10
|
+
readonly WidgetList: "WidgetList";
|
|
8
11
|
};
|
|
9
12
|
/**
|
|
10
13
|
* please fill this file and coreComponents.ts
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
export { DisplayForm } from '../displayer/DisplayForm.component';
|
|
5
5
|
export { Empty } from '../displayer/Empty';
|
|
6
6
|
export { TwoColLayout } from '../components/TwoColLayout';
|
|
7
|
+
export { WidgetWrapperCore } from '../components/widgets/WidgetWrapperCore';
|
|
8
|
+
export { WidgetList } from '../components/widgets/WidgetList/WidgetList';
|
|
9
|
+
export { EditorsPortal } from '../components/editors/EditorsPortal';
|
|
7
10
|
/**
|
|
8
11
|
* please fill this file and core-component-list.ts
|
|
9
12
|
*/
|
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
readonly ButtonFile: "JRCButtonFile";
|
|
16
16
|
readonly Card: "JRCCard";
|
|
17
17
|
readonly CardImg: "JRCCardImg";
|
|
18
|
+
readonly BETA_ColorPicker: "BETA_JRCColorPicker";
|
|
18
19
|
readonly Column: "JRCColumn";
|
|
19
20
|
readonly ColumnCenter: "JRCColumnCenter";
|
|
20
21
|
readonly ColumnLeft: "JRCColumnLeft";
|
|
@@ -22,7 +23,9 @@ declare const _default: {
|
|
|
22
23
|
readonly ConditionalWrapper: "JRCConditionalWrapper";
|
|
23
24
|
readonly Container: "JRCContainer";
|
|
24
25
|
readonly Date: "JRCDate";
|
|
26
|
+
readonly DoubleClick: "BETA_JRCDoubleClick";
|
|
25
27
|
readonly DraggingPlaceholder: "JRCDraggingPlaceholder";
|
|
28
|
+
readonly BETA_DragAndDrop: "BETA_JRCDragAndDrop";
|
|
26
29
|
readonly DropDown: "JRCDropDown";
|
|
27
30
|
readonly Ellipsis: "JRCEllipsis";
|
|
28
31
|
readonly FadeStepper: "JRCFadeStepper";
|
|
@@ -97,5 +100,18 @@ declare const _default: {
|
|
|
97
100
|
readonly Tooltip: "JRCTooltip";
|
|
98
101
|
readonly Typography: "JRCTypography";
|
|
99
102
|
readonly ValidationButton: "JRCValidationButton";
|
|
103
|
+
readonly WidgetArticleAttachment: "JRCWidgetArticleAttachment";
|
|
104
|
+
readonly WidgetArticleAttachmentEditor: "JRCWidgetArticleAttachmentEditor";
|
|
105
|
+
readonly WidgetArticleButton: "JRCWidgetArticleButton";
|
|
106
|
+
readonly WidgetArticleButtonEditor: "JRCWidgetArticleButtonEditor";
|
|
107
|
+
readonly WidgetArticleGallery: "JRCWidgetArticleGallery";
|
|
108
|
+
readonly WidgetArticleGalleryEditor: "JRCWidgetArticleGalleryEditor";
|
|
109
|
+
readonly WidgetArticleImage: "JRCWidgetArticleImage";
|
|
110
|
+
readonly WidgetArticleImageEditor: "JRCWidgetArticleImageEditor";
|
|
111
|
+
readonly WidgetArticleText: "JRCWidgetArticleText";
|
|
112
|
+
readonly WidgetArticleTextEditor: "JRCWidgetArticleTextEditor";
|
|
113
|
+
readonly WidgetArticleTitle: "JRCWidgetArticleTitle";
|
|
114
|
+
readonly WidgetArticleTitleEditor: "JRCWidgetArticleTitleEditor";
|
|
115
|
+
readonly WidgetEmptyInplace: "JRCWidgetEmptyInplace";
|
|
100
116
|
};
|
|
101
117
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.102",
|
|
4
4
|
"description": "Jamespot React Core",
|
|
5
5
|
"main": "./build/app.bundle.js",
|
|
6
6
|
"types": "./build/src/App.d.ts",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@reduxjs/toolkit": "^1.9.0",
|
|
67
67
|
"history": "^5.3.0",
|
|
68
|
-
"jamespot-front-business": "^1.1.
|
|
69
|
-
"jamespot-react-components": "^1.0.
|
|
70
|
-
"jamespot-user-api": "^1.0.
|
|
68
|
+
"jamespot-front-business": "^1.1.11",
|
|
69
|
+
"jamespot-react-components": "^1.0.131",
|
|
70
|
+
"jamespot-user-api": "^1.0.102",
|
|
71
71
|
"react": "^17.0.2",
|
|
72
72
|
"react-dom": "^17.0.2",
|
|
73
73
|
"react-hook-form": "^7.25.0",
|
package/build/898.bundle.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[898],{898:(e,t,n)=>{n.r(t),n.d(t,{DisplayForm:()=>l,Empty:()=>s,TwoColLayout:()=>f});var r=n(363),a=n(230),o=n(375);const l=r.forwardRef(((e,t)=>{const n=r.useRef(null),[l,s]=(0,o.GF)(e.fields,e.type),{handleSubmit:u,control:c,reset:i}=(0,a.useForm)({defaultValues:Object.assign(Object.assign({},s),e.defaultValues),criteriaMode:"all"});return r.useImperativeHandle(t,(()=>({reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),i()}})),[]),r.createElement("form",{onSubmit:u(e.onSubmit),ref:n},l.map((t=>{var{Input:n}=t,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(t,["Input"]);return r.createElement(n,Object.assign({key:a.name,control:c},a,{dataCy:`${e.dataCy}-${a.name}`}))})),e.extraInputs&&e.extraInputs(c),e.buttons)})),s=()=>r.createElement(r.Fragment,null);var u=n(248),c=n(181),i=n(675);const m=i.default.registry.getLazyComponent("Container"),p=i.default.registry.getLazyComponent("AppColumn"),d=i.default.registry.getLazyComponent("MainColumn");function f({extensionRoute:e,routes:t,description:n,mode:a="center"}){var o;const l=(0,c.useIntl)(),{pathname:s}=(0,u.useLocation)(),i=Object.values(t),[f,b]=r.useState(null===(o=null==i?void 0:i[0])||void 0===o?void 0:o.key),y=i.map((t=>Object.assign(Object.assign({},t),{label:l.formatMessage({id:t.label}),href:`/ng/rr/${e}/${t.path}`,group:t.group?l.formatMessage({id:t.group}):void 0})));return r.useEffect((()=>{const t=i.find((t=>s===`/ng/rr/${e}/${t.path}`));t&&b(t.key)}),[s]),r.createElement(r.Suspense,{fallback:r.createElement(r.Fragment,null)},r.createElement(m,{mode:a},r.createElement(p,{mode:a,description:n,tabs:y,activeTab:f||""}),r.createElement(d,{mode:a},r.createElement(u.Outlet,null))))}}}]);
|
|
2
|
-
//# sourceMappingURL=898.bundle.js.map
|
package/build/898.bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"898.bundle.js","mappings":"oMAmBO,MAAMA,EAAc,cAWzB,CAACC,EAAOC,KACN,MAAMC,EAAU,SAA8B,OAEvCC,EAAeC,IAAiB,EAAAC,EAAA,IAAeL,EAAMM,OAAQN,EAAMO,OAEpE,aAAEC,EAAY,QAAEC,EAAO,MAAEC,IAAU,IAAAC,SAAQ,CAC7CP,cAAe,OAAF,wBACNA,GACAJ,EAAMI,eAEbQ,aAAc,QAgBlB,OAbA,sBACIX,GACA,KAAM,CACFS,MAAO,K,MAEa,QAAhB,EAAAR,MAAAA,OAAO,EAAPA,EAASW,eAAO,SAAEC,SAAS,EAAG,GAE9BJ,QAGR,IAIA,wBAAMK,SAAUP,EAAaR,EAAMe,UAAWd,IAAKC,GAC9CC,EAAca,KAAK,I,IAAA,MAAEC,GAAK,EAAKC,E,yUAAI,GAAhB,WAAuB,OACvC,gBAACD,EAAK,eAACE,IAAKD,EAAKE,KAAMX,QAASA,GAAaS,EAAI,CAAEG,OAAQ,GAAGrB,EAAMqB,UAAUH,EAAKE,aAEtFpB,EAAMsB,aAAetB,EAAMsB,YAAYb,GACvCT,EAAMuB,YC3DNC,EAAQ,IAAM,iC,+BCK3B,MAAMC,EAAY,oCAAiC,aAC7CC,EAAY,oCAAiC,aAC7CC,EAAa,oCAAiC,cAmB7C,SAASC,GAAa,eAAEC,EAAc,OAAEC,EAAM,YAAEC,EAAW,KAAEC,EAAO,W,MACvE,MAAMC,GAAO,IAAAC,YACP,SAAEC,IAAa,IAAAC,eAEfC,EAAeC,OAAOC,OAAOT,IAC5BU,EAAWC,GAAgB,WAAgC,QAAjB,EAAAJ,MAAAA,OAAY,EAAZA,EAAe,UAAE,eAAElB,KAE9DuB,EAAOL,EAAarB,KAAK2B,GAAS,OAAD,wBAChCA,GAAG,CACNC,MAAOX,EAAKY,cAAc,CAAEC,GAAIH,EAAIC,QACpCG,KAAM,UAAUlB,KAAkBc,EAAIK,OACtCC,MAAON,EAAIM,MAAQhB,EAAKY,cAAc,CAAEC,GAAIH,EAAIM,aAAWC,MAQ/D,OALA,aAAgB,KACZ,MAAMC,EAAcd,EAAae,MAAMC,GAAUlB,IAAa,UAAUN,KAAkBwB,EAAML,SAC5FG,GAAaV,EAAaU,EAAYhC,OAC3C,CAACgB,IAGA,gBAAC,WAAc,CAACmB,SAAU,kCACtB,gBAAC7B,EAAS,CAACO,KAAMA,GACb,gBAACN,EAAS,CAACM,KAAMA,EAAMD,YAAaA,EAAaW,KAAMA,EAAMF,UAAWA,GAAa,KACrF,gBAACb,EAAU,CAACK,KAAMA,GACd,gBAAC,EAAAuB,OAAM","sources":["webpack://ReactCore/./src/displayer/DisplayForm.component.tsx","webpack://ReactCore/./src/displayer/Empty.tsx","webpack://ReactCore/./src/components/TwoColLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { DisplayFormRef, FieldsWithOptionalRender } from './types';\nimport { useForm, Control } from 'react-hook-form';\nimport { useDisplayForm } from './useDisplay';\n\n/****\n * The jamespot model depend on the platform\n * For example a user can have the size attribute only for a given platform\n * The model specifics of a platform are stored in J.model\n *\n * This component display an array of attributes only if this attribute is activated on the platform\n *\n * @param type form model type (sport, mpArticle, etc.)\n * @param fields an array of string : the list of attributes we want to display\n * @param defaultValues react hook form default values\n * @param onSubmit callback provided to react hook, called after successful validation\n * @param buttons the buttons, should always include a <button type=\"submit\">\n * Note :If we override the \"render\" you can't override \"wrapper\" and \"element\" because the render rewrite everything\n */\nexport const DisplayForm = React.forwardRef<\n DisplayFormRef,\n {\n type: string;\n fields: FieldsWithOptionalRender<any, any>;\n extraInputs?: (control: Control<any>) => React.ReactNode;\n defaultValues?: any;\n onSubmit: any;\n buttons: React.ReactNode;\n dataCy?: string;\n }\n>((props, ref) => {\n const formRef = React.useRef<HTMLFormElement>(null);\n\n const [configuration, defaultValues] = useDisplayForm(props.fields, props.type);\n\n const { handleSubmit, control, reset } = useForm({\n defaultValues: {\n ...defaultValues,\n ...props.defaultValues,\n },\n criteriaMode: 'all',\n });\n\n React.useImperativeHandle(\n ref,\n () => ({\n reset: () => {\n // in case the form is scrollable\n formRef?.current?.scrollTo(0, 0);\n // reset react-hook-form form\n reset();\n },\n }),\n [],\n );\n\n return (\n <form onSubmit={handleSubmit(props.onSubmit)} ref={formRef}>\n {configuration.map(({ Input, ...conf }) => (\n <Input key={conf.name} control={control} {...conf} dataCy={`${props.dataCy}-${conf.name}`} />\n ))}\n {props.extraInputs && props.extraInputs(control)}\n {props.buttons}\n </form>\n );\n});\n","import * as React from 'react';\n\n// FIXME move to j-react-components + display error if dev mode\nexport const Empty = () => <></>;\n","import * as React from 'react';\nimport { Outlet } from 'react-router-dom';\nimport { useIntl } from 'react-intl';\nimport type { JRCAppColumnProps } from 'jamespot-react-components';\nimport JRCore from 'App';\nimport { useLocation } from 'react-router-dom';\nimport { LayoutMode } from 'jamespot-react-components';\n\nconst Container = JRCore.registry.getLazyComponent('Container');\nconst AppColumn = JRCore.registry.getLazyComponent('AppColumn');\nconst MainColumn = JRCore.registry.getLazyComponent('MainColumn');\n\nexport type TwoColLayoutRoute = {\n path: string;\n key: string;\n icon: string;\n label: string;\n group?: string;\n};\n\nexport type TwoColLayoutRoutes = Record<string, TwoColLayoutRoute>;\n\nexport type TwoColLayoutProps = {\n extensionRoute: string;\n routes: TwoColLayoutRoutes;\n mode?: LayoutMode;\n description: JRCAppColumnProps['description'];\n};\n\nexport function TwoColLayout({ extensionRoute, routes, description, mode = 'center' }: TwoColLayoutProps) {\n const intl = useIntl();\n const { pathname } = useLocation();\n\n const ROUTES_ARRAY = Object.values(routes);\n const [activeTab, setActiveTab] = React.useState(ROUTES_ARRAY?.[0]?.key);\n\n const tabs = ROUTES_ARRAY.map((tab) => ({\n ...tab,\n label: intl.formatMessage({ id: tab.label }),\n href: `/ng/rr/${extensionRoute}/${tab.path}`,\n group: tab.group ? intl.formatMessage({ id: tab.group }) : undefined,\n }));\n\n React.useEffect(() => {\n const activeRoute = ROUTES_ARRAY.find((route) => pathname === `/ng/rr/${extensionRoute}/${route.path}`);\n if (activeRoute) setActiveTab(activeRoute.key);\n }, [pathname]);\n\n return (\n <React.Suspense fallback={<></>}>\n <Container mode={mode}>\n <AppColumn mode={mode} description={description} tabs={tabs} activeTab={activeTab || ''} />\n <MainColumn mode={mode}>\n <Outlet />\n </MainColumn>\n </Container>\n </React.Suspense>\n );\n}\n"],"names":["DisplayForm","props","ref","formRef","configuration","defaultValues","useDisplay","fields","type","handleSubmit","control","reset","useForm","criteriaMode","current","scrollTo","onSubmit","map","Input","conf","key","name","dataCy","extraInputs","buttons","Empty","Container","AppColumn","MainColumn","TwoColLayout","extensionRoute","routes","description","mode","intl","useIntl","pathname","useLocation","ROUTES_ARRAY","Object","values","activeTab","setActiveTab","tabs","tab","label","formatMessage","id","href","path","group","undefined","activeRoute","find","route","fallback","Outlet"],"sourceRoot":""}
|