@antscorp/antsomi-ui 1.3.5-beta.578 → 1.3.5-beta.579
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.
|
@@ -85,8 +85,8 @@ export const SearchPopover = props => {
|
|
|
85
85
|
});
|
|
86
86
|
}, [isClientSearch, itemSearchRender, searchList, searchValue]);
|
|
87
87
|
// Handlers
|
|
88
|
-
const handleAddFilter = () => {
|
|
89
|
-
onAddFilter(searchValue);
|
|
88
|
+
const handleAddFilter = (value) => {
|
|
89
|
+
onAddFilter(value || searchValue);
|
|
90
90
|
setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: false, searchValue: '' })));
|
|
91
91
|
};
|
|
92
92
|
// Renderers
|
|
@@ -117,8 +117,8 @@ export const SearchPopover = props => {
|
|
|
117
117
|
React.createElement(Input.CustomSearch, { value: searchValue, placeholder: t(translations.global.search).toString(), onAfterChange: searchValue => {
|
|
118
118
|
setState(prev => (Object.assign(Object.assign({}, prev), { searchValue })));
|
|
119
119
|
onSearch(searchValue);
|
|
120
|
-
}, onPressEnter:
|
|
121
|
-
handleAddFilter();
|
|
120
|
+
}, onPressEnter: e => {
|
|
121
|
+
handleAddFilter(e.target.value);
|
|
122
122
|
} }),
|
|
123
123
|
React.createElement(Divider, { style: { margin: '8px 0px' } }),
|
|
124
124
|
renderFilterSection(),
|
|
@@ -126,5 +126,9 @@ export const SearchPopover = props => {
|
|
|
126
126
|
return (React.createElement(Popover, Object.assign({ open: isOpenPopover, content: content, overlayInnerStyle: { width: 300, padding: 0 }, trigger: ['click'], arrow: false, placement: "bottomRight" }, restProps, { onOpenChange: open => {
|
|
127
127
|
// Reset search value to empty when close popover
|
|
128
128
|
setState(prev => (Object.assign(Object.assign(Object.assign({}, prev), { isOpenPopover: open }), (!open && { searchValue: '' }))));
|
|
129
|
+
// Clear search when close popover
|
|
130
|
+
if (!open) {
|
|
131
|
+
onSearch('');
|
|
132
|
+
}
|
|
129
133
|
} }), children));
|
|
130
134
|
};
|
|
@@ -36,7 +36,10 @@ export const useHomeMenu = (props) => {
|
|
|
36
36
|
const onClickCreateDashboard = useLayoutStore(store => store.state.leftMenu.onClickCreateDashboard);
|
|
37
37
|
const [removedDashboardId, setRemovedDashboardId] = useState('');
|
|
38
38
|
const urlParams = useMemo(() => new URLSearchParams(search), [search]);
|
|
39
|
-
const showCreateButton = useMemo(() =>
|
|
39
|
+
const showCreateButton = useMemo(() => {
|
|
40
|
+
const menuItemList = isHover ? appHoverMenuChildren : appMenuChildren;
|
|
41
|
+
return !!(menuItemList === null || menuItemList === void 0 ? void 0 : menuItemList.find(item => item.menu_item_code === HOME_MENU_ITEMS.DASHBOARD));
|
|
42
|
+
}, [appHoverMenuChildren, appMenuChildren, isHover]);
|
|
40
43
|
const { mutateAsync: removeDashboard, isLoading: isDashboardRemoving } = useRemoveDashboard();
|
|
41
44
|
const onOptionCallback = useCallback((args) => {
|
|
42
45
|
const { optionKey, menuItemKey } = args;
|