uview-plus 3.7.32 → 3.8.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +0 -1
  2. package/changelog.md +1993 -1808
  3. package/components/u-action-sheet/u-action-sheet.vue +54 -16
  4. package/components/u-agreement/u-agreement.vue +2 -1
  5. package/components/u-alert/u-alert.vue +8 -10
  6. package/components/u-button/u-button.vue +35 -5
  7. package/components/u-calendar/calendar.js +1 -0
  8. package/components/u-calendar/header.vue +98 -9
  9. package/components/u-calendar/month.vue +10 -7
  10. package/components/u-calendar/props.js +5 -0
  11. package/components/u-calendar/u-calendar.vue +109 -2
  12. package/components/u-car-keyboard/u-car-keyboard.vue +7 -7
  13. package/components/u-card/u-card.vue +6 -6
  14. package/components/u-cascader/u-cascader.vue +32 -12
  15. package/components/u-cate-tab/u-cate-tab.vue +49 -48
  16. package/components/u-cell/u-cell.vue +24 -4
  17. package/components/u-cell-group/u-cell-group.vue +10 -3
  18. package/components/u-checkbox/u-checkbox.vue +6 -6
  19. package/components/u-choose/u-choose.vue +9 -4
  20. package/components/u-city-locate/u-city-locate.vue +28 -22
  21. package/components/u-color-picker/u-color-picker.vue +15 -15
  22. package/components/u-datetime-picker/u-datetime-picker.vue +79 -10
  23. package/components/u-dragsort/u-dragsort.vue +3 -0
  24. package/components/u-dropdown/u-dropdown.vue +15 -2
  25. package/components/u-dropdown-item/u-dropdown-item.vue +3 -3
  26. package/components/u-form-item/u-form-item.vue +6 -1
  27. package/components/u-gap/u-gap.vue +5 -1
  28. package/components/u-goods-sku/u-goods-sku.vue +16 -15
  29. package/components/u-index-anchor/u-index-anchor.vue +13 -2
  30. package/components/u-index-list/u-index-list.vue +18 -5
  31. package/components/u-input/input.js +3 -3
  32. package/components/u-input/u-input.vue +27 -5
  33. package/components/u-keyboard/u-keyboard.vue +11 -6
  34. package/components/u-loading-page/loadingPage.js +1 -1
  35. package/components/u-loading-page/u-loading-page.vue +18 -12
  36. package/components/u-navbar/navbar.js +2 -3
  37. package/components/u-navbar/theme-vars.scss +21 -0
  38. package/components/u-navbar/u-navbar.vue +30 -6
  39. package/components/u-notice-bar/theme-vars.scss +25 -0
  40. package/components/u-notice-bar/u-notice-bar.vue +24 -5
  41. package/components/u-number-box/numberBox.js +4 -4
  42. package/components/u-number-box/u-number-box.vue +27 -13
  43. package/components/u-number-keyboard/u-number-keyboard.vue +6 -6
  44. package/components/u-picker/picker.js +43 -43
  45. package/components/u-picker/u-picker.vue +14 -2
  46. package/components/u-popup/popup.js +1 -1
  47. package/components/u-popup/u-popup.vue +14 -6
  48. package/components/u-pull-refresh/u-pull-refresh.vue +6 -6
  49. package/components/u-radio/u-radio.vue +6 -6
  50. package/components/u-rate/rate.js +2 -2
  51. package/components/u-rate/u-rate.vue +98 -21
  52. package/components/u-search/search.js +3 -3
  53. package/components/u-search/u-search.vue +29 -6
  54. package/components/u-select/u-select.vue +141 -73
  55. package/components/u-signature/u-signature.vue +35 -16
  56. package/components/u-skeleton/u-skeleton.vue +7 -2
  57. package/components/u-slider/u-slider.vue +30 -31
  58. package/components/u-steps-item/u-steps-item.vue +20 -17
  59. package/components/u-subsection/theme-vars.scss +41 -0
  60. package/components/u-subsection/u-subsection.vue +69 -16
  61. package/components/u-swipe-action-item/u-swipe-action-item.vue +11 -5
  62. package/components/u-switch/theme-vars.scss +41 -0
  63. package/components/u-switch/u-switch.vue +44 -15
  64. package/components/u-tabbar/u-tabbar.vue +5 -5
  65. package/components/u-tabbar-item/u-tabbar-item.vue +16 -5
  66. package/components/u-table/u-table.vue +18 -3
  67. package/components/u-table2/tableRow.vue +43 -41
  68. package/components/u-table2/u-table2.vue +56 -50
  69. package/components/u-tabs/u-tabs.vue +14 -1
  70. package/components/u-tag/theme-vars.scss +21 -0
  71. package/components/u-tag/u-tag.vue +17 -7
  72. package/components/u-td/u-td.vue +5 -3
  73. package/components/u-text/text.js +1 -1
  74. package/components/u-text/u-text.vue +15 -13
  75. package/components/u-textarea/props.js +2 -2
  76. package/components/u-textarea/textarea.js +1 -1
  77. package/components/u-textarea/u-textarea.vue +115 -61
  78. package/components/u-th/u-th.vue +5 -4
  79. package/components/u-title/u-title.vue +1 -0
  80. package/components/u-toast/u-toast.vue +8 -8
  81. package/components/u-tree/u-tree.vue +491 -51
  82. package/components/u-upload/u-upload.vue +34 -6
  83. package/index.js +178 -27
  84. package/index.scss +5 -1
  85. package/libs/config/color.js +1 -2
  86. package/libs/config/props.js +1 -1
  87. package/libs/css/theme-vars-core.scss +197 -0
  88. package/libs/css/theme-vars.scss +1 -0
  89. package/libs/function/index.js +8 -8
  90. package/libs/mixin/mixin.js +117 -5
  91. package/libs/root/index.js +175 -0
  92. package/libs/root/nvue-root.vue +72 -0
  93. package/libs/root/page.js +269 -0
  94. package/libs/root/root-toast-host.vue +31 -0
  95. package/libs/root/root.js +40 -0
  96. package/libs/root/runtime.js +11 -0
  97. package/libs/root/utils.js +115 -0
  98. package/libs/theme/runtime.js +391 -0
  99. package/libs/theme/theme.js +684 -0
  100. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  101. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  102. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  103. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  104. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  105. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  106. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  107. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  108. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  109. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  110. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  111. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  112. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  113. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  114. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  115. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  116. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  117. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  118. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  119. package/libs/util/gcanvas/env/canvas.js +0 -0
  120. package/libs/util/gcanvas/env/image.js +0 -0
  121. package/libs/util/gcanvas/env/tool.js +0 -0
  122. package/libs/util/gcanvas/index.js +0 -0
  123. package/package.json +1 -1
  124. package/theme.scss +113 -32
  125. package/types/comps/stepsItem.d.ts +8 -4
  126. package/types/index.d.ts +41 -2
