revdev-components 0.90.0 → 0.92.0

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/index.js CHANGED
@@ -5360,7 +5360,7 @@ function OptionsAutocomplete(_a) {
5360
5360
  }
5361
5361
  }, [text]);
5362
5362
  React.useEffect(function () {
5363
- onChange(values.map(function (w) { return w.label; }));
5363
+ onChange(values);
5364
5364
  }, [values]);
5365
5365
  var optionsModified = React.useMemo(function () {
5366
5366
  var result = __spreadArray([], options, true);
@@ -5368,7 +5368,7 @@ function OptionsAutocomplete(_a) {
5368
5368
  var textParsed_1 = text.trim().toLowerCase();
5369
5369
  var hasOption = options.find(function (x) { return x.label === textParsed_1; });
5370
5370
  if (!hasOption) {
5371
- result.push({ label: text, value: "" });
5371
+ result.push({ label: text, value: text, isNew: true });
5372
5372
  }
5373
5373
  }
5374
5374
  return result;
@@ -1,9 +1,14 @@
1
1
  import React from "react";
2
2
  import { ValueOption } from "src/interfaces";
3
+ export interface AutocompleteOption {
4
+ label: string;
5
+ value: string;
6
+ isNew?: boolean;
7
+ }
3
8
  interface Props<T> {
4
- onChange: (options: string[]) => void;
9
+ onChange: (options: AutocompleteOption[]) => void;
5
10
  placeholder?: string;
6
- requestAction: (text: string, options: ValueOption[]) => void;
11
+ requestAction: (text: string, options: AutocompleteOption[]) => void;
7
12
  requestResponse: {
8
13
  isSuccess: boolean;
9
14
  isLoading: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.90.0",
3
+ "version": "0.92.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {