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,12 +1,20 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { IconLabelPosition, ImgMode } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* u-icon 组件 Props 类型定义
|
|
7
6
|
*/
|
|
8
7
|
export const IconProps = {
|
|
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
|
/** 图标名称,见示例图标集 */
|
|
11
19
|
name: { type: String, default: '' },
|
|
12
20
|
/** 图标颜色,可接受主题色 */
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { ImgMode, Shape } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
// 定义 ImageProps 的类型
|
|
6
5
|
export const ImageProps = {
|
|
7
|
-
|
|
6
|
+
/** 自定义根节点样式 */
|
|
7
|
+
customStyle: {
|
|
8
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
9
|
+
default: () => ({})
|
|
10
|
+
},
|
|
11
|
+
/** 自定义根节点样式类 */
|
|
12
|
+
customClass: {
|
|
13
|
+
type: String as unknown as PropType<string>,
|
|
14
|
+
default: ''
|
|
15
|
+
},
|
|
8
16
|
/** 图片地址 */
|
|
9
17
|
src: { type: String, default: '' },
|
|
10
18
|
/** 裁剪模式 */
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* u-index-anchor 组件 Props 类型定义
|
|
6
5
|
* @description 索引锚点属性
|
|
7
6
|
*/
|
|
8
7
|
export const IndexAnchorProps = {
|
|
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
|
/** 是否使用自定义内容的插槽 */
|
|
11
19
|
useSlot: { type: Boolean, default: false },
|
|
12
20
|
/** 索引字符,如果定义了use-slot,此参数自动失效 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import type { InputAlign, InputConfirmType, InputType } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
2
|
+
import type { InputAlign, InputConfirmType, InputType, SizeType } from '../../types/global';
|
|
4
3
|
import { useLocale } from '../../';
|
|
5
4
|
|
|
6
5
|
const { t } = useLocale();
|
|
@@ -11,7 +10,16 @@ const { t } = useLocale();
|
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
export const InputProps = {
|
|
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
|
modelValue: {
|
|
17
25
|
type: [String, Number] as PropType<string | number>,
|
|
@@ -27,6 +35,11 @@ export const InputProps = {
|
|
|
27
35
|
type: String as PropType<InputAlign>,
|
|
28
36
|
default: 'left'
|
|
29
37
|
},
|
|
38
|
+
/** 输入框文字的大小(默认default),支持 small/default/large 预设值,也支持 16/16px/16rpx 等自定义值 */
|
|
39
|
+
size: {
|
|
40
|
+
type: [String, Number] as PropType<SizeType | string | number>,
|
|
41
|
+
default: ''
|
|
42
|
+
},
|
|
30
43
|
/** placeholder显示值(默认 '请输入内容') */
|
|
31
44
|
placeholder: {
|
|
32
45
|
type: String,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
:style="getStyle"
|
|
22
22
|
:value="inputValue"
|
|
23
23
|
:placeholder="placeholder"
|
|
24
|
-
:placeholderStyle="
|
|
24
|
+
:placeholderStyle="getPlaceholderStyle"
|
|
25
25
|
:disabled="disabled"
|
|
26
26
|
:maxlength="inputMaxlength"
|
|
27
27
|
:fixed="fixed"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
:value="inputValue"
|
|
47
47
|
:password="type == 'password' && !showPassword"
|
|
48
48
|
:placeholder="placeholder"
|
|
49
|
-
:placeholderStyle="
|
|
49
|
+
:placeholderStyle="getPlaceholderStyle"
|
|
50
50
|
:disabled="disabled || type === 'select'"
|
|
51
51
|
:maxlength="inputMaxlength"
|
|
52
52
|
:focus="focus"
|
|
@@ -65,17 +65,20 @@
|
|
|
65
65
|
<view class="u-input__right-icon u-flex">
|
|
66
66
|
<view
|
|
67
67
|
class="u-input__right-icon__clear u-input__right-icon__item"
|
|
68
|
-
v-if="
|
|
68
|
+
v-if="clearable && inputValue !== '' && !disabled"
|
|
69
|
+
:style="{ marginLeft: $u.addUnit(iconSpacing) }"
|
|
70
|
+
:class="{ 'u-hidden': !focused && type !== 'select' }"
|
|
69
71
|
@click.stop="onClear"
|
|
70
72
|
>
|
|
71
|
-
<u-icon size="
|
|
73
|
+
<u-icon :size="currentIconSize" name="close-circle-fill" color="var(--u-light-color)" />
|
|
72
74
|
</view>
|
|
73
75
|
<view
|
|
74
76
|
class="u-input__right-icon__clear u-input__right-icon__item"
|
|
75
77
|
v-if="passwordIcon && type == 'password'"
|
|
78
|
+
:style="{ marginLeft: $u.addUnit(iconSpacing) }"
|
|
76
79
|
>
|
|
77
80
|
<u-icon
|
|
78
|
-
size="
|
|
81
|
+
:size="currentIconSize"
|
|
79
82
|
:name="!showPassword ? 'eye' : 'eye-fill'"
|
|
80
83
|
color="var(--u-light-color)"
|
|
81
84
|
@click="showPassword = !showPassword"
|
|
@@ -87,8 +90,9 @@
|
|
|
87
90
|
:class="{
|
|
88
91
|
'u-input__right-icon--select--reverse': selectOpen
|
|
89
92
|
}"
|
|
93
|
+
:style="{ marginLeft: $u.addUnit(iconSpacing) }"
|
|
90
94
|
>
|
|
91
|
-
<u-icon name="arrow-down-fill" size="
|
|
95
|
+
<u-icon name="arrow-down-fill" :size="selectIconSize" color="var(--u-light-color)"></u-icon>
|
|
92
96
|
</view>
|
|
93
97
|
</view>
|
|
94
98
|
<text
|
|
@@ -120,30 +124,92 @@ export default {
|
|
|
120
124
|
import { ref, computed, watch } from 'vue';
|
|
121
125
|
import { $u, useChildren } from '../..';
|
|
122
126
|
import { InputProps } from './types';
|
|
127
|
+
import type { SizeType } from '../../types/global';
|
|
123
128
|
|
|
124
129
|
const props = defineProps(InputProps);
|
|
125
130
|
const emit = defineEmits(['update:modelValue', 'input', 'blur', 'focus', 'confirm', 'click']);
|
|
126
131
|
|
|
127
132
|
const { emitToParent } = useChildren('u-input', 'u-form-item');
|
|
133
|
+
const { parentExposed } = useChildren('u-input', 'u-form');
|
|
128
134
|
|
|
129
|
-
const inputHeight = 70; // input的高度
|
|
130
|
-
const textareaHeight = 100; // textarea的高度
|
|
131
135
|
const validateState = ref(props.validateState); // 当前input的验证状态,用于错误时,边框是否改为红色
|
|
132
136
|
const focused = ref(false); // 当前是否处于获得焦点的状态
|
|
133
137
|
const showPassword = ref(false); // 是否预览密码
|
|
134
138
|
const lastValue = ref(''); // 用于头条小程序,判断@input中,前后的值是否发生了变化
|
|
135
139
|
|
|
140
|
+
// 根据 size 定义不同的配置
|
|
141
|
+
const sizeConfig = {
|
|
142
|
+
small: {
|
|
143
|
+
inputHeight: 56,
|
|
144
|
+
textareaHeight: 70,
|
|
145
|
+
fontSize: 24,
|
|
146
|
+
iconSize: 28,
|
|
147
|
+
iconSpacing: 6
|
|
148
|
+
},
|
|
149
|
+
default: {
|
|
150
|
+
inputHeight: 70,
|
|
151
|
+
textareaHeight: 100,
|
|
152
|
+
fontSize: 28,
|
|
153
|
+
iconSize: 32,
|
|
154
|
+
iconSpacing: 10
|
|
155
|
+
},
|
|
156
|
+
large: {
|
|
157
|
+
inputHeight: 84,
|
|
158
|
+
textareaHeight: 130,
|
|
159
|
+
fontSize: 32,
|
|
160
|
+
iconSize: 36,
|
|
161
|
+
iconSpacing: 14
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// 获取实际使用的 size 值(优先级:props.size > u-form.size)
|
|
166
|
+
const actualSize = computed(() => {
|
|
167
|
+
// 优先使用 props 的 size 属性
|
|
168
|
+
if (props.size !== '') {
|
|
169
|
+
return String(props.size);
|
|
170
|
+
}
|
|
171
|
+
// 次优先:使用 u-form 的 size 属性(u-form 的 size 只支持预设值)
|
|
172
|
+
if (parentExposed.value?.props?.size) {
|
|
173
|
+
return String(parentExposed.value.props.size);
|
|
174
|
+
}
|
|
175
|
+
// 默认值
|
|
176
|
+
return 'default';
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// 判断实际使用的 size 是否在预设配置中
|
|
180
|
+
const isInSizeConfig = computed(() => actualSize.value in sizeConfig);
|
|
181
|
+
|
|
182
|
+
// 获取预设 size(用于查找 sizeConfig 配置,如图标大小、高度等)
|
|
183
|
+
const presetSize = computed(() => {
|
|
184
|
+
return (isInSizeConfig.value ? actualSize.value : 'default') as SizeType;
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// 获取当前尺寸配置
|
|
188
|
+
const currentSizeConfig = computed(() => sizeConfig[presetSize.value]);
|
|
189
|
+
|
|
190
|
+
// 获取实际要使用的 font-size(如果是预设值使用配置值,否则作为自定义值处理)
|
|
191
|
+
const actualFontSize = computed(() => {
|
|
192
|
+
if (isInSizeConfig.value) {
|
|
193
|
+
return $u.addUnit(currentSizeConfig.value.fontSize);
|
|
194
|
+
}
|
|
195
|
+
// 自定义size值,直接作为fontSize处理
|
|
196
|
+
return $u.addUnit(actualSize.value);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// 计算当前图标大小
|
|
200
|
+
const currentIconSize = computed(() => currentSizeConfig.value.iconSize);
|
|
201
|
+
|
|
202
|
+
// 计算 select 图标大小(比常规图标稍小)
|
|
203
|
+
const selectIconSize = computed(() => currentSizeConfig.value.iconSize - 4);
|
|
204
|
+
|
|
205
|
+
// 计算图标间距
|
|
206
|
+
const iconSpacing = computed(() => currentSizeConfig.value.iconSpacing);
|
|
207
|
+
|
|
136
208
|
const inputValue = computed<string>(() => {
|
|
137
209
|
if (props.modelValue === undefined || props.modelValue === null) return '';
|
|
138
210
|
return String(props.modelValue);
|
|
139
211
|
});
|
|
140
212
|
|
|
141
|
-
// 清除图标是否显示
|
|
142
|
-
const clearIconShow = computed(() => {
|
|
143
|
-
if (props.type === 'select') return props.clearable && inputValue.value !== '' && !props.disabled;
|
|
144
|
-
return props.clearable && focused.value && inputValue.value !== '' && !props.disabled;
|
|
145
|
-
});
|
|
146
|
-
|
|
147
213
|
// 监听 value 变化
|
|
148
214
|
watch(
|
|
149
215
|
() => inputValue.value,
|
|
@@ -168,12 +234,25 @@ const getStyle = computed(() => {
|
|
|
168
234
|
let style: Record<string, any> = {};
|
|
169
235
|
// 如果没有自定义高度,就根据type为input还是textarea来分配一个默认的高度
|
|
170
236
|
style.minHeight = props.height
|
|
171
|
-
? props.height
|
|
172
|
-
: props.type
|
|
173
|
-
?
|
|
174
|
-
:
|
|
237
|
+
? $u.addUnit(props.height)
|
|
238
|
+
: props.type === 'textarea'
|
|
239
|
+
? $u.addUnit(currentSizeConfig.value.textareaHeight)
|
|
240
|
+
: $u.addUnit(currentSizeConfig.value.inputHeight);
|
|
241
|
+
// 根据 size 属性设置字体大小
|
|
242
|
+
style.fontSize = actualFontSize.value;
|
|
175
243
|
return $u.toStyle(style, props.customStyle);
|
|
176
244
|
});
|
|
245
|
+
|
|
246
|
+
const getPlaceholderStyle = computed(() => {
|
|
247
|
+
return $u.toStyle(
|
|
248
|
+
{
|
|
249
|
+
fontSize: actualFontSize.value
|
|
250
|
+
},
|
|
251
|
+
props.placeholderStyle
|
|
252
|
+
);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// 计算光标与键盘的距离
|
|
177
256
|
const getCursorSpacing = computed(() => Number(props.cursorSpacing));
|
|
178
257
|
// 光标起始位置
|
|
179
258
|
const uSelectionStart = computed(() => String(props.selectionStart));
|
|
@@ -264,6 +343,7 @@ defineExpose({
|
|
|
264
343
|
position: relative;
|
|
265
344
|
flex: 1;
|
|
266
345
|
@include vue-flex;
|
|
346
|
+
align-items: center;
|
|
267
347
|
|
|
268
348
|
&__select-overlay {
|
|
269
349
|
position: absolute;
|
|
@@ -276,6 +356,8 @@ defineExpose({
|
|
|
276
356
|
font-size: 28rpx;
|
|
277
357
|
color: $u-main-color;
|
|
278
358
|
flex: 1;
|
|
359
|
+
align-self: center;
|
|
360
|
+
line-height: normal;
|
|
279
361
|
}
|
|
280
362
|
|
|
281
363
|
&__textarea {
|
|
@@ -313,10 +395,6 @@ defineExpose({
|
|
|
313
395
|
position: relative;
|
|
314
396
|
z-index: 2;
|
|
315
397
|
|
|
316
|
-
&__item {
|
|
317
|
-
margin-left: 10rpx;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
398
|
&--select {
|
|
321
399
|
transition: transform 0.4s;
|
|
322
400
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
|
|
4
3
|
type LoadingMode = 'circle' | 'flower';
|
|
5
4
|
|
|
@@ -8,7 +7,16 @@ type LoadingMode = 'circle' | 'flower';
|
|
|
8
7
|
* @description 加载动画,支持多种模式
|
|
9
8
|
*/
|
|
10
9
|
export const LoadingProps = {
|
|
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
|
mode: {
|
|
14
22
|
type: String as PropType<LoadingMode>,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { LoadmoreIconType, LoadmoreStatus, LoadmoreText } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
import { useLocale } from '../../';
|
|
5
4
|
|
|
6
5
|
const { t } = useLocale();
|
|
@@ -11,7 +10,16 @@ const { t } = useLocale();
|
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
export const LoadmoreProps = {
|
|
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
|
bgColor: {
|
|
17
25
|
type: String,
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { baseProps } from '../common/props';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* u-mask 组件 props 类型定义
|
|
6
5
|
* @description 遮罩层,支持自定义样式、缩放、动画等
|
|
7
6
|
*/
|
|
8
7
|
export const MaskProps = {
|
|
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
|
/** 是否显示遮罩 */
|
|
11
19
|
show: {
|
|
12
20
|
type: Boolean,
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { InputType, MessageInputMode } from '../../types/global';
|
|
3
3
|
import { getColor } from '../../';
|
|
4
|
-
import { baseProps } from '../common/props';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* u-message-input 组件 props 类型定义
|
|
8
7
|
* @description 验证码/短信输入框,支持多种样式
|
|
9
8
|
*/
|
|
10
9
|
export const MessageInputProps = {
|
|
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
|
/** 输入框的类型,textarea,text,number */
|
|
13
21
|
type: {
|
|
14
22
|
type: String as PropType<InputType>,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { getColor, useLocale } from '../../';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
|
|
5
4
|
const { t } = useLocale();
|
|
6
5
|
|
|
@@ -9,7 +8,16 @@ const { t } = useLocale();
|
|
|
9
8
|
* @description 弹窗模态框,支持多种样式和交互
|
|
10
9
|
*/
|
|
11
10
|
export const ModalProps = {
|
|
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
|
/** 是否显示模态框 */
|
|
14
22
|
modelValue: {
|
|
15
23
|
type: Boolean,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { baseProps } from '../common/props';
|
|
2
1
|
import type { PaginationChangePayload } from '../../types/global';
|
|
3
2
|
import { useLocale } from '../../';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
4
|
|
|
5
5
|
const { t } = useLocale();
|
|
6
6
|
|
|
@@ -10,7 +10,16 @@ const { t } = useLocale();
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
export const PaginationProps = {
|
|
13
|
-
|
|
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
|
+
},
|
|
14
23
|
/** 左侧按钮文字 */
|
|
15
24
|
prevText: { type: String, default: () => t('uPagination.prevText') },
|
|
16
25
|
/** 右侧按钮文字 */
|
|
@@ -2,7 +2,6 @@ import type { ExtractPropTypes, PropType } from 'vue';
|
|
|
2
2
|
import type { PickerMode, PickerParams } from '../../types/global';
|
|
3
3
|
import { getColor, useLocale } from '../../';
|
|
4
4
|
import zIndex from '../../libs/config/zIndex';
|
|
5
|
-
import { baseProps } from '../common/props';
|
|
6
5
|
|
|
7
6
|
const { t } = useLocale();
|
|
8
7
|
|
|
@@ -23,7 +22,16 @@ const defaultParams: PickerParams = {
|
|
|
23
22
|
* @description 支持时间、地区、单列、多列等多种模式
|
|
24
23
|
*/
|
|
25
24
|
export const PickerProps = {
|
|
26
|
-
|
|
25
|
+
/** 自定义根节点样式 */
|
|
26
|
+
customStyle: {
|
|
27
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
28
|
+
default: () => ({})
|
|
29
|
+
},
|
|
30
|
+
/** 自定义根节点样式类 */
|
|
31
|
+
customClass: {
|
|
32
|
+
type: String as unknown as PropType<string>,
|
|
33
|
+
default: ''
|
|
34
|
+
},
|
|
27
35
|
/** picker中需要显示的参数 */
|
|
28
36
|
params: {
|
|
29
37
|
type: Object as PropType<PickerParams>,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import type { PopupCloseIconPos, PopupMode } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
4
3
|
import zIndex from '../../libs/config/zIndex';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -8,7 +7,16 @@ import zIndex from '../../libs/config/zIndex';
|
|
|
8
7
|
* @description 弹出层容器,支持多种弹出方向和自定义内容
|
|
9
8
|
*/
|
|
10
9
|
export const PopupProps = {
|
|
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
|
show: { type: Boolean, default: false },
|
|
14
22
|
/** 弹出方向,left|right|top|bottom|center */
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import type { Shape } from '../../types/global';
|
|
3
|
-
import { baseProps } from '../common/props';
|
|
2
|
+
import type { Shape, SizeType } from '../../types/global';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* RadioProps 单选框 props 类型定义
|
|
7
6
|
* @description 单选框用于有一个选择,用户只能选择其中一个的场景。搭配u-radio-group使用
|
|
8
7
|
*/
|
|
9
8
|
export const RadioProps = {
|
|
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
|
label: { type: String, default: '' },
|
|
12
20
|
value: { type: [String, Number] as PropType<string | number>, default: '' },
|
|
13
21
|
/** radio的名称 */
|
|
@@ -23,7 +31,9 @@ export const RadioProps = {
|
|
|
23
31
|
/** 图标的大小,单位rpx */
|
|
24
32
|
iconSize: { type: [String, Number] as PropType<number | string>, default: '' },
|
|
25
33
|
/** label的字体大小,rpx单位 */
|
|
26
|
-
labelSize: { type: [String, Number] as PropType<number | string>, default: '' }
|
|
34
|
+
labelSize: { type: [String, Number] as PropType<number | string>, default: '' },
|
|
35
|
+
/** 组件的整体大小 */
|
|
36
|
+
size: { type: [String, Number] as PropType<SizeType | string | number>, default: '' }
|
|
27
37
|
};
|
|
28
38
|
|
|
29
39
|
export type RadioProps = ExtractPropTypes<typeof RadioProps>;
|