| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- .utv-tree-item {
- position: relative;
- z-index: 0;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- min-height: 88rpx;
- padding-right: 24rpx;
- color: #666666;
- border-bottom: 2rpx solid #F3F3F3;
- &:nth-child(1){
- border-top: 2rpx solid #F3F3F3;
- }
- // hover-class 按压反馈,兼容微信/支付宝小程序与 H5
- &--hover {
- background-color: rgba(17, 24, 39, 0.04);
- }
- &.is-disabled {
- color: #666666;
- }
- // 状态层始终保留在节点树中,选中时只改 opacity。
- // 避免小程序在选中/反选时反复创建伪元素并重新合成整行。
- &__state-layer {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 0;
- // background-color: var(--theme-color, #007aff);
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.2s ease;
- }
- &.is-checked &__state-layer {
- opacity: 0.06;
- }
- &.is-checked .utv-tree-node-label {
- color: var(--theme-color, #007aff);
- }
- &.is-disabled &__state-layer {
- opacity: 0;
- }
- &.is-disabled.is-checked .utv-tree-node-label {
- color: #666666;
- }
- &__arrow-placeholder {
- flex: 0 0 40rpx;
- width: 40rpx;
- height: 40rpx;
- }
- &__arrow-icon {
- position: relative;
- flex: 0 0 40rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 40rpx;
- height: 40rpx;
- &::after {
- position: relative;
- z-index: 1;
- overflow: hidden;
- /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
- font-family: "uni-tree-iconfont" !important;
- font-size: 32rpx;
- font-style: normal;
- color: #999999;
- transition: transform 0.2s ease;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- &.is-right::after {
- content: '\e604';
- transform: rotate(-90deg);
- }
- &.is-expand::after {
- transform: rotate(0deg);
- }
- &.is-loading {
- animation: IconLoading 1s linear 0s infinite;
- &::after {
- content: '\e7f1';
- }
- }
- &.is-load-error::after {
- color: #e5484d;
- content: "!";
- font-family: sans-serif !important;
- font-weight: 600;
- transform: none;
- }
- }
- &__checkbox {
- flex: 0 0 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 48rpx;
- height: 48rpx;
- overflow: hidden;
- &.is-disabled {
- // opacity: 0.45;
- .utv-tree-checkbox-checked::after {
- color: #C0C4CC;
- }
- }
- &-icon {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 40rpx;
- height: 40rpx;
- &::after {
- position: relative;
- top: 0;
- left: 0;
- z-index: 1;
- overflow: hidden;
- /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
- font-family: "uni-tree-iconfont" !important;
- font-size: 36rpx;
- font-style: normal;
- transition: color 0.2s ease;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- &.utv-tree-checkbox-outline::after {
- color: #bbb;
- content: "\ead5";
- }
- &.utv-tree-checkbox-checked::after {
- color: var(--theme-color,#007aff);
- content: "\ead4";
- }
- &.utv-tree-checkbox-indeterminate::after {
- color: var(--theme-color,#007aff);
- content: "\ebce";
- }
- &.utv-tree-radio-outline::after {
- color: #bbb;
- content: "\ecc5";
- }
- &.utv-tree-radio-checked::after {
- color: var(--theme-color,#007aff);
- content: "\ecc4";
- }
- &.utv-tree-radio-indeterminate::after {
- color: var(--theme-color,#007aff);
- content: "\ea4f";
- }
- }
- }
- &.is-virtual &__checkbox {
- height: 100%;
- }
- }
- .utv-tree-node-label {
- flex: 1;
- min-width: 0;
- padding: 0 4rpx;
- overflow: hidden;
- font-size: 28rpx;
- line-height: 40rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- &.parent{
- font-weight: 500;
- color: #333333;
- }
- }
- .utv-tree-node-label__match {
- color: var(--theme-color, #007aff);
- font-weight: 600;
- }
- .utv-tree-item.is-disabled .utv-tree-node-label__match {
- color: inherit;
- }
- .utv-tree-node-content {
- display: flex;
- flex: 1;
- align-items: center;
- min-width: 0;
- }
- .utv-tree-node-main {
- flex: 1;
- min-width: 0;
- }
- .utv-tree-node-icon {
- flex: 0 0 auto;
- padding-left: 16rpx;
- font-size: 28rpx;
- line-height: 40rpx;
- }
- .utv-tree-node-icon + .utv-tree-node-main .utv-tree-node-label {
- padding-left: 8rpx;
- }
- .utv-tree-node-append {
- flex: 0 0 auto;
- max-width: 40%;
- padding-left: 16rpx;
- overflow: hidden;
- color: #667085;
- font-size: 24rpx;
- line-height: 36rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .utv-tree-node-path {
- padding: 0 16rpx;
- overflow: hidden;
- color: #98a2b3;
- font-size: 22rpx;
- line-height: 32rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .utv-tree-empty {
- padding: 64rpx 24rpx;
- color: #98a2b3;
- font-size: 28rpx;
- line-height: 40rpx;
- text-align: center;
- }
- // 加载图标旋转动画;此前被 .is-loading 引用但未定义
- @keyframes IconLoading {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
- }
|