modal.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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-left: 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. }
  144. .vxe-modal--body {
  145. overflow: auto;
  146. .vxe-modal--content {
  147. overflow: auto;
  148. }
  149. }
  150. }
  151. &.type--alert,
  152. &.type--confirm {
  153. .vxe-modal--status-wrapper {
  154. font-size: 1.6em;
  155. padding-left: 10px;
  156. }
  157. }
  158. .vxe-modal--box {
  159. visibility: hidden;
  160. width: 420px;
  161. background-color: $vxe-modal-body-background-color;
  162. border-radius: $vxe-border-radius;
  163. border: 1px solid $vxe-modal-border-color;
  164. text-align: left;
  165. pointer-events: auto;
  166. opacity: 0;
  167. &.is--drag {
  168. cursor: move;
  169. .vxe-modal--body,
  170. .vxe-modal--footer {
  171. &:after {
  172. content: "";
  173. position: absolute;
  174. top: 0;
  175. left: 0;
  176. width: 100%;
  177. height: 100%;
  178. }
  179. }
  180. .vxe-modal--body {
  181. overflow: hidden;
  182. .vxe-modal--content {
  183. overflow: hidden;
  184. }
  185. }
  186. }
  187. }
  188. &.status--info {
  189. .vxe-modal--status-wrapper {
  190. color: $vxe-info-color;
  191. }
  192. }
  193. &.status--warning,
  194. &.status--question {
  195. .vxe-modal--status-wrapper {
  196. color: $vxe-warning-color;
  197. }
  198. }
  199. &.status--success {
  200. .vxe-modal--status-wrapper {
  201. color: $vxe-success-color;
  202. }
  203. }
  204. &.status--error {
  205. .vxe-modal--status-wrapper {
  206. color: $vxe-danger-color;
  207. }
  208. }
  209. &.status--loading {
  210. .vxe-modal--status-wrapper {
  211. color: $vxe-disabled-color;
  212. }
  213. }
  214. .vxe-modal--status-wrapper {
  215. flex-shrink: 0;
  216. display: flex;
  217. align-items: center;
  218. }
  219. .vxe-modal--content {
  220. flex-grow: 1;
  221. padding: 0.8em 1em;
  222. white-space: pre-line;
  223. }
  224. .vxe-modal--header,
  225. .vxe-modal--body,
  226. .vxe-modal--footer {
  227. position: relative;
  228. }
  229. .vxe-modal--body {
  230. display: flex;
  231. flex-grow: 1;
  232. }
  233. .vxe-modal--header {
  234. display: flex;
  235. flex-direction: row;
  236. flex-shrink: 0;
  237. font-size: 1.1em;
  238. font-weight: 700;
  239. border-bottom: 1px solid $vxe-modal-border-color;
  240. background-color: $vxe-modal-header-background-color;
  241. border-radius: $vxe-border-radius $vxe-border-radius 0 0;
  242. user-select: none;
  243. &.is--draggable {
  244. .vxe-modal--header-title {
  245. cursor: move;
  246. }
  247. }
  248. &.is--ellipsis {
  249. .vxe-modal--header-title {
  250. overflow: hidden;
  251. text-overflow: ellipsis;
  252. white-space: nowrap;
  253. }
  254. }
  255. }
  256. .vxe-modal--header-title {
  257. flex-grow: 1;
  258. padding: 0.6em 0 0.6em 1em;
  259. }
  260. .vxe-modal--header-right {
  261. flex-shrink: 0;
  262. padding: 0.6em 1em 0.6em 0;
  263. }
  264. .vxe-modal--zoom-btn,
  265. .vxe-modal--close-btn {
  266. cursor: pointer;
  267. margin-left: 0.6em;
  268. &:hover {
  269. color: $vxe-primary-color;
  270. }
  271. }
  272. .vxe-modal--footer {
  273. flex-shrink: 0;
  274. text-align: right;
  275. padding: 0.4em 1em 0.8em 1em;
  276. }
  277. &.is--maximize {
  278. .vxe-modal--box {
  279. .vxe-modal--header {
  280. cursor: default;
  281. }
  282. }
  283. .vxe-modal--resize {
  284. .wl-resize,
  285. .wr-resize,
  286. .swst-resize,
  287. .sest-resize,
  288. .st-resize,
  289. .swlb-resize,
  290. .selb-resize,
  291. .sb-resize {
  292. display: none;
  293. }
  294. }
  295. }
  296. .vxe-modal--resize {
  297. $SpaceSize: 8px;
  298. $SpaceWidth: 5px;
  299. .wl-resize,
  300. .wr-resize,
  301. .swst-resize,
  302. .sest-resize,
  303. .st-resize,
  304. .swlb-resize,
  305. .selb-resize,
  306. .sb-resize {
  307. position: absolute;
  308. z-index: 100;
  309. }
  310. .wl-resize,
  311. .wr-resize {
  312. width: $SpaceSize;
  313. height: 100%;
  314. top: 0;
  315. cursor: w-resize;
  316. }
  317. .wl-resize {
  318. left: -$SpaceWidth;
  319. }
  320. .wr-resize {
  321. right: -$SpaceWidth;
  322. }
  323. .swst-resize,
  324. .sest-resize,
  325. .swlb-resize,
  326. .selb-resize {
  327. width: $SpaceSize + 2;
  328. height: $SpaceSize + 2;
  329. z-index: 101;
  330. }
  331. .swst-resize,
  332. .sest-resize {
  333. top: -$SpaceSize;
  334. }
  335. .swlb-resize,
  336. .selb-resize {
  337. bottom: -$SpaceSize;
  338. }
  339. .sest-resize,
  340. .swlb-resize {
  341. cursor: sw-resize;
  342. }
  343. .swst-resize,
  344. .selb-resize {
  345. cursor: se-resize;
  346. }
  347. .swst-resize,
  348. .swlb-resize {
  349. left: -$SpaceSize;
  350. }
  351. .sest-resize,
  352. .selb-resize {
  353. right: -$SpaceSize;
  354. }
  355. .st-resize,
  356. .sb-resize {
  357. width: 100%;
  358. height: $SpaceSize;
  359. left: 0;
  360. cursor: s-resize;
  361. }
  362. .st-resize {
  363. top: -$SpaceWidth;
  364. }
  365. .sb-resize {
  366. bottom: -$SpaceWidth;
  367. }
  368. }
  369. }
  370. .vxe-modal--wrapper {
  371. font-size: $vxe-font-size;
  372. &.size--medium {
  373. font-size: $vxe-font-size-medium;
  374. }
  375. &.size--small {
  376. font-size: $vxe-font-size-small;
  377. }
  378. &.size--mini {
  379. font-size: $vxe-font-size-mini;
  380. }
  381. }