import React, { useEffect, useMemo, useState } from "react"; import Select, { OnChangeValue, StylesConfig, OptionProps, components as reactSelectComponents, Options, MenuListProps, GroupBase, OptionsOrGroups, DropdownIndicatorProps, } from "react-select"; import CreatableSelect from "react-select/creatable"; import * as GQL from "src/core/generated-graphql"; import { useAllMoviesForFilter, useAllStudiosForFilter, useMarkerStrings, useStudioCreate, useMovieCreate, } from "src/core/StashService"; import { useToast } from "src/hooks/Toast"; import { SelectComponents } from "react-select/dist/declarations/src/components"; import { ConfigurationContext } from "src/hooks/Config"; import { useIntl } from "react-intl"; import { objectTitle } from "src/core/files"; import { galleryTitle } from "src/core/galleries"; import { defaultMaxOptionsShown, IUIConfig } from "src/core/config"; import { useDebounce } from "src/hooks/debounce"; import { Placement } from "react-bootstrap/esm/Overlay"; import { PerformerIDSelect } from "../Performers/PerformerSelect"; import { Icon } from "./Icon"; import { faTableColumns } from "@fortawesome/free-solid-svg-icons"; import { TagIDSelect } from "../Tags/TagSelect"; export type SelectObject = { id: string; name?: string | null; title?: string | null; }; type Option = { value: string; label: string }; interface ITypeProps { type?: | "performers" | "studios" | "tags" | "scene_tags" | "performer_tags" | "movies"; } interface IFilterProps { ids?: string[]; initialIds?: string[]; onSelect?: (item: SelectObject[]) => void; noSelectionString?: string; className?: string; isMulti?: boolean; isClearable?: boolean; isDisabled?: boolean; creatable?: boolean; menuPortalTarget?: HTMLElement | null; } interface ISelectProps { className?: string; items: Option[]; selectedOptions?: OnChangeValue; creatable?: boolean; onCreateOption?: (value: string) => void; isLoading: boolean; isDisabled?: boolean; onChange: (item: OnChangeValue) => void; initialIds?: string[]; isMulti: T; isClearable?: boolean; onInputChange?: (input: string) => void; components?: Partial>>; filterOption?: (option: Option, rawInput: string) => boolean; isValidNewOption?: ( inputValue: string, value: Options