@ludo.ninja/components 2.3.44 → 2.3.46
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.
- package/build/components/myWallets/myWalletItem/myWalletItemCheckBox/index.d.ts +4 -3
- package/build/components/myWallets/myWalletItem/myWalletItemCheckBox/index.js +12 -4
- package/build/components/search/SearchInputContainer.js +11 -14
- package/build/components/search/searchCloseMoreButtons/index.js +12 -12
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { UseFormRegister } from "react-hook-form";
|
|
3
|
-
|
|
3
|
+
type MyWalletItemCheckBoxProps = {
|
|
4
4
|
onChange: (e?: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
|
|
5
5
|
name: string;
|
|
6
|
-
register
|
|
6
|
+
register?: UseFormRegister<any>;
|
|
7
7
|
checked?: boolean;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
declare const MyWalletItemCheckBox: ({ onChange, name, register, checked }: MyWalletItemCheckBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default MyWalletItemCheckBox;
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const Forms_1 = require("../../../../system/Forms");
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
7
|
const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
|
|
8
|
+
const Forms_1 = require("../../../../system/Forms");
|
|
10
9
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
10
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
11
11
|
const StyledCheckbox = styled_components_1.default.div `
|
|
12
12
|
position: absolute;
|
|
13
13
|
right: 12px;
|
|
@@ -15,7 +15,15 @@ const StyledCheckbox = styled_components_1.default.div `
|
|
|
15
15
|
right: ${(0, _4k_1.adaptiveValueCalc)(12)};
|
|
16
16
|
}
|
|
17
17
|
`;
|
|
18
|
-
const MyWalletItemCheckBox = ({ onChange, name, register, checked
|
|
19
|
-
|
|
18
|
+
const MyWalletItemCheckBox = ({ onChange, name, register, checked }) => {
|
|
19
|
+
const inputProps = register
|
|
20
|
+
? register(name, { onChange })
|
|
21
|
+
: {
|
|
22
|
+
name,
|
|
23
|
+
onChange,
|
|
24
|
+
onBlur: () => { },
|
|
25
|
+
ref: () => { },
|
|
26
|
+
};
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(StyledCheckbox, { children: (0, jsx_runtime_1.jsx)(Forms_1.CheckboxInput, { label: "", data: { name }, register: inputProps, checked: checked }) }));
|
|
20
28
|
};
|
|
21
29
|
exports.default = MyWalletItemCheckBox;
|
|
@@ -29,12 +29,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.SearchInputContainer = void 0;
|
|
30
30
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
|
-
|
|
32
|
+
const router_1 = require("next/router");
|
|
33
33
|
const lodash_debounce_1 = __importDefault(require("lodash.debounce"));
|
|
34
34
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
35
35
|
const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
|
|
36
36
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
37
37
|
const utils_1 = require("@ludo.ninja/utils");
|
|
38
|
+
// import { useFetchFindAllTopEntitiesByName } from "@/api/server-search/queries/useFetchFindAllTopEntitiesByName";
|
|
38
39
|
const searchCloseMoreButtons_1 = __importDefault(require("./searchCloseMoreButtons"));
|
|
39
40
|
const searchSuggestions_1 = __importDefault(require("./searchSuggestions"));
|
|
40
41
|
const env_1 = require("../../store/env");
|
|
@@ -62,10 +63,10 @@ const SearchInputContainer = ({ onFocusHandler, isClearOnBlur, initializeInputCo
|
|
|
62
63
|
// const { load, topEntities, loading, clearTopEntitiesState } =
|
|
63
64
|
// useFetchFindAllTopEntitiesByName();
|
|
64
65
|
const { load, projects, loading, clearProjectsState } = (0, useFetchProjectsByTerm_1.useFetchProjectsByTerm)();
|
|
65
|
-
|
|
66
|
+
const router = (0, router_1.useRouter)();
|
|
66
67
|
(0, react_1.useEffect)(() => {
|
|
67
|
-
|
|
68
|
-
const term = new URLSearchParams(window.location.search).get("term");
|
|
68
|
+
const term = router.query?.term;
|
|
69
|
+
// const term = new URLSearchParams(window.location.search).get("term");
|
|
69
70
|
if (term) {
|
|
70
71
|
setSearchValue(term);
|
|
71
72
|
}
|
|
@@ -156,16 +157,12 @@ const SearchInputContainer = ({ onFocusHandler, isClearOnBlur, initializeInputCo
|
|
|
156
157
|
const currentPath = window.location.pathname;
|
|
157
158
|
if (searchDomain === window.origin &&
|
|
158
159
|
seacrhTabs_1.searchTabs.find((el) => currentPath.includes(el.link))) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
//
|
|
165
|
-
// );
|
|
166
|
-
const newUrl = new URL(window.location.href);
|
|
167
|
-
newUrl.searchParams.set("term", newSearchValue);
|
|
168
|
-
window.history.replaceState({}, "", newUrl.toString());
|
|
160
|
+
await router.replace({
|
|
161
|
+
query: { ...router.query, term: newSearchValue },
|
|
162
|
+
}, undefined, { shallow: true });
|
|
163
|
+
// const newUrl = new URL(window.location.href);
|
|
164
|
+
// newUrl.searchParams.set("term", newSearchValue);
|
|
165
|
+
// window.history.replaceState({}, "", newUrl.toString());
|
|
169
166
|
setSearchFocused(false);
|
|
170
167
|
onFocusHandler?.(false);
|
|
171
168
|
closeOverlay();
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
|
|
7
|
+
const router_1 = require("next/router");
|
|
8
8
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
9
9
|
const scale_1 = require("../../../utils/adaptive/scale");
|
|
10
10
|
const screen_1 = require("../../../utils/screen");
|
|
@@ -41,21 +41,21 @@ const SearchCloseIconResize = () => {
|
|
|
41
41
|
};
|
|
42
42
|
// Components
|
|
43
43
|
const SearchCloseMoreButtons = ({ isNeedToShow, position, clearSearchValue, }) => {
|
|
44
|
-
|
|
44
|
+
const router = (0, router_1.useRouter)();
|
|
45
45
|
// const { term } = router.query;
|
|
46
46
|
return ((0, jsx_runtime_1.jsx)(StyledSearchCloseMoreButtons, { position: position, children: isNeedToShow ? ((0, jsx_runtime_1.jsx)(StyledCloseIcon, { onClick: () => {
|
|
47
47
|
const term = new URLSearchParams(window.location.search).get('term');
|
|
48
48
|
if (term) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const params = new URLSearchParams(window.location.search);
|
|
55
|
-
params.delete('term');
|
|
56
|
-
const newUrl = `${window.location.pathname}?${params.toString()}`;
|
|
57
|
-
window.history.pushState({}, '', newUrl);
|
|
58
|
-
clearSearchValue('');
|
|
49
|
+
router
|
|
50
|
+
.push({
|
|
51
|
+
query: { ...router.query, term: [] },
|
|
52
|
+
})
|
|
53
|
+
.then(() => clearSearchValue(''));
|
|
54
|
+
// const params = new URLSearchParams(window.location.search);
|
|
55
|
+
// params.delete('term');
|
|
56
|
+
// const newUrl = `${window.location.pathname}?${params.toString()}`;
|
|
57
|
+
// window.history.pushState({}, '', newUrl);
|
|
58
|
+
// clearSearchValue('');
|
|
59
59
|
}
|
|
60
60
|
clearSearchValue('');
|
|
61
61
|
}, children: (0, jsx_runtime_1.jsx)(SearchCloseIconResize, {}) })) : null }));
|