vendor: amis 6.13.0 base (fork root)
This commit is contained in:
313
packages/amis-ui/scss/components/_list.scss
Normal file
313
packages/amis-ui/scss/components/_list.scss
Normal file
@@ -0,0 +1,313 @@
|
||||
.#{$ns}List {
|
||||
position: relative;
|
||||
// 黑科技,让 scrollIntoView 能够跑正确的位置
|
||||
// margin-top: calc(var(--affix-offset-top) * -1);
|
||||
// padding-top: var(--affix-offset-top);
|
||||
scroll-margin-top: var(--affix-offset-top);
|
||||
|
||||
&-items {
|
||||
border-radius: var(--List-borderRadius);
|
||||
border: var(--List-borderWidth) solid var(--List-borderColor);
|
||||
background: var(--List-bg);
|
||||
margin-bottom: var(--gap-sm);
|
||||
margin-right: px2rem(15px);
|
||||
}
|
||||
|
||||
&-toolbar {
|
||||
@include clearfix();
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: var(--List-toolbar-marginY) var(--List-toolbar-marginX)
|
||||
var(--List-toolbar-marginY);
|
||||
}
|
||||
|
||||
&-actions {
|
||||
display: inline-block;
|
||||
|
||||
> * {
|
||||
margin-right: var(--Crud-toolbar-gap);
|
||||
}
|
||||
}
|
||||
|
||||
&-header {
|
||||
padding: var(--List-toolbar-marginY) var(--List-toolbar-marginX);
|
||||
|
||||
> * + .#{$ns}Button,
|
||||
> * + .#{$ns}ButtonGroup,
|
||||
> * + .#{$ns}ButtonToolbar {
|
||||
margin-left: var(--Crud-toolbar-gap);
|
||||
}
|
||||
}
|
||||
|
||||
&-header + &-toolbar {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
&-heading {
|
||||
padding: var(--gap-xs) 0;
|
||||
}
|
||||
|
||||
&-fixedTop {
|
||||
position: sticky;
|
||||
background: var(--white);
|
||||
z-index: $zindex-sticky;
|
||||
top: var(--affix-offset-top);
|
||||
// box-shadow: var(--List-fixedTop-boxShadow);
|
||||
// padding: var(--gap-sm);
|
||||
|
||||
.#{$ns}Cards-toolbar {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&--unsaved &-heading {
|
||||
background: var(--List--unsaved-heading-bg);
|
||||
color: var(--List--unsaved-heading-color);
|
||||
padding: var(--gap-xs) var(--gap-sm);
|
||||
margin-bottom: var(--gap-sm);
|
||||
}
|
||||
|
||||
&-dragTip {
|
||||
width: 100%;
|
||||
color: var(--info);
|
||||
clear: both;
|
||||
margin-top: var(--gap-xs);
|
||||
}
|
||||
|
||||
&-placeholder {
|
||||
color: var(--text--muted-color);
|
||||
text-align: center;
|
||||
min-height: var(--List-placeholder-height);
|
||||
line-height: var(--List-placeholder-height);
|
||||
}
|
||||
|
||||
&-footToolbar--affix,
|
||||
&-footer--affix {
|
||||
position: sticky;
|
||||
bottom: var(--affix-offset-bottom);
|
||||
background: var(--Table-bg);
|
||||
z-index: $zindex-sticky;
|
||||
}
|
||||
|
||||
&-content-wrapper {
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&-main {
|
||||
flex: 1;
|
||||
min-width: 0; // 防止内容溢出
|
||||
}
|
||||
}
|
||||
|
||||
.#{$ns}ListGroup {
|
||||
max-width: px2rem(400px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
&-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
padding: var(--ListItem-paddingY) var(--ListItem-paddingX);
|
||||
margin-bottom: px2rem(-1px);
|
||||
background: var(--white);
|
||||
border: var(--ListItem-borderWidth) solid var(--List-borderColor);
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: var(--borderRadius);
|
||||
border-top-right-radius: var(--borderRadius);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom-left-radius: var(--borderRadius);
|
||||
border-bottom-right-radius: var(--borderRadius);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
// todo
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
// todo
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
color: var(--text--muted-color);
|
||||
}
|
||||
}
|
||||
|
||||
&--expanded {
|
||||
.#{$ns}ListGroup-item {
|
||||
border-radius: var(--borderRadius);
|
||||
|
||||
margin-bottom: var(--gap-sm);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.#{$ns}ListItem {
|
||||
@include clearfix();
|
||||
|
||||
& + & {
|
||||
border-top: var(--ListItem-borderWidth) solid var(--List-borderColor);
|
||||
}
|
||||
|
||||
position: relative;
|
||||
display: block;
|
||||
padding: var(--ListItem-paddingY) var(--ListItem-paddingX);
|
||||
|
||||
&:nth-child(even) {
|
||||
background: var(--ListItem--strip-bg);
|
||||
}
|
||||
|
||||
&-checkBtn {
|
||||
float: left;
|
||||
margin-right: var(--gap-sm);
|
||||
}
|
||||
|
||||
&-dragBtn {
|
||||
cursor: move;
|
||||
float: left;
|
||||
margin-right: var(--gap-sm);
|
||||
}
|
||||
|
||||
&-actions {
|
||||
float: right;
|
||||
}
|
||||
|
||||
&--actions-at-left &-actions {
|
||||
float: left;
|
||||
margin-right: var(--gap-base);
|
||||
}
|
||||
|
||||
&-title {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: var(--fontSizeBase);
|
||||
color: var(--text--loud-color);
|
||||
font-weight: var(--fontWeightNormal);
|
||||
}
|
||||
|
||||
&-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-field {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
&-fieldValue {
|
||||
position: relative;
|
||||
flex-basis: 0;
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
&-fieldLabel {
|
||||
width: px2rem(150px);
|
||||
color: var(--text--muted-color);
|
||||
}
|
||||
|
||||
&.is-checked {
|
||||
background: var(--ListItem-onChecked-bg);
|
||||
border-color: var(--ListItem-onChecked-borderColor);
|
||||
color: var(--ListItem-onChecked-color);
|
||||
|
||||
+ .#{$ns}ListItem {
|
||||
border-color: var(--ListItem-onChecked-borderColor);
|
||||
}
|
||||
|
||||
.#{$ns}ListItem-fieldLabel {
|
||||
color: var(--ListItem-onChecked-fieldLabel-color);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-modified,
|
||||
&.is-moved {
|
||||
background: var(--ListItem-onModified-bg);
|
||||
border-color: var(--ListItem-onModified-borderColor);
|
||||
color: var(--ListItem-onModified-color);
|
||||
|
||||
+ .#{$ns}ListItem {
|
||||
border-color: var(--ListItem-onModified-borderColor);
|
||||
}
|
||||
|
||||
.#{$ns}ListItem-fieldLabel {
|
||||
color: var(--ListItem-onModified-fieldLabel-color);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-dragging {
|
||||
opacity: var(--ListItem-onDragging-opacity);
|
||||
}
|
||||
|
||||
&--hasItemAction {
|
||||
cursor: pointer;
|
||||
}
|
||||
&--hasItemAction:hover {
|
||||
color: var(--ListMenu-item--onHover-color);
|
||||
background: var(--ListMenu-item--onHover-bg);
|
||||
}
|
||||
}
|
||||
|
||||
// 修改索引条样式
|
||||
.#{$ns}AlphabetIndexer {
|
||||
position: sticky;
|
||||
top: calc(var(--affix-offset-top) + var(--gap-base));
|
||||
right: px2rem(5px);
|
||||
height: fit-content;
|
||||
padding: px2rem(10px) px2rem(5px);
|
||||
background: var(--white);
|
||||
border-radius: var(--borderRadius);
|
||||
box-shadow: var(--boxShadow);
|
||||
z-index: 1050;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-self: flex-start;
|
||||
overflow-y: auto;
|
||||
|
||||
// 移动端样式
|
||||
@media (max-width: 768px) {
|
||||
position: sticky;
|
||||
top: calc(var(--affix-offset-top) + var(--gap-base));
|
||||
right: px2rem(5px);
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
&-letter {
|
||||
font-size: var(--fontSizeSm);
|
||||
padding: px2rem(2px) px2rem(4px);
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: px2rem(1px) px2rem(2px);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
color: var(--white);
|
||||
background: var(--primary);
|
||||
border-radius: var(--borderRadius-sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user