uview-plus 3.7.36 → 3.8.32

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 (132) hide show
  1. package/README.md +0 -1
  2. package/changelog.md +2047 -1782
  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-cropper/u-cropper.vue +409 -387
  23. package/components/u-datetime-picker/u-datetime-picker.vue +79 -10
  24. package/components/u-dragsort/u-dragsort.vue +3 -0
  25. package/components/u-dropdown/u-dropdown.vue +15 -2
  26. package/components/u-dropdown-item/u-dropdown-item.vue +3 -3
  27. package/components/u-form-item/u-form-item.vue +6 -1
  28. package/components/u-gap/u-gap.vue +5 -1
  29. package/components/u-goods-sku/u-goods-sku.vue +16 -15
  30. package/components/u-index-anchor/u-index-anchor.vue +13 -2
  31. package/components/u-index-list/u-index-list.vue +18 -5
  32. package/components/u-input/input.js +3 -3
  33. package/components/u-input/u-input.vue +27 -5
  34. package/components/u-keyboard/u-keyboard.vue +11 -6
  35. package/components/u-loading-page/loadingPage.js +1 -1
  36. package/components/u-loading-page/u-loading-page.vue +18 -12
  37. package/components/u-navbar/navbar.js +2 -3
  38. package/components/u-navbar/theme-vars.scss +21 -0
  39. package/components/u-navbar/u-navbar.vue +30 -6
  40. package/components/u-notice-bar/theme-vars.scss +25 -0
  41. package/components/u-notice-bar/u-notice-bar.vue +24 -5
  42. package/components/u-number-box/numberBox.js +4 -4
  43. package/components/u-number-box/u-number-box.vue +27 -13
  44. package/components/u-number-keyboard/u-number-keyboard.vue +6 -6
  45. package/components/u-picker/picker.js +43 -43
  46. package/components/u-picker/u-picker.vue +14 -2
  47. package/components/u-popup/popup.js +1 -1
  48. package/components/u-popup/u-popup.vue +14 -6
  49. package/components/u-poster/u-poster.vue +12 -10
  50. package/components/u-pull-refresh/u-pull-refresh.vue +6 -6
  51. package/components/u-qrcode/qrcode.js +35 -29
  52. package/components/u-qrcode/u-qrcode.vue +17 -12
  53. package/components/u-radio/u-radio.vue +6 -6
  54. package/components/u-rate/rate.js +2 -2
  55. package/components/u-rate/u-rate.vue +98 -21
  56. package/components/u-search/search.js +3 -3
  57. package/components/u-search/u-search.vue +29 -6
  58. package/components/u-select/u-select.vue +141 -73
  59. package/components/u-signature/u-signature.vue +35 -16
  60. package/components/u-skeleton/u-skeleton.vue +7 -2
  61. package/components/u-slider/u-slider.vue +30 -31
  62. package/components/u-steps-item/u-steps-item.vue +20 -17
  63. package/components/u-subsection/theme-vars.scss +41 -0
  64. package/components/u-subsection/u-subsection.vue +69 -16
  65. package/components/u-swipe-action-item/u-swipe-action-item.vue +11 -5
  66. package/components/u-switch/theme-vars.scss +41 -0
  67. package/components/u-switch/u-switch.vue +44 -15
  68. package/components/u-tabbar/u-tabbar.vue +5 -5
  69. package/components/u-tabbar-item/u-tabbar-item.vue +16 -5
  70. package/components/u-table/u-table.vue +18 -3
  71. package/components/u-table2/tableRow.vue +43 -41
  72. package/components/u-table2/u-table2.vue +56 -50
  73. package/components/u-tabs/u-tabs.vue +14 -1
  74. package/components/u-tag/theme-vars.scss +21 -0
  75. package/components/u-tag/u-tag.vue +17 -7
  76. package/components/u-td/u-td.vue +5 -3
  77. package/components/u-text/text.js +1 -1
  78. package/components/u-text/u-text.vue +15 -13
  79. package/components/u-textarea/props.js +2 -2
  80. package/components/u-textarea/textarea.js +1 -1
  81. package/components/u-textarea/u-textarea.vue +115 -61
  82. package/components/u-th/u-th.vue +5 -4
  83. package/components/u-title/u-title.vue +1 -0
  84. package/components/u-toast/u-toast.vue +13 -9
  85. package/components/u-tooltip/u-tooltip.vue +1 -0
  86. package/components/u-tree/u-tree.vue +491 -51
  87. package/components/u-upload/u-upload.vue +34 -6
  88. package/index.js +178 -27
  89. package/index.scss +5 -1
  90. package/libs/config/color.js +1 -2
  91. package/libs/config/config.js +2 -0
  92. package/libs/config/props.js +1 -1
  93. package/libs/css/theme-vars-core.scss +201 -0
  94. package/libs/css/theme-vars.scss +1 -0
  95. package/libs/function/index.js +7 -7
  96. package/libs/mixin/mixin.js +111 -4
  97. package/libs/root/index.js +151 -0
  98. package/libs/root/nvue-root.vue +72 -0
  99. package/libs/root/page.js +269 -0
  100. package/libs/root/root-toast-host.vue +31 -0
  101. package/libs/root/root.js +44 -0
  102. package/libs/root/runtime.js +11 -0
  103. package/libs/root/utils.js +115 -0
  104. package/libs/theme/runtime.js +392 -0
  105. package/libs/theme/theme.js +682 -0
  106. package/libs/util/gcanvas/bridge/bridge-weex.js +0 -0
  107. package/libs/util/gcanvas/context-2d/FillStyleLinearGradient.js +0 -0
  108. package/libs/util/gcanvas/context-2d/FillStylePattern.js +0 -0
  109. package/libs/util/gcanvas/context-2d/FillStyleRadialGradient.js +0 -0
  110. package/libs/util/gcanvas/context-2d/RenderingContext.js +0 -0
  111. package/libs/util/gcanvas/context-webgl/ActiveInfo.js +0 -0
  112. package/libs/util/gcanvas/context-webgl/Buffer.js +0 -0
  113. package/libs/util/gcanvas/context-webgl/Framebuffer.js +0 -0
  114. package/libs/util/gcanvas/context-webgl/GLenum.js +0 -0
  115. package/libs/util/gcanvas/context-webgl/GLmethod.js +0 -0
  116. package/libs/util/gcanvas/context-webgl/GLtype.js +0 -0
  117. package/libs/util/gcanvas/context-webgl/Program.js +0 -0
  118. package/libs/util/gcanvas/context-webgl/Renderbuffer.js +0 -0
  119. package/libs/util/gcanvas/context-webgl/RenderingContext.js +0 -0
  120. package/libs/util/gcanvas/context-webgl/Shader.js +0 -0
  121. package/libs/util/gcanvas/context-webgl/ShaderPrecisionFormat.js +0 -0
  122. package/libs/util/gcanvas/context-webgl/Texture.js +0 -0
  123. package/libs/util/gcanvas/context-webgl/UniformLocation.js +0 -0
  124. package/libs/util/gcanvas/context-webgl/classUtils.js +0 -0
  125. package/libs/util/gcanvas/env/canvas.js +0 -0
  126. package/libs/util/gcanvas/env/image.js +0 -0
  127. package/libs/util/gcanvas/env/tool.js +0 -0
  128. package/libs/util/gcanvas/index.js +0 -0
  129. package/package.json +3 -2
  130. package/theme.scss +113 -32
  131. package/types/comps/qrcode.d.ts +6 -0
  132. package/types/index.d.ts +47 -2
