import React, {FC, useState, useRef, useMemo, useEffect} from "react"; import Select, {components, Props} from "react-select"; import classNames from "classnames"; import {__, CouponsPlus} from "../../globals"; import { MultiSelectSearchItem, MultiSelectSearchItemContext, MultiSelectSearchItemOptions, MultiSelectSearchItemProps } from "./MultiSelectSearchItem"; import AsyncSelect, {AsyncProps} from "react-select/async"; import {get, merge} from "lodash"; import {fieldsCache, fieldsCacheContainer} from "../FieldsCache"; import {Button} from "../cards/Button"; export type RemoteOptions = { type: 'remote', category: string, // the category of the data to fetch, e.g. 'products', 'categories', 'tags', 'users' where: string, // path: string, searchArgumentName?: string | 'search', labelProperty?: string, // the property to use as the name of the option, default is 'name' idProperty?: string, // the property to use as the id, default is 'id' excludeIdsArgumentName?: string, arguments?: Record, } export type MultiSelectSearchProps