modal.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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. .vxe-modal--body {
  148. overflow: auto;
  149. .vxe-modal--content {
  150. overflow: auto;
  151. }
  152. }
  153. }
  154. &.type--modal {
  155. .vxe-modal--header {
  156. padding: 0.6em 4.6em 0.6em 1em;
  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. white-space: pre-line;
  230. }
  231. .vxe-modal--header,
  232. .vxe-modal--body,
  233. .vxe-modal--footer {
  234. position: relative;
  235. }
  236. .vxe-modal--body {
  237. display: flex;
  238. flex-grow: 1;
  239. padding: 0.6em 1em;
  240. }
  241. .vxe-modal--header {
  242. flex-shrink: 0;
  243. font-size: 1.1em;
  244. font-weight: 700;
  245. padding: 0.6em 2.8em 0.6em 1em;
  246. border-bottom: 1px solid $vxe-modal-border-color;
  247. background-color: $vxe-modal-header-background-color;
  248. border-radius: $vxe-border-radius $vxe-border-radius 0 0;
  249. user-select: none;
  250. &.is--ellipsis {
  251. overflow: hidden;
  252. text-overflow: ellipsis;
  253. white-space: nowrap;
  254. }
  255. }
  256. .vxe-modal--zoom-btn,
  257. .vxe-modal--close-btn {
  258. position: absolute;
  259. right: 14px;
  260. top: 0.85em;
  261. z-index: 1;
  262. cursor: pointer;
  263. &:hover {
  264. color: $vxe-primary-color;
  265. }
  266. }
  267. .vxe-modal--zoom-btn {
  268. right: 44px;
  269. }
  270. .vxe-modal--footer {
  271. flex-shrink: 0;
  272. text-align: right;
  273. padding: 0.8em 1em;
  274. }
  275. &.is--maximize {
  276. .vxe-modal--box {
  277. .vxe-modal--header {
  278. cursor: default;
  279. }
  280. }
  281. .vxe-modal--resize {
  282. .wl-resize,
  283. .wr-resize,
  284. .swst-resize,
  285. .sest-resize,
  286. .st-resize,
  287. .swlb-resize,
  288. .selb-resize,
  289. .sb-resize {
  290. display: none;
  291. }
  292. }
  293. }
  294. .vxe-modal--resize {
  295. $SpaceSize: 8;
  296. .wl-resize,
  297. .wr-resize,
  298. .swst-resize,
  299. .sest-resize,
  300. .st-resize,
  301. .swlb-resize,
  302. .selb-resize,
  303. .sb-resize {
  304. position: absolute;
  305. z-index: 100;
  306. }
  307. .wl-resize,
  308. .wr-resize {
  309. width: #{$SpaceSize}px;
  310. height: 100%;
  311. top: 0;
  312. cursor: w-resize;
  313. }
  314. .wl-resize {
  315. left: -#{$SpaceSize / 2 + 1}px;
  316. }
  317. .wr-resize {
  318. right: -#{$SpaceSize / 2 + 1}px;
  319. }
  320. .swst-resize,
  321. .sest-resize,
  322. .swlb-resize,
  323. .selb-resize {
  324. width: #{$SpaceSize + 2}px;
  325. height: #{$SpaceSize + 2}px;
  326. z-index: 101;
  327. }
  328. .swst-resize,
  329. .sest-resize {
  330. top: -#{$SpaceSize}px;
  331. }
  332. .swlb-resize,
  333. .selb-resize {
  334. bottom: -#{$SpaceSize}px;
  335. }
  336. .sest-resize,
  337. .swlb-resize {
  338. cursor: sw-resize;
  339. }
  340. .swst-resize,
  341. .selb-resize {
  342. cursor: se-resize;
  343. }
  344. .swst-resize,
  345. .swlb-resize {
  346. left: -#{$SpaceSize}px;
  347. }
  348. .sest-resize,
  349. .selb-resize {
  350. right: -#{$SpaceSize}px;
  351. }
  352. .st-resize,
  353. .sb-resize {
  354. width: 100%;
  355. height: #{$SpaceSize}px;
  356. left: 0;
  357. cursor: s-resize;
  358. }
  359. .st-resize {
  360. top: -#{$SpaceSize / 2 + 1}px;
  361. }
  362. .sb-resize {
  363. bottom: -#{$SpaceSize / 2 + 1}px;
  364. }
  365. }
  366. }
  367. .vxe-modal--wrapper {
  368. font-size: $vxe-font-size;
  369. &.size--medium {
  370. font-size: $vxe-font-size-medium;
  371. }
  372. &.size--small {
  373. font-size: $vxe-font-size-small;
  374. }
  375. &.size--mini {
  376. font-size: $vxe-font-size-mini;
  377. }
  378. }