@@ -8,20 +8,28 @@
8
8
  :key="index"
9
9
  >
10
10
  <image
11
- v-if="item.isImage || (item.type && item.type === 'image')"
11
+ v-if="(item.isImage || (item.type && item.type === 'image')) && (item.thumb || item.url)"
12
12
  :src="item.thumb || item.url"
13
13
  :mode="imageMode"
14
14
  class="u-upload__wrap__preview__image"
15
15
  @tap="onClickPreview(item, index)"
16
16
  :style="[{
17
17
  width: addUnit(width),
18
- height: addUnit(height)
18
+ height: addUnit(height),
19
+ backgroundColor: upThemeVar('--up-card-bg-color', 'rgb(242, 242, 242)'),
20
+ borderColor: upThemeVar('--up-border-color', '#e5e7eb'),
21
+ borderWidth: '1px',
22
+ borderStyle: 'solid'
19
23
  }]"
20
24
  />
21
25
  <view class="u-upload__wrap__preview__video"
22
26
  :style="{
23
27
  width: addUnit(width),
24
- height: addUnit(height)
28
+ height: addUnit(height),
29
+ backgroundColor: upThemeVar('--up-card-bg-color', 'rgb(242, 242, 242)'),
30
+ borderColor: upThemeVar('--up-border-color', '#e5e7eb'),
31
+ borderWidth: '1px',
32
+ borderStyle: 'solid'
25
33
  }"
