constant.js 3.7 KB

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