1
This commit is contained in:
9
uview-plus/types/comps/_common.d.ts
vendored
Normal file
9
uview-plus/types/comps/_common.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface AllowedComponentProps {
|
||||
class?: unknown;
|
||||
style?: unknown;
|
||||
}
|
||||
|
||||
export interface VNodeProps {
|
||||
key?: string | number | symbol;
|
||||
ref?: unknown;
|
||||
}
|
||||
121
uview-plus/types/comps/actionSheet.d.ts
vendored
Normal file
121
uview-plus/types/comps/actionSheet.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
82
uview-plus/types/comps/album.d.ts
vendored
Normal file
82
uview-plus/types/comps/album.d.ts
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface AlbumProps {
|
||||
/**
|
||||
* 图片地址列表
|
||||
*/
|
||||
urls?: string[] | Record<string, any>[]
|
||||
/**
|
||||
* 指定从数组的对象元素中读取哪个属性作为图片地址
|
||||
*/
|
||||
keyName?: string
|
||||
/**
|
||||
* 单图时,图片长边的长度
|
||||
* @default 180
|
||||
*/
|
||||
singleSize?: string | number
|
||||
/**
|
||||
* 多图时,图片边长
|
||||
* @default 70
|
||||
*/
|
||||
multipleSize?: string | number
|
||||
/**
|
||||
* 多图时,图片水平和垂直之间的间隔
|
||||
* @default 6
|
||||
*/
|
||||
space?: string | number
|
||||
/**
|
||||
* 单图时,图片缩放裁剪的模式
|
||||
* @default "scaleToFill"
|
||||
*/
|
||||
singleMode?: ImageMode
|
||||
/**
|
||||
* 多图时,图片缩放裁剪的模式
|
||||
* @default "aspectFill"
|
||||
*/
|
||||
multipleMode?: ImageMode
|
||||
/**
|
||||
* 最多展示的图片数量,超出时最后一个位置将会显示剩余图片数量
|
||||
* @default 9
|
||||
*/
|
||||
maxCount?: string | number
|
||||
/**
|
||||
* 是否可以预览图片
|
||||
* @default true
|
||||
*/
|
||||
previewFullImage?: boolean
|
||||
/**
|
||||
* 每行展示图片数量,如设置,singleSize和multipleSize将会无效
|
||||
* @default 3
|
||||
*/
|
||||
rowCount?: string | number
|
||||
/**
|
||||
* 超出maxCount时是否显示查看更多的提示
|
||||
* @default true
|
||||
*/
|
||||
showMore?: boolean
|
||||
/**
|
||||
* 某些特殊的情况下,需要让文字与相册的宽度相等,这里事件的形式对外发送
|
||||
* @param width 宽度
|
||||
*/
|
||||
onAlbumWidth?: (width: any) => any
|
||||
/**
|
||||
* 图片形状
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'circle' | 'square'
|
||||
/**
|
||||
* 圆角,默认单位px
|
||||
* @default 0
|
||||
*/
|
||||
radius?: string | number
|
||||
}
|
||||
|
||||
declare interface _Album {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
AlbumProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Album: _Album
|
||||
55
uview-plus/types/comps/alert.d.ts
vendored
Normal file
55
uview-plus/types/comps/alert.d.ts
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface AlertProps {
|
||||
/**
|
||||
* 显示的文字
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 使用预设的颜色
|
||||
* @default "warning"
|
||||
*/
|
||||
type?: 'warning' | 'success' | 'primary' | 'error' | 'info'
|
||||
/**
|
||||
* 辅助性文字,颜色比`title`浅一点,字号也小一点,可选
|
||||
*/
|
||||
description?: string
|
||||
/**
|
||||
* 关闭按钮(默认为叉号icon图标)
|
||||
* @default false
|
||||
*/
|
||||
closable?: boolean
|
||||
/**
|
||||
* 是否显示左边的辅助图标
|
||||
* @default false
|
||||
*/
|
||||
showIcon?: boolean
|
||||
/**
|
||||
* 多图时,图片缩放裁剪的模式
|
||||
*/
|
||||
effect?: 'light' | 'dark'
|
||||
/**
|
||||
* 文字是否居中
|
||||
* @default false
|
||||
*/
|
||||
center?: boolean
|
||||
/**
|
||||
* 字体大小
|
||||
* @default 14
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 点击组件时触发
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface _Alert {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
AlertProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Alert: _Alert
|
||||
85
uview-plus/types/comps/avatar.d.ts
vendored
Normal file
85
uview-plus/types/comps/avatar.d.ts
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
import { ImageMode } from './image'
|
||||
|
||||
declare interface AvatarProps {
|
||||
/**
|
||||
* 头像路径,如加载失败,将会显示默认头像(不能为相对路径)
|
||||
*/
|
||||
src?: string
|
||||
/**
|
||||
* 头像形状
|
||||
* @default "circle"
|
||||
*/
|
||||
shape?: 'circle' | 'square'
|
||||
/**
|
||||
* 头像尺寸
|
||||
* @default 40
|
||||
*/
|
||||
size?: 'large' | 'default' | 'mini' | number
|
||||
/**
|
||||
* 裁剪类型
|
||||
* @default "scaleToFill"
|
||||
*/
|
||||
mode?: ImageMode
|
||||
/**
|
||||
* 用文字替代图片,级别优先于`src`
|
||||
*/
|
||||
text?: string
|
||||
/**
|
||||
* 背景颜色
|
||||
* @default "#c0c4cc"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 文字颜色
|
||||
* @default "#fff"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 文字大小
|
||||
* @default 18
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 显示的图标
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 显示小程序头像,只对百度,微信,QQ小程序有效
|
||||
* @default false
|
||||
*/
|
||||
mpAvatar?: boolean
|
||||
/**
|
||||
* 是否使用随机背景色
|
||||
* @default false
|
||||
*/
|
||||
randomBgColor?: boolean
|
||||
/**
|
||||
* 加载失败的默认头像(组件有内置默认图片)
|
||||
*/
|
||||
defaultUrl?: string
|
||||
/**
|
||||
* 如果配置了randomBgColor为true,且配置了此值,则从默认的背景色数组中取出对应索引的颜色值,取值0-19之间
|
||||
*/
|
||||
colorIndex?: string | number
|
||||
/**
|
||||
* 组件标识符
|
||||
* @default "level"
|
||||
*/
|
||||
name?: string
|
||||
/**
|
||||
* 头像被点击
|
||||
* @param index 用户传递的标识符
|
||||
*/
|
||||
onClick?: (index: any) => any
|
||||
}
|
||||
|
||||
declare interface _Avatar {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
AvatarProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Avatar: _Avatar
|
||||
62
uview-plus/types/comps/avatarGroup.d.ts
vendored
Normal file
62
uview-plus/types/comps/avatarGroup.d.ts
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
import { ImageMode } from './image'
|
||||
|
||||
declare interface AvatarGroupProps {
|
||||
/**
|
||||
* 头像图片组
|
||||
* @default []
|
||||
*/
|
||||
urls?: string[]
|
||||
/**
|
||||
* 最多展示的头像数量
|
||||
* @default 5
|
||||
*/
|
||||
maxCount?: string | number
|
||||
/**
|
||||
* 头像形状
|
||||
* @default "circle"
|
||||
*/
|
||||
shape?: 'circle' | 'square'
|
||||
/**
|
||||
* 裁剪模式
|
||||
* @default "aspectFill"
|
||||
*/
|
||||
mode?: ImageMode
|
||||
/**
|
||||
* 超出maxCount时是否显示查看更多的提示
|
||||
* @default true
|
||||
*/
|
||||
showMore?: boolean
|
||||
/**
|
||||
* 头像大小
|
||||
* @default 40
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 指定从数组的对象元素中读取哪个属性作为图片地址
|
||||
*/
|
||||
keyName?: string
|
||||
/**
|
||||
* 头像之间的遮挡比例(0.4代表遮挡40%)
|
||||
* @default 0.5
|
||||
*/
|
||||
gap?: string | number
|
||||
/**
|
||||
* 需额外显示的值,如设置则优先于内部的`urls.length - maxCount`值
|
||||
*/
|
||||
extraValue?: string | number
|
||||
/**
|
||||
* 头像组更多点击
|
||||
*/
|
||||
onShowMore?: () => any
|
||||
}
|
||||
|
||||
declare interface _AvatarGroup {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
AvatarGroupProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const AvatarGroup: _AvatarGroup
|
||||
74
uview-plus/types/comps/backTop.d.ts
vendored
Normal file
74
uview-plus/types/comps/backTop.d.ts
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface BackTopProps {
|
||||
/**
|
||||
* 按钮形状
|
||||
* @default "circle"
|
||||
*/
|
||||
mode?: 'circle' | 'square'
|
||||
/**
|
||||
* uView内置图标名称,或图片路径
|
||||
* @default "arrow-upward"
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 返回顶部按钮的提示文字
|
||||
*/
|
||||
text?: string
|
||||
/**
|
||||
* 返回顶部过程中的过渡时间,单位ms
|
||||
* @default 100
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 页面的滚动距离,通过`onPageScroll`生命周期获取
|
||||
* @default 0
|
||||
*/
|
||||
scrollTop?: string | number
|
||||
/**
|
||||
* 滚动条滑动多少距离时显示,单位rpx
|
||||
* @default 400
|
||||
*/
|
||||
top?: string | number
|
||||
/**
|
||||
* 返回按钮位置到屏幕底部的距离,单位rpx
|
||||
* @default 100
|
||||
*/
|
||||
bottom?: string | number
|
||||
/**
|
||||
* 返回按钮位置到屏幕右边的距离,单位rpx
|
||||
* @default 20
|
||||
*/
|
||||
right?: string | number
|
||||
/**
|
||||
* 返回顶部按钮的层级
|
||||
* @default 9
|
||||
*/
|
||||
zIndex?: string | number
|
||||
/**
|
||||
* 图标的样式
|
||||
*/
|
||||
iconStyle?: unknown
|
||||
/**
|
||||
* 按钮外层的自定义样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
}
|
||||
|
||||
declare interface BackTopSlots {
|
||||
/**
|
||||
* 自定义返回按钮的所有内容
|
||||
*/
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _BackTop {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
BackTopProps
|
||||
$slots: BackTopSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const BackTop: _BackTop
|
||||
76
uview-plus/types/comps/badge.d.ts
vendored
Normal file
76
uview-plus/types/comps/badge.d.ts
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface BadgeProps {
|
||||
/**
|
||||
* 不展示数字,只有一个小点
|
||||
* @default false
|
||||
*/
|
||||
isDot?: boolean
|
||||
/**
|
||||
* 展示的数字,大于`overflowCount`时显示为`${overflowCount}+`,为`0`且`show-zero`为`false`时隐藏
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 组件是否显示
|
||||
* @default true
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 最大值,超过最大值会显示 '{max}+'
|
||||
* @default 99
|
||||
*/
|
||||
max?: string | number
|
||||
/**
|
||||
* 主题类型
|
||||
* @default "error"
|
||||
*/
|
||||
type?: 'error' | 'warning' | 'success' | 'primary' | 'info'
|
||||
/**
|
||||
* 当数值为 0 时,是否展示 Badge
|
||||
* @default false
|
||||
*/
|
||||
showZero?: boolean
|
||||
/**
|
||||
* 背景颜色,优先级比`type`高,如设置,`type`参数会失效
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 字体颜色
|
||||
* @default "#fff"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 徽标形状,circle-四角均为圆角,horn-左下角为直角
|
||||
* @default "circle"
|
||||
*/
|
||||
shape?: 'circle' | 'horn'
|
||||
/**
|
||||
* 置数字的显示方式,详细见[文档](https://www.uviewui.com/components/badge.html#%E8%AE%BE%E7%BD%AE%E6%95%B0%E5%AD%97%E7%9A%84%E6%98%BE%E7%A4%BA%E6%96%B9%E5%BC%8F-overflow-ellipsis-limit)
|
||||
* @default "overflow"
|
||||
*/
|
||||
numberType?: 'overflow' | 'ellipsis' | 'limit'
|
||||
/**
|
||||
* 设置badge的位置偏移,格式为 [x, y],也即设置的为`top`和`right`的值,`absolute`为`true`时有效
|
||||
*/
|
||||
offset?: string[]
|
||||
/**
|
||||
* 是否反转背景和字体颜色
|
||||
* @default false
|
||||
*/
|
||||
inverted?: boolean
|
||||
/**
|
||||
* 组件是否绝对定位,为`true`时,`offset`参数才有效
|
||||
* @default false
|
||||
*/
|
||||
absolute?: boolean
|
||||
}
|
||||
|
||||
declare interface _Badge {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
BadgeProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Badge: _Badge
|
||||
169
uview-plus/types/comps/button.d.ts
vendored
Normal file
169
uview-plus/types/comps/button.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
164
uview-plus/types/comps/calendar.d.ts
vendored
Normal file
164
uview-plus/types/comps/calendar.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user