useSelect.d.ts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import type { Option, OptionType, SelectStates } from './select.types';
  2. import type { ISelectV2Props } from './token';
  3. import type { SelectEmitFn } from './defaults';
  4. import type { TooltipInstance } from 'element-plus/es/components/tooltip';
  5. import type { SelectDropdownInstance } from './select-dropdown';
  6. declare const useSelect: (props: ISelectV2Props, emit: SelectEmitFn) => {
  7. inputId: import("vue").Ref<string | undefined>;
  8. collapseTagSize: import("vue").ComputedRef<"default" | "small">;
  9. currentPlaceholder: import("vue").ComputedRef<string>;
  10. expanded: import("vue").Ref<boolean>;
  11. emptyText: import("vue").ComputedRef<string | false | null>;
  12. popupHeight: import("vue").ComputedRef<number>;
  13. debounce: import("vue").ComputedRef<0 | 300>;
  14. allOptions: import("vue").ComputedRef<OptionType[]>;
  15. filteredOptions: import("vue").Ref<({
  16. [x: string]: any;
  17. } | {
  18. [x: string]: any;
  19. created?: boolean | undefined;
  20. })[]>;
  21. iconComponent: import("vue").ComputedRef<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown> | undefined>;
  22. iconReverse: import("vue").ComputedRef<string | undefined>;
  23. tagStyle: import("vue").ComputedRef<{
  24. maxWidth: string;
  25. }>;
  26. collapseTagStyle: import("vue").ComputedRef<{
  27. maxWidth: string;
  28. }>;
  29. popperSize: import("vue").Ref<number>;
  30. dropdownMenuVisible: import("vue").WritableComputedRef<boolean>;
  31. hasModelValue: import("vue").ComputedRef<boolean>;
  32. shouldShowPlaceholder: import("vue").ComputedRef<boolean>;
  33. selectDisabled: import("vue").ComputedRef<boolean | undefined>;
  34. selectSize: import("vue").ComputedRef<"" | "small" | "default" | "large">;
  35. needStatusIcon: import("vue").ComputedRef<boolean>;
  36. showClearBtn: import("vue").ComputedRef<boolean>;
  37. states: SelectStates;
  38. isFocused: import("vue").Ref<boolean>;
  39. nsSelect: {
  40. namespace: import("vue").ComputedRef<string>;
  41. b: (blockSuffix?: string) => string;
  42. e: (element?: string) => string;
  43. m: (modifier?: string) => string;
  44. be: (blockSuffix?: string, element?: string) => string;
  45. em: (element?: string, modifier?: string) => string;
  46. bm: (blockSuffix?: string, modifier?: string) => string;
  47. bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
  48. is: {
  49. (name: string, state: boolean | undefined): string;
  50. (name: string): string;
  51. };
  52. cssVar: (object: Record<string, string>) => Record<string, string>;
  53. cssVarName: (name: string) => string;
  54. cssVarBlock: (object: Record<string, string>) => Record<string, string>;
  55. cssVarBlockName: (name: string) => string;
  56. };
  57. nsInput: {
  58. namespace: import("vue").ComputedRef<string>;
  59. b: (blockSuffix?: string) => string;
  60. e: (element?: string) => string;
  61. m: (modifier?: string) => string;
  62. be: (blockSuffix?: string, element?: string) => string;
  63. em: (element?: string, modifier?: string) => string;
  64. bm: (blockSuffix?: string, modifier?: string) => string;
  65. bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
  66. is: {
  67. (name: string, state: boolean | undefined): string;
  68. (name: string): string;
  69. };
  70. cssVar: (object: Record<string, string>) => Record<string, string>;
  71. cssVarName: (name: string) => string;
  72. cssVarBlock: (object: Record<string, string>) => Record<string, string>;
  73. cssVarBlockName: (name: string) => string;
  74. };
  75. inputRef: import("vue").Ref<HTMLElement | undefined>;
  76. menuRef: import("vue").Ref<SelectDropdownInstance | undefined>;
  77. tagMenuRef: import("vue").Ref<HTMLElement | undefined>;
  78. tooltipRef: import("vue").Ref<TooltipInstance | undefined>;
  79. tagTooltipRef: import("vue").Ref<TooltipInstance | undefined>;
  80. selectRef: import("vue").Ref<HTMLElement | undefined>;
  81. wrapperRef: import("vue").ShallowRef<HTMLElement | undefined>;
  82. selectionRef: import("vue").Ref<HTMLElement | undefined>;
  83. prefixRef: import("vue").Ref<HTMLElement | undefined>;
  84. suffixRef: import("vue").Ref<HTMLElement | undefined>;
  85. collapseItemRef: import("vue").Ref<HTMLElement | undefined>;
  86. popperRef: import("vue").ComputedRef<HTMLElement | undefined>;
  87. validateState: import("vue").ComputedRef<"" | "error" | "success" | "validating">;
  88. validateIcon: import("vue").ComputedRef<any>;
  89. showTagList: import("vue").ComputedRef<Option[]>;
  90. collapseTagList: import("vue").ComputedRef<Option[]>;
  91. debouncedOnInputChange: import("lodash").DebouncedFunc<() => void>;
  92. deleteTag: (event: MouseEvent, option: Option) => void;
  93. getLabel: (option: Option) => any;
  94. getValue: (option: Option) => any;
  95. getDisabled: (option: Option) => any;
  96. getValueKey: (item: unknown) => any;
  97. handleClear: () => void;
  98. handleClickOutside: (event: Event) => void;
  99. handleDel: (e: KeyboardEvent) => void;
  100. handleEsc: () => void;
  101. focus: () => void;
  102. blur: () => void;
  103. handleMenuEnter: () => Promise<void>;
  104. handleResize: () => void;
  105. resetSelectionWidth: () => void;
  106. updateTooltip: () => void;
  107. updateTagTooltip: () => void;
  108. updateOptions: () => void;
  109. toggleMenu: () => void;
  110. scrollTo: (index: number) => void;
  111. onInput: (event: Event) => void;
  112. onKeyboardNavigate: (direction: "forward" | "backward", hoveringIndex?: number | undefined) => void;
  113. onKeyboardSelect: () => void;
  114. onSelect: (option: Option) => void;
  115. onHover: (idx?: number) => void;
  116. handleCompositionStart: (event: CompositionEvent) => void;
  117. handleCompositionEnd: (event: CompositionEvent) => void;
  118. handleCompositionUpdate: (event: CompositionEvent) => void;
  119. };
  120. export default useSelect;