uview-plus 3.7.36 → 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 (125) hide show
  1. package/README.md +0 -1
  2. package/changelog.md +1993 -1820
  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 +7 -7
  90. package/libs/mixin/mixin.js +111 -4
  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 +3 -2
  124. package/theme.scss +113 -32
  125. package/types/index.d.ts +41 -2
@@ -1,31 +1,31 @@
1
- <template>
2
- <view class="u-select">
3
- <view :class="['u-select__content', disabled && 'disabled']">
4
- <view class="u-select__label" @click="openSelect">
5
- <slot name="text" :currentLabel="currentLabel">
6
- <text class="u-select__text" v-if="showOptionsLabel">
7
- {{ currentLabel }}
8
- </text>
9
- <text class="u-select__text" v-else>
10
- {{ label }}
11
- </text>
12
- </slot>
13
- <slot name="icon">
14
- <up-icon name="arrow-down" :size="iconSize" :color="iconColor"></up-icon>
15
- </slot>
16
- </view>
17
- <u-overlay :show="isOpen" @click="overlayClick" v-if="overlay" :zIndex="zIndex" :duration="duration + 50"
18
- :customStyle="overlayStyle" :opacity="overlayOpacity" @touchmove.stop.prevent="noop"></u-overlay>
19
- <view class="u-select__options__wrap"
20
- :style="{ overflowY: 'auto', zIndex: zIndex + 1, left: optionsWrapLeft, right: optionsWrapRight, maxHeight: maxHeight}">
21
- <view class="u-select__options" v-if="isOpen">
22
- <slot name="options">
23
- <view class="u-select__options_item" :class="current == item[keyName] ? 'active': ''"
24
- :key="index" v-for="(item, index) in options" @click="selectItem(item)">
25
- <slot name="optionItem" :item="item">
26
- <text class="u-select__item_text" :style="{color: itemColor}">
27
- {{item[labelName]}}
28
- </text>
1
+ <template>
2
+ <view class="u-select">
3
+ <view :class="['u-select__content', disabled && 'disabled']">
4
+ <view :class="['u-select__label', border && 'u-select__label--border']" :style="selectLabelStyle" @click="openSelect">
5
+ <slot name="text" :currentLabel="currentLabel">
6
+ <text class="u-select__text" :style="{ color: resolvedTextColor }" v-if="showOptionsLabel">
7
+ {{ currentLabel }}
8
+ </text>
9
+ <text class="u-select__text" :style="{ color: resolvedTextColor }" v-else>
10
+ {{ label }}
11
+ </text>
12
+ </slot>
13
+ <slot name="icon">
14
+ <up-icon name="arrow-down" :size="iconSize" :color="resolvedIconColor"></up-icon>
15
+ </slot>
16
+ </view>
17
+ <u-overlay :show="isOpen" @click="overlayClick" v-if="overlay" :zIndex="zIndex" :duration="duration + 50"
18
+ :customStyle="overlayStyle" :opacity="overlayOpacity" @touchmove.stop.prevent="noop"></u-overlay>
19
+ <view class="u-select__options__wrap" :style="optionsWrapStyle">
20
+ <view class="u-select__options" :style="optionsStyle" v-if="isOpen">
21
+ <slot name="options">
22
+ <view class="u-select__options_item" :class="current == item[keyName] ? 'active': ''"
23
+ :style="{ color: resolvedItemColor }"
24
+ :key="index" v-for="(item, index) in options" @click="selectItem(item)">
25
+ <slot name="optionItem" :item="item">
26
+ <text class="u-select__item_text" :style="{color: resolvedItemColor}">
27
+ {{item[labelName]}}
28
+ </text>
29
29
  </slot>
30
30
  </view>
31
31
  </slot>
@@ -102,10 +102,10 @@
102
102
  type: Number,
103
103
  default: 11000
104
104
  },
105
- itemColor: {
106
- type: String,
107
- default: '#333333'
108
- },
105
+ itemColor: {
106
+ type: String,
107
+ default: ''
108
+ },
109
109
  iconColor: {
110
110
  type: String,
111
111
  default: ''
@@ -115,23 +115,79 @@
115
115
  default: '13px'
116
116
  },
