uview-pro 0.3.16 → 0.4.2
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.
- package/changelog.md +82 -0
- package/components/u-action-sheet-item/u-action-sheet-item.vue +1 -1
- package/components/u-alert-tips/u-alert-tips.vue +2 -2
- package/components/u-avatar/u-avatar.vue +5 -5
- package/components/u-avatar-cropper/u-avatar-cropper.vue +5 -5
- package/components/u-avatar-cropper/weCropper.js +1 -1
- package/components/u-avatar-cropper/weCropper.ts +1 -1
- package/components/u-back-top/types.ts +1 -1
- package/components/u-back-top/u-back-top.vue +1 -1
- package/components/u-badge/u-badge.vue +1 -31
- package/components/u-button/types.ts +1 -1
- package/components/u-button/u-button.vue +45 -37
- package/components/u-calendar/types.ts +4 -4
- package/components/u-calendar/u-calendar.vue +8 -8
- package/components/u-car-keyboard/u-car-keyboard.vue +5 -5
- package/components/u-card/types.ts +2 -2
- package/components/u-card/u-card.vue +3 -3
- package/components/u-cell-group/u-cell-group.vue +1 -1
- package/components/u-cell-item/u-cell-item.vue +2 -2
- package/components/u-checkbox/u-checkbox.vue +7 -7
- package/components/u-circle-progress/types.ts +4 -3
- package/components/u-circle-progress/u-circle-progress.vue +3 -3
- package/components/u-city-select/u-city-select.vue +1 -1
- package/components/u-collapse/types.ts +2 -2
- package/components/u-collapse/u-collapse.vue +1 -1
- package/components/u-collapse-item/u-collapse-item.vue +1 -1
- package/components/u-column-notice/u-column-notice.vue +2 -2
- package/components/u-config-provider/types.ts +34 -0
- package/components/u-config-provider/u-config-provider.vue +141 -0
- package/components/u-count-down/types.ts +4 -4
- package/components/u-count-down/u-count-down.vue +4 -4
- package/components/u-count-to/types.ts +1 -1
- package/components/u-count-to/u-count-to.vue +1 -1
- package/components/u-divider/types.ts +3 -3
- package/components/u-divider/u-divider.vue +4 -4
- package/components/u-dropdown/u-dropdown.vue +3 -3
- package/components/u-empty/types.ts +2 -2
- package/components/u-empty/u-empty.vue +1 -1
- package/components/u-field/types.ts +3 -3
- package/components/u-field/u-field.vue +6 -6
- package/components/u-form-item/u-form-item.vue +1 -1
- package/components/u-full-screen/u-full-screen.vue +1 -1
- package/components/u-gap/u-gap.vue +2 -2
- package/components/u-grid-item/types.ts +1 -1
- package/components/u-grid-item/u-grid-item.vue +3 -3
- package/components/u-icon/types.ts +2 -2
- package/components/u-icon/u-icon.vue +2 -2
- package/components/u-image/types.ts +4 -2
- package/components/u-image/u-image.vue +7 -2
- package/components/u-index-anchor/u-index-anchor.vue +3 -3
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-input/types.ts +4 -4
- package/components/u-input/u-input.vue +7 -7
- package/components/u-keyboard/u-keyboard.vue +3 -3
- package/components/u-lazy-load/u-lazy-load.vue +1 -1
- package/components/u-line/types.ts +1 -1
- package/components/u-line/u-line.vue +1 -1
- package/components/u-line-progress/types.ts +2 -2
- package/components/u-line-progress/u-line-progress.vue +3 -3
- package/components/u-link/u-link.vue +1 -1
- package/components/u-loading/types.ts +1 -1
- package/components/u-loading/u-loading.vue +3 -3
- package/components/u-loading-popup/types.ts +1 -1
- package/components/u-loading-popup/u-loading-popup.vue +2 -2
- package/components/u-loadmore/types.ts +2 -2
- package/components/u-loadmore/u-loadmore.vue +6 -6
- package/components/u-message-input/u-message-input.vue +5 -5
- package/components/u-modal/u-modal.vue +2 -2
- package/components/u-navbar/types.ts +4 -4
- package/components/u-navbar/u-navbar.vue +27 -20
- package/components/u-no-network/u-no-network.vue +2 -2
- package/components/u-number-box/types.ts +4 -4
- package/components/u-number-box/u-number-box.vue +6 -6
- package/components/u-number-keyboard/u-number-keyboard.vue +2 -2
- package/components/u-picker/u-picker.vue +4 -4
- package/components/u-popup/types.ts +1 -1
- package/components/u-popup/u-popup.vue +6 -6
- package/components/u-radio/u-radio.vue +7 -7
- package/components/u-rate/types.ts +2 -2
- package/components/u-rate/u-rate.vue +2 -2
- package/components/u-read-more/types.ts +1 -1
- package/components/u-row-notice/u-row-notice.vue +2 -2
- package/components/u-search/types.ts +4 -4
- package/components/u-search/u-search.vue +4 -4
- package/components/u-section/types.ts +2 -2
- package/components/u-section/u-section.vue +2 -2
- package/components/u-select/u-select.vue +6 -6
- package/components/u-skeleton/types.ts +2 -2
- package/components/u-skeleton/u-skeleton.vue +2 -2
- package/components/u-slider/types.ts +1 -1
- package/components/u-slider/u-slider.vue +4 -4
- package/components/u-step/u-step.vue +4 -4
- package/components/u-steps/u-steps.vue +3 -3
- package/components/u-sticky/types.ts +1 -1
- package/components/u-sticky/u-sticky.vue +1 -1
- package/components/u-subsection/types.ts +4 -4
- package/components/u-subsection/u-subsection.vue +7 -7
- package/components/u-swipe-action/types.ts +1 -1
- package/components/u-swipe-action/u-swipe-action.vue +2 -2
- package/components/u-swiper/types.ts +1 -1
- package/components/u-swiper/u-swiper.vue +1 -1
- package/components/u-switch/types.ts +1 -1
- package/components/u-switch/u-switch.vue +5 -5
- package/components/u-tabbar/types.ts +5 -4
- package/components/u-tabbar/u-tabbar.vue +5 -5
- package/components/u-table/types.ts +3 -3
- package/components/u-table/u-table.vue +3 -3
- package/components/u-tabs/types.ts +1 -1
- package/components/u-tabs/u-tabs.vue +2 -2
- package/components/u-tabs-swiper/types.ts +1 -1
- package/components/u-tabs-swiper/u-tabs-swiper.vue +2 -2
- package/components/u-tag/u-tag.vue +12 -12
- package/components/u-text/types.ts +1 -1
- package/components/u-text/u-text.vue +1 -1
- package/components/u-textarea/types.ts +1 -1
- package/components/u-textarea/u-textarea.vue +6 -6
- package/components/u-time-line/u-time-line.vue +1 -1
- package/components/u-time-line-item/types.ts +1 -1
- package/components/u-time-line-item/u-time-line-item.vue +2 -3
- package/components/u-toast/u-toast.vue +8 -8
- package/components/u-top-tips/u-top-tips.vue +1 -1
- package/components/u-upload/types.ts +2 -2
- package/components/u-upload/u-upload.vue +1 -1
- package/index.scss +1 -0
- package/index.ts +42 -11
- package/libs/config/theme-tokens.ts +101 -0
- package/libs/css/style.theme.scss +31 -0
- package/libs/css/style.vue.scss +1 -1
- package/libs/function/clipboard.ts +6 -11
- package/libs/function/color.ts +53 -22
- package/libs/hooks/index.ts +2 -0
- package/libs/hooks/useColor.ts +61 -0
- package/libs/hooks/useTheme.ts +162 -0
- package/libs/index.ts +4 -3
- package/libs/util/config-provider.ts +580 -0
- package/libs/util/system-theme.ts +25 -0
- package/package.json +5 -5
- package/theme.scss +50 -34
- package/types/components.d.ts +1 -0
- package/types/global.d.ts +47 -2
package/theme.scss
CHANGED
|
@@ -2,37 +2,53 @@
|
|
|
2
2
|
// uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中,造成微信程序包太大,
|
|
3
3
|
// 故uni.scss只建议放scss变量名相关样式,其他的样式可以通过main.js或者App.vue引入
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
$u-
|
|
7
|
-
$u-
|
|
8
|
-
$u-
|
|
9
|
-
$u-
|
|
10
|
-
$u-
|
|
11
|
-
|
|
12
|
-
$u-
|
|
13
|
-
$u-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
$u-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
$u-
|
|
21
|
-
|
|
22
|
-
$u-
|
|
23
|
-
$u-
|
|
24
|
-
$u-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
$u-type-
|
|
28
|
-
$u-type-
|
|
29
|
-
$u-type-
|
|
30
|
-
$u-type-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
$u-type-
|
|
34
|
-
$u-type-
|
|
35
|
-
$u-type-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
5
|
+
// 常用色
|
|
6
|
+
$u-main-color: var(--u-main-color, #303133);
|
|
7
|
+
$u-content-color: var(--u-content-color, #606266);
|
|
8
|
+
$u-tips-color: var(--u-tips-color, #909399);
|
|
9
|
+
$u-light-color: var(--u-light-color, #c0c4cc);
|
|
10
|
+
$u-border-color: var(--u-border-color, #e4e7ed);
|
|
11
|
+
$u-divider-color: var(--u-divider-color, #e4e7ed);
|
|
12
|
+
$u-mask-color: var(--u-mask-color, rgba(0, 0, 0, 0.4));
|
|
13
|
+
$u-shadow-color: var(--u-shadow-color, rgba(0, 0, 0, 0.1));
|
|
14
|
+
|
|
15
|
+
// 纯色
|
|
16
|
+
$u-white-color: var(--u-white-color, #ffffff);
|
|
17
|
+
$u-black-color: var(--u-black-color, #000000);
|
|
18
|
+
|
|
19
|
+
// 背景色
|
|
20
|
+
$u-bg-color: var(--u-bg-color, #f3f4f6);
|
|
21
|
+
$u-bg-white: var(--u-bg-white, #ffffff);
|
|
22
|
+
$u-bg-gray-light: var(--u-bg-gray-light, #f5f7fa);
|
|
23
|
+
$u-bg-gray-dark: var(--u-bg-gray-dark, #2f343c);
|
|
24
|
+
$u-bg-black: var(--u-bg-black, #000000);
|
|
25
|
+
|
|
26
|
+
// 主色
|
|
27
|
+
$u-type-primary: var(--u-type-primary, #2979ff);
|
|
28
|
+
$u-type-primary-light: var(--u-type-primary-light, #ecf5ff);
|
|
29
|
+
$u-type-primary-disabled: var(--u-type-primary-disabled, #a0cfff);
|
|
30
|
+
$u-type-primary-dark: var(--u-type-primary-dark, #2b85e4);
|
|
31
|
+
|
|
32
|
+
// 警告色
|
|
33
|
+
$u-type-warning: var(--u-type-warning, #ff9900);
|
|
34
|
+
$u-type-warning-disabled: var(--u-type-warning-disabled, #fcbd71);
|
|
35
|
+
$u-type-warning-dark: var(--u-type-warning-dark, #f29100);
|
|
36
|
+
$u-type-warning-light: var(--u-type-warning-light, #fdf6ec);
|
|
37
|
+
|
|
38
|
+
// 成功色
|
|
39
|
+
$u-type-success: var(--u-type-success, #19be6b);
|
|
40
|
+
$u-type-success-disabled: var(--u-type-success-disabled, #71d5a1);
|
|
41
|
+
$u-type-success-dark: var(--u-type-success-dark, #18b566);
|
|
42
|
+
$u-type-success-light: var(--u-type-success-light, #dbf1e1);
|
|
43
|
+
|
|
44
|
+
// 错误色
|
|
45
|
+
$u-type-error: var(--u-type-error, #fa3534);
|
|
46
|
+
$u-type-error-disabled: var(--u-type-error-disabled, #fab6b6);
|
|
47
|
+
$u-type-error-dark: var(--u-type-error-dark, #dd6161);
|
|
48
|
+
$u-type-error-light: var(--u-type-error-light, #fef0f0);
|
|
49
|
+
|
|
50
|
+
// 信息色
|
|
51
|
+
$u-type-info: var(--u-type-info, #909399);
|
|
52
|
+
$u-type-info-disabled: var(--u-type-info-disabled, #c8c9cc);
|
|
53
|
+
$u-type-info-dark: var(--u-type-info-dark, #82848a);
|
|
54
|
+
$u-type-info-light: var(--u-type-info-light, #f4f4f5);
|
package/types/components.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ declare module 'vue' {
|
|
|
97
97
|
uTextarea: (typeof import('../components/u-textarea/u-textarea.vue'))['default'];
|
|
98
98
|
uFab: (typeof import('../components/u-fab/u-fab.vue'))['default'];
|
|
99
99
|
uPagination: (typeof import('../components/u-pagination/u-pagination.vue'))['default'];
|
|
100
|
+
uConfigProvider: (typeof import('../components/u-config-provider/u-config-provider.vue'))['default'];
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
|
package/types/global.d.ts
CHANGED
|
@@ -312,6 +312,10 @@ export type ColorType =
|
|
|
312
312
|
| 'primaryDisabled'
|
|
313
313
|
| 'primaryLight'
|
|
314
314
|
| 'bgColor'
|
|
315
|
+
| 'bgWhite'
|
|
316
|
+
| 'bgGrayLight'
|
|
317
|
+
| 'bgGrayDark'
|
|
318
|
+
| 'bgBlack'
|
|
315
319
|
| 'info'
|
|
316
320
|
| 'infoDark'
|
|
317
321
|
| 'infoDisabled'
|
|
@@ -332,11 +336,40 @@ export type ColorType =
|
|
|
332
336
|
| 'contentColor'
|
|
333
337
|
| 'tipsColor'
|
|
334
338
|
| 'lightColor'
|
|
335
|
-
| 'borderColor'
|
|
339
|
+
| 'borderColor'
|
|
340
|
+
| 'whiteColor'
|
|
341
|
+
| 'blackColor'
|
|
342
|
+
| 'dividerColor'
|
|
343
|
+
| 'maskColor'
|
|
344
|
+
| 'shadowColor';
|
|
336
345
|
|
|
337
346
|
// 自定义主题色
|
|
338
347
|
export type ThemeColor = Partial<Record<ColorType, string>>;
|
|
339
348
|
|
|
349
|
+
export type DarkMode = 'auto' | 'light' | 'dark';
|
|
350
|
+
|
|
351
|
+
export type Theme = {
|
|
352
|
+
name: string;
|
|
353
|
+
label?: string;
|
|
354
|
+
description?: string;
|
|
355
|
+
/**
|
|
356
|
+
* 亮色模式下的令牌(会同步到 $u.color 和 CSS 变量)
|
|
357
|
+
*/
|
|
358
|
+
color: Partial<ThemeColor>;
|
|
359
|
+
/**
|
|
360
|
+
* 暗黑模式下的令牌,未提供时回退到 color
|
|
361
|
+
*/
|
|
362
|
+
darkColor?: Partial<ThemeColor>;
|
|
363
|
+
/**
|
|
364
|
+
* 需要直接注入的 CSS 变量(亮色)
|
|
365
|
+
*/
|
|
366
|
+
css?: Record<string, string>;
|
|
367
|
+
/**
|
|
368
|
+
* 需要直接注入的 CSS 变量(暗黑)
|
|
369
|
+
*/
|
|
370
|
+
darkCss?: Record<string, string>;
|
|
371
|
+
};
|
|
372
|
+
|
|
340
373
|
export type LogConfig = Partial<{
|
|
341
374
|
debug?: boolean;
|
|
342
375
|
prefix?: string;
|
|
@@ -344,7 +377,7 @@ export type LogConfig = Partial<{
|
|
|
344
377
|
}>;
|
|
345
378
|
|
|
346
379
|
export interface UViewProOptions {
|
|
347
|
-
theme?: ThemeColor;
|
|
380
|
+
theme?: ThemeColor | Theme[];
|
|
348
381
|
log?: LogConfig;
|
|
349
382
|
// 可扩展更多配置项
|
|
350
383
|
}
|
|
@@ -357,3 +390,15 @@ export type PaginationChangePayload = {
|
|
|
357
390
|
type: PaginationDirection;
|
|
358
391
|
current: number;
|
|
359
392
|
};
|
|
393
|
+
|
|
394
|
+
// tabbar 组件 Item
|
|
395
|
+
export type TabbarItem = {
|
|
396
|
+
text?: string;
|
|
397
|
+
pagePath?: string;
|
|
398
|
+
iconPath?: string;
|
|
399
|
+
selectedIconPath?: string;
|
|
400
|
+
count?: number;
|
|
401
|
+
isDot?: boolean;
|
|
402
|
+
customIcon?: boolean;
|
|
403
|
+
midButton?: boolean;
|
|
404
|
+
};
|