26
34
  v-else-if="(item.isVideo || (item.type && item.type === 'video')) && getVideoThumb">
27
35
  <image
@@ -56,7 +64,11 @@
56
64
  @tap="onClickPreview(item, index)"
57
65
  :style="[{
58
66
  width: addUnit(width),
59
- height: addUnit(height)
67
+ height: addUnit(height),
68
+ backgroundColor: upThemeVar('--up-card-bg-color', 'rgb(242, 242, 242)'),
69
+ borderColor: upThemeVar('--up-border-color', '#e5e7eb'),
70
+ borderWidth: '1px',
71
+ borderStyle: 'solid'
60
72
  }]"
61
73
  >
62
74
  <up-icon
@@ -153,17 +165,22 @@
153
165
  :class="[disabled && 'u-upload__button--disabled']"
154
166
  :style="[{
155
167
  width: addUnit(width),
156
- height: addUnit(height)
168
+ height: addUnit(height),
169
+ backgroundColor: upThemeVar('--up-card-bg-color', 'rgb(244, 245, 247)'),
170
+ borderColor: upThemeVar('--up-border-color', '#e5e7eb'),
171
+ borderWidth: '1px',
172
+ borderStyle: 'solid'
157
173
  }]"
158
174
  >
159
175
  <up-icon
160
176
  :name="uploadIcon"
161
177
  size="26"
162
- :color="uploadIconColor"
178
+ :color="resolvedUploadIconColor"
163
179
  ></up-icon>
164
180
  <text
165
181
  v-if="uploadText"
166
182
  class="u-upload__button__text"
183
+ :style="{ color: resolvedUploadTextColor }"
167
184
  >{{ uploadText }}</text>
168
185
  </view>
169
186
  </template>
@@ -267,6 +284,17 @@
267
284
  }
268
285
  }
269
286
  },
287
+ computed: {
288
+ resolvedUploadIconColor() {
289
+ if (this.upHasProp('uploadIconColor') || this.uploadIconColor !== '#D3D4D6') {
290
+ return this.uploadIconColor
291
+ }
292
+ return this.upThemeVar('--up-content-color', '#909399')
293
+ },
294
+ resolvedUploadTextColor() {
295
+ return this.upThemeVar('--up-tips-color', '#909399')
296
+ }
297
+ },
270
298
  // #ifdef VUE3
271
299
  emits: ['error', 'beforeRead', 'oversize', 'afterRead', 'delete', 'clickPreview', 'update:fileList', 'afterAutoUpload'],
272
300
  // #endif
package/index.js CHANGED
@@ -43,6 +43,95 @@ import fontUtil from './components/u-icon/util.js';
43
43
 
44
44
  // i18n
45
45
  import i18n, { t } from './libs/i18n/index.js'