117
117
  // 是否禁用
118
- disabled: {
119
- type: Boolean,
120
- default: false
121
- }
122
- },
123
- data() {
124
- return {
118
+ disabled: {
119
+ type: Boolean,
120
+ default: false
121
+ },
122
+ // 是否显示触发区边框
123
+ border: {
124
+ type: Boolean,
125
+ default: false
126
+ },
127
+ // 下拉面板宽度,支持 px/rpx/% 等,如 240px 或 300rpx
128
+ optionsWidth: {
129
+ type: [String, Number],
130
+ default: ''
131
+ }
132
+ },
133
+ data() {
134
+ return {
125
135
  isOpen: false,
126
136
  optionsWrapLeft: 'auto',
127
137
  optionsWrapRight: 'auto'
128
138
  }
129
139
  },
130
- computed: {
131
- currentLabel() {
132
- let name = '';
133
- this.options.forEach((ele) => {
134
- if (ele[this.keyName] === this.current) {
140
+ computed: {
141
+ resolvedItemColor() {
142
+ return this.itemColor || this.upThemeVar('--up-main-color', '#303133');
143
+ },
144
+ resolvedTextColor() {
145
+ return this.upThemeVar('--up-main-color', '#303133');
146
+ },
147
+ resolvedIconColor() {
148
+ return this.iconColor || this.upThemeVar('--up-content-color', '#606266');
149
+ },
150
+ normalizedOptionsWidth() {
151
+ if (this.optionsWidth === '' || this.optionsWidth === null || typeof this.optionsWidth === 'undefined') {
152
+ return '';
153
+ }
154
+ if (typeof this.optionsWidth === 'number') {
155
+ return `${this.optionsWidth}px`;
156
+ }
157
+ return this.optionsWidth;
158
+ },
159
+ selectLabelStyle() {
160
+ if (!this.border) return {};
161
+ return {
162
+ borderColor: this.upThemeVar('--up-border-color', '#dadbde'),
163
+ backgroundColor: this.upThemeVar('--up-card-bg-color', '#ffffff')
164
+ };
165
+ },
166
+ optionsWrapStyle() {
167
+ const style = {
168
+ overflowY: 'auto',
169
+ zIndex: this.zIndex + 1,
170
+ left: this.optionsWrapLeft,
171
+ right: this.optionsWrapRight,
172
+ maxHeight: this.maxHeight
173
+ };
174
+ if (this.normalizedOptionsWidth) {
175
+ style.width = this.normalizedOptionsWidth;
176
+ }
177
+ return style;
178
+ },
179
+ optionsStyle() {
180
+ const style = {};
181
+ if (this.normalizedOptionsWidth) {
182
+ style.width = this.normalizedOptionsWidth;
183
+ style.minWidth = this.normalizedOptionsWidth;
184
+ }
185
+ return style;
186
+ },
187
+ currentLabel() {
188
+ let name = '';
189
+ this.options.forEach((ele) => {
190
+ if (ele[this.keyName] === this.current) {
135
191
  name = ele[this.labelName];
136
192
  }
137
193
  });
@@ -159,12 +215,14 @@
159
215
  this.$emit('update:current', item[this.keyName]);
160
216
  this.$emit('select', item);
161
217
  },
162
- adjustOptionsWrapPosition() {
163
- let wi = getWindowInfo();
164
- let windowWidth = wi.windowWidth;
165
- this.$uGetRect('.u-select__options__wrap').then(rect => {
166
- if (rect.left + rect.width > windowWidth) {
167
- // 如果右侧被遮挡,则调整到左侧
218
+ adjustOptionsWrapPosition() {
219
+ this.optionsWrapLeft = '0px';
220
+ this.optionsWrapRight = 'auto';
221
+ let wi = getWindowInfo();
222
+ let windowWidth = wi.windowWidth;
223
+ this.$uGetRect('.u-select__options__wrap').then(rect => {
224
+ if (rect.left + rect.width > windowWidth) {
225
+ // 如果右侧被遮挡,则调整到左侧
168
226
  this.optionsWrapLeft = 'auto';
169
227
  this.optionsWrapRight = `0px`;
170
228
  }
@@ -178,14 +236,24 @@
178
236
  .u-select__content {
179
237
  position: relative;
180
238
 
181
- .u-select__label {
182
- display: flex;
183
- justify-content: space-between;
184
-
185
- /* #ifdef H5 */
186
- &:hover {
187
- cursor: pointer;
188
- }
239
+ .u-select__label {
240
+ display: flex;
241
+ justify-content: space-between;
242
+ align-items: center;
243
+
244
+ &--border {
245
+ padding: 8px 10px;
246
+ border-width: 1px;
247
+ border-style: solid;
248
+ border-radius: 4px;
249
+ min-height: 36px;
250
+ box-sizing: border-box;
251
+ }
252
+
253
+ /* #ifdef H5 */
254
+ &:hover {
255
+ cursor: pointer;
256
+ }
189
257
 
190
258
  /* #endif */
191
259
  }
@@ -199,19 +267,19 @@
199
267
  pointer-events: none;
200
268
  }
201
269
 
202
- .u-select__options__wrap {
203
- margin-bottom: 46px;
204
- position: absolute;
205
- top: 20px;
206
- left: 0;
207
- }
270
+ .u-select__options__wrap {
271
+ margin-bottom: 46px;
272
+ position: absolute;
273
+ top: calc(100% + 4px);
274
+ left: 0;
275
+ }
208
276
 
209
- .u-select__options {
210
- min-width: 100px;
211
- box-sizing: border-box;
212
- border-radius: 4px;
213
- border: 1px solid #f1f1f1;
214
- background-color: #fff;
277
+ .u-select__options {
278
+ min-width: 100px;
279
+ box-sizing: border-box;
280
+ border-radius: 4px;
281
+ border: 1px solid var(--up-border-color, #f1f1f1);
282
+ background-color: var(--up-card-bg-color, #fff);
215
283
 
216
284
  .u-select__options_item {
217
285
  padding: 10px 12px;
@@ -219,9 +287,9 @@
219
287
  width: 100%;
220
288
  height: 100%;
221
289
 
222
- &:hover {
223
- background-color: #f7f7f7;
224
- }
290
+ &:hover {
291
+ background-color: var(--up-bg-color, #f7f7f7);
292
+ }
225
293
 
226
294
  /* #ifdef H5 */
227
295
  &:hover {
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <view class="u-signature">
3
- <view class="u-signature__canvas-wrap" :style="{background: bgColor}">
3
+ <view class="u-signature__canvas-wrap" :style="{background: resolvedBgColor}">
4
4
  <up-canvas
5
5
  ref="signatureCanvas"
6
6
  :canvas-id="canvasId"
7
7
  :width="canvasWidth"
8
8
  :height="canvasHeight"
9
- :bg-color="bgColor"
9
+ :bg-color="resolvedBgColor"
10
10
  @touchstart="touchStart"
11
11
  @touchmove="touchMove"
12
12
  @touchend="touchEnd"
@@ -22,19 +22,19 @@
22
22
  <view v-if="showToolbar" class="u-signature__toolbar">
23
23
  <view class="u-signature__toolbar-icons u-flex u-flex-x">
24
24
  <view class="u-signature__toolbar-icon" @click="undo">
25
- <up-icon name="arrow-left" size="22" :color="pathStack.length === 0 ? '#ccc' : '#999'"></up-icon>
25
+ <up-icon name="arrow-left" size="22" :color="pathStack.length === 0 ? iconDisabledColor : iconDefaultColor"></up-icon>
26
26
  </view>
27
27
  <view class="u-signature__toolbar-icon" @click="clear">
28
- <up-icon name="trash" size="25" color="#999"></up-icon>
28
+ <up-icon name="trash" size="25" :color="iconDefaultColor"></up-icon>
29
29
  </view>
30
30
  <view class="u-signature__toolbar-icon" @click="toggleBrushSettings">
31
- <up-icon name="edit-pen" size="25" color="#999"></up-icon>
31
+ <up-icon name="edit-pen" size="25" :color="iconDefaultColor"></up-icon>
32
32
  </view>
33
33
  <view class="u-signature__toolbar-icon" @click="toggleColorSettings">
34
- <up-icon name="grid" size="24" color="#999"></up-icon>
34
+ <up-icon name="grid" size="24" :color="iconDefaultColor"></up-icon>
35
35
  </view>
36
36
  <view class="u-signature__toolbar-icon" @click="exportSignature">
37
- <up-icon name="checkmark" size="25" :color="isEmpty ? '#ccc' : '#999'"></up-icon>
37
+ <up-icon name="checkmark" size="25" :color="isEmpty ? iconDisabledColor : iconDefaultColor"></up-icon>
38
38
  </view>
39
39
  </view>
40
40
 
@@ -114,7 +114,7 @@
114
114
  canvasId: 'u-signature-' + Math.random().toString(36).substr(2, 9),
115
115
  canvasWidth: 300,
116
116
  canvasHeight: 200,
117
- lineColor: '#000000',
117
+ lineColor: '',
118
118
  lineWidth: 3,
119
119
  isDrawing: false,
120
120
  pathStack: [], // 存储绘制路径用于回退
@@ -136,6 +136,19 @@
136
136
  canvasInstance: null // 缓存canvas实例
137
137
  }
138
138
  },
139
+ computed: {
140
+ resolvedBgColor() {
141
+ return this.bgColor === '#ffffff'
142
+ ? (this.upThemeIsDark ? '#1c1c1e' : '#ffffff')
143
+ : this.bgColor
144
+ },
145
+ iconDefaultColor() {
146
+ return this.upThemeVar('--up-content-color', '#999999')
147
+ },
148
+ iconDisabledColor() {
149
+ return this.upThemeVar('--up-disabled-color', '#c8c9cc')
150
+ }
151
+ },
139
152
  mounted() {
140
153
  // 初始化时获取canvas实例
141
154
  this.$nextTick(() => {
@@ -158,7 +171,7 @@
158
171
  },
159
172
  color: {
160
173
  handler(newVal) {
161
- this.lineColor = newVal
174
+ this.lineColor = this.resolveStrokeColor(newVal)
162
175
  },
163
176
  immediate: true
164
177
  },
@@ -171,6 +184,12 @@
171
184
  },
172
185
  methods: {
173
186
  t,
187
+ resolveStrokeColor(color) {
188
+ if (color === '#000000') {
189
+ return this.upThemeIsDark ? '#f5f5f5' : '#000000'
190
+ }
191
+ return color
192
+ },
174
193
 
175
194
  // 获取签名画布实例
176
195
  getCanvasInstance() {
@@ -400,7 +419,7 @@
400
419
  flex-direction: column;
401
420
 
402
421
  &__canvas-wrap {
403
- border: 1px solid #e0e0e0;
422
+ border: 1px solid var(--up-border-color, #e0e0e0);
404
423
  border-radius: 4px;
405
424
  overflow: hidden;
406
425
  }
@@ -412,7 +431,7 @@
412
431
 
413
432
  &__toolbar {
414
433
  margin-top: 5px;
415
- background-color: #fff;
434
+ background-color: var(--up-card-bg-color, #fff);
416
435
  }
417
436
 
418
437
  &__toolbar-icons {
@@ -441,7 +460,7 @@
441
460
  display: block;
442
461
  margin-bottom: 10px;
443
462
  font-size: 14px;
444
- color: #999;
463
+ color: var(--up-tips-color, #999);
445
464
  }
446
465
  }
447
466
 
@@ -453,7 +472,7 @@
453
472
  display: block;
454
473
  margin-bottom: 10px;
455
474
  font-size: 14px;
456
- color: #999;
475
+ color: var(--up-tips-color, #999);
457
476
  }
458
477
 
459
478
  &__colors {
@@ -467,11 +486,11 @@
467
486
  width: 30px;
468
487
  height: 30px;
469
488
  border-radius: 50%;
470
- border: 2px solid #f0f0f0;
489
+ border: 2px solid var(--up-border-color, #f0f0f0);
471
490
  cursor: pointer;
472
491
 
473
492
  &--active {
474
- border-color: #2979ff;
493
+ border-color: var(--up-primary, #2979ff);
475
494
  transform: scale(1.1);
476
495
  }
477
496
  }
@@ -483,4 +502,4 @@
483
502
  justify-content: center;
484
503
  }
485
504
  }
486
- </style>
505
+ </style>
@@ -190,10 +190,15 @@
190
190
 
191
191
  @mixin background {
192
192
  /* #ifdef APP-NVUE */
193
- background-color: #F1F2F4;
193
+ background-color: var(--up-skeleton-bg-color, var(--up-fill-color, #2f3135));
194
194
  /* #endif */
195
195
  /* #ifndef APP-NVUE */
196
- background: linear-gradient(90deg, #F1F2F4 25%, #e6e6e6 37%, #F1F2F4 50%);
196
+ background: linear-gradient(
197
+ 90deg,
198
+ var(--up-skeleton-bg-color, var(--up-fill-color, #2f3135)) 25%,
199
+ var(--up-skeleton-shimmer-color, rgba(255, 255, 255, 0.12)) 37%,
200
+ var(--up-skeleton-bg-color, var(--up-fill-color, #2f3135)) 50%
201
+ );
197
202
  background-size: 400% 100%;
198
203
  /* #endif */
199
204
  }
@@ -177,11 +177,40 @@
177
177
  deep:true
178
178
  }
179
179
  },
180
- mounted() {
180
+ async mounted() {
181
181
  if (this.height != '') {
182
182
  this.sizeLocal = val
183
183
  } else {
184
184
  this.sizeLocal = this.size
185
+ }
186
+
187
+ // 获取滑块条的尺寸信息
188
+ if (!this.useNative) {
189
+ // #ifndef APP-NVUE
190
+ this.$uGetRect('.u-slider__base').then(rect => {
191
+ this.sliderRect = rect;
192
+ // console.log('sliderRect', this.sliderRect)
193
+ if (this.sliderRect.width == 0) {
194
+ console.info('如在弹窗等元素中使用,请使用v-if来显示滑块,否则无法计算长度。')
195
+ }
196
+ this.init()
197
+ });
198
+ // #endif
199
+ // #ifdef APP-NVUE
200
+ await sleep(30) // 不延迟会出现size获取都为0的问题
201
+ const ref = this.$refs['u-slider__base']
202
+ ref &&
203
+ dom.getComponentRect(ref, (res) => {
204
+ // console.log(res)
205
+ this.sliderRect = {
206
+ top: res.size.top,
207
+ left: res.size.left,
208
+ width: res.size.width,
209
+ height: res.size.height
210
+ };
211
+ this.init()
212
+ })
213
+ // #endif
185
214
  }
186
215
  },
187
216
  computed: {
@@ -215,36 +244,6 @@
215
244
  return style;
216
245
  }
217
246
  },
218
- async mounted() {
219
- // 获取滑块条的尺寸信息
220
- if (!this.useNative) {
221
- // #ifndef APP-NVUE
222
- this.$uGetRect('.u-slider__base').then(rect => {
223
- this.sliderRect = rect;
224
- // console.log('sliderRect', this.sliderRect)
225
- if (this.sliderRect.width == 0) {
226
- console.info('如在弹窗等元素中使用,请使用v-if来显示滑块,否则无法计算长度。')
227
- }
228
- this.init()
229
- });
230
- // #endif
231
- // #ifdef APP-NVUE
232
- await sleep(30) // 不延迟会出现size获取都为0的问题
233
- const ref = this.$refs['u-slider__base']
234
- ref &&
235
- dom.getComponentRect(ref, (res) => {
236
- // console.log(res)
237
- this.sliderRect = {
238
- top: res.size.top,
239
- left: res.size.left,
240
- width: res.size.width,
241
- height: res.size.height
242
- };
243
- this.init()
244
- })
245
- // #endif
246
- }
247
- },
248
247
  methods: {
249
248
  addUnit,
250
249
  addStyle,
@@ -21,10 +21,10 @@
21
21
  backgroundColor: statusClass === 'process' ? parentData.activeColor : 'transparent',
22
22
  borderColor: statusColor
23
23
  }" class="u-steps-item__wrapper__circle">
24
- <text v-if="statusClass === 'process' || statusClass === 'wait'"
25
- class="u-steps-item__wrapper__circle__text" :style="{
26
- color: index == parentData.current ? '#ffffff' : parentData.inactiveColor
27
- }">{{ index + 1}}</text>
24
+ <text v-if="statusClass === 'process' || statusClass === 'wait'"
25
+ class="u-steps-item__wrapper__circle__text" :style="{
26
+ color: index == parentData.current ? activeStepTextColor : parentData.inactiveColor
27
+ }">{{ index + 1}}</text>
28
28
  <up-icon v-else :color="statusClass === 'error' ? 'error' : parentData.activeColor" size="12"
29
29
  :name="statusClass === 'error' ? 'close' : 'checkmark'"></up-icon>
30
30
  </view>
@@ -170,8 +170,8 @@
170
170
  }
171
171
  return colorTmp
172
172
  },
173
- contentStyle() {
174
- const style = {}
173
+ contentStyle() {
174
+ const style = {}
175
175
  if (this.parentData.direction === 'column') {
176
176
  style.marginLeft = this.parentData.dot ? '2px' : '6px'
177
177
  style.marginTop = this.parentData.dot ? '0px' : '6px'
@@ -179,10 +179,13 @@
179
179
  style.marginTop = this.parentData.dot ? '2px' : '6px'
180
180
  style.marginLeft = this.parentData.dot ? '2px' : '6px'
181
181
  }
182
-
183
- return style
184
- }
185
- },
182
+
183
+ return style
184
+ },
185
+ activeStepTextColor() {
186
+ return this.upThemeVar('--up-white', '#ffffff')
187
+ }
188
+ },
186
189
  mounted() {
187
190
  this.parent && this.parent.updateFromChild()
188
191
  sleep().then(() => {
@@ -247,13 +250,13 @@
247
250
  padding-bottom: 5px;
248
251
  }
249
252
 
250
- &__wrapper {
251
- @include flex;
252
- justify-content: center;
253
- align-items: center;
254
- position: relative;
255
- background-color: #fff;
256
- border-radius: 50px;
253
+ &__wrapper {
254
+ @include flex;
255
+ justify-content: center;
256
+ align-items: center;
257
+ position: relative;
258
+ background-color: var(--up-card-bg-color, #fff);
259
+ border-radius: 50px;
257
260
 
258
261
  &--column {
259
262
  width: 20px;
@@ -0,0 +1,41 @@
1
+ :root,
2
+ page,
3
+ body {
4
+ --up-subsection-bg-color: #eeeeef;
5
+ --up-subsection-bar-color: #ffffff;
6
+ --up-subsection-inactive-color: #303133;
7
+ --up-subsection-disabled-text-color: #c8c9cc;
8
+ --up-subsection-disabled-border-color: #d4d4d4;
9
+ --up-subsection-disabled-bar-color: #f5f5f5;
10
+ }
11
+
12
+ @media (prefers-color-scheme: dark) {
13
+ :root,
14
+ page,
15
+ body {
16
+ --up-subsection-bg-color: #2b2c30;
17
+ --up-subsection-bar-color: #3a3b40;
18
+ --up-subsection-inactive-color: #d1d5db;
19
+ --up-subsection-disabled-text-color: #6b7280;
20
+ --up-subsection-disabled-border-color: #3a3a3c;
21
+ --up-subsection-disabled-bar-color: #3a3a3c;
22
+ }
23
+ }
24
+
25
+ [data-up-theme='light'] {
26
+ --up-subsection-bg-color: #eeeeef;
27
+ --up-subsection-bar-color: #ffffff;
28
+ --up-subsection-inactive-color: #303133;
29
+ --up-subsection-disabled-text-color: #c8c9cc;
30
+ --up-subsection-disabled-border-color: #d4d4d4;
31
+ --up-subsection-disabled-bar-color: #f5f5f5;
32
+ }
33
+
34
+ [data-up-theme='dark'] {
35
+ --up-subsection-bg-color: #2b2c30;
36
+ --up-subsection-bar-color: #3a3b40;
37
+ --up-subsection-inactive-color: #d1d5db;
38
+ --up-subsection-disabled-text-color: #6b7280;
39
+ --up-subsection-disabled-border-color: #3a3a3c;
40
+ --up-subsection-disabled-bar-color: #3a3a3c;
41
+ }