uview-pro 0.5.14 → 0.5.16
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 +53 -8
- package/components/u-action-sheet/types.ts +10 -2
- package/components/u-action-sheet-item/types.ts +10 -2
- package/components/u-alert-tips/types.ts +10 -2
- package/components/u-avatar/types.ts +10 -2
- package/components/u-back-top/types.ts +10 -2
- package/components/u-badge/types.ts +10 -2
- package/components/u-button/types.ts +11 -3
- package/components/u-button/u-button.vue +17 -0
- package/components/u-calendar/types.ts +10 -2
- package/components/u-car-keyboard/types.ts +11 -3
- package/components/u-card/types.ts +10 -2
- package/components/u-cell-group/types.ts +10 -2
- package/components/u-cell-item/types.ts +10 -2
- package/components/u-checkbox/types.ts +12 -4
- package/components/u-checkbox/u-checkbox.vue +73 -9
- package/components/u-checkbox-group/types.ts +14 -6
- package/components/u-checkbox-group/u-checkbox-group.vue +1 -1
- package/components/u-circle-progress/types.ts +10 -2
- package/components/u-city-select/types.ts +10 -2
- package/components/u-col/types.ts +10 -2
- package/components/u-collapse/types.ts +10 -2
- package/components/u-collapse-item/types.ts +10 -2
- package/components/u-column-notice/types.ts +10 -2
- package/components/u-config-provider/types.ts +10 -2
- package/components/u-count-down/types.ts +10 -2
- package/components/u-count-to/types.ts +10 -2
- package/components/u-divider/types.ts +10 -2
- package/components/u-dropdown/types.ts +10 -2
- package/components/u-dropdown-item/types.ts +10 -2
- package/components/u-empty/types.ts +10 -2
- package/components/u-fab/types.ts +10 -2
- package/components/u-field/types.ts +10 -2
- package/components/u-form/types.ts +14 -4
- package/components/u-form-item/types.ts +16 -3
- package/components/u-form-item/u-form-item.vue +73 -9
- package/components/u-full-screen/types.ts +10 -2
- package/components/u-gap/types.ts +10 -2
- package/components/u-grid/types.ts +10 -2
- package/components/u-grid-item/types.ts +10 -2
- package/components/u-icon/types.ts +10 -2
- package/components/u-image/types.ts +10 -2
- package/components/u-index-anchor/types.ts +10 -2
- package/components/u-input/types.ts +16 -3
- package/components/u-input/u-input.vue +100 -22
- package/components/u-loading/types.ts +10 -2
- package/components/u-loadmore/types.ts +10 -2
- package/components/u-mask/types.ts +10 -2
- package/components/u-message-input/types.ts +10 -2
- package/components/u-modal/types.ts +10 -2
- package/components/u-pagination/types.ts +11 -2
- package/components/u-picker/types.ts +10 -2
- package/components/u-popup/types.ts +10 -2
- package/components/u-radio/types.ts +14 -4
- package/components/u-radio/u-radio.vue +78 -10
- package/components/u-radio-group/types.ts +12 -4
- package/components/u-rate/types.ts +10 -2
- package/components/u-read-more/types.ts +10 -2
- package/components/u-row/types.ts +10 -2
- package/components/u-row-notice/types.ts +10 -2
- package/components/u-safe-bottom/types.ts +19 -0
- package/components/u-safe-bottom/u-safe-bottom.vue +1 -1
- package/components/u-search/types.ts +10 -2
- package/components/u-section/types.ts +10 -2
- package/components/u-select/types.ts +10 -2
- package/components/u-skeleton/types.ts +10 -2
- package/components/u-slider/types.ts +10 -2
- package/components/u-status-bar/types.ts +21 -0
- package/components/u-status-bar/u-status-bar.vue +1 -1
- package/components/u-step/types.ts +10 -2
- package/components/u-steps/types.ts +10 -2
- package/components/u-sticky/types.ts +10 -2
- package/components/u-subsection/types.ts +10 -2
- package/components/u-swipe-action/types.ts +10 -2
- package/components/u-swiper/types.ts +10 -2
- package/components/u-switch/types.ts +12 -4
- package/components/u-switch/u-switch.vue +60 -5
- package/components/u-tabbar/types.ts +10 -2
- package/components/u-table/types.ts +10 -2
- package/components/u-tabs/types.ts +10 -2
- package/components/u-tabs-swiper/types.ts +10 -2
- package/components/u-tag/types.ts +10 -2
- package/components/u-tag/u-tag.vue +5 -0
- package/components/u-td/types.ts +10 -2
- package/components/u-text/types.ts +10 -2
- package/components/u-textarea/types.ts +16 -5
- package/components/u-textarea/u-textarea.vue +87 -6
- package/components/u-th/types.ts +10 -2
- package/components/u-time-line/u-time-line.vue +13 -2
- package/components/u-time-line-item/types.ts +10 -2
- package/components/u-toast/types.ts +10 -2
- package/components/u-top-tips/types.ts +10 -2
- package/components/u-tr/types.ts +11 -3
- package/components/u-transition/types.ts +10 -2
- package/components/u-upload/types.ts +10 -2
- package/components/u-verification-code/types.ts +10 -2
- package/components/u-waterfall/types.ts +10 -2
- package/index.ts +4 -5
- package/libs/config/config.ts +27 -4
- package/libs/css/common.scss +5 -0
- package/libs/hooks/useCompRelation.ts +37 -34
- package/libs/index.ts +0 -1
- package/libs/util/config-provider.ts +24 -25
- package/package.json +3 -2
- package/types/global.d.ts +8 -9
- package/components/common/props.ts +0 -22
- package/components/u-safe-bottom/props.ts +0 -11
- package/components/u-status-bar/props.ts +0 -13
- package/libs/util/logger.ts +0 -364
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="u-radio" :style="$u.toStyle(radioStyle, customStyle)" :class="customClass">
|
|
3
3
|
<view class="u-radio__icon-wrap" @tap="toggle" :class="iconClass" :style="$u.toStyle(iconStyle)">
|
|
4
|
-
<u-icon
|
|
4
|
+
<u-icon
|
|
5
|
+
custom-class="u-radio__icon-wrap__icon"
|
|
6
|
+
name="checkbox-mark"
|
|
7
|
+
:size="elIconSize"
|
|
8
|
+
:color="iconColor"
|
|
9
|
+
/>
|
|
5
10
|
</view>
|
|
6
11
|
<view
|
|
7
12
|
class="u-radio__label"
|
|
8
13
|
@tap="onClickLabel"
|
|
9
14
|
:style="{
|
|
10
|
-
fontSize:
|
|
15
|
+
fontSize: labelFontSize
|
|
11
16
|
}"
|
|
12
17
|
>
|
|
13
18
|
<slot>
|
|
@@ -34,6 +39,7 @@ export default {
|
|
|
34
39
|
import { computed } from 'vue';
|
|
35
40
|
import { $u, useChildren } from '../..';
|
|
36
41
|
import { RadioProps } from './types';
|
|
42
|
+
import type { SizeType } from '../../types/global';
|
|
37
43
|
|
|
38
44
|
/**
|
|
39
45
|
* radio 单选框
|
|
@@ -56,6 +62,7 @@ const emit = defineEmits(['change']);
|
|
|
56
62
|
|
|
57
63
|
// 使用组件关系 hooks 获取父组件
|
|
58
64
|
const { parentExposed } = useChildren('u-radio', 'u-radio-group');
|
|
65
|
+
const { parentExposed: formExposed } = useChildren('u-radio', 'u-form');
|
|
59
66
|
|
|
60
67
|
// radio 的value值,id
|
|
61
68
|
const radioValue = computed(() => {
|
|
@@ -81,6 +88,54 @@ const parentData = computed(() => {
|
|
|
81
88
|
);
|
|
82
89
|
});
|
|
83
90
|
|
|
91
|
+
// 根据 size 定义不同的配置
|
|
92
|
+
const sizeConfig = {
|
|
93
|
+
small: {
|
|
94
|
+
size: 28,
|
|
95
|
+
fontSize: 24,
|
|
96
|
+
iconSize: 16
|
|
97
|
+
},
|
|
98
|
+
default: {
|
|
99
|
+
size: 34,
|
|
100
|
+
fontSize: 28,
|
|
101
|
+
iconSize: 20
|
|
102
|
+
},
|
|
103
|
+
large: {
|
|
104
|
+
size: 40,
|
|
105
|
+
fontSize: 32,
|
|
106
|
+
iconSize: 24
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// 获取实际使用的 size 值(优先级:props.size > u-radio-group.size > u-form.size)
|
|
111
|
+
const actualSize = computed(() => {
|
|
112
|
+
// 优先使用 props 的 size 属性
|
|
113
|
+
if (props.size !== '') {
|
|
114
|
+
return String(props.size);
|
|
115
|
+
}
|
|
116
|
+
// 次优先:使用 u-radio-group 的 size 属性
|
|
117
|
+
if (parentExposed.value?.props?.size) {
|
|
118
|
+
return String(parentExposed.value.props.size);
|
|
119
|
+
}
|
|
120
|
+
// 最后:使用 u-form 的 size 属性(u-form 的 size 只支持预设值)
|
|
121
|
+
if (formExposed.value?.props?.size) {
|
|
122
|
+
return String(formExposed.value.props.size);
|
|
123
|
+
}
|
|
124
|
+
// 默认值
|
|
125
|
+
return 'default';
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// 判断实际使用的 size 是否在预设配置中
|
|
129
|
+
const isInSizeConfig = computed(() => actualSize.value in sizeConfig);
|
|
130
|
+
|
|
131
|
+
// 获取预设 size(用于查找 sizeConfig 配置,如图标大小、高度等)
|
|
132
|
+
const presetSize = computed(() => {
|
|
133
|
+
return (isInSizeConfig.value ? actualSize.value : 'default') as SizeType;
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// 获取当前尺寸配置
|
|
137
|
+
const currentSizeConfig = computed(() => sizeConfig[presetSize.value]);
|
|
138
|
+
|
|
84
139
|
/**
|
|
85
140
|
* 是否禁用,如果父组件u-radio-group禁用的话,将会忽略子组件的配置
|
|
86
141
|
*/
|
|
@@ -103,18 +158,31 @@ const elLabelDisabled = computed(() =>
|
|
|
103
158
|
* 组件尺寸,对应size的值,默认值为34rpx
|
|
104
159
|
* 兼容无size属性场景
|
|
105
160
|
*/
|
|
106
|
-
const elSize = computed(() =>
|
|
107
|
-
// 若props无size,直接用默认值
|
|
108
|
-
// 兼容老代码,parentData.value.size 可能不存在
|
|
109
|
-
return (props as any).size ? (props as any).size : parentData.value.size ? parentData.value.size : 34;
|
|
110
|
-
});
|
|
161
|
+
const elSize = computed(() => currentSizeConfig.value.size);
|
|
111
162
|
|
|
112
163
|
/**
|
|
113
164
|
* 组件的勾选图标的尺寸,默认20
|
|
114
165
|
*/
|
|
115
|
-
const elIconSize = computed(() =>
|
|
116
|
-
|
|
117
|
-
|
|
166
|
+
const elIconSize = computed(() => {
|
|
167
|
+
if (props.iconSize) {
|
|
168
|
+
return props.iconSize;
|
|
169
|
+
}
|
|
170
|
+
if (parentExposed.value?.props?.iconSize) {
|
|
171
|
+
return parentExposed.value?.props?.iconSize;
|
|
172
|
+
}
|
|
173
|
+
if (isInSizeConfig.value) {
|
|
174
|
+
return currentSizeConfig.value.iconSize;
|
|
175
|
+
}
|
|
176
|
+
return 20;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// label字体大小,默认28
|
|
180
|
+
const labelFontSize = computed(() => {
|
|
181
|
+
if (isInSizeConfig.value) {
|
|
182
|
+
return $u.addUnit(currentSizeConfig.value.fontSize);
|
|
183
|
+
}
|
|
184
|
+
return $u.addUnit(props.labelSize);
|
|
185
|
+
});
|
|
118
186
|
|
|
119
187
|
/**
|
|
120
188
|
* 组件选中激活时的颜色
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { Shape } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
import { getColor } from '../../';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -8,7 +7,16 @@ import { getColor } from '../../';
|
|
|
8
7
|
* @description 单选框用于有一个选择,用户只能选择其中一个的场景。搭配u-radio使用
|
|
9
8
|
*/
|
|
10
9
|
export const RadioGroupProps = {
|
|
11
|
-
|
|
10
|
+
/** 自定义根节点样式 */
|
|
11
|
+
customStyle: {
|
|
12
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
13
|
+
default: () => ({})
|
|
14
|
+
},
|
|
15
|
+
/** 自定义根节点样式类 */
|
|
16
|
+
customClass: {
|
|
17
|
+
type: String as unknown as PropType<string>,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
12
20
|
/** 是否禁用所有单选框 */
|
|
13
21
|
disabled: { type: Boolean, default: false },
|
|
14
22
|
/** 匹配某一个radio组件,如果某个radio的name值等于此值,那么这个radio就被会选中 */
|
|
@@ -16,13 +24,13 @@ export const RadioGroupProps = {
|
|
|
16
24
|
/** 选中状态下的颜色 */
|
|
17
25
|
activeColor: { type: String, default: () => getColor('primary') },
|
|
18
26
|
/** 组件的整体大小 */
|
|
19
|
-
size: { type: [String, Number] as PropType<number | string>, default:
|
|
27
|
+
size: { type: [String, Number] as PropType<number | string>, default: '' },
|
|
20
28
|
/** 是否禁止点击提示语选中复选框 */
|
|
21
29
|
labelDisabled: { type: Boolean, default: false },
|
|
22
30
|
/** 形状,square为方形,circle为原型 */
|
|
23
31
|
shape: { type: String as PropType<Shape>, default: 'circle' },
|
|
24
32
|
/** 图标的大小,单位rpx */
|
|
25
|
-
iconSize: { type: [String, Number] as PropType<number | string>, default:
|
|
33
|
+
iconSize: { type: [String, Number] as PropType<number | string>, default: '' },
|
|
26
34
|
/** 每个checkbox占u-checkbox-group的宽度 */
|
|
27
35
|
width: { type: [String, Number] as PropType<number | string>, default: 'auto' },
|
|
28
36
|
/** 是否每个checkbox都换行 */
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* RateProps 评分组件 props 类型定义
|
|
6
5
|
* @description 满意度调查、星型评分场景
|
|
7
6
|
*/
|
|
8
7
|
export const RateProps = {
|
|
9
|
-
|
|
8
|
+
/** 自定义根节点样式 */
|
|
9
|
+
customStyle: {
|
|
10
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
11
|
+
default: () => ({})
|
|
12
|
+
},
|
|
13
|
+
/** 自定义根节点样式类 */
|
|
14
|
+
customClass: {
|
|
15
|
+
type: String as unknown as PropType<string>,
|
|
16
|
+
default: ''
|
|
17
|
+
},
|
|
10
18
|
/** v-model双向绑定选中的星星数量 */
|
|
11
19
|
modelValue: { type: [Number, String] as PropType<number | string>, default: -1 },
|
|
12
20
|
/** 要显示的星星数量 */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
import { getColor, useLocale } from '../../';
|
|
4
3
|
|
|
5
4
|
const { t } = useLocale();
|
|
@@ -9,7 +8,16 @@ const { t } = useLocale();
|
|
|
9
8
|
* @description 内容较长时收起/展开的场景
|
|
10
9
|
*/
|
|
11
10
|
export const ReadMoreProps = {
|
|
12
|
-
|
|
11
|
+
/** 自定义根节点样式 */
|
|
12
|
+
customStyle: {
|
|
13
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
/** 自定义根节点样式类 */
|
|
17
|
+
customClass: {
|
|
18
|
+
type: String as unknown as PropType<string>,
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
13
21
|
/** 默认的显示占位高度,单位为rpx */
|
|
14
22
|
showHeight: { type: [Number, String] as PropType<number | string>, default: 400 },
|
|
15
23
|
/** 展开后是否显示"收起"按钮 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { RowAlign, RowJustify } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* RowProps 行布局 props 类型定义
|
|
@@ -8,7 +7,16 @@ import { baseProps } from '../common/props';
|
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
export const RowProps = {
|
|
11
|
-
|
|
10
|
+
/** 自定义根节点样式 */
|
|
11
|
+
customStyle: {
|
|
12
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
13
|
+
default: () => ({})
|
|
14
|
+
},
|
|
15
|
+
/** 自定义根节点样式类 */
|
|
16
|
+
customClass: {
|
|
17
|
+
type: String as unknown as PropType<string>,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
12
20
|
/** 给col添加间距,左右边距各占一半 */
|
|
13
21
|
gutter: { type: [String, Number] as PropType<number | string>, default: 20 },
|
|
14
22
|
/** 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`) */
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { PlayState, ThemeType } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* RowNoticeProps 水平滚动通告栏 props 类型定义
|
|
7
6
|
* @description 水平滚动通告栏,支持主题、图标、关闭等
|
|
8
7
|
*/
|
|
9
8
|
export const RowNoticeProps = {
|
|
10
|
-
|
|
9
|
+
/** 自定义根节点样式 */
|
|
10
|
+
customStyle: {
|
|
11
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
},
|
|
14
|
+
/** 自定义根节点样式类 */
|
|
15
|
+
customClass: {
|
|
16
|
+
type: String as unknown as PropType<string>,
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
11
19
|
/** 显示的内容,数组 */
|
|
12
20
|
list: { type: Array as PropType<string[]>, default: () => [] },
|
|
13
21
|
/** 显示的主题,success|error|primary|info|warning|none */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SafeBottomProps SafeBottom 底部安全区
|
|
5
|
+
*/
|
|
6
|
+
export const SafeBottomProps = {
|
|
7
|
+
/** 自定义根节点样式 */
|
|
8
|
+
customStyle: {
|
|
9
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
10
|
+
default: () => ({})
|
|
11
|
+
},
|
|
12
|
+
/** 自定义根节点样式类 */
|
|
13
|
+
customClass: {
|
|
14
|
+
type: String as unknown as PropType<string>,
|
|
15
|
+
default: ''
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type SafeBottomProps = ExtractPropTypes<typeof SafeBottomProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { InputAlign, SearchShape } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
import { useLocale } from '../../';
|
|
5
4
|
|
|
6
5
|
const { t } = useLocale();
|
|
@@ -10,7 +9,16 @@ const { t } = useLocale();
|
|
|
10
9
|
* @description 集成常见搜索框功能,开箱即用
|
|
11
10
|
*/
|
|
12
11
|
export const SearchProps = {
|
|
13
|
-
|
|
12
|
+
/** 自定义根节点样式 */
|
|
13
|
+
customStyle: {
|
|
14
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
15
|
+
default: () => ({})
|
|
16
|
+
},
|
|
17
|
+
/** 自定义根节点样式类 */
|
|
18
|
+
customClass: {
|
|
19
|
+
type: String as unknown as PropType<string>,
|
|
20
|
+
default: ''
|
|
21
|
+
},
|
|
14
22
|
/** 搜索框形状,round-圆形,square-方形 */
|
|
15
23
|
shape: { type: String as PropType<SearchShape>, default: 'round' },
|
|
16
24
|
/** 搜索框背景色,默认值var(--u-bg-gray-light) */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
import { useLocale } from '../../';
|
|
4
3
|
|
|
5
4
|
const { t } = useLocale();
|
|
@@ -11,7 +10,16 @@ const { t } = useLocale();
|
|
|
11
10
|
export type FontSize = string | number;
|
|
12
11
|
|
|
13
12
|
export const SectionProps = {
|
|
14
|
-
|
|
13
|
+
/** 自定义根节点样式 */
|
|
14
|
+
customStyle: {
|
|
15
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
16
|
+
default: () => ({})
|
|
17
|
+
},
|
|
18
|
+
/** 自定义根节点样式类 */
|
|
19
|
+
customClass: {
|
|
20
|
+
type: String as unknown as PropType<string>,
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
15
23
|
/** 标题信息 */
|
|
16
24
|
title: { type: String, default: '' },
|
|
17
25
|
/** 右边副标题内容 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { SelectListItem, SelectMode } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
import { getColor, useLocale } from '../../';
|
|
5
4
|
|
|
6
5
|
const { t } = useLocale();
|
|
@@ -10,7 +9,16 @@ const { t } = useLocale();
|
|
|
10
9
|
* @description 用于单列、多列、多列联动的选择场景
|
|
11
10
|
*/
|
|
12
11
|
export const SelectProps = {
|
|
13
|
-
|
|
12
|
+
/** 自定义根节点样式 */
|
|
13
|
+
customStyle: {
|
|
14
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
15
|
+
default: () => ({})
|
|
16
|
+
},
|
|
17
|
+
/** 自定义根节点样式类 */
|
|
18
|
+
customClass: {
|
|
19
|
+
type: String as unknown as PropType<string>,
|
|
20
|
+
default: ''
|
|
21
|
+
},
|
|
14
22
|
/** 列数据 */
|
|
15
23
|
list: { type: Array as PropType<SelectListItem[] | SelectListItem[][]>, default: () => [] },
|
|
16
24
|
/** 是否显示边框 */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
|
|
4
3
|
const skeleton = {
|
|
5
4
|
loading: true,
|
|
@@ -20,7 +19,16 @@ const skeleton = {
|
|
|
20
19
|
* @description 骨架屏用于页面数据加载时的占位
|
|
21
20
|
*/
|
|
22
21
|
export const SkeletonProps = {
|
|
23
|
-
|
|
22
|
+
/** 自定义根节点样式 */
|
|
23
|
+
customStyle: {
|
|
24
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
25
|
+
default: () => ({})
|
|
26
|
+
},
|
|
27
|
+
/** 自定义根节点样式类 */
|
|
28
|
+
customClass: {
|
|
29
|
+
type: String as unknown as PropType<string>,
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
24
32
|
// 是否展示骨架组件
|
|
25
33
|
loading: {
|
|
26
34
|
type: Boolean,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
import { getColor } from '../../';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -7,7 +6,16 @@ import { getColor } from '../../';
|
|
|
7
6
|
* @description 滑块选择器,支持自定义样式、步长、禁用等
|
|
8
7
|
*/
|
|
9
8
|
export const SliderProps = {
|
|
10
|
-
|
|
9
|
+
/** 自定义根节点样式 */
|
|
10
|
+
customStyle: {
|
|
11
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
},
|
|
14
|
+
/** 自定义根节点样式类 */
|
|
15
|
+
customClass: {
|
|
16
|
+
type: String as unknown as PropType<string>,
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
11
19
|
/** 当前进度百分比值,范围0-100 */
|
|
12
20
|
modelValue: { type: [Number, String] as PropType<number | string>, default: 0 },
|
|
13
21
|
/** 是否禁用滑块 */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const StatusBarProps = {
|
|
4
|
+
/** 自定义根节点样式 */
|
|
5
|
+
customStyle: {
|
|
6
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
7
|
+
default: () => ({})
|
|
8
|
+
},
|
|
9
|
+
/** 自定义根节点样式类 */
|
|
10
|
+
customClass: {
|
|
11
|
+
type: String as unknown as PropType<string>,
|
|
12
|
+
default: ''
|
|
13
|
+
},
|
|
14
|
+
/** 背景设置 */
|
|
15
|
+
background: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'transparent'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type StatusBarProps = ExtractPropTypes<typeof StatusBarProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
import type { StepMode, ThemeType } from '../../types/global';
|
|
4
3
|
import { getColor } from '../../';
|
|
5
4
|
|
|
@@ -9,7 +8,16 @@ import { getColor } from '../../';
|
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
export const StepProps = {
|
|
12
|
-
|
|
11
|
+
/** 自定义根节点样式 */
|
|
12
|
+
customStyle: {
|
|
13
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
/** 自定义根节点样式类 */
|
|
17
|
+
customClass: {
|
|
18
|
+
type: String as unknown as PropType<string>,
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
13
21
|
/** 步骤条的类型,dot|number */
|
|
14
22
|
mode: { type: String as PropType<StepMode>, default: 'dot' },
|
|
15
23
|
/** 主题类型, primary|success|info|warning|error */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { StepDirection, StepMode, StepsListItem, ThemeType } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
import { getColor } from '../../';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -9,7 +8,16 @@ import { getColor } from '../../';
|
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
export const StepsProps = {
|
|
12
|
-
|
|
11
|
+
/** 自定义根节点样式 */
|
|
12
|
+
customStyle: {
|
|
13
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
/** 自定义根节点样式类 */
|
|
17
|
+
customClass: {
|
|
18
|
+
type: String as unknown as PropType<string>,
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
13
21
|
/** 步骤条的类型,dot|number */
|
|
14
22
|
mode: { type: String as PropType<StepMode>, default: 'dot' },
|
|
15
23
|
/** 步骤条的数据 */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
import zIndex from '../../libs/config/zIndex';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -7,7 +6,16 @@ import zIndex from '../../libs/config/zIndex';
|
|
|
7
6
|
* @description 吸顶组件,支持自定义吸顶距离、z-index、背景色等
|
|
8
7
|
*/
|
|
9
8
|
export const StickyProps = {
|
|
10
|
-
|
|
9
|
+
/** 自定义根节点样式 */
|
|
10
|
+
customStyle: {
|
|
11
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
},
|
|
14
|
+
/** 自定义根节点样式类 */
|
|
15
|
+
customClass: {
|
|
16
|
+
type: String as unknown as PropType<string>,
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
11
19
|
/** 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px */
|
|
12
20
|
offsetTop: { type: [Number, String] as PropType<number | string>, default: 0 },
|
|
13
21
|
/** 列表中的索引值 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { SubsectionListItem, SubsectionMode } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* SubsectionProps 分段器 props 类型定义
|
|
@@ -8,7 +7,16 @@ import { baseProps } from '../common/props';
|
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
export const SubsectionProps = {
|
|
11
|
-
|
|
10
|
+
/** 自定义根节点样式 */
|
|
11
|
+
customStyle: {
|
|
12
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
13
|
+
default: () => ({})
|
|
14
|
+
},
|
|
15
|
+
/** 自定义根节点样式类 */
|
|
16
|
+
customClass: {
|
|
17
|
+
type: String as unknown as PropType<string>,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
12
20
|
/** tab的数据 */
|
|
13
21
|
list: { type: Array as PropType<Array<string | SubsectionListItem>>, default: () => [] },
|
|
14
22
|
/** 当前活动的tab的index */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { SwipeActionOption } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* swipeAction 左滑单元格 props 类型定义
|
|
@@ -8,7 +7,16 @@ import { baseProps } from '../common/props';
|
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
export const SwipeActionProps = {
|
|
11
|
-
|
|
10
|
+
/** 自定义根节点样式 */
|
|
11
|
+
customStyle: {
|
|
12
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
13
|
+
default: () => ({})
|
|
14
|
+
},
|
|
15
|
+
/** 自定义根节点样式类 */
|
|
16
|
+
customClass: {
|
|
17
|
+
type: String as unknown as PropType<string>,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
12
20
|
/** index值,用于得知点击删除的是哪个按钮 */
|
|
13
21
|
index: {
|
|
14
22
|
type: [Number, String] as PropType<string | number>,
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { ImgMode, SwiperIndicatorPosition, SwiperMode } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* SwiperProps 轮播图 props 类型定义
|
|
7
6
|
* @description 轮播图,支持多种指示器、3D、自动播放等
|
|
8
7
|
*/
|
|
9
8
|
export const SwiperProps = {
|
|
10
|
-
|
|
9
|
+
/** 自定义根节点样式 */
|
|
10
|
+
customStyle: {
|
|
11
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
},
|
|
14
|
+
/** 自定义根节点样式类 */
|
|
15
|
+
customClass: {
|
|
16
|
+
type: String as unknown as PropType<string>,
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
11
19
|
/** 轮播数据列表,数组对象 */
|
|
12
20
|
list: { type: Array as PropType<Array<Record<string, any>>>, default: () => [] },
|
|
13
21
|
/** 是否显示标题 */
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import { getColor } from '../../';
|
|
2
|
+
import type { SizeType } from '../../types/global';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* SwitchProps 开关选择器 props 类型定义
|
|
7
6
|
* @description 选择开关,支持自定义颜色、尺寸、值等
|
|
8
7
|
*/
|
|
9
8
|
export const SwitchProps = {
|
|
10
|
-
|
|
9
|
+
/** 自定义根节点样式 */
|
|
10
|
+
customStyle: {
|
|
11
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
},
|
|
14
|
+
/** 自定义根节点样式类 */
|
|
15
|
+
customClass: {
|
|
16
|
+
type: String as unknown as PropType<string>,
|
|
17
|
+
default: ''
|
|
18
|
+
},
|
|
11
19
|
/** 是否显示加载中状态 */
|
|
12
20
|
loading: { type: Boolean, default: false },
|
|
13
21
|
/** 是否禁用 */
|
|
14
22
|
disabled: { type: Boolean, default: false },
|
|
15
23
|
/** 开关尺寸,单位rpx */
|
|
16
|
-
size: { type: [Number, String] as PropType<number | string>, default:
|
|
24
|
+
size: { type: [Number, String] as PropType<number | string | SizeType>, default: '' },
|
|
17
25
|
/** 打开时的颜色 */
|
|
18
26
|
activeColor: { type: String, default: 'var(--u-type-primary)' },
|
|
19
27
|
/** 关闭时的颜色 */
|