forked from didi/cube-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TS type declaration for supplementary basic components & vetur (didi#777
) * fix(types): complete ts type * fix: complete ts type 1 * fix(types/ test/): complete ts types * docs: test * fix(test types): complete ts types test-dts * docs: updata Partial EventsProps * docs: update ts events * docs: add ts development tooling * docs: update ts development tooling docs * chore: supplement the TS declaration of the basic component & vetur Co-authored-by: shanchuntao <[email protected]>
- Loading branch information
1 parent
d4b743c
commit 76e1f67
Showing
34 changed files
with
887 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
import { CubeUIComponent } from '../component' | ||
|
||
export type ButtonType = 'button' | 'submit' | ||
|
||
export declare class CubeButton extends CubeUIComponent { | ||
type?: ButtonType | ||
active?: boolean | ||
disabled?: boolean | ||
icon?: string | ||
light?: string | ||
inline?: boolean | ||
outline?: boolean | ||
primary?: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { CubeUIComponent } from '../component' | ||
import { IRadioOptionData } from './common' | ||
|
||
export declare class CubeCheckbox extends CubeUIComponent { | ||
option?: IRadioOptionData | string | boolean | ||
position?: 'left' | 'right' | ||
shape?: 'circle' | 'square' | ||
hollowStyle?: boolean | ||
label?: string | boolean | ||
value?: string | boolean | ||
disabled?: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { IRadioOptionData } from './common' | ||
import { CubeUIComponent } from '../component' | ||
|
||
export declare class CubeCheckboxGroup extends CubeUIComponent { | ||
value?: [] | ||
options?: IRadioOptionData[] | string | ||
horizontal?: boolean | ||
colNum?: number | ||
shape?: 'circle' | 'square' | ||
hollowStyle?: boolean | ||
min?: number | ||
max?: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { CubeUIComponent } from '../component' | ||
|
||
export interface ICheckerOptionData { | ||
value?: string | number | ||
text?: string | ||
disabled?: boolean | ||
} | ||
export declare class CubeChecker extends CubeUIComponent { | ||
value?: string | number | ICheckerOptionData[] | ||
options?: ICheckerOptionData[] | ||
type?: 'checkbox' | 'radio' | ||
min?: number | ||
max?: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
import { CubeUIComponent } from '../component' | ||
|
||
export declare class CubeDrawer extends CubeUIComponent { | ||
title?: string | ||
data?: any[] | ||
selectedIndex?: number[] | ||
visible?: boolean | ||
refill: (index?: number, data?: any[], item?: any[]) => void | ||
show: () => void | ||
hide: () => void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { CubeUIComponent } from '../component' | ||
|
||
interface IField { | ||
type?: string | ||
component?: string | object | ||
modelKey?: string | ||
label?: string | ||
props?: object | ||
events?: object | ||
rules?: object | ||
trigger?: 'blur' | 'change' | ||
debounce?: number | boolean | ||
messages?: string | ||
key?: string | ||
} | ||
|
||
interface IFields { | ||
fields: IField[] | ||
} | ||
|
||
interface IGroups { | ||
groups: { | ||
legend?: string | ||
fields?: IField[] | ||
} | ||
} | ||
|
||
interface IValidity { | ||
valid?: boolean | undefined | ||
result?: {} | ||
dirty?: boolean | ||
} | ||
|
||
interface IValidateParams { | ||
validity?: IValidity | ||
valid?: boolean | undefined | ||
invalid?: boolean | ||
dirty?: boolean | ||
firstInvalidFieldIndex?: number | ||
} | ||
|
||
export declare class CubeForm extends CubeUIComponent { | ||
model?: object | ||
schema?: IFields | IGroups | ||
immediateValidate?: boolean | ||
action?: string | undefined | ||
options?: { | ||
scrollToInvalidField?: boolean | ||
layout?: 'standard' | 'classic' | 'fresh' | ||
} | ||
submitAlwaysValidate?: boolean | ||
submit: (skipValidate?: boolean) => void | ||
reset: () => void | ||
validate: (cb?: Function) => Promise<boolean | undefined> | undefined | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
import { BsOption } from 'better-scroll' | ||
|
||
export interface IndexListSlots { | ||
title: VNode[] | ||
pulldown: VNode[] | ||
pullup: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
export declare class CubeIndexList extends CubeUIComponent { | ||
title?: string | ||
data?: [] | ||
navbar?: boolean | ||
speed?: number | ||
options?: BsOption | ||
pullUpLoad?: boolean | object | ||
pullDownRefresh?: boolean | object | ||
$slots: IndexListSlots | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
|
||
interface IClearable { | ||
visible?: boolean | ||
blurHidden?: boolean | ||
} | ||
|
||
interface IEye { | ||
open?: boolean | ||
reverse?: boolean | ||
} | ||
|
||
export interface InputSlots { | ||
prepend: VNode[] | ||
append: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
export declare class CubeInput extends CubeUIComponent { | ||
value?: string | number | ||
type?: 'text' | 'number' | 'password' | 'date' | ||
disabled?: boolean | ||
readonly?: boolean | ||
maxlength?: number | ||
placeholder?: string | ||
autofocus?: boolean | ||
autocomplete?: boolean | ||
clearable?: boolean | IClearable | ||
eye?: boolean | IEye | ||
focus: (e?: FocusEvent) => void | ||
blur: (e?: FocusEvent) => void | ||
$slots: InputSlots | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { CubeUIComponent } from '../component' | ||
|
||
export declare class CubeLoading extends CubeUIComponent { | ||
size?: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { IRadioOptionData } from './common' | ||
import { CubeUIComponent } from '../component' | ||
|
||
export declare class CubeRadio extends CubeUIComponent { | ||
value?: string | number | ||
option?: IRadioOptionData | string | ||
position?: 'left' | 'right' | ||
hollowStyle?: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { IRadioOptionData } from './common' | ||
import { CubeUIComponent } from '../component' | ||
|
||
export declare class CubeRadioGroup extends CubeUIComponent { | ||
value?: string | number | ||
options?: IRadioOptionData[] | string | ||
position?: 'left' | 'right' | ||
horizontal?: boolean | ||
colNum?: number | ||
hollowStyle?: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
|
||
export interface RateSlots { | ||
default: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
export declare class CubeRate extends CubeUIComponent { | ||
value?: number | ||
max?: number | ||
disabled?: boolean | ||
justify?: boolean | ||
$slots: RateSlots | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
|
||
export interface RecycleListSlots { | ||
default: VNode[] | ||
tombstone: VNode[] | ||
item: VNode[] | ||
spinner: VNode[] | ||
noMore: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
export declare class CubeRecycleList extends CubeUIComponent { | ||
infinite?: boolean | ||
size?: number | ||
offset?: number | ||
onFetch: Promise<any[] | false> | ||
reset: () => void | ||
$slots: RecycleListSlots | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
import { BsOption } from 'better-scroll' | ||
|
||
type IScrollEvents = 'scroll' | 'before-scroll-start' | 'scroll-end' | ||
|
||
export interface ScrollSlots { | ||
default: VNode[] | ||
pulldown: VNode[] | ||
pullup: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
export declare class CubeScroll extends CubeUIComponent { | ||
data?: [] | ||
direction?: 'vertical' | 'horizontal' | ||
options?: BsOption | ||
scrollEvents?: IScrollEvents[] | ||
listenScroll?: boolean | ||
listenBeforeScroll?: boolean | ||
refreshDelay?: number | ||
nestMode?: 'none' | 'native' | 'free' | ||
scrollTo: (x?: number, y?: number, time?: number, ease?: object) => void | ||
forceUpdate: (dirty?: boolean, nomore?: boolean) => void | ||
disable: () => void | ||
enable: () => void | ||
resetPullUpTxt: () => void | ||
refresh: () => void | ||
$slots: ScrollSlots | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
import { BsOption } from 'better-scroll' | ||
|
||
export interface ScrollNavSlots { | ||
default: VNode[] | ||
prepend: VNode[] | ||
bar: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
|
||
export declare class CubeScrollNav extends CubeUIComponent { | ||
data?: [] | ||
side?: boolean | ||
current?: string | number | ||
speed?: number | ||
options?: BsOption | ||
refresh: () => void | ||
$slots: ScrollNavSlots | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
import { BsOption } from 'better-scroll' | ||
|
||
export interface ScrollNavBarSlots { | ||
default: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
export declare class CubeScrollNavBar extends CubeUIComponent { | ||
direction?: 'horizontal' | 'vertical' | ||
labels?: [] | ||
txts?: [] | ||
current?: string | number | ||
options?: BsOption | ||
refresh: () => void | ||
$slots: ScrollNavBarSlots | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { CubeUIComponent } from '../component' | ||
|
||
interface IOptItem { | ||
value?: any | ||
text?: string | ||
} | ||
export declare class CubeSelect extends CubeUIComponent { | ||
value?: any | ||
options?: IOptItem[] | ||
placeholder?: string | ||
autoPop?: boolean | ||
disabled?: boolean | ||
title?: string | ||
cancelTxt?: string | ||
confirmTxt?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { VNode } from 'vue' | ||
import { CubeUIComponent } from '../component' | ||
import { BsOption } from 'better-scroll' | ||
|
||
interface SlideItem { | ||
url?: string | ||
image?: string | ||
} | ||
|
||
export interface SlideSlots { | ||
default: VNode[] | ||
dots: VNode[] | ||
[key: string]: VNode[] | ||
} | ||
|
||
export declare class CubeSlide extends CubeUIComponent { | ||
data?: SlideItem[] | ||
initialIndex?: number | ||
loop?: boolean | ||
showDots?: boolean | ||
autoPlay?: boolean | ||
interval?: number | ||
direction?: 'horizontal' | 'vertical' | ||
options?: BsOption | ||
threshold?: number | ||
speed?: number | ||
allowVertical?: boolean | ||
stopPropagation?: boolean | ||
refreshResetCurrent?: boolean | ||
refresh: () => void | ||
$slots: SlideSlots | ||
} |
Oops, something went wrong.