diff --git a/modules/apps/commerce/commerce-frontend-js/dev/components/Autocomplete.js b/modules/apps/commerce/commerce-frontend-js/dev/components/Autocomplete.js
deleted file mode 100644
index f6965e2bf272bc..00000000000000
--- a/modules/apps/commerce/commerce-frontend-js/dev/components/Autocomplete.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * 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.
- */
-
-import React from 'react';
-
-import launcher from '../../../src/main/resources/META-INF/resources/components/autocomplete/entry';
-
-import '../../../src/main/resources/META-INF/resources/styles/main.scss';
-
-launcher('autocomplete', 'autocomplete-root', {
- active: true,
- apiUrl: '/o/headless-commerce-admin-catalog/v1.0/products/',
- customView: (props) => {
- return props.items ? (
- <>
-
- {props.items.map((item) => (
- {item.id}
- ))}
-
- props.updatePage(props.page + 1)}
- >
- Get more Items
-
- >
- ) : null;
- },
- id: 'autocomplete',
- infinityScrollMode: true,
- inputName: 'test-name',
- itemsKey: 'productId',
- itemsLabel: 'externalReferenceCode',
- onValueUpdated: (value, itemData) =>
- // eslint-disable-next-line no-console
- console.log(`Value: ${value}`, `Data: ${JSON.stringify(itemData)}`),
- pageSize: 5,
-});
-
-launcher('autocomplete-2', 'autocomplete-root-2', {
- apiUrl: '/o/headless-commerce-admin-catalog/v1.0/products/',
- autofill: true,
- fetchDataDebounce: 1000,
- id: 'autocomplete-2',
- initialLabel: 'Initial Label',
- initialValue: 'initial-value',
- inputName: 'test-name',
- itemsKey: 'productId',
- itemsLabel: 'externalReferenceCode',
- onValueUpdated: (value, itemData) =>
- // eslint-disable-next-line no-console
- console.log(`Value: ${value}`, `Data: ${JSON.stringify(itemData)}`),
-});
diff --git a/modules/apps/commerce/commerce-frontend-js/dev/components/index.js b/modules/apps/commerce/commerce-frontend-js/dev/components/index.js
index 8295f4a9d645d9..36646ec2415f9d 100644
--- a/modules/apps/commerce/commerce-frontend-js/dev/components/index.js
+++ b/modules/apps/commerce/commerce-frontend-js/dev/components/index.js
@@ -23,11 +23,6 @@ module.exports = [
name: 'Add To Wish List',
page: 'add-to-wish-list.html',
},
- {
- entry: 'Autocomplete',
- name: 'Autocomplete',
- page: 'autocomplete.html',
- },
{
entry: 'DatasetDisplay',
name: 'Dataset display',
diff --git a/modules/apps/commerce/commerce-frontend-js/dev/public/autocomplete.html b/modules/apps/commerce/commerce-frontend-js/dev/public/autocomplete.html
deleted file mode 100644
index 7c82a8620895f8..00000000000000
--- a/modules/apps/commerce/commerce-frontend-js/dev/public/autocomplete.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- Autocomplete Component
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/modules/apps/commerce/commerce-frontend-js/package.json b/modules/apps/commerce/commerce-frontend-js/package.json
index d3e732e953cc56..243a928ccb4949 100644
--- a/modules/apps/commerce/commerce-frontend-js/package.json
+++ b/modules/apps/commerce/commerce-frontend-js/package.json
@@ -23,6 +23,7 @@
"@clayui/tooltip": "3.35.3",
"@liferay/frontend-js-react-web": "*",
"classnames": "2.3.1",
+ "frontend-js-components-web": "*",
"frontend-js-web": "*",
"prop-types": "15.7.2",
"react-dom": "16.12.0"
diff --git a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/AccountsListView.js b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/AccountsListView.js
index 7d03e00e01a199..363a2f6a887bf9 100644
--- a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/AccountsListView.js
+++ b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/AccountsListView.js
@@ -14,7 +14,8 @@
import {ClayButtonWithIcon} from '@clayui/button';
import ClayDropDown from '@clayui/drop-down';
-import React, {useRef} from 'react';
+import {ClayInput} from '@clayui/form';
+import React from 'react';
import ServiceProvider from '../../../ServiceProvider/index';
import Sticker from '../Sticker';
@@ -32,7 +33,7 @@ function AccountsListView({
disabled,
setCurrentView,
}) {
- const accountsListRef = useRef();
+ const [inputValue, setInputValue] = React.useState('');
return (
@@ -55,9 +56,19 @@ function AccountsListView({
+ setInputValue(event.target.value)}
+ placeholder={Liferay.Language.get('search')}
+ value={inputValue}
+ />
+
+
+
+
+
{
if (!items || !items.length) {
return (
@@ -93,14 +104,8 @@ function AccountsListView({
);
}}
disabled={disabled}
- placeholder={Liferay.Language.get('search')}
+ query={inputValue}
/>
-
-
-
-
-
-
);
diff --git a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/ListView.js b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/ListView.js
index b5024516fe6b76..b8d66c60da57f1 100644
--- a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/ListView.js
+++ b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/ListView.js
@@ -12,30 +12,66 @@
* details.
*/
-import React from 'react';
+import {useIsMounted} from '@liferay/frontend-js-react-web';
+import React, {useEffect, useState} from 'react';
-import Autocomplete from '../../autocomplete/Autocomplete';
+import debounce from '../../../utilities/debounce';
+import {getData} from '../../../utilities/index';
+import {showErrorNotification} from '../../../utilities/notifications';
+import InfiniteScroller from '../../infinite_scroller/InfiniteScroller';
+
+function ListView({apiUrl, customView: CustomView, pageSize = 10, query}) {
+ const [items, setItems] = useState(null);
+ const [loading, setLoading] = useState(false);
+ const [totalCount, setTotalCount] = useState(null);
+ const [lastPage, setLastPage] = useState(null);
+ const [page, setPage] = useState(1);
+ const isMounted = useIsMounted();
+
+ const fetchData = debounce((queryVal) => {
+ if (queryVal && isMounted()) {
+ setLoading(true);
+
+ getData(apiUrl, queryVal, page, pageSize)
+ .then((jsonResponse) => {
+ setItems((prevItems) => {
+ if (prevItems?.length && page > 1) {
+ return [...prevItems, ...jsonResponse.items];
+ }
+
+ return jsonResponse.items;
+ });
+
+ setTotalCount(jsonResponse.totalCount);
+ setLastPage(jsonResponse.lastPage);
+ setLoading(false);
+ })
+ .catch(() => {
+ showErrorNotification();
+ setLoading(false);
+ });
+ }
+ }, 200);
+
+ useEffect(() => {
+ fetchData(query);
+ }, [fetchData, query]);
-function ListView({
- apiUrl,
- contentWrapperRef,
- customView,
- disabled,
- placeholder,
-}) {
return (
-
+ {
+ if (!loading) {
+ if (page !== lastPage) {
+ setPage((currentPage) => currentPage + 1);
+
+ fetchData(query);
+ }
+ }
+ }}
+ scrollCompleted={!items || items.length >= totalCount}
+ >
+
+
);
}
diff --git a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/OrdersListView.js b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/OrdersListView.js
index 61df912f7c3d03..de3daa08e19cf7 100644
--- a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/OrdersListView.js
+++ b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/account_selector/views/OrdersListView.js
@@ -14,7 +14,8 @@
import ClayButton, {ClayButtonWithIcon} from '@clayui/button';
import ClayDropDown from '@clayui/drop-down';
-import React, {useMemo, useRef} from 'react';
+import {ClayInput} from '@clayui/form';
+import React, {useMemo} from 'react';
import ServiceProvider from '../../../ServiceProvider/index';
import {OPEN_MODAL} from '../../../utilities/eventsDefinitions';
@@ -34,13 +35,13 @@ function OrdersListView({
setCurrentView,
showOrderTypeModal,
}) {
+ const [inputValue, setInputValue] = React.useState('');
+
const CartResource = useMemo(
() => ServiceProvider.DeliveryCartAPI('v1'),
[]
);
- const ordersListRef = useRef();
-
return (
@@ -57,13 +58,23 @@ function OrdersListView({
-
+
+ setInputValue(event.target.value)}
+ placeholder={Liferay.Language.get('search-order')}
+ value={inputValue}
+ />
+
+
+
+
+
{
if (!items || !items.length) {
return (
@@ -84,16 +95,12 @@ function OrdersListView({
);
}}
disabled={disabled}
- placeholder={Liferay.Language.get('search-order')}
+ query={inputValue}
/>
-
+
-
-
-
-
{
- updateDebouncedGetItems(() =>
- debouncePromise(getData, props.fetchDataDebounce)
- );
- }, [props.fetchDataDebounce]);
-
- const currentValue = selectedItem
- ? getValueFromItem(selectedItem, props.itemsKey)
- : null;
- const currentLabel = selectedItem
- ? getValueFromItem(selectedItem, props.itemsLabel)
- : null;
-
- const CustomView = props.customView || FetchedCustomView;
-
- useEffect(() => {
- if (items && items.length === 1 && props.autofill) {
- const firstItem = items[0];
- updateSelectedItem(firstItem);
- }
- }, [items, props.autofill, props.itemsKey, props.itemsLabel]);
-
- useEffect(() => {
- const value =
- selectedItem && getValueFromItem(selectedItem, props.itemsKey);
-
- if (props.id) {
- Liferay.fire(AUTOCOMPLETE_VALUE_UPDATED, {
- id: props.id,
- itemData: selectedItem,
- value,
- });
- }
-
- if (onValueUpdated) {
- onValueUpdated(value, selectedItem);
- }
-
- if (onChange) {
- onChange({target: {value}});
- }
- }, [selectedItem, props.id, props.itemsKey, onChange, onValueUpdated]);
-
- useEffect(() => {
- if (query) {
- setInitialised(true);
- }
-
- if (props.infiniteScrollMode) {
- updateItems(null);
- }
-
- updatePage(1);
- updateTotalCount(null);
- updateLastPage(null);
- }, [props.infiniteScrollMode, query]);
-
- useEffect(() => {
- if (initialised && debouncedGetItems && !props.disabled) {
- setLoading(true);
-
- debouncedGetItems(props.apiUrl, query, page, pageSize)
- .then((jsonResponse) => {
- if (!isMounted()) {
- return;
- }
-
- updateItems((prevItems) => {
- if (
- props.infiniteScrollMode &&
- prevItems?.length &&
- page > 1
- ) {
- return [...prevItems, ...jsonResponse.items];
- }
-
- return jsonResponse.items;
- });
-
- updateTotalCount(jsonResponse.totalCount);
- updateLastPage(jsonResponse.lastPage);
- setLoading(false);
-
- if (!query) {
- return;
- }
- const found = jsonResponse.items.find(
- (item) =>
- getValueFromItem(item, props.itemsLabel) === query
- );
- if (found) {
- updateSelectedItem(found);
- }
- })
- .catch(() => {
- showErrorNotification();
- setLoading(false);
- });
- }
- }, [
- debouncedGetItems,
- initialised,
- isMounted,
- query,
- page,
- pageSize,
- props.disabled,
- props.infiniteScrollMode,
- props.apiUrl,
- props.itemsLabel,
- props.showErrorNotification,
- ]);
-
- useEffect(() => {
- if (onItemsUpdated) {
- onItemsUpdated(items);
- }
- }, [items, onItemsUpdated]);
-
- useEffect(() => {
- function handleClick(event) {
- if (
- node.current.contains(event.target) ||
- (dropdownNode.current &&
- dropdownNode.current.contains(event.target))
- ) {
- return;
- }
-
- setActive(false);
- }
- if (active) {
- document.addEventListener('mousedown', handleClick);
- }
-
- return () => {
- document.removeEventListener('mousedown', handleClick);
- };
- }, [active]);
-
- let results;
-
- if (CustomView) {
- results = (
-
- );
- }
- else {
- results = (
-
- {items && items.length === 0 && (
-
- {Liferay.Language.get('no-items-were-found')}
-
- )}
- {items &&
- items.length > 0 &&
- items.map((item) => (
- {
- updateSelectedItem(item);
- setActive(false);
- }}
- value={String(
- getValueFromItem(item, props.itemsLabel)
- )}
- />
- ))}
-
- );
- }
-
- const wrappedResults =
- props.infiniteScrollMode && CustomView ? (
- {
- if (!loading) {
- updatePage((currentPage) =>
- currentPage < lastPage
- ? currentPage + 1
- : currentPage
- );
- }
- }}
- scrollCompleted={!items || items.length === totalCount}
- >
- {results}
-
- ) : (
- results
- );
-
- return (
- <>
-
-
-
- {
- updateSelectedItem(null);
- updatePage(1);
- setQuery(event.target.value);
- }}
- onFocus={(_e) => {
- setActive(true);
- setInitialised(true);
- }}
- onKeyUp={(event) => {
- setActive(event.keyCode !== 27);
- }}
- placeholder={props.inputPlaceholder}
- ref={inputNode}
- required={props.required || false}
- value={currentLabel || query}
- />
- {!CustomView && !props.disabled && (
- 1)
- }
- >
-
- {wrappedResults}
-
-
- )}
- {loading && }
-
-
- {CustomView &&
- !props.disabled &&
- (props.contentWrapperRef
- ? props.contentWrapperRef.current && (
-
- {wrappedResults}
-
- )
- : wrappedResults)}
- >
- );
-}
-
-Autocomplete.propTypes = {
- apiUrl: PropTypes.string.isRequired,
- autofill: PropTypes.bool,
- contentWrapperRef: PropTypes.object,
- customView: PropTypes.func,
- customViewModuleUrl: PropTypes.string,
- disabled: PropTypes.bool,
- fetchDataDebounce: PropTypes.number,
- id: PropTypes.string,
- infiniteScrollMode: PropTypes.bool,
- initialLabel: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
- .isRequired,
- initialValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
- .isRequired,
- inputClass: PropTypes.string,
- inputId: PropTypes.string,
- inputName: PropTypes.string.isRequired,
- inputPlaceholder: PropTypes.string,
- itemsKey: PropTypes.string.isRequired,
- itemsLabel: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.arrayOf(PropTypes.string),
- ]).isRequired,
- loadingView: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
- onChange: PropTypes.func,
- onItemsUpdated: PropTypes.func,
- onValueUpdated: PropTypes.func,
- required: PropTypes.bool,
- value: PropTypes.string,
-};
-
-Autocomplete.defaultProps = {
- autofill: false,
- disabled: false,
- fetchDataDebounce: 200,
- infiniteScrollMode: false,
- initialLabel: '',
- initialValue: '',
- inputPlaceholder: Liferay.Language.get('type-here'),
- pageSize: 10,
-};
-
-export default Autocomplete;
diff --git a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/autocomplete/entry.js b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/autocomplete/entry.js
deleted file mode 100644
index 69666b54f8029f..00000000000000
--- a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/autocomplete/entry.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * 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.
- */
-
-import launcher from '../../utilities/launcher';
-import Autocomplete from './Autocomplete';
-
-export default (...data) => launcher(Autocomplete, ...data);
diff --git a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/index.js b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/index.js
index b70f43e5b04708..b7a9cf490fe48a 100644
--- a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/index.js
+++ b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/components/index.js
@@ -18,8 +18,6 @@
export {default as AddToCart} from './add_to_cart/entry';
export {default as AddToWishList} from './add_to_wish_list/entry';
-export {default as Autocomplete} from './autocomplete/entry';
-export {default as AutocompletePureComponent} from './autocomplete/Autocomplete';
export {default as DropdownMenu} from './dropdown/entry';
export {default as Gallery} from './gallery/entry';
export {default as ItemFinder} from './item_finder/entry';
diff --git a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/moduleDescriptor.js b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/moduleDescriptor.js
index 6f6c3dbef0cf03..323e0dd4164537 100644
--- a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/moduleDescriptor.js
+++ b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/moduleDescriptor.js
@@ -16,8 +16,6 @@ export default {
CommerceComponents: [
'AddToCart',
'AddToWishList',
- 'Autocomplete',
- 'AutocompletePureComponent',
'DropdownMenu',
'Gallery',
'ItemFinder',
diff --git a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/utilities/debounce.js b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/utilities/debounce.js
index 508777f5f23ae4..582ee65395c457 100644
--- a/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/utilities/debounce.js
+++ b/modules/apps/commerce/commerce-frontend-js/src/main/resources/META-INF/resources/utilities/debounce.js
@@ -15,9 +15,8 @@
export default function debounce(func, wait, immediate) {
let timeout;
- return () => {
+ return (...args) => {
const context = this;
- const args = arguments;
function later() {
timeout = null;
diff --git a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/package.json b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/package.json
index 938241450baf4a..ae6280e0ca2803 100644
--- a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/package.json
+++ b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/package.json
@@ -7,10 +7,12 @@
"@clayui/modal": "3.35.3",
"@clayui/popover": "3.35.3",
"@clayui/table": "3.32.0",
+ "@liferay/frontend-js-react-web": "*",
"axios": "0.21.1",
"classnames": "2.3.1",
"clay-icon": "2.22.4",
"frontend-editor-ckeditor-web": "*",
+ "frontend-js-components-web": "*",
"frontend-js-web": "*",
"leaflet": "1.7.1",
"map-google-maps": "*",
diff --git a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/ObjectRelationship/ObjectRelationship.js b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/ObjectRelationship/ObjectRelationship.js
index 51b72c79f2539d..7c9dbdd24d2747 100644
--- a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/ObjectRelationship/ObjectRelationship.js
+++ b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/ObjectRelationship/ObjectRelationship.js
@@ -12,33 +12,118 @@
* details.
*/
-import Autocomplete from 'commerce-frontend-js/components/autocomplete/Autocomplete';
+import ClayAutocomplete from '@clayui/autocomplete';
+import {useResource} from '@clayui/data-provider';
+import ClayDropDown from '@clayui/drop-down';
+import {useDebounce} from '@clayui/shared';
import {FieldBase} from 'dynamic-data-mapping-form-field-type/FieldBase/ReactFieldBase.es';
+import {fetch} from 'frontend-js-web';
import React from 'react';
-const ObjectRelationship = ({
+const LoadingWithDebounce = ({loading, networkStatus, render}) => {
+ const debouncedLoadingChange = useDebounce(loading, 500);
+
+ if (networkStatus === 1 || debouncedLoadingChange) {
+ return (
+
+ {Liferay.Language.get('loading')}
+
+ );
+ }
+
+ return render;
+};
+
+export function ObjectRelationship({
apiURL,
- initialLabel,
- initialValue,
+ initialLabel = '',
+ initialValue = '',
inputName,
- itemsKey,
- itemsLabel,
+ labelKey = 'label',
name,
- value,
+ valueKey = 'value',
...otherProps
-}) => (
-
-
-
-);
+}) {
+ const [selectedValue, setSelectedValue] = React.useState(initialValue);
+ const [inputValue, setInputValue] = React.useState(initialLabel);
+ const [networkStatus, setNetworkStatus] = React.useState(1);
+
+ const {resource} = useResource({
+ fetch,
+ fetchPolicy: 'cache-first',
+ link: apiURL,
+ onNetworkStatusChange: setNetworkStatus,
+ variables: {
+ page: 1,
+ pageSize: 10,
+ search: inputValue,
+ },
+ });
+
+ const initialLoading = networkStatus === 1;
+ const loading = networkStatus < 4;
+
+ return (
+
+
+
+
+ {
+ setSelectedValue('');
+ setInputValue(event.target.value);
+ }}
+ placeholder={Liferay.Language.get('search')}
+ value={inputValue}
+ />
+
+
+
+
+ {resource?.items?.length === 0 && (
+
+ {Liferay.Language.get(
+ 'no-results-found'
+ )}
+
+ )}
+ {resource?.items?.map((item) => (
+ {
+ setSelectedValue(
+ item[valueKey]
+ );
+ setInputValue(item[labelKey]);
+ }}
+ value={String(item[labelKey])}
+ />
+ ))}
+ >
+ }
+ />
+
+
+ {loading && }
+
+
+ );
+}
export default ObjectRelationship;
diff --git a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/tsconfig.json b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/tsconfig.json
index b0a61dfae45536..705b8f033a8c0c 100644
--- a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/tsconfig.json
+++ b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/tsconfig.json
@@ -1,5 +1,5 @@
{
- "@generated": "bcba4b119d3cf7bdcb52b5d3d5a71d24f5290ca2",
+ "@generated": "c950209e6d87c9a20f17d56d67f7efa046552fe6",
"@overrides": {
},
"@readonly": "** AUTO-GENERATED: DO NOT EDIT OUTSIDE @overrides **",
@@ -13,6 +13,9 @@
"moduleResolution": "node",
"outDir": "./types",
"paths": {
+ "@liferay/frontend-js-react-web": [
+ "../../frontend-js/frontend-js-react-web/src/main/resources/META-INF/resources/js/index.ts"
+ ]
},
"sourceMap": false,
"strict": true,
@@ -28,5 +31,8 @@
"test/**/*"
],
"references": [
+ {
+ "path": "../../frontend-js/frontend-js-react-web"
+ }
]
}
\ No newline at end of file
diff --git a/modules/apps/frontend-js/frontend-js-components-web/package.json b/modules/apps/frontend-js/frontend-js-components-web/package.json
index d3180b3f5afaec..42a0b0e281d88e 100644
--- a/modules/apps/frontend-js/frontend-js-components-web/package.json
+++ b/modules/apps/frontend-js/frontend-js-components-web/package.json
@@ -1,7 +1,10 @@
{
"dependencies": {
+ "@clayui/autocomplete": "3.35.3",
"@clayui/card": "3.35.3",
+ "@clayui/drop-down": "3.35.3",
"@clayui/icon": "3.32.0",
+ "@clayui/shared": "3.35.3",
"@clayui/sticker": "3.32.0",
"@liferay/frontend-js-react-web": "*",
"classnames": "2.3.1",
diff --git a/modules/apps/frontend-js/frontend-js-components-web/src/main/resources/META-INF/resources/index.js b/modules/apps/frontend-js/frontend-js-components-web/src/main/resources/META-INF/resources/index.js
index b70d3104d9437c..3c735ba1987da5 100644
--- a/modules/apps/frontend-js/frontend-js-components-web/src/main/resources/META-INF/resources/index.js
+++ b/modules/apps/frontend-js/frontend-js-components-web/src/main/resources/META-INF/resources/index.js
@@ -12,6 +12,8 @@
* details.
*/
+export {default as Autocomplete} from './autocomplete/Autocomplete';
+
export {default as Treeview} from './treeview/Treeview';
export {activeLanguageIdsAtom} from './translation_manager/state';
diff --git a/modules/apps/object/object-dynamic-data-mapping/src/main/java/com/liferay/object/dynamic/data/mapping/internal/form/field/type/ObjectRelationshipDDMFormFieldTemplateContextContributor.java b/modules/apps/object/object-dynamic-data-mapping/src/main/java/com/liferay/object/dynamic/data/mapping/internal/form/field/type/ObjectRelationshipDDMFormFieldTemplateContextContributor.java
index 27a6c11445f8bb..a481c4df95c5c0 100644
--- a/modules/apps/object/object-dynamic-data-mapping/src/main/java/com/liferay/object/dynamic/data/mapping/internal/form/field/type/ObjectRelationshipDDMFormFieldTemplateContextContributor.java
+++ b/modules/apps/object/object-dynamic-data-mapping/src/main/java/com/liferay/object/dynamic/data/mapping/internal/form/field/type/ObjectRelationshipDDMFormFieldTemplateContextContributor.java
@@ -68,11 +68,9 @@ public Map getParameters(
).put(
"inputName", ddmFormField.getName()
).put(
- "itemsKey", "id"
+ "labelKey", "id"
).put(
- "itemsLabel", "id"
- ).put(
- "value", ddmFormFieldRenderingContext.getValue()
+ "valueKey", "id"
).build();
}
catch (PortalException portalException) {