@headless-adminapp/fluent 1.4.6 → 1.4.7
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.
|
@@ -4,6 +4,7 @@ exports.MultiSelectLookupControl = MultiSelectLookupControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
7
|
+
const useRecentItemStore_1 = require("@headless-adminapp/app/metadata/hooks/useRecentItemStore");
|
|
7
8
|
const hooks_2 = require("@headless-adminapp/app/route/hooks");
|
|
8
9
|
const app_1 = require("@headless-adminapp/core/experience/app");
|
|
9
10
|
const icons_1 = require("@headless-adminapp/icons");
|
|
@@ -36,6 +37,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
36
37
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
37
38
|
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
38
39
|
const { lookupStrings } = (0, AppStringContext_1.useAppStrings)();
|
|
40
|
+
const recentItemStore = (0, useRecentItemStore_1.useRecentItemStore)();
|
|
39
41
|
(0, react_1.useEffect)(() => {
|
|
40
42
|
if (open)
|
|
41
43
|
setLookupEnabled(true);
|
|
@@ -141,6 +143,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
141
143
|
const _item = data?.records.find((x) => String(x[schema.idAttribute]) === String(item.optionValue));
|
|
142
144
|
if (!_item)
|
|
143
145
|
return;
|
|
146
|
+
recentItemStore.addItem((0, useLookupData_1.createLookupRecentKey)(schema.logicalName), _item[schema.idAttribute], _item[schema.idAttribute]);
|
|
144
147
|
handleAdd(_item);
|
|
145
148
|
}, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view?.experience.card, record: item, schema: schema }) }, item[schema.idAttribute]))), !isLoading && !data?.records.length && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
146
149
|
paddingInline: react_components_1.tokens.spacingHorizontalL,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"uuid": "11.0.3",
|
|
53
53
|
"yup": "^1.4.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "c89d5cfad823c28fbbeed6a055d3ff6de11adc45"
|
|
56
56
|
}
|