@danikokonn/yarik-frontend-lib 2.0.58-test4 → 2.0.58-test5

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 +1 @@
1
- {"version":3,"file":"RichFilterTextField.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/RichFilterTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAUf,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAMlE,QAAA,MAAM,mBAAmB,GAAI,4HAS1B,wBAAwB,sBAsP1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"RichFilterTextField.d.ts","sourceRoot":"","sources":["../../../src/components/RichFilterTextField/RichFilterTextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAUf,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAMlE,QAAA,MAAM,mBAAmB,GAAI,4HAS1B,wBAAwB,sBAkP1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -7,7 +7,6 @@ import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
7
7
  import HintOptionsMenu from "./HintOptionsMenu";
8
8
  import { getHints, insertInStrPos } from "./utils";
9
9
  import { useSnackbarContext } from "../../providers";
10
- import { useDebounce } from "../../utils";
11
10
  import FilterHistoryMenu from "./FilterHistoryMenu";
12
11
  import { Stack } from "@mui/material";
13
12
  const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, additionalComponents, instant: _instant, onChange, onSelectFromHistory, }) => {
@@ -27,14 +26,10 @@ const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, ad
27
26
  const currentHintOptions = (cursorPos != null
28
27
  ? getHints(search, cursorPos, fields, operators)
29
28
  : null) ?? new Map();
30
- const updateHints = useDebounce(() => {
31
- if (cursorPos == null)
32
- return;
33
- // const hints = getHints(search, cursorPos, fields, operators);
34
- // setCurrentHintOptions(hints);
29
+ useEffect(() => {
35
30
  setFocusIdx(0);
36
31
  setInputAnchor(currentHintOptions?.size > 0 ? textFieldRef.current : null);
37
- }, 20);
32
+ }, [currentHintOptions]);
38
33
  useEffect(() => {
39
34
  if (cursorPos == null)
40
35
  return;
@@ -42,8 +37,7 @@ const RichFilterTextField = ({ filterExpr, filterExprHist, fields, operators, ad
42
37
  inputRef.current.selectionStart = cursorPos;
43
38
  inputRef.current.selectionEnd = cursorPos;
44
39
  }
45
- updateHints();
46
- }, [cursorPos, currentHintOptions]);
40
+ }, [cursorPos]);
47
41
  const handleChange = (value, _idx) => {
48
42
  setSearch(value);
49
43
  onChange(value, (v) => setSearchHist(v));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danikokonn/yarik-frontend-lib",
3
- "version": "2.0.58-test4",
3
+ "version": "2.0.58-test5",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "author": "",