upload.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. @import "./variables.scss";
  2. $module: #{$prefix}-upload;
  3. .#{$module} {
  4. display: flex;
  5. flex-wrap: wrap;
  6. &-disabled {
  7. cursor: not-allowed;
  8. .#{$module}-file-card {
  9. cursor: not-allowed;
  10. &-close {
  11. cursor: not-allowed;
  12. }
  13. }
  14. .#{$module}-drag-area {
  15. border: none;
  16. cursor: not-allowed;
  17. &:hover {
  18. background-color: $color-upload_drag_area-bg;
  19. }
  20. &-main-text,
  21. &-sub-text,
  22. &-icon {
  23. cursor: not-allowed;
  24. color: $color-upload_drag_area_disabled-text;
  25. }
  26. }
  27. }
  28. &-hidden-input {
  29. display: none;
  30. }
  31. &-hidden-input-replace {
  32. display: none;
  33. }
  34. &-add {
  35. display: flex;
  36. align-items: center;
  37. }
  38. &[x-prompt-pos="right"] {
  39. .#{$module}-add {
  40. display: inline-flex;
  41. }
  42. .#{$module}-prompt {
  43. display: inline-flex;
  44. }
  45. }
  46. &[x-prompt-pos="bottom"] {
  47. .#{$module}-add {
  48. display: flex;
  49. }
  50. .#{$module}-prompt {
  51. display: flex;
  52. flex-basis: 100%;
  53. }
  54. .#{$module}-file-list {
  55. flex-basis: 100%;
  56. }
  57. }
  58. &[x-prompt-pos="left"] {
  59. .#{$module}-add {
  60. display: inline-flex;
  61. order: 2;
  62. }
  63. .#{$module}-prompt {
  64. display: inline-flex;
  65. order: 1;
  66. }
  67. .#{$module}-file-list {
  68. order: 2;
  69. }
  70. }
  71. &-file-list {
  72. flex-basis: 100%;
  73. flex-shrink: 0;
  74. display: block;
  75. margin-top: $spacing-tight;
  76. margin-bottom: $spacing-tight;
  77. &-main {
  78. display: flex;
  79. flex-wrap: wrap;
  80. flex-shrink: 0;
  81. p {
  82. @include ver-center;
  83. }
  84. }
  85. &-title {
  86. @include font-size-small;
  87. color: $color-upload_assist-text;
  88. &-choosen {
  89. margin-right: $spacing-upload_title_choosen-marginRight;
  90. }
  91. &-clear {
  92. cursor: pointer;
  93. color: $color-upload_clear-text;
  94. }
  95. margin-bottom: $spacing-upload_title-marginBottom;
  96. }
  97. }
  98. &-file-card {
  99. // border: 1px solid $color-upload-border;
  100. border-radius: $radius-upload_file_card;
  101. display: inline-flex;
  102. align-items: center;
  103. justify-content: space-between;
  104. height: $height-upload_file_card;
  105. width: $width-upload_file_card;
  106. margin-right: $spacing-tight;
  107. margin-bottom: $spacing-tight;
  108. background-color: $color-upload_card-bg;
  109. cursor: pointer;
  110. &:hover {
  111. background-color: $color-upload_card-bg-hover;
  112. }
  113. a {
  114. text-decoration: none;
  115. // color: inherit;
  116. }
  117. &-preview {
  118. height: $height-upload_file_card_preview;
  119. width: $width-upload_file_card_preview;
  120. color: $color-upload_preview-icon;
  121. margin: $spacing-upload_file_card_preview-margin;
  122. @include all-center;
  123. border-radius: $radius-upload_file_card_preview;
  124. flex-shrink: 0;
  125. img {
  126. width: $width-upload_file_card_preview_img;
  127. height: $width-upload_file_card_preview_img;
  128. object-fit: cover;
  129. }
  130. }
  131. &-preview-placeholder {
  132. background-color: $color-upload_file_card_preview_placeholder-bg;
  133. color: $color-upload_file_card_preview_placeholder-text;
  134. }
  135. &-show-pointer {
  136. cursor: pointer;
  137. }
  138. &-info {
  139. display: flex;
  140. align-items: center;
  141. &-main {
  142. display: flex;
  143. flex-wrap: wrap;
  144. flex: 1;
  145. &-text {
  146. @include ver-center;
  147. flex-basis: 100%;
  148. }
  149. &-control {
  150. display: flex;
  151. }
  152. }
  153. &-name {
  154. // width: $width-upload_file_card_info_name;
  155. width: 0;
  156. flex: 1;
  157. overflow: hidden;
  158. text-overflow: ellipsis;
  159. white-space: nowrap;
  160. display: inline-block;
  161. @include font-size-regular;
  162. font-weight: $font-upload_file_card_info_name-fontWeight;
  163. color: $color-upload-text;
  164. }
  165. &-size {
  166. @include font-size-small;
  167. font-weight: $font-upload_file_card_info_size-fontWeight;
  168. margin-left: $spacing-upload_file_card_info_size-marginLeft;
  169. color: $color-upload_assist-text;
  170. margin-top: 1px;
  171. }
  172. &-replace {
  173. display: inline-flex;
  174. margin-left: $spacing-tight;
  175. color: var(--semi-color-text-2);
  176. }
  177. &-validate-message {
  178. @include font-size-small;
  179. @include ver-center;
  180. color: $color-upload-text;
  181. }
  182. &-retry {
  183. @include font-size-small;
  184. color: $color-upload_retry-text;
  185. cursor: pointer;
  186. margin-left: $spacing-upload_file_card_info_retry-marginLeft;
  187. }
  188. .#{$prefix}-progress {
  189. flex-basis: 100%;
  190. margin-top: $spacing-upload_file_card_info_progress-marginTop;
  191. }
  192. }
  193. &-close {
  194. margin-left: $spacing-upload_file_card_close-marginLeft;
  195. margin-right: $spacing-upload_file_card_close-marginRight;
  196. flex-shrink: 0;
  197. }
  198. &-replace {
  199. margin-left: $spacing-tight;
  200. width: 24px;
  201. flex-shrink: 0;
  202. }
  203. &-icon {
  204. &-loading,
  205. &-error {
  206. font-size: $width-upload_file_card-icon;
  207. margin-right: $spacing-upload_file_card_icon-marginRight;
  208. }
  209. &-error {
  210. position: relative;
  211. top: $spacing-upload_picture_file_card_icon_error-top;
  212. }
  213. &-loading {
  214. .#{$prefix}-spin-wrapper svg {
  215. height: $width-upload_file_card-icon;
  216. width: $width-upload_file_card-icon;
  217. }
  218. }
  219. }
  220. &-fail {
  221. background-color: $color-upload_card_fail-bg;
  222. &:hover {
  223. background-color: $color-upload_card_fail-bg-hover;
  224. }
  225. .#{$module}-file-card {
  226. &-info-validate-message {
  227. color: $color-upload_file_card_fail_info-text;
  228. }
  229. }
  230. }
  231. }
  232. // listType = 'picture'
  233. &-picture {
  234. display: flex;
  235. &[x-prompt-pos="bottom"] {
  236. flex-direction: column;
  237. .#{$module}-prompt {
  238. order: 2;
  239. }
  240. .#{$module}-add {
  241. order: 1;
  242. }
  243. }
  244. &[x-prompt-pos="right"] {
  245. .#{$module}-prompt {
  246. order: 2;
  247. }
  248. .#{$module}-add {
  249. order: 1;
  250. }
  251. }
  252. &-add {
  253. background-color: $color-upload_pic_add-bg;
  254. height: $height-upload_file_pic_card;
  255. width: $width-upload_file_pic_card;
  256. box-sizing: border-box;
  257. display: inline-flex;
  258. justify-content: center;
  259. align-items: center;
  260. border: $width-upload_picture_add-border dashed $color-upload-border;
  261. color: $color-upload-icon;
  262. border-radius: $radius-upload_picture_add;
  263. order: 2;
  264. cursor: pointer;
  265. &:hover {
  266. background-color: $color-upload_pic_add-bg-hover;
  267. }
  268. &:active {
  269. background-color: $color-upload_pic_add-bg-active;
  270. }
  271. }
  272. &-add-disabled {
  273. cursor: not-allowed;
  274. &:hover {
  275. background-color: $color-upload_pic_add-bg;
  276. }
  277. &:active {
  278. background-color: $color-upload_pic_add-bg;
  279. }
  280. }
  281. &-file-list {
  282. flex-basis: inherit;
  283. margin-top: 0;
  284. margin-bottom: 0;
  285. // width: 100%;
  286. }
  287. &-file-card {
  288. height: $height-upload_file_pic_card;
  289. width: $width-upload_file_pic_card;
  290. position: relative;
  291. margin-right: $spacing-upload_picture_file_card-marginRight;
  292. margin-bottom: $spacing-upload_picture_file_card-marginBottom;
  293. img {
  294. height: $width-upload_picture_file_card_img;
  295. width: $width-upload_picture_file_card_img;
  296. object-fit: cover;
  297. border-radius: $radius-upload_picture_file_card_img;
  298. }
  299. &-close {
  300. width: $width-upload_picture_file_card_close;
  301. height: $width-upload_picture_file_card_close;
  302. background-color: $color-upload_pic_remove-bg;
  303. position: absolute;
  304. top: $spacing-upload_picture_file_card_close-top;
  305. right: $spacing-upload_picture_file_card_close-right;
  306. @include all-center;
  307. display: none;
  308. border-radius: $radius-upload_picture_file_card_close;
  309. color: white;
  310. cursor: pointer;
  311. transition: all 0s;
  312. }
  313. &:hover {
  314. .#{$module}-picture-file-card-close {
  315. display: flex;
  316. }
  317. .#{$module}-picture-file-card-replace {
  318. visibility: visible;
  319. }
  320. }
  321. .#{$prefix}-progress-circle {
  322. position: absolute;
  323. top: 50%;
  324. left: 50%;
  325. transform: translate(-50%, -50%);
  326. }
  327. &-retry {
  328. background-color: $color-upload_file_card_retry-bg;
  329. width: $width-upload_file_card_retry;
  330. height: $width-upload_file_card_retry;
  331. position: absolute;
  332. top: 50%;
  333. left: 50%;
  334. transform: translate(-50%, -50%);
  335. color: $color-upload_file_card_retry-text;
  336. border-radius: $radius-upload_file_card_retry;
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. cursor: pointer;
  341. }
  342. &-icon-retry {
  343. transform: scale(-1, 1);
  344. font-size: $width-upload_file_card_retry-icon;
  345. }
  346. &-replace {
  347. visibility: hidden;
  348. display: inline-flex;
  349. position: absolute;
  350. cursor: pointer;
  351. top: 50%;
  352. left: 50%;
  353. color: $color-upload_replace-text;
  354. transform: translate3D(-50%, -50%, 0);
  355. }
  356. &-icon-loading,
  357. &-icon-error {
  358. position: absolute;
  359. bottom: $spacing-upload_picture_file_card_loading_error-bottom;
  360. right: $spacing-upload_picture_file_card_loading_error-right;
  361. color: $color-upload_picture_file_card_loading_error-icon;
  362. }
  363. &-icon-loading {
  364. font-size: $width-upload_picture_file_card_loading-icon;
  365. }
  366. &-show-pointer {
  367. cursor: pointer;
  368. }
  369. }
  370. }
  371. &-drag-area {
  372. border-radius: $radius-upload_drag_area;
  373. border: $width-upload_drag_area-border dashed $color-upload-border;
  374. width: 100%;
  375. padding: $spacing-upload_drag_area-padding;
  376. background-color: $color-upload_drag_area-bg;
  377. @include all-center;
  378. flex-direction: column;
  379. cursor: pointer;
  380. &:hover {
  381. background-color: $color-upload_drag_area-bg-hover;
  382. border-color: $color-upload_drag_area-border-hover;
  383. }
  384. &-custom {
  385. border: none;
  386. padding: 0;
  387. background-color: inherit;
  388. &:hover {
  389. background-color: inherit;
  390. }
  391. }
  392. &-legal {
  393. background-color: $color-upload_drag_area-bg-hover;
  394. border-color: $color-upload_drag_area-border-hover;
  395. .#{$module}-drag-area-sub-text {
  396. display: none;
  397. }
  398. }
  399. &-icon {
  400. color: $color-upload_drag_area_icon;
  401. }
  402. &-text {
  403. text-align: center;
  404. }
  405. &-main-text {
  406. cursor: pointer;
  407. @include font-size-regular;
  408. margin-bottom: $spacing-upload_drag_area_main_text-marginBottom;
  409. }
  410. &-sub-text {
  411. cursor: pointer;
  412. @include font-size-small;
  413. }
  414. &-tips {
  415. @include font-size-small;
  416. font-weight: $font-upload_drag_area_tips-fontWeight;
  417. &-legal {
  418. color: $color-upload_drag_area_tips-text;
  419. }
  420. }
  421. }
  422. &-validate-message {
  423. flex-basis: 100%;
  424. flex-shrink: 0;
  425. display: block;
  426. color: $color-upload_file_card_fail_info-text;
  427. }
  428. }
  429. @import "./rtl.scss";