uview-pro 0.3.16 → 0.4.1

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 (140) hide show
  1. package/changelog.md +66 -0
  2. package/components/u-action-sheet-item/u-action-sheet-item.vue +1 -1
  3. package/components/u-alert-tips/u-alert-tips.vue +2 -2
  4. package/components/u-avatar/u-avatar.vue +5 -5
  5. package/components/u-avatar-cropper/u-avatar-cropper.vue +5 -5
  6. package/components/u-avatar-cropper/weCropper.js +1 -1
  7. package/components/u-avatar-cropper/weCropper.ts +1 -1
  8. package/components/u-back-top/types.ts +1 -1
  9. package/components/u-back-top/u-back-top.vue +1 -1
  10. package/components/u-badge/u-badge.vue +1 -31
  11. package/components/u-button/types.ts +1 -1
  12. package/components/u-button/u-button.vue +45 -37
  13. package/components/u-calendar/types.ts +4 -4
  14. package/components/u-calendar/u-calendar.vue +8 -8
  15. package/components/u-car-keyboard/u-car-keyboard.vue +5 -5
  16. package/components/u-card/types.ts +2 -2
  17. package/components/u-card/u-card.vue +3 -3
  18. package/components/u-cell-group/u-cell-group.vue +1 -1
  19. package/components/u-cell-item/u-cell-item.vue +2 -2
  20. package/components/u-checkbox/u-checkbox.vue +7 -7
  21. package/components/u-circle-progress/types.ts +4 -3
  22. package/components/u-circle-progress/u-circle-progress.vue +3 -3
  23. package/components/u-city-select/u-city-select.vue +1 -1
  24. package/components/u-collapse/types.ts +2 -2
  25. package/components/u-collapse/u-collapse.vue +1 -1
  26. package/components/u-collapse-item/u-collapse-item.vue +1 -1
  27. package/components/u-column-notice/u-column-notice.vue +2 -2
  28. package/components/u-config-provider/types.ts +34 -0
  29. package/components/u-config-provider/u-config-provider.vue +141 -0
  30. package/components/u-count-down/types.ts +4 -4
  31. package/components/u-count-down/u-count-down.vue +4 -4
  32. package/components/u-count-to/types.ts +1 -1
  33. package/components/u-count-to/u-count-to.vue +1 -1
  34. package/components/u-divider/types.ts +3 -3
  35. package/components/u-divider/u-divider.vue +4 -4
  36. package/components/u-dropdown/u-dropdown.vue +3 -3
  37. package/components/u-empty/types.ts +2 -2
  38. package/components/u-empty/u-empty.vue +1 -1
  39. package/components/u-field/types.ts +3 -3
  40. package/components/u-field/u-field.vue +6 -6
  41. package/components/u-form-item/u-form-item.vue +1 -1
  42. package/components/u-full-screen/u-full-screen.vue +1 -1
  43. package/components/u-gap/u-gap.vue +2 -2
  44. package/components/u-grid-item/types.ts +1 -1
  45. package/components/u-grid-item/u-grid-item.vue +3 -3
  46. package/components/u-icon/types.ts +2 -2
  47. package/components/u-icon/u-icon.vue +2 -2
  48. package/components/u-image/types.ts +4 -2
  49. package/components/u-image/u-image.vue +7 -2
  50. package/components/u-index-anchor/u-index-anchor.vue +3 -3
  51. package/components/u-index-list/u-index-list.vue +1 -1
  52. package/components/u-input/types.ts +4 -4
  53. package/components/u-input/u-input.vue +7 -7
  54. package/components/u-keyboard/u-keyboard.vue +3 -3
  55. package/components/u-lazy-load/u-lazy-load.vue +1 -1
  56. package/components/u-line/types.ts +1 -1
  57. package/components/u-line/u-line.vue +1 -1
  58. package/components/u-line-progress/types.ts +2 -2
  59. package/components/u-line-progress/u-line-progress.vue +3 -3
  60. package/components/u-link/u-link.vue +1 -1
  61. package/components/u-loading/types.ts +1 -1
  62. package/components/u-loading/u-loading.vue +3 -3
  63. package/components/u-loading-popup/types.ts +1 -1
  64. package/components/u-loading-popup/u-loading-popup.vue +2 -2
  65. package/components/u-loadmore/types.ts +2 -2
  66. package/components/u-loadmore/u-loadmore.vue +6 -6
  67. package/components/u-message-input/u-message-input.vue +5 -5
  68. package/components/u-modal/u-modal.vue +2 -2
  69. package/components/u-navbar/types.ts +4 -4
  70. package/components/u-navbar/u-navbar.vue +27 -20
  71. package/components/u-no-network/u-no-network.vue +2 -2
  72. package/components/u-number-box/types.ts +4 -4
  73. package/components/u-number-box/u-number-box.vue +6 -6
  74. package/components/u-number-keyboard/u-number-keyboard.vue +2 -2
  75. package/components/u-picker/u-picker.vue +4 -4
  76. package/components/u-popup/types.ts +1 -1
  77. package/components/u-popup/u-popup.vue +6 -6
  78. package/components/u-radio/u-radio.vue +7 -7
  79. package/components/u-rate/types.ts +2 -2
  80. package/components/u-rate/u-rate.vue +2 -2
  81. package/components/u-read-more/types.ts +1 -1
  82. package/components/u-row-notice/u-row-notice.vue +2 -2
  83. package/components/u-search/types.ts +4 -4
  84. package/components/u-search/u-search.vue +4 -4
  85. package/components/u-section/types.ts +2 -2
  86. package/components/u-section/u-section.vue +2 -2
  87. package/components/u-select/u-select.vue +6 -6
  88. package/components/u-skeleton/types.ts +2 -2
  89. package/components/u-skeleton/u-skeleton.vue +2 -2
  90. package/components/u-slider/types.ts +1 -1
  91. package/components/u-slider/u-slider.vue +4 -4
  92. package/components/u-step/u-step.vue +4 -4
  93. package/components/u-steps/u-steps.vue +3 -3
  94. package/components/u-sticky/types.ts +1 -1
  95. package/components/u-sticky/u-sticky.vue +1 -1
  96. package/components/u-subsection/types.ts +4 -4
  97. package/components/u-subsection/u-subsection.vue +7 -7
  98. package/components/u-swipe-action/types.ts +1 -1
  99. package/components/u-swipe-action/u-swipe-action.vue +2 -2
  100. package/components/u-swiper/types.ts +1 -1
  101. package/components/u-swiper/u-swiper.vue +1 -1
  102. package/components/u-switch/types.ts +1 -1
  103. package/components/u-switch/u-switch.vue +5 -5
  104. package/components/u-tabbar/types.ts +5 -4
  105. package/components/u-tabbar/u-tabbar.vue +5 -5
  106. package/components/u-table/types.ts +3 -3
  107. package/components/u-table/u-table.vue +3 -3
  108. package/components/u-tabs/types.ts +1 -1
  109. package/components/u-tabs/u-tabs.vue +2 -2
  110. package/components/u-tabs-swiper/types.ts +1 -1
  111. package/components/u-tabs-swiper/u-tabs-swiper.vue +2 -2
  112. package/components/u-tag/u-tag.vue +12 -12
  113. package/components/u-text/types.ts +1 -1
  114. package/components/u-text/u-text.vue +1 -1
  115. package/components/u-textarea/types.ts +1 -1
  116. package/components/u-textarea/u-textarea.vue +6 -6
  117. package/components/u-time-line/u-time-line.vue +1 -1
  118. package/components/u-time-line-item/types.ts +1 -1
  119. package/components/u-time-line-item/u-time-line-item.vue +2 -3
  120. package/components/u-toast/u-toast.vue +8 -8
  121. package/components/u-top-tips/u-top-tips.vue +1 -1
  122. package/components/u-upload/types.ts +2 -2
  123. package/components/u-upload/u-upload.vue +1 -1
  124. package/index.scss +1 -0
  125. package/index.ts +35 -10
  126. package/libs/config/theme-tokens.ts +101 -0
  127. package/libs/css/style.theme.scss +31 -0
  128. package/libs/css/style.vue.scss +1 -1
  129. package/libs/function/clipboard.ts +6 -11
  130. package/libs/function/color.ts +53 -22
  131. package/libs/hooks/index.ts +2 -0
  132. package/libs/hooks/useColor.ts +61 -0
  133. package/libs/hooks/useTheme.ts +162 -0
  134. package/libs/index.ts +4 -3
  135. package/libs/util/config-provider.ts +558 -0
  136. package/libs/util/system-theme.ts +25 -0
  137. package/package.json +107 -107
  138. package/theme.scss +50 -34
  139. package/types/components.d.ts +1 -0
  140. package/types/global.d.ts +47 -2
