modal.scss 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. @use '../helpers/baseMixin.scss';
  2. html[data-vxe-lock-scroll] {
  3. overflow: hidden;
  4. body {
  5. overflow: hidden;
  6. width: var(--vxe-ui-modal-lock-scroll-view-width);
  7. }
  8. }
  9. .vxe-modal--box {
  10. visibility: hidden;
  11. width: 420px;
  12. background-color: var(--vxe-ui-layout-background-color);
  13. border-radius: var(--vxe-ui-base-border-radius);
  14. border: 1px solid var(--vxe-ui-base-popup-border-color);
  15. text-align: left;
  16. pointer-events: auto;
  17. opacity: 0;
  18. outline: 0;
  19. &.is--drag {
  20. cursor: move;
  21. .vxe-modal--body,
  22. .vxe-modal--footer {
  23. &:after {
  24. content: "";
  25. position: absolute;
  26. top: 0;
  27. left: 0;
  28. width: 100%;
  29. height: 100%;
  30. }
  31. }
  32. .vxe-modal--body {
  33. overflow: hidden;
  34. .vxe-modal--content {
  35. overflow: hidden;
  36. }
  37. }
  38. }
  39. }
  40. .vxe-modal--aside {
  41. flex-shrink: 0;
  42. overflow: auto;
  43. }
  44. .vxe-modal--container {
  45. display: flex;
  46. flex-direction: column;
  47. flex-grow: 1;
  48. overflow: hidden;
  49. }
  50. .vxe-modal--status-wrapper {
  51. flex-shrink: 0;
  52. display: flex;
  53. align-items: center;
  54. font-size: 1.6em;
  55. }
  56. .vxe-modal--content {
  57. flex-grow: 1;
  58. white-space: pre-line;
  59. }
  60. .vxe-modal--header,
  61. .vxe-modal--body,
  62. .vxe-modal--footer {
  63. position: relative;
  64. }
  65. .vxe-modal--body {
  66. display: flex;
  67. flex-direction: row;
  68. flex-grow: 1;
  69. outline: 0;
  70. }
  71. .vxe-modal--body-left,
  72. .vxe-modal--body-right {
  73. flex-shrink: 0;
  74. overflow: auto;
  75. outline: 0;
  76. }
  77. .vxe-modal--body-default {
  78. display: flex;
  79. flex-grow: 1;
  80. overflow: auto;
  81. outline: 0;
  82. }
  83. .vxe-modal--header {
  84. display: flex;
  85. flex-direction: row;
  86. align-items: center;
  87. height: 2.8em;
  88. flex-shrink: 0;
  89. font-size: 1.1em;
  90. font-weight: 700;
  91. border-radius: var(--vxe-ui-base-border-radius) var(--vxe-ui-base-border-radius) 0 0;
  92. user-select: none;
  93. &.is--ellipsis {
  94. .vxe-modal--header-title {
  95. overflow: hidden;
  96. text-overflow: ellipsis;
  97. white-space: nowrap;
  98. }
  99. }
  100. }
  101. .vxe-modal--footer-wrapper {
  102. display: flex;
  103. flex-direction: row;
  104. .vxe-modal--footer-left {
  105. flex-grow: 1;
  106. text-align: left
  107. }
  108. .vxe-modal--footer-right {
  109. flex-shrink: 0;
  110. }
  111. }
  112. .vxe-modal--header-title {
  113. flex-grow: 1;
  114. padding: 0.8em 0 0.8em 0.6em;
  115. }
  116. .vxe-modal--header-right {
  117. display: flex;
  118. flex-direction: row;
  119. flex-shrink: 0;
  120. padding: 0 0.6em 0 0;
  121. }
  122. .vxe-modal--zoom-btn,
  123. .vxe-modal--close-btn {
  124. display: inline-flex;
  125. align-items: center;
  126. justify-content: center;
  127. width: 1.6em;
  128. height: 1.6em;
  129. margin-left: 0.5em;
  130. cursor: pointer;
  131. &:hover {
  132. color: var(--vxe-ui-font-primary-color);
  133. }
  134. }
  135. .vxe-modal--footer {
  136. flex-shrink: 0;
  137. text-align: right;
  138. padding: 0.4em 1em 0.8em 1em;
  139. }
  140. .vxe-modal--resize {
  141. $SpaceSize: 8px;
  142. $SpaceWidth: 5px;
  143. .wl-resize,
  144. .wr-resize,
  145. .swst-resize,
  146. .sest-resize,
  147. .st-resize,
  148. .swlb-resize,
  149. .selb-resize,
  150. .sb-resize {
  151. position: absolute;
  152. z-index: 100;
  153. }
  154. .wl-resize,
  155. .wr-resize {
  156. width: $SpaceSize;
  157. height: 100%;
  158. top: 0;
  159. cursor: w-resize;
  160. }
  161. .wl-resize {
  162. left: -$SpaceWidth;
  163. }
  164. .wr-resize {
  165. right: -$SpaceWidth;
  166. }
  167. .swst-resize,
  168. .sest-resize,
  169. .swlb-resize,
  170. .selb-resize {
  171. width: $SpaceSize + 2;
  172. height: $SpaceSize + 2;
  173. z-index: 101;
  174. }
  175. .swst-resize,
  176. .sest-resize {
  177. top: -$SpaceSize;
  178. }
  179. .swlb-resize,
  180. .selb-resize {
  181. bottom: -$SpaceSize;
  182. }
  183. .sest-resize,
  184. .swlb-resize {
  185. cursor: sw-resize;
  186. }
  187. .swst-resize,
  188. .selb-resize {
  189. cursor: se-resize;
  190. }
  191. .swst-resize,
  192. .swlb-resize {
  193. left: -$SpaceSize;
  194. }
  195. .sest-resize,
  196. .selb-resize {
  197. right: -$SpaceSize;
  198. }
  199. .st-resize,
  200. .sb-resize {
  201. width: 100%;
  202. height: $SpaceSize;
  203. left: 0;
  204. cursor: s-resize;
  205. }
  206. .st-resize {
  207. top: -$SpaceWidth;
  208. }
  209. .sb-resize {
  210. bottom: -$SpaceWidth;
  211. }
  212. }
  213. .vxe-modal--wrapper {
  214. display: none;
  215. position: fixed;
  216. top: 0;
  217. left: 0;
  218. line-height: 1.5;
  219. width: calc(100% + 18px);
  220. height: calc(100% + 18px);
  221. color: var(--vxe-ui-font-color);
  222. font-family: var(--vxe-ui-font-family);
  223. outline: 0;
  224. &.is--active {
  225. display: block;
  226. }
  227. &.is--visible {
  228. &.is--mask {
  229. &:before {
  230. background-color: rgba(0, 0, 0, 0.5);
  231. }
  232. }
  233. .vxe-modal--box {
  234. opacity: 1;
  235. visibility: visible;
  236. }
  237. }
  238. &:not(.lock--view) {
  239. pointer-events: none;
  240. }
  241. &.is--draggable {
  242. &.zoom--revert,
  243. &.zoom--minimize {
  244. .vxe-modal--header-title {
  245. cursor: move;
  246. }
  247. }
  248. }
  249. &.zoom--minimize,
  250. &.zoom--maximize {
  251. & > .vxe-modal--box {
  252. & > .vxe-modal--container {
  253. & > .vxe-modal--resize {
  254. .wl-resize,
  255. .wr-resize,
  256. .swst-resize,
  257. .sest-resize,
  258. .st-resize,
  259. .swlb-resize,
  260. .selb-resize,
  261. .sb-resize {
  262. display: none;
  263. }
  264. }
  265. }
  266. }
  267. }
  268. &.zoom--maximize {
  269. & > .vxe-modal--box {
  270. border-radius: 0;
  271. & > .vxe-modal--container {
  272. & > .vxe-modal--header {
  273. border-radius: 0;
  274. cursor: default;
  275. }
  276. }
  277. }
  278. }
  279. &.zoom--minimize {
  280. & > .vxe-modal--box {
  281. & > .vxe-modal--container {
  282. & > .vxe-modal--body,
  283. & > .vxe-modal--footer {
  284. display: none;
  285. }
  286. }
  287. }
  288. }
  289. &.type--modal,
  290. &.type--alert,
  291. &.type--confirm {
  292. &.lock--scroll {
  293. overflow: hidden;
  294. }
  295. &:not(.lock--scroll) {
  296. overflow: auto;
  297. }
  298. }
  299. &.lock--view,
  300. &.is--mask {
  301. &:before {
  302. content: "";
  303. position: fixed;
  304. top: 0;
  305. left: 0;
  306. width: 100%;
  307. height: 100%;
  308. z-index: -1;
  309. pointer-events: auto;
  310. }
  311. }
  312. &.is--mask {
  313. &:before {
  314. background-color: rgba(0, 0, 0, 0);
  315. }
  316. }
  317. &.is--animat {
  318. &.is--mask {
  319. &:before {
  320. @include baseMixin.createAnimationTransition(background-color, .2s);
  321. }
  322. }
  323. }
  324. &.type--message,
  325. &.type--notification,
  326. &.type--alert,
  327. &.type--confirm {
  328. .vxe-modal--body {
  329. white-space: normal;
  330. word-break: break-word;
  331. }
  332. }
  333. &.type--message {
  334. .vxe-modal--box {
  335. opacity: 0;
  336. transform: translate(0, -100%);
  337. }
  338. &.is--visible {
  339. .vxe-modal--box {
  340. opacity: 1;
  341. transform: translate(0, 0);
  342. }
  343. }
  344. }
  345. &.type--notification {
  346. &.pos--top-right {
  347. .vxe-modal--box {
  348. opacity: 0;
  349. transform: translate(100%, 0);
  350. }
  351. &.is--visible {
  352. .vxe-modal--box {
  353. opacity: 1;
  354. transform: translate(0, 0);
  355. }
  356. }
  357. }
  358. }
  359. &.type--message,
  360. &.type--notification {
  361. width: 100%;
  362. height: 100%;
  363. padding: 0 var(--vxe-ui-layout-padding-double);
  364. text-align: center;
  365. transition: top .3s ease-in-out;
  366. &.pos--top-left {
  367. text-align: left;
  368. }
  369. &.pos--top-right {
  370. text-align: right;
  371. }
  372. .vxe-modal--box {
  373. display: inline-flex;
  374. flex-direction: row;
  375. margin-top: 0;
  376. width: auto;
  377. box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1);
  378. @include baseMixin.createAnimationTransition(all, .3s, ease-out);
  379. .vxe-modal--body {
  380. &:after {
  381. content: '';
  382. display: block;
  383. clear: both;
  384. height: 0;
  385. overflow: hidden;
  386. visibility: hidden;
  387. }
  388. }
  389. .vxe-modal--content {
  390. max-width: 800px;
  391. float: left;
  392. }
  393. }
  394. }
  395. &.type--modal,
  396. &.type--alert,
  397. &.type--confirm {
  398. .vxe-modal--box {
  399. display: flex;
  400. flex-direction: row;
  401. position: fixed;
  402. left: 50%;
  403. top: 0;
  404. box-shadow: var(--vxe-ui-base-popup-box-shadow);
  405. }
  406. .vxe-modal--header {
  407. border-bottom: 1px solid var(--vxe-ui-input-border-color);
  408. background-color: var(--vxe-ui-modal-header-background-color);
  409. }
  410. .vxe-modal--body {
  411. overflow: auto;
  412. .vxe-modal--content {
  413. overflow: auto;
  414. }
  415. }
  416. }
  417. &.status--info {
  418. .vxe-modal--status-wrapper {
  419. color: var(--vxe-ui-status-info-color);
  420. }
  421. }
  422. &.status--warning,
  423. &.status--question {
  424. .vxe-modal--status-wrapper {
  425. color: var(--vxe-ui-status-warning-color);
  426. }
  427. }
  428. &.status--success {
  429. .vxe-modal--status-wrapper {
  430. color: var(--vxe-ui-status-success-color);
  431. }
  432. }
  433. &.status--error {
  434. .vxe-modal--status-wrapper {
  435. color: var(--vxe-ui-status-danger-color);
  436. }
  437. }
  438. &.status--loading {
  439. .vxe-modal--status-wrapper {
  440. color: var(--vxe-ui-font-disabled-color);
  441. }
  442. }
  443. &.is--padding {
  444. .vxe-modal--aside {
  445. padding: 0.8em 0.6em;
  446. }
  447. .vxe-modal--body-default {
  448. padding: 0.8em 0.6em;
  449. .vxe-modal--status-wrapper {
  450. padding-right: 0.6em;
  451. }
  452. }
  453. &.type--notification {
  454. .vxe-modal--body-default {
  455. padding-top: 0;
  456. }
  457. }
  458. }
  459. &.type--message {
  460. .vxe-modal--body-default {
  461. padding-right: 1.2em;
  462. }
  463. }
  464. }
  465. .vxe-modal--wrapper {
  466. font-size: var(--vxe-ui-font-size-default);
  467. &.size--medium {
  468. font-size: var(--vxe-ui-font-size-medium);
  469. }
  470. &.size--small {
  471. font-size: var(--vxe-ui-font-size-small);
  472. }
  473. &.size--mini {
  474. font-size: var(--vxe-ui-font-size-mini);
  475. }
  476. }