@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.
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { UseFormRegister } from "react-hook-form";
3
- declare const MyWalletItemCheckBox: ({ onChange, name, register, checked, }: {
3
+ type MyWalletItemCheckBoxProps = {
4
4
  onChange: (e?: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
5
5
  name: string;
6
- register: UseFormRegister<any>;
6
+ register?: UseFormRegister<any>;
7
7
  checked?: boolean;
8
- }) => import("react/jsx-runtime").JSX.Element;
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
- return ((0, jsx_runtime_1.jsx)(StyledCheckbox, { children: (0, jsx_runtime_1.jsx)(Forms_1.CheckboxInput, { label: "", data: { name }, register: register(name, { onChange }), checked: checked }) }));
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
- // import { useRouter } from "next/router";
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
- // const router = useRouter();
66
+ const router = (0, router_1.useRouter)();
66
67
  (0, react_1.useEffect)(() => {
67
- // const term = router.query?.term;
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
- // await router.replace(
160
- // {
161
- // query: { ...router.query, term: newSearchValue },
162
- // },
163
- // undefined,
164
- // { shallow: true },
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
- // import { useRouter } from 'next/router';
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
- // const router = useRouter();
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
- // 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('');
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 }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.3.44",
3
+ "version": "2.3.46",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",