useSelect.d.ts 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. import { 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 { ISelectProps, SelectEmits } from './select';
  5. import type { OptionPublicInstance, OptionValue, SelectStates } from './type';
  6. export declare const useSelect: (props: ISelectProps, 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. value: OptionValue;
  52. currentLabel: OptionPublicInstance["currentLabel"];
  53. isDisabled?: OptionPublicInstance["isDisabled"] | undefined;
  54. }[];
  55. hoveringIndex: number;
  56. inputHovering: boolean;
  57. selectionWidth: number;
  58. collapseItemWidth: number;
  59. previousQuery: string | null;
  60. selectedLabel: string;
  61. menuVisibleOnFocus: boolean;
  62. isBeforeHide: boolean;
  63. };
  64. isFocused: import("vue").Ref<boolean>;
  65. expanded: import("vue").Ref<boolean>;
  66. optionsArray: import("vue").ComputedRef<OptionPublicInstance[]>;
  67. hoverOption: import("vue").Ref<any>;
  68. selectSize: import("vue").ComputedRef<"" | "small" | "default" | "large">;
  69. filteredOptionsCount: import("vue").ComputedRef<number>;
  70. updateTooltip: () => void;
  71. updateTagTooltip: () => void;
  72. debouncedOnInputChange: import("lodash").DebouncedFunc<() => void>;
  73. onInput: (event: Event) => void;
  74. deletePrevTag: (e: KeyboardEvent) => void;
  75. deleteTag: (event: MouseEvent, tag: OptionPublicInstance | SelectStates["selected"][0]) => void;
  76. deleteSelected: (event: Event) => void;
  77. handleOptionSelect: (option: OptionPublicInstance) => void;
  78. scrollToOption: (option: OptionPublicInstance | OptionPublicInstance[] | SelectStates["selected"]) => void;
  79. hasModelValue: import("vue").ComputedRef<boolean>;
  80. shouldShowPlaceholder: import("vue").ComputedRef<boolean>;
  81. currentPlaceholder: import("vue").ComputedRef<string>;
  82. mouseEnterEventName: import("vue").ComputedRef<"mouseenter" | null>;
  83. needStatusIcon: import("vue").ComputedRef<boolean>;
  84. showClose: import("vue").ComputedRef<boolean>;
  85. 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>;
  86. iconReverse: import("vue").ComputedRef<string>;
  87. validateState: import("vue").ComputedRef<"" | "error" | "success" | "validating">;
  88. validateIcon: import("vue").ComputedRef<"" | Component>;
  89. showNewOption: import("vue").ComputedRef<boolean>;
  90. updateOptions: () => void;
  91. collapseTagSize: import("vue").ComputedRef<"default" | "small">;
  92. setSelected: () => void;
  93. selectDisabled: import("vue").ComputedRef<boolean | undefined>;
  94. emptyText: import("vue").ComputedRef<string | null>;
  95. handleCompositionStart: (event: CompositionEvent) => void;
  96. handleCompositionUpdate: (event: CompositionEvent) => void;
  97. handleCompositionEnd: (event: CompositionEvent) => void;
  98. onOptionCreate: (vm: OptionPublicInstance) => void;
  99. onOptionDestroy: (key: OptionValue, vm: OptionPublicInstance) => void;
  100. handleMenuEnter: () => void;
  101. focus: () => void;
  102. blur: () => void;
  103. handleClearClick: (event: Event) => void;
  104. handleClickOutside: (event: Event) => void;
  105. handleEsc: () => void;
  106. toggleMenu: () => void;
  107. selectOption: () => void;
  108. getValueKey: (item: OptionPublicInstance | SelectStates["selected"][0]) => any;
  109. navigateOptions: (direction: "prev" | "next") => void;
  110. dropdownMenuVisible: import("vue").WritableComputedRef<boolean>;
  111. showTagList: import("vue").ComputedRef<{
  112. value: OptionValue;
  113. currentLabel: OptionPublicInstance["currentLabel"];
  114. isDisabled?: OptionPublicInstance["isDisabled"] | undefined;
  115. }[]>;
  116. collapseTagList: import("vue").ComputedRef<{
  117. value: OptionValue;
  118. currentLabel: OptionPublicInstance["currentLabel"];
  119. isDisabled?: OptionPublicInstance["isDisabled"] | undefined;
  120. }[]>;
  121. popupScroll: (data: {
  122. scrollTop: number;
  123. scrollLeft: number;
  124. }) => void;
  125. tagStyle: import("vue").ComputedRef<{
  126. maxWidth: string;
  127. }>;
  128. collapseTagStyle: import("vue").ComputedRef<{
  129. maxWidth: string;
  130. }>;
  131. popperRef: import("vue").ComputedRef<HTMLElement | undefined>;
  132. inputRef: import("vue").Ref<HTMLInputElement | undefined>;
  133. tooltipRef: import("vue").Ref<TooltipInstance | undefined>;
  134. tagTooltipRef: import("vue").Ref<TooltipInstance | undefined>;
  135. prefixRef: import("vue").Ref<HTMLElement | undefined>;
  136. suffixRef: import("vue").Ref<HTMLElement | undefined>;
  137. selectRef: import("vue").Ref<HTMLElement | undefined>;
  138. wrapperRef: import("vue").ShallowRef<HTMLElement | undefined>;
  139. selectionRef: import("vue").Ref<HTMLElement | undefined>;
  140. scrollbarRef: import("vue").Ref<ScrollbarInstance | undefined>;
  141. menuRef: import("vue").Ref<HTMLElement | undefined>;
  142. tagMenuRef: import("vue").Ref<HTMLElement | undefined>;
  143. collapseItemRef: import("vue").Ref<HTMLElement | undefined>;
  144. };