html.d.ts 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. import HtmlComponent from '../abstract/html-component';
  2. import { Point, PointLocationCfg } from '../types';
  3. import { TooltipCfg } from '../types';
  4. import { ILocation } from '../interfaces';
  5. declare class Tooltip<T extends TooltipCfg = TooltipCfg> extends HtmlComponent implements ILocation<PointLocationCfg> {
  6. getDefaultCfg(): {
  7. name: string;
  8. type: string;
  9. x: number;
  10. y: number;
  11. items: any[];
  12. customContent: any;
  13. containerTpl: string;
  14. itemTpl: string;
  15. xCrosshairTpl: string;
  16. yCrosshairTpl: string;
  17. title: any;
  18. showTitle: boolean;
  19. /**
  20. * tooltip 限制的区域
  21. * @type {Region}
  22. */
  23. region: any;
  24. crosshairsRegion: any;
  25. containerClassName: string;
  26. crosshairs: any;
  27. offset: number;
  28. position: string;
  29. domStyles: any;
  30. defaultStyles: {
  31. [x: string]: {
  32. position: string;
  33. visibility: string;
  34. zIndex: number;
  35. transition: string;
  36. backgroundColor: string;
  37. boxShadow: string;
  38. borderRadius: string;
  39. color: string;
  40. fontSize: string;
  41. fontFamily: string;
  42. lineHeight: string;
  43. padding: string;
  44. marginBottom?: undefined;
  45. margin?: undefined;
  46. listStyleType?: undefined;
  47. width?: undefined;
  48. height?: undefined;
  49. display?: undefined;
  50. marginRight?: undefined;
  51. float?: undefined;
  52. marginLeft?: undefined;
  53. } | {
  54. marginBottom: string;
  55. position?: undefined;
  56. visibility?: undefined;
  57. zIndex?: undefined;
  58. transition?: undefined;
  59. backgroundColor?: undefined;
  60. boxShadow?: undefined;
  61. borderRadius?: undefined;
  62. color?: undefined;
  63. fontSize?: undefined;
  64. fontFamily?: undefined;
  65. lineHeight?: undefined;
  66. padding?: undefined;
  67. margin?: undefined;
  68. listStyleType?: undefined;
  69. width?: undefined;
  70. height?: undefined;
  71. display?: undefined;
  72. marginRight?: undefined;
  73. float?: undefined;
  74. marginLeft?: undefined;
  75. } | {
  76. margin: string;
  77. listStyleType: string;
  78. padding: string;
  79. position?: undefined;
  80. visibility?: undefined;
  81. zIndex?: undefined;
  82. transition?: undefined;
  83. backgroundColor?: undefined;
  84. boxShadow?: undefined;
  85. borderRadius?: undefined;
  86. color?: undefined;
  87. fontSize?: undefined;
  88. fontFamily?: undefined;
  89. lineHeight?: undefined;
  90. marginBottom?: undefined;
  91. width?: undefined;
  92. height?: undefined;
  93. display?: undefined;
  94. marginRight?: undefined;
  95. float?: undefined;
  96. marginLeft?: undefined;
  97. } | {
  98. listStyleType: string;
  99. marginBottom: string;
  100. position?: undefined;
  101. visibility?: undefined;
  102. zIndex?: undefined;
  103. transition?: undefined;
  104. backgroundColor?: undefined;
  105. boxShadow?: undefined;
  106. borderRadius?: undefined;
  107. color?: undefined;
  108. fontSize?: undefined;
  109. fontFamily?: undefined;
  110. lineHeight?: undefined;
  111. padding?: undefined;
  112. margin?: undefined;
  113. width?: undefined;
  114. height?: undefined;
  115. display?: undefined;
  116. marginRight?: undefined;
  117. float?: undefined;
  118. marginLeft?: undefined;
  119. } | {
  120. width: string;
  121. height: string;
  122. borderRadius: string;
  123. display: string;
  124. marginRight: string;
  125. position?: undefined;
  126. visibility?: undefined;
  127. zIndex?: undefined;
  128. transition?: undefined;
  129. backgroundColor?: undefined;
  130. boxShadow?: undefined;
  131. color?: undefined;
  132. fontSize?: undefined;
  133. fontFamily?: undefined;
  134. lineHeight?: undefined;
  135. padding?: undefined;
  136. marginBottom?: undefined;
  137. margin?: undefined;
  138. listStyleType?: undefined;
  139. float?: undefined;
  140. marginLeft?: undefined;
  141. } | {
  142. display: string;
  143. float: string;
  144. marginLeft: string;
  145. position?: undefined;
  146. visibility?: undefined;
  147. zIndex?: undefined;
  148. transition?: undefined;
  149. backgroundColor?: undefined;
  150. boxShadow?: undefined;
  151. borderRadius?: undefined;
  152. color?: undefined;
  153. fontSize?: undefined;
  154. fontFamily?: undefined;
  155. lineHeight?: undefined;
  156. padding?: undefined;
  157. marginBottom?: undefined;
  158. margin?: undefined;
  159. listStyleType?: undefined;
  160. width?: undefined;
  161. height?: undefined;
  162. marginRight?: undefined;
  163. } | {
  164. position: string;
  165. width: string;
  166. backgroundColor: string;
  167. visibility?: undefined;
  168. zIndex?: undefined;
  169. transition?: undefined;
  170. boxShadow?: undefined;
  171. borderRadius?: undefined;
  172. color?: undefined;
  173. fontSize?: undefined;
  174. fontFamily?: undefined;
  175. lineHeight?: undefined;
  176. padding?: undefined;
  177. marginBottom?: undefined;
  178. margin?: undefined;
  179. listStyleType?: undefined;
  180. height?: undefined;
  181. display?: undefined;
  182. marginRight?: undefined;
  183. float?: undefined;
  184. marginLeft?: undefined;
  185. } | {
  186. position: string;
  187. height: string;
  188. backgroundColor: string;
  189. visibility?: undefined;
  190. zIndex?: undefined;
  191. transition?: undefined;
  192. boxShadow?: undefined;
  193. borderRadius?: undefined;
  194. color?: undefined;
  195. fontSize?: undefined;
  196. fontFamily?: undefined;
  197. lineHeight?: undefined;
  198. padding?: undefined;
  199. marginBottom?: undefined;
  200. margin?: undefined;
  201. listStyleType?: undefined;
  202. width?: undefined;
  203. display?: undefined;
  204. marginRight?: undefined;
  205. float?: undefined;
  206. marginLeft?: undefined;
  207. };
  208. };
  209. container: any;
  210. updateAutoRender: boolean;
  211. parent: any;
  212. id: string;
  213. locationType: string;
  214. offsetX: number;
  215. offsetY: number;
  216. animate: boolean;
  217. capture: boolean;
  218. animateOption: {
  219. appear: any;
  220. update: {
  221. duration: number;
  222. easing: string;
  223. };
  224. enter: {
  225. duration: number;
  226. easing: string;
  227. };
  228. leave: {
  229. duration: number;
  230. easing: string;
  231. };
  232. };
  233. events: any;
  234. defaultCfg: {};
  235. visible: boolean;
  236. };
  237. render(): void;
  238. clear(): void;
  239. show(): void;
  240. hide(): void;
  241. getLocation(): {
  242. x: any;
  243. y: any;
  244. };
  245. setLocation(point: Point): void;
  246. setCrossHairsVisible(visible: any): void;
  247. protected initContainer(): void;
  248. protected updateInner(cfg: Partial<T>): void;
  249. protected initDom(): void;
  250. protected removeDom(): void;
  251. protected resetPosition(): void;
  252. private renderCustomContent;
  253. private getHtmlContentNode;
  254. private cacheDoms;
  255. private resetTitle;
  256. private setTitle;
  257. private resetCrosshairs;
  258. private resetCrosshair;
  259. private checkCrosshair;
  260. private renderItems;
  261. private clearItemDoms;
  262. private clearCrosshairs;
  263. }
  264. export default Tooltip;