123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654 |
- @use 'mixins/mixins' as *;
- @use 'mixins/utils' as *;
- @use 'common/var' as *;
- @mixin upload-success($color: null) {
- right: -15px;
- top: -6px;
- width: 40px;
- height: 24px;
- background: getCssVar('color-success');
- text-align: center;
- transform: rotate(45deg);
- i {
- font-size: 12px;
- margin-top: 11px;
- transform: rotate(-45deg);
- color: $color;
- }
- }
- @include b(upload) {
- @include set-component-css-var('upload', $upload);
- }
- @include b(upload) {
- @include utils-inline-flex-center;
- cursor: pointer;
- outline: none;
- @include when(disabled) {
- cursor: not-allowed;
- &:focus {
- border-color: getCssVar('border-color', 'darker');
- color: inherit;
- .#{$namespace}-upload-dragger {
- border-color: getCssVar('border-color', 'darker');
- }
- }
- .#{$namespace}-upload-dragger {
- cursor: not-allowed;
- background-color: getCssVar('disabled-bg-color');
- .#{bem('upload', 'text')} {
- color: getCssVar('text-color-placeholder');
- em {
- color: getCssVar('disabled-text-color');
- }
- }
- &:hover {
- border-color: getCssVar('border-color', 'darker');
- }
- }
- }
- @include e(input) {
- display: none;
- }
- @include e(tip) {
- font-size: 12px;
- color: getCssVar('text-color', 'regular');
- margin-top: 7px;
- }
- iframe {
- position: absolute;
- z-index: -1;
- top: 0;
- left: 0;
- opacity: 0;
- filter: alpha(opacity=0);
- }
- /* Picture Card for Wall */
- @include m(picture-card) {
- @include set-css-var-value(('upload', 'picture-card', 'size'), 148px);
- background-color: getCssVar('fill-color', 'lighter');
- border: 1px dashed getCssVar('border-color', 'darker');
- border-radius: 6px;
- box-sizing: border-box;
- width: getCssVar('upload', 'picture-card', 'size');
- height: getCssVar('upload', 'picture-card', 'size');
- cursor: pointer;
- vertical-align: top;
- @include utils-inline-flex-center;
- > i {
- font-size: 28px;
- color: getCssVar('text-color', 'secondary');
- }
- &:hover {
- border-color: getCssVar('color-primary');
- color: getCssVar('color-primary');
- }
- }
- @include when(drag) {
- display: block;
- }
- &:focus {
- border-color: getCssVar('color-primary');
- color: getCssVar('color-primary');
- .#{$namespace}-upload-dragger {
- border-color: getCssVar('color-primary');
- }
- }
- }
- @include b(upload-dragger) {
- padding: getCssVar('upload-dragger-padding-horizontal')
- getCssVar('upload-dragger-padding-vertical');
- background-color: getCssVar('fill-color', 'blank');
- border: 1px dashed getCssVar('border-color');
- border-radius: 6px;
- box-sizing: border-box;
- text-align: center;
- cursor: pointer;
- position: relative;
- overflow: hidden;
- .#{bem('icon', '', 'upload')} {
- font-size: 67px;
- color: getCssVar('text-color', 'placeholder');
- margin-bottom: 16px;
- line-height: 50px;
- }
- + .#{bem('upload', 'tip')} {
- text-align: center;
- }
- ~ .#{bem('upload', 'files')} {
- border-top: getCssVar('border');
- margin-top: 7px;
- padding-top: 5px;
- }
- .#{bem('upload', 'text')} {
- color: getCssVar('text-color', 'regular');
- font-size: 14px;
- text-align: center;
- em {
- color: getCssVar('color-primary');
- font-style: normal;
- }
- }
- &:hover {
- border-color: getCssVar('color-primary');
- }
- @include when(dragover) {
- padding: calc(#{getCssVar('upload-dragger-padding-horizontal')} - 1px)
- calc(#{getCssVar('upload-dragger-padding-vertical')} - 1px);
- background-color: getCssVar('color', 'primary', 'light-9');
- border: 2px dashed getCssVar('color-primary');
- }
- }
- @include b(upload-list) {
- margin: 10px 0 0;
- padding: 0;
- list-style: none;
- position: relative;
- @include e(item) {
- transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
- font-size: 14px;
- color: getCssVar('text-color', 'regular');
- margin-bottom: 5px;
- position: relative;
- box-sizing: border-box;
- border-radius: 4px;
- width: 100%;
- .#{bem('progress')} {
- position: absolute;
- top: 20px;
- width: 100%;
- }
- .#{bem('progress', 'text')} {
- position: absolute;
- right: 0;
- top: -13px;
- }
- .#{bem('progress-bar')} {
- margin-right: 0;
- padding-right: 0;
- }
- & .#{bem('icon', '', 'upload-success')} {
- color: getCssVar('color-success');
- }
- .#{bem('icon', '', 'close')} {
- display: none;
- position: absolute;
- right: 5px;
- top: 50%;
- cursor: pointer;
- opacity: 0.75;
- color: getCssVar('text-color', 'regular');
- transition: opacity getCssVar('transition-duration');
- transform: translateY(-50%);
- &:hover {
- opacity: 1;
- color: getCssVar('color-primary');
- }
- }
- & .#{bem('icon', '', 'close-tip')} {
- display: none;
- position: absolute;
- top: 1px;
- right: 5px;
- font-size: 12px;
- cursor: pointer;
- opacity: 1;
- color: getCssVar('color-primary');
- font-style: normal;
- }
- &:hover {
- background-color: getCssVar('fill-color', 'light');
- .#{bem('icon', '', 'close')} {
- display: inline-flex;
- }
- .#{bem('progress', 'text')} {
- display: none;
- }
- }
- .#{bem('upload-list', 'item-info')} {
- display: inline-flex;
- justify-content: center;
- flex-direction: column;
- width: calc(100% - 30px);
- margin-left: 4px;
- }
- @include when(success) {
- .#{bem('upload-list', 'item-status-label')} {
- display: inline-flex;
- }
- .#{bem('upload-list', 'item-name')}:hover,
- .#{bem('upload-list', 'item-name')}:focus {
- color: getCssVar('color-primary');
- cursor: pointer;
- }
- &:focus:not(:hover) {
- /* 键盘focus */
- .#{bem('icon', '', 'close-tip')} {
- display: inline-block;
- }
- }
- &:not(.focusing):focus,
- &:active {
- /* click时 */
- outline-width: 0;
- .#{bem('icon', '', 'close-tip')} {
- display: none;
- }
- }
- &:hover,
- &:focus {
- .#{bem('upload-list', 'item-status-label')} {
- display: none;
- opacity: 0;
- }
- }
- }
- }
- @include e(item-name) {
- color: getCssVar('text-color', 'regular');
- display: inline-flex;
- text-align: center;
- align-items: center;
- padding: 0 4px;
- transition: color getCssVar('transition-duration');
- font-size: getCssVar('font-size', 'base');
- .#{$namespace}-icon {
- margin-right: 6px;
- color: getCssVar('text-color', 'secondary');
- }
- }
- @include e(item-file-name) {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- @include e(item-status-label) {
- position: absolute;
- right: 5px;
- top: 0;
- line-height: inherit;
- display: none;
- height: 100%;
- justify-content: center;
- align-items: center;
- transition: opacity getCssVar('transition-duration');
- }
- @include e(item-delete) {
- position: absolute;
- right: 10px;
- top: 0;
- font-size: 12px;
- color: getCssVar('text-color', 'regular');
- display: none;
- &:hover {
- color: getCssVar('color-primary');
- }
- }
- // upload-list
- @include m(picture-card) {
- @include set-css-var-value(('upload-list', 'picture-card', 'size'), 148px);
- display: inline-flex;
- flex-wrap: wrap;
- margin: 0;
- .#{bem('upload-list', 'item')} {
- overflow: hidden;
- background-color: getCssVar('fill-color', 'blank');
- border: 1px solid getCssVar('border-color');
- border-radius: 6px;
- box-sizing: border-box;
- width: getCssVar('upload-list', 'picture-card', 'size');
- height: getCssVar('upload-list', 'picture-card', 'size');
- margin: 0 8px 8px 0;
- padding: 0;
- display: inline-flex;
- .#{bem('icon', '' ,'check')},
- .#{bem('icon', '' ,'circle-check')} {
- color: $color-white;
- }
- .#{bem('icon', '', 'close')} {
- display: none;
- }
- &:hover {
- .#{bem('upload-list', 'item-status-label')} {
- opacity: 0;
- // for fade out
- display: block;
- }
- .#{$namespace}-progress__text {
- display: block;
- }
- }
- }
- .#{bem('upload-list', 'item')} {
- .#{bem('upload-list', 'item-name')} {
- display: none;
- }
- }
- .#{bem('upload-list', 'item-thumbnail')} {
- width: 100%;
- height: 100%;
- object-fit: contain;
- }
- .#{bem('upload-list', 'item-status-label')} {
- @include upload-success();
- }
- .#{bem('upload-list', 'item-actions')} {
- position: absolute;
- width: 100%;
- height: 100%;
- left: 0;
- top: 0;
- cursor: default;
- display: inline-flex;
- justify-content: center;
- align-items: center;
- color: #fff;
- opacity: 0;
- font-size: 20px;
- background-color: getCssVar('overlay-color', 'lighter');
- transition: opacity getCssVar('transition-duration');
- span {
- display: none;
- cursor: pointer;
- }
- span + span {
- margin-left: 16px;
- }
- .#{bem('upload-list', 'item-delete')} {
- position: static;
- font-size: inherit;
- color: inherit;
- }
- &:hover {
- opacity: 1;
- span {
- display: inline-flex;
- }
- }
- }
- .#{bem('progress')} {
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- bottom: auto;
- width: 126px;
- .#{$namespace}-progress__text {
- top: 50%;
- }
- }
- }
- @include m(picture) {
- .#{bem('upload-list', 'item')} {
- overflow: hidden;
- z-index: 0;
- background-color: getCssVar('fill-color', 'blank');
- border: 1px solid getCssVar('border-color');
- border-radius: 6px;
- box-sizing: border-box;
- margin-top: 10px;
- padding: 10px;
- display: flex;
- align-items: center;
- .#{bem('icon', '' ,'check')},
- .#{bem('icon', '' ,'circle-check')} {
- color: $color-white;
- }
- &:hover {
- .#{bem('upload-list', 'item-status-label')} {
- opacity: 0;
- display: inline-flex;
- }
- .#{bem('progress', 'text')} {
- display: block;
- }
- }
- &.is-success {
- .#{bem('upload-list', 'item-name')} {
- i {
- display: none;
- }
- }
- }
- & .#{bem('icon', '' ,'close')} {
- top: 5px;
- transform: translateY(0);
- }
- }
- .#{bem('upload-list', 'item-thumbnail')} {
- $item-thumbnail-size: 70px;
- display: inline-flex;
- justify-content: center;
- align-items: center;
- width: $item-thumbnail-size;
- height: $item-thumbnail-size;
- object-fit: contain;
- position: relative;
- z-index: 1;
- background-color: getCssVar('color-white');
- }
- .#{bem('upload-list', 'item-status-label')} {
- position: absolute;
- right: -17px;
- top: -7px;
- width: 46px;
- height: 26px;
- background: getCssVar('color-success');
- text-align: center;
- transform: rotate(45deg);
- i {
- font-size: 12px;
- margin-top: 12px;
- transform: rotate(-45deg);
- }
- }
- .#{$namespace}-progress {
- position: relative;
- top: -7px;
- }
- }
- }
- @include b(upload-cover) {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- overflow: hidden;
- z-index: 10;
- cursor: default;
- @include utils-vertical-center;
- img {
- display: block;
- width: 100%;
- height: 100%;
- }
- @include e(label) {
- @include upload-success(#fff);
- }
- @include e(progress) {
- display: inline-block;
- vertical-align: middle;
- position: static;
- width: 243px;
- + .#{bem('upload', 'inner')} {
- opacity: 0;
- }
- }
- @include e(content) {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- @include e(interact) {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: getCssVar('overlay-color', 'light');
- text-align: center;
- .btn {
- display: inline-block;
- color: $color-white;
- font-size: 14px;
- cursor: pointer;
- vertical-align: middle;
- transition: getCssVar('transition-md-fade');
- margin-top: 60px;
- i {
- margin-top: 0;
- }
- span {
- opacity: 0;
- transition: opacity 0.15s linear;
- }
- &:not(:first-child) {
- margin-left: 35px;
- }
- &:hover {
- transform: translateY(-13px);
- span {
- opacity: 1;
- }
- }
- i {
- color: $color-white;
- display: block;
- font-size: 24px;
- line-height: inherit;
- margin: 0 auto 5px;
- }
- }
- }
- @include e(title) {
- position: absolute;
- bottom: 0;
- left: 0;
- background-color: $color-white;
- height: 36px;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-weight: normal;
- text-align: left;
- padding: 0 10px;
- margin: 0;
- line-height: 36px;
- font-size: 14px;
- color: getCssVar('text-color', 'primary');
- }
- + .#{bem('upload', 'inner')} {
- opacity: 0;
- position: relative;
- z-index: 1;
- }
- }
|