123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830 |
- /**Variable**/
- @import './helpers/mixin.scss';
- $iconWidth: 1.6em;
- .vxe-input--inner {
- width: 100%;
- height: 100%;
- border-radius: $vxe-border-radius;
- outline: 0;
- margin: 0;
- font-size: inherit;
- font-family: inherit;
- line-height: inherit;
- padding: 0 0.6em;
- color: $vxe-font-color;
- border: 1px solid $vxe-input-border-color;
- background-color: $vxe-input-background-color;
- box-shadow: none;
- &::placeholder {
- color: $vxe-input-placeholder-color;
- }
- &[type="number"] {
- appearance: none;
- -moz-appearance: textfield;
- }
- &[type="search"],
- &[type="search"]::-webkit-search-cancel-button,
- &[type="number"]::-webkit-outer-spin-button,
- &[type="number"]::-webkit-inner-spin-button {
- appearance: none;
- }
- &[disabled] {
- cursor: not-allowed;
- color: $vxe-disabled-color;
- background-color: $vxe-input-disabled-background-color;
- }
- }
- .vxe-input {
- display: inline-block;
- position: relative;
- width: 180px;
- &.is--disabled {
- .vxe-input--date-picker-suffix,
- .vxe-input--search-suffix,
- .vxe-input--suffix,
- .vxe-input--password-suffix,
- .vxe-input--number-suffix {
- cursor: no-drop;
- }
- }
- &:not(.is--disabled) {
- .vxe-input--date-picker-suffix,
- .vxe-input--search-suffix,
- .vxe-input--clear-icon,
- .vxe-input--password-suffix,
- .vxe-input--number-suffix {
- cursor: pointer;
- }
- &.is--active {
- .vxe-input--inner {
- border: 1px solid $vxe-primary-color;
- }
- }
- }
- }
- .vxe-input--prefix,
- .vxe-input--suffix,
- .vxe-input--extra-suffix {
- display: flex;
- position: absolute;
- top: 0;
- width: $iconWidth;
- height: 100%;
- user-select: none;
- align-items: center;
- justify-content: center;
- color: $vxe-table-column-icon-border-color;
- }
- // 前缀图标
- .vxe-input {
- .vxe-input--prefix {
- left: 0.2em;
- }
- &.is--prefix {
- .vxe-input--inner {
- padding-left: #{$iconWidth + 0.2em};
- }
- }
- }
- // 后缀图标
- .vxe-input {
- .vxe-input--clear-icon {
- display: none;
- }
- .vxe-input--suffix,
- .vxe-input--extra-suffix {
- right: 0.2em;
- }
- &.is--suffix {
- .vxe-input--inner {
- padding-right: #{$iconWidth + 0.2em};
- }
- }
- &.is--left {
- .vxe-input--inner {
- text-align: left;
- }
- }
- &.is--center {
- .vxe-input--inner {
- text-align: center;
- }
- }
- &.is--right {
- .vxe-input--inner {
- text-align: right;
- }
- }
- &.is--controls {
- &.type--search,
- &.type--password,
- &.type--number,
- &.type--integer,
- &.type--float,
- &.type--date,
- &.type--datetime,
- &.type--week,
- &.type--month,
- &.type--year {
- .vxe-input--inner {
- padding-right: #{$iconWidth + 0.2em};
- }
- .vxe-input--suffix {
- right: $iconWidth;
- }
- }
- }
- &.is--suffix {
- &.is--controls {
- &.type--search,
- &.type--password,
- &.type--number,
- &.type--integer,
- &.type--float,
- &.type--date,
- &.type--datetime,
- &.type--week,
- &.type--month,
- &.type--year {
- .vxe-input--inner {
- padding-right: #{$iconWidth * 2};
- }
- }
- }
- }
- &.is--suffix {
- &:hover {
- .vxe-input--suffix {
- &.is--clear {
- .vxe-input--suffix-icon {
- display: none;
- }
- .vxe-input--clear-icon {
- display: inline;
- }
- }
- }
- }
- }
- &:not(.is--disabled) {
- &:not(.is--readonly) {
- .vxe-input--suffix {
- &:hover {
- .vxe-input--clear-icon {
- color: $vxe-font-color;
- }
- }
- }
- .vxe-input--extra-suffix {
- &:hover {
- .vxe-input--password-suffix {
- color: $vxe-font-color;
- }
- }
- }
- .vxe-input--number-prev,
- .vxe-input--number-next {
- &:hover {
- color: $vxe-font-color;
- }
- &:active {
- color: $vxe-primary-color;
- }
- }
- }
- }
- }
- .vxe-input--password-suffix,
- .vxe-input--number-suffix,
- .vxe-input--date-picker-suffix,
- .vxe-input--search-suffix {
- position: relative;
- width: 100%;
- height: 100%;
- }
- .vxe-input--date-picker-icon,
- .vxe-input--search-icon,
- .vxe-input--password-icon {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- }
- .vxe-input--date-picker-suffix {
- display: flex;
- align-items: center;
- justify-content: center;
- .vxe-input--panel-icon {
- @include animatTransition(transform, .2s);
- }
- }
- .vxe-input--number-prev,
- .vxe-input--number-next {
- position: relative;
- display: block;
- height: 50%;
- width: 100%;
- text-align: center;
- }
- .vxe-input--number-prev-icon,
- .vxe-input--number-next-icon {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- }
- .vxe-input--number-prev-icon {
- bottom: 0;
- }
- .vxe-input--number-next-icon {
- top: 0;
- }
- .vxe-input--panel {
- display: none;
- position: absolute;
- left: 0;
- padding: 4px 0;
- color: $vxe-font-color;
- font-size: $vxe-font-size;
- text-align: left;
- &:not(.is--transfer) {
- min-width: 100%;
- }
- &.is--transfer {
- position: fixed;
- }
- &.animat--leave {
- display: block;
- opacity: 0;
- transform: scaleY(0.5);
- transition: transform .3s cubic-bezier(.23,1,.32,1), opacity .3s cubic-bezier(.23,1,.32,1);
- transform-origin: center top;
- backface-visibility: hidden;
- transform-style: preserve-3d;
- &[placement="top"] {
- transform-origin: center bottom;
- }
- }
- &.animat--enter {
- opacity: 1;
- transform: scaleY(1);
- }
- }
- .vxe-input--panel-wrapper,
- .vxe-input--panel-layout-wrapper {
- background-color: $vxe-input-panel-background-color;
- border: 1px solid $vxe-table-popup-border-color;
- box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
- border-radius: $vxe-border-radius;
- }
- .vxe-input--panel-wrapper {
- overflow-x: hidden;
- overflow-y: auto;
- }
- .vxe-input--panel-layout-wrapper {
- display: flex;
- flex-direction: row;
- }
- .vxe-input--panel {
- &.type--date,
- &.type--week,
- &.type--month,
- &.type--year {
- user-select: none;
- }
- &.type--datetime {
- .vxe-input--panel-right-wrapper {
- display: flex;
- flex-direction: column;
- border-left: 1px solid $vxe-input-border-color;
- }
- }
- &.type--date,
- &.type--datetime {
- .vxe-input--date-picker-body {
- th {
- width: 14.28571%;
- }
- }
- }
- &.type--week {
- .vxe-input--date-picker-body {
- table {
- th {
- width: 12%;
- &:first-child {
- width: 14%;
- }
- }
- }
- }
- }
- &.type--month,
- &.type--year {
- .vxe-input--date-picker-body {
- td {
- width: 25%;
- }
- }
- }
- }
- .vxe-input--time-picker-title {
- display: inline-block;
- text-align: center;
- border: 1px solid $vxe-input-border-color;
- border-radius: $vxe-border-radius;
- }
- .vxe-input--time-picker-confirm {
- position: absolute;
- right: 0;
- top: 0;
- outline: 0;
- border: 1px solid $vxe-input-border-color;
- border-radius: $vxe-border-radius;
- cursor: pointer;
- color: $vxe-input-date-time-confirm-button-color;
- border-color: $vxe-primary-color;
- background-color: $vxe-primary-color;
- &:hover {
- background-color: lighten($vxe-primary-color, 6%);
- border-color: lighten($vxe-primary-color, 6%);
- }
- &:active {
- background-color: darken($vxe-primary-color, 3%);
- border-color: darken($vxe-primary-color, 3%);
- }
- }
- .vxe-input--time-picker-header {
- display: flex;
- position: relative;
- flex-shrink: 0;
- }
- .vxe-input--date-picker-header {
- display: flex;
- flex-direction: row;
- user-select: none;
- .vxe-input--date-picker-type-wrapper {
- flex-grow: 1;
- }
- .vxe-input--date-picker-btn-wrapper {
- flex-shrink: 0;
- text-align: center;
- }
- }
- .vxe-input--date-picker-type-wrapper {
- .vxe-input--date-picker-label,
- .vxe-input--date-picker-btn {
- display: inline-block;
- }
- }
- .vxe-input--date-picker-btn-wrapper {
- display: flex;
- flex-direction: row;
- }
- .vxe-input--date-picker-label,
- .vxe-input--date-picker-btn {
- display: inline-block;
- display: flex;
- border-radius: $vxe-border-radius;
- border: 1px solid $vxe-input-border-color;
- align-items: center;
- justify-content: center;
- background-color: $vxe-button-default-background-color;
- }
- .vxe-input--date-picker-btn {
- &.is--disabled {
- color: $vxe-disabled-color;
- cursor: no-drop;
- }
- &:not(.is--disabled) {
- cursor: pointer;
- &:hover {
- background-color: lighten($vxe-button-default-background-color, 6%);
- }
- &:active {
- background-color: darken($vxe-button-default-background-color, 3%);
- }
- }
- }
- .vxe-input--date-picker-body {
- border-radius: $vxe-border-radius;
- border: 1px solid $vxe-table-popup-border-color;
- user-select: none;
- table {
- border: 0;
- width: 100%;
- border-spacing: 0;
- border-collapse: separate;
- text-align: center;
- table-layout: fixed
- }
- th,
- td {
- font-weight: normal;
- }
- th {
- box-shadow: inset 0 -1px 0 0 $vxe-table-popup-border-color;
- }
- td {
- &.is--prev,
- &.is--next {
- color: $vxe-disabled-color;
- .vxe-input--date-label,
- .vxe-input--date-festival {
- color: $vxe-disabled-color;
- }
- }
- &.is--now {
- box-shadow: inset 0 0 0 1px $vxe-table-popup-border-color;
- &:not(.is--selected) {
- &.is--current {
- color: $vxe-primary-color;
- .vxe-input--date-label,
- .vxe-input--date-festival {
- color: $vxe-primary-color;
- }
- }
- }
- }
- &.is--hover {
- background-color: $vxe-input-date-picker-hover-background-color;
- }
- &.is--selected {
- color: $vxe-input-date-picker-selected-color;
- background-color: $vxe-primary-color;
- .vxe-input--date-label,
- .vxe-input--date-festival {
- color: $vxe-input-date-picker-festival-selected-color;
- }
- .vxe-input--date-label {
- &.is-notice {
- &:before {
- background-color: $vxe-input-date-picker-notice-selected-background-color;
- }
- }
- }
- }
- &:not(.is--disabled) {
- cursor: pointer;
- }
- &.is--disabled {
- cursor: no-drop;
- color: $vxe-input-disabled-color;
- background-color: $vxe-input-disabled-background-color;
- .vxe-input--date-label,
- .vxe-input--date-festival {
- color: $vxe-input-disabled-color;
- }
- }
- }
- }
- .vxe-input--date-week-view {
- th {
- &:first-child {
- box-shadow: inset -1px -1px 0 0 $vxe-table-popup-border-color;
- }
- }
- td {
- &:first-child {
- box-shadow: inset -1px 0 0 0 $vxe-table-popup-border-color;
- }
- }
- }
- .vxe-input--date-label,
- .vxe-input--date-festival {
- display: block;
- overflow: hidden;
- }
- .vxe-input--date-label {
- position: relative;
- padding-top: 8%;
- &.is-notice {
- &:before {
- content: "";
- position: absolute;
- width: 4px;
- height: 4px;
- left: 0.8em;
- top: 0.3em;
- transform: translateX(-50%);
- border-radius: 100%;
- background-color: $vxe-input-date-notice-background-color;
- }
- }
- }
- .vxe-input--date-label--extra {
- position: absolute;
- right: 0.1em;
- top: 0;
- font-size: 12px;
- line-height: 12px;
- transform: scale(0.7);
- color: $vxe-input-date-extra-color;
- &.is-important {
- color: $vxe-input-date-extra-important-color;
- }
- }
- .vxe-input--date-festival {
- color: $vxe-input-date-festival-color;
- height: 14px;
- line-height: 1;
- overflow: hidden;
- &.is-important {
- color: $vxe-input-date-festival-important-color;
- }
- }
- .vxe-input--date-festival--label {
- display: block;
- font-size: 12px;
- transform: scale(0.9);
- }
- @keyframes festivalOverlap2 {
- 0%, 45%, 100% {
- transform: translateY(0);
- }
- 50%, 95% {
- transform: translateY(-14px);
- }
- }
- @keyframes festivalOverlap3 {
- 0%, 20%, 100% {
- transform: translateY(0);
- }
- 25%, 45%, 75%, 95% {
- transform: translateY(-14px);
- }
- 50%, 70% {
- transform: translateY(-28px);
- }
- }
- .vxe-input--date-festival--overlap {
- display: block;
- font-size: 12px;
- &.overlap--2 {
- animation: festivalOverlap2 6s infinite ease-in-out;
- }
- &.overlap--3 {
- animation: festivalOverlap3 9s infinite ease-in-out;
- }
- & > span {
- height: 14px;
- display: block;
- transform: scale(0.9);
- }
- }
- .vxe-input--time-picker-body {
- position: relative;
- display: flex;
- flex-direction: row;
- border: 1px solid $vxe-table-popup-border-color;
- flex-grow: 1;
- border-radius: $vxe-border-radius;
- user-select: none;
- & > ul {
- height: 100%;
- overflow: hidden;
- margin: 0;
- padding: 0;
- &:before,
- &:after {
- content: " ";
- display: block;
- }
- &:hover {
- overflow-y: auto;
- }
- & > li {
- display: block;
- &:hover {
- background-color: $vxe-input-date-picker-hover-background-color;
- cursor: pointer;
- }
- &.is--selected {
- font-weight: 700;
- color: $vxe-primary-color;
- }
- }
- }
- .vxe-input--time-picker-minute-list {
- border-left: 1px solid $vxe-table-popup-border-color;
- }
- .vxe-input--time-picker-second-list {
- border-left: 1px solid $vxe-table-popup-border-color;
- }
- }
- .vxe-input {
- font-size: $vxe-font-size;
- height: $vxe-input-height-default;
- .vxe-input--inner {
- &[type="date"]::-webkit-inner-spin-button,
- &[type="month"]::-webkit-inner-spin-button,
- &[type="week"]::-webkit-inner-spin-button {
- margin-top: 6px;
- }
- &[type="date"]::-webkit-inner-spin-button,
- &[type="month"]::-webkit-inner-spin-button,
- &[type="week"]::-webkit-inner-spin-button,
- &[type="number"]::-webkit-inner-spin-button {
- height: 24px;
- }
- }
- &.size--medium {
- font-size: $vxe-font-size-medium;
- height: $vxe-input-height-medium;
- .vxe-input--inner {
- &[type="date"]::-webkit-inner-spin-button,
- &[type="month"]::-webkit-inner-spin-button,
- &[type="week"]::-webkit-inner-spin-button {
- margin-top: 4px;
- }
- }
- }
- &.size--small {
- font-size: $vxe-font-size-small;
- height: $vxe-input-height-small;
- .vxe-input--inner {
- &[type="date"]::-webkit-inner-spin-button,
- &[type="month"]::-webkit-inner-spin-button,
- &[type="week"]::-webkit-inner-spin-button {
- margin-top: 2px;
- }
- }
- }
- &.size--mini {
- font-size: $vxe-font-size-mini;
- height: $vxe-input-height-mini;
- .vxe-input--inner {
- &[type="date"]::-webkit-inner-spin-button,
- &[type="month"]::-webkit-inner-spin-button,
- &[type="week"]::-webkit-inner-spin-button {
- margin-top: 0;
- }
- }
- }
- }
- @mixin getPanelStyle ($sizeIndex) {
- $fontSizeList: $vxe-font-size, $vxe-font-size-medium, $vxe-font-size-small, $vxe-font-size-mini;
- $timeWeekRowHeightList: $vxe-input-date-time-week-row-height-default, $vxe-input-date-time-week-row-height-medium, $vxe-input-date-time-week-row-height-small, $vxe-input-date-time-week-row-height-mini;
- $monthYearRowHeightList: $vxe-input-date-month-year-row-height-default, $vxe-input-date-month-year-row-height-medium, $vxe-input-date-month-year-row-height-small, $vxe-input-date-month-year-row-height-mini;
- $titleRowHeightList: $vxe-input-date-title-height-default, $vxe-input-date-title-height-medium, $vxe-input-date-title-height-small, $vxe-input-date-title-height-mini;
-
- font-size: nth($fontSizeList, $sizeIndex);
- .vxe-input--panel-wrapper {
- max-height: 400px - $sizeIndex * 20;
- }
- &.type--date,
- &.type--time,
- &.type--week,
- &.type--month,
- &.type--year {
- .vxe-input--panel-wrapper {
- padding: 12px - $sizeIndex;
- }
- }
- &.type--date,
- &.type--month,
- &.type--year {
- .vxe-input--panel-wrapper {
- $widthList: 336px, 336px, 312px, 288px;
- width: nth($widthList, $sizeIndex);
- }
- }
- &.type--week {
- .vxe-input--panel-wrapper {
- $widthList: 380px, 380px, 354px, 326px;
- width: nth($widthList, $sizeIndex);
- }
- }
- &.type--time {
- .vxe-input--panel-wrapper {
- $widthList: 170px, 168px, 154px, 146px;
- width: nth($widthList, $sizeIndex);
- }
- }
- &.type--datetime {
- .vxe-input--panel-left-wrapper {
- $widthList: 336px, 336px, 312px, 288px;
- width: nth($widthList, $sizeIndex);
- }
- .vxe-input--panel-left-wrapper,
- .vxe-input--panel-right-wrapper {
- padding: 12px - $sizeIndex;
- }
- }
- .vxe-input--time-picker-title {
- height: 31px - $sizeIndex;
- line-height: 31px - $sizeIndex;
- padding: 0 12px - $sizeIndex;
- }
- .vxe-input--date-picker-label,
- .vxe-input--date-picker-btn {
- height: 31px - $sizeIndex;
- line-height: 31px - $sizeIndex;
- }
- .vxe-input--date-picker-btn-wrapper {
- .vxe-input--date-picker-btn {
- width: 31px - $sizeIndex;
- margin-left: 9px - $sizeIndex;
- }
- }
- .vxe-input--date-picker-type-wrapper {
- .vxe-input--date-picker-label,
- .vxe-input--date-picker-btn {
- padding: 0 10px - $sizeIndex;
- }
- }
- .vxe-input--time-picker-header,
- .vxe-input--date-picker-header {
- $paddingBottomList: 8px, 7px, 6px, 5px;
- padding-bottom: nth($paddingBottomList, $sizeIndex);
- }
- .vxe-input--date-picker-body table,
- .vxe-input--time-picker-body {
- height: nth($timeWeekRowHeightList, $sizeIndex) * 6 + nth($titleRowHeightList, $sizeIndex);
- }
- .vxe-input--time-picker-body {
- $ulWidthList: 48px, 48px, 44px, 42px;
- & > ul {
- width: nth($ulWidthList, $sizeIndex);
- &:before,
- &:after {
- $heightList: 120px, 120px, 110px, 100px;
- height: nth($heightList, $sizeIndex);
- }
- & > li {
- height: 26px;
- padding-left: 10px - $sizeIndex;
- }
- }
- .vxe-input--time-picker-minute-list {
- left: nth($ulWidthList, $sizeIndex);
- }
- .vxe-input--time-picker-second-list {
- left: nth($ulWidthList, $sizeIndex) * 2;
- }
- }
- .vxe-input--date-day-view,
- .vxe-input--date-week-view {
- td {
- height: nth($timeWeekRowHeightList, $sizeIndex);
- }
- }
- .vxe-input--date-month-view,
- .vxe-input--date-year-view {
- td {
- height: nth($monthYearRowHeightList, $sizeIndex);
- }
- }
- .vxe-input--date-picker-body {
- th {
- height: nth($titleRowHeightList, $sizeIndex);
- }
- }
- .vxe-input--time-picker-confirm {
- height: 31px - $sizeIndex;
- padding: 0 10px - $sizeIndex;
- }
- .vxe-input--date-label {
- line-height: nth($fontSizeList, $sizeIndex) + 1;
- }
- }
- .vxe-input--panel {
- @include getPanelStyle(1);
- &.size--medium {
- @include getPanelStyle(2);
- }
- &.size--small {
- @include getPanelStyle(3);
- }
- &.size--mini {
- @include getPanelStyle(4);
- }
- }
|