46
+ import {
47
+ themeState,
48
+ setTheme,
49
+ setThemePreference,
50
+ getThemePreference,
51
+ getSystemTheme,
52
+ getThemeVars,
53
+ initThemeSystem,
54
+ refreshThemeFromConfig,
55
+ syncThemeColorOverrideState
56
+ } from './libs/theme/theme.js'
57
+ import {
58
+ applyNativeThemeUI,
59
+ getThemeCardStyle,
60
+ getThemeIsDark,
61
+ getThemePageStyle,
62
+ getThemeTabBarStyle,
63
+ getThemeVar,
64
+ getThemeVarsForStyle
65
+ } from './libs/theme/runtime.js'
66
+
67
+ const rootToastState = {
68
+ ref: null
69
+ }
70
+ const rootNotifyState = {
71
+ ref: null
72
+ }
73
+
74
+ function normalizeRootToastOptions(options = {}) {
75
+ const toastOptions = typeof options === 'string'
76
+ ? { message: options }
77
+ : (options && typeof options === 'object' ? { ...options } : {})
78
+ if (!toastOptions.message && toastOptions.title) {
79
+ toastOptions.message = toastOptions.title
80
+ }
81
+ return toastOptions
82
+ }
83
+
84
+ function setRootToastRef(ref = null) {
85
+ rootToastState.ref = ref || null
86
+ }
87
+
88
+ function rootToast(options = {}) {
89
+ const toastOptions = normalizeRootToastOptions(options)
90
+ const toastRef = rootToastState.ref
91
+ if (toastRef && typeof toastRef.show === 'function') {
92
+ toastRef.show(toastOptions)
93
+ return
94
+ }
95
+ if (!toastOptions.message) return
96
+ if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
97
+ uni.showToast({
98
+ title: toastOptions.message,
99
+ icon: 'none',
100
+ duration: Number(toastOptions.duration) || 2000,
101
+ })
102
+ }
103
+ }
104
+
105
+ function normalizeRootNotifyOptions(options = {}) {
106
+ const notifyOptions = typeof options === 'string'
107
+ ? { message: options }
108
+ : (options && typeof options === 'object' ? { ...options } : {})
109
+ if (!notifyOptions.message && notifyOptions.title) {
110
+ notifyOptions.message = notifyOptions.title
111
+ }
112
+ return notifyOptions
113
+ }
114
+
115
+ function setRootNotifyRef(ref = null) {
116
+ rootNotifyState.ref = ref || null
117
+ }
118
+
119
+ function rootNotify(options = {}) {
120
+ const notifyOptions = normalizeRootNotifyOptions(options)
121
+ const notifyRef = rootNotifyState.ref
122
+ if (notifyRef && typeof notifyRef.show === 'function') {
123
+ notifyRef.show(notifyOptions)
124
+ return
125
+ }
126
+ if (!notifyOptions.message) return
127
+ if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
128
+ uni.showToast({
129
+ title: notifyOptions.message,
130
+ icon: 'none',
131
+ duration: Number(notifyOptions.duration) || 3000,
132
+ })
133
+ }
134
+ }
46
135
 
47
136
  // 导出
48
137
  let themeType = ['primary', 'success', 'error', 'warning', 'info'];
@@ -58,10 +147,21 @@ export * from './libs/function/colorGradient.js'
58
147
  * @param {object} zIndex 修改内置zIndex属性
59
148
  */
60
149
  export function setConfig(configs) {
61
- index.shallowMerge(config, configs.config || {})
62
- index.shallowMerge(props, configs.props || {})
63
- index.shallowMerge(color, configs.color || {})
64
- index.shallowMerge(zIndex, configs.zIndex || {})
150
+ const settings = configs || {}
151
+ index.shallowMerge(config, settings.config || {})
152
+ index.shallowMerge(props, settings.props || {})
153
+ index.shallowMerge(color, settings.color || {})
154
+ index.shallowMerge(zIndex, settings.zIndex || {})
155
+ syncThemeColorOverrideState({
156
+ color: settings.color,
157
+ configColor: settings?.config?.color
158
+ })
159
+ const shouldRefreshTheme = !!settings.color
160
+ || !!settings?.config?.color
161
+ || themeState.version > 0
162
+ if (shouldRefreshTheme) {
163
+ refreshThemeFromConfig()
164
+ }
65
165
  }
66
166
  index.setConfig = setConfig
67
167
 
@@ -85,11 +185,59 @@ const $u = {
85
185
  // props,
86
186
  ...index,
87
187
  color,
88
- platform
188
+ platform,
189
+ theme: themeState,
190
+ setTheme,
191
+ setThemePreference,
192
+ getThemePreference,
193
+ getSystemTheme,
194
+ getThemeVars,
195
+ getThemeTabBarStyle,
196
+ applyNativeThemeUI,
197
+ rootToast,
198
+ setRootToastRef,
199
+ rootNotify,
200
+ setRootNotifyRef
89
201
  }
90
202
 
