constant.js 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import { __assign } from "tslib";
  2. export function getClassNames(prefixCls) {
  3. if (prefixCls === void 0) { prefixCls = ''; }
  4. return {
  5. CONTAINER: "".concat(prefixCls, "tooltip"),
  6. TITLE: "".concat(prefixCls, "tooltip-title"),
  7. LIST: "".concat(prefixCls, "tooltip-list"),
  8. LIST_ITEM: "".concat(prefixCls, "tooltip-list-item"),
  9. NAME: "".concat(prefixCls, "tooltip-list-item-name"),
  10. MARKER: "".concat(prefixCls, "tooltip-list-item-marker"),
  11. NAME_LABEL: "".concat(prefixCls, "tooltip-list-item-name-label"),
  12. VALUE: "".concat(prefixCls, "tooltip-list-item-value"),
  13. CROSSHAIR_X: "".concat(prefixCls, "tooltip-crosshair-x"),
  14. CROSSHAIR_Y: "".concat(prefixCls, "tooltip-crosshair-y"),
  15. };
  16. }
  17. var TEXT_OVERFLOW_STYLE = {
  18. overflow: 'hidden',
  19. 'white-space': 'nowrap',
  20. 'text-overflow': 'ellipsis',
  21. };
  22. export function getDefaultTooltipStyle(prefixCls) {
  23. var _a;
  24. if (prefixCls === void 0) { prefixCls = ''; }
  25. var CLASS_NAME = getClassNames(prefixCls);
  26. return _a = {},
  27. _a[".".concat(CLASS_NAME.CONTAINER)] = {
  28. position: 'absolute',
  29. visibility: 'visible',
  30. // 'white-space': 'nowrap',
  31. 'z-index': 8,
  32. transition: 'visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), ' +
  33. 'left 0.4s cubic-bezier(0.23, 1, 0.32, 1), ' +
  34. 'top 0.4s cubic-bezier(0.23, 1, 0.32, 1)',
  35. 'background-color': 'rgba(255, 255, 255, 0.96)',
  36. 'box-shadow': '0 6px 12px 0 rgba(0, 0, 0, 0.12)',
  37. 'border-radius': '4px',
  38. color: 'rgba(0, 0, 0, 0.65)',
  39. 'font-size': '12px',
  40. // 'font-family': ,
  41. 'line-height': '20px',
  42. padding: '12px',
  43. 'min-width': '120px',
  44. 'max-width': '360px',
  45. 'font-family': 'Roboto-Regular',
  46. },
  47. _a[".".concat(CLASS_NAME.TITLE)] = {
  48. color: 'rgba(0, 0, 0, 0.45)',
  49. },
  50. _a[".".concat(CLASS_NAME.LIST)] = {
  51. margin: '0px',
  52. 'list-style-type': 'none',
  53. padding: '0px',
  54. },
  55. _a[".".concat(CLASS_NAME.LIST_ITEM)] = {
  56. 'list-style-type': 'none',
  57. display: 'flex',
  58. 'line-height': '2em',
  59. 'align-items': 'center',
  60. 'justify-content': 'space-between',
  61. 'white-space': 'nowrap',
  62. },
  63. _a[".".concat(CLASS_NAME.MARKER)] = {
  64. width: '8px',
  65. height: '8px',
  66. 'border-radius': '50%',
  67. display: 'inline-block',
  68. 'margin-right': '4px',
  69. },
  70. _a[".".concat(CLASS_NAME.NAME)] = {
  71. display: 'flex',
  72. 'align-items': 'center',
  73. 'max-width': '216px',
  74. },
  75. _a[".".concat(CLASS_NAME.NAME_LABEL)] = __assign({ flex: 1 }, TEXT_OVERFLOW_STYLE),
  76. _a[".".concat(CLASS_NAME.VALUE)] = __assign({ display: 'inline-block', float: 'right', flex: 1, 'text-align': 'right', 'min-width': '28px', 'margin-left': '30px', color: 'rgba(0, 0, 0, 0.85)' }, TEXT_OVERFLOW_STYLE),
  77. _a[".".concat(CLASS_NAME.CROSSHAIR_X)] = {
  78. position: 'absolute',
  79. width: '1px',
  80. 'background-color': 'rgba(0, 0, 0, 0.25)',
  81. },
  82. _a[".".concat(CLASS_NAME.CROSSHAIR_Y)] = {
  83. position: 'absolute',
  84. height: '1px',
  85. 'background-color': 'rgba(0, 0, 0, 0.25)',
  86. },
  87. _a;
  88. }
  89. //# sourceMappingURL=constant.js.map