amis2/scss/components/_list.scss

250 lines
4.7 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}List {
2019-12-06 09:58:08 +08:00
position: relative;
2019-04-30 11:11:25 +08:00
&-items {
border-radius: var(--List-borderRadius);
border: var(--List-borderWidth) solid var(--List-borderColor);
background: var(--List-bg);
2021-07-08 10:49:43 +08:00
margin-bottom: var(--gap-sm);
}
2019-12-06 09:58:08 +08:00
&-toolbar {
@include clearfix();
display: flex;
2020-06-08 15:49:45 +08:00
flex-wrap: wrap;
margin: 0 var(--List-toolbar-marginX) var(--List-toolbar-marginY);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-actions {
display: inline-block;
2019-12-06 09:58:08 +08:00
> * {
margin-right: var(--Crud-toolbar-gap);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-header {
padding: var(--List-toolbar-marginY) var(--List-toolbar-marginX);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
> * + .#{$ns}Button,
> * + .#{$ns}ButtonGroup,
> * + .#{$ns}ButtonToolbar {
margin-left: var(--Crud-toolbar-gap);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-header + &-toolbar {
padding-top: 0;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-heading {
padding: var(--gap-xs) 0;
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-fixedTop {
position: absolute;
background: var(--white);
2019-12-06 09:58:08 +08:00
z-index: -1;
opacity: 0;
box-shadow: var(--List-fixedTop-boxShadow);
// padding: var(--gap-sm);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.in {
position: fixed;
opacity: 1;
z-index: $zindex-affix;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}Cards-toolbar {
margin-bottom: 0;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:empty {
display: none;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&--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);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-dragTip {
2020-06-08 15:49:45 +08:00
width: 100%;
color: var(--info);
2019-12-06 09:58:08 +08:00
clear: both;
margin-top: var(--gap-xs);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-placeholder {
color: var(--text--muted-color);
2019-12-06 09:58:08 +08:00
text-align: center;
min-height: var(--List-placeholder-height);
line-height: var(--List-placeholder-height);
2019-12-06 09:58:08 +08:00
}
}
2019-04-30 11:11:25 +08:00
2020-06-08 13:55:05 +08:00
.#{$ns}ListGroup {
max-width: px2rem(400px);
display: flex;
flex-direction: column;
&-item {
position: relative;
display: block;
padding: var(--ListItem-paddingY) var(--ListItem-paddingX);
2020-06-08 13:55:05 +08:00
margin-bottom: px2rem(-1px);
background: var(--white);
border: var(--ListItem-borderWidth) solid var(--List-borderColor);
2020-06-08 13:55:05 +08:00
&:first-child {
border-top-left-radius: var(--borderRadius);
border-top-right-radius: var(--borderRadius);
2020-06-08 13:55:05 +08:00
}
&:last-child {
border-bottom-left-radius: var(--borderRadius);
border-bottom-right-radius: var(--borderRadius);
2020-06-08 13:55:05 +08:00
margin-bottom: 0;
}
&:hover {
// todo
z-index: 1;
}
&.is-active {
// todo
z-index: 2;
}
&.is-disabled {
color: var(--text--muted-color);
2020-06-08 13:55:05 +08:00
}
}
&--expanded {
.#{$ns}ListGroup-item {
border-radius: var(--borderRadius);
2020-06-08 13:55:05 +08:00
margin-bottom: var(--gap-sm);
2020-06-08 13:55:05 +08:00
&:last-child {
margin-bottom: 0;
}
}
}
}
2019-12-06 09:58:08 +08:00
.#{$ns}ListItem {
@include clearfix();
& + & {
border-top: var(--ListItem-borderWidth) solid var(--ListItem-borderColor);
2019-12-06 09:58:08 +08:00
}
position: relative;
display: block;
padding: var(--ListItem-paddingY) var(--ListItem-paddingX);
2019-12-06 09:58:08 +08:00
&:nth-child(even) {
background: var(--ListItem--strip-bg);
2019-12-06 09:58:08 +08:00
}
&-checkBtn {
float: left;
margin-right: var(--gap-sm);
2019-12-06 09:58:08 +08:00
}
&-dragBtn {
2020-06-08 15:49:45 +08:00
cursor: move;
2019-12-06 09:58:08 +08:00
float: left;
margin-right: var(--gap-sm);
2019-12-06 09:58:08 +08:00
}
&-actions {
float: right;
}
&--actions-at-left &-actions {
float: left;
margin-right: var(--gap-base);
}
2019-12-06 09:58:08 +08:00
&-title {
margin: 0;
padding: 0;
font-size: var(--fontSizeBase);
color: var(--text--loud-color);
font-weight: var(--fontWeightNormal);
2019-12-06 09:58:08 +08:00
}
&-content {
overflow: hidden;
}
&-field {
position: relative;
display: flex;
flex-wrap: nowrap;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-fieldValue {
position: relative;
flex-basis: 0;
flex-grow: 1;
max-width: 100%;
2019-12-24 11:25:55 +08:00
width: 0;
overflow: hidden;
text-overflow: ellipsis;
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-fieldLabel {
width: px2rem(150px);
color: var(--text--muted-color);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.is-checked {
background: var(--ListItem-onChecked-bg);
border-color: var(--ListItem-onChecked-borderColor);
color: var(--ListItem-onChecked-color);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
+ .#{$ns}ListItem {
border-color: var(--ListItem-onChecked-borderColor);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}ListItem-fieldLabel {
color: var(--ListItem-onChecked-fieldLabel-color);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.is-modified,
&.is-moved {
background: var(--ListItem-onModified-bg);
border-color: var(--ListItem-onModified-borderColor);
color: var(--ListItem-onModified-color);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
+ .#{$ns}ListItem {
border-color: var(--ListItem-onModified-borderColor);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}ListItem-fieldLabel {
color: var(--ListItem-onModified-fieldLabel-color);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.is-dragging {
opacity: var(--ListItem-onDragging-opacity);
2019-12-06 09:58:08 +08:00
}
&--hasItemAction {
cursor: pointer;
}
&--hasItemAction:hover {
color: var(--ListMenu-item--onHover-color);
background: var(--ListMenu-item--onHover-bg);
}
2019-12-06 09:58:08 +08:00
}