@@ -124,11 +124,58 @@ export default {
124
124
  },
125
125
  },
126
126
  computed: {
127
+ isDarkMode() {
128
+ return this.$u?.theme?.mode === 'dark';
129
+ },
130
+ resolvedInactiveColor() {
131
+ if (this.upHasProp('inactiveColor')) return this.inactiveColor;
132
+ return this.upThemeVar(
133
+ '--up-subsection-inactive-color',
134
+ this.isDarkMode
135
+ ? (this.$u?.color?.contentColor || '#d1d5db')
136
+ : '#303133'
137
+ );
138
+ },
139
+ resolvedButtonBgColor() {
140
+ if (this.upHasProp('bgColor')) return this.bgColor;
141
+ return this.upThemeVar(
142
+ '--up-subsection-bg-color',
143
+ this.isDarkMode ? '#2b2c30' : '#eeeeef'
144
+ );
145
+ },
146
+ resolvedButtonBarColor() {
147
+ if (this.disabled) {
148
+ return this.upThemeVar(
149
+ '--up-subsection-disabled-bar-color',
150
+ this.isDarkMode ? '#3a3a3c' : '#f5f5f5'
151
+ );
152
+ }
153
+ return this.upThemeVar(
154
+ '--up-subsection-bar-color',
155
+ this.isDarkMode ? '#3a3b40' : '#ffffff'
156
+ );
157
+ },
158
+ resolvedDisabledTextColor() {
159
+ return this.upThemeVar(
160
+ '--up-subsection-disabled-text-color',
161
+ this.isDarkMode
162
+ ? (this.$u?.color?.lightColor || '#6b7280')
163
+ : '#c8c9cc'
164
+ );
165
+ },
166
+ resolvedDisabledBorderColor() {
167
+ return this.upThemeVar(
168
+ '--up-subsection-disabled-border-color',
169
+ this.isDarkMode
170
+ ? (this.$u?.color?.borderColor || '#3a3a3c')
171
+ : '#d4d4d4'
172
+ );
173
+ },
127
174
  wrapperStyle() {
128
175
  const style = {};
129
176
  // button模式时,设置背景色
130
177
  if (this.mode === "button") {
131
- style.backgroundColor = this.bgColor;
178
+ style.backgroundColor = this.resolvedButtonBgColor;
132
179
  }
133
180
  return style;
134
181
  },
@@ -145,7 +192,11 @@ export default {
145
192
  // #endif
146
193
  if (this.mode === "subsection") {
147
194
  // 在subsection模式下,需要动态设置滑块的圆角,因为移动滑块使用的是translateX,无法通过父元素设置overflow: hidden隐藏滑块的直角
148
- style.backgroundColor = this.activeColor;
195
+ style.backgroundColor = this.disabled
196
+ ? this.resolvedDisabledBorderColor
197
+ : this.activeColor;
198
+ } else {
199
+ style.backgroundColor = this.resolvedButtonBarColor;
149
200
  }
150
201
  return style;
151
202
  },
@@ -155,7 +206,9 @@ export default {
155
206
  const style = {};
156
207
  if (this.mode === "subsection") {
157
208
  // 设置border的样式
158
- style.borderColor = this.activeColor;
209
+ style.borderColor = this.disabled
210
+ ? this.resolvedDisabledBorderColor
211
+ : this.activeColor;
159
212
  style.borderWidth = "1px";
160
213
  style.borderStyle = "solid";
161
214
  }
@@ -166,6 +219,12 @@ export default {
166
219
  textStyle(index,item) {
167
220
  return (index,item) => {
168
221
  const style = {};
222
+ if (this.disabled) {
223
+ style.fontWeight = 'normal';
224
+ style.fontSize = addUnit(this.fontSize);
225
+ style.color = this.resolvedDisabledTextColor;
226
+ return style;
227
+ }
169
228
  style.fontWeight =
170
229
  this.bold && this.innerCurrent === index ? "bold" : "normal";
171
230
  style.fontSize = addUnit(this.fontSize);
@@ -190,7 +249,7 @@ export default {
190
249
  }
191
250
  else{
192
251
  // 判断当前是否有自定义的颜色
193
- style.color = inactiveColorTemp ? inactiveColorTemp : this.inactiveColor;
252
+ style.color = inactiveColorTemp ? inactiveColorTemp : this.resolvedInactiveColor;
194
253
  }
195
254
  }
196
255
  else {
@@ -201,7 +260,7 @@ export default {
201
260
  }
202
261
  else{
203
262
  // 判断当前是否有自定义的颜色
204
- style.color = inactiveColorTemp ? inactiveColorTemp : this.inactiveColor;
263
+ style.color = inactiveColorTemp ? inactiveColorTemp : this.resolvedInactiveColor;
205
264
  }
206
265
  }
207
266
  return style;
@@ -279,6 +338,10 @@ export default {
279
338
  };
280
339
  </script>
281
340
 
341
+ <style lang="scss">
342
+ @import "./theme-vars.scss";
343
+ </style>
344
+
282
345
  <style lang="scss" scoped>
283
346
  .u-subsection {
284
347
  @include flex;
@@ -387,19 +450,9 @@ export default {
387
450
 
388
451
  .item-button--disabled{
389
452
  cursor: no-drop;
390
- color: #BDBDBD !important;
391
- border-color: #BDBDBD !important;
392
- text{
393
- color: #BDBDBD !important;
394
- }
395
453
  }
396
454
  .item-subsection--disabled{
397
455
  cursor: no-drop;
398
- background: #FFFFFF !important;
399
- color: #BDBDBD !important;
400
- border-color: #BDBDBD !important;
401
- text{
402
- color: #BDBDBD !important;
403
- }
456
+ background: transparent !important;
404
457
  }
405
458
  </style>
@@ -10,19 +10,19 @@
10
10
  alignItems: item.style && item.style.borderRadius ? 'center' : 'stretch'
11
11
  }]" @tap="buttonClickHandler(item, index)">
12
12
  <view class="u-swipe-action-item__right__button__wrapper" :style="[{
13
- backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
13
+ backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : defaultButtonBgColor,
14
14
  borderRadius: item.style && item.style.borderRadius ? item.style.borderRadius : '0',
15
15
  padding: item.style && item.style.borderRadius ? '0' : '0 15px',
16
16
  }, item.style]">
17
17
  <up-icon v-if="item.icon" :name="item.icon"
18
- :color="item.style && item.style.color ? item.style.color : '#ffffff'"
18
+ :color="item.style && item.style.color ? item.style.color : defaultButtonColor"
19
19
  :size="item.iconSize ? addUnit(item.iconSize) : item.style && item.style.fontSize ? getPx(item.style.fontSize) * 1.2 : 17"
20
20
  :customStyle="{
21
21
  marginRight: item.text ? '2px' : 0
22
22
  }"></up-icon>
23
23
  <text v-if="item.text" class="u-swipe-action-item__right__button__wrapper__text u-line-1"
24
24
  :style="[{
25
- color: item.style && item.style.color ? item.style.color : '#ffffff',
25
+ color: item.style && item.style.color ? item.style.color : defaultButtonColor,
26
26
  fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px',
27
27
  lineHeight: item.style && item.style.fontSize ? item.style.fontSize : '16px',
28
28
  }]">{{ item.text }}</text>