package/changelog.md CHANGED
@@ -1,3 +1,69 @@
1
+ ## 0.4.1(2025-11-30)
2
+
3
+ ### ✨ Features | 新功能
4
+
5
+ - **root:** 新增根节点组件支持,优化主题文件 ([12d14f8](https://github.com/anyup/uView-Pro/commit/12d14f8c859bae1e330b246b6eb1f87c2597c2d7))
6
+ - **iconfont:** 新增iconfont实例 ([4d34d25](https://github.com/anyup/uView-Pro/commit/4d34d25f0c124a6622b8b38b7501b85586843a42))
7
+ - **locales:** 新增locales中英文字段 ([2dbad6d](https://github.com/anyup/uView-Pro/commit/2dbad6d38bc5cd2fbe55aa0998d2264782cb4dfe))
8
+ - **markdown-view:** 新增 markdown-view 模块 ([9e21b6a](https://github.com/anyup/uView-Pro/commit/9e21b6af96c17175dd178923ab2f98c595bacb20))
9
+ - **u-config-provider:** 新增 u-config-provider 组件用于全局主题管理 ([f44857c](https://github.com/anyup/uView-Pro/commit/f44857c44f0354b9408bc40c8d586ace1ea40538))
10
+ - **theme:** 实现自定义多主题,主题切换功能 ([9551d26](https://github.com/anyup/uView-Pro/commit/9551d260451d2c21b7fe9dfab4850a57c5601573))
11
+ - **demo:** 新增 demo-page 组件并重构组件演示页面,添加 API 文档展示 ([ecfd77e](https://github.com/anyup/uView-Pro/commit/ecfd77ea3776720e0bbba7f7678896e685adff3a))
12
+ - **demo-page:** 优化代码示例组件文档获取方式 ([50738be](https://github.com/anyup/uView-Pro/commit/50738beafa879e3f95831287a1aa7cb560b59c20))
13
+ - **theme:** 实现暗黑模式并优化多主题管理 ([38f9346](https://github.com/anyup/uView-Pro/commit/38f93464edf7ba3e6a0d28c025e31cfe27a147bb))
14
+ - **u-config-provider:** 完善u-config-provider主题注入和暗黑模式切换 ([726a7f9](https://github.com/anyup/uView-Pro/commit/726a7f96a31c2e6346c9037842963624b22c3f60))
15
+ - **demo:** 优化主题切换示例逻辑和样式 ([d69af6a](https://github.com/anyup/uView-Pro/commit/d69af6a82b639d35ce757abccccb9f8f9aae14a5))
16
+ - **theme:** 优化主题系统,兼容单主题、多主题配置能力 ([d06cd7f](https://github.com/anyup/uView-Pro/commit/d06cd7f592e5ae4f9dae7f0cd90f173f76cc5e62))
17
+ - **theme:** 更新深蓝主题的色彩配置 ([77e8e5c](https://github.com/anyup/uView-Pro/commit/77e8e5c6ca55281253f86dbc5244c807f04324b3))
18
+ - **config-provider:** 增加非 H5 平台系统暗黑模式识别 ([2175dc6](https://github.com/anyup/uView-Pro/commit/2175dc6892f7f559507e19c44638f5c57ac13e4a))
19
+ - **u-button:** 调整u-button按钮节流默认值为0,优化点击逻辑 ([3fa2593](https://github.com/anyup/uView-Pro/commit/3fa2593dba31c05a97e001fda9cd233306f42a9d))
20
+ - **theme:** 优化主题配置中的暗黑模式处理逻辑,按规则自动生成完整暗色方案 ([8246853](https://github.com/anyup/uView-Pro/commit/82468538004c88637b98c9bd2381b0d44aef0d22))
21
+ - **system:** 添加系统主题变更监听 ([9c35243](https://github.com/anyup/uView-Pro/commit/9c3524390847d92c7345e8a27c4603afa8d094f4))
22
+ - **theme:** 多主题配置兼容单主题 ([79d3223](https://github.com/anyup/uView-Pro/commit/79d3223459a306fb4ba320713ed03a4a6579f563))
23
+ - **u-image:** 增强 u-image 组件自定义样式 ([b133c3c](https://github.com/anyup/uView-Pro/commit/b133c3c00f14738eaa0a61eaec19dbe1b5defcfe))
24
+
25
+ ### ♻️ Code Refactoring | 代码重构
26
+
27
+ - **app:** 添加本地应用资源 ([cd3f020](https://github.com/anyup/uView-Pro/commit/cd3f02074c871772ea0e42fb26336751eeda7c35))
28
+ - **theme:** 重构主题配置和颜色处理逻辑 ([31aa36b](https://github.com/anyup/uView-Pro/commit/31aa36b9207144836be7073a804b8c7ebd68fc6b))
29
+ - **demo:** 修改演示页面功能及样式,调整演示组件整体样式 ([8760b3c](https://github.com/anyup/uView-Pro/commit/8760b3c82ff129bd1695e384abbc762de6c85cd4))
30
+ - **components:** 优化多个组件主题颜色变量使用,兼容多主题和暗黑模式 ([1a2856f](https://github.com/anyup/uView-Pro/commit/1a2856fc98ec3169d29330f9b7470e936d4aa334))
31
+ - **demo:** 优化演示示例 Demo 的功能 ([445878b](https://github.com/anyup/uView-Pro/commit/445878b906475f5dd3bcc9b15efd9aac597f0603))
32
+ - **demo-page:** 优化demo page展示,主题切换逻辑优化 ([c5ecbaa](https://github.com/anyup/uView-Pro/commit/c5ecbaa437e51cf1bf47f84f0f3bc071f37dd413))
33
+ - 更新自定义主题文件 ([cab8be3](https://github.com/anyup/uView-Pro/commit/cab8be38832bca9de1254a06f199e6b3704ee88e))
34
+ - **color:** 重构颜色组件以提升可维护性 ([d92a052](https://github.com/anyup/uView-Pro/commit/d92a0526f7bfa51eeb40bb90eb0e7fc8f24fe488))
35
+
36
+ ### ⚡ Performance Improvements | 性能优化
37
+
38
+ - 优化微信小程序代码包体积 ([bf56c99](https://github.com/anyup/uView-Pro/commit/bf56c99515e41d067481cd6498187ed5bd37c193))
39
+
40
+ ### 💄 Styles | 风格
41
+
42
+ - **demo:** 优化演示页面样式 ([ae5de09](https://github.com/anyup/uView-Pro/commit/ae5de091ee1234b4432eb7d2609f77fd5afd27aa))
43
+ - **components:** 使用变量替代硬编码的颜色值 ([cf0044e](https://github.com/anyup/uView-Pro/commit/cf0044e3be68daff91b764eb31a75cf3ecad86aa))
44
+ - **demo:** 优化替代组件颜色硬编码值,保证主题色和暗黑模式 ([291e92b](https://github.com/anyup/uView-Pro/commit/291e92b07d80532b1620f62ae0ac3f4909bdab6a))
45
+
46
+ ### 📦‍ Build System | 打包构建
47
+
48
+ - 新增颜色替换脚本 ([b160c28](https://github.com/anyup/uView-Pro/commit/b160c28e838a4f27b9bfa2f3ce47e8ad46e807a0))
49
+ - 指定 Node.js 版本 ([7147284](https://github.com/anyup/uView-Pro/commit/714728421527bbd5abed02fe4fdf51cdf3c2a583))
50
+ - **deps:** 更新 dcloudio uni-app 依赖版本至 4.76 ([f92a348](https://github.com/anyup/uView-Pro/commit/f92a34892369facda3d89add34cfbeddc1872a65))
51
+
52
+ ### 🐛 Bug Fixes | Bug 修复
53
+
54
+ - **u-tabbar:** 修复 u-tabbar 在鸿蒙应用上高度计算错误的问题 ([cc4bc1a](https://github.com/anyup/uView-Pro/commit/cc4bc1add7ef63f6d9eb519e9ee38414ef3c73eb))
55
+ - **clipboard:** 处理未传入可选参数引起的错误 ([1756b53](https://github.com/anyup/uView-Pro/commit/1756b53f8ce2e2a21d288124c257b4729e48d92a))
56
+ - **theme:** 修复获取系统设置的theme不正确的问题 ([58b0cbb](https://github.com/anyup/uView-Pro/commit/58b0cbb3aa666d8f127bc88850b66d469cc1b996))
57
+ - **install:** 优化 install 方法的错误处理和代码结构 ([7edb867](https://github.com/anyup/uView-Pro/commit/7edb8673b0cdf4238c184a480b91fb73908e6c5c))
58
+
59
+ ### 👷 Continuous Integration | CI 配置
60
+
61
+ - **release:** 支持直接指定版本号发布 ([e4db5f8](https://github.com/anyup/uView-Pro/commit/e4db5f8b349954548ddef37fc02aa5a397cace01))
62
+
63
+ ### 👥 Contributors
64
+
65
+ <a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a> <a href="https://github.com/lonelyflyer"><img src="https://github.com/lonelyflyer.png?size=40" width="40" height="40" alt="Lonelyflyer" title="Lonelyflyer"/></a>
66
+
1
67
  ## 0.3.16(2025-11-21)
2
68
 
3
69
  ### 📝 Documentation | 文档
@@ -47,7 +47,7 @@ const itemStyle = computed(() => {
47
47
  style.color = props.color || parentExposed?.value?.props?.color;
48
48
  style.fontSize = $u.addUnit(props.fontSize || parentExposed?.value?.props?.fontSize);
49
49
  style.padding = $u.addUnit(props.padding);
50
- if (props.disabled) style.color = '#c0c4cc';
50
+ if (props.disabled) style.color = 'var(--u-light-color)';
51
51
  return style;
52
52
  });
53
53
 
@@ -42,7 +42,7 @@
42
42
  v-if="closeAble && !closeText"
43
43
  hoverClass="u-type-error-hover-color"
44
44
  name="close"
45
- color="#c0c4cc"
45
+ color="var(--u-light-color)"
46
46
  :size="22"
47
47
  class="u-close-icon"
48
48
  :style="{
@@ -154,7 +154,7 @@ function onClose() {
154
154
  border-radius: 8rpx;
155
155
  position: relative;
156
156
  transition: all 0.3s linear;
157
- border: 1px solid #fff;
157
+ border: 1px solid var(--u-white-color);
158
158
 
159
159
  &--bg--primary-light {
160
160
  background-color: $u-type-primary-light;
@@ -44,7 +44,7 @@ let base64Avatar =
44
44
  * avatar 头像
45
45
  * @description 本组件一般用于展示头像的地方,如个人中心,或者评论列表页的用户头像展示等场所。
46
46
  * @tutorial https://uviewpro.cn/zh/components/avatar.html
47
- * @property {String} bg-color 背景颜色,一般显示文字时用(默认#ffffff
47
+ * @property {String} bg-color 背景颜色,一般显示文字时用(默认var(--u-bg-white)
48
48
  * @property {String} src 头像路径,如加载失败,将会显示默认头像
49
49
  * @property {String Number} size 头像尺寸,可以为指定字符串(large, default, mini),或者数值,单位rpx(默认default)
50
50
  * @property {String} mode 显示类型,见上方说明(默认circle)
@@ -174,7 +174,7 @@ function onClick() {
174
174
  &__sex {
175
175
  position: absolute;
176
176
  width: 32rpx;
177
- color: #ffffff;
177
+ color: var(--u-white-color);
178
178
  height: 32rpx;
179
179
  @include vue-flex;
180
180
  justify-content: center;
@@ -183,7 +183,7 @@ function onClick() {
183
183
  top: 5%;
184
184
  z-index: 1;
185
185
  right: -7%;
186
- border: 1px #ffffff solid;
186
+ border: 1px var(--u-white-color) solid;
187
187
 
188
188
  &--man {
189
189
  background-color: $u-type-primary;
@@ -201,7 +201,7 @@ function onClick() {
201
201
  &__level {
202
202
  position: absolute;
203
203
  width: 32rpx;
204
- color: #ffffff;
204
+ color: var(--u-white-color);
205
205
  height: 32rpx;
206
206
  @include vue-flex;
207
207
  justify-content: center;
@@ -210,7 +210,7 @@ function onClick() {
210
210
  bottom: 5%;
211
211
  z-index: 1;
212
212
  right: -7%;
213
- border: 1px #ffffff solid;
213
+ border: 1px var(--u-white-color) solid;
214
214
  background-color: $u-type-warning;
215
215
  }
216
216
  }
@@ -129,8 +129,8 @@ onMounted(() => {
129
129
 
130
130
  // 设置导航栏样式,以免用户在page.json中没有设置为黑色背景
131
131
  uni.setNavigationBarColor({
132
- frontColor: '#ffffff',
133
- backgroundColor: '#000000'
132
+ frontColor: 'var(--u-white-color)',
133
+ backgroundColor: 'var(--u-bg-black)'
134
134
  });
135
135
 
136
136
  // 初始化 cropper 实例
@@ -253,8 +253,8 @@ function uploadTap() {
253
253
  }
254
254
 
255
255
  .cropper-buttons {
256
- background-color: #000000;
257
- color: #eee;
256
+ background-color: var(--u-bg-black);
257
+ color: var(--u-divider-color);
258
258
  }
259
259
 
260
260
  .cropper-wrapper {
@@ -264,7 +264,7 @@ function uploadTap() {
264
264
  justify-content: space-between;
265
265
  align-items: center;
266
266
  width: 100%;
267
- background-color: #000;
267
+ background-color: var(--u-bg-black);
268
268
  }
269
269
 
270
270
  .cropper-buttons {
@@ -1134,7 +1134,7 @@
1134
1134
  self.setBoundStyle = function (ref) {
1135
1135
  if (ref === void 0) ref = {};
1136
1136
  var color = ref.color;
1137
- if (color === void 0) color = '#04b00f';
1137
+ if (color === void 0) color = 'var(--u-type-success-dark)';
1138
1138
  var mask = ref.mask;
1139
1139
  if (mask === void 0) mask = 'rgba(0, 0, 0, 0.3)';
1140
1140
  var lineWidth = ref.lineWidth;
@@ -1131,7 +1131,7 @@ function cut(this: any) {
1131
1131
  self.setBoundStyle = function (ref: any) {
1132
1132
  if (ref === void 0) ref = {};
1133
1133
  var color = ref.color;
1134
- if (color === void 0) color = '#04b00f';
1134
+ if (color === void 0) color = 'var(--u-type-success-dark)';
1135
1135
  var mask = ref.mask;
1136
1136
  if (mask === void 0) mask = 'rgba(0, 0, 0, 0.3)';
1137
1137
  var lineWidth = ref.lineWidth;
@@ -27,7 +27,7 @@ export const BackTopProps = {
27
27
  iconStyle: {
28
28
  type: Object as PropType<Record<string, any>>,
29
29
  default: () => ({
30
- color: '#909399',
30
+ color: 'var(--u-tips-color)',
31
31
  fontSize: '38rpx'
32
32
  })
33
33
  }
@@ -120,7 +120,7 @@ function backToTop() {
120
120
  @include vue-flex;
121
121
  flex-direction: column;
122
122
  justify-content: center;
123
- background-color: #e1e1e1;
123
+ background-color: var(--u-divider-color);
124
124
  color: $u-content-color;
125
125
  align-items: center;
126
126
  transition: opacity 0.4s;
@@ -57,7 +57,7 @@ import { $u } from '../..';
57
57
  * @property {Boolean} show-zero 当数值为 0 时,是否展示 Badge(默认false)
58
58
  * @property {String} size Badge的尺寸,设为mini会得到小一号的Badge(默认default)
59
59
  * @property {Array} offset 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,单位rpx。absolute为true时有效(默认[20, 20])
60
- * @property {String} color 字体颜色(默认#ffffff
60
+ * @property {String} color 字体颜色(默认var(--u-white-color)
61
61
  * @property {String} bgColor 背景颜色,优先级比type高,如设置,type参数会失效
62
62
  * @property {Boolean} is-center 组件中心点是否和父组件右上角重合,优先级比offset高,如设置,offset参数会失效(默认false)
63
63
  * @example <u-badge type="error" count="7"></u-badge>
@@ -150,34 +150,4 @@ const show = computed(() => {
150
150
  transform: scale(0.8);
151
151
  transform-origin: center center;
152
152
  }
153
-
154
- // .u-primary {
155
- // background: $u-type-primary;
156
- // color: #fff;
157
- // }
158
-
159
- // .u-error {
160
- // background: $u-type-error;
161
- // color: #fff;
162
- // }
163
-
164
- // .u-warning {
165
- // background: $u-type-warning;
166
- // color: #fff;
167
- // }
168
-
169
- // .u-success {
170
- // background: $u-type-success;
171
- // color: #fff;
172
- // }
173
-
174
- // .u-black {
175
- // background: #585858;
176
- // color: #fff;
177
- // }
178
-
179
- .u-info {
180
- background-color: $u-type-info;
181
- color: #fff;
182
- }
183
153
  </style>
@@ -56,7 +56,7 @@ export const ButtonProps = {
56
56
  /** 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 */
57
57
  dataName: { type: String, default: '' },
58
58
  /** 节流,一定时间内只能触发一次 */
59
- throttleTime: { type: [String, Number], default: 1000 },
59
+ throttleTime: { type: [String, Number], default: 0 },
60
60
  /** 按住后多久出现点击态,单位毫秒 */
61
61
  hoverStartTime: { type: [String, Number], default: 20 },
62
62
  /** 手指松开后点击态保留时间,单位毫秒 */
@@ -177,19 +177,27 @@ const showHairLineBorder = computed(() => {
177
177
  * @emits click
178
178
  */
179
179
  function click(e: any) {
180
- $u.throttle(() => {
181
- // 如果按钮时disabled和loading状态,不触发水波纹效果
182
- if (props.loading === true || props.disabled === true) return;
183
- // 是否开启水波纹效果
184
- if (props.ripple) {
185
- // 每次点击时,移除上一次的类,再次添加,才能触发动画效果
186
- waveActive.value = false;
187
- nextTick(() => {
188
- getWaveQuery(e);
189
- });
190
- }
191
- emit('click', e);
192
- }, Number(props.throttleTime));
180
+ if (Number(props.throttleTime)) {
181
+ $u.throttle(() => {
182
+ clickAction(e);
183
+ }, Number(props.throttleTime));
184
+ } else {
185
+ clickAction(e);
186
+ }
187
+ }
188
+
189
+ function clickAction(e: any) {
190
+ // 如果按钮时disabled和loading状态,不触发水波纹效果
191
+ if (props.loading === true || props.disabled === true) return;
192
+ // 是否开启水波纹效果
193
+ if (props.ripple) {
194
+ // 每次点击时,移除上一次的类,再次添加,才能触发动画效果
195
+ waveActive.value = false;
196
+ nextTick(() => {
197
+ getWaveQuery(e);
198
+ });
199
+ }
200
+ emit('click', e);
193
201
  }
194
202
 
195
203
  /**
@@ -350,65 +358,65 @@ function agreeprivacyauthorization(event: any) {
350
358
  transition: all 0.15s;
351
359
 
352
360
  &--bold-border {
353
- border: 1px solid #ffffff;
361
+ border: 1px solid var(--u-white-color);
354
362
  }
355
363
 
356
364
  &--default {
357
365
  color: $u-content-color;
358
- border-color: #c0c4cc;
359
- background-color: #ffffff;
366
+ border-color: var(--u-light-color);
367
+ background-color: var(--u-bg-white);
360
368
  }
361
369
 
362
370
  &--primary {
363
- color: #ffffff;
371
+ color: var(--u-white-color);
364
372
  border-color: $u-type-primary;
365
373
  background-color: $u-type-primary;
366
374
  }
367
375
 
368
376
  &--success {
369
- color: #ffffff;
377
+ color: var(--u-white-color);
370
378
  border-color: $u-type-success;
371
379
  background-color: $u-type-success;
372
380
  }
373
381
 
374
382
  &--error {
375
- color: #ffffff;
383
+ color: var(--u-white-color);
376
384
  border-color: $u-type-error;
377
385
  background-color: $u-type-error;
378
386
  }
379
387
 
380
388
  &--warning {
381
- color: #ffffff;
389
+ color: var(--u-white-color);
382
390
  border-color: $u-type-warning;
383
391
  background-color: $u-type-warning;
384
392
  }
385
393
 
386
394
  &--default--disabled {
387
- color: #ffffff;
388
- border-color: #e4e7ed;
389
- background-color: #ffffff;
395
+ color: var(--u-white-color);
396
+ border-color: var(--u-border-color);
397
+ background-color: var(--u-bg-white);
390
398
  }
391
399
 
392
400
  &--primary--disabled {
393
- color: #ffffff !important;
401
+ color: var(--u-white-color) !important;
394
402
  border-color: $u-type-primary-disabled !important;
395
403
  background-color: $u-type-primary-disabled !important;
396
404
  }
397
405
 
398
406
  &--success--disabled {
399
- color: #ffffff !important;
407
+ color: var(--u-white-color) !important;
400
408
  border-color: $u-type-success-disabled !important;
401
409
  background-color: $u-type-success-disabled !important;
402
410
  }
403
411
 
404
412
  &--error--disabled {
405
- color: #ffffff !important;
413
+ color: var(--u-white-color) !important;
406
414
  border-color: $u-type-error-disabled !important;
407
415
  background-color: $u-type-error-disabled !important;
408
416
  }
409
417
 
410
418
  &--warning--disabled {
411
- color: #ffffff !important;
419
+ color: var(--u-white-color) !important;
412
420
  border-color: $u-type-warning-disabled !important;
413
421
  background-color: $u-type-warning-disabled !important;
414
422
  }
@@ -519,7 +527,7 @@ function agreeprivacyauthorization(event: any) {
519
527
  }
520
528
 
521
529
  .u-primary-plain-hover {
522
- color: #ffffff !important;
530
+ color: var(--u-white-color) !important;
523
531
  background: $u-type-primary-dark !important;
524
532
  }
525
533
 
@@ -529,22 +537,22 @@ function agreeprivacyauthorization(event: any) {
529
537
  }
530
538
 
531
539
  .u-success-plain-hover {
532
- color: #ffffff !important;
540
+ color: var(--u-white-color) !important;
533
541
  background: $u-type-success-dark !important;
534
542
  }
535
543
 
536
544
  .u-warning-plain-hover {
537
- color: #ffffff !important;
545
+ color: var(--u-white-color) !important;
538
546
  background: $u-type-warning-dark !important;
539
547
  }
540
548
 
541
549
  .u-error-plain-hover {
542
- color: #ffffff !important;
550
+ color: var(--u-white-color) !important;
543
551
  background: $u-type-error-dark !important;
544
552
  }
545
553
 
546
554
  .u-info-plain-hover {
547
- color: #ffffff !important;
555
+ color: var(--u-white-color) !important;
548
556
  background: $u-type-info-dark !important;
549
557
  }
550
558
 
@@ -556,26 +564,26 @@ function agreeprivacyauthorization(event: any) {
556
564
 
557
565
  .u-primary-hover {
558
566
  background: $u-type-primary-dark !important;
559
- color: #fff;
567
+ color: var(--u-white-color);
560
568
  }
561
569
 
562
570
  .u-success-hover {
563
571
  background: $u-type-success-dark !important;
564
- color: #fff;
572
+ color: var(--u-white-color);
565
573
  }
566
574
 
567
575
  .u-info-hover {
568
576
  background: $u-type-info-dark !important;
569
- color: #fff;
577
+ color: var(--u-white-color);
570
578
  }
571
579
 
572
580
  .u-warning-hover {
573
581
  background: $u-type-warning-dark !important;
574
- color: #fff;
582
+ color: var(--u-white-color);
575
583
  }
576
584
 
577
585
  .u-error-hover {
578
586
  background: $u-type-error-dark !important;
579
- color: #fff;
587
+ color: var(--u-white-color);
580
588
  }
581
589
  </style>
@@ -34,15 +34,15 @@ export const CalendarProps = {
34
34
  /** 弹窗顶部左右两边的圆角值 */
35
35
  borderRadius: { type: [String, Number], default: 20 },
36
36
  /** 月份切换按钮箭头颜色 */
37
- monthArrowColor: { type: String, default: '#606266' },
37
+ monthArrowColor: { type: String, default: 'var(--u-content-color)' },
38
38
  /** 年份切换按钮箭头颜色 */
39
- yearArrowColor: { type: String, default: '#909399' },
39
+ yearArrowColor: { type: String, default: 'var(--u-tips-color)' },
40
40
  /** 默认日期字体颜色 */
41
- color: { type: String, default: '#303133' },
41
+ color: { type: String, default: 'var(--u-main-color)' },
42
42
  /** 选中|起始结束日期背景色 */
43
43
  activeBgColor: { type: String, default: () => getColor('primary') },
44
44
  /** 选中|起始结束日期字体颜色 */
45
- activeColor: { type: String, default: '#ffffff' },
45
+ activeColor: { type: String, default: 'var(--u-white-color)' },
46
46
  /** 范围内日期背景色 */
47
47
  rangeBgColor: { type: String, default: 'rgba(41,121,255,0.13)' },
48
48
  /** 范围内日期字体颜色 */
@@ -267,12 +267,12 @@ import Calendar from '../../libs/util/calendar';
267
267
  * @property {String Number} max-date 最大可选日期(默认当前日期)
268
268
  * @property {String Number} 弹窗顶部左右两边的圆角值,单位rpx(默认20)
269
269
  * @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭日历(默认true)
270
- * @property {String} month-arrow-color 月份切换按钮箭头颜色(默认#606266)
271
- * @property {String} year-arrow-color 年份切换按钮箭头颜色(默认#909399)
272
- * @property {String} color 日期字体的默认颜色(默认#303133)
270
+ * @property {String} month-arrow-color 月份切换按钮箭头颜色(默认var(--u-content-color))
271
+ * @property {String} year-arrow-color 年份切换按钮箭头颜色(默认var(--u-tips-color))
272
+ * @property {String} color 日期字体的默认颜色(默认var(--u-main-color))
273
273
  * @property {String} active-bg-color 起始/结束日期按钮的背景色(默认主题色primary)
274
274
  * @property {String Number} z-index 弹出时的z-index值(默认10075)
275
- * @property {String} active-color 起始/结束日期按钮的字体颜色(默认#ffffff)
275
+ * @property {String} active-color 起始/结束日期按钮的字体颜色(默认var(--u-white-color))
276
276
  * @property {String} range-bg-color 起始/结束日期之间的区域的背景颜色(默认rgba(41,121,255,0.13))
277
277
  * @property {String} range-color 选择范围内字体颜色(默认主题色primary)
278
278
  * @property {String} start-text 起始日期底部的提示文字(默认 '开始')
@@ -650,7 +650,7 @@ function btnFix(show: boolean) {
650
650
  width: 100%;
651
651
  box-sizing: border-box;
652
652
  font-size: 30rpx;
653
- background-color: #fff;
653
+ background-color: var(--u-bg-white);
654
654
  color: $u-main-color;
655
655
 
656
656
  &__text {
@@ -697,7 +697,7 @@ function btnFix(show: boolean) {
697
697
  flex-wrap: wrap;
698
698
  padding: 6px 0;
699
699
  box-sizing: border-box;
700
- background-color: #fff;
700
+ background-color: var(--u-bg-white);
701
701
  position: relative;
702
702
 
703
703
  &--end-date {
@@ -764,7 +764,7 @@ function btnFix(show: boolean) {
764
764
  left: 50%;
765
765
  top: 50%;
766
766
  transform: translate(-50%, -50%);
767
- color: #e4e7ed;
767
+ color: var(--u-border-color);
768
768
  z-index: 1;
769
769
  }
770
770
  }
@@ -775,7 +775,7 @@ function btnFix(show: boolean) {
775
775
  align-items: center;
776
776
  justify-content: center;
777
777
  flex-direction: column;
778
- background-color: #fff;
778
+ background-color: var(--u-bg-white);
779
779
  padding: 0 40rpx 30rpx;
780
780
  box-sizing: border-box;
781
781
  font-size: 24rpx;
@@ -197,10 +197,10 @@ function clearTimer() {
197
197
  font-size: 36rpx;
198
198
  text-align: center;
199
199
  line-height: 80rpx;
200
- background-color: #fff;
200
+ background-color: var(--u-bg-white);
201
201
  margin: 8rpx 5rpx;
202
202
  border-radius: 8rpx;
203
- box-shadow: 0 2rpx 0rpx #888992;
203
+ box-shadow: 0 2rpx 0rpx var(--u-tips-color);
204
204
  font-weight: 500;
205
205
  justify-content: center;
206
206
  }
@@ -220,19 +220,19 @@ function clearTimer() {
220
220
  align-items: center;
221
221
  border-radius: 8rpx;
222
222
  justify-content: center;
223
- box-shadow: 0 2rpx 0rpx #888992;
223
+ box-shadow: 0 2rpx 0rpx var(--u-tips-color);
224
224
  }
225
225
 
226
226
  .u-keyboard-change {
227
227
  font-size: 24rpx;
228
- box-shadow: 0 2rpx 0rpx #888992;
228
+ box-shadow: 0 2rpx 0rpx var(--u-tips-color);
229
229
  position: absolute;
230
230
  width: 96rpx;
231
231
  left: 22rpx;
232
232
  line-height: 1;
233
233
  bottom: 32rpx;
234
234
  height: 80rpx;
235
- background-color: #ffffff;
235
+ background-color: var(--u-bg-white);
236
236
  @include vue-flex;
237
237
  align-items: center;
238
238
  border-radius: 8rpx;
@@ -15,13 +15,13 @@ export const CardProps = {
15
15
  /** 标题 */
16
16
  title: { type: String, default: '' },
17
17
  /** 标题颜色 */
18
- titleColor: { type: String, default: '#303133' },
18
+ titleColor: { type: String, default: 'var(--u-main-color)' },
19
19
  /** 标题字体大小,单位rpx */
20
20
  titleSize: { type: [Number, String], default: '30' },
21
21
  /** 副标题 */
22
22
  subTitle: { type: String, default: '' },
23
23
  /** 副标题颜色 */
24
- subTitleColor: { type: String, default: '#909399' },
24
+ subTitleColor: { type: String, default: 'var(--u-tips-color)' },
25
25
  /** 副标题字体大小,单位rpx */
26
26
  subTitleSize: { type: [Number, String], default: '26' },
27
27
  /** 是否显示外部边框,只对full=false时有效(卡片与边框有空隙时) */
@@ -101,10 +101,10 @@ import { $u } from '../..';
101
101
  * @tutorial https://uviewpro.cn/zh/components/card.html
102
102
  * @property {Boolean} full 卡片与屏幕两侧是否留空隙(默认false)
103
103
  * @property {String} title 头部左边的标题
104
- * @property {String} title-color 标题颜色(默认#303133
104
+ * @property {String} title-color 标题颜色(默认var(--u-main-color)
105
105
  * @property {String | Number} title-size 标题字体大小,单位rpx(默认30)
106
106
  * @property {String} sub-title 头部右边的副标题
107
- * @property {String} sub-title-color 副标题颜色(默认#909399
107
+ * @property {String} sub-title-color 副标题颜色(默认var(--u-tips-color)
108
108
  * @property {String | Number} sub-title-size 副标题字体大小(默认26)
109
109
  * @property {Boolean} border 是否显示边框(默认true)
110
110
  * @property {String | Number} index 用于标识点击了第几个卡片
@@ -165,7 +165,7 @@ function onFootClick() {
165
165
  position: relative;
166
166
  overflow: hidden;
167
167
  font-size: 28rpx;
168
- background-color: #ffffff;
168
+ background-color: var(--u-bg-white);
169
169
  box-sizing: border-box;
170
170
 
171
171
  &-full {
@@ -54,7 +54,7 @@ defineProps(CellGroupProps);
54
54
  }
55
55
 
56
56
  .u-cell-item-box {
57
- background-color: #ffffff;
57
+ background-color: var(--u-bg-white);
58
58
  flex-direction: row;
59
59
  }
60
60
  </style>
@@ -132,7 +132,7 @@ function onClick() {
132
132
  font-size: 28rpx;
133
133
  line-height: 54rpx;
134
134
  color: $u-content-color;
135
- background-color: #fff;
135
+ background-color: var(--u-bg-white);
136
136
  text-align: left;
137
137
  }
138
138
 
@@ -147,7 +147,7 @@ function onClick() {
147
147
 
148
148
  .u-cell__right-icon-wrap {
149
149
  margin-left: 10rpx;
150
- color: #969799;
150
+ color: var(--u-tips-color);
151
151
  font-size: 28rpx;
152
152
  }
153
153