22ed39eac0c1c447b18c6452d3cd553eea4a7e6a14dcf0fe15970626441effd091f25e6bc70cd50d305016dd2ba5465caa3bb4863d8320e9ba3dbb9da6738a 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import type { Component } from 'vue';
  2. import type { TooltipInstance } from 'element-plus/es/components/tooltip';
  3. import type { ScrollbarInstance } from 'element-plus/es/components/scrollbar';
  4. import type { SelectEmits, SelectProps } from './select';
  5. import type { OptionBasic, OptionPublicInstance, OptionValue, SelectStates } from './type';
  6. export declare const useSelect: (props: SelectProps, emit: SelectEmits) => {
  7. inputId: import("vue").Ref<string | undefined>;
  8. contentId: import("vue").Ref<string>;
  9. nsSelect: {
  10. namespace: import("vue").ComputedRef<string>;
  11. b: (blockSuffix?: string) => string;
  12. e: (element?: string) => string;
  13. m: (modifier?: string) => string;
  14. be: (blockSuffix?: string, element?: string) => string;
  15. em: (element?: string, modifier?: string) => string;
  16. bm: (blockSuffix?: string, modifier?: string) => string;
  17. bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
  18. is: {
  19. (name: string, state: boolean | undefined): string;
  20. (name: string): string;
  21. };
  22. cssVar: (object: Record<string, string>) => Record<string, string>;
  23. cssVarName: (name: string) => string;
  24. cssVarBlock: (object: Record<string, string>) => Record<string, string>;
  25. cssVarBlockName: (name: string) => string;
  26. };
  27. nsInput: {
  28. namespace: import("vue").ComputedRef<string>;
  29. b: (blockSuffix?: string) => string;
  30. e: (element?: string) => string;
  31. m: (modifier?: string) => string;
  32. be: (blockSuffix?: string, element?: string) => string;
  33. em: (element?: string, modifier?: string) => string;
  34. bm: (blockSuffix?: string, modifier?: string) => string;
  35. bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
  36. is: {
  37. (name: string, state: boolean | undefined): string;
  38. (name: string): string;
  39. };
  40. cssVar: (object: Record<string, string>) => Record<string, string>;
  41. cssVarName: (name: string) => string;
  42. cssVarBlock: (object: Record<string, string>) => Record<string, string>;
  43. cssVarBlockName: (name: string) => string;
  44. };
  45. states: {
  46. inputValue: string;
  47. options: Map<OptionValue, OptionPublicInstance>;
  48. cachedOptions: Map<OptionValue, OptionPublicInstance>;
  49. optionValues: OptionValue[];
  50. selected: {
  51. index: number;
  52. value: OptionValue;
  53. currentLabel: OptionPublicInstance["currentLabel"];
  54. isDisabled?: OptionPublicInstance["isDisabled"] | undefined;
  55. }[];
  56. hoveringIndex: number;
  57. inputHovering: boolean;
  58. selectionWidth: number;
  59. collapseItemWidth: number;
  60. previousQuery: string | null;
  61. selectedLabel: string;
  62. menuVisibleOnFocus: boolean;
  63. isBeforeHide: boolean;
  64. };
  65. isFocused: import("vue").Ref<boolean>;
  66. expanded: import("vue").Ref<boolean>;
  67. optionsArray: import("vue").ComputedRef<OptionPublicInstance[]>;
  68. hoverOption: import("vue").Ref<any>;
  69. selectSize: import("vue").ComputedRef<"" | "small" | "default" | "large">;
  70. filteredOptionsCount: import("vue").ComputedRef<number>;
  71. updateTooltip: () => void;
  72. updateTagTooltip: () => void;
  73. debouncedOnInputChange: import("lodash").DebouncedFunc<() => void>;
  74. onInput: (event: Event) => void;
  75. deletePrevTag: (e: KeyboardEvent) => void;
  76. deleteTag: (event: MouseEvent, tag: OptionBasic) => void;
  77. deleteSelected: (event: Event) => void;
  78. handleOptionSelect: (option: OptionPublicInstance) => void;
  79. scrollToOption: (option: OptionPublicInstance | OptionPublicInstance[] | SelectStates["selected"]) => void;
  80. hasModelValue: import("vue").ComputedRef<boolean>;
  81. shouldShowPlaceholder: import("vue").ComputedRef<boolean>;
  82. currentPlaceholder: import("vue").ComputedRef<string>;
  83. mouseEnterEventName: import("vue").ComputedRef<"mouseenter" | null>;
  84. needStatusIcon: import("vue").ComputedRef<boolean>;
  85. showClearBtn: import("vue").ComputedRef<boolean>;
  86. iconComponent: import("vue").ComputedRef<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown> | undefined>;
  87. iconReverse: import("vue").ComputedRef<string>;
  88. validateState: import("vue").ComputedRef<"" | "error" | "success" | "validating">;
  89. validateIcon: import("vue").ComputedRef<"" | Component>;
  90. showNewOption: import("vue").ComputedRef<boolean>;
  91. updateOptions: () => void;
  92. collapseTagSize: import("vue").ComputedRef<"default" | "small">;
  93. setSelected: () => void;
  94. selectDisabled: import("vue").ComputedRef<boolean>;
  95. emptyText: import("vue").ComputedRef<string | null>;
  96. handleCompositionStart: (event: CompositionEvent) => void;
  97. handleCompositionUpdate: (event: CompositionEvent) => void;
  98. handleCompositionEnd: (event: CompositionEvent) => void;
  99. onOptionCreate: (vm: OptionPublicInstance) => void;
  100. onOptionDestroy: (key: OptionValue, vm: OptionPublicInstance) => void;
  101. handleMenuEnter: () => void;
  102. focus: () => void;
  103. blur: () => void;
  104. handleClearClick: (event: Event) => void;
  105. handleClickOutside: (event: Event) => void;
  106. handleEsc: () => void;
  107. toggleMenu: () => void;
  108. selectOption: () => void;
  109. getValueKey: (item: OptionPublicInstance | SelectStates["selected"][0]) => any;
  110. navigateOptions: (direction: "prev" | "next") => void;
  111. dropdownMenuVisible: import("vue").WritableComputedRef<boolean>;
  112. showTagList: import("vue").ComputedRef<{
  113. index: number;
  114. value: OptionValue;
  115. currentLabel: OptionPublicInstance["currentLabel"];
  116. isDisabled?: OptionPublicInstance["isDisabled"] | undefined;
  117. }[]>;
  118. collapseTagList: import("vue").ComputedRef<{
  119. index: number;
  120. value: OptionValue;
  121. currentLabel: OptionPublicInstance["currentLabel"];
  122. isDisabled?: OptionPublicInstance["isDisabled"] | undefined;
  123. }[]>;
  124. popupScroll: (data: {
  125. scrollTop: number;
  126. scrollLeft: number;
  127. }) => void;
  128. getOption: (value: OptionValue) => {
  129. index: number;
  130. value: import("element-plus/es/utils").EpPropMergeType<(ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
  131. currentLabel: any;
  132. } | {
  133. index: number;
  134. value: import("element-plus/es/utils").EpPropMergeType<(ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
  135. currentLabel: string | number | boolean;
  136. readonly isDisabled: boolean;
  137. };
  138. tagStyle: import("vue").ComputedRef<{
  139. maxWidth: string;
  140. }>;
  141. collapseTagStyle: import("vue").ComputedRef<{
  142. maxWidth: string;
  143. }>;
  144. popperRef: import("vue").ComputedRef<HTMLElement | undefined>;
  145. inputRef: import("vue").Ref<HTMLInputElement | undefined>;
  146. tooltipRef: import("vue").Ref<TooltipInstance | undefined>;
  147. tagTooltipRef: import("vue").Ref<TooltipInstance | undefined>;
  148. prefixRef: import("vue").Ref<HTMLElement | undefined>;
  149. suffixRef: import("vue").Ref<HTMLElement | undefined>;
  150. selectRef: import("vue").Ref<HTMLElement | undefined>;
  151. wrapperRef: import("vue").ShallowRef<HTMLElement | undefined>;
  152. selectionRef: import("vue").Ref<HTMLElement | undefined>;
  153. scrollbarRef: import("vue").Ref<ScrollbarInstance | undefined>;
  154. menuRef: import("vue").Ref<HTMLElement | undefined>;
  155. tagMenuRef: import("vue").Ref<HTMLElement | undefined>;
  156. collapseItemRef: import("vue").Ref<HTMLElement | undefined>;
  157. };