Global

Members

(constant) capitalize

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) capitalize

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) 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) ColorPickerProxy

The Proxy is on the front line of `PageRenderer.RegisterFieldType`, communicates directly with the store and issues events from the Metal instance. This should be overridden when we have a Store/Provider React implementation.
Source:

(constant) COLORS

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) connectStore

The proxy combines the responsibilities of the withDispatch utilities to maintain compatibility with the use of FieldBase in other fields in React and isolate connection to the Metal store.
Source:

(constant) CSS_DDM_FIELDSET

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) dedupValue

Deduplicates the value by checking if there is a value in the fields, always incrementing an integer in front of the value to be friendly for the user.
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) FIELD_TYPE_FIELDSET

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) getEditingValue

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) KEYCODES

Mapping to be used to match keyCodes returned from keydown events.
Source:

(constant) normalizeValue

O normalize value impede que value seja nulo ou undefined. If the value is null or undefined, normalize follows a verification order and the final stage of normalization is to deduplicate the value if necessary. 1. If the current value is null, use the label 2. If the current label is null, use the string Option
Source:

(constant) setJSONArrayValue

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) 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) SoyRegisterAdapter

Basically it is an implementation of a module with a deltemplate in compiled soy, this registers the field so that it can be called dynamically. Anyone using ReactComponentAdapter does not need to know this information, it will be removed when we have an implementation in React.
Source:

(constant) useSyncValue

Use Sync Value to synchronize the initial value with the current internal value, only update the internal value with the new initial value if the values are different and when the value is not changed for more than ms.
Source:

(constant) VALIDATIONS

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:

Methods

appendValue(options) → {Array}

Appends a new value on the current value state
Parameters:
Name Type Description
options Object
Properties
Name Type Description
value Array | String
valueToBeAppended Array | String
Source:
Returns:
Type
Array

assertOptionParameters()

Some parameters on each option needs to be prepared in case of multiple selected values(when the value state is an array).
Source:

FakeSoyTemplate()

Create a fake template to use Soy.register so that ComponentAdapter is called instead.
Source:

FieldBaseProxy()

This Proxy connects to the store to send the changes directly to the store. This should be replaced when we have a communication with a Store/Provider in React.
Source:

FieldTypeBox()

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:

getConnectedReactComponentAdapter(ReactComponent, variant)

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
variant String
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>
//	);
// }

Some considerations that must be made, this works very well in the context of DDM fields,
where the dynamic rendering mechanism of the components is used using Soy with the use of
`deltemplates`, so you just need to pass the name of the `variant` of your field so that
it can be called dynamically, this registers a variant in `PageRenderer.RegisterFieldType`.
This is optional; this adapter can work very well in the context of Metal+JSX.
// import getConnectedReactComponentAdapter from '/path/ReactComponentAdapter.es';
//
// const ReactComponent = ({className}) => <div className={className} />;
// const ReactComponentAdapter = getConnectedReactComponentAdapter(
//   ReactComponent,
//	'separetor'
// );

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}

handleFieldSetAdded()

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:

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:

ObserverSubscribe()

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

Panel()

Alternative component for ClayPanel, since the original component don't have to much flexibility for adding items on the ClayPanel trigger.
Source:

removeValue(options) → {Array}

Removes a value from the value array.
Parameters:
Name Type Description
options Object
Properties
Name Type Description
value Array | String
valueToBeRemoved Array | String
Source:
Returns:
Type
Array

selectText()

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:

sumTotalEntries()

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:

toArray(value)

Wraps the given argument into an array.
Parameters:
Name Type Description
value Array | String
Source: