@bbl-digital/snorre 3.0.8 → 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,6 @@ declare const useAutocomplete: (props: IProps) => {
11
11
  handleCustomOnKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
12
12
  handleOnInputClick: () => void;
13
13
  onFuzzyBlur: (e: React.FocusEvent<HTMLInputElement, Element>) => void;
14
- onFuzzyFocus: () => void;
15
14
  value: string;
16
15
  highlightedIndex: number | null;
17
16
  showValues: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useAutocomplete.d.ts","sourceRoot":"","sources":["../../../../src/packages/core/Autocomplete/hooks/useAutocomplete.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAE1D,QAAA,MAAM,eAAe,UAAW,MAAM;;;;;;uBAuBV,MAAM,WAAW,CAAC,gBAAgB,CAAC;yBAwJjC,mBAAmB,CAAC,gBAAgB,CAAC;+BAZ/B,mBAAmB,CAAC,gBAAgB,CAAC;;qBA3H/C,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC;;;;;;CAqNpE,CAAA;AAED,eAAe,eAAe,CAAA"}
1
+ {"version":3,"file":"useAutocomplete.d.ts","sourceRoot":"","sources":["../../../../src/packages/core/Autocomplete/hooks/useAutocomplete.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAE1D,QAAA,MAAM,eAAe,UAAW,MAAM;;;;;;uBAuBV,MAAM,WAAW,CAAC,gBAAgB,CAAC;yBAgJjC,mBAAmB,CAAC,gBAAgB,CAAC;+BAZ/B,mBAAmB,CAAC,gBAAgB,CAAC;;qBAnH/C,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC;;;;;CA4MpE,CAAA;AAED,eAAe,eAAe,CAAA"}
@@ -38,8 +38,6 @@ const useAutocomplete = props => {
38
38
  const onFuzzyBlur = e => {
39
39
  // If the value of the input is changed, and does not match the value of the values array,
40
40
  // we should revert back the input value to the original value
41
- //What
42
- // if (!e.target.value.length) clearSelectedItem()
43
41
  if (e.target.value === props.value) return; // If target value is the same as a value from the values array, we should set the value for the user
44
42
 
45
43
  if (inputValues?.length) {
@@ -57,11 +55,6 @@ const useAutocomplete = props => {
57
55
  }
58
56
  };
59
57
 
60
- const onFuzzyFocus = () => {
61
- setValueChanged('');
62
- if (props.values?.length) setShowValues(true);
63
- };
64
-
65
58
  const renderedValues = useMemo(() => {
66
59
  if (!props.values?.length) return [];
67
60
 
@@ -231,7 +224,6 @@ const useAutocomplete = props => {
231
224
  handleCustomOnKeyDown,
232
225
  handleOnInputClick,
233
226
  onFuzzyBlur,
234
- onFuzzyFocus,
235
227
  value,
236
228
  highlightedIndex,
237
229
  showValues,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Autocomplete/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAa,YAAY,EAAE,MAAM,OAAO,CAAA;AAQtD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3C,oBAAY,GAAG,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAA;AAEhD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAqLjC,CAAA;AAEF,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Autocomplete/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAa,YAAY,EAAE,MAAM,OAAO,CAAA;AAQtD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAG3C,oBAAY,GAAG,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAA;AAEhD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAoLjC,CAAA;AAEF,eAAe,YAAY,CAAA"}
@@ -37,8 +37,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
37
37
  handleOnKeyDown,
38
38
  handleValueClick,
39
39
  onInputChange,
40
- onFuzzyBlur,
41
- onFuzzyFocus
40
+ onFuzzyBlur
42
41
  } = useAutocomplete(props);
43
42
  useEffect(() => {
44
43
  const handleClickOutside = e => {
@@ -60,8 +59,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
60
59
  return _jsxs(_Fragment, {
61
60
  children: [_jsxs("label", {
62
61
  ref: inputWrapperRef,
63
- css: theme => [styles.default(theme), (props.invalid || props.invalidMessage) && styles.invalid(theme), props.validation && styles.validation, props.onLabelClick && styles.clickableLabel, height && styles.height(height), css && css],
64
62
  onClick: props.onLabelClick ? e => e.preventDefault() : undefined,
63
+ css: theme => [styles.default(theme), (props.invalid || props.invalidMessage) && styles.invalid(theme), props.validation && styles.validation, props.onLabelClick && styles.clickableLabel, height && styles.height(height), css && css],
65
64
  children: [_jsxs("span", {
66
65
  css: styles.label,
67
66
  children: [props.label && (props.onLabelClick ? _jsx(Link, {
@@ -83,7 +82,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(({
83
82
  disabled: props.disabled,
84
83
  autoFocus: props.focus,
85
84
  onBlur: props.fuzzy ? onFuzzyBlur : props.onBlur,
86
- onFocus: props.fuzzy ? onFuzzyFocus : props.onFocus,
85
+ onFocus: props.onFocus,
87
86
  onChange: onInputChange,
88
87
  onKeyDown: props.onKeyDown ? handleCustomOnKeyDown : handleOnKeyDown,
89
88
  onClick: handleOnInputClick,