91
203
  export const mount$u = function() {
92
204
  uni.$u = $u
205
+ initThemeSystem()
206
+ }
207
+
208
+ function defineGlobalThemeHelpers(Vue) {
209
+ const globalProperties = Vue?.config?.globalProperties
210
+ if (!globalProperties) return
211
+ Object.defineProperty(globalProperties, 'upThemeIsDark', {
212
+ configurable: true,
213
+ get() {
214
+ return getThemeIsDark()
215
+ }
216
+ })
217
+ Object.defineProperty(globalProperties, 'upThemeVars', {
218
+ configurable: true,
219
+ get() {
220
+ return getThemeVarsForStyle()
221
+ }
222
+ })
223
+ Object.defineProperty(globalProperties, 'upThemePageStyle', {
224
+ configurable: true,
225
+ get() {
226
+ return getThemePageStyle()
227
+ }
228
+ })
229
+ Object.defineProperty(globalProperties, 'upThemeCardStyle', {
230
+ configurable: true,
231
+ get() {
232
+ return getThemeCardStyle()
233
+ }
234
+ })
235
+ globalProperties.upThemeVar = function(varName, fallbackColor) {
236
+ return getThemeVar(varName, fallbackColor)
237
+ }
238
+ globalProperties.upApplyNativeThemeUI = function() {
239
+ return applyNativeThemeUI()
240
+ }
93
241
  }
94
242
 
95
243
  function toCamelCase(str) {
@@ -100,27 +248,27 @@ function toCamelCase(str) {
100
248
  });
101
249
  }
102
250
 
