jamespot-react-core 1.1.96 → 1.1.98
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 +466 -323
- package/build/app.bundle.js.map +1 -1
- package/build/assets/group-background.daf782321c7f65cde0fc3d5918d27762.png +0 -0
- package/build/displayer/DisplayForm.component.d.ts +16 -6
- package/build/displayer/components/inputs/InputRichText.d.ts +2 -0
- package/build/displayer/formatter.d.ts +14 -14
- package/build/displayer/types.d.ts +4 -5
- package/build/displayer/useDisplay.d.ts +6 -2
- package/build/redux/slice/Article.slice.d.ts +1 -1
- package/build/redux/slice/User.slice.d.ts +1 -1
- package/build/redux/store.d.ts +2 -2
- package/build/registry/ext-component-list.d.ts +2 -0
- package/package.json +4 -4
package/build/898.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[898],{898:(e,t,n)=>{n.r(t),n.d(t,{DisplayForm:()=>l,Empty:()=>
|
|
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
2
|
//# sourceMappingURL=898.bundle.js.map
|
package/build/898.bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"898.bundle.js","mappings":"
|
|
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,wBAC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ACN,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":""}
|