constant.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. var _a;
  2. export var POPTIP_ID = 'gui-poptip';
  3. /**
  4. * 默认类名
  5. */
  6. export var CLASS_NAME = {
  7. CONTAINER: 'gui-poptip',
  8. ARROW: 'gui-poptip-arrow',
  9. TEXT: 'gui-poptip-text',
  10. };
  11. /**
  12. * 默认 style
  13. */
  14. export var POPTIP_STYLE = (_a = {},
  15. // 容器 默认 style
  16. _a[".".concat(CLASS_NAME.CONTAINER)] = {
  17. visibility: 'visible',
  18. position: 'absolute',
  19. 'background-color': 'rgba(0, 0, 0)',
  20. 'box-shadow': '0px 0px 10px #aeaeae',
  21. 'border-radius': '3px',
  22. color: '#fff',
  23. opacity: 0.8,
  24. 'font-size': '12px',
  25. padding: '4px 6px',
  26. display: 'flex',
  27. 'justify-content': 'center',
  28. 'align-items': 'center',
  29. 'z-index': 8,
  30. transition: 'visibility 50ms',
  31. },
  32. // 文本内容 默认 style
  33. _a[".".concat(CLASS_NAME.TEXT)] = {
  34. 'text-align': 'center',
  35. },
  36. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='top']")] = {
  37. transform: "translate(-50%, -100%)",
  38. },
  39. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='left']")] = {
  40. transform: "translate(-100%, -50%)",
  41. },
  42. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='right']")] = {
  43. transform: "translate(0, -50%)",
  44. },
  45. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='bottom']")] = {
  46. transform: "translate(-50%, 0)",
  47. },
  48. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='top-left']")] = {
  49. transform: "translate(0,-100%)",
  50. },
  51. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='top-right']")] = {
  52. transform: "translate(-100%,-100%)",
  53. },
  54. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='left-top']")] = {
  55. transform: "translate(-100%, 0)",
  56. },
  57. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='left-bottom']")] = {
  58. transform: "translate(-100%, -100%)",
  59. },
  60. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='right-top']")] = {
  61. transform: "translate(0, 0)",
  62. },
  63. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='right-bottom']")] = {
  64. transform: "translate(0, -100%)",
  65. },
  66. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='bottom-left']")] = {
  67. transform: "translate(0, 0)",
  68. },
  69. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='bottom-right']")] = {
  70. transform: "translate(-100%, 0)",
  71. },
  72. _a[".".concat(CLASS_NAME.ARROW)] = {
  73. width: '4px',
  74. height: '4px',
  75. transform: 'rotate(45deg)',
  76. 'background-color': 'rgba(0, 0, 0)',
  77. position: 'absolute',
  78. 'z-index': -1,
  79. },
  80. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='top']")] = {
  81. transform: "translate(-50%, calc(-100% - 5px))",
  82. },
  83. _a["[data-position='top'] .".concat(CLASS_NAME.ARROW)] = {
  84. bottom: '-2px',
  85. },
  86. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='left']")] = {
  87. transform: "translate(calc(-100% - 5px), -50%)",
  88. },
  89. _a["[data-position='left'] .".concat(CLASS_NAME.ARROW)] = {
  90. right: '-2px',
  91. },
  92. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='right']")] = {
  93. transform: "translate(5px, -50%)",
  94. },
  95. _a["[data-position='right'] .".concat(CLASS_NAME.ARROW)] = {
  96. left: '-2px',
  97. },
  98. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='bottom']")] = {
  99. transform: "translate(-50%, 5px)",
  100. },
  101. _a["[data-position='bottom'] .".concat(CLASS_NAME.ARROW)] = {
  102. top: '-2px',
  103. },
  104. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='top-left']")] = {
  105. transform: "translate(0, calc(-100% - 5px))",
  106. },
  107. _a["[data-position='top-left'] .".concat(CLASS_NAME.ARROW)] = {
  108. left: '10px',
  109. bottom: '-2px',
  110. },
  111. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='top-right']")] = {
  112. transform: "translate(-100%, calc(-100% - 5px))",
  113. },
  114. _a["[data-position='top-right'] .".concat(CLASS_NAME.ARROW)] = {
  115. right: '10px',
  116. bottom: '-2px',
  117. },
  118. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='left-top']")] = {
  119. transform: "translate(calc(-100% - 5px), 0)",
  120. },
  121. _a["[data-position='left-top'] .".concat(CLASS_NAME.ARROW)] = {
  122. right: '-2px',
  123. top: '8px',
  124. },
  125. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='left-bottom']")] = {
  126. transform: "translate(calc(-100% - 5px), -100%)",
  127. },
  128. _a["[data-position='left-bottom'] .".concat(CLASS_NAME.ARROW)] = {
  129. right: '-2px',
  130. bottom: '8px',
  131. },
  132. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='right-top']")] = {
  133. transform: "translate(5px, 0)",
  134. },
  135. _a["[data-position='right-top'] .".concat(CLASS_NAME.ARROW)] = {
  136. left: '-2px',
  137. top: '8px',
  138. },
  139. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='right-bottom']")] = {
  140. transform: "translate(5px, -100%)",
  141. },
  142. _a["[data-position='right-bottom'] .".concat(CLASS_NAME.ARROW)] = {
  143. left: '-2px',
  144. bottom: '8px',
  145. },
  146. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='bottom-left']")] = {
  147. transform: "translate(0, 5px)",
  148. },
  149. _a["[data-position='bottom-left'] .".concat(CLASS_NAME.ARROW)] = {
  150. top: '-2px',
  151. left: '8px',
  152. },
  153. _a[".".concat(CLASS_NAME.CONTAINER, "[data-position='bottom-right']")] = {
  154. transform: "translate(-100%, 5px)",
  155. },
  156. _a["[data-position='bottom-right'] .".concat(CLASS_NAME.ARROW)] = {
  157. top: '-2px',
  158. right: '8px',
  159. },
  160. _a);
  161. //# sourceMappingURL=constant.js.map