index.scss 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. .utv-tree-item {
  2. position: relative;
  3. z-index: 0;
  4. box-sizing: border-box;
  5. display: flex;
  6. align-items: center;
  7. min-height: 88rpx;
  8. padding-right: 24rpx;
  9. color: #666666;
  10. border-bottom: 2rpx solid #F3F3F3;
  11. &:nth-child(1){
  12. border-top: 2rpx solid #F3F3F3;
  13. }
  14. // hover-class 按压反馈,兼容微信/支付宝小程序与 H5
  15. &--hover {
  16. background-color: rgba(17, 24, 39, 0.04);
  17. }
  18. &.is-disabled {
  19. color: #666666;
  20. }
  21. // 状态层始终保留在节点树中,选中时只改 opacity。
  22. // 避免小程序在选中/反选时反复创建伪元素并重新合成整行。
  23. &__state-layer {
  24. position: absolute;
  25. top: 0;
  26. right: 0;
  27. bottom: 0;
  28. left: 0;
  29. z-index: 0;
  30. // background-color: var(--theme-color, #007aff);
  31. opacity: 0;
  32. pointer-events: none;
  33. transition: opacity 0.2s ease;
  34. }
  35. &.is-checked &__state-layer {
  36. opacity: 0.06;
  37. }
  38. &.is-checked .utv-tree-node-label {
  39. color: var(--theme-color, #007aff);
  40. }
  41. &.is-disabled &__state-layer {
  42. opacity: 0;
  43. }
  44. &.is-disabled.is-checked .utv-tree-node-label {
  45. color: #666666;
  46. }
  47. &__arrow-placeholder {
  48. flex: 0 0 40rpx;
  49. width: 40rpx;
  50. height: 40rpx;
  51. }
  52. &__arrow-icon {
  53. position: relative;
  54. flex: 0 0 40rpx;
  55. display: flex;
  56. align-items: center;
  57. justify-content: center;
  58. width: 40rpx;
  59. height: 40rpx;
  60. &::after {
  61. position: relative;
  62. z-index: 1;
  63. overflow: hidden;
  64. /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
  65. font-family: "uni-tree-iconfont" !important;
  66. font-size: 32rpx;
  67. font-style: normal;
  68. color: #999999;
  69. transition: transform 0.2s ease;
  70. -webkit-font-smoothing: antialiased;
  71. -moz-osx-font-smoothing: grayscale;
  72. }
  73. &.is-right::after {
  74. content: '\e604';
  75. transform: rotate(-90deg);
  76. }
  77. &.is-expand::after {
  78. transform: rotate(0deg);
  79. }
  80. &.is-loading {
  81. animation: IconLoading 1s linear 0s infinite;
  82. &::after {
  83. content: '\e7f1';
  84. }
  85. }
  86. &.is-load-error::after {
  87. color: #e5484d;
  88. content: "!";
  89. font-family: sans-serif !important;
  90. font-weight: 600;
  91. transform: none;
  92. }
  93. }
  94. &__checkbox {
  95. flex: 0 0 48rpx;
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. width: 48rpx;
  100. height: 48rpx;
  101. overflow: hidden;
  102. &.is-disabled {
  103. // opacity: 0.45;
  104. .utv-tree-checkbox-checked::after {
  105. color: #C0C4CC;
  106. }
  107. }
  108. &-icon {
  109. position: relative;
  110. display: flex;
  111. align-items: center;
  112. justify-content: center;
  113. width: 40rpx;
  114. height: 40rpx;
  115. &::after {
  116. position: relative;
  117. top: 0;
  118. left: 0;
  119. z-index: 1;
  120. overflow: hidden;
  121. /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
  122. font-family: "uni-tree-iconfont" !important;
  123. font-size: 36rpx;
  124. font-style: normal;
  125. transition: color 0.2s ease;
  126. -webkit-font-smoothing: antialiased;
  127. -moz-osx-font-smoothing: grayscale;
  128. }
  129. &.utv-tree-checkbox-outline::after {
  130. color: #bbb;
  131. content: "\ead5";
  132. }
  133. &.utv-tree-checkbox-checked::after {
  134. color: var(--theme-color,#007aff);
  135. content: "\ead4";
  136. }
  137. &.utv-tree-checkbox-indeterminate::after {
  138. color: var(--theme-color,#007aff);
  139. content: "\ebce";
  140. }
  141. &.utv-tree-radio-outline::after {
  142. color: #bbb;
  143. content: "\ecc5";
  144. }
  145. &.utv-tree-radio-checked::after {
  146. color: var(--theme-color,#007aff);
  147. content: "\ecc4";
  148. }
  149. &.utv-tree-radio-indeterminate::after {
  150. color: var(--theme-color,#007aff);
  151. content: "\ea4f";
  152. }
  153. }
  154. }
  155. &.is-virtual &__checkbox {
  156. height: 100%;
  157. }
  158. }
  159. .utv-tree-node-label {
  160. flex: 1;
  161. min-width: 0;
  162. padding: 0 4rpx;
  163. overflow: hidden;
  164. font-size: 28rpx;
  165. line-height: 40rpx;
  166. text-overflow: ellipsis;
  167. white-space: nowrap;
  168. &.parent{
  169. font-weight: 500;
  170. color: #333333;
  171. }
  172. }
  173. .utv-tree-node-label__match {
  174. color: var(--theme-color, #007aff);
  175. font-weight: 600;
  176. }
  177. .utv-tree-item.is-disabled .utv-tree-node-label__match {
  178. color: inherit;
  179. }
  180. .utv-tree-node-content {
  181. display: flex;
  182. flex: 1;
  183. align-items: center;
  184. min-width: 0;
  185. }
  186. .utv-tree-node-main {
  187. flex: 1;
  188. min-width: 0;
  189. }
  190. .utv-tree-node-icon {
  191. flex: 0 0 auto;
  192. padding-left: 16rpx;
  193. font-size: 28rpx;
  194. line-height: 40rpx;
  195. }
  196. .utv-tree-node-icon + .utv-tree-node-main .utv-tree-node-label {
  197. padding-left: 8rpx;
  198. }
  199. .utv-tree-node-append {
  200. flex: 0 0 auto;
  201. max-width: 40%;
  202. padding-left: 16rpx;
  203. overflow: hidden;
  204. color: #667085;
  205. font-size: 24rpx;
  206. line-height: 36rpx;
  207. text-overflow: ellipsis;
  208. white-space: nowrap;
  209. }
  210. .utv-tree-node-path {
  211. padding: 0 16rpx;
  212. overflow: hidden;
  213. color: #98a2b3;
  214. font-size: 22rpx;
  215. line-height: 32rpx;
  216. text-overflow: ellipsis;
  217. white-space: nowrap;
  218. }
  219. .utv-tree-empty {
  220. padding: 64rpx 24rpx;
  221. color: #98a2b3;
  222. font-size: 28rpx;
  223. line-height: 40rpx;
  224. text-align: center;
  225. }
  226. // 加载图标旋转动画;此前被 .is-loading 引用但未定义
  227. @keyframes IconLoading {
  228. 0% {
  229. transform: rotate(0deg);
  230. }
  231. 100% {
  232. transform: rotate(360deg);
  233. }
  234. }