modal.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. /**Variable**/
  2. @import './helpers/mixin.scss';
  3. .vxe-modal--wrapper {
  4. display: none;
  5. position: fixed;
  6. top: 0;
  7. left: 0;
  8. line-height: 1.5;
  9. width: calc(100% + 18px);
  10. height: calc(100% + 18px);
  11. color: $vxe-font-color;
  12. font-family: $vxe-font-family;
  13. transition: top .4s ease-in-out;
  14. &.is--active {
  15. display: block;
  16. }
  17. &.is--visible {
  18. &.is--mask {
  19. &:before {
  20. background-color: rgba(0, 0, 0, 0.5);
  21. }
  22. }
  23. &.type--message {
  24. .vxe-modal--box {
  25. opacity: 1;
  26. transform: translateY(0);
  27. }
  28. }
  29. .vxe-modal--box {
  30. opacity: 1;
  31. visibility: visible;
  32. }
  33. }
  34. &.is--loading {
  35. .vxe-modal--header,
  36. .vxe-modal--footer {
  37. position: relative;
  38. border-bottom-color: $vxe-loading-background-color;
  39. &:before {
  40. content: "";
  41. position: absolute;
  42. top: 0;
  43. left: 0;
  44. width: 100%;
  45. height: 100%;
  46. z-index: 1;
  47. user-select: none;
  48. background-color: $vxe-loading-background-color;
  49. }
  50. }
  51. }
  52. &:not(.lock--view) {
  53. pointer-events: none;
  54. }
  55. &:not(.type--message) {
  56. &.lock--scroll {
  57. overflow: hidden;
  58. }
  59. &:not(.lock--scroll) {
  60. overflow: auto;
  61. }
  62. }
  63. &.lock--view,
  64. &.is--mask {
  65. &:before {
  66. content: "";
  67. position: fixed;
  68. top: 0;
  69. left: 0;
  70. width: 100%;
  71. height: 100%;
  72. z-index: -1;
  73. pointer-events: auto;
  74. }
  75. }
  76. &.is--mask {
  77. &:before {
  78. background-color: rgba(0, 0, 0, 0);
  79. }
  80. }
  81. &.is--animat {
  82. &.is--mask {
  83. &:before {
  84. @include animatTransition(background-color, .2s);
  85. }
  86. }
  87. &.type--message {
  88. .vxe-modal--box {
  89. &:not(.is--drag) {
  90. @include animatTransition(all, .4s, ease-out);
  91. }
  92. }
  93. }
  94. }
  95. &.type--message,
  96. &.type--alert,
  97. &.type--confirm {
  98. .vxe-modal--body {
  99. white-space: normal;
  100. word-break: break-word;
  101. }
  102. }
  103. &.type--message {
  104. text-align: center;
  105. .vxe-modal--box {
  106. display: inline-block;
  107. padding: 2px 0;
  108. margin-top: 0;
  109. width: auto;
  110. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  111. opacity: 0;
  112. transform: translateY(-100%);
  113. .vxe-modal--body {
  114. &:after {
  115. content: '';
  116. display: block;
  117. clear: both;
  118. height: 0;
  119. overflow: hidden;
  120. visibility: hidden;
  121. }
  122. }
  123. .vxe-modal--content {
  124. max-width: 800px;
  125. float: left;
  126. }
  127. }
  128. .vxe-modal--status-wrapper {
  129. font-size: 1.4em;
  130. padding-right: 10px;
  131. }
  132. }
  133. &.type--modal,
  134. &.type--alert,
  135. &.type--confirm {
  136. .vxe-modal--box {
  137. display: flex;
  138. flex-direction: column;
  139. position: fixed;
  140. left: 50%;
  141. top: 0;
  142. box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
  143. .vxe-modal--header {
  144. cursor: move;
  145. }
  146. }
  147. }
  148. &.type--modal {
  149. .vxe-modal--header {
  150. padding: 0.6em 4.6em 0.6em 1em;
  151. }
  152. .vxe-modal--body {
  153. overflow: auto;
  154. .vxe-modal--content {
  155. overflow: auto;
  156. }
  157. }
  158. }
  159. &.type--alert,
  160. &.type--confirm {
  161. .vxe-modal--status-wrapper {
  162. font-size: 1.6em;
  163. padding: 0 10px 0 2px;
  164. }
  165. }
  166. .vxe-modal--box {
  167. visibility: hidden;
  168. width: 420px;
  169. background-color: $vxe-modal-body-background-color;
  170. border-radius: $vxe-border-radius;
  171. border: 1px solid $vxe-modal-border-color;
  172. text-align: left;
  173. pointer-events: auto;
  174. opacity: 0;
  175. &.is--drag {
  176. cursor: move;
  177. .vxe-modal--body,
  178. .vxe-modal--footer {
  179. &:after {
  180. content: "";
  181. position: absolute;
  182. top: 0;
  183. left: 0;
  184. width: 100%;
  185. height: 100%;
  186. }
  187. }
  188. .vxe-modal--body {
  189. overflow: hidden;
  190. .vxe-modal--content {
  191. overflow: hidden;
  192. }
  193. }
  194. }
  195. }
  196. &.status--info {
  197. .vxe-modal--status-wrapper {
  198. color: $vxe-info-color;
  199. }
  200. }
  201. &.status--warning,
  202. &.status--question {
  203. .vxe-modal--status-wrapper {
  204. color: $vxe-warning-color;
  205. }
  206. }
  207. &.status--success {
  208. .vxe-modal--status-wrapper {
  209. color: $vxe-success-color;
  210. }
  211. }
  212. &.status--error {
  213. .vxe-modal--status-wrapper {
  214. color: $vxe-danger-color;
  215. }
  216. }
  217. &.status--loading {
  218. .vxe-modal--status-wrapper {
  219. color: $vxe-disabled-color;
  220. }
  221. }
  222. .vxe-modal--status-wrapper {
  223. flex-shrink: 0;
  224. display: flex;
  225. align-items: center;
  226. }
  227. .vxe-modal--content {
  228. flex-grow: 1;
  229. }
  230. .vxe-modal--header,
  231. .vxe-modal--body,
  232. .vxe-modal--footer {
  233. position: relative;
  234. }
  235. .vxe-modal--body {
  236. display: flex;
  237. flex-grow: 1;
  238. padding: 0.6em 1em;
  239. }
  240. .vxe-modal--header {
  241. flex-shrink: 0;
  242. font-size: 1.1em;
  243. font-weight: 700;
  244. padding: 0.6em 2.8em 0.6em 1em;
  245. border-bottom: 1px solid $vxe-modal-border-color;
  246. background-color: $vxe-modal-header-background-color;
  247. border-radius: $vxe-border-radius $vxe-border-radius 0 0;
  248. user-select: none;
  249. &.is--ellipsis {
  250. overflow: hidden;
  251. text-overflow: ellipsis;
  252. white-space: nowrap;
  253. }
  254. }
  255. .vxe-modal--zoom-btn,
  256. .vxe-modal--close-btn {
  257. position: absolute;
  258. right: 14px;
  259. top: 0.85em;
  260. z-index: 1;
  261. cursor: pointer;
  262. &:hover {
  263. color: $vxe-primary-color;
  264. }
  265. }
  266. .vxe-modal--zoom-btn {
  267. right: 44px;
  268. }
  269. .vxe-modal--footer {
  270. flex-shrink: 0;
  271. text-align: right;
  272. padding: 0.8em 1em;
  273. }
  274. &.is--maximize {
  275. .vxe-modal--box {
  276. .vxe-modal--header {
  277. cursor: default;
  278. }
  279. }
  280. .vxe-modal--resize {
  281. .wl-resize,
  282. .wr-resize,
  283. .swst-resize,
  284. .sest-resize,
  285. .st-resize,
  286. .swlb-resize,
  287. .selb-resize,
  288. .sb-resize {
  289. display: none;
  290. }
  291. }
  292. }
  293. .vxe-modal--resize {
  294. $SpaceSize: 8;
  295. .wl-resize,
  296. .wr-resize,
  297. .swst-resize,
  298. .sest-resize,
  299. .st-resize,
  300. .swlb-resize,
  301. .selb-resize,
  302. .sb-resize {
  303. position: absolute;
  304. z-index: 100;
  305. }
  306. .wl-resize,
  307. .wr-resize {
  308. width: #{$SpaceSize}px;
  309. height: 100%;
  310. top: 0;
  311. cursor: w-resize;
  312. }
  313. .wl-resize {
  314. left: -#{$SpaceSize / 2 + 1}px;
  315. }
  316. .wr-resize {
  317. right: -#{$SpaceSize / 2 + 1}px;
  318. }
  319. .swst-resize,
  320. .sest-resize,
  321. .swlb-resize,
  322. .selb-resize {
  323. width: #{$SpaceSize + 2}px;
  324. height: #{$SpaceSize + 2}px;
  325. z-index: 101;
  326. }
  327. .swst-resize,
  328. .sest-resize {
  329. top: -#{$SpaceSize}px;
  330. }
  331. .swlb-resize,
  332. .selb-resize {
  333. bottom: -#{$SpaceSize}px;
  334. }
  335. .sest-resize,
  336. .swlb-resize {
  337. cursor: sw-resize;
  338. }
  339. .swst-resize,
  340. .selb-resize {
  341. cursor: se-resize;
  342. }
  343. .swst-resize,
  344. .swlb-resize {
  345. left: -#{$SpaceSize}px;
  346. }
  347. .sest-resize,
  348. .selb-resize {
  349. right: -#{$SpaceSize}px;
  350. }
  351. .st-resize,
  352. .sb-resize {
  353. width: 100%;
  354. height: #{$SpaceSize}px;
  355. left: 0;
  356. cursor: s-resize;
  357. }
  358. .st-resize {
  359. top: -#{$SpaceSize / 2 + 1}px;
  360. }
  361. .sb-resize {
  362. bottom: -#{$SpaceSize / 2 + 1}px;
  363. }
  364. }
  365. }
  366. .vxe-modal--wrapper {
  367. font-size: $vxe-font-size;
  368. &.size--medium {
  369. font-size: $vxe-font-size-medium;
  370. }
  371. &.size--small {
  372. font-size: $vxe-font-size-small;
  373. }
  374. &.size--mini {
  375. font-size: $vxe-font-size-mini;
  376. }
  377. }