compact-item-vertical.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.genCompactItemVerticalStyle = genCompactItemVerticalStyle;
  6. function compactItemVerticalBorder(token, parentCls, prefixCls) {
  7. return {
  8. // border collapse
  9. [`&-item:not(${parentCls}-last-item)`]: {
  10. marginBottom: token.calc(token.lineWidth).mul(-1).equal()
  11. },
  12. [`&-item:not(${prefixCls}-status-success)`]: {
  13. zIndex: 2
  14. },
  15. '&-item': {
  16. '&:hover,&:focus,&:active': {
  17. zIndex: 3
  18. },
  19. '&[disabled]': {
  20. zIndex: 0
  21. }
  22. }
  23. };
  24. }
  25. function compactItemBorderVerticalRadius(prefixCls, parentCls) {
  26. return {
  27. [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: {
  28. borderRadius: 0
  29. },
  30. [`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: {
  31. [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
  32. borderEndEndRadius: 0,
  33. borderEndStartRadius: 0
  34. }
  35. },
  36. [`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: {
  37. [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
  38. borderStartStartRadius: 0,
  39. borderStartEndRadius: 0
  40. }
  41. }
  42. };
  43. }
  44. function genCompactItemVerticalStyle(token) {
  45. const compactCls = `${token.componentCls}-compact-vertical`;
  46. return {
  47. [compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls, token.componentCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
  48. };
  49. }