password-input.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. @use "sass:list";
  2. .vxe-password-input--wrapper {
  3. flex-grow: 1;
  4. overflow: hidden;
  5. }
  6. .vxe-password-input--inner {
  7. display: block;
  8. width: 100%;
  9. height: 100%;
  10. outline: 0;
  11. margin: 0;
  12. font-size: inherit;
  13. font-family: inherit;
  14. line-height: inherit;
  15. padding: 0 0.5em;
  16. color: var(--vxe-ui-font-color);
  17. border: 0;
  18. border-radius: var(--vxe-ui-base-border-radius);
  19. background-color: var(--vxe-ui-layout-background-color);
  20. box-shadow: none;
  21. &::placeholder {
  22. color: var(--vxe-ui-input-placeholder-color);
  23. }
  24. &::-webkit-autofill {
  25. background-color: var(--vxe-ui-layout-background-color);
  26. }
  27. &[type="number"] {
  28. appearance: none;
  29. -moz-appearance: textfield;
  30. }
  31. &[type="search"],
  32. &[type="search"]::-webkit-search-cancel-button,
  33. &[type="number"]::-webkit-outer-spin-button,
  34. &[type="number"]::-webkit-inner-spin-button {
  35. appearance: none;
  36. }
  37. &[disabled] {
  38. cursor: not-allowed;
  39. color: var(--vxe-ui-font-disabled-color);
  40. background-color: var(--vxe-ui-input-disabled-background-color);
  41. }
  42. }
  43. // 禁用
  44. .vxe-password-input {
  45. &.is--disabled {
  46. background-color: var(--vxe-ui-input-disabled-background-color);
  47. .vxe-password-input--prefix,
  48. .vxe-password-input--suffix,
  49. .vxe-password-input--clear-icon,
  50. .vxe-password-input--control-icon {
  51. cursor: not-allowed;
  52. }
  53. .vxe-password-input--prefix,
  54. .vxe-password-input--suffix {
  55. background-color: var(--vxe-ui-input-disabled-background-color);
  56. }
  57. }
  58. }
  59. // 图标
  60. .vxe-password-input {
  61. display: inline-flex;
  62. flex-direction: row;
  63. position: relative;
  64. border-radius: var(--vxe-ui-base-border-radius);
  65. width: 180px;
  66. border: 1px solid var(--vxe-ui-input-border-color);
  67. &.is--active {
  68. border: 1px solid var(--vxe-ui-font-primary-color);
  69. }
  70. &.show--clear {
  71. &:hover {
  72. .vxe-password-input--clear-icon {
  73. display: block;
  74. }
  75. }
  76. }
  77. }
  78. .vxe-password-input--prefix,
  79. .vxe-password-input--suffix {
  80. display: flex;
  81. flex-direction: row;
  82. align-items: center;
  83. flex-shrink: 0;
  84. background-color: var(--vxe-ui-layout-background-color);
  85. }
  86. .vxe-password-input--prefix-icon {
  87. padding-left: 0.5em;
  88. }
  89. .vxe-password-input--clear-icon,
  90. .vxe-password-input--control-icon,
  91. .vxe-password-input--suffix-icon {
  92. padding-right: 0.5em;
  93. }
  94. .vxe-password-input--clear-icon,
  95. .vxe-password-input--control-icon {
  96. height: 100%;
  97. color: var(--vxe-ui-input-placeholder-color);
  98. cursor: pointer;
  99. }
  100. .vxe-password-input--clear-icon {
  101. display: none;
  102. &:hover {
  103. color: var(--vxe-ui-font-color);
  104. }
  105. &:active {
  106. color: var(--vxe-ui-font-primary-color);
  107. }
  108. }
  109. .vxe-password-input--number-btn {
  110. height: 50%;
  111. display: flex;
  112. align-items: center;
  113. justify-content: center;
  114. &:hover {
  115. color: var(--vxe-ui-font-color);
  116. }
  117. &:active {
  118. color: var(--vxe-ui-font-primary-color);
  119. }
  120. }
  121. .vxe-password-input--number-icon {
  122. display: flex;
  123. flex-direction: column;
  124. height: 100%;
  125. .vxe-password-input--number-btn {
  126. &.is--disabled {
  127. cursor: no-drop;
  128. color: var(--vxe-ui-font-disabled-color);
  129. }
  130. }
  131. }
  132. // 统计字数
  133. .vxe-password-input--count {
  134. flex-shrink: 0;
  135. color: var(--vxe-ui-input-count-color);
  136. background-color: var(--vxe-ui-layout-background-color);
  137. padding-right: 0.6em;
  138. &.is--error {
  139. color: var(--vxe-ui-input-count-error-color);
  140. }
  141. }
  142. // 对齐方式
  143. .vxe-password-input {
  144. &.is--left {
  145. .vxe-password-input--inner {
  146. text-align: left;
  147. }
  148. }
  149. &.is--center {
  150. .vxe-password-input--inner {
  151. text-align: center;
  152. }
  153. }
  154. &.is--right {
  155. .vxe-password-input--inner {
  156. text-align: right;
  157. }
  158. }
  159. }
  160. .vxe-password-input--panel {
  161. display: none;
  162. position: absolute;
  163. left: 0;
  164. padding: 4px 0;
  165. color: var(--vxe-ui-font-color);
  166. font-size: var(--vxe-ui-font-size-default);
  167. text-align: left;
  168. &:not(.is--transfer) {
  169. min-width: 100%;
  170. }
  171. &.is--transfer {
  172. position: fixed;
  173. }
  174. &.ani--leave {
  175. display: block;
  176. opacity: 0;
  177. transform: scaleY(0.5);
  178. transition: transform .3s cubic-bezier(.23,1,.32,1), opacity .3s cubic-bezier(.23,1,.32,1);
  179. transform-origin: center top;
  180. backface-visibility: hidden;
  181. transform-style: preserve-3d;
  182. &[placement="top"] {
  183. transform-origin: center bottom;
  184. }
  185. }
  186. &.ani--enter {
  187. opacity: 1;
  188. transform: scaleY(1);
  189. }
  190. }
  191. .vxe-password-input {
  192. font-size: var(--vxe-ui-font-size-default);
  193. height: var(--vxe-ui-input-height-default);
  194. line-height: var(--vxe-ui-input-height-default);
  195. .vxe-password-input--inner {
  196. &[type="date"]::-webkit-inner-spin-button,
  197. &[type="month"]::-webkit-inner-spin-button,
  198. &[type="week"]::-webkit-inner-spin-button {
  199. margin-top: 6px;
  200. }
  201. &[type="date"]::-webkit-inner-spin-button,
  202. &[type="month"]::-webkit-inner-spin-button,
  203. &[type="week"]::-webkit-inner-spin-button,
  204. &[type="number"]::-webkit-inner-spin-button {
  205. height: 24px;
  206. }
  207. }
  208. &.size--medium {
  209. font-size: var(--vxe-ui-font-size-medium);
  210. height: var(--vxe-ui-input-height-medium);
  211. line-height: var(--vxe-ui-input-height-medium);
  212. .vxe-password-input--inner {
  213. &[type="date"]::-webkit-inner-spin-button,
  214. &[type="month"]::-webkit-inner-spin-button,
  215. &[type="week"]::-webkit-inner-spin-button {
  216. margin-top: 4px;
  217. }
  218. }
  219. }
  220. &.size--small {
  221. font-size: var(--vxe-ui-font-size-small);
  222. height: var(--vxe-ui-input-height-small);
  223. line-height: var(--vxe-ui-input-height-small);
  224. .vxe-password-input--inner {
  225. &[type="date"]::-webkit-inner-spin-button,
  226. &[type="month"]::-webkit-inner-spin-button,
  227. &[type="week"]::-webkit-inner-spin-button {
  228. margin-top: 2px;
  229. }
  230. }
  231. }
  232. &.size--mini {
  233. font-size: var(--vxe-ui-font-size-mini);
  234. height: var(--vxe-ui-input-height-mini);
  235. line-height: var(--vxe-ui-input-height-mini);
  236. .vxe-password-input--inner {
  237. &[type="date"]::-webkit-inner-spin-button,
  238. &[type="month"]::-webkit-inner-spin-button,
  239. &[type="week"]::-webkit-inner-spin-button {
  240. margin-top: 0;
  241. }
  242. }
  243. }
  244. }
  245. @mixin getPanelStyle ($sizeIndex) {
  246. $fontSizeList: var(--vxe-ui-font-size-default), var(--vxe-ui-font-size-medium), var(--vxe-ui-font-size-small), var(--vxe-ui-font-size-mini);
  247. $timeWeekRowHeightList: var(--vxe-ui-input-date-time-week-row-height-default), var(--vxe-ui-input-date-time-week-row-height-medium), var(--vxe-ui-input-date-time-week-row-height-small), var(--vxe-ui-input-date-time-week-row-height-mini);
  248. $monthYearRowHeightList: var(--vxe-ui-input-date-month-year-row-height-default), var(--vxe-ui-input-date-month-year-row-height-medium), var(--vxe-ui-input-date-month-year-row-height-small), var(--vxe-ui-input-date-month-year-row-height-mini);
  249. $quarterRowHeightList: var(--vxe-ui-input-date-quarter-row-height-default), var(--vxe-ui-input-date-quarter-row-height-medium), var(--vxe-ui-input-date-quarter-row-height-small), var(--vxe-ui-input-date-quarter-row-height-mini);
  250. $titleRowHeightList: var(--vxe-ui-input-date-title-height-default), var(--vxe-ui-input-date-title-height-medium), var(--vxe-ui-input-date-title-height-small), var(--vxe-ui-input-date-title-height-mini);
  251. font-size: list.nth($fontSizeList, $sizeIndex);
  252. .vxe-password-input--panel-wrapper {
  253. max-height: 400px - $sizeIndex * 20;
  254. }
  255. &.type--date,
  256. &.type--time,
  257. &.type--week,
  258. &.type--month,
  259. &.type--quarter,
  260. &.type--year {
  261. .vxe-password-input--panel-wrapper {
  262. padding: 12px - $sizeIndex;
  263. }
  264. }
  265. &.type--date,
  266. &.type--month,
  267. &.type--quarter,
  268. &.type--year {
  269. .vxe-password-input--panel-wrapper {
  270. $widthList: 336px, 336px, 312px, 288px;
  271. width: list.nth($widthList, $sizeIndex);
  272. }
  273. }
  274. &.type--week {
  275. .vxe-password-input--panel-wrapper {
  276. $widthList: 380px, 380px, 354px, 326px;
  277. width: list.nth($widthList, $sizeIndex);
  278. }
  279. }
  280. &.type--time {
  281. .vxe-password-input--panel-wrapper {
  282. $widthList: 170px, 168px, 154px, 146px;
  283. width: list.nth($widthList, $sizeIndex);
  284. }
  285. }
  286. &.type--datetime {
  287. .vxe-password-input--panel-left-wrapper {
  288. $widthList: 336px, 336px, 312px, 288px;
  289. width: list.nth($widthList, $sizeIndex);
  290. }
  291. .vxe-password-input--panel-left-wrapper,
  292. .vxe-password-input--panel-right-wrapper {
  293. padding: 12px - $sizeIndex;
  294. }
  295. }
  296. .vxe-password-input--time-picker-title {
  297. height: 31px - $sizeIndex;
  298. line-height: 31px - $sizeIndex;
  299. padding: 0 12px - $sizeIndex;
  300. }
  301. .vxe-password-input--date-picker-label,
  302. .vxe-password-input--date-picker-btn {
  303. height: 31px - $sizeIndex;
  304. line-height: 31px - $sizeIndex;
  305. }
  306. .vxe-password-input--date-picker-btn-wrapper {
  307. .vxe-password-input--date-picker-btn {
  308. margin-left: 9px - $sizeIndex;
  309. }
  310. .vxe-password-input--date-picker-prev-btn,
  311. .vxe-password-input--date-picker-current-btn,
  312. .vxe-password-input--date-picker-next-btn {
  313. width: 31px - $sizeIndex;
  314. border-radius: var(--vxe-ui-base-border-radius);
  315. border: 1px solid var(--vxe-ui-input-border-color);
  316. }
  317. }
  318. .vxe-password-input--date-picker-type-wrapper {
  319. .vxe-password-input--date-picker-label,
  320. .vxe-password-input--date-picker-btn {
  321. padding: 0 10px - $sizeIndex;
  322. }
  323. }
  324. .vxe-password-input--time-picker-header,
  325. .vxe-password-input--date-picker-header {
  326. $paddingBottomList: 8px, 7px, 6px, 5px;
  327. padding-bottom: list.nth($paddingBottomList, $sizeIndex);
  328. }
  329. .vxe-password-input--date-picker-body table,
  330. .vxe-password-input--time-picker-body {
  331. height: calc(list.nth($timeWeekRowHeightList, $sizeIndex) * 6 + list.nth($titleRowHeightList, $sizeIndex));
  332. }
  333. .vxe-password-input--time-picker-body {
  334. $ulWidthList: 48px, 48px, 44px, 42px;
  335. & > ul {
  336. width: list.nth($ulWidthList, $sizeIndex);
  337. &:before,
  338. &:after {
  339. $heightList: 120px, 120px, 110px, 100px;
  340. height: list.nth($heightList, $sizeIndex);
  341. }
  342. & > li {
  343. height: 26px;
  344. padding-left: 10px - $sizeIndex;
  345. }
  346. }
  347. .vxe-password-input--time-picker-minute-list {
  348. left: list.nth($ulWidthList, $sizeIndex);
  349. }
  350. .vxe-password-input--time-picker-second-list {
  351. left: calc(list.nth($ulWidthList, $sizeIndex) * 2);
  352. }
  353. }
  354. .vxe-password-input--date-day-view,
  355. .vxe-password-input--date-week-view {
  356. td {
  357. height: list.nth($timeWeekRowHeightList, $sizeIndex);
  358. }
  359. }
  360. .vxe-password-input--date-quarter-view {
  361. td {
  362. height: list.nth($quarterRowHeightList, $sizeIndex);
  363. }
  364. }
  365. .vxe-password-input--date-month-view,
  366. .vxe-password-input--date-year-view {
  367. td {
  368. height: list.nth($monthYearRowHeightList, $sizeIndex);
  369. }
  370. }
  371. .vxe-password-input--date-picker-body {
  372. th {
  373. height: list.nth($titleRowHeightList, $sizeIndex);
  374. }
  375. }
  376. .vxe-password-input--time-picker-confirm,
  377. .vxe-password-input--date-picker-confirm {
  378. height: 31px - $sizeIndex;
  379. padding: 0 10px - $sizeIndex;
  380. }
  381. .vxe-password-input--date-label {
  382. line-height: calc(list.nth($fontSizeList, $sizeIndex) + 1px);
  383. }
  384. }
  385. .vxe-password-input--panel {
  386. @include getPanelStyle(1);
  387. &.size--medium {
  388. @include getPanelStyle(2);
  389. }
  390. &.size--small {
  391. @include getPanelStyle(3);
  392. }
  393. &.size--mini {
  394. @include getPanelStyle(4);
  395. }
  396. }