@@ -147,6 +147,12 @@
147
147
  computed: {
148
148
  wxsInit() {
149
149
  return [this.disabled, this.autoClose, this.threshold, this.options, this.duration]
150
+ },
151
+ defaultButtonBgColor() {
152
+ return this.upThemeVar('--up-swipe-action-button-bg-color', this.upThemeIsDark ? '#4b5563' : '#C7C6CD')
153
+ },
154
+ defaultButtonColor() {
155
+ return this.upThemeVar('--up-swipe-action-button-color', '#ffffff')
150
156
  }
151
157
  },
152
158
  mounted() {
@@ -211,7 +217,7 @@
211
217
 
212
218
  &__content {
213
219
  transform: translateX(0px); // 修复某些情况下默认右侧按钮是展开的问题
214
- background-color: #FFFFFF;
220
+ background-color: var(--up-card-bg-color, #FFFFFF);
215
221
  z-index: 10;
216
222
  }
217
223
 
@@ -237,7 +243,7 @@
237
243
  &__text {
238
244
  @include flex;
239
245
  align-items: center;
240
- color: #FFFFFF;
246
+ color: var(--up-swipe-action-button-color, #FFFFFF);
241
247
  font-size: 15px;
242
248
  text-align: center;
243
249
  justify-content: center;
@@ -0,0 +1,41 @@
1
+ :root,
2
+ page,
3
+ body {
4
+ --up-switch-active-color: #3c9cff;
5
+ --up-switch-inactive-color: #ffffff;
6
+ --up-switch-dot-active-color: #ffffff;
7
+ --up-switch-dot-inactive-color: #ffffff;
8
+ --up-switch-loading-inactive-color: #aaabad;
9
+ --up-switch-border-color: rgba(0, 0, 0, 0.12);
10
+ }
11
+
12
+ @media (prefers-color-scheme: dark) {
13
+ :root,
14
+ page,
15
+ body {
16
+ --up-switch-active-color: #3c9cff;
17
+ --up-switch-inactive-color: #3a3a3c;
18
+ --up-switch-dot-active-color: #ffffff;
19
+ --up-switch-dot-inactive-color: #d1d5db;
20
+ --up-switch-loading-inactive-color: #9ca3af;
21
+ --up-switch-border-color: #4b5563;
22
+ }
23
+ }
24
+
25
+ [data-up-theme='light'] {
26
+ --up-switch-active-color: #3c9cff;
27
+ --up-switch-inactive-color: #ffffff;
28
+ --up-switch-dot-active-color: #ffffff;
29
+ --up-switch-dot-inactive-color: #ffffff;
30
+ --up-switch-loading-inactive-color: #aaabad;
31
+ --up-switch-border-color: rgba(0, 0, 0, 0.12);
32
+ }
33
+
34
+ [data-up-theme='dark'] {
35
+ --up-switch-active-color: #3c9cff;
36
+ --up-switch-inactive-color: #3a3a3c;
37
+ --up-switch-dot-active-color: #ffffff;
38
+ --up-switch-dot-inactive-color: #d1d5db;
39
+ --up-switch-loading-inactive-color: #9ca3af;
40
+ --up-switch-border-color: #4b5563;
41
+ }
@@ -26,10 +26,10 @@
26
26
  mode="circle"
27
27
  timingFunction='linear'
28
28
  <!-- #ifdef VUE3 -->
29
- :color="modelValue ? activeColor : '#AAABAD'"
29
+ :color="modelValue ? resolvedActiveColor : resolvedLoadingInactiveColor"
30
30
  <!-- #endif -->
31
31
  <!-- #ifdef VUE2 -->
32
- :color="value ? activeColor : '#AAABAD'"
32
+ :color="value ? resolvedActiveColor : resolvedLoadingInactiveColor"
33
33
  <!-- #endif -->
34
34
  :size="size * 0.6"
35
35
  />
@@ -41,6 +41,7 @@
41
41
  import { props } from './props';
42
42
  import { mpMixin } from '../../libs/mixin/mpMixin';
43
43
  import { mixin } from '../../libs/mixin/mixin';
44
+ import defProps from '../../libs/config/props.js';
44
45
  import { addStyle, addUnit, error } from '../../libs/function/index';
45
46
  /**
46
47
  * switch 开关选择器
@@ -88,11 +89,6 @@
88
89
  }
89
90
  // #endif
90
91
  },
91
- data() {
92
- return {
93
- bgColor: '#ffffff'
94
- }
95
- },
96
92
  computed: {
97
93
  isActive(){
98
94
  // #ifdef VUE3
@@ -102,6 +98,33 @@
102
98
  return this.value === this.activeValue;
103
99
  // #endif
104
100
  },
101
+ resolvedActiveColor() {
102
+ if (this.upHasProp('activeColor') || this.activeColor !== defProps.switch.activeColor) {
103
+ return this.activeColor
104
+ }
105
+ return this.upThemeVar('--up-switch-active-color', this.$u.color.primary || '#3c9cff')
106
+ },
107
+ resolvedInactiveColor() {
108
+ if (this.upHasProp('inactiveColor') || this.inactiveColor !== defProps.switch.inactiveColor) {
109
+ return this.inactiveColor
110
+ }
111
+ return this.upThemeVar('--up-switch-inactive-color', this.upThemeIsDark ? '#3a3a3c' : '#ffffff')
112
+ },
113
+ resolvedDotActiveColor() {
114
+ if (this.upHasProp('dotActiveColor') || this.dotActiveColor !== defProps.switch.dotActiveColor) {
115
+ return this.dotActiveColor
116
+ }
117
+ return this.upThemeVar('--up-switch-dot-active-color', '#ffffff')
118
+ },
119
+ resolvedDotInactiveColor() {
120
+ if (this.upHasProp('dotInactiveColor') || this.dotInactiveColor !== defProps.switch.dotInactiveColor) {
121
+ return this.dotInactiveColor
122
+ }
123
+ return this.upThemeVar('--up-switch-dot-inactive-color', this.upThemeIsDark ? '#d1d5db' : '#ffffff')
124
+ },
125
+ resolvedLoadingInactiveColor() {
126
+ return this.upThemeVar('--up-switch-loading-inactive-color', this.upThemeIsDark ? '#9ca3af' : '#aaabad')
127
+ },
105
128
  switchStyle() {
106
129
  let style = {}
107
130
  // 这里需要加2,是为了腾出边框的距离,否则圆点node会和外边框紧贴在一起
@@ -112,8 +135,10 @@
112
135
  // 这里不能简单的设置为非激活的颜色,否则打开状态时,会有边框,所以需要透明
113
136
  if(this.customInactiveColor) {
114
137
  style.borderColor = 'rgba(0, 0, 0, 0)'
138
+ } else {
139
+ style.borderColor = this.upThemeVar('--up-switch-border-color', this.upThemeIsDark ? '#4b5563' : 'rgba(0, 0, 0, 0.12)')
115
140
  }
116
- style.backgroundColor = this.isActive ? this.activeColor : this.inactiveColor
141
+ style.backgroundColor = this.isActive ? this.resolvedActiveColor : this.resolvedInactiveColor
117
142
  return style;
118
143
  },
119
144
  nodeStyle() {
@@ -123,7 +148,7 @@
123
148
  style.height = addUnit(this.size - this.space)
124
149
  const translateX = this.isActive ? addUnit(this.space) : addUnit(this.size);
125
150
  style.transform = `translateX(-${translateX})`
126
- style.backgroundColor = this.isActive ? this.dotActiveColor : this.dotInactiveColor
151
+ style.backgroundColor = this.isActive ? this.resolvedDotActiveColor : this.resolvedDotInactiveColor
127
152
  return style
128
153
  },
129
154
  bgStyle() {
@@ -131,14 +156,14 @@
131
156
  // 这里配置一个多余的元素在HTML中,是为了让switch切换时,有更良好的背景色扩充体验(见实际效果)
132
157
  style.width = addUnit(Number(this.size) * 2 - this.size / 2)
133
158
  style.height = addUnit(this.size)
134
- style.backgroundColor = this.inactiveColor
159
+ style.backgroundColor = this.resolvedInactiveColor
135
160
  // 打开时,让此元素收缩,否则反之
136
161
  style.transform = `scale(${this.isActive ? 0 : 1})`
137
162
  return style
138
163
  },
139
164
  customInactiveColor() {
140
165
  // 之所以需要判断是否自定义了“非激活”颜色,是为了让node圆点离外边框更宽一点的距离
141
- return this.inactiveColor !== '#fff' && this.inactiveColor !== '#ffffff'
166
+ return this.upHasProp('inactiveColor') || this.inactiveColor !== defProps.switch.inactiveColor
142
167
  }
143
168
  },
144
169
  // #ifdef VUE3
@@ -167,6 +192,10 @@
167
192
  };
168
193
  </script>
169
194
 
195
+ <style lang="scss">
196
+ @import "./theme-vars.scss";
197
+ </style>
198
+
170
199
  <style lang="scss" scoped>
171
200
 
172
201
  .u-switch {
@@ -175,11 +204,11 @@
175
204
  box-sizing: border-box;
176
205
  /* #endif */
177
206
  position: relative;
178
- background-color: #fff;
207
+ background-color: $u-bg-color;
179
208
  border-width: 1px;
180
209
  border-radius: 100px;
181
210
  transition: background-color 0.4s;
182
- border-color: rgba(0, 0, 0, 0.12);
211
+ border-color: $u-border-color;
183
212
  border-style: solid;
184
213
  justify-content: flex-end;
185
214
  align-items: center;
@@ -192,7 +221,7 @@
192
221
  align-items: center;
193
222
  justify-content: center;
194
223
  border-radius: 100px;
195
- background-color: #fff;
224
+ background-color: $u-bg-color;
196
225
  box-shadow: 1px 1px 1px 0 rgba(0, 0, 0, 0.25);
197
226
  transition-property: transform, background-color;
198
227
  transition-duration: 0.4s;
@@ -202,7 +231,7 @@
202
231
  &__bg {
203
232
  position: absolute;
204
233
  border-radius: 100px;
205
- background-color: #FFFFFF;
234
+ background-color: $u-bg-color;
206
235
  transition-property: transform;
207
236
  transition-duration: 0.4s;
208
237
  border-top-left-radius: 0;
@@ -58,13 +58,13 @@
58
58
  computed: {
59
59
  tabbarStyle() {
60
60
  const style = {
61
- zIndex: this.zIndex
61
+ zIndex: this.zIndex,
62
+ backgroundColor: this.backgroundColor || this.upThemeVar('--up-card-bg-color', this.upThemeIsDark ? '#1c1c1e' : '#ffffff')
62
63
  }
63
64
  if (this.borderColor) {
64
65
  style.borderColor = this.borderColor + ' !important'
65
- }
66
- if (this.backgroundColor) {
67
- style.backgroundColor = this.backgroundColor
66
+ } else {
67
+ style.borderColor = this.upThemeVar('--up-border-color', '#dadbde')
68
68
  }
69
69
  // 合并来自父组件的customStyle样式
70
70
  return deepMerge(style, addStyle(this.customStyle))
@@ -132,7 +132,7 @@
132
132
 
133
133
  &__content {
134
134
  @include flex(column);
135
- background-color: #fff;
135
+ background-color: var(--up-card-bg-color, #fff);
136
136
 
137
137
  &__item-wrapper {
138
138
  height: 50px;
@@ -14,7 +14,7 @@
14
14
  <up-icon
15
15
  v-if="icon"
16
16
  :name="icon"
17
- :color="isActive? parentData.activeColor : parentData.inactiveColor"
17
+ :color="isActive ? resolvedActiveColor : resolvedInactiveColor"
18
18
  :size="isMidButton ? 26 : 20"
19
19
  ></up-icon>
20
20
  <template v-else>
@@ -41,7 +41,7 @@
41
41
  <text
42
42
  class="u-tabbar-item__text"
43
43
  :style="{
44
- color: isActive? parentData.activeColor : parentData.inactiveColor
44
+ color: isActive ? resolvedActiveColor : resolvedInactiveColor
45
45
  }"
46
46
  >{{ text }}</text>
47
47
  </slot>
@@ -88,6 +88,16 @@
88
88
  // 计算是否为中间按钮
89
89
  isMidButton() {
90
90
  return this.mode === 'midButton';
91
+ },
92
+ resolvedActiveColor() {
93
+ return !this.parentData.activeColor || this.parentData.activeColor === '#1989fa'
94
+ ? this.upThemeVar('--up-primary', '#1989fa')
95
+ : this.parentData.activeColor
96
+ },
97
+ resolvedInactiveColor() {
98
+ return !this.parentData.inactiveColor || this.parentData.inactiveColor === '#7d7e80'
99
+ ? this.upThemeVar('--up-content-color', '#7d7e80')
100
+ : this.parentData.inactiveColor
91
101
  }
92
102
  },
93
103
  created() {
@@ -167,7 +177,7 @@
167
177
  }
168
178
 
169
179
  .u-tabbar-item--mid-button-cover {
170
- background-color: #fff;
180
+ background-color: var(--up-card-bg-color, #fff);
171
181
  position: absolute;
172
182
  top: 22px;
173
183
  left: -10px;
@@ -180,8 +190,9 @@
180
190
  width: 70px;
181
191
  height: 70px;
182
192
  border-radius: 100px;
183
- background-color: #ffffff;
193
+ background-color: var(--up-card-bg-color, #ffffff);
184
194
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
195
+ border: 1px solid var(--up-border-color, rgba(0, 0, 0, 0.08));
185
196
  display: flex;
186
197
  align-items: center;
187
198
  justify-content: center;
@@ -194,4 +205,4 @@
194
205
  width: 100%;
195
206
  }
196
207
  /* #endif */
197
- </style>
208
+ </style>
@@ -79,11 +79,26 @@
79
79
  }
80
80
  },
81
81
  computed: {
82
+ resolvedBorderColor() {
83
+ return this.borderColor === '#e4e7ed'
84
+ ? this.upThemeVar('--up-border-color', '#e4e7ed')
85
+ : this.borderColor
86
+ },
87
+ resolvedColor() {
88
+ return this.color === '#606266'
89
+ ? this.upThemeVar('--up-content-color', '#606266')
90
+ : this.color
91
+ },
92
+ resolvedBgColor() {
93
+ return this.bgColor === '#ffffff'
94
+ ? this.upThemeVar('--up-card-bg-color', '#ffffff')
95
+ : this.bgColor
96
+ },
82
97
  tableStyle() {
83
98
  let style = {};
84
- style.borderLeft = `solid 1px ${this.borderColor}`;
85
- style.borderTop = `solid 1px ${this.borderColor}`;
86
- style.backgroundColor = this.bgColor;;
99
+ style.borderLeft = `solid 1px ${this.resolvedBorderColor}`;
100
+ style.borderTop = `solid 1px ${this.resolvedBorderColor}`;
101
+ style.backgroundColor = this.resolvedBgColor;
87
102
  return style;
88
103
  }
89
104
  },
@@ -1,22 +1,23 @@
1
1
  <style lang="scss" scoped>
2
- .u-table-row {
3
- display: flex;
4
- flex-direction: row;
5
- position: relative;
6
- }
7
-
8
- // 添加border样式支持
9
- .u-table-border {
10
- border-top: 1px solid #ebeef5;
11
- border-left: 1px solid #ebeef5;
12
- border-right: 1px solid #ebeef5;
13
- .u-table-cell {
14
- border-right: 1px solid #ebeef5;
15
- }
16
-
17
- .u-table-cell:last-child {
18
- border-right: none;
19
- }
2
+ .u-table-row {
3
+ display: flex;
4
+ flex-direction: row;
5
+ position: relative;
6
+ color: var(--up-content-color, #606266);
7
+ }
8
+
9
+ // 添加border样式支持
10
+ .u-table-border {
11
+ border-top: 1px solid var(--up-border-color, #ebeef5);
12
+ border-left: 1px solid var(--up-border-color, #ebeef5);
13
+ border-right: 1px solid var(--up-border-color, #ebeef5);
14
+ .u-table-cell {
15
+ border-right: 1px solid var(--up-border-color, #ebeef5);
16
+ }
17
+
18
+ .u-table-cell:last-child {
19
+ border-right: none;
20
+ }
20
21
  }
21
22
 
22
23
  .u-table-cell {
@@ -27,13 +28,14 @@
27
28
  padding: 10px 1px;
28
29
  font-size: 14px;
29
30
  white-space: nowrap;
30
- overflow: hidden;
31
- text-overflow: ellipsis;
32
- line-height: 1.1;
33
- border-bottom: 1px solid #ebeef5;
34
- &.u-text-left {
35
- justify-content: flex-start;
36
- text-align: left;
31
+ overflow: hidden;
32
+ text-overflow: ellipsis;
33
+ line-height: 1.1;
34
+ color: var(--up-content-color, #606266);
35
+ border-bottom: 1px solid var(--up-border-color, #ebeef5);
36
+ &.u-text-left {
37
+ justify-content: flex-start;
38
+ text-align: left;
37
39
  }
38
40
  &.u-text-center {
39
41
  justify-content: center;
@@ -43,21 +45,21 @@
43
45
  justify-content: flex-end;
44
46
  text-align: right;
45
47
  }
46
- }
47
-
48
- .u-table-row-zebra {
49
- background-color: #fafafa;
50
- }
51
-
52
- .u-table-row-highlight {
53
- background-color: #f5f7fa;
54
- }
55
-
56
- .u-table-empty {
57
- text-align: center;
58
- padding: 20px;
59
- color: #999;
60
- }
48
+ }
49
+
50
+ .u-table-row-zebra {
51
+ background-color: var(--up-table2-zebra-bg-color, #fafafa);
52
+ }
53
+
54
+ .u-table-row-highlight {
55
+ background-color: var(--up-table2-highlight-bg-color, #f5f7fa);
56
+ }
57
+
58
+ .u-table-empty {
59
+ text-align: center;
60
+ padding: 20px;
61
+ color: var(--up-tips-color, #999);
62
+ }
61
63
 
62
64
  // 隐藏被合并的单元格
63
65
  .u-table-cell-hidden {
@@ -325,4 +327,4 @@ export default {
325
327
  }
326
328
  }
327
329
  }
328
- </script>
330
+ </script>