You've already forked template-MP
Initial commit
This commit is contained in:
101
uview-plus/types/comps.d.ts
vendored
Normal file
101
uview-plus/types/comps.d.ts
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
// 基础组件
|
||||
['up-icon']: typeof import('./comps/icon')['Icon']
|
||||
['up-image']: typeof import('./comps/image')['Image']
|
||||
['up-button']: typeof import('./comps/button')['Button']
|
||||
['up-text']: typeof import('./comps/text')['Text']
|
||||
['up-row']: typeof import('./comps/row')['Row']
|
||||
['up-col']: typeof import('./comps/col')['Col']
|
||||
['up-cell']: typeof import('./comps/cell')['Cell']
|
||||
['up-cell-group']: typeof import('./comps/cellGroup')['CellGroup']
|
||||
['up-badge']: typeof import('./comps/badge')['Badge']
|
||||
['up-tag']: typeof import('./comps/tag')['Tag']
|
||||
['up-loading-icon']: typeof import('./comps/loadingIcon')['LoadingIcon']
|
||||
['up-loading-page']: typeof import('./comps/loadingPage')['LoadingPage']
|
||||
|
||||
// 表单组件
|
||||
['up-form']: typeof import('./comps/form')['Form']
|
||||
['up-form-item']: typeof import('./comps/formItem')['FormItem']
|
||||
['up-calendar']: typeof import('./comps/calendar')['Calendar']
|
||||
['up-keyboard']: typeof import('./comps/keyboard')['Keyboard']
|
||||
['up-picker']: typeof import('./comps/picker')['Picker']
|
||||
['up-datetime-picker']: typeof import('./comps/datetimePicker')['DatetimePicker']
|
||||
['up-rate']: typeof import('./comps/rate')['Rate']
|
||||
['up-search']: typeof import('./comps/search')['Search']
|
||||
['up-number-box']: typeof import('./comps/numberBox')['NumberBox']
|
||||
['up-upload']: typeof import('./comps/upload')['Upload']
|
||||
['up-code']: typeof import('./comps/code')['Code']
|
||||
['up-input']: typeof import('./comps/input')['Input']
|
||||
['up-textarea']: typeof import('./comps/textarea')['Textarea']
|
||||
['up-checkbox']: typeof import('./comps/checkbox')['Checkbox']
|
||||
['up-checkbox-group']: typeof import('./comps/checkboxGroup')['CheckboxGroup']
|
||||
['up-radio']: typeof import('./comps/radio')['Radio']
|
||||
['up-radio-group']: typeof import('./comps/radioGroup')['RadioGroup']
|
||||
['up-switch']: typeof import('./comps/switch')['Switch']
|
||||
['up-slider']: typeof import('./comps/slider')['Slider']
|
||||
['up-album']: typeof import('./comps/album')['Album']
|
||||
|
||||
// 数据组件
|
||||
['up-list']: typeof import('./comps/list')['List']
|
||||
['up-list-item']: typeof import('./comps/listItem')['ListItem']
|
||||
['up-line-progress']: typeof import('./comps/lineProgress')['LineProgress']
|
||||
['up-count-down']: typeof import('./comps/countDown')['CountDown']
|
||||
['up-count-to']: typeof import('./comps/countTo')['CountTo']
|
||||
|
||||
// 反馈组件
|
||||
['up-tooltip']: typeof import('./comps/tooltip')['Tooltip']
|
||||
['up-action-sheet']: typeof import('./comps/actionSheet')['ActionSheet']
|
||||
['up-alert']: typeof import('./comps/alert')['Alert']
|
||||
['up-toast']: typeof import('./comps/toast')['Toast']
|
||||
['up-notice-bar']: typeof import('./comps/noticeBar')['NoticeBar']
|
||||
['up-notify']: typeof import('./comps/notify')['Notify']
|
||||
['up-swipe-action']: typeof import('./comps/swipeAction')['SwipeAction']
|
||||
['up-swipe-action-item']: typeof import('./comps/swipeActionItem')['SwipeActionItem']
|
||||
['up-collapse']: typeof import('./comps/collapse')['Collapse']
|
||||
['up-collapse-item']: typeof import('./comps/collapseItem')['CollapseItem']
|
||||
['up-popup']: typeof import('./comps/popup')['Popup']
|
||||
['up-modal']: typeof import('./comps/modal')['Modal']
|
||||
|
||||
// 布局组件
|
||||
['up-scroll-list']: typeof import('./comps/scrollList')['ScrollList']
|
||||
['up-line']: typeof import('./comps/line')['Line']
|
||||
['up-overlay']: typeof import('./comps/overlay')['Overlay']
|
||||
['up-no-network']: typeof import('./comps/noNetwork')['NoNetwork']
|
||||
['up-grid']: typeof import('./comps/grid')['Grid']
|
||||
['up-grid-item']: typeof import('./comps/gridItem')['GridItem']
|
||||
['up-swiper']: typeof import('./comps/swiper')['Swiper']
|
||||
['up-skeleton']: typeof import('./comps/skeleton')['Skeleton']
|
||||
['up-sticky']: typeof import('./comps/sticky')['Sticky']
|
||||
['up-divider']: typeof import('./comps/divider')['Divider']
|
||||
|
||||
// 导航组件
|
||||
['up-tabbar']: typeof import('./comps/tabbar')['Tabbar']
|
||||
['up-tabbar-item']: typeof import('./comps/tabbarItem')['TabbarItem']
|
||||
['up-back-top']: typeof import('./comps/backTop')['BackTop']
|
||||
['up-navbar']: typeof import('./comps/navbar')['Navbar']
|
||||
['up-tabs']: typeof import('./comps/tabs')['Tabs']
|
||||
['up-subsection']: typeof import('./comps/subsection')['Subsection']
|
||||
['up-index-list']: typeof import('./comps/indexList')['IndexList']
|
||||
['up-index-item']: typeof import('./comps/indexItem')['IndexItem']
|
||||
['up-index-anchor']: typeof import('./comps/indexAnchor')['IndexAnchor']
|
||||
['up-steps']: typeof import('./comps/steps')['Steps']
|
||||
['up-steps-item']: typeof import('./comps/stepsItem')['StepsItem']
|
||||
['up-empty']: typeof import('./comps/empty')['Empty']
|
||||
|
||||
// 其他组件
|
||||
['up-parse']: typeof import('./comps/parse')['Parse']
|
||||
['up-code-input']: typeof import('./comps/codeInput')['CodeInput']
|
||||
['up-loadmore']: typeof import('./comps/loadMore')['LoadMore']
|
||||
['up-read-more']: typeof import('./comps/readMore')['ReadMore']
|
||||
['up-gap']: typeof import('./comps/gap')['Gap']
|
||||
['up-avatar']: typeof import('./comps/avatar')['Avatar']
|
||||
['up-avatar-group']: typeof import('./comps/avatarGroup')['AvatarGroup']
|
||||
['up-link']: typeof import('./comps/link')['Link']
|
||||
['up-transition']: typeof import('./comps/transition')['Transition']
|
||||
['up-status-bar']: typeof import('./comps/statusBar')['StatusBar']
|
||||
['up-safe-bottom']: typeof import('./comps/safeBottom')['SafeBottom']
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
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
@@ -0,0 +1,121 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ActionSheetProps {
|
||||
/**
|
||||
* 是否展示
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 设置标题
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 选项上方的描述信息
|
||||
*/
|
||||
description?: string
|
||||
/**
|
||||
* 按钮的文字数组
|
||||
* @default []
|
||||
*/
|
||||
actions?: any[]
|
||||
/**
|
||||
* 取消按钮的文字,不为空时显示按钮
|
||||
*/
|
||||
cancelText?: string
|
||||
/**
|
||||
* 点击某个菜单项时是否关闭弹窗
|
||||
*/
|
||||
closeOnClickAction?: boolean
|
||||
/**
|
||||
* 是否开启底部安全区适配
|
||||
* @default false
|
||||
*/
|
||||
safeAreaInsetBottom?: boolean
|
||||
/**
|
||||
* 小程序的打开方式
|
||||
*/
|
||||
openType?: string
|
||||
/**
|
||||
* 点击遮罩是否允许关闭
|
||||
*/
|
||||
closeOnClickOverlay?: boolean
|
||||
/**
|
||||
* 圆角值,默认无圆角
|
||||
* @default 0
|
||||
*/
|
||||
round?: string | number
|
||||
/**
|
||||
* 指定返回用户信息的语言
|
||||
* @default "en"
|
||||
*/
|
||||
lang?: 'zh_CN' | 'zh_TW' | 'en'
|
||||
/**
|
||||
* 会话来源,open-type="contact"时有效。只微信小程序有效
|
||||
*/
|
||||
sessionFrom?: string
|
||||
/**
|
||||
* 会话内消息卡片标题,openType="contact"时有效
|
||||
*/
|
||||
sendMessageTitle?: string
|
||||
/**
|
||||
* 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
|
||||
*/
|
||||
sendMessagePath?: string
|
||||
/**
|
||||
* 会话内消息卡片图片,openType="contact"时有效
|
||||
*/
|
||||
sendMessageImg?: string
|
||||
/**
|
||||
* 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效
|
||||
* @default false
|
||||
*/
|
||||
showMessageCard?: boolean
|
||||
/**
|
||||
* 打开 APP 时,向 APP 传递的参数,openType=launchApp 时有效
|
||||
*/
|
||||
appParameter?: string
|
||||
/**
|
||||
* 点击ActionSheet列表项时触发
|
||||
*/
|
||||
onSelect?: (e: any) => any
|
||||
/**
|
||||
* 点击取消按钮时触发
|
||||
*/
|
||||
onClose?: () => any
|
||||
/**
|
||||
* 获取用户信息回调,openType="getUserInfo"时有效
|
||||
* @param detail 用户信息
|
||||
*/
|
||||
onGetuserinfo?: (detail: any) => any
|
||||
/**
|
||||
* 客服消息回调,openType="contact"时有效
|
||||
*/
|
||||
onContact?: () => any
|
||||
/**
|
||||
* 获取用户手机号回调,openType="getPhoneNumber"时有效
|
||||
*/
|
||||
onGetphonenumber?: () => any
|
||||
/**
|
||||
* 当使用开放能力时,发生错误的回调
|
||||
*/
|
||||
onError?: (...args: any) => any
|
||||
/**
|
||||
* 在打开授权设置页并关闭后回调
|
||||
*/
|
||||
onOpensetting?: (...args: any) => any
|
||||
/**
|
||||
* 打开 APP 成功的回调
|
||||
*/
|
||||
onLaunchapp?: (...args: any) => any
|
||||
}
|
||||
|
||||
declare interface _ActionSheet {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ActionSheetProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const ActionSheet: _ActionSheet
|
||||
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
@@ -0,0 +1,169 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ButtonProps {
|
||||
/**
|
||||
* 是否显示按钮的细边框
|
||||
* @default true
|
||||
*/
|
||||
hairline?: boolean
|
||||
/**
|
||||
* 按钮的样式类型
|
||||
* @default "info"
|
||||
*/
|
||||
type?: 'info' | 'primary' | 'error' | 'warning' | 'success' | 'text'
|
||||
/**
|
||||
* 按钮的大小
|
||||
* @default "normal"
|
||||
*/
|
||||
size?: 'normal' | 'large' | 'small' | 'mini'
|
||||
/**
|
||||
* 按钮外观形状
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'square' | 'circle'
|
||||
/**
|
||||
* 按钮是否镂空
|
||||
* @default false
|
||||
*/
|
||||
plain?: boolean
|
||||
/**
|
||||
* 是否禁用
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 按钮名称前是否带 loading 图标
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 加载中提示文字
|
||||
*/
|
||||
loadingText?: string
|
||||
/**
|
||||
* 加载状态图标类型
|
||||
* @default "spinner"
|
||||
*/
|
||||
loadingMode?: string
|
||||
/**
|
||||
* 加载图标大小
|
||||
* @default 15
|
||||
*/
|
||||
loadingSize?: string | number
|
||||
/**
|
||||
* 开放能力,具体请看 [button](https://uniapp.dcloud.net.cn/component/button.html#open-type-%E6%9C%89%E6%95%88%E5%80%BC)
|
||||
*/
|
||||
openType?: string
|
||||
/**
|
||||
* 用于 <form> 组件
|
||||
*/
|
||||
formType?: 'submit' | 'reset'
|
||||
/**
|
||||
* 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 (注:只微信小程序、QQ小程序有效)
|
||||
*/
|
||||
appParameter?: string
|
||||
/**
|
||||
* 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
|
||||
* @default true
|
||||
*/
|
||||
hoverStopPropagation?: boolean
|
||||
/**
|
||||
* 指定返回用户信息的语言
|
||||
* @default "en"
|
||||
*/
|
||||
lang?: 'en' | 'zh_CN' | 'zh_TW'
|
||||
/**
|
||||
* 会话来源,openType="contact"时有效
|
||||
*/
|
||||
sessionFrom?: string
|
||||
/**
|
||||
* 会话内消息卡片标题,openType="contact"时有效
|
||||
*/
|
||||
sendMessageTitle?: string
|
||||
/**
|
||||
* 会话内消息卡片点击跳转小程序路径,openType="contact"时有效
|
||||
*/
|
||||
sendMessagePath?: string
|
||||
/**
|
||||
* 会话内消息卡片图片,openType="contact"时有效
|
||||
*/
|
||||
sendMessageImg?: string
|
||||
/**
|
||||
* 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,openType="contact"时有效
|
||||
*/
|
||||
showMessageCard?: string
|
||||
/**
|
||||
* 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取
|
||||
*/
|
||||
dataName?: string
|
||||
/**
|
||||
* 节流,一定时间内只能触发一次,单位毫秒
|
||||
* @default 0
|
||||
*/
|
||||
throttleTime?: string | number
|
||||
/**
|
||||
* 按住后多久出现点击态,单位毫秒
|
||||
* @default 0
|
||||
*/
|
||||
hoverStartTime?: string | number
|
||||
/**
|
||||
* 手指松开后点击态保留时间,单位毫秒
|
||||
* @default 200
|
||||
*/
|
||||
hoverStayTime?: string | number
|
||||
/**
|
||||
* 按钮文字,之所以通过props传入,是因为slot传入的话(注:nvue中无法控制文字的样式)
|
||||
*/
|
||||
text?: string | number
|
||||
/**
|
||||
* 按钮图标
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 按钮颜色
|
||||
*/
|
||||
iconColor?: string
|
||||
/**
|
||||
* 按钮颜色,支持传入linear-gradient渐变色
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 定义需要用到的外部样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
/**
|
||||
* 按钮点击,请勿使用@tap点击事件,微信小程序无效,返回值为点击事件及参数
|
||||
*/
|
||||
onClick?: (...args: any) => any
|
||||
/**
|
||||
* open-type="getPhoneNumber"时有效
|
||||
*/
|
||||
onGetphonenumber?: (...args: any) => any
|
||||
/**
|
||||
* 获取用户信息回调,openType="getUserInfo"时有效
|
||||
* @param detail 用户信息
|
||||
*/
|
||||
onGetuserinfo?: (detail: any) => any
|
||||
/**
|
||||
* 当使用开放能力时,发生错误的回调
|
||||
*/
|
||||
onError?: (...args: any) => any
|
||||
/**
|
||||
* 在打开授权设置页并关闭后回调
|
||||
*/
|
||||
onOpensetting?: (...args: any) => any
|
||||
/**
|
||||
* 打开 APP 成功的回调
|
||||
*/
|
||||
onLaunchapp?: (...args: any) => any
|
||||
}
|
||||
|
||||
declare interface _Button {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ButtonProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Button: _Button
|
||||
164
uview-plus/types/comps/calendar.d.ts
vendored
Normal file
164
uview-plus/types/comps/calendar.d.ts
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CalendarProps {
|
||||
/**
|
||||
* 标题内容
|
||||
* @default "日期选择"
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 是否显示标题
|
||||
* @default true
|
||||
*/
|
||||
showTitle?: boolean
|
||||
/**
|
||||
* 是否显示副标题
|
||||
* @default true
|
||||
*/
|
||||
showSubtitle?: boolean
|
||||
/**
|
||||
* 日期类型选择
|
||||
* @default 'single
|
||||
*/
|
||||
mode?: 'single' | 'multiple' | 'range'
|
||||
/**
|
||||
* mode=range时,第一个日期底部的提示文字
|
||||
* @default "开始"
|
||||
*/
|
||||
startText?: string
|
||||
/**
|
||||
* mode=range时,最后一个日期底部的提示文字
|
||||
* @default "结束"
|
||||
*/
|
||||
endText?: string
|
||||
/**
|
||||
* 自定义列表
|
||||
*/
|
||||
customList?: any[]
|
||||
/**
|
||||
* 主题色,对底部按钮和选中日期有效
|
||||
* @default "#3c9cff"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 最小的可选日期
|
||||
* @default 0
|
||||
*/
|
||||
minDate?: string | number
|
||||
/**
|
||||
* 最大可选日期
|
||||
* @default 0
|
||||
*/
|
||||
maxDate?: string | number
|
||||
/**
|
||||
* 默认选中的日期,mode为multiple或range是必须为数组格式
|
||||
* @default null
|
||||
*/
|
||||
defaultDate?: string | Date | any[]
|
||||
/**
|
||||
* mode=multiple时,最多可选多少个日期
|
||||
* @default Number.MAX_SAFE_INTEGER
|
||||
*/
|
||||
maxCount?: string | number
|
||||
/**
|
||||
* 日期行高
|
||||
* @default 56
|
||||
*/
|
||||
rowHeight?: string | number
|
||||
/**
|
||||
* 日期格式化函数(如需兼容微信小程序,则只能通过setFormatter方法)
|
||||
*/
|
||||
formatter?: (...args: any) => any
|
||||
/**
|
||||
* 是否显示农历
|
||||
* @default false
|
||||
*/
|
||||
showLunar?: boolean
|
||||
/**
|
||||
* 是否显示月份背景色
|
||||
* @default true
|
||||
*/
|
||||
showMark?: boolean
|
||||
/**
|
||||
* 确定按钮的文字
|
||||
* @default "确定"
|
||||
*/
|
||||
confirmText?: string
|
||||
/**
|
||||
* 确认按钮处于禁用状态时的文字
|
||||
* @default "确定"
|
||||
*/
|
||||
confirmDisabledText?: string
|
||||
/**
|
||||
* 是否显示日历弹窗
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 是否允许点击遮罩关闭日历 (注意:关闭事件需要自行处理,只会在开启closeOnClickOverlay后点击遮罩层执行close回调)
|
||||
* @default false
|
||||
*/
|
||||
closeOnClickOverlay?: boolean
|
||||
/**
|
||||
* 是否为只读状态,只读状态下禁止选择日期
|
||||
* @default false
|
||||
*/
|
||||
readonly?: boolean
|
||||
/**
|
||||
* 日期区间最多可选天数,默认无限制,mode = range时有效
|
||||
* @default 无限制
|
||||
*/
|
||||
maxRange?: string | number
|
||||
/**
|
||||
* 范围选择超过最多可选天数时的提示文案,mode = range时有效
|
||||
* @default "选择天数不能超过 xx 天"
|
||||
*/
|
||||
rangePrompt?: string | null
|
||||
/**
|
||||
* 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效
|
||||
* @default true
|
||||
*/
|
||||
showRangePrompt?: boolean
|
||||
/**
|
||||
* 是否允许日期范围的起止时间为同一天,mode = range时有效
|
||||
* @default false
|
||||
*/
|
||||
allowSameDay?: boolean
|
||||
/**
|
||||
* 圆角值,默认无圆角
|
||||
* @default 0
|
||||
*/
|
||||
round?: string | number
|
||||
/**
|
||||
* 最大展示的月份数量
|
||||
* @default 3
|
||||
*/
|
||||
monthNum?: string | number
|
||||
/**
|
||||
* 日期选择完成后触发,若`show-confirm`为`true`,则点击确认按钮后触发
|
||||
*/
|
||||
onConfirm?: (...args: any) => any
|
||||
/**
|
||||
* 日历关闭时触发
|
||||
*/
|
||||
onClose?: () => any
|
||||
}
|
||||
|
||||
declare interface _Calendar {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CalendarProps
|
||||
}
|
||||
}
|
||||
|
||||
declare interface _CalendarRef {
|
||||
/**
|
||||
* 为兼容微信小程序而暴露的内部方法,详见[文档](https://www.uviewui.com/components/calendar.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E6%96%87%E6%A1%88)
|
||||
*/
|
||||
setFormatter: (type, value) => any
|
||||
}
|
||||
|
||||
export declare const Calendar: _Calendar
|
||||
|
||||
export declare const CalendarRef: _CalendarRef
|
||||
133
uview-plus/types/comps/cell.d.ts
vendored
Normal file
133
uview-plus/types/comps/cell.d.ts
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CellProps {
|
||||
/**
|
||||
* 左侧标题
|
||||
*/
|
||||
title?: string | number
|
||||
/**
|
||||
* 标题下方的描述信息
|
||||
*/
|
||||
label?: string | number
|
||||
/**
|
||||
* 右侧的内容
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 左侧图标名称,或者图片链接(本地文件建议使用绝对地址)
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 是否禁用cell
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 是否显示下边框
|
||||
* @default true
|
||||
*/
|
||||
border?: boolean
|
||||
/**
|
||||
* 内容是否垂直居中(主要是针对右侧的value部分)
|
||||
* @default false
|
||||
*/
|
||||
center?: boolean
|
||||
/**
|
||||
* 点击后跳转的URL地址
|
||||
*/
|
||||
url?: string
|
||||
/**
|
||||
* 链接跳转的方式,内部使用的是uView封装的route方法,可能会进行拦截操作
|
||||
* @default "navigateTo"
|
||||
*/
|
||||
linkType?: string
|
||||
/**
|
||||
* 是否开启点击反馈(表现为点击时加上灰色背景)
|
||||
* @default false
|
||||
*/
|
||||
clickable?: boolean
|
||||
/**
|
||||
* 是否展示右侧箭头并开启点击反馈
|
||||
* @default false
|
||||
*/
|
||||
isLink?: boolean
|
||||
/**
|
||||
* 是否显示表单状态下的必填星号(此组件可能会内嵌入input组件)
|
||||
* @default false
|
||||
*/
|
||||
required?: boolean
|
||||
/**
|
||||
* 右侧的图标箭头
|
||||
* @default "arrow-right"
|
||||
*/
|
||||
rightIcon?: string
|
||||
/**
|
||||
* 右侧箭头的方向
|
||||
* @default "right"
|
||||
*/
|
||||
arrowDirection?: 'left' | 'right' | 'up' | 'down'
|
||||
/**
|
||||
* 左侧图标样式
|
||||
*/
|
||||
iconStyle?: unknown
|
||||
/**
|
||||
* 右侧箭头图标的样式
|
||||
*/
|
||||
rightIconStyle?: unknown
|
||||
/**
|
||||
* 标题的样式
|
||||
*/
|
||||
titleStyle?: unknown
|
||||
/**
|
||||
* 单位元的大小,可选值为large
|
||||
*/
|
||||
size?: string
|
||||
/**
|
||||
* 点击cell是否阻止事件传播
|
||||
* @default true
|
||||
*/
|
||||
stop?: boolean
|
||||
/**
|
||||
* 标识符,用于在`click`事件中进行返回
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 点击cell列表时触发
|
||||
* @param name `props`的`name`参数标识符
|
||||
*/
|
||||
onClick?: (name: any) => any
|
||||
}
|
||||
|
||||
declare interface CellSlots {
|
||||
/**
|
||||
* 自定义左侧标题部分的内容,如需使用,请勿定义`title`参数,或赋值`null`即可
|
||||
*/
|
||||
['title']?: () => any
|
||||
/**
|
||||
* 自定义右侧标题部分的内容,如需使用,请勿定义`value`参数,或赋值`null`即可
|
||||
*/
|
||||
['value']?: () => any
|
||||
/**
|
||||
* 自定义左侧的图标
|
||||
*/
|
||||
['icon']?: () => any
|
||||
/**
|
||||
* 自定义右侧图标内容,需设置`arrow`为`false`才起作用
|
||||
*/
|
||||
['right-icon']?: () => any
|
||||
/**
|
||||
* 自定义label内容
|
||||
*/
|
||||
['label']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Cell {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CellProps
|
||||
$slots: CellSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Cell: _Cell
|
||||
27
uview-plus/types/comps/cellGroup.d.ts
vendored
Normal file
27
uview-plus/types/comps/cellGroup.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CellGroupProps {
|
||||
/**
|
||||
* 分组标题
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 是否显示外边框
|
||||
* @default true
|
||||
*/
|
||||
border?: boolean
|
||||
/**
|
||||
* 用户自定义外部样式,对象形式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
}
|
||||
|
||||
declare interface _CellGroup {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CellGroupProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const CellGroup: _CellGroup
|
||||
69
uview-plus/types/comps/checkbox.d.ts
vendored
Normal file
69
uview-plus/types/comps/checkbox.d.ts
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CheckboxProps {
|
||||
/**
|
||||
* checkbox的名称
|
||||
*/
|
||||
name?: string | number | boolean
|
||||
/**
|
||||
* 形状,square为方形,circle为圆型
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'square' | 'circle'
|
||||
/**
|
||||
* 整体的大小
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 是否默认选中
|
||||
* @default false
|
||||
*/
|
||||
checked?: boolean
|
||||
/**
|
||||
* 是否禁用
|
||||
* @default false
|
||||
*/
|
||||
disabled?: string | boolean
|
||||
/**
|
||||
* 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 未选中的颜色
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 图标的大小,单位px
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* 图标颜色
|
||||
*/
|
||||
iconColor?: string
|
||||
/**
|
||||
* label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
|
||||
*/
|
||||
label?: string | number
|
||||
/**
|
||||
* label的字体大小,px单位
|
||||
*/
|
||||
labelSize?: string | number
|
||||
/**
|
||||
* label的颜色
|
||||
*/
|
||||
labelColor?: string
|
||||
/**
|
||||
* 是否禁止点击提示语选中复选框
|
||||
*/
|
||||
labelDisabled?: string | boolean
|
||||
}
|
||||
|
||||
declare interface _Checkbox {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CheckboxProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Checkbox: _Checkbox
|
||||
93
uview-plus/types/comps/checkboxGroup.d.ts
vendored
Normal file
93
uview-plus/types/comps/checkboxGroup.d.ts
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CheckboxGroupProps {
|
||||
/**
|
||||
* 标识符
|
||||
*/
|
||||
name?: string
|
||||
/**
|
||||
* 绑定的值
|
||||
* @default []
|
||||
*/
|
||||
value?: string[]
|
||||
/**
|
||||
* 形状,square为方形,circle为圆型
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'square' | 'circle'
|
||||
/**
|
||||
* 是否禁用全部checkbox
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
|
||||
* @default "#2979ff"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 未选中的颜色
|
||||
* @default "#c8c9cc"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 整体的大小
|
||||
* @default 18
|
||||
*/
|
||||
size?: string
|
||||
/**
|
||||
* 布局方式,row-横向,column-纵向
|
||||
* @default "row"
|
||||
*/
|
||||
placement?: 'row' | 'column'
|
||||
/**
|
||||
* label的字体大小,px单位
|
||||
* @default 14
|
||||
*/
|
||||
labelSize?: string | number
|
||||
/**
|
||||
* label的颜色
|
||||
* @default "#303133"
|
||||
*/
|
||||
labelColor?: string
|
||||
/**
|
||||
* 是否禁止点击文本操作
|
||||
* @default false
|
||||
*/
|
||||
labelDisabled?: boolean
|
||||
/**
|
||||
* 图标的大小,单位px
|
||||
* @default 12
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* 图标颜色
|
||||
* @default "#fff"
|
||||
*/
|
||||
iconColor?: string
|
||||
/**
|
||||
* 勾选图标的对齐方式,left-左边,right-右边
|
||||
* @default "left"
|
||||
*/
|
||||
iconPlacement?: 'left' | 'right'
|
||||
/**
|
||||
* 竖向配列时,是否显示下划线
|
||||
* @default false
|
||||
*/
|
||||
borderBottom?: boolean
|
||||
/**
|
||||
* 任一个`checkbox`状态发生变化时触发,回调为一个对象
|
||||
* @param detail 元素为被选中的`checkbox`的`name`数组
|
||||
*/
|
||||
onChange?: (detail: any[]) => any
|
||||
}
|
||||
|
||||
declare interface _CheckboxGroup {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CheckboxGroupProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const CheckboxGroup: _CheckboxGroup
|
||||
69
uview-plus/types/comps/code.d.ts
vendored
Normal file
69
uview-plus/types/comps/code.d.ts
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CodeProps {
|
||||
/**
|
||||
* 倒计时所需的秒数
|
||||
* @default 60
|
||||
*/
|
||||
seconds?: string | number
|
||||
/**
|
||||
* 开始前的提示语,详细见[文档](https://www.uviewui.com/components/code.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E6%8F%90%E7%A4%BA%E8%AF%AD)
|
||||
* @default "获取验证码"
|
||||
*/
|
||||
startText?: string
|
||||
/**
|
||||
* 倒计时期间的提示语,必须带有字母"x",详细见[文档](https://www.uviewui.com/components/code.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E6%8F%90%E7%A4%BA%E8%AF%AD)
|
||||
* @default "X秒重新获取"
|
||||
*/
|
||||
changeText?: string
|
||||
/**
|
||||
* 倒计结束的提示语,详细见[文档](https://www.uviewui.com/components/code.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E6%8F%90%E7%A4%BA%E8%AF%AD)
|
||||
* @default "重新获取"
|
||||
*/
|
||||
endText?: string
|
||||
/**
|
||||
* 是否在H5刷新或各端返回再进入时继续倒计时
|
||||
* @default false
|
||||
*/
|
||||
keepRunning?: boolean
|
||||
/**
|
||||
* 多个组件之间继续倒计时的区分`key`,详细见[文档](https://www.uviewui.com/components/code.html#%E4%BF%9D%E6%8C%81%E5%80%92%E8%AE%A1%E6%97%B6)
|
||||
*/
|
||||
uniqueKey?: string
|
||||
/**
|
||||
* 倒计时期间,每秒触发一次
|
||||
* @param text 当前剩余多少秒的状态
|
||||
*/
|
||||
onChange?: (text: string) => any
|
||||
/**
|
||||
* 开始倒计时触发
|
||||
*/
|
||||
onStart?: () => any
|
||||
/**
|
||||
* 结束倒计时触发
|
||||
*/
|
||||
onEnd?: () => any
|
||||
}
|
||||
|
||||
declare interface _Code {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CodeProps
|
||||
}
|
||||
}
|
||||
|
||||
declare interface _CodeRef {
|
||||
/**
|
||||
* 开始倒计时
|
||||
*/
|
||||
start: () => void
|
||||
/**
|
||||
* 结束当前正在进行中的倒计时,设置组件为可以重新获取验证码的状态
|
||||
*/
|
||||
reset: () => void
|
||||
}
|
||||
|
||||
export declare const Code: _Code
|
||||
|
||||
export declare const CodeRef: _CodeRef
|
||||
98
uview-plus/types/comps/codeInput.d.ts
vendored
Normal file
98
uview-plus/types/comps/codeInput.d.ts
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CodeInputProps {
|
||||
/**
|
||||
* 键盘弹起时,是否自动上推页面
|
||||
* @default true
|
||||
*/
|
||||
adjustPosition?: boolean
|
||||
/**
|
||||
* 输入字符个数
|
||||
* @default 6
|
||||
*/
|
||||
maxlength?: string | number
|
||||
/**
|
||||
* 是否用圆点填充
|
||||
* @default false
|
||||
*/
|
||||
dot?: boolean
|
||||
/**
|
||||
* 模式选择
|
||||
* @default "box"
|
||||
*/
|
||||
mode?: 'box' | 'bottomLine' | 'middleLine'
|
||||
/**
|
||||
* 是否细边框
|
||||
* @default false
|
||||
*/
|
||||
hairline?: boolean
|
||||
/**
|
||||
* 字符间的距离
|
||||
* @default 10
|
||||
*/
|
||||
space?: string | number
|
||||
/**
|
||||
* 预置值
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 是否自动获取焦点
|
||||
* @default false
|
||||
*/
|
||||
focus?: boolean
|
||||
/**
|
||||
* 字体和输入横线是否加粗
|
||||
* @default false
|
||||
*/
|
||||
bold?: boolean
|
||||
/**
|
||||
* 字体颜色
|
||||
* @default "#606266"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 字体大小,单位rpx
|
||||
* @default 18
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 输入框的大小,宽等于高
|
||||
* @default 35
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 禁止点击输入框唤起系统键盘
|
||||
* @default false
|
||||
*/
|
||||
disabledKeyboard?: boolean
|
||||
/**
|
||||
* 边框和线条颜色
|
||||
* @default "#c9cacc"
|
||||
*/
|
||||
borderColor?: string
|
||||
/**
|
||||
* 是否禁止输入"."符号
|
||||
* @default true
|
||||
*/
|
||||
disabledDot?: boolean
|
||||
/**
|
||||
* 输入内容发生改变时触发
|
||||
* @param value 当前输入的值
|
||||
*/
|
||||
onChange?: (value: any) => any
|
||||
/**
|
||||
* 输入字符个数达`maxlength`值时触发
|
||||
* @param value 当前输入的值
|
||||
*/
|
||||
onFinish?: (value: any) => any
|
||||
}
|
||||
|
||||
declare interface _CodeInput {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CodeInputProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const CodeInput: _CodeInput
|
||||
43
uview-plus/types/comps/col.d.ts
vendored
Normal file
43
uview-plus/types/comps/col.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ColProps {
|
||||
/**
|
||||
* 栅格占据的列数,总12等分
|
||||
* @default 0
|
||||
*/
|
||||
span?: string | number
|
||||
/**
|
||||
* 分栏左边偏移,计算方式与span相同
|
||||
* @default 0
|
||||
*/
|
||||
offset?: string | number
|
||||
/**
|
||||
* 水平排列方式(微信小程序暂不支持)
|
||||
* @default "start"
|
||||
*/
|
||||
justify?: 'start' | 'flex-start' | 'end' | 'flex-end' | 'center' | 'around' | 'space-around' | 'between' | 'space-between'
|
||||
/**
|
||||
* 垂直排列方式
|
||||
* @default "stretch"
|
||||
*/
|
||||
align?: 'top' | 'center' | 'bottom' | 'stretch'
|
||||
/**
|
||||
* 文字水平对齐方式
|
||||
* @default 'left
|
||||
*/
|
||||
textAlign?: 'left' | 'center' | 'right'
|
||||
/**
|
||||
* 点击触发事件
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface _Col {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ColProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Col: _Col
|
||||
52
uview-plus/types/comps/collapse.d.ts
vendored
Normal file
52
uview-plus/types/comps/collapse.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CollapseProps {
|
||||
/**
|
||||
* 当前展开面板的name,非手风琴模式:[<String | Number>],手风琴模式:String | Number
|
||||
*/
|
||||
value: string | number | (string | number)[]
|
||||
/**
|
||||
* 是否手风琴模式
|
||||
* @default false
|
||||
*/
|
||||
accordion?: boolean
|
||||
/**
|
||||
* 是否显示外边框
|
||||
* @default true
|
||||
*/
|
||||
border?: boolean
|
||||
/**
|
||||
* 当前激活面板展开时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)
|
||||
* @param activeNames 活动项
|
||||
*/
|
||||
onChange?: (activeNames: string | any[]) => any
|
||||
/**
|
||||
* 当前激活面板展开时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)
|
||||
* @param activeNames 活动项
|
||||
*/
|
||||
onOpen?: (activeNames: string | any[]) => any
|
||||
/**
|
||||
* 当前激活面板关闭时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)
|
||||
* @param activeNames 活动项
|
||||
*/
|
||||
onClose?: (activeNames: string | any[]) => any
|
||||
}
|
||||
|
||||
declare interface _Collapse {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CollapseProps
|
||||
}
|
||||
}
|
||||
|
||||
declare interface _CollapseRef {
|
||||
/**
|
||||
* 重新初始化内部高度计算,用于异步获取内容的情形,请结合`this.$nextTick()`使用
|
||||
*/
|
||||
init: () => void
|
||||
}
|
||||
|
||||
export declare const Collapse: _Collapse
|
||||
|
||||
export declare const CollapseRef: _CollapseRef
|
||||
83
uview-plus/types/comps/collapseItem.d.ts
vendored
Normal file
83
uview-plus/types/comps/collapseItem.d.ts
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CollapseItemProps {
|
||||
/**
|
||||
* 面板标题
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 标题右侧内容
|
||||
*/
|
||||
value?: string
|
||||
/**
|
||||
* 标题下方的描述信息
|
||||
*/
|
||||
label?: string
|
||||
/**
|
||||
* 面板是否可以打开或收起
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 是否展示右侧箭头并开启点击反馈
|
||||
* @default true
|
||||
*/
|
||||
isLink?: boolean
|
||||
/**
|
||||
* 是否开启点击反馈
|
||||
* @default true
|
||||
*/
|
||||
clickable?: boolean
|
||||
/**
|
||||
* 是否显示内边框
|
||||
* @default true
|
||||
*/
|
||||
border?: boolean
|
||||
/**
|
||||
* 唯一标识符,如不设置,默认用当前`collapse-item`的索引值
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 标题左侧图片,可为绝对路径的图片或内置图标
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 面板展开收起的过渡时间,单位`ms`
|
||||
* @default 300
|
||||
*/
|
||||
duration?: number
|
||||
}
|
||||
|
||||
declare interface CollapseItemSlots {
|
||||
/**
|
||||
* 主体部分的内容
|
||||
*/
|
||||
['default']?: () => any
|
||||
/**
|
||||
* 标题内容
|
||||
*/
|
||||
['title']?: () => any
|
||||
/**
|
||||
* icon
|
||||
*/
|
||||
['icon']?: () => any
|
||||
/**
|
||||
* 右侧value
|
||||
*/
|
||||
['value']?: () => any
|
||||
/**
|
||||
* 右侧icon
|
||||
*/
|
||||
['right-icon']?: () => any
|
||||
}
|
||||
|
||||
declare interface _CollapseItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CollapseItemProps
|
||||
$slots: CollapseItemSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const CollapseItem: _CollapseItem
|
||||
60
uview-plus/types/comps/countDown.d.ts
vendored
Normal file
60
uview-plus/types/comps/countDown.d.ts
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CountDownProps {
|
||||
/**
|
||||
* 倒计时时长,单位ms
|
||||
* @default 0
|
||||
*/
|
||||
time?: string | number
|
||||
/**
|
||||
* 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒
|
||||
* @default "HH:mm:ss"
|
||||
*/
|
||||
format?: string
|
||||
/**
|
||||
* 是否自动开始倒计时
|
||||
* @default true
|
||||
*/
|
||||
autoStart?: boolean
|
||||
/**
|
||||
* 是否展示毫秒倒计时
|
||||
* @default false
|
||||
*/
|
||||
millisecond?: boolean
|
||||
/**
|
||||
* 过程中,倒计时变化时触发
|
||||
* @param time 剩余的时间
|
||||
*/
|
||||
onChange?: (time: any) => any
|
||||
/**
|
||||
* 倒计时结束
|
||||
*/
|
||||
onFinish?: () => any
|
||||
}
|
||||
|
||||
declare interface _CountDownRef {
|
||||
/**
|
||||
* 开始倒计时
|
||||
*/
|
||||
start: () => void
|
||||
/**
|
||||
* 暂停倒计时
|
||||
*/
|
||||
pause: () => void
|
||||
/**
|
||||
* 重置倒计时
|
||||
*/
|
||||
reset: () => void
|
||||
}
|
||||
|
||||
declare interface _CountDown {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CountDownProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const CountDown: _CountDown
|
||||
|
||||
export declare const CountDownRef: _CountDownRef
|
||||
88
uview-plus/types/comps/countTo.d.ts
vendored
Normal file
88
uview-plus/types/comps/countTo.d.ts
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface CountToProps {
|
||||
/**
|
||||
* 开始值
|
||||
* @default 0
|
||||
*/
|
||||
startVal?: string | number
|
||||
/**
|
||||
* 结束值
|
||||
* @default 0
|
||||
*/
|
||||
endVal?: string | number
|
||||
/**
|
||||
* 滚动过程所需的时间,单位ms
|
||||
* @default 2000
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 是否自动开始滚动
|
||||
* @default true
|
||||
*/
|
||||
autoplay?: boolean
|
||||
/**
|
||||
* 要显示的小数位数,详细见[文档](https://www.uviewui.com/components/countTo.html#%E6%98%AF%E5%90%A6%E6%98%BE%E7%A4%BA%E5%B0%8F%E6%95%B0%E4%BD%8D)
|
||||
* @default 0
|
||||
*/
|
||||
decimals?: string | number
|
||||
/**
|
||||
* 滚动结束时,是否缓动结尾,详细见[文档](https://www.uviewui.com/components/countTo.html#%E8%AE%BE%E7%BD%AE%E6%BB%9A%E5%8A%A8%E7%9B%B8%E5%85%B3%E5%8F%82%E6%95%B0)
|
||||
* @default true
|
||||
*/
|
||||
useEasing?: boolean
|
||||
/**
|
||||
* 十进制分割
|
||||
*/
|
||||
decimal?: string
|
||||
/**
|
||||
* 字体颜色
|
||||
* @default #606266
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 字体大小,单位px
|
||||
* @default 22
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 字体是否加粗
|
||||
* @default false
|
||||
*/
|
||||
bold?: boolean
|
||||
/**
|
||||
* 千位分隔符,详细见[文档](https://www.uviewui.com/components/countTo.html#%E5%8D%83%E5%88%86%E4%BD%8D%E5%88%86%E9%9A%94%E7%AC%A6)
|
||||
*/
|
||||
separator?: string
|
||||
/**
|
||||
* 数值滚动到目标值时触发
|
||||
*/
|
||||
onEnd?: () => any
|
||||
}
|
||||
|
||||
declare interface _CountToRef {
|
||||
/**
|
||||
* `autoplay`为`false`时,通过此方法启动滚动
|
||||
*/
|
||||
start: () => void
|
||||
/**
|
||||
* 暂停后重新开始滚动(从暂停前的值开始滚动)
|
||||
*/
|
||||
reStart: () => void
|
||||
/**
|
||||
* 暂停滚动
|
||||
*/
|
||||
paused: () => void
|
||||
}
|
||||
|
||||
declare interface _CountTo {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
CountToProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const CountTo: _CountTo
|
||||
|
||||
export declare const CountToRef: _CountToRef
|
||||
146
uview-plus/types/comps/datetimePicker.d.ts
vendored
Normal file
146
uview-plus/types/comps/datetimePicker.d.ts
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface DatetimePickerProps {
|
||||
/**
|
||||
* 用于控制选择器的弹出与收起
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 是否显示顶部的操作栏
|
||||
* @default true
|
||||
*/
|
||||
showToolbar?: boolean
|
||||
/**
|
||||
* 绑定值
|
||||
*/
|
||||
['v-model']?: string | number
|
||||
/**
|
||||
* 顶部标题
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 展示格式
|
||||
* @default "datetime"
|
||||
*/
|
||||
mode?: 'datetime' | 'date' | 'time' | 'year-month'
|
||||
/**
|
||||
* 可选的最大时间(时间戳毫秒)
|
||||
* @default 最大默认值为后10年
|
||||
*/
|
||||
maxDate?: number
|
||||
/**
|
||||
* 可选的最小时间(时间戳毫秒)
|
||||
* @default 最小默认值为前10年
|
||||
*/
|
||||
minDate?: number
|
||||
/**
|
||||
* 可选的最小小时,仅mode=time有效
|
||||
* @default 0
|
||||
*/
|
||||
minHour?: number
|
||||
/**
|
||||
* 可选的最大小时,仅mode=time有效
|
||||
* @default 23
|
||||
*/
|
||||
maxHour?: number
|
||||
/**
|
||||
* 可选的最小分钟,仅mode=time有效
|
||||
* @default 0
|
||||
*/
|
||||
minMinute?: number
|
||||
/**
|
||||
* 可选的最大分钟,仅mode=time有效
|
||||
* @default 59
|
||||
*/
|
||||
maxMinute?: number
|
||||
/**
|
||||
* 选项过滤函数
|
||||
* @default null
|
||||
*/
|
||||
filter?: (...args: any) => any
|
||||
/**
|
||||
* 输入过滤或格式化函数(如需兼容微信小程序,则只能通过`setFormatter`方法)
|
||||
* @default null
|
||||
*/
|
||||
formatter?: (...args: any) => any
|
||||
/**
|
||||
* 是否显示加载中状态
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 各列中,单个选项的高度
|
||||
* @default 44
|
||||
*/
|
||||
itemHeight?: string | number
|
||||
/**
|
||||
* 取消按钮的文字
|
||||
* @default "取消"
|
||||
*/
|
||||
cancelText?: string
|
||||
/**
|
||||
* 确认按钮的文字
|
||||
* @default "确认"
|
||||
*/
|
||||
confirmText?: string
|
||||
/**
|
||||
* 取消按钮的颜色
|
||||
* @default "#909193"
|
||||
*/
|
||||
cancelColor?: string
|
||||
/**
|
||||
* 确认按钮的颜色
|
||||
* @default "#3c9cff"
|
||||
*/
|
||||
confirmColor?: string
|
||||
/**
|
||||
* 每列中可见选项的数量
|
||||
* @default 5
|
||||
*/
|
||||
visibleItemCount?: string | number
|
||||
/**
|
||||
* 是否允许点击遮罩关闭选择器(注意:关闭事件需要自行处理,只会在开启closeOnClickOverlay后点击遮罩层执行close回调)
|
||||
* @default false
|
||||
*/
|
||||
closeOnClickOverlay?: boolean
|
||||
/**
|
||||
* 各列的默认索引
|
||||
*/
|
||||
defaultIndex?: any[]
|
||||
/**
|
||||
* 关闭选择器时触发
|
||||
*/
|
||||
onClose?: () => any
|
||||
/**
|
||||
* 点击确定按钮,返回当前选择的值
|
||||
*/
|
||||
onConfirm?: () => any
|
||||
/**
|
||||
* 当选择值变化时触发
|
||||
*/
|
||||
onChange?: () => any
|
||||
/**
|
||||
* 点击取消按钮
|
||||
*/
|
||||
onCancel?: () => any
|
||||
}
|
||||
|
||||
declare interface _DatetimePickerRef {
|
||||
/**
|
||||
* 为兼容微信小程序而暴露的内部方法,详见[文档](https://www.uviewui.com/components/datetimePicker.html#%E6%A0%BC%E5%BC%8F%E5%8C%96)
|
||||
*/
|
||||
setFormatter: (type, value) => any
|
||||
}
|
||||
|
||||
declare interface _DatetimePicker {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
DatetimePickerProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const DatetimePicker: _DatetimePicker
|
||||
|
||||
export declare const DatetimePickerRef: _DatetimePickerRef
|
||||
58
uview-plus/types/comps/divider.d.ts
vendored
Normal file
58
uview-plus/types/comps/divider.d.ts
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface DividerProps {
|
||||
/**
|
||||
* 是否虚线
|
||||
* @default false
|
||||
*/
|
||||
dashed?: boolean
|
||||
/**
|
||||
* 是否细线
|
||||
* @default true
|
||||
*/
|
||||
hairline?: boolean
|
||||
/**
|
||||
* 是否以点替代文字,优先于text字段起作用
|
||||
* @default false
|
||||
*/
|
||||
dot?: boolean
|
||||
/**
|
||||
* 内容文本的位置
|
||||
* @default "center"
|
||||
*/
|
||||
textPosition?: 'left' | 'center' | 'right'
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
text?: string | number
|
||||
/**
|
||||
* 文本大小
|
||||
* @default 14
|
||||
*/
|
||||
textSize?: string | number
|
||||
/**
|
||||
* 文本颜色
|
||||
* @default #909399
|
||||
*/
|
||||
textColor?: string
|
||||
/**
|
||||
* 线条颜色
|
||||
* @default #dcdfe6
|
||||
*/
|
||||
lineColor?: string
|
||||
/**
|
||||
* divider组件被点击时触发
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface _Divider {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
DividerProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Divider: _Divider
|
||||
|
||||
72
uview-plus/types/comps/empty.d.ts
vendored
Normal file
72
uview-plus/types/comps/empty.d.ts
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface EmptyProps {
|
||||
/**
|
||||
* 内置图标名称,或图片路径,建议绝对路径
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 文字提示
|
||||
*/
|
||||
text?: string
|
||||
/**
|
||||
* 文字颜色
|
||||
* @default "#c0c4cc"
|
||||
*/
|
||||
textColor?: string
|
||||
/**
|
||||
* 文字大小
|
||||
* @default 14
|
||||
*/
|
||||
textSize?: string | number
|
||||
/**
|
||||
* 图标的颜色
|
||||
* @default "#c0c4cc"
|
||||
*/
|
||||
iconColor?: string
|
||||
/**
|
||||
* 图标的大小
|
||||
* @default 90
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* 内置的图标,详细见[文档](https://www.uviewui.com/components/empty.html#%E5%86%85%E7%BD%AE%E5%9B%BE%E6%A0%87)
|
||||
* @default "data"
|
||||
*/
|
||||
mode?: string
|
||||
/**
|
||||
* 图标的宽度,单位px
|
||||
* @default 160
|
||||
*/
|
||||
width?: string | number
|
||||
/**
|
||||
* 图标的高度,单位px
|
||||
* @default 160
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 是否显示组件
|
||||
* @default true
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 组件到上一个元素的间距,单位px
|
||||
* @default 0
|
||||
*/
|
||||
marginTop?: string | number
|
||||
}
|
||||
|
||||
declare interface EmptySlots {
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Empty {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
EmptyProps
|
||||
$slots: EmptySlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Empty: _Empty
|
||||
76
uview-plus/types/comps/form.d.ts
vendored
Normal file
76
uview-plus/types/comps/form.d.ts
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface FormProps {
|
||||
/**
|
||||
* 表单数据对象
|
||||
*/
|
||||
model?: Record<string, any>
|
||||
/**
|
||||
* 通过ref设置,如果rules中有自定义方法等,需要使用setRules方法设置规则,详见[文档](https://www.uviewui.com/components/form.html#%E9%AA%8C%E8%AF%81%E8%A7%84%E5%88%99)
|
||||
*/
|
||||
rules?: Record<string, any>
|
||||
/**
|
||||
* 错误的提示方式
|
||||
* @default "message"
|
||||
*/
|
||||
errorType?: 'message' | 'none' | 'toast' | 'border-bottom' | 'none'
|
||||
/**
|
||||
* 是否显示表单域的下划线边框
|
||||
* @default true
|
||||
*/
|
||||
borderBottom?: boolean
|
||||
/**
|
||||
* 表单域提示文字的位置,left-左侧,top-上方
|
||||
* @default "left"
|
||||
*/
|
||||
labelPosition?: 'left' | 'top'
|
||||
/**
|
||||
* 提示文字的宽度,单位px
|
||||
* @default 45
|
||||
*/
|
||||
labelWidth?: string | number
|
||||
/**
|
||||
* lable字体的对齐方式
|
||||
* @default "left"
|
||||
*/
|
||||
labelAlign?: 'left' | 'center' | 'right'
|
||||
/**
|
||||
* lable的样式
|
||||
*/
|
||||
labelStyle?: unknown
|
||||
}
|
||||
|
||||
declare interface _FormRef {
|
||||
/**
|
||||
* 对整个表单进行校验的方法
|
||||
*/
|
||||
validate: () => any
|
||||
/**
|
||||
* 如果`rules`中有自定义方法等,需要用此方法设置`rules`规则,否则微信小程序无效
|
||||
*/
|
||||
setRules: (rules: any) => any
|
||||
/**
|
||||
* 对部分表单字段进行校验
|
||||
*/
|
||||
validateField: (value, cb?: ((errorsRes) => any)) => any
|
||||
/**
|
||||
* 对整个表单进行重置,将所有字段值重置为初始值并移除校验结果
|
||||
*/
|
||||
resetFields: () => any
|
||||
/**
|
||||
* 清空校验结果
|
||||
*/
|
||||
clearValidate: (props: any) => any
|
||||
}
|
||||
|
||||
declare interface _Form {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
FormProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Form: _Form
|
||||
|
||||
export declare const FormRef: _FormRef
|
||||
68
uview-plus/types/comps/formItem.d.ts
vendored
Normal file
68
uview-plus/types/comps/formItem.d.ts
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface FormItemProps {
|
||||
/**
|
||||
* 左侧提示文字
|
||||
*/
|
||||
label?: string
|
||||
/**
|
||||
* 表单域`model`对象的属性名,在使用 validate、resetFields 方法的情况下,该属性是必填的
|
||||
*/
|
||||
prop?: string
|
||||
/**
|
||||
* 是否显示下边框,如不需要下边框,需同时将u-form的同名参数设置为false
|
||||
* @default true
|
||||
*/
|
||||
borderBottom?: boolean
|
||||
/**
|
||||
* 提示文字的宽度,单位rpx,如设置,将覆盖`u-form`的同名参数
|
||||
*/
|
||||
labelWidth?: string | number
|
||||
/**
|
||||
* label的位置
|
||||
*/
|
||||
labelPosition?: 'left' | 'top'
|
||||
/**
|
||||
* 右侧自定义字体图标(限uView内置图标)或图片地址
|
||||
*/
|
||||
rightIcon?: string
|
||||
/**
|
||||
* 左侧自定义字体图标(限uView内置图标)或图片地址
|
||||
*/
|
||||
leftIcon?: string
|
||||
/**
|
||||
* 左侧自定义字体图标的样式
|
||||
*/
|
||||
leftIconStyle?: unknown
|
||||
/**
|
||||
* 是否显示左边的"*"号,这里仅起展示作用,如需校验必填,请通过rules配置必填规则,如需在swiper标签内显示星号,需要给予swiper-item内第一个根节点一定的margin样式
|
||||
* @default false
|
||||
*/
|
||||
required?: boolean
|
||||
/**
|
||||
* 点击时触发
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface FormItemSlots {
|
||||
/**
|
||||
* Form Item 的内容
|
||||
*/
|
||||
['default']?: () => any
|
||||
/**
|
||||
* 右侧自定义内容,可以在此传入一个按钮,用于获取验证码等场景
|
||||
*/
|
||||
['right']?: () => any
|
||||
}
|
||||
|
||||
declare interface _FormItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
FormItemProps
|
||||
$slots: FormItemSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const FormItem: _FormItem
|
||||
35
uview-plus/types/comps/gap.d.ts
vendored
Normal file
35
uview-plus/types/comps/gap.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface GapProps {
|
||||
/**
|
||||
* 背景颜色
|
||||
* @default "transparent"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 间隔槽高度,单位px
|
||||
* @default 20
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 与前一个元素的距离,单位px
|
||||
* @default 0
|
||||
*/
|
||||
marginTop?: string | number
|
||||
/**
|
||||
* 与后一个元素的距离,单位px
|
||||
* @default 0
|
||||
*/
|
||||
marginBottom?: string | number
|
||||
}
|
||||
|
||||
declare interface _Gap {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
GapProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Gap: _Gap
|
||||
|
||||
34
uview-plus/types/comps/grid.d.ts
vendored
Normal file
34
uview-plus/types/comps/grid.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface GridProps {
|
||||
/**
|
||||
* 宫格的列数
|
||||
* @default 3
|
||||
*/
|
||||
col?: string | number
|
||||
/**
|
||||
* 是否显示宫格的边框
|
||||
* @default true
|
||||
*/
|
||||
border?: boolean
|
||||
/**
|
||||
* 宫格的对齐方式,用于控制只有一两个宫格时的对齐场景
|
||||
* @default "left"
|
||||
*/
|
||||
align?: 'left' | 'center' | 'right'
|
||||
/**
|
||||
* 点击宫格触发
|
||||
* @param name `grid-item` 的 `name`
|
||||
*/
|
||||
onClick?: (name: any) => any
|
||||
}
|
||||
|
||||
declare interface _Grid {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
GridProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Grid: _Grid
|
||||
28
uview-plus/types/comps/gridItem.d.ts
vendored
Normal file
28
uview-plus/types/comps/gridItem.d.ts
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface GridItemProps {
|
||||
/**
|
||||
* 宫格的name
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 宫格的背景颜色
|
||||
* @default "transparent"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 点击宫格触发
|
||||
* @param name `grid-item` 的 `name`
|
||||
*/
|
||||
onClick?: (name: any) => any
|
||||
}
|
||||
|
||||
declare interface _GridItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
GridItemProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const GridItem: _GridItem
|
||||
93
uview-plus/types/comps/icon.d.ts
vendored
Normal file
93
uview-plus/types/comps/icon.d.ts
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
import { ImageMode } from './image'
|
||||
|
||||
declare interface IconProps {
|
||||
/**
|
||||
* 图标名称,如名称带有`/`,会被认为是图片图标
|
||||
*/
|
||||
name?: string
|
||||
/**
|
||||
* 图标颜色
|
||||
* @default "color['u-content-color']"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 图标字体大小,单位默认px
|
||||
* @default "16px"
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 是否显示粗体
|
||||
* @default false
|
||||
*/
|
||||
bold?: boolean
|
||||
/**
|
||||
* 一个用于区分多个图标的值,点击图标时通过`click`事件传出
|
||||
*/
|
||||
index?: string | number
|
||||
/**
|
||||
* 图标按下去的样式类,用法同uni的`view`组件的`hover-class`参数,详见:[hover-class](https://uniapp.dcloud.io/component/view)
|
||||
*/
|
||||
hoverClass?: string
|
||||
/**
|
||||
* 图标右侧/下方的label文字
|
||||
*/
|
||||
label?: string | number
|
||||
/**
|
||||
* `label`相对于图标的位置
|
||||
* @default "right"
|
||||
*/
|
||||
labelPos?: 'right' | 'bottom' | 'top' | 'left'
|
||||
/**
|
||||
* `label`字体大小,单位默认px
|
||||
* @default "15px"
|
||||
*/
|
||||
labelSize?: string | number
|
||||
/**
|
||||
* `label`字体颜色
|
||||
* @default "color['u-content-color']"
|
||||
*/
|
||||
labelColor?: string
|
||||
/**
|
||||
* `label`与图标的距离,单位默认px
|
||||
* @default "3px"
|
||||
*/
|
||||
space?: string | number
|
||||
/**
|
||||
* 裁剪模式
|
||||
*/
|
||||
imgMode?: ImageMode
|
||||
/**
|
||||
* `name`为图片路径时图片的宽度,单位默认px
|
||||
*/
|
||||
width?: string | number
|
||||
/**
|
||||
* `name`为图片路径时图片的高度,单位默认px
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 图标到顶部的距离,如果某些场景,如果图标没有垂直居中,可以调整此参数,单位默认px
|
||||
* @default 0
|
||||
*/
|
||||
top?: string | number
|
||||
/**
|
||||
* 是否阻止事件传播
|
||||
* @default false
|
||||
*/
|
||||
stop?: boolean
|
||||
/**
|
||||
* 点击图标时触发
|
||||
* @param index 通过`props`传递的`index`值
|
||||
*/
|
||||
onClick?: (index: any) => any
|
||||
}
|
||||
|
||||
declare interface _Icon {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
IconProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Icon: _Icon
|
||||
119
uview-plus/types/comps/image.d.ts
vendored
Normal file
119
uview-plus/types/comps/image.d.ts
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
export declare type ImageMode = 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right'
|
||||
|
||||
declare interface ImageProps {
|
||||
/**
|
||||
* 图片地址,强烈建议使用绝对或者网络路径
|
||||
*/
|
||||
src?: string
|
||||
/**
|
||||
* 裁剪模式
|
||||
* @default "aspectFill"
|
||||
*/
|
||||
mode?: ImageMode
|
||||
/**
|
||||
* 宽度,单位任意,如果为数值,默认单位px
|
||||
* @default 300
|
||||
*/
|
||||
width?: string | number
|
||||
/**
|
||||
* 高度,单位任意,如果为数值,默认单位px
|
||||
* @default 225
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 图片形状
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'circle' | 'square'
|
||||
/**
|
||||
* 圆角,默认单位px
|
||||
* @default 0
|
||||
*/
|
||||
radius?: string | number
|
||||
/**
|
||||
* 是否懒加载,仅微信小程序、App、百度小程序、字节跳动小程序有效
|
||||
* @default true
|
||||
*/
|
||||
lazyLoad?: boolean
|
||||
/**
|
||||
* 是否开启长按图片显示识别小程序码菜单,仅微信小程序有效
|
||||
*/
|
||||
showMenuByLongpress?: boolean
|
||||
/**
|
||||
* 加载中的图标,或者小图片
|
||||
* @default "photo"
|
||||
*/
|
||||
loadingIcon?: string
|
||||
/**
|
||||
* 加载失败的图标,或者小图片
|
||||
* @default "error-circle"
|
||||
*/
|
||||
errorIcon?: string
|
||||
/**
|
||||
* 是否显示加载中的图标或者自定义的slot
|
||||
* @default true
|
||||
*/
|
||||
showLoading?: boolean
|
||||
/**
|
||||
* 是否显示加载错误的图标或者自定义的slot
|
||||
* @default true
|
||||
*/
|
||||
showError?: boolean
|
||||
/**
|
||||
* 是否需要淡入效果
|
||||
* @default true
|
||||
*/
|
||||
fade?: boolean
|
||||
/**
|
||||
* 只支持网络资源,只对微信小程序有效
|
||||
* @default false
|
||||
*/
|
||||
webp?: boolean
|
||||
/**
|
||||
* 搭配`fade`参数的过渡时间,单位ms
|
||||
* @default 500
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 背景颜色,用于深色页面加载图片时,为了和背景色融合
|
||||
* @default "#f3f4f6"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 点击图片时触发
|
||||
*/
|
||||
onClick?: () => any
|
||||
/**
|
||||
* 图片加载失败时触发
|
||||
* @param err 错误信息
|
||||
*/
|
||||
onError?: (err: any) => any
|
||||
/**
|
||||
* 图片加载成功时触发
|
||||
*/
|
||||
onLoad?: () => any
|
||||
}
|
||||
|
||||
declare interface ImageSlots {
|
||||
/**
|
||||
* 自定义加载中的提示内容
|
||||
*/
|
||||
['loading']?: () => any
|
||||
/**
|
||||
* 自定义失败的提示内容
|
||||
*/
|
||||
['error']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Image {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ImageProps
|
||||
$slots: ImageSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Image: _Image
|
||||
38
uview-plus/types/comps/indexAnchor.d.ts
vendored
Normal file
38
uview-plus/types/comps/indexAnchor.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface IndexAnchorProps {
|
||||
/**
|
||||
* 列表锚点文本内容
|
||||
*/
|
||||
text?: string | number
|
||||
/**
|
||||
* 列表锚点文字颜色
|
||||
* @default "#606266"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 列表锚点文字大小,单位默认px
|
||||
* @default 14
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 列表锚点背景颜色
|
||||
* @default "#dedede"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 列表锚点高度,单位默认px
|
||||
* @default 32
|
||||
*/
|
||||
height?: string | number
|
||||
}
|
||||
|
||||
declare interface _IndexAnchor {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
IndexAnchorProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const IndexAnchor: _IndexAnchor
|
||||
18
uview-plus/types/comps/indexItem.d.ts
vendored
Normal file
18
uview-plus/types/comps/indexItem.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface IndexItemSlots {
|
||||
/**
|
||||
* 自定义列表内容
|
||||
*/
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _IndexItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps
|
||||
$slots: IndexItemSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const IndexItem: _IndexItem
|
||||
39
uview-plus/types/comps/indexList.d.ts
vendored
Normal file
39
uview-plus/types/comps/indexList.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface IndexListProps {
|
||||
/**
|
||||
* 右边锚点状态非激活时的颜色
|
||||
* @default "#606266"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 右边锚点状态激活时的颜色
|
||||
* @default "#5677fc"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 索引字符列表,数组
|
||||
* @default "A-Z"
|
||||
*/
|
||||
indexList?: (string | number)[]
|
||||
/**
|
||||
* 是否开启锚点自动吸顶
|
||||
* @default true
|
||||
*/
|
||||
sticky?: boolean
|
||||
/**
|
||||
* 自定义导航栏的高度,单位默认px
|
||||
* @default 0
|
||||
*/
|
||||
customNavHeight?: string | number
|
||||
}
|
||||
|
||||
declare interface _IndexList {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
IndexListProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const IndexList: _IndexList
|
||||
234
uview-plus/types/comps/input.d.ts
vendored
Normal file
234
uview-plus/types/comps/input.d.ts
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface InputProps {
|
||||
/**
|
||||
* 输入的值
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 输入框类型,详见[文档](https://www.uviewui.com/components/input.html#%E8%BE%93%E5%85%A5%E6%A1%86%E7%9A%84%E7%B1%BB%E5%9E%8B)
|
||||
* @default "text"
|
||||
*/
|
||||
type?: 'text' | 'number' | 'idcard' | 'digit' | 'password' | 'nickname'
|
||||
/**
|
||||
* 是否禁用输入框
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 禁用状态时的背景色
|
||||
* @default "#f5f7fa"
|
||||
*/
|
||||
disabledColor?: string
|
||||
/**
|
||||
* 是否显示清除控件
|
||||
* @default false
|
||||
*/
|
||||
clearable?: boolean
|
||||
/**
|
||||
* 是否密码类型
|
||||
* @default false
|
||||
*/
|
||||
password?: boolean
|
||||
/**
|
||||
* 最大输入长度,设置为 -1 的时候不限制最大长度
|
||||
* @default -1
|
||||
*/
|
||||
maxlength?: string | number
|
||||
/**
|
||||
* 输入框为空时的占位符
|
||||
*/
|
||||
placeholder?: string
|
||||
/**
|
||||
* 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
|
||||
* @default "input-placeholder"
|
||||
*/
|
||||
placeholderClass?: string
|
||||
/**
|
||||
* 指定placeholder的样式
|
||||
* @default "color: #c0c4cc"
|
||||
*/
|
||||
placeholderStyle?: unknown
|
||||
/**
|
||||
* 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
|
||||
* @default false
|
||||
*/
|
||||
showWordLimit?: boolean
|
||||
/**
|
||||
* 设置右下角按钮的文字
|
||||
* @default "done"
|
||||
*/
|
||||
confirmType?: 'send' | 'search' | 'next' | 'go' | 'done'
|
||||
/**
|
||||
* 点击键盘右下角按钮时是否保持键盘不收起,H5无效
|
||||
* @default false
|
||||
*/
|
||||
confirmHold?: boolean
|
||||
/**
|
||||
* focus时,点击页面的时候不收起键盘,微信小程序有效
|
||||
* @default false
|
||||
*/
|
||||
holdKeyboard?: boolean
|
||||
/**
|
||||
* 自动获取焦点,在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
|
||||
* @default false
|
||||
*/
|
||||
focus?: boolean
|
||||
/**
|
||||
* 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
|
||||
* @default false
|
||||
*/
|
||||
autoBlur?: boolean
|
||||
/**
|
||||
* 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件
|
||||
* @default true
|
||||
*/
|
||||
ignoreCompositionEvent?: boolean
|
||||
/**
|
||||
* 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
|
||||
* @default false
|
||||
*/
|
||||
disableDefaultPadding?: boolean
|
||||
/**
|
||||
* 指定focus时光标的位置
|
||||
* @default -1
|
||||
*/
|
||||
cursor?: string | number
|
||||
/**
|
||||
* 输入框聚焦时底部与键盘的距离
|
||||
* @default 30
|
||||
*/
|
||||
cursorSpacing?: string | number
|
||||
/**
|
||||
* 光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
||||
* @default -1
|
||||
*/
|
||||
selectionStart?: string | number
|
||||
/**
|
||||
* 光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
||||
* @default -1
|
||||
*/
|
||||
selectionEnd?: string | number
|
||||
/**
|
||||
* 键盘弹起时,是否自动上推页面
|
||||
* @default true
|
||||
*/
|
||||
adjustPosition?: boolean
|
||||
/**
|
||||
* 输入框内容对齐方式
|
||||
* @default "left"
|
||||
*/
|
||||
inputAlign?: 'left' | 'center' | 'right'
|
||||
/**
|
||||
* 输入框字体的大小
|
||||
* @default "15px"
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 输入框字体颜色
|
||||
* @default "#303133"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 输入框前置图标
|
||||
*/
|
||||
prefixIcon?: string
|
||||
/**
|
||||
* 前置图标样式
|
||||
*/
|
||||
prefixIconStyle?: unknown
|
||||
/**
|
||||
* 输入框后置图标
|
||||
*/
|
||||
suffixIcon?: string
|
||||
/**
|
||||
* 后置图标样式
|
||||
*/
|
||||
suffixIconStyle?: unknown
|
||||
/**
|
||||
* 边框类型,surround-四周边框,bottom-底部边框,none-无边框
|
||||
* @default "surround"
|
||||
*/
|
||||
border?: 'surround' | 'bottom' | 'none'
|
||||
/**
|
||||
* 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
|
||||
* @default false
|
||||
*/
|
||||
readonly?: boolean
|
||||
/**
|
||||
* 输入框形状,circle-圆形,square-方形
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'square' | 'circle'
|
||||
/**
|
||||
* 输入过滤或格式化函数(如需兼容微信小程序,则只能通过`setFormatter`方法)
|
||||
*/
|
||||
formatter?: (...args: any) => any
|
||||
/**
|
||||
* 定义需要用到的外部样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
/**
|
||||
* 输入框失去焦点时触发
|
||||
* @param value 内容值
|
||||
*/
|
||||
onBlur?: (value: any) => any
|
||||
/**
|
||||
* 输入框聚焦时触发
|
||||
*/
|
||||
onFocus?: () => any
|
||||
/**
|
||||
* 点击完成按钮时触发
|
||||
* @param value 内容值
|
||||
*/
|
||||
onConfirm?: (value: any) => any
|
||||
/**
|
||||
* 键盘高度发生变化的时候触发此事件
|
||||
*/
|
||||
onKeyboardheightchange?: () => any
|
||||
/**
|
||||
* 内容发生变化触发此事件
|
||||
* @param value 内容值
|
||||
*/
|
||||
onInput?: (value: any) => any
|
||||
/**
|
||||
* 内容发生变化触发此事件
|
||||
* @param value 内容值
|
||||
*/
|
||||
onChange?: (value: any) => any
|
||||
/**
|
||||
* 点击清空内容
|
||||
*/
|
||||
onClear?: () => any
|
||||
}
|
||||
|
||||
declare interface InputSlots {
|
||||
/**
|
||||
* 输入框前置内容,`nuve`环境需`u--input`有效,非`nvue`环境需`u-input`才有效
|
||||
*/
|
||||
['prefix']?: () => any
|
||||
/**
|
||||
* 输入框后置内容,`nuve`环境需`u--input`有效,非`nvue`环境需`u-input`才有效
|
||||
*/
|
||||
['suffix']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Input {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
InputProps
|
||||
$slots: InputSlots
|
||||
}
|
||||
}
|
||||
|
||||
declare interface _InputRef {
|
||||
/**
|
||||
* 为兼容微信小程序而暴露的内部方法
|
||||
*/
|
||||
setFormatter: () => void
|
||||
}
|
||||
|
||||
export declare const Input: _Input
|
||||
|
||||
export declare const InputRef: _InputRef
|
||||
125
uview-plus/types/comps/keyboard.d.ts
vendored
Normal file
125
uview-plus/types/comps/keyboard.d.ts
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface KeyboardProps {
|
||||
/**
|
||||
* 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘
|
||||
* @default "car"
|
||||
*/
|
||||
mode?: 'car' | 'number' | 'card'
|
||||
/**
|
||||
* 是否显示"."按键,只在mode=number时有效
|
||||
* @default false
|
||||
*/
|
||||
dotDisabled?: boolean
|
||||
/**
|
||||
* 是否显示键盘顶部工具条
|
||||
* @default true
|
||||
*/
|
||||
tooltip?: boolean
|
||||
/**
|
||||
* 是否显示工具条中间的提示
|
||||
* @default true
|
||||
*/
|
||||
showTips?: boolean
|
||||
/**
|
||||
* 工具条中间的提示文字,详见[文档](https://www.uviewui.com/components/keyboard.html#%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8)
|
||||
*/
|
||||
tips?: string
|
||||
/**
|
||||
* 是否显示工具条左边的"取消"按钮
|
||||
* @default true
|
||||
*/
|
||||
showCancel?: boolean
|
||||
/**
|
||||
* 是否显示工具条右边的"完成"按钮
|
||||
* @default true
|
||||
*/
|
||||
showConfirm?: boolean
|
||||
/**
|
||||
* 是否打乱键盘按键的顺序
|
||||
* @default false
|
||||
*/
|
||||
random?: boolean
|
||||
/**
|
||||
* 是否开启底部安全区适配
|
||||
* @default false
|
||||
*/
|
||||
safeAreaInsetBottom?: boolean
|
||||
/**
|
||||
* 是否允许点击遮罩收起键盘(注意:关闭事件需要自行处理,只会在开启closeOnClickOverlay后点击遮罩层执行close回调)
|
||||
* @default true
|
||||
*/
|
||||
closeOnClickOverlay?: boolean
|
||||
/**
|
||||
* 控制键盘的弹出与收起
|
||||
* @default true
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 是否显示遮罩
|
||||
* @default true
|
||||
*/
|
||||
overlay?: boolean
|
||||
/**
|
||||
* 弹出键盘的`z-index`值
|
||||
* @default 1075
|
||||
*/
|
||||
zIndex?: string | number
|
||||
/**
|
||||
* 确认按钮的文字
|
||||
* @default "确认"
|
||||
*/
|
||||
confirmText?: string
|
||||
/**
|
||||
* 取消按钮的文字
|
||||
* @default "取消"
|
||||
*/
|
||||
cancelText?: string
|
||||
/**
|
||||
* 自定义样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
/**
|
||||
* `mode`为`car`下,输入文字后,是否自动切换为字母模式
|
||||
* @default false
|
||||
*/
|
||||
autoChange?: boolean
|
||||
/**
|
||||
* 按键被点击(不包含退格键被点击)
|
||||
*/
|
||||
onChange?: () => any
|
||||
/**
|
||||
* 键盘关闭
|
||||
*/
|
||||
onClose?: () => any
|
||||
/**
|
||||
* 键盘顶部工具条右边的"完成"按钮被点击
|
||||
*/
|
||||
onConfirm?: () => any
|
||||
/**
|
||||
* 键盘顶部工具条左边的"取消"按钮被点击
|
||||
*/
|
||||
onCancel?: () => any
|
||||
/**
|
||||
* 键盘退格键被点击
|
||||
*/
|
||||
onBackspace?: () => any
|
||||
}
|
||||
|
||||
declare interface KeyboardSlots {
|
||||
/**
|
||||
* 内容将会显示键盘的工具条上面,可以结合MessageInput 验证码输入组件实现类似支付宝输入密码时,上方显示输入内容的功能
|
||||
*/
|
||||
['default']: () => any
|
||||
}
|
||||
|
||||
declare interface _Keyboard {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
KeyboardProps
|
||||
$slots: KeyboardSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Keyboard: _Keyboard
|
||||
44
uview-plus/types/comps/line.d.ts
vendored
Normal file
44
uview-plus/types/comps/line.d.ts
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface LineProps {
|
||||
/**
|
||||
* 线条的颜色
|
||||
* @default "#d6d7d9"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带rpx单位的值等
|
||||
* @default 100%
|
||||
*/
|
||||
length?: string | number
|
||||
/**
|
||||
* 线条的方向,`row`-横向,`col`-竖向
|
||||
* @default "row"
|
||||
*/
|
||||
direction?: "row" | "col"
|
||||
/**
|
||||
* 是否显示细边框
|
||||
* @default true
|
||||
*/
|
||||
hairline?: boolean
|
||||
/**
|
||||
* 线条与上下左右元素的间距,字符串形式,如"30rpx"、"20rpx 30rpx",默认单位px
|
||||
* @default 0
|
||||
*/
|
||||
margin?: string | number
|
||||
/**
|
||||
* 是否虚线,false-实线,true-虚线
|
||||
* @default false
|
||||
*/
|
||||
dashed?: boolean
|
||||
}
|
||||
|
||||
declare interface _Line {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
LineProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Line: _Line
|
||||
51
uview-plus/types/comps/lineProgress.d.ts
vendored
Normal file
51
uview-plus/types/comps/lineProgress.d.ts
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface LineProgressProps {
|
||||
/**
|
||||
* 进度条激活部分的颜色
|
||||
* @default "#19be6b"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 进度条的底色,默认为灰色
|
||||
* @default "#ececec"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 进度百分比,数值
|
||||
* @default 0
|
||||
*/
|
||||
percentage?: string | number
|
||||
/**
|
||||
* 是否在进度条内部显示百分比的值
|
||||
* @default true
|
||||
*/
|
||||
showText?: boolean
|
||||
/**
|
||||
* 进度条的高度,默认单位px
|
||||
* @default 12
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 点击触发事件
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface LineProgressSlots {
|
||||
/**
|
||||
* 传入自定义的显示内容,将会覆盖默认显示的百分比值
|
||||
*/
|
||||
['default']?: (arg: any) => any
|
||||
}
|
||||
|
||||
declare interface _LineProgress {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
LineProgressProps
|
||||
$slots: LineProgressSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const LineProgress: _LineProgress
|
||||
51
uview-plus/types/comps/link.d.ts
vendored
Normal file
51
uview-plus/types/comps/link.d.ts
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface LinkProps {
|
||||
/**
|
||||
* 文字颜色
|
||||
* @default color['u-primary']
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 字体大小,默认单位px
|
||||
* @default 15
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 是否显示下划线
|
||||
* @default false
|
||||
*/
|
||||
underLine?: boolean
|
||||
/**
|
||||
* 跳转的链接,要带上http(s)
|
||||
*/
|
||||
href?: string
|
||||
/**
|
||||
* 各个小程序平台把链接复制到粘贴板后的提示语
|
||||
* @default "链接已复制,请在浏览器打开"
|
||||
*/
|
||||
mpTips?: string
|
||||
/**
|
||||
* 下划线颜色,默认同color参数颜色
|
||||
*/
|
||||
lineColor?: string
|
||||
/**
|
||||
* 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色
|
||||
*/
|
||||
text?: string
|
||||
}
|
||||
|
||||
declare interface LinkSlots {
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Link {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
LinkProps
|
||||
$slots: LinkSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Link: _Link
|
||||
92
uview-plus/types/comps/list.d.ts
vendored
Normal file
92
uview-plus/types/comps/list.d.ts
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ListProps {
|
||||
/**
|
||||
* 控制是否出现滚动条,仅nvue有效
|
||||
* @default false
|
||||
*/
|
||||
showScrollbar?: boolean
|
||||
/**
|
||||
* 距底部多少时触发scrolltolower事件
|
||||
* @default 50
|
||||
*/
|
||||
lowerThreshold?: string | number
|
||||
/**
|
||||
* 距顶部多少时触发scrolltoupper事件,非nvue有效
|
||||
* @default 0
|
||||
*/
|
||||
upperThreshold?: string | number
|
||||
/**
|
||||
* 设置竖向滚动条位置
|
||||
* @default 0
|
||||
*/
|
||||
scrollTop?: string | number
|
||||
/**
|
||||
* 控制 onscroll 事件触发的频率,仅nvue有效
|
||||
* @default 10
|
||||
*/
|
||||
offsetAccuracy?: string | number
|
||||
/**
|
||||
* 启用 flexbox 布局。开启后,当前节点声明了display: flex就会成为flex container,并作用于其孩子节点,仅微信小程序有效
|
||||
* @default false
|
||||
*/
|
||||
enableFlex?: boolean
|
||||
/**
|
||||
* 是否按分页模式显示List
|
||||
* @default false
|
||||
*/
|
||||
pagingEnabled?: boolean
|
||||
/**
|
||||
* 是否允许List滚动
|
||||
* @default true
|
||||
*/
|
||||
scrollable?: boolean
|
||||
/**
|
||||
* 值应为某子元素id(id不能以数字开头)
|
||||
*/
|
||||
scrollIntoView?: string
|
||||
/**
|
||||
* 在设置滚动条位置时使用动画过渡
|
||||
* @default false
|
||||
*/
|
||||
scrollWithAnimation?: boolean
|
||||
/**
|
||||
* iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只对微信小程序有效
|
||||
* @default false
|
||||
*/
|
||||
enableBackToTop?: boolean
|
||||
/**
|
||||
* 列表的高度
|
||||
* @default 0
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 列表宽度
|
||||
* @default 0
|
||||
*/
|
||||
width?: string | number
|
||||
/**
|
||||
* 列表前后预渲染的屏数,1代表一个屏幕的高度,1.5代表1个半屏幕高度
|
||||
* @default 1
|
||||
*/
|
||||
preLoadScreen?: string | number
|
||||
/**
|
||||
* 滚动条滚动触发事件
|
||||
* @param scrollTop 滚动条位置
|
||||
*/
|
||||
onScroll?: (scrollTop: number) => any
|
||||
/**
|
||||
* 滚动到底部触发事件
|
||||
*/
|
||||
onScrolltolower?: () => any
|
||||
}
|
||||
|
||||
declare interface _List {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ListProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const List: _List
|
||||
18
uview-plus/types/comps/listItem.d.ts
vendored
Normal file
18
uview-plus/types/comps/listItem.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ListItemProps {
|
||||
/**
|
||||
* 用于滚动到指定item
|
||||
*/
|
||||
anchor?: string | number
|
||||
}
|
||||
|
||||
declare interface _ListItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ListItemProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const ListItem: _ListItem
|
||||
108
uview-plus/types/comps/loadMore.d.ts
vendored
Normal file
108
uview-plus/types/comps/loadMore.d.ts
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface LoadMoreProps {
|
||||
/**
|
||||
* 组件状态
|
||||
* @default "loadmore"
|
||||
*/
|
||||
status?: 'loadmore' | 'loading' | 'nomore'
|
||||
/**
|
||||
* 组件背景颜色,在页面是非白色时会用到
|
||||
* @default "transparent"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 加载中时是否显示图标
|
||||
* @default true
|
||||
*/
|
||||
icon?: boolean
|
||||
/**
|
||||
* 字体大小,单位rpx
|
||||
* @default 14
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 图标大小,单位px
|
||||
* @default 17
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* 字体颜色
|
||||
* @default "#606266"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 加载中状态的图标
|
||||
* @default "circle"
|
||||
*/
|
||||
loadingIcon?: 'circle' | 'spinner' | 'semicircle'
|
||||
/**
|
||||
* 加载前的提示语
|
||||
* @default "加载更多"
|
||||
*/
|
||||
loadmoreText?: string
|
||||
/**
|
||||
* 加载中提示语
|
||||
* @default "正在加载..."
|
||||
*/
|
||||
loadingText?: string
|
||||
/**
|
||||
* 没有更多的提示语
|
||||
* @default "没有更多了"
|
||||
*/
|
||||
nomoreText?: string
|
||||
/**
|
||||
* `status`为`nomore`时,内容显示为一个"●"
|
||||
* @default false
|
||||
*/
|
||||
isDot?: boolean
|
||||
/**
|
||||
* 加载中的动画图标的颜色
|
||||
* @default "#b7b7b7"
|
||||
*/
|
||||
iconColor?: string
|
||||
/**
|
||||
* 线条颜色
|
||||
* @default "#E6E8EB"
|
||||
*/
|
||||
lineColor?: string
|
||||
/**
|
||||
* 是否虚线,false-实线,true-虚线
|
||||
* @default false
|
||||
*/
|
||||
dashed?: boolean
|
||||
/**
|
||||
* 与前一个元素的距离,单位rpx
|
||||
* @default 10
|
||||
*/
|
||||
marginTop?: string | number
|
||||
/**
|
||||
* 与后一个元素的距离,单位rpx
|
||||
* @default 10
|
||||
*/
|
||||
marginBottom?: string | number
|
||||
/**
|
||||
* 高度
|
||||
* @default "auto"
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 是否显示左边分割线
|
||||
* @default false
|
||||
*/
|
||||
line?: boolean
|
||||
/**
|
||||
* `status`为`loadmore`时,点击组件会发出此事件
|
||||
*/
|
||||
onLoadmore?: () => any
|
||||
}
|
||||
|
||||
declare interface _LoadMore {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
LoadMoreProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const LoadMore: _LoadMore
|
||||
68
uview-plus/types/comps/loadingIcon.d.ts
vendored
Normal file
68
uview-plus/types/comps/loadingIcon.d.ts
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface LoadingIconProps {
|
||||
/**
|
||||
* 是否显示动画
|
||||
* @default true
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 图标颜色
|
||||
* @default "color['u-tips-color']"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 提示文本颜色
|
||||
* @default "color['u-tips-color']"
|
||||
*/
|
||||
textColor?: string
|
||||
/**
|
||||
* 图标和文字是否垂直排列
|
||||
* @default false
|
||||
*/
|
||||
vertical?: boolean
|
||||
/**
|
||||
* 模式选
|
||||
* @default "circle"
|
||||
*/
|
||||
mode?: 'circle' | 'semicircle'
|
||||
/**
|
||||
* 加载图标的大小,单位px
|
||||
* @default 24
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 加载文字的大小,单位px
|
||||
* @default 15
|
||||
*/
|
||||
textSize?: string | number
|
||||
/**
|
||||
* 文字内容
|
||||
*/
|
||||
text?: string
|
||||
/**
|
||||
* 指定`animation-timing-function`的css属性,但只支持`mode`为`circle`或`semicircle`才有效
|
||||
* @default "ease-in-out"
|
||||
*/
|
||||
timingFunction?: string
|
||||
/**
|
||||
* 动画执行周期时间,单位ms
|
||||
* @default 1200
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 图标的暗边颜色, `mode`为`circle` 模式有效
|
||||
* @default "transparent"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
}
|
||||
|
||||
declare interface _LoadingIcon {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
LoadingIconProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const LoadingIcon: _LoadingIcon
|
||||
58
uview-plus/types/comps/loadingPage.d.ts
vendored
Normal file
58
uview-plus/types/comps/loadingPage.d.ts
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface LoadingPageProps {
|
||||
/**
|
||||
* 提示内容
|
||||
* @default "正在加载"
|
||||
*/
|
||||
loadingText?: string | number
|
||||
/**
|
||||
* 文字上方用于替换loading动画的图片
|
||||
*/
|
||||
image?: string
|
||||
/**
|
||||
* 加载动画的模式
|
||||
* @default "circle"
|
||||
*/
|
||||
loadingMode?: 'circle' | 'spinner' | 'semicircle'
|
||||
/**
|
||||
* 是否加载中
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 背景颜色
|
||||
* @default "#ffffff"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 文字颜色
|
||||
* @default "#C8C8C8"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 文字大小
|
||||
* @default 19
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 图标大小
|
||||
* @default 28
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* 加载中图标的颜色
|
||||
* @default "#C8C8C8"
|
||||
*/
|
||||
loadingColor?: string
|
||||
}
|
||||
|
||||
declare interface _LoadingPage {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
LoadingPageProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const LoadingPage: _LoadingPage
|
||||
115
uview-plus/types/comps/modal.d.ts
vendored
Normal file
115
uview-plus/types/comps/modal.d.ts
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ModalProps {
|
||||
/**
|
||||
* 是否显示模态框,请赋值给`show`
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 标题内容
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 模态框内容,如传入`slot`内容,则此参数无效
|
||||
*/
|
||||
content?: string
|
||||
/**
|
||||
* 确认按钮的文字
|
||||
* @default "确认"
|
||||
*/
|
||||
confirmText?: string
|
||||
/**
|
||||
* 取消按钮的文字
|
||||
* @default "取消"
|
||||
*/
|
||||
cancelText?: string
|
||||
/**
|
||||
* 是否显示确认按钮
|
||||
* @default true
|
||||
*/
|
||||
showConfirmButton?: boolean
|
||||
/**
|
||||
* 是否显示取消按钮
|
||||
* @default false
|
||||
*/
|
||||
showCancelButton?: boolean
|
||||
/**
|
||||
* 确认按钮的颜色
|
||||
* @default "#2979ff"
|
||||
*/
|
||||
confirmColor?: string
|
||||
/**
|
||||
* 取消按钮的颜色
|
||||
* @default "#606266"
|
||||
*/
|
||||
cancelColor?: string
|
||||
/**
|
||||
* 对调确认和取消的位置
|
||||
* @default false
|
||||
*/
|
||||
buttonReverse?: boolean
|
||||
/**
|
||||
* 是否开启缩放模式
|
||||
* @default true
|
||||
*/
|
||||
zoom?: boolean
|
||||
/**
|
||||
* 是否异步关闭,只对确定按钮有效
|
||||
* @default false
|
||||
*/
|
||||
asyncClose?: boolean
|
||||
/**
|
||||
* 是否允许点击遮罩关闭Modal(注意:关闭事件需要自行处理,只会在开启closeOnClickOverlay后点击遮罩层执行close回调)
|
||||
* @default false
|
||||
*/
|
||||
closeOnClickOverlay?: boolean
|
||||
/**
|
||||
* 往上偏移的值,给一个负的margin-top,往上偏移,避免和键盘重合的情况,单位任意,数值则默认为rpx单位
|
||||
* @default 0
|
||||
*/
|
||||
negativeTop?: string | number
|
||||
/**
|
||||
* modal宽度,不支持百分比,可以数值,px,rpx单位
|
||||
* @default "650rpx"
|
||||
*/
|
||||
width?: string | number
|
||||
/**
|
||||
* 确认按钮的样式,如设置,将不会显示取消按钮
|
||||
*/
|
||||
confirmButtonShape?: 'circle' | 'square'
|
||||
/**
|
||||
* 点击确认按钮时触发
|
||||
*/
|
||||
onConfirm?: () => any
|
||||
/**
|
||||
* 点击取消按钮时触发
|
||||
*/
|
||||
onCancel?: () => any
|
||||
/**
|
||||
* 点击遮罩关闭出发,closeOnClickOverlay为true有效
|
||||
*/
|
||||
onClose?: () => any
|
||||
}
|
||||
|
||||
declare interface ModalSlots {
|
||||
/**
|
||||
* 传入自定义内容,一般为富文本
|
||||
*/
|
||||
['default']?: () => any
|
||||
/**
|
||||
* 传入自定义按钮,用于在微信小程序弹窗通过按钮授权的场景
|
||||
*/
|
||||
['confirm-button']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Modal {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ModalProps
|
||||
$slots: ModalSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Modal: _Modal
|
||||
113
uview-plus/types/comps/navbar.d.ts
vendored
Normal file
113
uview-plus/types/comps/navbar.d.ts
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface NavbarProps {
|
||||
/**
|
||||
* 是否开启顶部安全区适配
|
||||
* @default true
|
||||
*/
|
||||
safeAreaInsetTop?: boolean
|
||||
/**
|
||||
* 固定在顶部时,是否生成一个等高元素,以防止塌陷
|
||||
* @default false
|
||||
*/
|
||||
placeholder?: boolean
|
||||
/**
|
||||
* 导航栏是否固定在顶部
|
||||
* @default true
|
||||
*/
|
||||
fixed?: boolean
|
||||
/**
|
||||
* 导航栏底部是否显示下边框
|
||||
* @default false
|
||||
*/
|
||||
border?: boolean
|
||||
/**
|
||||
* 左边返回图标的名称,只能为uView自带的图标
|
||||
* @default "arrow-left"
|
||||
*/
|
||||
leftIcon?: string
|
||||
/**
|
||||
* 左边的提示文字
|
||||
*/
|
||||
leftText?: string
|
||||
/**
|
||||
* 右边的提示文字
|
||||
*/
|
||||
rightText?: string
|
||||
/**
|
||||
* 右边返回图标的名称,只能为uView自带的图标
|
||||
*/
|
||||
rightIcon?: string
|
||||
/**
|
||||
* 导航栏标题,如设置为空字符,将会隐藏标题占位区域
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 导航栏背景设置
|
||||
* @default"#fff
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位rpx
|
||||
* @default "400rpx"
|
||||
*/
|
||||
titleWidth?: string | number
|
||||
/**
|
||||
* 导航栏高度(不包括状态栏高度在内,内部自动加上),单位px
|
||||
* @default "44px"
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 左侧返回图标的大小
|
||||
* @default "20px"
|
||||
*/
|
||||
leftIconSize?: string | number
|
||||
/**
|
||||
* 左侧返回图标的颜色
|
||||
* @default "#303133"
|
||||
*/
|
||||
leftIconColor?: string
|
||||
/**
|
||||
* 点击左侧区域(返回图标),是否自动返回上一页
|
||||
* @default false
|
||||
*/
|
||||
autoBack?: boolean
|
||||
/**
|
||||
* 标题的样式
|
||||
*/
|
||||
titleStyle?: unknown
|
||||
/**
|
||||
* 点击左侧区域
|
||||
*/
|
||||
onLeftClick?: () => any
|
||||
/**
|
||||
* 点击右侧区域
|
||||
*/
|
||||
onRightClick?: () => any
|
||||
}
|
||||
|
||||
declare interface NavbarSlots {
|
||||
/**
|
||||
* 自定义左侧部分内容
|
||||
*/
|
||||
['left']?: () => any
|
||||
/**
|
||||
* 自定义右侧部分内容
|
||||
*/
|
||||
['right']?: () => any
|
||||
/**
|
||||
* 自定义中部内容
|
||||
*/
|
||||
['center']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Navbar {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
NavbarProps
|
||||
$slots: NavbarSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Navbar: _Navbar
|
||||
40
uview-plus/types/comps/noNetwork.d.ts
vendored
Normal file
40
uview-plus/types/comps/noNetwork.d.ts
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface NoNetworkProps {
|
||||
/**
|
||||
* 没有网络时的提示语
|
||||
* @default "哎呀,网络信号丢失"
|
||||
*/
|
||||
tips?: string
|
||||
/**
|
||||
* 组件的`z-index`值
|
||||
* @default 10080
|
||||
*/
|
||||
zIndex?: string | number
|
||||
/**
|
||||
* 无网络的图片提示,可用的src地址或base64图片
|
||||
*/
|
||||
image?: string
|
||||
/**
|
||||
* 用户点击页面的"重试"按钮时触发
|
||||
*/
|
||||
onRetry?: () => any
|
||||
/**
|
||||
* "重试"后,有网络触发
|
||||
*/
|
||||
onConnected?: () => any
|
||||
/**
|
||||
* "重试"后,无网络触发
|
||||
*/
|
||||
onDisconnected?: () => any
|
||||
}
|
||||
|
||||
declare interface _NoNetwork {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
NoNetworkProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const NoNetwork: _NoNetwork
|
||||
85
uview-plus/types/comps/noticeBar.d.ts
vendored
Normal file
85
uview-plus/types/comps/noticeBar.d.ts
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface NoticeBarProps {
|
||||
/**
|
||||
* 显示的内容,direction为column时要求为数组, 为row时要求为字符串
|
||||
*/
|
||||
text?: string | string[]
|
||||
/**
|
||||
* 通告滚动模式,row-横向滚动,column-竖向滚动
|
||||
* @default "row"
|
||||
*/
|
||||
direction?: 'row' | 'column'
|
||||
/**
|
||||
* direction = row时,是否使用步进形式滚动
|
||||
* @default false
|
||||
*/
|
||||
step?: boolean
|
||||
/**
|
||||
* 是否显示左侧的音量图标
|
||||
* @default "volume"
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 通告模式,link-显示右箭头,closable-显示右侧关闭图标
|
||||
*/
|
||||
mode?: 'link' | 'closable'
|
||||
/**
|
||||
* 文字颜色
|
||||
* @default "#f9ae3d"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 背景颜色
|
||||
* @default "#fdf6ec"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 水平滚动时的滚动速度,即每秒滚动多少px(rpx),这有利于控制文字无论多少时,都能有一个恒定的速度
|
||||
* @default 80
|
||||
*/
|
||||
speed?: string | number
|
||||
/**
|
||||
* 字体大小
|
||||
* @default 14
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 滚动一个周期的时间长,单位ms
|
||||
* @default 2000
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 是否禁止用手滑动切换(目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序)
|
||||
* @default true
|
||||
*/
|
||||
disableTouch?: boolean
|
||||
/**
|
||||
* 跳转的页面路径
|
||||
*/
|
||||
url?: string
|
||||
/**
|
||||
* 页面跳转的类型
|
||||
* @default "navigateTo"
|
||||
*/
|
||||
linkType?: string
|
||||
/**
|
||||
* 点击通告文字触发
|
||||
* @param index 点击的text的索引
|
||||
*/
|
||||
onClick?: (index: number) => any
|
||||
/**
|
||||
* 点击右侧关闭图标触发
|
||||
*/
|
||||
onClose?: () => any
|
||||
}
|
||||
|
||||
declare interface _NoticeBar {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
NoticeBarProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const NoticeBar: _NoticeBar
|
||||
73
uview-plus/types/comps/notify.d.ts
vendored
Normal file
73
uview-plus/types/comps/notify.d.ts
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface NotifyProps {
|
||||
/**
|
||||
* 到顶部的距离
|
||||
* @default 0
|
||||
*/
|
||||
top?: string | number
|
||||
/**
|
||||
* 主题
|
||||
* @default "primary"
|
||||
*/
|
||||
type?: 'primary' | 'success' | 'warning' | 'error'
|
||||
/**
|
||||
* 字体颜色
|
||||
* @default "#fff"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 背景颜色
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 展示的文字内容
|
||||
*/
|
||||
message?: string
|
||||
/**
|
||||
* 展示时长,为0时不消失,单位ms
|
||||
* @default 3000
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 字体大小,单位rpx
|
||||
* @default 15
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 是否留出顶部安全距离(状态栏高度)
|
||||
* @default false
|
||||
*/
|
||||
safeAreaInsetTop?: boolean
|
||||
}
|
||||
|
||||
declare interface NotifySlots {
|
||||
/**
|
||||
* 通知内容
|
||||
*/
|
||||
['icon']?: () => any
|
||||
}
|
||||
|
||||
declare interface _NotifyRef {
|
||||
/**
|
||||
* 显示并加载配置
|
||||
*/
|
||||
show: (options: NotifyProps) => void
|
||||
/**
|
||||
* 关闭消息提示
|
||||
*/
|
||||
close: () => void
|
||||
}
|
||||
|
||||
declare interface _Notify {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
NotifyProps
|
||||
$slots: NotifySlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Notify: _Notify
|
||||
|
||||
export declare const NotifyRef: _NotifyRef
|
||||
155
uview-plus/types/comps/numberBox.d.ts
vendored
Normal file
155
uview-plus/types/comps/numberBox.d.ts
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface NumberBoxProps {
|
||||
/**
|
||||
* 步进器标识符,在change回调返回
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 用于双向绑定的值,初始化时设置设为默认min值(最小值)
|
||||
* @default 1
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 用户可输入的最小值
|
||||
* @default 1
|
||||
*/
|
||||
min?: string | number
|
||||
/**
|
||||
* 用户可输入的最大值
|
||||
* @default Number.MAX_SAFE_INTEGER
|
||||
*/
|
||||
max?: string | number
|
||||
/**
|
||||
* 步长,每次加或减的值, 支持小数值,如需小数
|
||||
* @default 1
|
||||
*/
|
||||
step?: string | number
|
||||
/**
|
||||
* 是否只能输入正整数
|
||||
* @default false
|
||||
*/
|
||||
integer?: boolean
|
||||
/**
|
||||
* 是否禁用操作,包括输入框,加减按钮
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 是否禁止输入框
|
||||
* @default false
|
||||
*/
|
||||
disabledInput?: boolean
|
||||
/**
|
||||
* 是否开启异步变更,开启后需要手动控制输入值
|
||||
* @default false
|
||||
*/
|
||||
asyncChange?: boolean
|
||||
/**
|
||||
* 输入框宽度,单位px
|
||||
* @default 35
|
||||
*/
|
||||
inputWidth?: string | number
|
||||
/**
|
||||
* 是否显示减少按钮
|
||||
* @default true
|
||||
*/
|
||||
showMinus?: boolean
|
||||
/**
|
||||
* 是否显示增加按钮
|
||||
* @default true
|
||||
*/
|
||||
showPlus?: boolean
|
||||
/**
|
||||
* 显示的小数位数
|
||||
*/
|
||||
decimalLength?: string | number
|
||||
/**
|
||||
* 是否允许长按进行加减
|
||||
* @default true
|
||||
*/
|
||||
longPress?: boolean
|
||||
/**
|
||||
* 输入框文字和加减按钮图标的颜色
|
||||
* @default "#323233"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
|
||||
* @default 30
|
||||
*/
|
||||
buttonSize?: string | number
|
||||
/**
|
||||
* 输入框和按钮的背景颜色
|
||||
* @default "#EBECEE"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 指定光标于键盘的距离,避免键盘遮挡输入框,单位px
|
||||
* @default 100
|
||||
*/
|
||||
cursorSpacing?: string | number
|
||||
/**
|
||||
* 是否禁用增加按钮
|
||||
* @default false
|
||||
*/
|
||||
disablePlus?: boolean
|
||||
/**
|
||||
* 是否禁用减少按钮
|
||||
* @default false
|
||||
*/
|
||||
disableMinus?: boolean
|
||||
/**
|
||||
* 加减按钮图标的样式
|
||||
*/
|
||||
iconStyle?: string
|
||||
/**
|
||||
* 输入框得到焦点触发(按钮可点击情况下)
|
||||
* @param value 输入框当前值
|
||||
* @param value 步进器标识符
|
||||
*/
|
||||
onFocus?: (value: any, name: any) => any
|
||||
/**
|
||||
* 输入框失去焦点时触发
|
||||
* @param value 输入框当前值
|
||||
* @param value 步进器标识符
|
||||
*/
|
||||
onBlur?: (value: any, name: any) => any
|
||||
/**
|
||||
* 输入框内容发生变化时触发
|
||||
* @param value 输入框当前值
|
||||
* @param value 步进器标识符
|
||||
*/
|
||||
onChange?: (value: any, name: any) => any
|
||||
/**
|
||||
* 超过范围阈值时触发
|
||||
* @type type 限制类型
|
||||
*/
|
||||
onOverlimit?: (type: 'minus' | 'plus') => any
|
||||
}
|
||||
|
||||
declare interface NumberBoxSlots {
|
||||
/**
|
||||
* 减少按钮
|
||||
*/
|
||||
['minus']?: () => any
|
||||
/**
|
||||
* 输入框
|
||||
*/
|
||||
['input']?: () => any
|
||||
/**
|
||||
* 增加按钮
|
||||
*/
|
||||
['plus']?: () => any
|
||||
}
|
||||
|
||||
declare interface _NumberBox {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
NumberBoxProps
|
||||
$slots: NumberBoxSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const NumberBox: _NumberBox
|
||||
46
uview-plus/types/comps/overlay.d.ts
vendored
Normal file
46
uview-plus/types/comps/overlay.d.ts
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface OverlayProps {
|
||||
/**
|
||||
* 是否显示遮罩
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* z-index 层级
|
||||
* @default 10070
|
||||
*/
|
||||
zIndex?: string | number
|
||||
/**
|
||||
* 动画时长,单位毫秒
|
||||
* @default 300
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 不透明度值,当做rgba的第四个参数
|
||||
* @default 0.5
|
||||
*/
|
||||
opacity?: string | number
|
||||
/**
|
||||
* 点击遮罩发送此事件
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface OverlaySlots {
|
||||
/**
|
||||
* 默认插槽,用于在遮罩层上方嵌入内容
|
||||
*/
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Overlay {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
OverlayProps
|
||||
$slots: OverlaySlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Overlay: _Overlay
|
||||
101
uview-plus/types/comps/parse.d.ts
vendored
Normal file
101
uview-plus/types/comps/parse.d.ts
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ParseProps {
|
||||
/**
|
||||
* 背景颜色,只适用与APP-PLUS-NVUE
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 要显示的富文本字符串
|
||||
*/
|
||||
content?: string
|
||||
/**
|
||||
* 是否允许外部链接被点击时自动复制
|
||||
*/
|
||||
copyLink?: string
|
||||
/**
|
||||
* 主域名,设置后将给链接自动拼接上主域名或协议名
|
||||
*/
|
||||
domain?: string
|
||||
/**
|
||||
* 图片出错时的占位图链接
|
||||
*/
|
||||
errorImg?: string
|
||||
/**
|
||||
* 是否开启图片懒加载,nvue不支持此属性
|
||||
* @default true
|
||||
*/
|
||||
lazyLoad?: boolean
|
||||
/**
|
||||
* 图片加载完成前的占位图
|
||||
*/
|
||||
loadingImg?: string
|
||||
/**
|
||||
* 是否在播放一个视频时自动暂停其它视频
|
||||
*/
|
||||
pauseVideo?: boolean
|
||||
/**
|
||||
* 是否开启图片被点击时自动预览
|
||||
* @default true
|
||||
*/
|
||||
previewImg?: boolean
|
||||
/**
|
||||
* 是否自动给 table 添加一个滚动层(使表格可以单独横向滚动)
|
||||
* @default false
|
||||
*/
|
||||
scrollTable?: boolean
|
||||
/**
|
||||
* 是否开启长按复制内容
|
||||
* @default false
|
||||
*/
|
||||
selectable?: boolean
|
||||
/**
|
||||
* 是否自动将 title 标签的内容设置到页面标题
|
||||
* @default true
|
||||
*/
|
||||
setTitle?: boolean
|
||||
/**
|
||||
* 是否开启图片被长按时显示菜单
|
||||
* @default true
|
||||
*/
|
||||
showImgMenu?: boolean
|
||||
/**
|
||||
* 设置标签的默认样式
|
||||
*/
|
||||
tagStyle?: unknown
|
||||
/**
|
||||
* 是否使用页面内锚点
|
||||
* @default false
|
||||
*/
|
||||
useAnchor?: boolean | number
|
||||
/**
|
||||
* dom 加载完成时触发
|
||||
*/
|
||||
onLoad?: () => any
|
||||
/**
|
||||
* 渲染完成时触发
|
||||
*/
|
||||
onReady?: (...args: any) => any
|
||||
/**
|
||||
* 出错时触发
|
||||
*/
|
||||
onError?: (...args: any) => any
|
||||
/**
|
||||
* 图片被点击时触发
|
||||
*/
|
||||
onImgTap?: (...args: any) => any
|
||||
/**
|
||||
* 在链接被点击时触发
|
||||
*/
|
||||
onLinkTap?: (...args: any) => any
|
||||
}
|
||||
|
||||
declare interface _Parse {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ParseProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Parse: _Parse
|
||||
115
uview-plus/types/comps/picker.d.ts
vendored
Normal file
115
uview-plus/types/comps/picker.d.ts
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface PickerProps {
|
||||
/**
|
||||
* 用于控制选择器的弹出与收起
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 是否显示顶部的操作栏
|
||||
* @default true
|
||||
*/
|
||||
showToolbar?: boolean
|
||||
/**
|
||||
* 顶部中间的标题
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 设置每一列的数据,详见[文档](https://www.uviewui.com/components/picker.html#%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8)
|
||||
*/
|
||||
columns?: any[]
|
||||
/**
|
||||
* 加载状态
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 各列中,单个选项的高度
|
||||
* @default 14
|
||||
*/
|
||||
itemHeight?: string | number
|
||||
/**
|
||||
* 取消按钮的文字
|
||||
* @default "取消"
|
||||
*/
|
||||
cancelText?: string
|
||||
/**
|
||||
* 确认按钮的文字
|
||||
* @default "确认"
|
||||
*/
|
||||
confirmText?: string
|
||||
/**
|
||||
* 取消按钮的颜色
|
||||
* @default "#909193"
|
||||
*/
|
||||
cancelColor?: string
|
||||
/**
|
||||
* 确认按钮的颜色
|
||||
* @default "#3c9cff"
|
||||
*/
|
||||
confirmColor?: string
|
||||
/**
|
||||
* 每列中可见选项的数量
|
||||
* @default 5
|
||||
*/
|
||||
visibleItemCount?: string | number
|
||||
/**
|
||||
* 自定义需要展示的`text`属性键名
|
||||
* @default "text"
|
||||
*/
|
||||
keyName?: string
|
||||
/**
|
||||
* 是否允许点击遮罩关闭选择器(注意:关闭事件需要自行处理,只会在开启closeOnClickOverlay后点击遮罩层执行close回调)
|
||||
* @default false
|
||||
*/
|
||||
closeOnClickOverlay?: boolean
|
||||
/**
|
||||
* 各列的默认索引
|
||||
*/
|
||||
defaultIndex?: any[]
|
||||
/**
|
||||
* 是否在手指松开时立即触发`change`事件。若不开启则会在滚动动画结束后触发`change`事件,只在微信`2.21.1`及以上有效
|
||||
* @default false
|
||||
*/
|
||||
immediateChange?: boolean
|
||||
/**
|
||||
* 关闭选择器时触发
|
||||
*/
|
||||
onClose?: () => any
|
||||
/**
|
||||
* 点击确定按钮,返回当前选择的值
|
||||
*/
|
||||
onConfirm?: (...args: any) => any
|
||||
/**
|
||||
* 当选择值变化时触发
|
||||
*/
|
||||
onChange?: (...args: any) => any
|
||||
/**
|
||||
* 点击取消按钮
|
||||
*/
|
||||
onCancel?: () => any
|
||||
}
|
||||
|
||||
declare interface _PickerRef {
|
||||
/**
|
||||
* 设置对应列的选择值
|
||||
*/
|
||||
setIndexs: (index, setLastIndex) => any
|
||||
/**
|
||||
* 多列联动时需要用到,详见[文档](https://www.uviewui.com/components/picker.html#%E5%A4%9A%E5%88%97%E6%A8%A1%E5%BC%8F%E4%B8%8E%E5%A4%9A%E5%88%97%E8%81%94%E5%8A%A8)
|
||||
*/
|
||||
setColumnValues: (...args: any) => any
|
||||
}
|
||||
|
||||
declare interface _Picker {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
PickerProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Picker: _Picker
|
||||
|
||||
export declare const PickerRef: _PickerRef
|
||||
103
uview-plus/types/comps/popup.d.ts
vendored
Normal file
103
uview-plus/types/comps/popup.d.ts
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface PopupProps {
|
||||
/**
|
||||
* 是否展示弹窗
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 是否显示遮罩
|
||||
* @default true
|
||||
*/
|
||||
overlay?: boolean
|
||||
/**
|
||||
* 弹出方向
|
||||
* @default 'bottom'
|
||||
*/
|
||||
mode?: 'top' | 'right' | 'left'| 'bottom' | 'center'
|
||||
/**
|
||||
* 遮罩打开或收起的动画过渡时间,单位ms
|
||||
* @default 300
|
||||
*/
|
||||
duration?: number
|
||||
/**
|
||||
* 是否显示关闭图标
|
||||
* @default false
|
||||
*/
|
||||
closeable?: boolean
|
||||
/**
|
||||
* 遮罩自定义样式,一般用于修改遮罩颜色,如:{background: 'rgba(3, 100, 219, 0.5)'}
|
||||
*/
|
||||
overlayStyle?: unknown
|
||||
/**
|
||||
* 遮罩透明度,0-1之间,勿与overlayStyle共用
|
||||
* @default 0.5
|
||||
*/
|
||||
overlayOpacity?: number | string
|
||||
/**
|
||||
* 点击遮罩是否关闭弹窗(注意:关闭事件需要自行处理,只会在开启closeOnClickOverlay后点击遮罩层执行close回调)
|
||||
* @default true
|
||||
*/
|
||||
closeOnClickOverlay?: boolean
|
||||
/**
|
||||
* 弹出层的z-index值
|
||||
* @default 10075
|
||||
*/
|
||||
zIndex?: number | string
|
||||
/**
|
||||
* 是否为留出底部安全距离
|
||||
* @default true
|
||||
*/
|
||||
safeAreaInsetBottom?: boolean
|
||||
/**
|
||||
* 是否留出顶部安全距离(状态栏高度)
|
||||
* @default false
|
||||
*/
|
||||
safeAreaInsetTop?: boolean
|
||||
/**
|
||||
* 自定义关闭图标位置,top-left为左上角,top-right为右上角,bottom-left为左下角,bottom-right为右下角
|
||||
*/
|
||||
closeIconPos?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
||||
/**
|
||||
* 设置圆角值,仅对mode = top | bottom | center有效
|
||||
* @default 0
|
||||
*/
|
||||
round?: number | string
|
||||
/**
|
||||
* 当mode=center时 是否开启缩放
|
||||
* @default true
|
||||
*/
|
||||
zoom?: boolean
|
||||
/**
|
||||
* 背景色,一般用于特殊弹窗内容场景,设置为transparent可去除默认的白色背景
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 用户自定义样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
/**
|
||||
* 弹出层打开
|
||||
*/
|
||||
onOpen?: () => any
|
||||
/**
|
||||
* 弹出层收起
|
||||
*/
|
||||
onClose?: () => any
|
||||
}
|
||||
|
||||
declare interface PopupSlots {
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Popup {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
PopupProps
|
||||
$slots: PopupSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Popup: _Popup
|
||||
77
uview-plus/types/comps/radio.d.ts
vendored
Normal file
77
uview-plus/types/comps/radio.d.ts
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface RadioProps {
|
||||
/**
|
||||
* checkbox的名称
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 形状,square为方形,circle为圆型
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'square' | 'circle'
|
||||
/**
|
||||
* 是否禁用
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 是否禁止点击提示语选中复选框
|
||||
*/
|
||||
labelDisabled?: string | boolean
|
||||
/**
|
||||
* 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 未选中的颜色
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 图标的大小,单位px
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* label的字体大小,px单位
|
||||
*/
|
||||
labelSize?: string | number
|
||||
/**
|
||||
* label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
|
||||
*/
|
||||
label?: string | number
|
||||
/**
|
||||
* 整体的大小
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 图标颜色
|
||||
*/
|
||||
iconColor?: string
|
||||
/**
|
||||
* label的颜色
|
||||
*/
|
||||
labelColor?: string
|
||||
/**
|
||||
* 某个`radio`状态发生变化时触发(选中状态)
|
||||
* @param name 通过`props`传递的`name`值
|
||||
*/
|
||||
onChange?: (name: string) => any
|
||||
}
|
||||
|
||||
declare interface RadioSlots {
|
||||
/**
|
||||
* 自定义修改label内容
|
||||
*/
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Radio {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
RadioProps
|
||||
$slots: RadioSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Radio: _Radio
|
||||
97
uview-plus/types/comps/radioGroup.d.ts
vendored
Normal file
97
uview-plus/types/comps/radioGroup.d.ts
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface RadioGroupProps {
|
||||
/**
|
||||
* 绑定的值
|
||||
*/
|
||||
value?: string | number | boolean
|
||||
/**
|
||||
* 是否禁用全部checkbox
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 形状,circle-圆形,square-方形
|
||||
* @default "circle"
|
||||
*/
|
||||
shape?: 'circle' | 'square'
|
||||
/**
|
||||
* 选中状态下的颜色,如子`Checkbox`组件设置此值,将会覆盖本值
|
||||
* @default "#2979ff"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 未选中的颜色
|
||||
* @default "#c8c9cc"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 标识符
|
||||
*/
|
||||
name?: string
|
||||
/**
|
||||
* 整个组件的尺寸,默认px
|
||||
* @default 18
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 布局方式,row-横向,column-纵向
|
||||
* @default "row"
|
||||
*/
|
||||
placement?: 'row' | 'column'
|
||||
/**
|
||||
* 文本
|
||||
*/
|
||||
label?: string
|
||||
/**
|
||||
* label的字体颜色
|
||||
* @default "#303133"
|
||||
*/
|
||||
labelColor?: string
|
||||
/**
|
||||
* label的字体大小,px单位
|
||||
* @default 14
|
||||
*/
|
||||
labelSize?: string | number
|
||||
/**
|
||||
* 是否禁止点击文本操作
|
||||
* @default false
|
||||
*/
|
||||
labelDisabled?: boolean
|
||||
/**
|
||||
* 图标颜色
|
||||
* @default "#fff"
|
||||
*/
|
||||
iconColor?: string
|
||||
/**
|
||||
* 图标的大小,单位px
|
||||
* @default 12
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* 竖向配列时,是否显示下划线
|
||||
* @default false
|
||||
*/
|
||||
borderBottom?: boolean
|
||||
/**
|
||||
* 勾选图标的对齐方式,left-左边,right-右边
|
||||
* @default "left"
|
||||
*/
|
||||
iconPlacement?: 'left' | 'right'
|
||||
/**
|
||||
* 任一个`radio`状态发生变化时触发
|
||||
* @param name 值为`radio`通过`props`传递的`name`值
|
||||
*/
|
||||
onChange?: (name: string) => any
|
||||
}
|
||||
|
||||
declare interface _RadioGroup {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
RadioGroupProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const RadioGroup: _RadioGroup
|
||||
85
uview-plus/types/comps/rate.d.ts
vendored
Normal file
85
uview-plus/types/comps/rate.d.ts
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface RateProps {
|
||||
/**
|
||||
* 双向绑定选择星星的数量
|
||||
* @default 1
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 最多可选的星星数量
|
||||
* @default 5
|
||||
*/
|
||||
count?: string | number
|
||||
/**
|
||||
* 是否禁止用户操作
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 是否只读
|
||||
* @default false
|
||||
*/
|
||||
readonly?: boolean
|
||||
/**
|
||||
* 星星的大小,单位rpx
|
||||
* @default 18
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 未选中星星的颜色
|
||||
* @default "#b2b2b2"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 选中的星星颜色
|
||||
* @default "#FA3534"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 星星之间的距离
|
||||
* @default 4
|
||||
*/
|
||||
gutter?: string | number
|
||||
/**
|
||||
* 最少选中星星的个数
|
||||
* @default 1
|
||||
*/
|
||||
minCount?: string | number
|
||||
/**
|
||||
* 是否允许半星选择
|
||||
* @default false
|
||||
*/
|
||||
allowHalf?: boolean
|
||||
/**
|
||||
* 选中时的图标名,只能为uView的内置图标
|
||||
* @default "star-fill"
|
||||
*/
|
||||
activeIcon?: string
|
||||
/**
|
||||
* 未选中时的图标名,只能为uView的内置图标
|
||||
* @default "star"
|
||||
*/
|
||||
inactiveIcon?: string
|
||||
/**
|
||||
* 是否可以通过滑动手势选择评分
|
||||
* @default true
|
||||
*/
|
||||
touchable?: boolean
|
||||
/**
|
||||
* 选中的星星发生变化时触发
|
||||
* @param value 当前选中的星星的数量
|
||||
*/
|
||||
onChange?: (value: number) => any
|
||||
}
|
||||
|
||||
declare interface _Rate {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
RateProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Rate: _Rate
|
||||
80
uview-plus/types/comps/readMore.d.ts
vendored
Normal file
80
uview-plus/types/comps/readMore.d.ts
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ReadMoreProps {
|
||||
/**
|
||||
* 内容超出此高度才会显示展开全文按钮,单位rpx
|
||||
* @default 400
|
||||
*/
|
||||
showHeight?: string | number
|
||||
/**
|
||||
* 展开后是否显示收起按钮
|
||||
* @default false
|
||||
*/
|
||||
toggle?: boolean
|
||||
/**
|
||||
* 关闭时的提示文字
|
||||
* @default "展开阅读全文"
|
||||
*/
|
||||
closeText?: string
|
||||
/**
|
||||
* 展开时的提示文字
|
||||
* @default "收起"
|
||||
*/
|
||||
openText?: string
|
||||
/**
|
||||
* 提示文字的颜色
|
||||
* @default "#2979ff"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 提示文字的大小,默认单位px
|
||||
* @default 14
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 对阴影的自定义处理
|
||||
*/
|
||||
shadowStyle?: {
|
||||
backgroundImage?: string
|
||||
paddingTop?: string
|
||||
marginTop?: string
|
||||
}
|
||||
/**
|
||||
* 段落首行缩进的字符个数
|
||||
* @default "2em"
|
||||
*/
|
||||
textIndent?: string
|
||||
/**
|
||||
* 用于在`open`和`close`事件中当作回调参数返回
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 内容被展开时触发
|
||||
* @param name props中传入的`name`参数值
|
||||
*/
|
||||
onOpen?: (name: any) => any
|
||||
/**
|
||||
* 内容被收起时触发
|
||||
* @param name props中传入的`name`参数值
|
||||
*/
|
||||
onClose?: (name: any) => any
|
||||
}
|
||||
|
||||
declare interface _ReadMoreRef {
|
||||
/**
|
||||
* 重新初始化组件内部高度计算过程,如果内嵌u-parse组件时可能需要用到
|
||||
*/
|
||||
init: () => void
|
||||
}
|
||||
|
||||
declare interface _ReadMore {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ReadMoreProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const ReadMore: _ReadMore
|
||||
|
||||
export declare const ReadMoreRef: _ReadMoreRef
|
||||
34
uview-plus/types/comps/row.d.ts
vendored
Normal file
34
uview-plus/types/comps/row.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface RowProps {
|
||||
/**
|
||||
* 栅格间隔,左右各为此值的一半,单位任意
|
||||
* @default 0
|
||||
*/
|
||||
gutter?: string | number
|
||||
/**
|
||||
* 水平排列方式(微信小程序暂不支持)
|
||||
* @default "start"
|
||||
*/
|
||||
justify?: 'start' | 'flex-start' | 'end' | 'flex-end' | 'center' | 'around' | 'space-around' | 'between' | 'space-between'
|
||||
/**
|
||||
* 垂直排列方式
|
||||
* @default "center"
|
||||
*/
|
||||
align?: 'top' | 'center' | 'bottom'
|
||||
/**
|
||||
* 点击触发事件
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface _Row {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
RowProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Row: _Row
|
||||
16
uview-plus/types/comps/safeBottom.d.ts
vendored
Normal file
16
uview-plus/types/comps/safeBottom.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface SafeBottomProps {
|
||||
/**
|
||||
* 定义需要用到的外部样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
}
|
||||
|
||||
declare interface _SafeBottom {
|
||||
new (): {
|
||||
$props: AllowedComponentProps & VNodeProps & SafeBottomProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const SafeBottom: _SafeBottom
|
||||
51
uview-plus/types/comps/scrollList.d.ts
vendored
Normal file
51
uview-plus/types/comps/scrollList.d.ts
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ScrollListProps {
|
||||
/**
|
||||
* 指示器的整体宽度
|
||||
* @default 50
|
||||
*/
|
||||
indicatorWidth?: string | number
|
||||
/**
|
||||
* 滑块的宽度
|
||||
* @default 20
|
||||
*/
|
||||
indicatorBarWidth?: string | number
|
||||
/**
|
||||
* 是否显示面板指示器
|
||||
* @default true
|
||||
*/
|
||||
indicator?: boolean
|
||||
/**
|
||||
* 指示器非激活颜色
|
||||
* @default "#f2f2f2"
|
||||
*/
|
||||
indicatorColor?: string
|
||||
/**
|
||||
* 指示器滑块颜色
|
||||
* @default "#3c9cff"
|
||||
*/
|
||||
indicatorActiveColor?: string
|
||||
/**
|
||||
* 指示器样式,可通过bottom,left,right进行定位
|
||||
*/
|
||||
indicatorStyle: string | Record<string, any>
|
||||
/**
|
||||
* 滑动到左边时触发
|
||||
*/
|
||||
onLeft?: () => any
|
||||
/**
|
||||
* 滑动到右边时触发
|
||||
*/
|
||||
onRight?: () => any
|
||||
}
|
||||
|
||||
declare interface _ScrollList {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ScrollListProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const ScrollList: _ScrollList
|
||||
167
uview-plus/types/comps/search.d.ts
vendored
Normal file
167
uview-plus/types/comps/search.d.ts
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface SearchProps {
|
||||
/**
|
||||
* 双向绑定输入框搜索值
|
||||
*/
|
||||
['v-model']?: string
|
||||
/**
|
||||
* 搜索框形状,round-圆形,square-方形
|
||||
* @default "round"
|
||||
*/
|
||||
shape?: 'round' | 'square'
|
||||
/**
|
||||
* 搜索框背景颜色
|
||||
* @default "#f2f2f2"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 占位文字内容
|
||||
* @default "请输入关键字"
|
||||
*/
|
||||
placeholder?: string
|
||||
/**
|
||||
* 是否启用清除控件
|
||||
* @default true
|
||||
*/
|
||||
clearabled?: boolean
|
||||
/**
|
||||
* 是否自动获得焦点
|
||||
* @default false
|
||||
*/
|
||||
focus?: boolean
|
||||
/**
|
||||
* 是否显示右侧控件(右侧的"搜索"按钮)
|
||||
* @default true
|
||||
*/
|
||||
showAction?: boolean
|
||||
/**
|
||||
* 右侧控件的样式,对象形式
|
||||
*/
|
||||
actionStyle?: unknown
|
||||
/**
|
||||
* 右侧控件文字
|
||||
* @default "搜索"
|
||||
*/
|
||||
actionText?: string
|
||||
/**
|
||||
* 输入框内容水平对齐方式
|
||||
* @default "left"
|
||||
*/
|
||||
inputAlign?: 'left' | 'center' |'right'
|
||||
/**
|
||||
* 自定义输入框样式,对象形式
|
||||
*/
|
||||
inputStyle?: unknown
|
||||
/**
|
||||
* 是否启用输入框
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 边框颜色,配置了颜色,才会有边框
|
||||
* @default "transparent"
|
||||
*/
|
||||
borderColor?: string
|
||||
/**
|
||||
* 搜索图标的颜色,默认同输入框字体颜色
|
||||
* @default "#909399"
|
||||
*/
|
||||
searchIconColor?: string
|
||||
/**
|
||||
* 搜索图标的大小
|
||||
* @default 22
|
||||
*/
|
||||
searchIconSize?: number
|
||||
/**
|
||||
* 输入框字体颜色
|
||||
* @default "#606266"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* placeholder的颜色
|
||||
* @default "#909399"
|
||||
*/
|
||||
placeholderColor?: string
|
||||
/**
|
||||
* 输入框左边的图标,可以为uView图标名称或图片路径
|
||||
* @default "search"
|
||||
*/
|
||||
searchIcon?: string
|
||||
/**
|
||||
* 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30rpx"、"30rpx 20rpx"等写法
|
||||
* @default "0"
|
||||
*/
|
||||
margin?: string
|
||||
/**
|
||||
* 是否开启动画,详见[文档](https://www.uviewui.com/components/search.html#%E6%98%AF%E5%90%A6%E5%BC%80%E5%90%AF%E5%8F%B3%E8%BE%B9%E6%8E%A7%E4%BB%B6)
|
||||
* @default false
|
||||
*/
|
||||
animation?: boolean
|
||||
/**
|
||||
* 输入框初始值
|
||||
*/
|
||||
value?: string
|
||||
/**
|
||||
* 输入框最大能输入的长度,-1为不限制长度
|
||||
* @default -1
|
||||
*/
|
||||
maxlength?: string | number
|
||||
/**
|
||||
* 输入框高度,单位rpx
|
||||
* @default 64
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 搜索左侧文本信息
|
||||
*/
|
||||
label?: string | number
|
||||
/**
|
||||
* 输入框内容发生变化时触发
|
||||
* @param value 输入框的值
|
||||
*/
|
||||
onChange?: (value: any) => any
|
||||
/**
|
||||
* 用户确定搜索时触发,用户按回车键,或者手机键盘右下角的"搜索"键时触发
|
||||
* @param value 输入框的值
|
||||
*/
|
||||
onSearch?: (value: any) => any
|
||||
/**
|
||||
* 用户点击右侧控件时触发
|
||||
* @param value 输入框的值
|
||||
*/
|
||||
onCustom?: (value: any) => any
|
||||
/**
|
||||
* 输入框失去焦点时触发
|
||||
* @param value 输入框的值
|
||||
*/
|
||||
onBlur?: (value: any) => any
|
||||
/**
|
||||
* 输入框获得焦点时触发
|
||||
* @param value 输入框的值
|
||||
*/
|
||||
onFocus?: (value: any) => any
|
||||
/**
|
||||
* 配置了`clearabled`后,清空内容时会发出此事件
|
||||
*/
|
||||
onClear?: () => any
|
||||
/**
|
||||
* `disabled`为`true`时,点击输入框,发出此事件,用于跳转搜索页
|
||||
*/
|
||||
onClick?: () => any
|
||||
/**
|
||||
* 左侧icon点击时候时触发
|
||||
*/
|
||||
onClickIcon?: () => any
|
||||
}
|
||||
|
||||
declare interface _Search {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SearchProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Search: _Search
|
||||
70
uview-plus/types/comps/skeleton.d.ts
vendored
Normal file
70
uview-plus/types/comps/skeleton.d.ts
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface SkeletonProps {
|
||||
/**
|
||||
* 是否显示骨架占位图,设置为`false`将会展示子组件内容
|
||||
* @default true
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 是否开启动画效果
|
||||
* @default true
|
||||
*/
|
||||
animate?: boolean
|
||||
/**
|
||||
* 段落占位图行数
|
||||
* @default 0
|
||||
*/
|
||||
rows?: string | number
|
||||
/**
|
||||
* 段落占位图的宽度,可以为百分比,数值,带单位字符串等,可通过数组传入指定每个段落行的宽度
|
||||
* @default "100%"
|
||||
*/
|
||||
rowsWidth?: string | number | any[]
|
||||
/**
|
||||
* 段落的高度
|
||||
* @default 18
|
||||
*/
|
||||
rowsHeight?: string | number | any[]
|
||||
/**
|
||||
* 是否展示标题占位图
|
||||
* @default true
|
||||
*/
|
||||
title?: boolean
|
||||
/**
|
||||
* 标题的宽度
|
||||
* @default "50%"
|
||||
*/
|
||||
titleWidth?: string | number
|
||||
/**
|
||||
* 标题的高度
|
||||
* @default 18
|
||||
*/
|
||||
titleHeight?: string | number
|
||||
/**
|
||||
* 是否展示头像占位图
|
||||
* @default false
|
||||
*/
|
||||
avatar?: boolean
|
||||
/**
|
||||
* 头像占位图大小
|
||||
* @default 32
|
||||
*/
|
||||
avatarSize?: string | number
|
||||
/**
|
||||
* 头像占位图的形状
|
||||
* @default "circle"
|
||||
*/
|
||||
avatarShape?: 'circle' | 'square'
|
||||
}
|
||||
|
||||
declare interface _Skeleton {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SkeletonProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Skeleton: _Skeleton
|
||||
79
uview-plus/types/comps/slider.d.ts
vendored
Normal file
79
uview-plus/types/comps/slider.d.ts
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface SliderProps {
|
||||
/**
|
||||
* 双向绑定滑块选择值
|
||||
* @default 0
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 滑块的大小
|
||||
* @default 18
|
||||
*/
|
||||
blockSize?: string | number
|
||||
/**
|
||||
* 可选的最小值(0-100之间)
|
||||
* @default 1
|
||||
*/
|
||||
min?: string | number
|
||||
/**
|
||||
* 可选的最大值(0-100之间)
|
||||
* @default 100
|
||||
*/
|
||||
max?: string | number
|
||||
/**
|
||||
* 选择的步长
|
||||
* @default 1
|
||||
*/
|
||||
step?: string | number
|
||||
/**
|
||||
* 进度条的激活部分颜色
|
||||
* @default "#2979ff"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 进度条的背景颜色
|
||||
* @default "#c0c4cc"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 滑块背景颜色
|
||||
* @default "#ffffff"
|
||||
*/
|
||||
blockColor?: string
|
||||
/**
|
||||
* 是否显示当前 value
|
||||
* @default false
|
||||
*/
|
||||
showValue?: boolean
|
||||
/**
|
||||
* 滑块按钮自定义样式
|
||||
*/
|
||||
blockStyle?: unknown
|
||||
/**
|
||||
* 更新v-model的
|
||||
* @param value 当前值
|
||||
*/
|
||||
onInput?: (value: any) => any
|
||||
/**
|
||||
* 触发事件(拖动过程中)
|
||||
* @param value 当前值
|
||||
*/
|
||||
onChanging?: (value: any) => any
|
||||
/**
|
||||
* 触发事件
|
||||
* @param value 当前值
|
||||
*/
|
||||
onChange?: (value: any) => any
|
||||
}
|
||||
|
||||
declare interface _Slider {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SliderProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Slider: _Slider
|
||||
22
uview-plus/types/comps/statusBar.d.ts
vendored
Normal file
22
uview-plus/types/comps/statusBar.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface StatusBarProps {
|
||||
|
||||
/**
|
||||
* 背景色
|
||||
*/
|
||||
bgColor?: string
|
||||
|
||||
/**
|
||||
* 定义需要用到的外部样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
}
|
||||
|
||||
declare interface _StatusBar {
|
||||
new (): {
|
||||
$props: AllowedComponentProps & VNodeProps & StatusBarProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const StatusBar: _StatusBar
|
||||
48
uview-plus/types/comps/steps.d.ts
vendored
Normal file
48
uview-plus/types/comps/steps.d.ts
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface StepsProps {
|
||||
/**
|
||||
* 方向
|
||||
* @default "row"
|
||||
*/
|
||||
direction?: 'row' | 'column'
|
||||
/**
|
||||
* 设置当前处于第几步
|
||||
* @default 0
|
||||
*/
|
||||
current?: number | string
|
||||
/**
|
||||
* 激活状态颜色
|
||||
* @default "#3c9cff"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 未激活状态颜色
|
||||
* @default "#969799"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 激活状态的图标
|
||||
*/
|
||||
activeIcon?: string
|
||||
/**
|
||||
* 未激活状态图标
|
||||
*/
|
||||
inactiveIcon?: string
|
||||
/**
|
||||
* 是否显示点类型
|
||||
* @default false
|
||||
*/
|
||||
dot?: boolean
|
||||
}
|
||||
|
||||
declare interface _Steps {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
StepsProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Steps: _Steps
|
||||
41
uview-plus/types/comps/stepsItem.d.ts
vendored
Normal file
41
uview-plus/types/comps/stepsItem.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface StepsItemProps {
|
||||
/**
|
||||
* 标题文字
|
||||
*/
|
||||
title?: string
|
||||
/**
|
||||
* 描述文本
|
||||
*/
|
||||
current?: string
|
||||
/**
|
||||
* 图标大小
|
||||
* @default 17
|
||||
*/
|
||||
iconSize?: string | number
|
||||
/**
|
||||
* 当前步骤是否处于失败状态
|
||||
* @default false
|
||||
*/
|
||||
error?: boolean
|
||||
}
|
||||
|
||||
declare interface StepsItemSlots {
|
||||
/**
|
||||
* 自定步骤状态内容
|
||||
*/
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _StepsItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
StepsItemProps
|
||||
$slots: StepsItemSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const StepsItem: _StepsItem
|
||||
48
uview-plus/types/comps/sticky.d.ts
vendored
Normal file
48
uview-plus/types/comps/sticky.d.ts
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface StickyProps {
|
||||
/**
|
||||
* 吸顶时与顶部的距离,单位rpx
|
||||
* @default 0
|
||||
*/
|
||||
offsetTop?: string | number
|
||||
/**
|
||||
* 导航栏高度,自定义导航栏时,需要传入此值
|
||||
* @default 0
|
||||
*/
|
||||
customNavHeight?: string | number
|
||||
/**
|
||||
* 是否禁用吸顶功能
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 组件背景颜色
|
||||
* @default #ffffff
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 吸顶时的z-index值,NVUE无效
|
||||
*/
|
||||
zIndex?: string | number
|
||||
/**
|
||||
* 自定义标识,用于区分是哪一个组件
|
||||
*/
|
||||
index?: string | number
|
||||
}
|
||||
|
||||
declare interface StickySlots {
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _Sticky {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
StickyProps
|
||||
$slots: StickySlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Sticky: _Sticky
|
||||
64
uview-plus/types/comps/subsection.d.ts
vendored
Normal file
64
uview-plus/types/comps/subsection.d.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
|
||||
declare interface SubsectionProps {
|
||||
/**
|
||||
* 选项的数组
|
||||
*/
|
||||
list?: any[]
|
||||
/**
|
||||
* 初始化时默认选中的选项索引值
|
||||
* @default 0
|
||||
*/
|
||||
current?: string | number
|
||||
/**
|
||||
* 激活时的颜色
|
||||
* @default "#3c9cff"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 未激活时的颜色
|
||||
* @default "#303133"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 模式选择
|
||||
* @default "button"
|
||||
*/
|
||||
mode?: 'button' | 'subsection'
|
||||
/**
|
||||
* 字体大小,单位px
|
||||
* @default 12
|
||||
*/
|
||||
fontSize?: string | number
|
||||
/**
|
||||
* 激活选项的字体是否加粗
|
||||
* @default true
|
||||
*/
|
||||
bold?: boolean
|
||||
/**
|
||||
* 组件背景颜色,`mode`为`button`时有效
|
||||
* @default "#eeeeef"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 从`list`元素对象中读取的键名
|
||||
* @default "name"
|
||||
*/
|
||||
keyName?: string
|
||||
/**
|
||||
* 分段器选项发生改变时触发
|
||||
* @param index 选项的index索引值,从0开始
|
||||
*/
|
||||
onChange?: (index: number) => any
|
||||
}
|
||||
|
||||
declare interface _Subsection {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SubsectionProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Subsection: _Subsection
|
||||
24
uview-plus/types/comps/swipeAction.d.ts
vendored
Normal file
24
uview-plus/types/comps/swipeAction.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface SwipeActionProps {
|
||||
/**
|
||||
* 是否自动关闭其他swipe按钮组
|
||||
* @default true
|
||||
*/
|
||||
autoClose?: boolean
|
||||
/**
|
||||
* 点击组件时触发
|
||||
* @param index 索引
|
||||
*/
|
||||
onClick?: (index: number) => any
|
||||
}
|
||||
|
||||
declare interface _SwipeAction {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SwipeActionProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const SwipeAction: _SwipeAction
|
||||
58
uview-plus/types/comps/swipeActionItem.d.ts
vendored
Normal file
58
uview-plus/types/comps/swipeActionItem.d.ts
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface SwipeActionItemProps {
|
||||
/**
|
||||
* 控制打开或者关闭
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 标识符,如果是v-for,可用index索引
|
||||
*/
|
||||
index?: string | number
|
||||
/**
|
||||
* 是否禁用
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 是否自动关闭其他swipe按钮组
|
||||
* @default true
|
||||
*/
|
||||
autoClose?: boolean
|
||||
/**
|
||||
* 滑动距离阈值,只有大于此值,才被认为是要打开菜单
|
||||
* @default 20
|
||||
*/
|
||||
threshold?: number
|
||||
/**
|
||||
* 右侧按钮内容
|
||||
*/
|
||||
options?: any[]
|
||||
/**
|
||||
* 动画过渡时间,单位ms
|
||||
* @default 300
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 标识符,如果是v-for,可用index索引值
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 按钮被点击时触发
|
||||
* @param name props参数`name`的值
|
||||
* @param index 第几个按钮被点击
|
||||
*/
|
||||
onClick?: (name: any, index: number) => any
|
||||
}
|
||||
|
||||
|
||||
declare interface _SwipeActionItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SwipeActionItemProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const SwipeActionItem: _SwipeActionItem
|
||||
142
uview-plus/types/comps/swiper.d.ts
vendored
Normal file
142
uview-plus/types/comps/swiper.d.ts
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
import { ImageMode } from './image'
|
||||
|
||||
declare interface SwiperProps {
|
||||
/**
|
||||
* 轮播图数据
|
||||
*/
|
||||
list?: any[]
|
||||
/**
|
||||
* 是否显示面板指示器
|
||||
* @default false
|
||||
*/
|
||||
indicator?: boolean
|
||||
/**
|
||||
* 指示器激活的颜色
|
||||
* @default "#fff"
|
||||
*/
|
||||
indicatorActiveColor?: string
|
||||
/**
|
||||
* 指示器非激活颜色
|
||||
* @default "rgba(255, 255, 255, 0.35)"
|
||||
*/
|
||||
indicatorInactiveColor?: string
|
||||
/**
|
||||
* 指示器样式,可通过bottom,left,right进行定位
|
||||
*/
|
||||
indicatorStyle?: string | Record<string, any>
|
||||
/**
|
||||
* 指示器模式
|
||||
* @default "line"
|
||||
*/
|
||||
indicatorMode?: 'line' | 'dot'
|
||||
/**
|
||||
* 是否自动切换
|
||||
* @default true
|
||||
*/
|
||||
autoplay?: boolean
|
||||
/**
|
||||
* 当前所在滑块的 index
|
||||
* @default 0
|
||||
*/
|
||||
current?: string | number
|
||||
/**
|
||||
* 当前所在滑块的 item-id ,不能与 current 被同时指定
|
||||
*/
|
||||
currentItemId?: string
|
||||
/**
|
||||
* 滑块自动切换时间间隔(ms)
|
||||
* @default 3000
|
||||
*/
|
||||
interval?: string | number
|
||||
/**
|
||||
* 滑块切换过程所需时间(ms),nvue不支持
|
||||
* @default 300
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 播放到末尾后是否重新回到开头
|
||||
* @default false
|
||||
*/
|
||||
circular?: boolean
|
||||
/**
|
||||
* 前边距,可用于露出前一项的一小部分,nvue和支付宝不支持
|
||||
* @default 0
|
||||
*/
|
||||
previousMargin?: string | number
|
||||
/**
|
||||
* 后边距,可用于露出后一项的一小部分,nvue和支付宝不支持
|
||||
* @default 0
|
||||
*/
|
||||
nextMargin?: string | number
|
||||
/**
|
||||
* 当开启时,会根据滑动速度,连续滑动多屏,支付宝不支持
|
||||
* @default false
|
||||
*/
|
||||
acceleration?: boolean
|
||||
/**
|
||||
* 同时显示的滑块数量,nvue、支付宝小程序不支持
|
||||
* @default 1
|
||||
*/
|
||||
displayMultipleItems?: number
|
||||
/**
|
||||
* 指定swiper切换缓动动画类型, 只对微信小程序有效
|
||||
* @default "default"
|
||||
*/
|
||||
easingFunction?: 'default' | 'linear' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic'
|
||||
/**
|
||||
* list数组中指定对象的目标属性名
|
||||
* @default "url"
|
||||
*/
|
||||
keyName?: string
|
||||
/**
|
||||
* 裁剪模式
|
||||
* @default "aspectFill"
|
||||
*/
|
||||
imgMode?: ImageMode
|
||||
/**
|
||||
* 组件高度
|
||||
* @default 130
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 背景颜色
|
||||
* @default "#f3f4f6"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 组件圆角,数值或带单位的字符串
|
||||
* @default 4
|
||||
*/
|
||||
radius?: string | number
|
||||
/**
|
||||
* 是否加载中
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 是否显示标题,要求数组对象中有title属性
|
||||
* @default false
|
||||
*/
|
||||
showTitle?: boolean
|
||||
/**
|
||||
* 点击轮播图时触发
|
||||
* @param index 点击了第几张图片,从0开始
|
||||
*/
|
||||
onClick?: (index: number) => any
|
||||
/**
|
||||
* 轮播图切换时触发(自动或者手动切换)
|
||||
* @param index 点击了第几张图片,从0开始
|
||||
*/
|
||||
onChange?: (index: number) => any
|
||||
}
|
||||
|
||||
declare interface _Swiper {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SwiperProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Swiper: _Swiper
|
||||
37
uview-plus/types/comps/swiperIndicator.d.ts
vendored
Normal file
37
uview-plus/types/comps/swiperIndicator.d.ts
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface SwiperIndicatorProps {
|
||||
/**
|
||||
* 轮播的长度
|
||||
* @default 0
|
||||
*/
|
||||
length?: string | number
|
||||
/**
|
||||
* 当前处于活动状态的轮播的索引
|
||||
* @default 0
|
||||
*/
|
||||
current?: string | number
|
||||
/**
|
||||
* 指示器非激活颜色
|
||||
*/
|
||||
indicatorActiveColor?: string
|
||||
/**
|
||||
* 指示器的激活颜色
|
||||
*/
|
||||
indicatorInactiveColor?: string
|
||||
/**
|
||||
* 指示器的形式
|
||||
* @default "line"
|
||||
*/
|
||||
indicatorStyle?: 'line' | 'dot'
|
||||
}
|
||||
|
||||
declare interface _SwiperIndicator {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SwiperIndicatorProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const SwiperIndicator: _SwiperIndicator
|
||||
73
uview-plus/types/comps/switch.d.ts
vendored
Normal file
73
uview-plus/types/comps/switch.d.ts
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface SwitchProps {
|
||||
/**
|
||||
* 是否处于加载中
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 是否禁用
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 开关尺寸,单位rpx
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 打开时的背景色
|
||||
* @default "#2979ff"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 关闭时的背景色
|
||||
* @default "#ffffff"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 通过v-model双向绑定的值
|
||||
* @default false
|
||||
*/
|
||||
value?: string | number | boolean
|
||||
/**
|
||||
* switch打开时的值
|
||||
* @default true
|
||||
*/
|
||||
activeValue?: string | number | boolean
|
||||
/**
|
||||
* switch关闭时的值
|
||||
* @default false
|
||||
*/
|
||||
inactiveValue?: string | number | boolean
|
||||
/**
|
||||
* 是否开启异步变更,开启后需要手动控制输入值
|
||||
* @default false
|
||||
*/
|
||||
asyncChange?: boolean
|
||||
/**
|
||||
* 圆点与外边框的距离
|
||||
* @default 0
|
||||
*/
|
||||
space?: string | number
|
||||
/**
|
||||
* 在`switch`打开或关闭时触发
|
||||
* @param value 打开时为`activeValue`值,关闭时为`inactiveValue`值
|
||||
*/
|
||||
onChange?: (value: any) => any
|
||||
/**
|
||||
* 在`switch`打开或关闭时触发(没开启异步)
|
||||
* @param value 打开时为`activeValue`值,关闭时为`inactiveValue`值
|
||||
*/
|
||||
onInput?: (value: any) => any
|
||||
}
|
||||
|
||||
declare interface _Switch {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
SwitchProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Switch: _Switch
|
||||
54
uview-plus/types/comps/tabbar.d.ts
vendored
Normal file
54
uview-plus/types/comps/tabbar.d.ts
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TabbarProps {
|
||||
/**
|
||||
* 当前匹配项的name
|
||||
* @default null
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 是否为iPhoneX留出底部安全距离
|
||||
* @default true
|
||||
*/
|
||||
safeAreaInsetBottom?: boolean
|
||||
/**
|
||||
* 是否显示上方边框
|
||||
* @default true
|
||||
*/
|
||||
border?: boolean
|
||||
/**
|
||||
* 元素层级z-index
|
||||
* @default 1
|
||||
*/
|
||||
zIndex?: string | number
|
||||
/**
|
||||
* 选中标签的颜色
|
||||
* @default "#1989fa"
|
||||
*/
|
||||
activeColor?: string
|
||||
/**
|
||||
* 未选中标签的颜色
|
||||
* @default "#7d7e80"
|
||||
*/
|
||||
inactiveColor?: string
|
||||
/**
|
||||
* 是否固定在底部
|
||||
* @default true
|
||||
*/
|
||||
fixed?: boolean
|
||||
/**
|
||||
* fixed定位固定在底部时,是否生成一个等高元素防止塌陷
|
||||
* @default true
|
||||
*/
|
||||
placeholder?: boolean
|
||||
}
|
||||
|
||||
declare interface _Tabbar {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TabbarProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Tabbar: _Tabbar
|
||||
52
uview-plus/types/comps/tabbarItem.d.ts
vendored
Normal file
52
uview-plus/types/comps/tabbarItem.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TabbarItemProps {
|
||||
/**
|
||||
* item标签的名称,作为与u-tabbar的value参数匹配的标识符
|
||||
* @default null
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* uView内置图标或者绝对路径的图片
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 右上角的角标提示信息
|
||||
* @default null
|
||||
*/
|
||||
badge?: string | number
|
||||
/**
|
||||
* 是否显示圆点,将会覆盖badge参数
|
||||
* @default false
|
||||
*/
|
||||
dot?: boolean
|
||||
/**
|
||||
* 描述文本
|
||||
*/
|
||||
text?: string
|
||||
/**
|
||||
* 控制徽标的位置
|
||||
* @default "top: 6px;right:2px;"
|
||||
*/
|
||||
badgeStyle?: Record<string, any> | string
|
||||
/**
|
||||
* 切换选项时触发
|
||||
* @param index 当前要切换项的name
|
||||
*/
|
||||
onChange?: (index: any) => any
|
||||
/**
|
||||
* 切换选项时触发
|
||||
* @param index 当前要切换项的name
|
||||
*/
|
||||
onClick?: (index: any) => any
|
||||
}
|
||||
|
||||
declare interface _TabbarItem {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TabbarItemProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const TabbarItem: _TabbarItem
|
||||
85
uview-plus/types/comps/tabs.d.ts
vendored
Normal file
85
uview-plus/types/comps/tabs.d.ts
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TabsProps {
|
||||
/**
|
||||
* 滑块移动一次所需的时间,单位ms
|
||||
* @default 300
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 标签数组,元素为对象
|
||||
*/
|
||||
list?: any[]
|
||||
/**
|
||||
* 滑块颜色
|
||||
* @default "#3c9cff"
|
||||
*/
|
||||
lineColor?: string
|
||||
/**
|
||||
* 菜单选择中时的样式
|
||||
* @default "{ color: '#303133' }"
|
||||
*/
|
||||
activeStyle?: unknown
|
||||
/**
|
||||
* 菜单非选中时的样式
|
||||
* @default "{ color: '#606266' }"
|
||||
*/
|
||||
inactiveStyle?: unknown
|
||||
/**
|
||||
* 滑块长度
|
||||
* @default 20
|
||||
*/
|
||||
lineWidth?: string | number
|
||||
/**
|
||||
* 滑块高度
|
||||
* @default 3
|
||||
*/
|
||||
lineHeight?: string | number
|
||||
/**
|
||||
* 滑块背景显示大小
|
||||
* @default "cover"
|
||||
*/
|
||||
lineBgSize?: string
|
||||
/**
|
||||
* 菜单item的样式
|
||||
* @default "{ height: '44px' }"
|
||||
*/
|
||||
itemStyle?: unknown
|
||||
/**
|
||||
* 菜单是否可滚动
|
||||
* @default true
|
||||
*/
|
||||
scrollable?: boolean
|
||||
/**
|
||||
* 当前选中标签的索引
|
||||
* @default 0
|
||||
*/
|
||||
current?: string | number
|
||||
/**
|
||||
* 从`list`元素对象中读取的键名
|
||||
* @default "name"
|
||||
*/
|
||||
keyName?: string
|
||||
/**
|
||||
* 点击标签时触发
|
||||
* @param item 传入的其他值
|
||||
* @param index 标签索引值
|
||||
*/
|
||||
onClick?: (item: any, index: number) => any
|
||||
/**
|
||||
* 标签索引改变时触发(`disalbed`时不会触发)
|
||||
* @param item 传入的其他值
|
||||
* @param index 标签索引值
|
||||
*/
|
||||
onChange?: (item: any, index: number) => any
|
||||
}
|
||||
|
||||
declare interface _Tabs {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TabsProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Tabs: _Tabs
|
||||
93
uview-plus/types/comps/tag.d.ts
vendored
Normal file
93
uview-plus/types/comps/tag.d.ts
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TagProps {
|
||||
/**
|
||||
* 主题类型
|
||||
* @default "primary"
|
||||
*/
|
||||
type?: 'primary' | 'success' | 'info' | 'warning' | 'error'
|
||||
/**
|
||||
* 不可用
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean | string
|
||||
/**
|
||||
* 标签大小
|
||||
* @default "medium"
|
||||
*/
|
||||
size?: 'medium' | 'large' | 'mini'
|
||||
/**
|
||||
* 标签形状
|
||||
* @default "square"
|
||||
*/
|
||||
shape?: 'square' | 'circle'
|
||||
/**
|
||||
* 标签的文字内容
|
||||
*/
|
||||
text?: string | number
|
||||
/**
|
||||
* 背景颜色,默认为空字符串,即不处理
|
||||
* @default "#C6C7CB"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 标签字体颜色,默认为空字符串,即不处理
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 标签的边框颜色
|
||||
*/
|
||||
borderColor?: string
|
||||
/**
|
||||
* 关闭按钮图标的颜色
|
||||
*/
|
||||
closeColor?: string
|
||||
/**
|
||||
* 点击时返回的索引值,用于区分例遍的数组哪个元素被点击了
|
||||
*/
|
||||
name?: string | number
|
||||
/**
|
||||
* 镂空时是否填充背景色
|
||||
* @default false
|
||||
*/
|
||||
plainFill?: boolean
|
||||
/**
|
||||
* 是否镂空
|
||||
* @default false
|
||||
*/
|
||||
plain?: boolean
|
||||
/**
|
||||
* 是否可关闭,设置为`true`,文字右边会出现一个关闭图标
|
||||
* @default false
|
||||
*/
|
||||
closable?: boolean
|
||||
/**
|
||||
* 标签显示与否
|
||||
* @default true
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 内置图标,或绝对路径的图片
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* 点击触发事件
|
||||
* @param index 传递的`index`参数值
|
||||
*/
|
||||
onClick?: (index: number) => any
|
||||
/**
|
||||
* `closable`为`true`时,点击标签关闭按钮触发
|
||||
* @param index 传递的`index`参数值
|
||||
*/
|
||||
onClose?: (index: number) => any
|
||||
}
|
||||
|
||||
declare interface _Tag {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TagProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Tag: _Tag
|
||||
110
uview-plus/types/comps/text.d.ts
vendored
Normal file
110
uview-plus/types/comps/text.d.ts
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TextProps {
|
||||
/**
|
||||
* 主题颜色
|
||||
*/
|
||||
type?: string
|
||||
/**
|
||||
* 是否显示
|
||||
* @default true
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 显示的值
|
||||
*/
|
||||
text?: string | number
|
||||
/**
|
||||
* 前置图标
|
||||
*/
|
||||
prefixIcon?: string
|
||||
/**
|
||||
* 后置图标
|
||||
*/
|
||||
suffixIcon?: string
|
||||
/**
|
||||
* 文本处理的匹配模式text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
|
||||
*/
|
||||
mode?: 'text' | 'price' | 'phone' | 'name' | 'date' | 'link'
|
||||
/**
|
||||
* mode=link下,配置的链接
|
||||
*/
|
||||
href?: string
|
||||
/**
|
||||
* 格式化规则
|
||||
*/
|
||||
format?: string | ((value: any) => any)
|
||||
/**
|
||||
* mode=phone时,点击文本是否拨打电话
|
||||
* @default false
|
||||
*/
|
||||
call?: boolean
|
||||
/**
|
||||
* 小程序的打开方式
|
||||
*/
|
||||
openType?: string
|
||||
/**
|
||||
* 是否粗体,默认normal
|
||||
* @default false
|
||||
*/
|
||||
bold?: boolean
|
||||
/**
|
||||
* 是否块状
|
||||
*/
|
||||
block?: boolean
|
||||
/**
|
||||
* 文本显示的行数,如果设置,超出此行数,将会显示省略号
|
||||
*/
|
||||
lines?: string | number
|
||||
/**
|
||||
* 文本颜色
|
||||
* @default "#303133"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 字体大小
|
||||
* @default 15
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 图标的样式
|
||||
*/
|
||||
iconStyle?: Record<string, any> | string
|
||||
/**
|
||||
* 文字装饰,下划线,中划线等
|
||||
* @default "none"
|
||||
*/
|
||||
decoration?: 'none' | 'underline' | 'line-through'
|
||||
/**
|
||||
* 外边距,对象、字符串,数值形式均可
|
||||
*/
|
||||
margin?: Record<string, any> | string | number
|
||||
/**
|
||||
* 文本行高
|
||||
*/
|
||||
lineHeight?: number | string
|
||||
/**
|
||||
* 文本对齐方式
|
||||
* @default "left"
|
||||
*/
|
||||
align?: 'left' | 'center' | 'right'
|
||||
/**
|
||||
* 文字换行
|
||||
* @default "normal"
|
||||
*/
|
||||
wordWrap?: 'normal' | 'break-word' | 'any-where'
|
||||
/**
|
||||
* 点击触发事件
|
||||
*/
|
||||
onClick?: () => any
|
||||
}
|
||||
|
||||
declare interface _Text {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TextProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Text: _Text
|
||||
158
uview-plus/types/comps/textarea.d.ts
vendored
Normal file
158
uview-plus/types/comps/textarea.d.ts
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TextareaProps {
|
||||
/**
|
||||
* 输入框的内容
|
||||
*/
|
||||
value?: string | number
|
||||
/**
|
||||
* 输入框为空时占位符
|
||||
*/
|
||||
placeholder?: string | number
|
||||
/**
|
||||
* 输入框高度
|
||||
* @default 70
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效
|
||||
* @default "done"
|
||||
*/
|
||||
confirmType?: string
|
||||
/**
|
||||
* 是否禁用
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 是否显示统计字数
|
||||
* @default false
|
||||
*/
|
||||
count?: boolean
|
||||
/**
|
||||
* 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现
|
||||
* @default false
|
||||
*/
|
||||
focus?: boolean
|
||||
/**
|
||||
* 是否自动增加高度
|
||||
* @default false
|
||||
*/
|
||||
autoHeight?: boolean
|
||||
/**
|
||||
* 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件
|
||||
* @default true
|
||||
*/
|
||||
ignoreCompositionEvent?: boolean
|
||||
/**
|
||||
* 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true
|
||||
* @default false
|
||||
*/
|
||||
fixed?: boolean
|
||||
/**
|
||||
* 指定光标与键盘的距离
|
||||
* @default 0
|
||||
*/
|
||||
cursorSpacing?: number
|
||||
/**
|
||||
* 指定focus时的光标位置
|
||||
*/
|
||||
cursor?: string | number
|
||||
/**
|
||||
* 是否显示键盘上方带有”完成“按钮那一栏
|
||||
* @default true
|
||||
*/
|
||||
showConfirmBar?: boolean
|
||||
/**
|
||||
* 光标起始位置,自动聚焦时有效,需与selection-end搭配使用
|
||||
* @default -1
|
||||
*/
|
||||
selectionStart?: number
|
||||
/**
|
||||
* 光标结束位置,自动聚焦时有效,需与selection-start搭配使用
|
||||
* @default -1
|
||||
*/
|
||||
selectionEnd?: number
|
||||
/**
|
||||
* 键盘弹起时,是否自动上推页面
|
||||
* @default true
|
||||
*/
|
||||
adjustPosition?: boolean
|
||||
/**
|
||||
* 是否去掉 iOS 下的默认内边距,只微信小程序有效
|
||||
* @default false
|
||||
*/
|
||||
disableDefaultPadding?: boolean
|
||||
/**
|
||||
* focus时,点击页面的时候不收起键盘,只微信小程序有效
|
||||
* @default false
|
||||
*/
|
||||
holdKeyboard?: boolean
|
||||
/**
|
||||
* 最大输入长度,设置为 -1 的时候不限制最大长度
|
||||
* @default 140
|
||||
*/
|
||||
maxlength?: string | number
|
||||
/**
|
||||
* 边框类型,surround-四周边框,none-无边框,bottom-底部边框
|
||||
* @default "surround"
|
||||
*/
|
||||
border?: 'surround' | 'none' | 'bottom'
|
||||
/**
|
||||
* 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
|
||||
* @default "textarea-placeholder"
|
||||
*/
|
||||
placeholderClass?: string
|
||||
/**
|
||||
* 指定placeholder的样式
|
||||
* @default "color: #c0c4cc"
|
||||
*/
|
||||
placeholderStyle?: unknown
|
||||
/**
|
||||
* 输入过滤或格式化函数(如需兼容微信小程序,则只能通过setFormatter方法)
|
||||
*/
|
||||
formatter?: (...args: any) => any
|
||||
/**
|
||||
* 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度
|
||||
*/
|
||||
onFocus?: (...args: any) => any
|
||||
/**
|
||||
* 输入框失去焦点时触发,event.detail = {value, cursor}
|
||||
*/
|
||||
onBlur?: (...args: any) => any
|
||||
/**
|
||||
* 输入框行数变化时调用,event.detail = {height: 0, heightRpx: 0, lineCount: 0}
|
||||
*/
|
||||
onLinechange?: (...args: any) => any
|
||||
/**
|
||||
* 当键盘输入时,触发 input 事件
|
||||
*/
|
||||
onInput?: (...args: any) => any
|
||||
/**
|
||||
* 点击完成时, 触发 confirm 事件
|
||||
*/
|
||||
onConfirm?: (...args: any) => any
|
||||
/**
|
||||
* 键盘高度发生变化的时候触发此事件
|
||||
*/
|
||||
onKeyboardheightchange?: (...args: any) => any
|
||||
}
|
||||
|
||||
declare interface _TextareaRef {
|
||||
/**
|
||||
* 为兼容微信小程序而暴露的内部方法,详细见[文档](https://www.uviewui.com/components/textarea.html#%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%A4%84%E7%90%86)
|
||||
*/
|
||||
setFormatter: (...args: any) => any
|
||||
}
|
||||
|
||||
declare interface _Textarea {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TextareaProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Textarea: _Textarea
|
||||
|
||||
export declare const TextareaRef: _TextareaRef
|
||||
59
uview-plus/types/comps/toast.d.ts
vendored
Normal file
59
uview-plus/types/comps/toast.d.ts
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface ToastProps {
|
||||
/**
|
||||
* 是否加载中
|
||||
* @default false
|
||||
*/
|
||||
loading?: boolean
|
||||
/**
|
||||
* 显示的文本
|
||||
*/
|
||||
message?: string | number
|
||||
/**
|
||||
* 图标,或者绝对路径的图片
|
||||
*/
|
||||
icon?: string
|
||||
/**
|
||||
* toast出现的位置
|
||||
* @default "center"
|
||||
*/
|
||||
position?: 'top' | 'center' | 'bottom'
|
||||
/**
|
||||
* 主题类型
|
||||
* @default "default"
|
||||
*/
|
||||
type?: 'default' | 'error' | 'success' | 'loading'
|
||||
/**
|
||||
* 跳转的参数
|
||||
*/
|
||||
params?: Record<string, any>
|
||||
/**
|
||||
* 展示时间,单位ms
|
||||
* @default 2000
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 执行完后的回调函数
|
||||
*/
|
||||
complete?: () => any
|
||||
}
|
||||
|
||||
declare interface _ToastRef {
|
||||
/**
|
||||
* 显示toast,如需一进入页面就显示toast,请在onReady生命周期调用
|
||||
*/
|
||||
show: () => void
|
||||
}
|
||||
|
||||
declare interface _Toast {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
ToastProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Toast: _Toast
|
||||
|
||||
export declare const ToastRef: _ToastRef
|
||||
71
uview-plus/types/comps/tooltip.d.ts
vendored
Normal file
71
uview-plus/types/comps/tooltip.d.ts
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TooltipProps {
|
||||
/**
|
||||
* 需要显示的提示文字
|
||||
*/
|
||||
text?: string | number
|
||||
/**
|
||||
* 点击复制按钮时,复制的文本,为空则使用text值
|
||||
*/
|
||||
copyText?: string | number
|
||||
/**
|
||||
* 文本大小
|
||||
* @default 14
|
||||
*/
|
||||
size?: string | number
|
||||
/**
|
||||
* 字体颜色
|
||||
* @default "#606266"
|
||||
*/
|
||||
color?: string
|
||||
/**
|
||||
* 弹出提示框时,文本的背景色
|
||||
* @default "transparent"
|
||||
*/
|
||||
bgColor?: string
|
||||
/**
|
||||
* 弹出提示的方向
|
||||
* @default "top"
|
||||
*/
|
||||
direction?: 'top' | 'bottom'
|
||||
/**
|
||||
* 弹出提示的z-index,nvue无效
|
||||
* @default 10071
|
||||
*/
|
||||
zIndex?: string | number
|
||||
/**
|
||||
* 是否显示复制按钮
|
||||
* @default true
|
||||
*/
|
||||
showCopy?: boolean
|
||||
/**
|
||||
* 扩展的按钮组
|
||||
*/
|
||||
buttons?: any[]
|
||||
/**
|
||||
* 是否显示透明遮罩以防止触摸穿透
|
||||
* @default true
|
||||
*/
|
||||
overlay?: boolean
|
||||
/**
|
||||
* 是否显示复制成功或者失败的`toast`
|
||||
* @default true
|
||||
*/
|
||||
showToast?: boolean
|
||||
/**
|
||||
* 点击触发事件
|
||||
* @param index 被点击按钮的索引
|
||||
*/
|
||||
onClick?: (index: number) => any
|
||||
}
|
||||
|
||||
declare interface _Tooltip {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TooltipProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Tooltip: _Tooltip
|
||||
61
uview-plus/types/comps/transition.d.ts
vendored
Normal file
61
uview-plus/types/comps/transition.d.ts
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
|
||||
declare interface TransitionProps {
|
||||
/**
|
||||
* 是否展示组件
|
||||
* @default false
|
||||
*/
|
||||
show?: boolean
|
||||
/**
|
||||
* 使用的动画模式
|
||||
* @default "fade"
|
||||
*/
|
||||
mode?: 'fade' | 'fade-up' | 'fade-down' | 'fade-left' | 'fade-right' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'zoom-in' | 'zoom-out'
|
||||
/**
|
||||
* 动画的执行时间,单位ms
|
||||
* @default 300
|
||||
*/
|
||||
duration?: string | number
|
||||
/**
|
||||
* 使用的动画过渡函数
|
||||
*/
|
||||
timingFunction?: string
|
||||
/**
|
||||
* 自定义样式
|
||||
*/
|
||||
customStyle?: unknown
|
||||
/**
|
||||
* 进入前触发
|
||||
*/
|
||||
onBeforeEnter?: () => any
|
||||
/**
|
||||
* 进入中触发
|
||||
*/
|
||||
onEnter?: () => any
|
||||
/**
|
||||
* 进入后触发
|
||||
*/
|
||||
onAfterEnter?: () => any
|
||||
/**
|
||||
* 离开前触发
|
||||
*/
|
||||
onBeforeLeave?: () => any
|
||||
/**
|
||||
* 离开中触发
|
||||
*/
|
||||
onLeave?: () => any
|
||||
/**
|
||||
* 离开后触发
|
||||
*/
|
||||
onAfterLeave?: () => any
|
||||
}
|
||||
|
||||
declare interface _Transition {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
TransitionProps
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Transition: _Transition
|
||||
163
uview-plus/types/comps/upload.d.ts
vendored
Normal file
163
uview-plus/types/comps/upload.d.ts
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
import { AllowedComponentProps, VNodeProps } from './_common'
|
||||
import { ImageMode } from './image';
|
||||
|
||||
declare interface UploadProps {
|
||||
/**
|
||||
* 接受的文件类型,file只支持H5(只有微信小程序才支持把accept配置为all、media)
|
||||
* @default "image"
|
||||
*/
|
||||
accept?: 'all' | 'media' | 'image' | 'file' | 'video'
|
||||
/**
|
||||
* 图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头
|
||||
* @default ["album", "camera"]
|
||||
*/
|
||||
capture?: 'album' | 'camera' | ('album' | 'camera')[]
|
||||
/**
|
||||
* 当accept为video时生效,是否压缩视频,默认为true
|
||||
* @default true
|
||||
*/
|
||||
compressed?: boolean
|
||||
/**
|
||||
* 当accept为video时生效,可选值为back或front
|
||||
* @default "back"
|
||||
*/
|
||||
camera?: 'back' | 'front'
|
||||
/**
|
||||
* 当accept为video时生效,拍摄视频最长拍摄时间,单位秒
|
||||
* @default 60
|
||||
*/
|
||||
maxDuration?: number
|
||||
/**
|
||||
* 上传区域的图标,只能内置图标
|
||||
* @default "camera-fill"
|
||||
*/
|
||||
uploadIcon?: string
|
||||
/**
|
||||
* 上传区域的图标的颜色
|
||||
* @default "#D3D4D6"
|
||||
*/
|
||||
uploadIconColor?: string
|
||||
/**
|
||||
* 是否启用(显示/隐藏)组件
|
||||
*/
|
||||
useBeforeRead?: boolean
|
||||
/**
|
||||
* 预览全图
|
||||
* @default true
|
||||
*/
|
||||
previewFullImage?: boolean
|
||||
/**
|
||||
* 最大选择图片的数量
|
||||
* @default 52
|
||||
*/
|
||||
maxCount?: string | number
|
||||
/**
|
||||
* 是否启用(显示/隐藏)组件
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean
|
||||
/**
|
||||
* 预览上传的图片时的裁剪模式
|
||||
* @default "aspectFill"
|
||||
*/
|
||||
imageMode?: ImageMode
|
||||
/**
|
||||
* 标识符,可以在回调函数的第二项参数中获取
|
||||
* @default "file"
|
||||
*/
|
||||
name?: string
|
||||
/**
|
||||
* original 原图,compressed 压缩图,默认二者都有,H5无效
|
||||
* @default ["original", "compressed"]
|
||||
*/
|
||||
sizeType?: ('original' | 'compressed')[]
|
||||
/**
|
||||
* 是否开启图片多选,部分安卓机型不支持
|
||||
* @default false
|
||||
*/
|
||||
multiple?: boolean
|
||||
/**
|
||||
* 是否显示删除图片的按钮
|
||||
* @default true
|
||||
*/
|
||||
deletable?: boolean
|
||||
/**
|
||||
* 选择单个文件的最大大小,单位B(byte),默认不限制
|
||||
* @default Number.MAX_VALUE
|
||||
*/
|
||||
maxSize?: string | number
|
||||
/**
|
||||
* 显示已上传的文件列表
|
||||
*/
|
||||
fileList?: any[]
|
||||
/**
|
||||
* 上传区域的提示文字
|
||||
*/
|
||||
uploadText?: string
|
||||
/**
|
||||
* 内部预览图片区域和选择图片按钮的区域宽度,单位rpx,不能是百分比,或者`auto`
|
||||
* @default 80
|
||||
*/
|
||||
width?: string | number
|
||||
/**
|
||||
* 内部预览图片区域和选择图片按钮的区域高度,单位rpx,不能是百分比,或者`auto`
|
||||
* @default 80
|
||||
*/
|
||||
height?: string | number
|
||||
/**
|
||||
* 是否在上传完成后展示预览图
|
||||
* @default true
|
||||
*/
|
||||
previewImage?: boolean
|
||||
/**
|
||||
* 读取后的处理函数
|
||||
*/
|
||||
onAfterRead?: (file, lists, name) => any
|
||||
/**
|
||||
* 读取前的处理函数
|
||||
*/
|
||||
onBeforeRead?: (file, lists, name) => any
|
||||
/**
|
||||
* 图片大小超出最大允许大小
|
||||
*/
|
||||
onOversize?: (file, lists, name) => any
|
||||
/**
|
||||
* 全屏预览图片时触发
|
||||
*/
|
||||
onClickPreview?: (file, lists, name) => any
|
||||
/**
|
||||
* 删除图片
|
||||
*/
|
||||
onDelete?: (index, file, name) => any
|
||||
}
|
||||
|
||||
declare interface UploadSlots {
|
||||
/**
|
||||
* 自定义上传样式
|
||||
*/
|
||||
['default']?: () => any
|
||||
}
|
||||
|
||||
declare interface _UploadRef {
|
||||
/**
|
||||
* 读取后的处理函数
|
||||
*/
|
||||
afterRead: (file, lists, name) => any
|
||||
/**
|
||||
* 读取前的处理函数
|
||||
*/
|
||||
beforeRead: (file, lists, name) => any
|
||||
}
|
||||
|
||||
declare interface _Upload {
|
||||
new (): {
|
||||
$props: AllowedComponentProps &
|
||||
VNodeProps &
|
||||
UploadProps
|
||||
$slots: UploadSlots
|
||||
}
|
||||
}
|
||||
|
||||
export declare const Upload: _Upload
|
||||
|
||||
export declare const UploadRef: _UploadRef
|
||||
172
uview-plus/types/index.d.ts
vendored
Normal file
172
uview-plus/types/index.d.ts
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
/// <reference path="./comps.d.ts" />
|
||||
declare module 'uview-plus' {
|
||||
export function install(): void //必要
|
||||
interface test {
|
||||
/** 邮箱格式校验 */
|
||||
email(email: string): boolean
|
||||
/** 手机号校验 */
|
||||
mobile(phone: number): boolean;
|
||||
/** url路径验证 */
|
||||
url(value: string): boolean;
|
||||
/** 验证日期格式 */
|
||||
date(value: string | number): boolean;
|
||||
/** 验证ISO类型的日期格式 YYYY-MM-DD | YYYY/MM/DD */
|
||||
dateISO(value: string): boolean;
|
||||
/** 验证十进制数字 */
|
||||
number(value: number): boolean;
|
||||
/** 验证字符串 */
|
||||
string(value: string): boolean;
|
||||
/** 验证整数 */
|
||||
digits(value: number): boolean;
|
||||
/** 验证身份证号码 */
|
||||
idCard(value: string | number): boolean;
|
||||
/** 是否车牌号 */
|
||||
carNo(value: string): boolean;
|
||||
/** 金额,只允许2位小数 */
|
||||
amount(value: string | number): boolean;
|
||||
/** 校验是否是中文 */
|
||||
chinese(value: any): boolean;
|
||||
/** 校验是否是字母 */
|
||||
letter(value: any): boolean;
|
||||
/** 校验字母或者数字 */
|
||||
enOrNum(value: any): boolean;
|
||||
/** 验证是否包含某个值 */
|
||||
contains(source: string, value: string): boolean;
|
||||
/** 验证一个值范围[min, max] */
|
||||
range(value: string, between: number[]): boolean;
|
||||
/** 验证一个长度范围[min, max] */
|
||||
rangeLength(value: string, between: number[]): boolean;
|
||||
/** 是否固定电话 */
|
||||
landline(value: string | number): boolean;
|
||||
/** 判断是否为空 */
|
||||
empty(value: string | number | undefined | boolean | object | null): boolean;
|
||||
/** 是否json字符串 */
|
||||
jsonString(value: string): boolean;
|
||||
/** 是否数组 */
|
||||
array(value: any): boolean;
|
||||
/** 是否对象 */
|
||||
object(value: any): boolean;
|
||||
/** 是否短信验证码 */
|
||||
code(value: any, len: number): boolean;
|
||||
/** 是否函数方法 */
|
||||
func(value: any): boolean;
|
||||
/** 是否promise对象 */
|
||||
promise(value: any): boolean;
|
||||
/** 是否图片格式 */
|
||||
image(value: string): boolean;
|
||||
/** 是否视频格式 */
|
||||
video(value: string): boolean;
|
||||
/** 是否为正则对象 */
|
||||
regExp(value: any): boolean;
|
||||
}
|
||||
interface RouteParam {
|
||||
type: 'navigateTo' | 'redirect' | 'switchTab' | 'reLaunch' | 'navigateBack';
|
||||
/** 路由地址 */
|
||||
url: string;
|
||||
/** navigateBack页面后退时,回退的层数 */
|
||||
delta?: number;
|
||||
/** 传递的参数 */
|
||||
params?: {};
|
||||
/** 窗口动画,只在APP有效 */
|
||||
animationType?: string;
|
||||
/** 窗口动画持续时间,单位毫秒,只在APP有效 */
|
||||
animationDuration?: number;
|
||||
/** 是否需要拦截 */
|
||||
intercept?: boolean;
|
||||
}
|
||||
interface Config {
|
||||
v: string;
|
||||
version: string;
|
||||
color: Partial<Color>;
|
||||
unit: 'px' | 'rpx'
|
||||
}
|
||||
interface Color {
|
||||
primary: string,
|
||||
info: string,
|
||||
default: string,
|
||||
warning: string,
|
||||
error: string,
|
||||
success: string,
|
||||
mainColor: string,
|
||||
contentColor: string,
|
||||
tipsColor: string,
|
||||
lightColor: string,
|
||||
borderColor: string
|
||||
}
|
||||
interface GlobalConfig {
|
||||
config: Partial<Config>;
|
||||
props: {};
|
||||
}
|
||||
interface $u {
|
||||
route: (url: string | RouteParam) => void;
|
||||
/**
|
||||
* 求两个颜色之间的渐变值
|
||||
* @param {string} startColor 开始的颜色
|
||||
* @param {string} endColor 结束的颜色
|
||||
* @param {number} step 颜色等分的份额
|
||||
*/
|
||||
colorGradient: (startColor: string, endColor: string, step: number) => any[];
|
||||
/**
|
||||
* 将hex表示方式转换为rgb
|
||||
* @param color "#000000"-> "rgb(0,0,0)" | "rgb(0,0,0)" -> "#000000"
|
||||
* @param str 是否返回颜色数组 true -> 不返回
|
||||
* @returns
|
||||
*/
|
||||
hexToRgb: (color: string, str?: boolean) => any[];
|
||||
/**
|
||||
* 将rgb表示方式转换为hex
|
||||
*/
|
||||
rgbToHex: (color: string) => string;
|
||||
/**
|
||||
* 十六进制转换为rgb或rgba
|
||||
* @param color
|
||||
* @param alpha 透明度
|
||||
* @returns rgba(255,255,255,0.5)字符串
|
||||
*/
|
||||
colorToRgba: (color: string, alpha: number) => string;
|
||||
test: test;
|
||||
type: {},
|
||||
http: {},
|
||||
config: Config;
|
||||
zIndex: {
|
||||
toast: number;
|
||||
noNetwork: number;
|
||||
// popup包含popup,actionsheet,keyboard,picker的值
|
||||
popup: number;
|
||||
mask: number;
|
||||
navbar: number;
|
||||
topTips: number;
|
||||
sticky: number;
|
||||
indexListSticky: number;
|
||||
},
|
||||
debounce: (func, wait, immediate) => void;
|
||||
throttle: (func, wait, immediate) => void;
|
||||
mixin: {},
|
||||
mpMixin: {},
|
||||
props: {},
|
||||
color: Color;
|
||||
platform: string;
|
||||
}
|
||||
|
||||
export function setConfig(config: Partial<GlobalConfig>): void;
|
||||
|
||||
global {
|
||||
interface Uni {
|
||||
$u: $u
|
||||
}
|
||||
}
|
||||
}
|
||||
declare type UniCountDownRef = typeof import('./comps/countDown')['CountDownRef']
|
||||
declare type UniCountToRef = typeof import('./comps/countTo')['CountToRef']
|
||||
declare type UniReadMoreRef = typeof import('./comps/readMore')['ReadMoreRef']
|
||||
declare type UniToastRef = typeof import('./comps/toast')['ToastRef']
|
||||
declare type UniCollapseRef = typeof import('./comps/collapse')['CollapseRef']
|
||||
declare type UniNotifyRef = typeof import('./comps/notify')['NotifyRef']
|
||||
declare type UniCodeRef = typeof import('./comps/code')['CodeRef']
|
||||
declare type UniInputRef = typeof import('./comps/input')['InputRef']
|
||||
declare type UniUploadRef = typeof import('./comps/upload')['UploadRef']
|
||||
declare type UniDatetimePickerRef = typeof import('./comps/datetimePicker')['DatetimePickerRef']
|
||||
declare type UniPickerRef = typeof import('./comps/picker')['PickerRef']
|
||||
declare type UniCalendarRef = typeof import('./comps/calendar')['CalendarRef']
|
||||
declare type UniTextareaRef = typeof import('./comps/textarea')['TextareaRef']
|
||||
declare type UniFormRef = typeof import('./comps/form')['FormRef']
|
||||
26
uview-plus/types/package.json
Normal file
26
uview-plus/types/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@uview-plus/types",
|
||||
"version": "3.2.5",
|
||||
"description": "types for uview-plus",
|
||||
"main": "index.d.ts",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ijry/uview-plus.git"
|
||||
},
|
||||
"keywords": [
|
||||
"uview-plus"
|
||||
],
|
||||
"author": "jry",
|
||||
"license": "MIT",
|
||||
"types": "./index.d.ts",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ijry/uview-plus/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ijry/uview-plus#readme",
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user