upload.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  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. gap: $spacing-upload_picture_file_card-gap;
  82. margin-bottom: $spacing-upload_picture_file_card-marginBottom;
  83. p {
  84. @include ver-center;
  85. }
  86. }
  87. &-title {
  88. @include font-size-small;
  89. color: $color-upload_assist-text;
  90. &-choosen {
  91. margin-right: $spacing-upload_title_choosen-marginRight;
  92. }
  93. &-clear {
  94. cursor: pointer;
  95. color: $color-upload_clear-text;
  96. }
  97. margin-bottom: $spacing-upload_title-marginBottom;
  98. }
  99. }
  100. &-file-card {
  101. // border: 1px solid $color-upload-border;
  102. border-radius: $radius-upload_file_card;
  103. display: inline-flex;
  104. align-items: center;
  105. justify-content: space-between;
  106. height: $height-upload_file_card;
  107. width: $width-upload_file_card;
  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: 1;
  239. }
  240. .#{$module}-add {
  241. order: 0;
  242. }
  243. }
  244. &[x-prompt-pos="right"] {
  245. .#{$module}-prompt {
  246. order: 1;
  247. }
  248. .#{$module}-add {
  249. order: 0;
  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. display: flex;
  289. align-items: center;
  290. justify-content: center;
  291. height: $height-upload_file_pic_card;
  292. width: $width-upload_file_pic_card;
  293. border-radius: $radius-upload_picture_file_card_img;
  294. position: relative;
  295. overflow: hidden;
  296. img {
  297. height: $width-upload_picture_file_card_img;
  298. width: $width-upload_picture_file_card_img;
  299. object-fit: cover;
  300. border-radius: $radius-upload_picture_file_card_img;
  301. }
  302. &-close {
  303. width: $width-upload_picture_file_card_close;
  304. height: $width-upload_picture_file_card_close;
  305. background-color: $color-upload_pic_remove-bg;
  306. position: absolute;
  307. top: $spacing-upload_picture_file_card_close-top;
  308. right: $spacing-upload_picture_file_card_close-right;
  309. @include all-center;
  310. display: none;
  311. border-radius: $radius-upload_picture_file_card_close;
  312. color: white;
  313. cursor: pointer;
  314. transition: all 0s;
  315. }
  316. &:hover {
  317. .#{$module}-picture-file-card-close {
  318. display: flex;
  319. }
  320. .#{$module}-picture-file-card-replace {
  321. visibility: visible;
  322. }
  323. }
  324. .#{$prefix}-progress-circle {
  325. position: absolute;
  326. top: 50%;
  327. left: 50%;
  328. transform: translate(-50%, -50%);
  329. }
  330. &-retry {
  331. background-color: $color-upload_file_card_retry-bg;
  332. width: $width-upload_file_card_retry;
  333. height: $width-upload_file_card_retry;
  334. position: absolute;
  335. top: 50%;
  336. left: 50%;
  337. transform: translate(-50%, -50%);
  338. color: $color-upload_file_card_retry-text;
  339. border-radius: $radius-upload_file_card_retry;
  340. display: flex;
  341. align-items: center;
  342. justify-content: center;
  343. cursor: pointer;
  344. }
  345. &-icon-retry {
  346. transform: scale(-1, 1);
  347. font-size: $width-upload_file_card_retry-icon;
  348. }
  349. &-replace {
  350. visibility: hidden;
  351. display: inline-flex;
  352. position: absolute;
  353. cursor: pointer;
  354. top: 50%;
  355. left: 50%;
  356. color: $color-upload_replace-text;
  357. transform: translate3D(-50%, -50%, 0);
  358. }
  359. &-pic-info {
  360. display: inline-flex;
  361. box-sizing: border-box;
  362. justify-content: space-between;
  363. align-items: center;
  364. position: absolute;
  365. width: 100%;
  366. height: 24px;
  367. padding: 0 10px;
  368. bottom: 0;
  369. left: 0;
  370. color: $color-upload_picture_file_card_pic_info-text;
  371. font-size: $font-upload_picture_file_card_pic_info-fontSize;
  372. font-weight: $font-upload_picture_file_card_pic_info-fontWeight;
  373. background: linear-gradient(0deg, rgba(22, 22, 26, 0.3) 0%, rgba(22, 22, 26, 0) 77.08%);
  374. }
  375. &-icon-loading,
  376. &-icon-error {
  377. position: absolute;
  378. bottom: $spacing-upload_picture_file_card_loading_error-bottom;
  379. right: $spacing-upload_picture_file_card_loading_error-right;
  380. color: $color-upload_picture_file_card_loading_error-icon;
  381. }
  382. &-icon-loading {
  383. font-size: $width-upload_picture_file_card_loading-icon;
  384. }
  385. &-show-pointer {
  386. cursor: pointer;
  387. }
  388. &-error {
  389. outline: 1px solid $color-upload_picture_file_card_error-border;
  390. }
  391. }
  392. }
  393. &-drag-area {
  394. border-radius: $radius-upload_drag_area;
  395. border: $width-upload_drag_area-border dashed $color-upload-border;
  396. width: 100%;
  397. padding: $spacing-upload_drag_area-padding;
  398. background-color: $color-upload_drag_area-bg;
  399. @include all-center;
  400. flex-direction: column;
  401. cursor: pointer;
  402. &:hover {
  403. background-color: $color-upload_drag_area-bg-hover;
  404. border-color: $color-upload_drag_area-border-hover;
  405. }
  406. &-custom {
  407. border: none;
  408. padding: 0;
  409. background-color: inherit;
  410. &:hover {
  411. background-color: inherit;
  412. }
  413. }
  414. &-legal {
  415. background-color: $color-upload_drag_area-bg-hover;
  416. border-color: $color-upload_drag_area-border-hover;
  417. .#{$module}-drag-area-sub-text {
  418. display: none;
  419. }
  420. }
  421. &-icon {
  422. color: $color-upload_drag_area_icon;
  423. }
  424. &-text {
  425. text-align: center;
  426. }
  427. &-main-text {
  428. cursor: pointer;
  429. @include font-size-regular;
  430. margin-bottom: $spacing-upload_drag_area_main_text-marginBottom;
  431. }
  432. &-sub-text {
  433. cursor: pointer;
  434. @include font-size-small;
  435. }
  436. &-tips {
  437. @include font-size-small;
  438. font-weight: $font-upload_drag_area_tips-fontWeight;
  439. &-legal {
  440. color: $color-upload_drag_area_tips-text;
  441. }
  442. }
  443. }
  444. &-validate-message {
  445. flex-basis: 100%;
  446. flex-shrink: 0;
  447. display: block;
  448. color: $color-upload_file_card_fail_info-text;
  449. }
  450. }
  451. @import "./rtl.scss";