compact-item-vertical.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. function compactItemVerticalBorder(token, parentCls) {
  3. return {
  4. // border collapse
  5. [`&-item:not(${parentCls}-last-item)`]: {
  6. marginBottom: -token.lineWidth
  7. },
  8. '&-item': {
  9. '&:hover,&:focus,&:active': {
  10. zIndex: 2
  11. },
  12. '&[disabled]': {
  13. zIndex: 0
  14. }
  15. }
  16. };
  17. }
  18. function compactItemBorderVerticalRadius(prefixCls, parentCls) {
  19. return {
  20. [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: {
  21. borderRadius: 0
  22. },
  23. [`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: {
  24. [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
  25. borderEndEndRadius: 0,
  26. borderEndStartRadius: 0
  27. }
  28. },
  29. [`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: {
  30. [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
  31. borderStartStartRadius: 0,
  32. borderStartEndRadius: 0
  33. }
  34. }
  35. };
  36. }
  37. export function genCompactItemVerticalStyle(token) {
  38. const compactCls = `${token.componentCls}-compact-vertical`;
  39. return {
  40. [compactCls]: _extends(_extends({}, compactItemVerticalBorder(token, compactCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
  41. };
  42. }