uview-pro 0.3.4 → 0.3.6
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 +66 -17
- package/components/u-action-sheet/types.ts +10 -3
- package/components/u-action-sheet/u-action-sheet.vue +21 -9
- package/components/u-action-sheet-item/types.ts +27 -0
- package/components/u-action-sheet-item/u-action-sheet-item.vue +85 -0
- package/components/u-calendar/types.ts +3 -2
- package/components/u-calendar/u-calendar.vue +2 -2
- package/components/u-checkbox-group/types.ts +2 -1
- package/components/u-checkbox-group/u-checkbox-group.vue +1 -1
- package/components/u-city-select/u-city-select.vue +2 -2
- package/components/u-dropdown/types.ts +3 -2
- package/components/u-dropdown/u-dropdown.vue +1 -1
- package/components/u-index-anchor/u-index-anchor.vue +1 -1
- package/components/u-index-list/types.ts +2 -1
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-input/u-input.vue +2 -1
- package/components/u-line-progress/u-line-progress.vue +1 -1
- package/components/u-link/types.ts +2 -1
- package/components/u-message-input/types.ts +3 -2
- package/components/u-message-input/u-message-input.vue +1 -1
- package/components/u-modal/types.ts +3 -2
- package/components/u-modal/u-modal.vue +1 -1
- package/components/u-picker/types.ts +8 -2
- package/components/u-picker/u-picker.vue +276 -126
- package/components/u-popup/u-popup.vue +12 -17
- package/components/u-radio/u-radio.vue +2 -2
- package/components/u-radio-group/types.ts +2 -1
- package/components/u-radio-group/u-radio-group.vue +1 -1
- package/components/u-read-more/types.ts +2 -1
- package/components/u-read-more/u-read-more.vue +1 -1
- package/components/u-search/u-search.vue +14 -3
- package/components/u-select/types.ts +5 -2
- package/components/u-select/u-select.vue +56 -18
- package/components/u-slider/types.ts +3 -2
- package/components/u-slider/u-slider.vue +2 -2
- package/components/u-step/types.ts +29 -0
- package/components/u-step/u-step.vue +264 -0
- package/components/u-steps/types.ts +3 -2
- package/components/u-steps/u-steps.vue +17 -106
- package/components/u-switch/types.ts +2 -1
- package/components/u-switch/u-switch.vue +2 -2
- package/components/u-tabs/types.ts +3 -2
- package/components/u-tabs/u-tabs.vue +1 -1
- package/components/u-tabs-swiper/types.ts +3 -2
- package/components/u-tabs-swiper/u-tabs-swiper.vue +1 -1
- package/libs/function/addUnit.ts +40 -3
- package/libs/hooks/useCompRelation.ts +15 -2
- package/package.json +1 -1
- package/types/components.d.ts +3 -2
- package/types/global.d.ts +2 -0
package/changelog.md
CHANGED
|
@@ -1,19 +1,68 @@
|
|
|
1
|
-
## 0.3.
|
|
2
|
-
|
|
3
|
-
###
|
|
4
|
-
|
|
5
|
-
- **
|
|
6
|
-
- **u-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- **
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
## 0.3.6(2025-10-24)
|
|
2
|
+
|
|
3
|
+
### ✨ Features | 新功能
|
|
4
|
+
|
|
5
|
+
- **u-select:** 优化选择器组件 u-select 默认值处理逻辑,添加 preserveSelection 属性,用于控制是否保留用户上次确认的选择 ([8493ff1](https://github.com/anyup/uView-Pro/commit/8493ff16d2eee42fabe926917d940a350b86abe0))
|
|
6
|
+
- **u-picker:** 优化 picker 的初始化和渲染流程,实现多次打开 picker 时保留用户选择的逻辑,新增 preserveSelection 属性支持 ([974872e](https://github.com/anyup/uView-Pro/commit/974872ec944fbb28cdb3c40fda08c9039bf0b960))
|
|
7
|
+
|
|
8
|
+
### ♻️ Code Refactoring | 代码重构
|
|
9
|
+
|
|
10
|
+
- **components:** 使用主题色替代硬编码颜色值,统一组件的颜色风格,便于未来主题颜色的调整和维护 ([ec348d4](https://github.com/anyup/uView-Pro/commit/ec348d4a8bff4dee62da78eadd23fc3a292ebdca))
|
|
11
|
+
- **example:** 代码示例中使用主题色替换硬编码颜色值 ([3216497](https://github.com/anyup/uView-Pro/commit/32164973d54cfff3edcbe765a8ed27158f4bec7d))
|
|
12
|
+
- **u-steps:** 新增u-step ([6b86eea](https://github.com/anyup/uView-Pro/commit/6b86eeaf7699eb13f739fc038d86efb4e3b48f8a))
|
|
13
|
+
- **u-step:** 替换步骤条组件中的默认硬编码颜色值 ([f3408ef](https://github.com/anyup/uView-Pro/commit/f3408ef006991702895432e775f266fb196ddf12))
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
16
|
+
|
|
17
|
+
- **u-picker:** 修复使用u-picker组件选择地区不设置默认值报错的问题 ([7941135](https://github.com/anyup/uView-Pro/commit/7941135a87a3511a562ed10e34573ef7f786fb57))
|
|
18
|
+
|
|
19
|
+
### 👥 Contributors
|
|
20
|
+
|
|
21
|
+
<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>
|
|
22
|
+
|
|
23
|
+
## 0.3.5(2025-10-21)
|
|
24
|
+
|
|
25
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
26
|
+
|
|
27
|
+
- **u-input:** 修复input组件不支持input事件的问题 ([52d6a6a](https://github.com/anyup/uView-Pro/commit/52d6a6aaeec9ec78e4088234ff7ba056cc10fd9c))
|
|
28
|
+
- **u-search:** 修复search组件不支持input事件的问题 ([603b96f](https://github.com/anyup/uView-Pro/commit/603b96f7eeb16d3e54c82b0be7dd03deb930aef5))
|
|
29
|
+
- **u-popup:** 修复微信小程序环境下,u-popup 组件 mode=center 时,设置关闭图标位置无效的问题 ([f08197a](https://github.com/anyup/uView-Pro/commit/f08197aafdc3f874b1efcddf6cc6ff9c9edde954))
|
|
30
|
+
- **u-line-progress:** type 属性设置后仍被 active-color 内联样式覆盖的问题 ([c6f29f9](https://github.com/anyup/uView-Pro/commit/c6f29f9dc8437035a0e698e869af2fd418d0bd65))
|
|
31
|
+
|
|
32
|
+
### ✨ Features | 新功能
|
|
33
|
+
|
|
34
|
+
- **useChildren:** 添加子组件索引功能 ([8ad744f](https://github.com/anyup/uView-Pro/commit/8ad744fd51df934cc20c099686cbdc5512b22c79))
|
|
35
|
+
- **addUnit:** 增强 addUnit 函数支持多值空格分隔 ([6d89cd3](https://github.com/anyup/uView-Pro/commit/6d89cd3c5aacc0770f6f2684fd737d0f05a6e929))
|
|
36
|
+
- **u-action-sheet:** 新增自定义 ActionSheet 组件 ([f709523](https://github.com/anyup/uView-Pro/commit/f709523cba5a089eed7c717cc36b9ab199ae24da))
|
|
37
|
+
|
|
38
|
+
### 📝 Documentation | 文档
|
|
39
|
+
|
|
40
|
+
- 移除issue模板中的提交格式参考 ([83799e8](https://github.com/anyup/uView-Pro/commit/83799e882f69b0e8787a014cfab9f16ab34ba57c))
|
|
41
|
+
|
|
42
|
+
### ♻️ Code Refactoring | 代码重构
|
|
43
|
+
|
|
44
|
+
- **u-popup:** 移除弹窗组件中的冗余代码 ([40c5b64](https://github.com/anyup/uView-Pro/commit/40c5b641539fce56af4f9a4ad2440b9240464a89))
|
|
45
|
+
|
|
46
|
+
### 👥 Contributors
|
|
47
|
+
|
|
48
|
+
<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/sunjianwei"><img src="https://github.com/sunjianwei.png?size=40" width="40" height="40" alt="sunjianwei" title="sunjianwei"/></a> <a href="https://github.com/koboshi"><img src="https://github.com/koboshi.png?size=40" width="40" height="40" alt="koboshi" title="koboshi"/></a>
|
|
49
|
+
|
|
50
|
+
## 0.3.4(2025-10-20)
|
|
51
|
+
|
|
52
|
+
### ♻️ Code Refactoring | 代码重构
|
|
53
|
+
|
|
54
|
+
- **components:** 移除不必要的父组件和事件总线相关代码,优化组件间通信 ([280c2f8](https://github.com/anyup/uView-Pro/commit/280c2f8acc75764a7706ec38c742cc16703c941a))
|
|
55
|
+
- **u-safe-bottom:** 优化底部安全区组件 ([161f2d3](https://github.com/anyup/uView-Pro/commit/161f2d32ff6b9abbb6f8221a4dd99c438a606e94))
|
|
56
|
+
- **u-status-bar:** 优化状态栏组件 ([53c50ab](https://github.com/anyup/uView-Pro/commit/53c50ab8b6314a7d702b90e6b48b79301a334090))
|
|
57
|
+
|
|
58
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
59
|
+
|
|
60
|
+
- **u-subsection:** 优化列表和模式变化的监听逻辑,移除不必要的初始化调用 ([f77ee7c](https://github.com/anyup/uView-Pro/commit/f77ee7ccc7521ec2472f72dcf2fb47362ca0abd9))
|
|
61
|
+
|
|
62
|
+
### 👥 Contributors
|
|
63
|
+
|
|
64
|
+
<a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
|
|
65
|
+
|
|
17
66
|
## 0.3.3(2025-10-16)
|
|
18
67
|
|
|
19
68
|
### 🐛 Bug Fixes | Bug 修复
|
|
@@ -30,7 +79,7 @@
|
|
|
30
79
|
|
|
31
80
|
### 👥 Contributors
|
|
32
81
|
|
|
33
|
-
<a href="https://github.com/koboshi"><img src="https://github.com/koboshi.png?size=40" width="40" height="40" alt="koboshi" title="koboshi"/></a> <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>
|
|
82
|
+
<a href="https://github.com/koboshi"><img src="https://github.com/koboshi.png?size=40" width="40" height="40" alt="koboshi" title="koboshi"/></a> <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>
|
|
34
83
|
|
|
35
84
|
## 0.3.2(2025-10-15)
|
|
36
85
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ExtractPropTypes, type PropType } from 'vue';
|
|
2
2
|
import type { ActionSheetItem, ActionSheetTips } from '../../types/global';
|
|
3
3
|
import { baseProps } from '../common/props';
|
|
4
|
+
import { $u } from '../../';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* actionSheet 操作菜单
|
|
@@ -8,7 +9,7 @@ import { baseProps } from '../common/props';
|
|
|
8
9
|
*/
|
|
9
10
|
export const ActionSheetProps = {
|
|
10
11
|
...baseProps,
|
|
11
|
-
/** 点击遮罩是否可以关闭
|
|
12
|
+
/** 点击遮罩是否可以关闭actionSheet */
|
|
12
13
|
maskCloseAble: { type: Boolean, default: true },
|
|
13
14
|
/** 按钮的文字数组,可以自定义颜色和字体大小,字体单位为rpx */
|
|
14
15
|
list: {
|
|
@@ -18,7 +19,7 @@ export const ActionSheetProps = {
|
|
|
18
19
|
/** 顶部的提示文字 */
|
|
19
20
|
tips: {
|
|
20
21
|
type: Object as unknown as PropType<ActionSheetTips>,
|
|
21
|
-
default: () => ({ text: '', color:
|
|
22
|
+
default: () => ({ text: '', color: $u.color.tipsColor, fontSize: '26rpx' })
|
|
22
23
|
},
|
|
23
24
|
/** 底部的取消按钮 */
|
|
24
25
|
cancelBtn: { type: Boolean, default: true },
|
|
@@ -31,7 +32,13 @@ export const ActionSheetProps = {
|
|
|
31
32
|
/** 弹出的z-index值 */
|
|
32
33
|
zIndex: { type: [String, Number], default: 0 },
|
|
33
34
|
/** 取消按钮的文字提示 */
|
|
34
|
-
cancelText: { type: String, default: '取消' }
|
|
35
|
+
cancelText: { type: String, default: '取消' },
|
|
36
|
+
/** 字体颜色 */
|
|
37
|
+
color: { type: String, default: $u.color.mainColor },
|
|
38
|
+
/** 字体大小 */
|
|
39
|
+
fontSize: { type: [String, Number], default: '32rpx' },
|
|
40
|
+
/** 是否异步关闭 */
|
|
41
|
+
asyncClose: { type: Boolean, default: false }
|
|
35
42
|
};
|
|
36
43
|
|
|
37
44
|
export type ActionSheetProps = ExtractPropTypes<typeof ActionSheetProps>;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
|
|
16
16
|
{{ tips.text }}
|
|
17
17
|
</view>
|
|
18
|
-
<block v-for="(item, index) in list" :key="index">
|
|
18
|
+
<block v-if="list && list.length > 0" v-for="(item, index) in list" :key="index">
|
|
19
19
|
<view
|
|
20
20
|
@touchmove.stop.prevent
|
|
21
21
|
@tap="itemClick(index)"
|
|
@@ -28,10 +28,13 @@
|
|
|
28
28
|
<text class="u-action-sheet-item__subtext u-line-1" v-if="item.subText">{{ item.subText }}</text>
|
|
29
29
|
</view>
|
|
30
30
|
</block>
|
|
31
|
+
<template v-else>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</template>
|
|
31
34
|
<view class="u-gab" v-if="cancelBtn"> </view>
|
|
32
35
|
<view
|
|
33
36
|
@touchmove.stop.prevent
|
|
34
|
-
class="u-
|
|
37
|
+
class="u-action-sheet-cancel u-action-sheet-item"
|
|
35
38
|
hover-class="u-hover-class"
|
|
36
39
|
:hover-stay-time="150"
|
|
37
40
|
v-if="cancelBtn"
|
|
@@ -57,7 +60,7 @@ export default {
|
|
|
57
60
|
|
|
58
61
|
<script setup lang="ts">
|
|
59
62
|
import { computed } from 'vue';
|
|
60
|
-
import { $u } from '../..';
|
|
63
|
+
import { $u, useParent } from '../..';
|
|
61
64
|
import { ActionSheetProps } from './types';
|
|
62
65
|
|
|
63
66
|
/**
|
|
@@ -82,6 +85,8 @@ const props = defineProps(ActionSheetProps);
|
|
|
82
85
|
|
|
83
86
|
const emit = defineEmits(['update:modelValue', 'click', 'close']);
|
|
84
87
|
|
|
88
|
+
useParent('u-action-sheet');
|
|
89
|
+
|
|
85
90
|
const popupValue = computed({
|
|
86
91
|
get: () => props.modelValue,
|
|
87
92
|
set: (val: boolean) => emit('update:modelValue', val)
|
|
@@ -90,18 +95,18 @@ const popupValue = computed({
|
|
|
90
95
|
// 顶部提示的样式
|
|
91
96
|
const tipsStyle = computed(() => {
|
|
92
97
|
let style: Record<string, string> = {};
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
style.color = props.tips?.color || $u.color.tipsColor;
|
|
99
|
+
style.fontSize = $u.addUnit(props.tips?.fontSize || '26rpx');
|
|
95
100
|
return style;
|
|
96
101
|
});
|
|
97
102
|
|
|
98
103
|
// 操作项目的样式
|
|
99
104
|
const itemStyle = (index: number) => {
|
|
100
105
|
let style: Record<string, string> = {};
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
style.color = props.list[index]?.color || props.color;
|
|
107
|
+
style.fontSize = $u.addUnit(props.list[index]?.fontSize || props.fontSize);
|
|
103
108
|
// 选项被禁用的样式
|
|
104
|
-
if (props.list[index]?.disabled) style.color =
|
|
109
|
+
if (props.list[index]?.disabled) style.color = $u.color.lightColor;
|
|
105
110
|
return style;
|
|
106
111
|
};
|
|
107
112
|
|
|
@@ -136,8 +141,15 @@ function itemClick(index: number) {
|
|
|
136
141
|
// disabled的项禁止点击
|
|
137
142
|
if (props.list[index]?.disabled) return;
|
|
138
143
|
emit('click', index);
|
|
144
|
+
if (props.asyncClose) return;
|
|
139
145
|
emit('update:modelValue', false);
|
|
140
146
|
}
|
|
147
|
+
|
|
148
|
+
defineExpose({
|
|
149
|
+
props,
|
|
150
|
+
close,
|
|
151
|
+
itemClick
|
|
152
|
+
});
|
|
141
153
|
</script>
|
|
142
154
|
|
|
143
155
|
<style lang="scss" scoped>
|
|
@@ -172,7 +184,7 @@ function itemClick(index: number) {
|
|
|
172
184
|
background-color: rgb(234, 234, 236);
|
|
173
185
|
}
|
|
174
186
|
|
|
175
|
-
.u-
|
|
187
|
+
.u-action-sheet-cancel {
|
|
176
188
|
color: $u-main-color;
|
|
177
189
|
}
|
|
178
190
|
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ExtractPropTypes, type PropType } from 'vue';
|
|
2
|
+
import { baseProps } from '../common/props';
|
|
3
|
+
import { $u } from '../../';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* actionSheet 操作菜单
|
|
7
|
+
* @description 本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。本组件功能类似于uni的uni.showActionSheetAPI,配置更加灵活,所有平台都表现一致。
|
|
8
|
+
*/
|
|
9
|
+
export const ActionSheetItemProps = {
|
|
10
|
+
...baseProps,
|
|
11
|
+
/** 标题 */
|
|
12
|
+
text: { type: String, default: '' },
|
|
13
|
+
/** 描述 */
|
|
14
|
+
subText: { type: String, default: '' },
|
|
15
|
+
/** 边距 */
|
|
16
|
+
padding: { type: [Number, String] as PropType<number | string>, default: '34rpx 0' },
|
|
17
|
+
/** 字体颜色 */
|
|
18
|
+
color: { type: String, default: $u.color.mainColor },
|
|
19
|
+
/** 字体大小 */
|
|
20
|
+
fontSize: { type: [String, Number], default: '32rpx' },
|
|
21
|
+
/** 是否禁用 */
|
|
22
|
+
disabled: { type: Boolean, default: false },
|
|
23
|
+
/** 是否异步关闭 */
|
|
24
|
+
asyncClose: { type: Boolean, default: false }
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type ActionSheetItemProps = ExtractPropTypes<typeof ActionSheetItemProps>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
class="u-action-sheet-item u-line-1"
|
|
4
|
+
:class="[!isLast ? 'u-border-bottom' : '', disabled ? 'u-action-sheet-item--disabled' : '', customClass]"
|
|
5
|
+
:style="$u.toStyle(itemStyle, customStyle)"
|
|
6
|
+
@click="handleClick"
|
|
7
|
+
@touchmove.stop.prevent
|
|
8
|
+
hover-class="u-hover-class"
|
|
9
|
+
:hover-stay-time="150"
|
|
10
|
+
>
|
|
11
|
+
<slot>
|
|
12
|
+
<text>{{ text }}</text>
|
|
13
|
+
<text class="u-action-sheet-item__subtext u-line-1" v-if="subText">{{ subText }}</text>
|
|
14
|
+
</slot>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
export default {
|
|
20
|
+
name: 'u-action-sheet-item',
|
|
21
|
+
options: {
|
|
22
|
+
addGlobalClass: true,
|
|
23
|
+
// #ifndef MP-TOUTIAO
|
|
24
|
+
virtualHost: true,
|
|
25
|
+
// #endif
|
|
26
|
+
styleIsolation: 'shared'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { computed } from 'vue';
|
|
33
|
+
import { ActionSheetItemProps } from './types';
|
|
34
|
+
import { $u, useChildren } from '../../libs';
|
|
35
|
+
|
|
36
|
+
const props = defineProps(ActionSheetItemProps);
|
|
37
|
+
const emit = defineEmits(['click']);
|
|
38
|
+
|
|
39
|
+
const { parent, parentExposed, childIndex, emitToParent } = useChildren('u-action-sheet-item', 'u-action-sheet');
|
|
40
|
+
|
|
41
|
+
const isLast = computed(() => {
|
|
42
|
+
return (childIndex?.value ?? 0) + 1 >= (parent?.value?.getChildren()?.length ?? 0);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const itemStyle = computed(() => {
|
|
46
|
+
const style: Record<string, string> = {};
|
|
47
|
+
style.color = props.color || parentExposed?.value?.props?.color;
|
|
48
|
+
style.fontSize = $u.addUnit(props.fontSize || parentExposed?.value?.props?.fontSize);
|
|
49
|
+
style.padding = $u.addUnit(props.padding);
|
|
50
|
+
if (props.disabled) style.color = '#c0c4cc';
|
|
51
|
+
return style;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
function handleClick() {
|
|
55
|
+
if (props.disabled) return;
|
|
56
|
+
emit('click', childIndex?.value || 0);
|
|
57
|
+
if (!props.asyncClose && !parentExposed?.value?.props?.asyncClose) {
|
|
58
|
+
emitToParent('itemClick', childIndex?.value || 0);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" scoped>
|
|
64
|
+
@import '../../libs/css/style.components.scss';
|
|
65
|
+
|
|
66
|
+
.u-action-sheet-item {
|
|
67
|
+
@include vue-flex;
|
|
68
|
+
line-height: 1;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
align-items: center;
|
|
71
|
+
font-size: 32rpx;
|
|
72
|
+
padding: 34rpx 0;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.u-action-sheet-item--disabled {
|
|
77
|
+
color: $u-light-color;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.u-action-sheet-item__subtext {
|
|
81
|
+
font-size: 24rpx;
|
|
82
|
+
color: $u-tips-color;
|
|
83
|
+
margin-top: 20rpx;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ExtractPropTypes, type PropType } from 'vue';
|
|
2
2
|
import type { CalendarChangeDate, CalendarChangeRange, CalendarMode, ThemeType } from '../../types/global';
|
|
3
3
|
import { baseProps } from '../common/props';
|
|
4
|
+
import { $u } from '../../';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* calendar 日历类型定义
|
|
@@ -39,13 +40,13 @@ export const CalendarProps = {
|
|
|
39
40
|
/** 默认日期字体颜色 */
|
|
40
41
|
color: { type: String, default: '#303133' },
|
|
41
42
|
/** 选中|起始结束日期背景色 */
|
|
42
|
-
activeBgColor: { type: String, default:
|
|
43
|
+
activeBgColor: { type: String, default: $u.color.primary },
|
|
43
44
|
/** 选中|起始结束日期字体颜色 */
|
|
44
45
|
activeColor: { type: String, default: '#ffffff' },
|
|
45
46
|
/** 范围内日期背景色 */
|
|
46
47
|
rangeBgColor: { type: String, default: 'rgba(41,121,255,0.13)' },
|
|
47
48
|
/** 范围内日期字体颜色 */
|
|
48
|
-
rangeColor: { type: String, default:
|
|
49
|
+
rangeColor: { type: String, default: $u.color.primary },
|
|
49
50
|
/** mode=range时生效,起始日期自定义文案 */
|
|
50
51
|
startText: { type: String, default: '开始' },
|
|
51
52
|
/** mode=range时生效,结束日期自定义文案 */
|
|
@@ -270,11 +270,11 @@ import Calendar from '../../libs/util/calendar';
|
|
|
270
270
|
* @property {String} month-arrow-color 月份切换按钮箭头颜色(默认#606266)
|
|
271
271
|
* @property {String} year-arrow-color 年份切换按钮箭头颜色(默认#909399)
|
|
272
272
|
* @property {String} color 日期字体的默认颜色(默认#303133)
|
|
273
|
-
* @property {String} active-bg-color 起始/结束日期按钮的背景色(
|
|
273
|
+
* @property {String} active-bg-color 起始/结束日期按钮的背景色(默认主题色primary)
|
|
274
274
|
* @property {String Number} z-index 弹出时的z-index值(默认10075)
|
|
275
275
|
* @property {String} active-color 起始/结束日期按钮的字体颜色(默认#ffffff)
|
|
276
276
|
* @property {String} range-bg-color 起始/结束日期之间的区域的背景颜色(默认rgba(41,121,255,0.13))
|
|
277
|
-
* @property {String} range-color 选择范围内字体颜色(
|
|
277
|
+
* @property {String} range-color 选择范围内字体颜色(默认主题色primary)
|
|
278
278
|
* @property {String} start-text 起始日期底部的提示文字(默认 '开始')
|
|
279
279
|
* @property {String} end-text 结束日期底部的提示文字(默认 '结束')
|
|
280
280
|
* @property {String} btn-type 底部确定按钮的主题(默认 'primary')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ExtractPropTypes, type PropType } from 'vue';
|
|
2
2
|
import type { Shape } from '../../types/global';
|
|
3
3
|
import { baseProps } from '../common/props';
|
|
4
|
+
import { $u } from '../../';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* checkbox-group 复选框组类型定义
|
|
@@ -20,7 +21,7 @@ export const CheckboxGroupProps = {
|
|
|
20
21
|
/** 形状,square为方形,circle为原型 */
|
|
21
22
|
shape: { type: String as PropType<Shape>, default: 'square' },
|
|
22
23
|
/** 选中状态下的颜色 */
|
|
23
|
-
activeColor: { type: String, default:
|
|
24
|
+
activeColor: { type: String, default: $u.color.primary },
|
|
24
25
|
/** 组件的整体大小 */
|
|
25
26
|
size: { type: [String, Number], default: 34 },
|
|
26
27
|
/** 每个checkbox占u-checkbox-group的宽度 */
|
|
@@ -34,7 +34,7 @@ import { CheckboxGroupProps } from './types';
|
|
|
34
34
|
* @property {String} width 宽度,需带单位
|
|
35
35
|
* @property {String} shape 外观形状,shape-方形,circle-圆形(默认circle)
|
|
36
36
|
* @property {Boolean} wrap 是否每个checkbox都换行(默认false)
|
|
37
|
-
* @property {String} active-color 选中时的颜色,应用到所有子Checkbox
|
|
37
|
+
* @property {String} active-color 选中时的颜色,应用到所有子Checkbox组件(默认主题色primary)
|
|
38
38
|
* @event {Function} change 任一个checkbox状态发生变化时触发,回调为一个对象
|
|
39
39
|
* @example <u-checkbox-group></u-checkbox-group>
|
|
40
40
|
*/
|
|
@@ -116,13 +116,13 @@ import { $u } from '../..';
|
|
|
116
116
|
* u-city-select 城市选择器
|
|
117
117
|
* @description 用于选择省、市、区三级行政区域,支持回显和自定义初始值。
|
|
118
118
|
* @property {Boolean} modelValue 控制弹窗显示与隐藏(v-model)
|
|
119
|
-
* @property {Array} defaultRegion 默认选中的省市区名称数组,如 ['
|
|
119
|
+
* @property {Array} defaultRegion 默认选中的省市区名称数组,如 ['山东省', '青岛市', '崂山区']
|
|
120
120
|
* @property {Array} areaCode 默认选中的省市区编码数组,如 ['440000', '440100', '440106']
|
|
121
121
|
* @property {Boolean} maskCloseAble 是否允许点击遮罩关闭弹窗(默认 true)
|
|
122
122
|
* @property {String|Number} zIndex 弹窗层级(默认 0,自动适配)
|
|
123
123
|
* @event update:modelValue v-model 绑定值变化时触发
|
|
124
124
|
* @event city-change 选择省市区后触发,返回选中的省市区对象
|
|
125
|
-
* @example <u-city-select v-model="show" :defaultRegion="['
|
|
125
|
+
* @example <u-city-select v-model="show" :defaultRegion="['山东省', '青岛市', '崂山区']" @city-change="onChange"></u-city-select>
|
|
126
126
|
*/
|
|
127
127
|
const props = defineProps(CitySelectProps);
|
|
128
128
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { baseProps } from '../common/props';
|
|
3
|
+
import { $u } from '../../';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* u-dropdown 下拉菜单 Props
|
|
@@ -8,9 +9,9 @@ import { baseProps } from '../common/props';
|
|
|
8
9
|
export const DropdownProps = {
|
|
9
10
|
...baseProps,
|
|
10
11
|
/** 菜单标题和选项的激活态颜色 */
|
|
11
|
-
activeColor: { type: String, default:
|
|
12
|
+
activeColor: { type: String, default: $u.color.primary },
|
|
12
13
|
/** 菜单标题和选项的未激活态颜色 */
|
|
13
|
-
inactiveColor: { type: String, default:
|
|
14
|
+
inactiveColor: { type: String, default: $u.color.contentColor },
|
|
14
15
|
/** 点击遮罩是否关闭菜单 */
|
|
15
16
|
closeOnClickMask: { type: Boolean, default: true },
|
|
16
17
|
/** 点击当前激活项标题是否关闭菜单 */
|
|
@@ -83,7 +83,7 @@ import { DropdownProps } from './types';
|
|
|
83
83
|
* dropdown 下拉菜单
|
|
84
84
|
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
|
|
85
85
|
* @tutorial https://uviewpro.cn/zh/components/dropdown.html
|
|
86
|
-
* @property {String} active-color
|
|
86
|
+
* @property {String} active-color 标题和选项卡选中的颜色(默认主题色primary)
|
|
87
87
|
* @property {String} inactive-color 标题和选项卡未选中的颜色(默认#606266)
|
|
88
88
|
* @property {Boolean} close-on-click-mask 点击遮罩是否关闭菜单(默认true)
|
|
89
89
|
* @property {Boolean} close-on-click-self 点击当前激活项标题是否关闭菜单(默认true)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { $u } from '../../';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-index-list 组件 props 类型定义
|
|
@@ -33,7 +34,7 @@ export const IndexListProps = {
|
|
|
33
34
|
/** 锚点和右边索引字符高亮颜色 */
|
|
34
35
|
activeColor: {
|
|
35
36
|
type: String,
|
|
36
|
-
default:
|
|
37
|
+
default: $u.color.primary
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -61,7 +61,7 @@ import { IndexListProps } from './types';
|
|
|
61
61
|
* @property {Number|String} z-index 锚点吸顶时的层级(默认965)
|
|
62
62
|
* @property {Boolean} sticky 是否开启锚点自动吸顶(默认true)
|
|
63
63
|
* @property {Number|String} offset-top 锚点自动吸顶时与顶部的距离(默认0)
|
|
64
|
-
* @property {String} highlight-color
|
|
64
|
+
* @property {String} highlight-color 锚点和右边索引字符高亮颜色(默认主题色primary)
|
|
65
65
|
* @event {Function} select 选中右边索引字符时触发
|
|
66
66
|
* @example <u-index-list :scrollTop="scrollTop"></u-index-list>
|
|
67
67
|
*/
|
|
@@ -110,7 +110,7 @@ import { $u, useChildren } from '../..';
|
|
|
110
110
|
import { InputProps } from './types';
|
|
111
111
|
|
|
112
112
|
const props = defineProps(InputProps);
|
|
113
|
-
const emit = defineEmits(['update:modelValue', 'blur', 'focus', 'confirm', 'click']);
|
|
113
|
+
const emit = defineEmits(['update:modelValue', 'input', 'blur', 'focus', 'confirm', 'click']);
|
|
114
114
|
|
|
115
115
|
const { emitToParent } = useChildren('u-input', 'u-form-item');
|
|
116
116
|
|
|
@@ -168,6 +168,7 @@ function handleInput(event: any) {
|
|
|
168
168
|
// 判断是否去除空格
|
|
169
169
|
if (props.trim) value = $u.trim(value);
|
|
170
170
|
emit('update:modelValue', value);
|
|
171
|
+
emit('input', value);
|
|
171
172
|
// 当前model 赋值
|
|
172
173
|
defaultValue.value = value;
|
|
173
174
|
// 过一个生命周期再发送事件给u-form-item,否则this.$emit('update:modelValue')更新了父组件的值,但是微信小程序上
|
|
@@ -65,7 +65,7 @@ const slots = useSlots();
|
|
|
65
65
|
const progressStyle = computed(() => {
|
|
66
66
|
let style: Record<string, string> = {};
|
|
67
67
|
style.width = props.percent + '%';
|
|
68
|
-
if (props.activeColor) style.backgroundColor = props.activeColor;
|
|
68
|
+
if (!props.type && props.activeColor) style.backgroundColor = props.activeColor;
|
|
69
69
|
return style;
|
|
70
70
|
});
|
|
71
71
|
</script>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { $u } from '../../';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-link 组件 props 类型定义
|
|
@@ -8,7 +9,7 @@ export const LinkProps = {
|
|
|
8
9
|
/** 文字颜色 */
|
|
9
10
|
color: {
|
|
10
11
|
type: String,
|
|
11
|
-
default:
|
|
12
|
+
default: $u.color.primary
|
|
12
13
|
},
|
|
13
14
|
/** 字体大小,单位rpx */
|
|
14
15
|
fontSize: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { MessageInputMode } from '../../types/global';
|
|
3
|
+
import { $u } from '../../';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* u-message-input 组件 props 类型定义
|
|
@@ -49,12 +50,12 @@ export const MessageInputProps = {
|
|
|
49
50
|
/** 激活样式 */
|
|
50
51
|
activeColor: {
|
|
51
52
|
type: String,
|
|
52
|
-
default:
|
|
53
|
+
default: $u.color.primary
|
|
53
54
|
},
|
|
54
55
|
/** 未激活的样式 */
|
|
55
56
|
inactiveColor: {
|
|
56
57
|
type: String,
|
|
57
|
-
default:
|
|
58
|
+
default: $u.color.contentColor
|
|
58
59
|
},
|
|
59
60
|
/** 输入框的大小,单位rpx,宽等于高 */
|
|
60
61
|
width: {
|
|
@@ -99,7 +99,7 @@ import { MessageInputProps } from './types';
|
|
|
99
99
|
* @property {Boolean} focus 是否自动获取焦点(默认false)
|
|
100
100
|
* @property {Boolean} bold 字体和输入横线是否加粗(默认true)
|
|
101
101
|
* @property {String|Number} font-size 字体大小,单位rpx(默认60)
|
|
102
|
-
* @property {String} active-color
|
|
102
|
+
* @property {String} active-color 当前激活输入框的样式(默认主题色primary)
|
|
103
103
|
* @property {String} inactive-color 非激活输入框的样式,文字颜色同此值(默认#606266)
|
|
104
104
|
* @property {String|Number} width 输入框宽度,单位rpx,高等于宽(默认80)
|
|
105
105
|
* @property {Boolean} disabled-keyboard 禁止点击输入框唤起系统键盘(默认false)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { $u } from '../../';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-modal 组件 props 类型定义
|
|
@@ -58,12 +59,12 @@ export const ModalProps = {
|
|
|
58
59
|
/** 确认按钮颜色 */
|
|
59
60
|
confirmColor: {
|
|
60
61
|
type: String,
|
|
61
|
-
default:
|
|
62
|
+
default: $u.color.primary
|
|
62
63
|
},
|
|
63
64
|
/** 取消文字颜色 */
|
|
64
65
|
cancelColor: {
|
|
65
66
|
type: String,
|
|
66
|
-
default:
|
|
67
|
+
default: $u.color.contentColor
|
|
67
68
|
},
|
|
68
69
|
/** 圆角值 */
|
|
69
70
|
borderRadius: {
|
|
@@ -88,7 +88,7 @@ import { ModalProps } from './types';
|
|
|
88
88
|
* @property {String} confirm-text 确认按钮的文字内容(默认"确认")
|
|
89
89
|
* @property {String} cancel-text 取消按钮的文字内容(默认"取消")
|
|
90
90
|
* @property {String} cancel-color 取消按钮的颜色(默认"#606266")
|
|
91
|
-
* @property {String} confirm-color
|
|
91
|
+
* @property {String} confirm-color 确认按钮的文字内容(默认主题色primary)
|
|
92
92
|
* @property {String | Number} border-radius 模态框圆角值,单位rpx(默认16)
|
|
93
93
|
* @property {Object} title-style 自定义标题样式,对象形式
|
|
94
94
|
* @property {Object} content-style 自定义内容样式,对象形式
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { PickerMode, PickerParams } from '../../types/global';
|
|
3
|
+
import { $u } from '../../';
|
|
3
4
|
|
|
4
5
|
const defaultParams: PickerParams = {
|
|
5
6
|
year: true,
|
|
@@ -33,6 +34,11 @@ export const PickerProps = {
|
|
|
33
34
|
type: Array as PropType<any[]>,
|
|
34
35
|
default: () => [0]
|
|
35
36
|
},
|
|
37
|
+
/** 是否保留用户上次确认的选择(true:优先使用已保存选择;false:优先使用外部传入的 defaultSelector/defaultTime/defaultRegion) */
|
|
38
|
+
preserveSelection: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
},
|
|
36
42
|
/** 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容 */
|
|
37
43
|
rangeKey: {
|
|
38
44
|
type: String,
|
|
@@ -56,12 +62,12 @@ export const PickerProps = {
|
|
|
56
62
|
/** "取消"按钮的颜色 */
|
|
57
63
|
cancelColor: {
|
|
58
64
|
type: String,
|
|
59
|
-
default:
|
|
65
|
+
default: $u.color.contentColor
|
|
60
66
|
},
|
|
61
67
|
/** "确定"按钮的颜色 */
|
|
62
68
|
confirmColor: {
|
|
63
69
|
type: String,
|
|
64
|
-
default:
|
|
70
|
+
default: $u.color.primary
|
|
65
71
|
},
|
|
66
72
|
/** 默认显示的时间,2025-07-02 || 2025-07-02 13:01:00 || 2025/07/02 */
|
|
67
73
|
defaultTime: {
|