Global

Members

(constant) checkInvalidFieldNameCharacter

Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Source:

(constant) FIELD_NAME_REGEX

Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Source:

(constant) FormNoop

It is an implementation of Form no-op, it just renders the layout and propagates any event to the instance `dispatch`.
Source:

(constant) localDataStorage

Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Source:

(constant) PUBLIC_EVENTS

Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Source:

(constant) ReactFieldAdapter

This creates a compatibility layer for the Field component on React, allowing it to be called by Metal+Soy file. This component creates a mask for the Field component, some DDM fields access the `usePage` and we need to bring the `usePage` here since this component will not have a React context above it.
Source:

(constant) setValue

Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Source:

(constant) useEvaluate

This hook is a partial function that removes the need to pass the same properties every time they are called, this is only for thunks that use the `evaluate` function.
Source:

(constant) useStorage

Simple implementation to create a local storage that can be shared independently of the React tree, Form Renderer is not an application and can be reused more than once on the same page, so we need to share requests and fields, they are loaded on demand, so as not to make unnecessary requests. Use the `useStorage` hook as a way to cache data.
Source:

Methods

getConnectedReactComponentAdapter(ReactComponent)

The Adapter creates a communication bridge between the Metal and React components. The Adapter when it is rendered for the first time uses `ReactDOM.render` to assemble the component and subsequent renderings are done by React. We created a tunnel with an Observer that updates the internal state of the component in React that makes a wrapper over the main component to force React to render at the best time, we also ignore the rendering of Metal.
Parameters:
Name Type Description
ReactComponent React.createElement
Source:
Examples
// import getConnectedReactComponentAdapter from '/path/ReactComponentAdapter.es';
//
// const ReactComponent = ({children, className}) => <div className={className}>{children}</div>;
// const ReactComponentAdapter = getConnectedReactComponentAdapter(
//   ReactComponent
// );
//
// In the rendering of Metal
// render() {
//	return (
//		<ReactComponentAdapter className="h1-title">
//			<h1>{'Title'}</h1>
//		</ReactComponentAdapter>
//	);
// }

To call the React component in the context of Metal + soy, where varient is not an option,
you can use Metal's `Soy.register` to create a fake component so that you can call the React
component in Soy. The use of children from Soy components for React does not work.
// import Soy from 'metal-soy';
// import getConnectedReactComponentAdapter from '/path/ReactComponentAdapter.es';
// import templates from './FakeAdapter.soy';
//
// const ReactComponent = ({className}) => <div className={className} />;
// const ReactComponentAdapter = getConnectedReactComponentAdapter(
//   ReactComponent
// );
// Soy.register(ReactComponentAdapter, templates);
//
// In soy
// {call FakeAdapter.render}
//	{param className: 'test' /}
// {/call}

identity()

Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Source:

mountStruct()

This only assembles the expected structure of the Forms field event, creates a makeup to maintain compatibility with the mechanism, the fields in React do not need to assemble this structure, they must only provide a native event or value in the case of an onChange
Source:

ObserverSubscribe()

Adds a sub observer to maintain the updated state of the component.
Source: