dragger.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. const genDraggerStyle = token => {
  7. const {
  8. componentCls,
  9. iconCls
  10. } = token;
  11. return {
  12. [`${componentCls}-wrapper`]: {
  13. [`${componentCls}-drag`]: {
  14. position: 'relative',
  15. width: '100%',
  16. height: '100%',
  17. textAlign: 'center',
  18. background: token.colorFillAlter,
  19. border: `${token.lineWidth}px dashed ${token.colorBorder}`,
  20. borderRadius: token.borderRadiusLG,
  21. cursor: 'pointer',
  22. transition: `border-color ${token.motionDurationSlow}`,
  23. [componentCls]: {
  24. padding: `${token.padding}px 0`
  25. },
  26. [`${componentCls}-btn`]: {
  27. display: 'table',
  28. width: '100%',
  29. height: '100%',
  30. outline: 'none'
  31. },
  32. [`${componentCls}-drag-container`]: {
  33. display: 'table-cell',
  34. verticalAlign: 'middle'
  35. },
  36. [`&:not(${componentCls}-disabled):hover`]: {
  37. borderColor: token.colorPrimaryHover
  38. },
  39. [`p${componentCls}-drag-icon`]: {
  40. marginBottom: token.margin,
  41. [iconCls]: {
  42. color: token.colorPrimary,
  43. fontSize: token.uploadThumbnailSize
  44. }
  45. },
  46. [`p${componentCls}-text`]: {
  47. margin: `0 0 ${token.marginXXS}px`,
  48. color: token.colorTextHeading,
  49. fontSize: token.fontSizeLG
  50. },
  51. [`p${componentCls}-hint`]: {
  52. color: token.colorTextDescription,
  53. fontSize: token.fontSize
  54. },
  55. // ===================== Disabled =====================
  56. [`&${componentCls}-disabled`]: {
  57. cursor: 'not-allowed',
  58. [`p${componentCls}-drag-icon ${iconCls},
  59. p${componentCls}-text,
  60. p${componentCls}-hint
  61. `]: {
  62. color: token.colorTextDisabled
  63. }
  64. }
  65. }
  66. }
  67. };
  68. };
  69. var _default = exports.default = genDraggerStyle;