vue-devui 1.5.7-hotfix.3 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/code-review/index.es.js +357 -8
- package/code-review/index.umd.js +74 -19
- package/code-review/style.css +1 -1
- package/git-graph/index.es.js +6061 -0
- package/git-graph/index.umd.js +32 -0
- package/git-graph/package.json +8 -0
- package/global.d.ts +1 -0
- package/nuxt/components/GitGraph.js +2 -0
- package/nuxt/components/gitGraphProps.js +2 -0
- package/package.json +2 -1
- package/style.css +1 -1
- package/types/code-review/src/code-review-types.d.ts +16 -0
- package/types/code-review/src/code-review.d.ts +10 -1
- package/types/code-review/src/components/code-review-icons.d.ts +4 -0
- package/types/code-review/src/composables/use-code-review-comment.d.ts +13 -0
- package/types/code-review/src/composables/use-code-review-expand.d.ts +5 -0
- package/types/code-review/src/composables/use-code-review.d.ts +2 -0
- package/types/code-review/src/const.d.ts +2 -0
- package/types/code-review/src/utils.d.ts +7 -0
- package/types/git-graph/index.d.ts +11 -0
- package/types/git-graph/src/git-graph-class.d.ts +43 -0
- package/types/git-graph/src/git-graph-types.d.ts +84 -0
- package/types/git-graph/src/git-graph.d.ts +10 -0
- package/types/git-graph/src/use-git-graph.d.ts +6 -0
- package/types/vue-devui.d.ts +2 -1
- package/vue-devui.es.js +989 -12
- package/vue-devui.umd.js +124 -64
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { ExtractPropTypes, InjectionKey, PropType, SetupContext, Ref } from 'vue';
|
|
2
2
|
import type { DiffFile } from 'diff2html/lib/types';
|
|
3
3
|
export declare type OutputFormat = 'line-by-line' | 'side-by-side';
|
|
4
|
+
export declare type ExpandDirection = 'up' | 'down' | 'updown' | 'all';
|
|
5
|
+
export declare type LineSide = 'left' | 'right';
|
|
6
|
+
export interface CommentPosition {
|
|
7
|
+
left: number;
|
|
8
|
+
right: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CodeReviewMethods {
|
|
11
|
+
toggleFold: (status?: boolean) => void;
|
|
12
|
+
insertComment: (lineNumber: number, lineSide: LineSide, commentDom: HTMLElement) => void;
|
|
13
|
+
removeComment: (lineNumber: number, lineSide: LineSide) => void;
|
|
14
|
+
}
|
|
4
15
|
export declare const codeReviewProps: {
|
|
5
16
|
diff: {
|
|
6
17
|
type: StringConstructor;
|
|
@@ -15,9 +26,14 @@ export declare const codeReviewProps: {
|
|
|
15
26
|
type: PropType<OutputFormat>;
|
|
16
27
|
default: string;
|
|
17
28
|
};
|
|
29
|
+
expandAllThreshold: {
|
|
30
|
+
type: NumberConstructor;
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
18
33
|
};
|
|
19
34
|
export declare type CodeReviewProps = ExtractPropTypes<typeof codeReviewProps>;
|
|
20
35
|
export interface CodeReviewContext {
|
|
36
|
+
reviewContentRef: Ref<HTMLElement>;
|
|
21
37
|
diffInfo: DiffFile;
|
|
22
38
|
isFold: Ref<boolean>;
|
|
23
39
|
rootCtx: SetupContext;
|
|
@@ -13,7 +13,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
type: import("vue").PropType<import("./code-review-types").OutputFormat>;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
expandAllThreshold: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "foldChange" | "addComment" | "afterViewInit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
21
|
diff: {
|
|
18
22
|
type: StringConstructor;
|
|
19
23
|
required: boolean;
|
|
@@ -27,9 +31,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
31
|
type: import("vue").PropType<import("./code-review-types").OutputFormat>;
|
|
28
32
|
default: string;
|
|
29
33
|
};
|
|
34
|
+
expandAllThreshold: {
|
|
35
|
+
type: NumberConstructor;
|
|
36
|
+
default: number;
|
|
37
|
+
};
|
|
30
38
|
}>>, {
|
|
31
39
|
diff: string;
|
|
32
40
|
fold: boolean;
|
|
33
41
|
outputFormat: import("./code-review-types").OutputFormat;
|
|
42
|
+
expandAllThreshold: number;
|
|
34
43
|
}>;
|
|
35
44
|
export default _default;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export declare function FoldIcon(): JSX.Element;
|
|
2
2
|
export declare function CopyIcon(): JSX.Element;
|
|
3
|
+
export declare function CommentIcon(): JSX.Element;
|
|
4
|
+
export declare function UpExpandIcon(): string;
|
|
5
|
+
export declare function DownExpandIcon(): string;
|
|
6
|
+
export declare function AllExpandIcon(): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SetupContext, Ref } from 'vue';
|
|
2
|
+
import type { LineSide } from '../code-review-types';
|
|
3
|
+
export declare function useCodeReviewComment(reviewContentRef: Ref<HTMLElement>, ctx: SetupContext): {
|
|
4
|
+
commentLeft: Ref<number>;
|
|
5
|
+
commentTop: Ref<number>;
|
|
6
|
+
onMouseEnter: (e: MouseEvent) => void;
|
|
7
|
+
onMouseMove: (e: MouseEvent) => void;
|
|
8
|
+
onMouseleave: (e: MouseEvent) => void;
|
|
9
|
+
onCommentMouseLeave: (e: MouseEvent) => void;
|
|
10
|
+
onCommentIconClick: () => void;
|
|
11
|
+
insertComment: (lineNumber: number, lineSide: LineSide, commentDom: HTMLElement) => void;
|
|
12
|
+
removeComment: (lineNumber: number, lineSide: LineSide) => void;
|
|
13
|
+
};
|
|
@@ -3,4 +3,6 @@ import type { CodeReviewProps } from '../code-review-types';
|
|
|
3
3
|
export declare function useCodeReview(props: CodeReviewProps, ctx: SetupContext): {
|
|
4
4
|
renderHtml: import("vue").Ref<string>;
|
|
5
5
|
isFold: import("vue").Ref<boolean>;
|
|
6
|
+
reviewContentRef: import("vue").Ref<any>;
|
|
7
|
+
toggleFold: (status?: boolean | undefined) => void;
|
|
6
8
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OutputFormat, ExpandDirection, LineSide } from './code-review-types';
|
|
2
|
+
export declare function notEmptyNode(node: HTMLElement): boolean;
|
|
3
|
+
export declare function insertNode(parent: HTMLElement, child: HTMLElement): void;
|
|
4
|
+
export declare function addExpandButton(parentNode: HTMLElement, className: string, icon: string): void;
|
|
5
|
+
export declare function attachToggleButton(dom: HTMLElement, outputFormat: OutputFormat): void;
|
|
6
|
+
export declare function attachExpandUpDownButton(parentNode: HTMLElement, direction: ExpandDirection): void;
|
|
7
|
+
export declare function addCommentToPage(lineHost: HTMLElement, commentDom: HTMLElement, lineSide: LineSide): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import GitGraph from './src/git-graph';
|
|
3
|
+
export * from './src/git-graph-types';
|
|
4
|
+
export { GitGraph };
|
|
5
|
+
declare const _default: {
|
|
6
|
+
title: string;
|
|
7
|
+
category: string;
|
|
8
|
+
status: string;
|
|
9
|
+
install(app: App): void;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CommitInfo, GitGraphData } from "./git-graph-types";
|
|
2
|
+
export declare class GitGraph {
|
|
3
|
+
element?: HTMLElement;
|
|
4
|
+
options?: GitGraphData;
|
|
5
|
+
mtime: number;
|
|
6
|
+
mspace: number;
|
|
7
|
+
parents: any;
|
|
8
|
+
offsetX: number;
|
|
9
|
+
offsetY: number;
|
|
10
|
+
unitTime: number;
|
|
11
|
+
unitSpace: number;
|
|
12
|
+
prev_start: number;
|
|
13
|
+
preparedCommits: any;
|
|
14
|
+
preStart: number;
|
|
15
|
+
isDark: boolean;
|
|
16
|
+
daysBefore: string;
|
|
17
|
+
hoursAgo: string;
|
|
18
|
+
minutesAgo: string;
|
|
19
|
+
aMinutesAgo: string;
|
|
20
|
+
maxNameLength: number;
|
|
21
|
+
commits: CommitInfo[];
|
|
22
|
+
graphHeight: number;
|
|
23
|
+
graphWidth: number;
|
|
24
|
+
svg: any;
|
|
25
|
+
barHeight: number;
|
|
26
|
+
messageBoxWidth: number;
|
|
27
|
+
colors: string[];
|
|
28
|
+
toolTipList: any;
|
|
29
|
+
load(element: HTMLElement, options: GitGraphData, isDark: boolean): void;
|
|
30
|
+
prepareData(commits: CommitInfo[]): void;
|
|
31
|
+
collectParent(): number[][];
|
|
32
|
+
buildGraph(refName: string): void;
|
|
33
|
+
setNodeAttr(node: Element, attrs: any): void;
|
|
34
|
+
__transform(time: any): string;
|
|
35
|
+
renderPartialGraph(refName: string): void;
|
|
36
|
+
drawDot(x: number, y: number, commit: CommitInfo): void;
|
|
37
|
+
drawLines(x: number, y: number, commit: CommitInfo): void;
|
|
38
|
+
appendLabel(x: number, y: number, commit: CommitInfo): void;
|
|
39
|
+
appendAnchor(x: number, y: number, commit: CommitInfo, refName: any): void;
|
|
40
|
+
getText(x: number, y: number, text: any, attrs?: any): SVGTextElement;
|
|
41
|
+
commitTooltip(x: number, y: number, commit: CommitInfo, isDark: boolean): void;
|
|
42
|
+
textWrap(t: any, width: any, x: any): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from "vue";
|
|
2
|
+
export interface CommitInfo {
|
|
3
|
+
author: {
|
|
4
|
+
name: string;
|
|
5
|
+
email: string;
|
|
6
|
+
/**
|
|
7
|
+
* 提交者头像地址
|
|
8
|
+
*/
|
|
9
|
+
avatar_url?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 提交时间
|
|
13
|
+
*/
|
|
14
|
+
date: string;
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* commit信息
|
|
18
|
+
*/
|
|
19
|
+
message: string;
|
|
20
|
+
/**
|
|
21
|
+
* 父级节点信息,包含父级的id和space
|
|
22
|
+
* @example [['deffajsdfasdasd056215421', 1], ['asdasdasddkfhjksdfhkjegfajszbg', 3]]
|
|
23
|
+
*/
|
|
24
|
+
parents: any[][];
|
|
25
|
+
/**
|
|
26
|
+
* 分支名称或标签名称
|
|
27
|
+
*/
|
|
28
|
+
refs?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 横向空间位置,从主分支为1开始,没向外一层+2,第i层为2i - 1
|
|
31
|
+
* 用于计算绘图尺寸和横向最大宽度
|
|
32
|
+
*/
|
|
33
|
+
space: number;
|
|
34
|
+
/**
|
|
35
|
+
* 等于commits数组index,用于计算纵向尺寸
|
|
36
|
+
*/
|
|
37
|
+
time: number;
|
|
38
|
+
/**
|
|
39
|
+
* 可选,自定义点击commit信息的跳转url
|
|
40
|
+
*/
|
|
41
|
+
customUrl?: string;
|
|
42
|
+
/**
|
|
43
|
+
* 分支名称,展示在hover面板中
|
|
44
|
+
*/
|
|
45
|
+
branch?: string;
|
|
46
|
+
hasDrawn?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface GitGraphData {
|
|
49
|
+
/**
|
|
50
|
+
* 绘图数据
|
|
51
|
+
*/
|
|
52
|
+
data: {
|
|
53
|
+
/**
|
|
54
|
+
* 提交日期数据
|
|
55
|
+
* @example [['7日', '7月'], ['6日', '7月']]
|
|
56
|
+
*/
|
|
57
|
+
days: string[][];
|
|
58
|
+
commits: CommitInfo[];
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* 跳转更改页面的url模板,会自动替换其中的‘{commitId}’
|
|
62
|
+
* @example https://xxxx/{commitId}
|
|
63
|
+
*/
|
|
64
|
+
commit_url: string;
|
|
65
|
+
params: {
|
|
66
|
+
/**
|
|
67
|
+
* 时间提示,默认为'xx天前','xx小时前','xx分钟前','1分钟前'
|
|
68
|
+
*/
|
|
69
|
+
daysBefore?: string;
|
|
70
|
+
hoursAgo?: string;
|
|
71
|
+
minutesAgo?: string;
|
|
72
|
+
aMinutesAgo?: string;
|
|
73
|
+
/**
|
|
74
|
+
* 用户名称最大长度
|
|
75
|
+
*/
|
|
76
|
+
maxNameLength?: number;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export declare const gitGraphProps: {
|
|
80
|
+
option: {
|
|
81
|
+
type: PropType<GitGraphData>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export declare type GitGraphProps = ExtractPropTypes<typeof gitGraphProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
option: {
|
|
3
|
+
type: import("vue").PropType<import("./git-graph-types").GitGraphData>;
|
|
4
|
+
};
|
|
5
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "scrollToBottom", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
6
|
+
option: {
|
|
7
|
+
type: import("vue").PropType<import("./git-graph-types").GitGraphData>;
|
|
8
|
+
};
|
|
9
|
+
}>>, {}>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Ref, SetupContext } from "vue";
|
|
2
|
+
import { GitGraphData, GitGraphProps } from "./git-graph-types";
|
|
3
|
+
export default function useGitGraph(props: GitGraphProps, ctx: SetupContext, isDark: Ref<boolean>): {
|
|
4
|
+
initTheme: () => void;
|
|
5
|
+
initGraph: (element: HTMLElement, options: GitGraphData, isDarkMode: boolean) => void;
|
|
6
|
+
};
|
package/types/vue-devui.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { EditorMd, MdRender } from './editor-md';
|
|
|
30
30
|
import { Form, FormItem, FormOperation } from './form';
|
|
31
31
|
import { Fullscreen } from './fullscreen';
|
|
32
32
|
import { Gantt } from './gantt';
|
|
33
|
+
import { GitGraph } from './git-graph';
|
|
33
34
|
import { Row, Col } from './grid';
|
|
34
35
|
import { Icon, IconGroup } from './icon';
|
|
35
36
|
import { ImagePreviewDirective, ImagePreviewService } from './image-preview';
|
|
@@ -83,7 +84,7 @@ import { TreeSelect } from './tree-select';
|
|
|
83
84
|
import { Upload, fileDropDirective } from './upload';
|
|
84
85
|
import { VirtualList } from './virtual-list';
|
|
85
86
|
import './style/devui.scss';
|
|
86
|
-
export { Accordion, ActionTimeline, Alert, Anchor, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Card, Carousel, CarouselItem, Cascader, Checkbox, CheckboxGroup, CheckboxButton, CodeEditor, CodeReview, Collapse, CollapseItem, ColorPicker, Comment, Countdown, DatePicker, StickSlider, DatePickerPro, DRangeDatePickerPro, DraggableDirective, DroppableDirective, SortableDirective, Drawer, DrawerService, Dropdown, DropdownMenu, DChart, EditableSelect, EditorMd, MdRender, Form, FormItem, FormOperation, Fullscreen, Gantt, Row, Col, Icon, IconGroup, ImagePreviewDirective, ImagePreviewService, Input, InputIcon, InputNumber, Layout, Content, Header, Footer, Aside, List, ListItem, LoadingService, LoadingDirective, Mention, Menu, SubMenu, MenuItem, Message, Modal, ModalHeader, ModalBody, ModalFooter, MultiAutoComplete, NavSprite, Notification, NotificationService, FlexibleOverlay, FixedOverlay, Pagination, Panel, PanelHeader, PanelBody, PanelFooter, Popover, Progress, QuadrantDiagram, Radio, RadioGroup, RadioButton, Rate, ReadTip, Result, RippleDirective, Search, Select, Option, OptionGroup, Skeleton, SkeletonItem, Slider, Splitter, SplitterPane, Statistic, Status, Steps, Step, StepsGuide, StepsGuideDirective, Sticky, Switch, Table, Column, Tabs, Tab, Tag, TagInput, Textarea, TimePicker, TimeSelect, Timeline, TimelineItem, Tooltip, Transfer, Tree, TreeSelect, Upload, fileDropDirective, VirtualList };
|
|
87
|
+
export { Accordion, ActionTimeline, Alert, Anchor, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Card, Carousel, CarouselItem, Cascader, Checkbox, CheckboxGroup, CheckboxButton, CodeEditor, CodeReview, Collapse, CollapseItem, ColorPicker, Comment, Countdown, DatePicker, StickSlider, DatePickerPro, DRangeDatePickerPro, DraggableDirective, DroppableDirective, SortableDirective, Drawer, DrawerService, Dropdown, DropdownMenu, DChart, EditableSelect, EditorMd, MdRender, Form, FormItem, FormOperation, Fullscreen, Gantt, GitGraph, Row, Col, Icon, IconGroup, ImagePreviewDirective, ImagePreviewService, Input, InputIcon, InputNumber, Layout, Content, Header, Footer, Aside, List, ListItem, LoadingService, LoadingDirective, Mention, Menu, SubMenu, MenuItem, Message, Modal, ModalHeader, ModalBody, ModalFooter, MultiAutoComplete, NavSprite, Notification, NotificationService, FlexibleOverlay, FixedOverlay, Pagination, Panel, PanelHeader, PanelBody, PanelFooter, Popover, Progress, QuadrantDiagram, Radio, RadioGroup, RadioButton, Rate, ReadTip, Result, RippleDirective, Search, Select, Option, OptionGroup, Skeleton, SkeletonItem, Slider, Splitter, SplitterPane, Statistic, Status, Steps, Step, StepsGuide, StepsGuideDirective, Sticky, Switch, Table, Column, Tabs, Tab, Tag, TagInput, Textarea, TimePicker, TimeSelect, Timeline, TimelineItem, Tooltip, Transfer, Tree, TreeSelect, Upload, fileDropDirective, VirtualList };
|
|
87
88
|
declare const _default: {
|
|
88
89
|
version: string;
|
|
89
90
|
install(app: App): void;
|