columns.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _cssinjs = require("@ant-design/cssinjs");
  7. var _style = require("../../checkbox/style");
  8. var _style2 = require("../../style");
  9. const getColumnsStyle = token => {
  10. const {
  11. prefixCls,
  12. componentCls
  13. } = token;
  14. const cascaderMenuItemCls = `${componentCls}-menu-item`;
  15. const iconCls = `
  16. &${cascaderMenuItemCls}-expand ${cascaderMenuItemCls}-expand-icon,
  17. ${cascaderMenuItemCls}-loading-icon
  18. `;
  19. return [
  20. // ==================== Checkbox ====================
  21. (0, _style.getStyle)(`${prefixCls}-checkbox`, token), {
  22. [componentCls]: {
  23. // ================== Checkbox ==================
  24. '&-checkbox': {
  25. top: 0,
  26. marginInlineEnd: token.paddingXS,
  27. pointerEvents: 'unset'
  28. },
  29. // ==================== Menu ====================
  30. // >>> Menus
  31. '&-menus': {
  32. display: 'flex',
  33. flexWrap: 'nowrap',
  34. alignItems: 'flex-start',
  35. [`&${componentCls}-menu-empty`]: {
  36. [`${componentCls}-menu`]: {
  37. width: '100%',
  38. height: 'auto',
  39. [cascaderMenuItemCls]: {
  40. color: token.colorTextDisabled
  41. }
  42. }
  43. }
  44. },
  45. // >>> Menu
  46. '&-menu': {
  47. flexGrow: 1,
  48. flexShrink: 0,
  49. minWidth: token.controlItemWidth,
  50. height: token.dropdownHeight,
  51. margin: 0,
  52. padding: token.menuPadding,
  53. overflow: 'auto',
  54. verticalAlign: 'top',
  55. listStyle: 'none',
  56. '-ms-overflow-style': '-ms-autohiding-scrollbar',
  57. // https://github.com/ant-design/ant-design/issues/11857
  58. '&:not(:last-child)': {
  59. borderInlineEnd: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
  60. },
  61. '&-item': Object.assign(Object.assign({}, _style2.textEllipsis), {
  62. display: 'flex',
  63. flexWrap: 'nowrap',
  64. alignItems: 'center',
  65. padding: token.optionPadding,
  66. lineHeight: token.lineHeight,
  67. cursor: 'pointer',
  68. transition: `all ${token.motionDurationMid}`,
  69. borderRadius: token.borderRadiusSM,
  70. '&:hover': {
  71. background: token.controlItemBgHover
  72. },
  73. '&-disabled': {
  74. color: token.colorTextDisabled,
  75. cursor: 'not-allowed',
  76. '&:hover': {
  77. background: 'transparent'
  78. },
  79. [iconCls]: {
  80. color: token.colorTextDisabled
  81. }
  82. },
  83. [`&-active:not(${cascaderMenuItemCls}-disabled)`]: {
  84. '&, &:hover': {
  85. color: token.optionSelectedColor,
  86. fontWeight: token.optionSelectedFontWeight,
  87. backgroundColor: token.optionSelectedBg
  88. }
  89. },
  90. '&-content': {
  91. flex: 'auto'
  92. },
  93. [iconCls]: {
  94. marginInlineStart: token.paddingXXS,
  95. color: token.colorIcon,
  96. fontSize: token.fontSizeIcon
  97. },
  98. '&-keyword': {
  99. color: token.colorHighlight
  100. }
  101. })
  102. }
  103. }
  104. }];
  105. };
  106. var _default = exports.default = getColumnsStyle;