103
- // #ifdef APP || H5
104
- const importFn = import.meta.glob('./components/u-*/u-*.vue', { eager: true })
105
- let components = [];
106
-
107
- // 批量注册全局组件
108
- for (const key in importFn) {
109
- let component = importFn[key].default;
110
- if (component.name && component.name.indexOf('u--') !== 0) {
111
- component.install = function (Vue) {
112
- Vue.component(name, component);
113
- };
114
-
115
- // 导入组件
116
- components.push(component);
251
+ let components = []
252
+
253
+ function resolveComponents() {
254
+ if (components.length) return components
255
+ // #ifdef H5
256
+ const canUseGlob = typeof import.meta !== 'undefined' && typeof import.meta.glob === 'function'
257
+ if (!canUseGlob) return components
258
+ const importFn = import.meta.glob('./components/u-*/u-*.vue', { eager: true })
259
+ for (const key in importFn) {
260
+ const component = importFn[key]?.default
261
+ if (component?.name && component.name.indexOf('u--') !== 0) {
262
+ components.push(component)
263
+ }
117
264
  }
265
+ // #endif
266
+ return components
118
267
  }
119
- // #endif
120
268
 
121
269
  const install = (Vue, upuiParams = '') => {
122
- // #ifdef APP || H5
123
- components.forEach(function(component) {
270
+ // #ifdef H5
271
+ resolveComponents().forEach(function(component) {
124
272
  const name = component.name.replace(/u-([a-zA-Z0-9-_]+)/g, 'up-$1');
125
273
  if (name != component.name) {
126
274
  Vue.component(component.name, component);
@@ -144,12 +292,15 @@ const install = (Vue, upuiParams = '') => {
144
292
  // 同时挂载到uni和Vue.prototype中
145
293
  // $u挂载到uni对象上
146
294
  uni.$u = $u
295
+ initThemeSystem()
147
296
 
148
- // #ifndef APP-NVUE
149
- // 只有vue,挂载到Vue.prototype才有意义,因为nvue中全局Vue.prototype和Vue.mixin是无效的
150
- Vue.config.globalProperties.$u = $u
151
- Vue.mixin(mixin)
152
- // #endif
297
+ if (Vue && Vue.config && Vue.config.globalProperties) {
298
+ Vue.config.globalProperties.$u = $u
299
+ defineGlobalThemeHelpers(Vue)
300
+ }
301
+ if (Vue && typeof Vue.mixin === 'function') {
302
+ Vue.mixin(mixin)
303
+ }
153
304
  }
154
305
 
155
306
  export default {
package/index.scss CHANGED
@@ -1,3 +1,7 @@
1
+ /* #ifndef APP-NVUE */
2
+ @import "./libs/css/theme-vars.scss";
3
+ /* #endif */
4
+
1
5
  // 引入公共基础类
2
6
  @import "./libs/css/common.scss";
3
7
  @import "./libs/css/components.scss";
@@ -22,4 +26,4 @@
22
26
  // H5特有的样式
23
27
  /* #ifdef H5 */
24
28
  @import "./libs/css/h5.scss";
25
- /* #endif */
29
+ /* #endif */
@@ -1,4 +1,3 @@
1
- // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
2
1
  // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
3
2
  const color = {
4
3
  primary: '#3c9cff',
@@ -14,4 +13,4 @@ const color = {
14
13
  borderColor: '#e4e7ed'
15
14
  }
16
15
 
17
- export default color
16
+ export default color
@@ -47,6 +47,8 @@ export default {
47
47
  customIcons: {}, // 自定义图标与unicode对应关系
48
48
  // 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
49
49
  unit: 'px',
50
+ // 是否由运行时主题同步原生导航栏、页面背景、tabBar等全局UI
51
+ nativeThemeSync: false,
50
52
  // 拦截器
51
53
  interceptor: {
52
54
  navbarLeftClick: null
@@ -202,7 +202,7 @@ function setConfig(configs) {
202
202
  }
203
203
 
204
204
  // 初始化自定义配置
205
- if (uni && uni.upuiParams) {
205
+ if (typeof uni !== 'undefined' && uni && uni.upuiParams) {
206
206
  console.log('setting uview-plus')
207
207
  let temp = uni.upuiParams()
208
208
  if (temp.httpIns) {
@@ -0,0 +1,201 @@
1
+ :root,
2
+ page,
3
+ body {
4
+ --up-main-color: var(--up-light-main-color, #303133);
5
+ --up-content-color: var(--up-light-content-color, #606266);
6
+ --up-tips-color: var(--up-light-tips-color, #909193);
7
+ --up-light-color: var(--up-light-light-color, #c0c4cc);
8
+ --up-border-color: var(--up-light-border-color, #dadbde);
9
+ --up-bg-color: var(--up-light-bg-color, #f3f4f6);
10
+ --up-hover-bg-color: #e7ebf0;
11
+ --up-page-bg-color: #f3f4f6;
12
+ --up-card-bg-color: #ffffff;
13
+ --up-navbar-bg-color: #ffffff;
14
+ --up-disabled-color: var(--up-light-disabled-color, #c8c9cc);
15
+
16
+ --up-primary: var(--up-light-primary, #3c9cff);
17
+ --up-primary-dark: var(--up-light-primary-dark, #398ade);
18
+ --up-primary-disabled: var(--up-light-primary-disabled, #9acafc);
19
+ --up-primary-light: var(--up-light-primary-light, #ecf5ff);
20
+
21
+ --up-warning: var(--up-light-warning, #f9ae3d);
22
+ --up-warning-dark: var(--up-light-warning-dark, #f1a532);
23
+ --up-warning-disabled: var(--up-light-warning-disabled, #f9d39b);
24
+ --up-warning-light: var(--up-light-warning-light, #fdf6ec);
25
+
26
+ --up-success: var(--up-light-success, #5ac725);
27
+ --up-success-dark: var(--up-light-success-dark, #53c21d);
28
+ --up-success-disabled: var(--up-light-success-disabled, #a9e08f);
29
+ --up-success-light: var(--up-light-success-light, #f5fff0);
30
+
31
+ --up-error: var(--up-light-error, #f56c6c);
32
+ --up-error-dark: var(--up-light-error-dark, #e45656);
33
+ --up-error-disabled: var(--up-light-error-disabled, #f7b2b2);
34
+ --up-error-light: var(--up-light-error-light, #fef0f0);
35
+
36
+ --up-info: var(--up-light-info, #909399);
37
+ --up-info-dark: var(--up-light-info-dark, #767a82);
38
+ --up-info-disabled: var(--up-light-info-disabled, #c4c6c9);
39
+ --up-info-light: var(--up-light-info-light, #f4f4f5);
40
+
41
+ --up-table2-header-bg-color: #f5f7fa;
42
+ --up-table2-zebra-bg-color: #fafafa;
43
+ --up-table2-highlight-bg-color: #f5f7fa;
44
+ --up-gap-bg-color: #f3f4f6;
45
+ --up-skeleton-bg-color: #f1f2f4;
46
+ --up-skeleton-shimmer-color: #e6e6e6;
47
+ --up-swipe-action-button-bg-color: #c7c6cd;
48
+ --up-index-list-indicator-bg-color: #c9c9c9;
49
+ --up-calendar-month-mark-color: rgba(231, 232, 234, 0.83);
50
+ }
51
+
52
+ @media (prefers-color-scheme: dark) {
53
+ :root,
54
+ page,
55
+ body {
56
+ --up-main-color: #f5f5f5;
57
+ --up-content-color: #d1d5db;
58
+ --up-tips-color: #9ca3af;
59
+ --up-light-color: #6b7280;
60
+ --up-border-color: #3a3a3c;
61
+ --up-bg-color: #1f1f1f;
62
+ --up-hover-bg-color: #343741;
63
+ --up-page-bg-color: #1f1f1f;
64
+ --up-card-bg-color: #1c1c1e;
65
+ --up-navbar-bg-color: #1c1c1e;
66
+ --up-disabled-color: #4b5563;
67
+
68
+ --up-primary: #3c9cff;
69
+ --up-primary-dark: #5aa8ff;
70
+ --up-primary-disabled: #4c6f92;
71
+ --up-primary-light: #10243a;
72
+
73
+ --up-warning: #f9ae3d;
74
+ --up-warning-dark: #ffbf66;
75
+ --up-warning-disabled: #8a6a3a;
76
+ --up-warning-light: #3d2f1b;
77
+
78
+ --up-success: #5ac725;
79
+ --up-success-dark: #7ad94b;
80
+ --up-success-disabled: #5f7f4f;
81
+ --up-success-light: #1f3316;
82
+
83
+ --up-error: #f56c6c;
84
+ --up-error-dark: #ff8a8a;
85
+ --up-error-disabled: #8d5858;
86
+ --up-error-light: #3a2222;
87
+
88
+ --up-info: #909399;
89
+ --up-info-dark: #b0b3b8;
90
+ --up-info-disabled: #5f6368;
91
+ --up-info-light: #2f3238;
92
+
93
+ --up-table2-header-bg-color: #2a2d33;
94
+ --up-table2-zebra-bg-color: #23262b;
95
+ --up-table2-highlight-bg-color: #2f3440;
96
+ --up-gap-bg-color: #111111;
97
+ --up-skeleton-bg-color: #2f3135;
98
+ --up-skeleton-shimmer-color: rgba(255, 255, 255, 0.12);
99
+ --up-swipe-action-button-bg-color: #4b5563;
100
+ --up-index-list-indicator-bg-color: #4b5563;
101
+ --up-calendar-month-mark-color: rgba(255, 255, 255, 0.04);
102
+ }
103
+ }
104
+
105
+ [data-up-theme='light'] {
106
+ --up-main-color: var(--up-light-main-color, #303133);
107
+ --up-content-color: var(--up-light-content-color, #606266);
108
+ --up-tips-color: var(--up-light-tips-color, #909193);
109
+ --up-light-color: var(--up-light-light-color, #c0c4cc);
110
+ --up-border-color: var(--up-light-border-color, #dadbde);
111
+ --up-bg-color: var(--up-light-bg-color, #f3f4f6);
112
+ --up-hover-bg-color: #e7ebf0;
113
+ --up-page-bg-color: #f3f4f6;
114
+ --up-card-bg-color: #ffffff;
115
+ --up-navbar-bg-color: #ffffff;
116
+ --up-disabled-color: var(--up-light-disabled-color, #c8c9cc);
117
+
118
+ --up-primary: var(--up-light-primary, #3c9cff);
119
+ --up-primary-dark: var(--up-light-primary-dark, #398ade);
120
+ --up-primary-disabled: var(--up-light-primary-disabled, #9acafc);
121
+ --up-primary-light: var(--up-light-primary-light, #ecf5ff);
122
+
123
+ --up-warning: var(--up-light-warning, #f9ae3d);
124
+ --up-warning-dark: var(--up-light-warning-dark, #f1a532);
125
+ --up-warning-disabled: var(--up-light-warning-disabled, #f9d39b);
126
+ --up-warning-light: var(--up-light-warning-light, #fdf6ec);
127
+
128
+ --up-success: var(--up-light-success, #5ac725);
129
+ --up-success-dark: var(--up-light-success-dark, #53c21d);
130
+ --up-success-disabled: var(--up-light-success-disabled, #a9e08f);
131
+ --up-success-light: var(--up-light-success-light, #f5fff0);
132
+
133
+ --up-error: var(--up-light-error, #f56c6c);
134
+ --up-error-dark: var(--up-light-error-dark, #e45656);
135
+ --up-error-disabled: var(--up-light-error-disabled, #f7b2b2);
136
+ --up-error-light: var(--up-light-error-light, #fef0f0);
137
+
138
+ --up-info: var(--up-light-info, #909399);
139
+ --up-info-dark: var(--up-light-info-dark, #767a82);
140
+ --up-info-disabled: var(--up-light-info-disabled, #c4c6c9);
141
+ --up-info-light: var(--up-light-info-light, #f4f4f5);
142
+
143
+ --up-table2-header-bg-color: #f5f7fa;
144
+ --up-table2-zebra-bg-color: #fafafa;
145
+ --up-table2-highlight-bg-color: #f5f7fa;
146
+ --up-gap-bg-color: #f3f4f6;
147
+ --up-skeleton-bg-color: #f1f2f4;
148
+ --up-skeleton-shimmer-color: #e6e6e6;
149
+ --up-swipe-action-button-bg-color: #c7c6cd;
150
+ --up-index-list-indicator-bg-color: #c9c9c9;
151
+ --up-calendar-month-mark-color: rgba(231, 232, 234, 0.83);
152
+ }
153
+
154
+ [data-up-theme='dark'] {
155
+ --up-main-color: #f5f5f5;
156
+ --up-content-color: #d1d5db;
157
+ --up-tips-color: #9ca3af;
158
+ --up-light-color: #6b7280;
159
+ --up-border-color: #3a3a3c;
160
+ --up-bg-color: #1f1f1f;
161
+ --up-hover-bg-color: #343741;
162
+ --up-page-bg-color: #1f1f1f;
163
+ --up-card-bg-color: #1c1c1e;
164
+ --up-navbar-bg-color: #1c1c1e;
165
+ --up-disabled-color: #4b5563;
166
+
167
+ --up-primary: #3c9cff;
168
+ --up-primary-dark: #5aa8ff;
169
+ --up-primary-disabled: #4c6f92;
170
+ --up-primary-light: #10243a;
171
+
172
+ --up-warning: #f9ae3d;
173
+ --up-warning-dark: #ffbf66;
174
+ --up-warning-disabled: #8a6a3a;
175
+ --up-warning-light: #3d2f1b;
176
+
177
+ --up-success: #5ac725;
178
+ --up-success-dark: #7ad94b;
179
+ --up-success-disabled: #5f7f4f;
180
+ --up-success-light: #1f3316;
181
+
182
+ --up-error: #f56c6c;
183
+ --up-error-dark: #ff8a8a;
184
+ --up-error-disabled: #8d5858;
185
+ --up-error-light: #3a2222;
186
+
187
+ --up-info: #909399;
188
+ --up-info-dark: #b0b3b8;
189
+ --up-info-disabled: #5f6368;
190
+ --up-info-light: #2f3238;
191
+
192
+ --up-table2-header-bg-color: #2a2d33;
193
+ --up-table2-zebra-bg-color: #23262b;
194
+ --up-table2-highlight-bg-color: #2f3440;
195
+ --up-gap-bg-color: #111111;
196
+ --up-skeleton-bg-color: #2f3135;
197
+ --up-skeleton-shimmer-color: rgba(255, 255, 255, 0.12);
198
+ --up-swipe-action-button-bg-color: #4b5563;
199
+ --up-index-list-indicator-bg-color: #4b5563;
200
+ --up-calendar-month-mark-color: rgba(255, 255, 255, 0.04);
201
+ }
@@ -0,0 +1 @@
1
+ @import "./theme-vars-core.scss";
@@ -1,10 +1,10 @@
1
- import {
2
- number as testNumber,
3
- array as testArray,
4
- empty as testEmpty
5
- } from './test'
6
- import { round } from './digit.js'
7
- import config from '../config/config';
1
+ import {
2
+ number as testNumber,
3
+ array as testArray,
4
+ empty as testEmpty
5
+ } from './test.js'
6
+ import { round } from './digit.js'
7
+ import config from '../config/config.js'
8
8
  /**
9
9
  * @description 如果value小于min,取min;如果value大于max,取max
10
10
  * @param {number} min