From 6d845889198f9e363f0942000789a9d09a2a7d58 Mon Sep 17 00:00:00 2001 From: yang Date: Tue, 12 Mar 2019 11:30:07 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=20=E6=9B=B4=E6=96=B0d.ts=20file=E5=88=B0?= =?UTF-8?q?3.3.0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/affix.d.ts | 2 +- types/alert.d.ts | 2 +- types/anchor.d.ts | 2 +- types/auto-complete.d.ts | 6 +++++- types/avatar.d.ts | 6 +++++- types/back-top.d.ts | 2 +- types/badge.d.ts | 2 +- types/breadcrumb.d.ts | 2 +- types/button.d.ts | 2 +- types/card.d.ts | 2 +- types/carousel.d.ts | 2 +- types/cascader.d.ts | 2 +- types/cell.d.ts | 2 +- types/checkbox.d.ts | 2 +- types/circle.d.ts | 2 +- types/collapse.d.ts | 2 +- types/color-picker.d.ts | 2 +- types/content.d.ts | 2 +- types/date-picker.d.ts | 6 +++++- types/divider.d.ts | 7 ++++++- types/drawer.d.ts | 19 ++++++++++++++++++- types/dropdown.d.ts | 6 +++++- types/footer.d.ts | 2 +- types/form.d.ts | 2 +- types/grid.d.ts | 2 +- types/header.d.ts | 2 +- types/icon.d.ts | 2 +- types/index.d.ts | 2 +- types/input-number.d.ts | 2 +- types/input.d.ts | 2 +- types/iview.components.d.ts | 2 +- types/layout.d.ts | 15 ++++++++------- types/loading-bar.d.ts | 2 +- types/menu.d.ts | 2 +- types/message.d.ts | 2 +- types/modal.d.ts | 2 +- types/notice.d.ts | 2 +- types/page.d.ts | 2 +- types/poptip.d.ts | 2 +- types/progress.d.ts | 6 +++++- types/radio.d.ts | 2 +- types/rate.d.ts | 2 +- types/scroll.d.ts | 2 +- types/select.d.ts | 6 +++++- types/sider.d.ts | 2 +- types/slider.d.ts | 2 +- types/spin.d.ts | 2 +- types/split.d.ts | 2 +- types/steps.d.ts | 2 +- types/switch.d.ts | 2 +- types/table.d.ts | 18 +++++++++++++++++- types/tabs.d.ts | 2 +- types/tag.d.ts | 2 +- types/time-picker.d.ts | 2 +- types/time.ts | 2 +- types/timeline.d.ts | 2 +- types/tooltip.d.ts | 2 +- types/transfer.d.ts | 2 +- types/tree.d.ts | 7 ++++++- types/upload.d.ts | 7 ++++++- 60 files changed, 139 insertions(+), 66 deletions(-) diff --git a/types/affix.d.ts b/types/affix.d.ts index f812e711..881551c2 100644 --- a/types/affix.d.ts +++ b/types/affix.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/alert.d.ts b/types/alert.d.ts index fe533cd3..b2a8819c 100644 --- a/types/alert.d.ts +++ b/types/alert.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/anchor.d.ts b/types/anchor.d.ts index be1320e0..049d99fe 100644 --- a/types/anchor.d.ts +++ b/types/anchor.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/auto-complete.d.ts b/types/auto-complete.d.ts index fd647ef9..72953c26 100644 --- a/types/auto-complete.d.ts +++ b/types/auto-complete.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -72,4 +72,8 @@ export declare interface AutoComplete extends Vue { * 搜索补全项的时候调用 */ $emit(eventName: 'on-blur', event: KeyboardEvent): this; + /** + * 清空时触发 + */ + $emit(eventName: 'on-clear'): this; } diff --git a/types/avatar.d.ts b/types/avatar.d.ts index 14c21767..8532e5f9 100644 --- a/types/avatar.d.ts +++ b/types/avatar.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -27,4 +27,8 @@ export declare interface Avatar extends Vue { * 自定义图标 */ 'custom-icon'?: string; + /** + * 在设置 src 且图片加载不成功时触发 + */ + $emit(eventName: 'on-error', event: Event): this; } \ No newline at end of file diff --git a/types/back-top.d.ts b/types/back-top.d.ts index 5bfc5481..d190c535 100644 --- a/types/back-top.d.ts +++ b/types/back-top.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/badge.d.ts b/types/badge.d.ts index 46ac4b27..8197c95b 100644 --- a/types/badge.d.ts +++ b/types/badge.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/breadcrumb.d.ts b/types/breadcrumb.d.ts index 81060242..d064419c 100644 --- a/types/breadcrumb.d.ts +++ b/types/breadcrumb.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/button.d.ts b/types/button.d.ts index 60346972..810bdd93 100644 --- a/types/button.d.ts +++ b/types/button.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/card.d.ts b/types/card.d.ts index d7d1d31b..75936c00 100644 --- a/types/card.d.ts +++ b/types/card.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/carousel.d.ts b/types/carousel.d.ts index 1746553a..1044982e 100644 --- a/types/carousel.d.ts +++ b/types/carousel.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/cascader.d.ts b/types/cascader.d.ts index 09676781..b9925b36 100644 --- a/types/cascader.d.ts +++ b/types/cascader.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/cell.d.ts b/types/cell.d.ts index ca9e1790..e7a59710 100644 --- a/types/cell.d.ts +++ b/types/cell.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/checkbox.d.ts b/types/checkbox.d.ts index 65679bdc..041cec6d 100644 --- a/types/checkbox.d.ts +++ b/types/checkbox.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/circle.d.ts b/types/circle.d.ts index 2add0490..2bd9fbe4 100644 --- a/types/circle.d.ts +++ b/types/circle.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/collapse.d.ts b/types/collapse.d.ts index 3856b020..5d58242c 100644 --- a/types/collapse.d.ts +++ b/types/collapse.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/color-picker.d.ts b/types/color-picker.d.ts index e7bf76de..77a9dcaa 100644 --- a/types/color-picker.d.ts +++ b/types/color-picker.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/content.d.ts b/types/content.d.ts index bed131b1..c34cebc8 100644 --- a/types/content.d.ts +++ b/types/content.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/date-picker.d.ts b/types/date-picker.d.ts index 4912086e..cbc4b1c9 100644 --- a/types/date-picker.d.ts +++ b/types/date-picker.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -111,6 +111,10 @@ export declare interface DatePicker extends Vue { * @default {} */ 'time-picker-options'?: object; + /** + * 两个日期间的分隔符 + */ + 'separator'?: string; /** * 日期发生变化时触发 已经格式化后的日期,比如 2016-01-01 */ diff --git a/types/divider.d.ts b/types/divider.d.ts index 8a7899a3..7431f366 100644 --- a/types/divider.d.ts +++ b/types/divider.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -20,4 +20,9 @@ export declare interface Divider extends Vue { * @default false */ dashed?: boolean; + /** + * 尺寸,可选值为 small 或 default + * @default default + */ + size?: string; } \ No newline at end of file diff --git a/types/drawer.d.ts b/types/drawer.d.ts index 3b5c512d..6c209b6f 100644 --- a/types/drawer.d.ts +++ b/types/drawer.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -67,6 +67,15 @@ export declare interface Drawer extends Vue { * @default false */ 'inner'?: boolean; + /** + * 是否开启拖拽调整宽度 + * @default false + */ + 'draggable'?: boolean; + /** + * 返回 Promise 可以阻止关闭 + */ + 'before-close'?: () => void | PromiseConstructor; /** * 关闭抽屉时触发 */ @@ -75,6 +84,10 @@ export declare interface Drawer extends Vue { * 显示状态发生变化时触发 */ $emit(eventName: 'on-visible-change', value: boolean): this; + /** + * 调整宽度时触发,返回宽度 + */ + $emit(eventName: 'on-resize-width'): number; /** * slot插槽对象 */ @@ -91,5 +104,9 @@ export declare interface Drawer extends Vue { * 抽屉主体内容 */ close: VNode[]; + /** + * 自定义调整宽度节点 + */ + trigger: VNode[]; }; } diff --git a/types/dropdown.d.ts b/types/dropdown.d.ts index dc8aa33b..b35b99ee 100644 --- a/types/dropdown.d.ts +++ b/types/dropdown.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -28,6 +28,10 @@ export declare interface Dropdown extends Vue { * @default false */ transfer?: boolean; + /** + * 开启 transfer 时,给浮层添加额外的 class 名称 + */ + 'transfer-class-name'?: string; /** * 点击菜单项时触发 * diff --git a/types/footer.d.ts b/types/footer.d.ts index bffbe036..4f3fafc9 100644 --- a/types/footer.d.ts +++ b/types/footer.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/form.d.ts b/types/form.d.ts index bc88225d..acf1fe5e 100644 --- a/types/form.d.ts +++ b/types/form.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/grid.d.ts b/types/grid.d.ts index cfcac4cb..b7731ed1 100644 --- a/types/grid.d.ts +++ b/types/grid.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/header.d.ts b/types/header.d.ts index 8b87bdf2..b6e14e0e 100644 --- a/types/header.d.ts +++ b/types/header.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/icon.d.ts b/types/icon.d.ts index c6954940..8e9dfae6 100644 --- a/types/icon.d.ts +++ b/types/icon.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/index.d.ts b/types/index.d.ts index d5af1acc..cf004b37 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/input-number.d.ts b/types/input-number.d.ts index 745bc35b..9178058d 100644 --- a/types/input-number.d.ts +++ b/types/input-number.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/input.d.ts b/types/input.d.ts index bd7b2b52..7b4241ab 100644 --- a/types/input.d.ts +++ b/types/input.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/iview.components.d.ts b/types/iview.components.d.ts index db214994..4fb03ee8 100644 --- a/types/iview.components.d.ts +++ b/types/iview.components.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/layout.d.ts b/types/layout.d.ts index 36eb9a5c..9e8a8662 100644 --- a/types/layout.d.ts +++ b/types/layout.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -8,11 +8,12 @@ export declare interface Layout extends Vue { /** * 触发响应式布局的断点,可选值为xs,sm,md,lg,xl或xxl,若不设此属性则不会触发响应式布局。 * { - * xs?: '480px', - * sm?: '768px', - * md?: '992px', - * lg?: '1200px', - * xl?: '1600px' + * xs: '480px', + * sm: '576px', + * md: '768px', + * lg: '992px', + * xl: '1200px', + * xxl: '1600px' * } */ breakpoint?: string; @@ -69,4 +70,4 @@ export declare interface Layout extends Vue { * methods, 改变Sider展开-收起状态。 */ toggleCollapse(): void; -} \ No newline at end of file +}更多· \ No newline at end of file diff --git a/types/loading-bar.d.ts b/types/loading-bar.d.ts index 2d702002..d66d2d57 100644 --- a/types/loading-bar.d.ts +++ b/types/loading-bar.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/menu.d.ts b/types/menu.d.ts index 03aed4f4..0e035982 100644 --- a/types/menu.d.ts +++ b/types/menu.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/message.d.ts b/types/message.d.ts index c209b2c0..56750337 100644 --- a/types/message.d.ts +++ b/types/message.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/modal.d.ts b/types/modal.d.ts index be4ee694..e3900dcc 100644 --- a/types/modal.d.ts +++ b/types/modal.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/notice.d.ts b/types/notice.d.ts index e1cae5ce..edabec8d 100644 --- a/types/notice.d.ts +++ b/types/notice.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/page.d.ts b/types/page.d.ts index 99bd2294..8a832bdb 100644 --- a/types/page.d.ts +++ b/types/page.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/poptip.d.ts b/types/poptip.d.ts index 95a90379..0dee6d3c 100644 --- a/types/poptip.d.ts +++ b/types/poptip.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/progress.d.ts b/types/progress.d.ts index 7662dedf..789b2e87 100644 --- a/types/progress.d.ts +++ b/types/progress.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -35,6 +35,10 @@ export declare interface Progress extends Vue { * @default 0 */ 'success-percent'?: number; + /** + * 进度条的颜色 + */ + 'stroke-color'?: string; /** * slot插槽对象 */ diff --git a/types/radio.d.ts b/types/radio.d.ts index b672b971..9047227c 100644 --- a/types/radio.d.ts +++ b/types/radio.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/rate.d.ts b/types/rate.d.ts index cc76d4a4..9a826b59 100644 --- a/types/rate.d.ts +++ b/types/rate.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/scroll.d.ts b/types/scroll.d.ts index 1e6cc45c..522e9781 100644 --- a/types/scroll.d.ts +++ b/types/scroll.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/select.d.ts b/types/select.d.ts index e6b06c73..5b2c9817 100644 --- a/types/select.d.ts +++ b/types/select.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -88,6 +88,10 @@ export declare interface Select extends Vue { * 给表单元素设置 id,详见 Form 用法。 */ 'element-id'?: string; + /** + * 开启 transfer 时,给浮层添加额外的 class 名称 + */ + 'transfer-class-name'?: string; /** * 选中的Option变化时触发,默认返回 value,如需返回 label,详见 label-in-value 属性 当前选中项 */ diff --git a/types/sider.d.ts b/types/sider.d.ts index ea2152ce..11276068 100644 --- a/types/sider.d.ts +++ b/types/sider.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/slider.d.ts b/types/slider.d.ts index 457ca70a..83664591 100644 --- a/types/slider.d.ts +++ b/types/slider.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/spin.d.ts b/types/spin.d.ts index d363bb89..67d34818 100644 --- a/types/spin.d.ts +++ b/types/spin.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/split.d.ts b/types/split.d.ts index 8d503eff..b01679ed 100644 --- a/types/split.d.ts +++ b/types/split.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/steps.d.ts b/types/steps.d.ts index c16ba660..13ff1b85 100644 --- a/types/steps.d.ts +++ b/types/steps.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/switch.d.ts b/types/switch.d.ts index f8d4e2c6..8b0856d5 100644 --- a/types/switch.d.ts +++ b/types/switch.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/table.d.ts b/types/table.d.ts index ab4f7674..828c5686 100644 --- a/types/table.d.ts +++ b/types/table.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -75,6 +75,16 @@ export declare interface Table extends Vue { * @default 暂无筛选结果 */ "no-filtered-data-text"?: string; + /** + * 是否开启拖拽调整行顺序,需配合 @on-drag-drop 事件使用 + * @default false + */ + "draggable"?: boolean; + /** + * 列使用 tooltip 时,配置它的主题,可选值为 dark 或 light + * @default dark + */ + "tooltip-theme"?: string; /** * 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发 * currentRow:当前高亮行的数据 @@ -154,6 +164,12 @@ export declare interface Table extends Vue { * status:当前的状态 */ $emit(eventName: "on-expand", row: object, status: string): this; + /** + * 拖拽排序松开时触发,返回置换的两行数据索引 + * index1 + * index2 + */ + $emit(eventName: "on-drag-drop", index1: number, index2: number): this; /** * 导出数据 */ diff --git a/types/tabs.d.ts b/types/tabs.d.ts index a7eebaa3..76a49593 100644 --- a/types/tabs.d.ts +++ b/types/tabs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/tag.d.ts b/types/tag.d.ts index 18eb2a18..694420cc 100644 --- a/types/tag.d.ts +++ b/types/tag.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/time-picker.d.ts b/types/time-picker.d.ts index e02d617e..09514ba0 100644 --- a/types/time-picker.d.ts +++ b/types/time-picker.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/time.ts b/types/time.ts index 1f6f85f3..30a9160b 100644 --- a/types/time.ts +++ b/types/time.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/timeline.d.ts b/types/timeline.d.ts index d38f9ff3..fed4e591 100644 --- a/types/timeline.d.ts +++ b/types/timeline.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/tooltip.d.ts b/types/tooltip.d.ts index 02c330b2..e58ff4c3 100644 --- a/types/tooltip.d.ts +++ b/types/tooltip.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/transfer.d.ts b/types/transfer.d.ts index a9945aa1..8bc2e4e6 100644 --- a/types/transfer.d.ts +++ b/types/transfer.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git diff --git a/types/tree.d.ts b/types/tree.d.ts index 61f399b7..d3585561 100644 --- a/types/tree.d.ts +++ b/types/tree.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -43,6 +43,11 @@ export declare interface Tree extends Vue { * @default false */ "check-strictly"?: boolean; + /** + * 开启后,在 show-checkbox 模式下,select 的交互也将转为 check + * @default false + */ + "check-directly"?: boolean; /** * 点击树节点时触发 * @default 当前已勾选节点的数组、当前项 diff --git a/types/upload.d.ts b/types/upload.d.ts index 465ce3fe..70e3f029 100644 --- a/types/upload.d.ts +++ b/types/upload.d.ts @@ -1,4 +1,4 @@ -// Type definitions for iview 3.1.0 +// Type definitions for iview 3.3.0 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git @@ -24,6 +24,11 @@ export declare interface Upload extends Vue { * @default false */ paste?: boolean; + /** + * 是否禁用 + * @default false + */ + disabled?: boolean; /** * 上传时附带的额外参数 */ From 2c00b6fdee383f3de2907b10e3e0848ae485aa88 Mon Sep 17 00:00:00 2001 From: oyv1cent <641027967@qq.com> Date: Wed, 13 Mar 2019 15:56:52 +0800 Subject: [PATCH 02/11] Add Affix component unit test --- test/unit/specs/affix.spec.js | 123 ++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 test/unit/specs/affix.spec.js diff --git a/test/unit/specs/affix.spec.js b/test/unit/specs/affix.spec.js new file mode 100644 index 00000000..11a4922a --- /dev/null +++ b/test/unit/specs/affix.spec.js @@ -0,0 +1,123 @@ +import { createVue, destroyVM } from '../util'; + +describe('Affix.vue', () => { + let vm; + afterEach(() => { + destroyVM(vm); + }); + + it('should create a Affix component without slot', done => { + vm = createVue(''); + expect(vm.$el.children[0].tagName).to.equal('DIV'); + expect(vm.$el.children[0].className).to.equal(''); + done(); + }); + + it('should create a Affix component with slot', done => { + vm = createVue(` + + Fixed at the top + + `); + expect(vm.$el.children[0].children[0].tagName).to.equal('SPAN'); + expect(vm.$el.children[0].children[0].className).to.equal('demo-affix'); + done(); + }); + + it('set offset-top props', done => { + vm = createVue(` +
+ + Fixed at the top + +
+
+ `, true); + expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.false; + expect(vm.$el.children[0].children[0].style.top).to.equal(''); + expect(vm.$el.children[0].children[1].style.display).to.equal('none'); + window.scrollTo(0, 10000); + setTimeout(()=>{ + expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.true; + expect(vm.$el.children[0].children[0].style.top).to.equal('20px'); + expect(vm.$el.children[0].children[1].style.display).to.equal(''); + done(); + }, 100); + }); + + it('set offset-bottom props', done => { + vm = createVue(` +
+
+ + Fixed at the top + +
+
+ `, true); + expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; + expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + // Affix component haven't run handleScroll function when component mounted in real dom. + // use scrollTo() to trigger scroll event. + window.scrollTo(0, 100); + setTimeout(()=>{ + expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.true; + expect(vm.$el.children[1].children[0].style.bottom).to.equal('20px'); + window.scrollTo(0, 10000); + setTimeout(()=>{ + expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; + expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + done(); + }, 100); + }, 100); + }); + + it('both props are set, only offset-bottom is valid', done => { + vm = createVue(` +
+
+ + Fixed at the top + +
+
+ `, true); + expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; + expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + // Affix component haven't run handleScroll function when component mounted in real dom. + // use scrollTo() to trigger scroll event. + window.scrollTo(0, 100); + setTimeout(()=>{ + expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.true; + expect(vm.$el.children[1].children[0].style.bottom).to.equal('20px'); + window.scrollTo(0, 10000); + setTimeout(()=>{ + expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; + expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + done(); + }, 100); + }, 100); + }); + + it('both props not set, should fixed and top equal 0', done => { + vm = createVue(` +
+ + Fixed at the top + +
+
+ `, true); + expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.false; + expect(vm.$el.children[0].children[0].style.top).to.equal(''); + expect(vm.$el.children[0].children[1].style.display).to.equal('none'); + window.scrollTo(0, 10000); + setTimeout(()=>{ + expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.true; + expect(vm.$el.children[0].children[0].style.top).to.equal('0px'); + expect(vm.$el.children[0].children[1].style.display).to.equal(''); + done(); + }, 100); + }); + +}); \ No newline at end of file From 1bf44ee08c1d72f50df8c30f83527b1f519fcd06 Mon Sep 17 00:00:00 2001 From: oyv1cent <641027967@qq.com> Date: Wed, 13 Mar 2019 16:04:24 +0800 Subject: [PATCH 03/11] better description --- test/unit/specs/affix.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/specs/affix.spec.js b/test/unit/specs/affix.spec.js index 11a4922a..20fb0bb0 100644 --- a/test/unit/specs/affix.spec.js +++ b/test/unit/specs/affix.spec.js @@ -13,7 +13,7 @@ describe('Affix.vue', () => { done(); }); - it('should create a Affix component with slot', done => { + it('should create a Affix component contain slot', done => { vm = createVue(` Fixed at the top @@ -24,7 +24,7 @@ describe('Affix.vue', () => { done(); }); - it('set offset-top props', done => { + it('only set offset-top props', done => { vm = createVue(`
@@ -45,7 +45,7 @@ describe('Affix.vue', () => { }, 100); }); - it('set offset-bottom props', done => { + it('only set offset-bottom props', done => { vm = createVue(`
@@ -99,7 +99,7 @@ describe('Affix.vue', () => { }, 100); }); - it('both props not set, should fixed and top equal 0', done => { + it('both props are not set, should fixed top and top equal 0px', done => { vm = createVue(`
From e1f6c928195791584f45001f6b494e1be859eaac Mon Sep 17 00:00:00 2001 From: oyv1cent <641027967@qq.com> Date: Wed, 13 Mar 2019 16:26:22 +0800 Subject: [PATCH 04/11] optimization --- test/unit/specs/affix.spec.js | 70 +++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/test/unit/specs/affix.spec.js b/test/unit/specs/affix.spec.js index 20fb0bb0..55344ae1 100644 --- a/test/unit/specs/affix.spec.js +++ b/test/unit/specs/affix.spec.js @@ -8,8 +8,10 @@ describe('Affix.vue', () => { it('should create a Affix component without slot', done => { vm = createVue(''); - expect(vm.$el.children[0].tagName).to.equal('DIV'); - expect(vm.$el.children[0].className).to.equal(''); + const affix = vm.$el.children[0]; + + expect(affix.tagName).to.equal('DIV'); + expect(affix.className).to.equal(''); done(); }); @@ -19,8 +21,10 @@ describe('Affix.vue', () => { Fixed at the top `); - expect(vm.$el.children[0].children[0].tagName).to.equal('SPAN'); - expect(vm.$el.children[0].children[0].className).to.equal('demo-affix'); + const slot = vm.$el.children[0].children[0]; + + expect(slot.tagName).to.equal('SPAN'); + expect(slot.className).to.equal('demo-affix'); done(); }); @@ -33,14 +37,17 @@ describe('Affix.vue', () => {
`, true); - expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.false; - expect(vm.$el.children[0].children[0].style.top).to.equal(''); - expect(vm.$el.children[0].children[1].style.display).to.equal('none'); + const affix = vm.$el.children[0].children[0]; + const fakeBlock = vm.$el.children[0].children[1]; + + expect(affix.classList.contains('ivu-affix')).to.false; + expect(affix.style.top).to.equal(''); + expect(fakeBlock.style.display).to.equal('none'); window.scrollTo(0, 10000); setTimeout(()=>{ - expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.true; - expect(vm.$el.children[0].children[0].style.top).to.equal('20px'); - expect(vm.$el.children[0].children[1].style.display).to.equal(''); + expect(affix.classList.contains('ivu-affix')).to.true; + expect(affix.style.top).to.equal('20px'); + expect(fakeBlock.style.display).to.equal(''); done(); }, 100); }); @@ -55,18 +62,20 @@ describe('Affix.vue', () => {
`, true); - expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; - expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + const affix = vm.$el.children[1].children[0]; + + expect(affix.classList.contains('ivu-affix')).to.false; + expect(affix.style.bottom).to.equal(''); // Affix component haven't run handleScroll function when component mounted in real dom. // use scrollTo() to trigger scroll event. window.scrollTo(0, 100); setTimeout(()=>{ - expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.true; - expect(vm.$el.children[1].children[0].style.bottom).to.equal('20px'); + expect(affix.classList.contains('ivu-affix')).to.true; + expect(affix.style.bottom).to.equal('20px'); window.scrollTo(0, 10000); setTimeout(()=>{ - expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; - expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + expect(affix.classList.contains('ivu-affix')).to.false; + expect(affix.style.bottom).to.equal(''); done(); }, 100); }, 100); @@ -82,18 +91,20 @@ describe('Affix.vue', () => {
`, true); - expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; - expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + const affix = vm.$el.children[1].children[0]; + + expect(affix.classList.contains('ivu-affix')).to.false; + expect(affix.style.bottom).to.equal(''); // Affix component haven't run handleScroll function when component mounted in real dom. // use scrollTo() to trigger scroll event. window.scrollTo(0, 100); setTimeout(()=>{ - expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.true; - expect(vm.$el.children[1].children[0].style.bottom).to.equal('20px'); + expect(affix.classList.contains('ivu-affix')).to.true; + expect(affix.style.bottom).to.equal('20px'); window.scrollTo(0, 10000); setTimeout(()=>{ - expect(vm.$el.children[1].children[0].classList.contains('ivu-affix')).to.false; - expect(vm.$el.children[1].children[0].style.bottom).to.equal(''); + expect(affix.classList.contains('ivu-affix')).to.false; + expect(affix.style.bottom).to.equal(''); done(); }, 100); }, 100); @@ -108,14 +119,17 @@ describe('Affix.vue', () => {
`, true); - expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.false; - expect(vm.$el.children[0].children[0].style.top).to.equal(''); - expect(vm.$el.children[0].children[1].style.display).to.equal('none'); + const affix = vm.$el.children[0].children[0]; + const fakeBlock = vm.$el.children[0].children[1]; + + expect(affix.classList.contains('ivu-affix')).to.false; + expect(affix.style.top).to.equal(''); + expect(fakeBlock.style.display).to.equal('none'); window.scrollTo(0, 10000); setTimeout(()=>{ - expect(vm.$el.children[0].children[0].classList.contains('ivu-affix')).to.true; - expect(vm.$el.children[0].children[0].style.top).to.equal('0px'); - expect(vm.$el.children[0].children[1].style.display).to.equal(''); + expect(affix.classList.contains('ivu-affix')).to.true; + expect(affix.style.top).to.equal('0px'); + expect(fakeBlock.style.display).to.equal(''); done(); }, 100); }); From fdcf4cb635326b5b1afce99095193058311e1e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Fri, 15 Mar 2019 14:25:26 +0800 Subject: [PATCH 05/11] close #5397 --- src/styles/components/drawer.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/styles/components/drawer.less b/src/styles/components/drawer.less index de903122..41cf3a86 100644 --- a/src/styles/components/drawer.less +++ b/src/styles/components/drawer.less @@ -96,6 +96,10 @@ &-no-mask{ pointer-events: none; + + .@{drawer-prefix-cls}-drag{ + pointer-events: auto; + } } &-drag{ From c9985ada18c7303b12ffbefe5be24b00b5e849c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Fri, 15 Mar 2019 14:45:10 +0800 Subject: [PATCH 06/11] fix #5352 --- src/components/form/form-item.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/form/form-item.vue b/src/components/form/form-item.vue index 88d3e299..d1e78464 100644 --- a/src/components/form/form-item.vue +++ b/src/components/form/form-item.vue @@ -84,9 +84,12 @@ }; }, watch: { - error (val) { - this.validateMessage = val; - this.validateState = val === '' ? '' : 'error'; + error: { + handler (val) { + this.validateMessage = val; + this.validateState = val ? 'error' : ''; + }, + immediate: true }, validateStatus (val) { this.validateState = val; From 5b143a2b3f0d690f6a48b251203c68de97abe55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Fri, 15 Mar 2019 15:44:27 +0800 Subject: [PATCH 07/11] fixed #5401 , close #5403 --- examples/routers/tabs.vue | 48 +++++++----------------------------- src/components/tabs/pane.vue | 5 ++++ src/components/tabs/tabs.vue | 8 ++++++ 3 files changed, 22 insertions(+), 39 deletions(-) diff --git a/examples/routers/tabs.vue b/examples/routers/tabs.vue index 5c6edace..38ac2f05 100644 --- a/examples/routers/tabs.vue +++ b/examples/routers/tabs.vue @@ -1,48 +1,18 @@