awing-library 2.1.2-dev.544 → 2.1.2-dev.546

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.
@@ -5,6 +5,7 @@ type Value = string | number;
5
5
  export interface LazyAutocompleteFieldDefinition<T> extends Omit<AutocompleteFieldDefinition<T>, 'options' | 'type'> {
6
6
  type: FIELD_TYPE.LAZY_AUTOCOMPLETE | 'lazyautocomplete';
7
7
  fetchOptions: () => Promise<MenuOption<Value>[]>;
8
+ additionalOptions?: MenuOption<Value>[];
8
9
  }
9
10
  export declare const LazyAutocompleteInput: <T>(fieldDefinition: LazyAutocompleteFieldDefinition<T>) => import("react/jsx-runtime").JSX.Element;
10
11
  export default LazyAutocompleteInput;
@@ -1 +1 @@
1
- {"version":3,"file":"LazyAutocompleteInput.d.ts","sourceRoot":"","sources":["../../../../src/AWING/DataInput/components/LazyAutocompleteInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlE,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7B,MAAM,WAAW,+BAA+B,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAChH,IAAI,EAAE,UAAU,CAAC,iBAAiB,GAAG,kBAAkB,CAAC;IACxD,YAAY,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,qBAAqB,GAAI,CAAC,mBAAoB,+BAA+B,CAAC,CAAC,CAAC,4CAmH5F,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"LazyAutocompleteInput.d.ts","sourceRoot":"","sources":["../../../../src/AWING/DataInput/components/LazyAutocompleteInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlE,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7B,MAAM,WAAW,+BAA+B,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAChH,IAAI,EAAE,UAAU,CAAC,iBAAiB,GAAG,kBAAkB,CAAC;IACxD,YAAY,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjD,iBAAiB,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;CAC3C;AAED,eAAO,MAAM,qBAAqB,GAAI,CAAC,mBAAoB,+BAA+B,CAAC,CAAC,CAAC,4CA2H5F,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -9,7 +9,7 @@ const LazyAutocompleteInput_LazyAutocompleteInput = (fieldDefinition)=>{
9
9
  const { t } = useTranslation(void 0, {
10
10
  i18n: i18n
11
11
  });
12
- const { fetchOptions, value, onChange, readOnly, error, disableHelperText, helperText, disableClearable, multiple = false, isDirectory = false, onValidateCustom, disabled, required = false, clearOnEscape = true, ...other } = fieldDefinition;
12
+ const { fetchOptions, value, onChange, readOnly, error, disableHelperText, helperText, disableClearable, multiple = false, isDirectory = false, onValidateCustom, disabled, required = false, clearOnEscape = true, additionalOptions, ...other } = fieldDefinition;
13
13
  const [open, setOpen] = useState(false);
14
14
  const [options, setOptions] = useState([]);
15
15
  const [fetched, setFetched] = useState(false);
@@ -22,7 +22,15 @@ const LazyAutocompleteInput_LazyAutocompleteInput = (fieldDefinition)=>{
22
22
  };
23
23
  useEffect(()=>{
24
24
  if (open && !fetched) fetchOptions().then((res)=>{
25
- setOptions(res);
25
+ let finalOptions = res;
26
+ if (additionalOptions) finalOptions = Array.isArray(additionalOptions) ? [
27
+ ...additionalOptions,
28
+ ...res
29
+ ] : [
30
+ additionalOptions,
31
+ ...res
32
+ ];
33
+ setOptions(finalOptions);
26
34
  setFetched(true);
27
35
  });
28
36
  }, [
@@ -3,7 +3,7 @@ import react from "@monaco-editor/react";
3
3
  import { formatJSON } from "../../Helpers/index.js";
4
4
  import { useEffect, useState } from "react";
5
5
  const MonacoEditorContainer = (props)=>{
6
- const { value, height, language, onChange, isShowMinimap, disableFormatJSON = false, ...options } = props;
6
+ const { value, height, language, onChange, isShowMinimap, disableFormatJSON = false, options } = props;
7
7
  const [valueGetter, setValueGetter] = useState(void 0);
8
8
  useEffect(()=>{
9
9
  disableFormatJSON ? setValueGetter(value) : setValueGetter(formatJSON(value ?? ''));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.544",
3
+ "version": "2.1.2-dev.546",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {