@thestarweb/ui 1.6.1 → 1.7.0
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/dist/star-ui.common.js +8559 -1296
- package/dist/star-ui.common.js.map +1 -1
- package/dist/star-ui.umd.js +8560 -1297
- package/dist/star-ui.umd.js.map +1 -1
- package/dist/star-ui.umd.min.js +139 -139
- package/dist/star-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/content/context-menu-box/index.vue +117 -0
- package/src/components/content/index.ts +5 -1
- package/src/components/{menu → content/menu}/index.vue +0 -0
- package/src/components/{menu → content/menu}/menu-h/index.vue +3 -1
- package/src/components/{menu → content/menu}/menu-h/menu-h-child.vue +0 -0
- package/src/components/{menu → content/menu}/menu-h/menu-h-item.vue +4 -3
- package/src/components/{menu → content/menu}/menu-v/index.vue +0 -0
- package/src/components/content/modals/confirm.vue +45 -0
- package/src/components/content/modals/modal.vue +110 -0
- package/src/components/content/page.vue +1 -1
- package/src/components/form/form/form-item.vue +0 -1
- package/src/func/download.ts +15 -0
- package/src/func/index.ts +2 -0
- package/src/func/modal/index.ts +72 -0
- package/src/global-style.css +2 -0
- package/src/main.ts +3 -1
- package/src/types.d.ts +6 -0
- package/types/components/content/context-menu-box/index.vue.d.ts +20 -0
- package/types/components/content/index.d.ts +4 -0
- package/types/components/{menu → content/menu}/index.vue.d.ts +0 -0
- package/types/components/{menu → content/menu}/menu-h/index.vue.d.ts +0 -0
- package/types/components/{menu → content/menu}/menu-h/menu-h-child.vue.d.ts +0 -0
- package/types/components/{menu → content/menu}/menu-h/menu-h-item.vue.d.ts +0 -0
- package/types/components/{menu → content/menu}/menu-v/index.vue.d.ts +0 -0
- package/types/components/content/modals/confirm.vue.d.ts +7 -0
- package/types/components/content/modals/modal.vue.d.ts +12 -0
- package/types/func/download.d.ts +1 -0
- package/types/func/index.d.ts +2 -0
- package/types/func/modal/index.d.ts +13 -0
- package/types/main.d.ts +1 -1
- package/src/components/menu/index.ts +0 -1
- package/types/components/menu/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="star-ui su-context-menu-box star-ui-context-menu-box" @contextmenu="handleContextMenu">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
<teleport to="body" v-if="isOpenMenu">
|
|
6
|
+
<div ref="mask" :class="['su-context-menu--mask', 'star-ui-context-menu--mask', ...ctrlClass]" @click="handleMaskClick">
|
|
7
|
+
<component :is="component" class="su-context-menu star-ui-context-menu" :style="isMobile ? '' : `top: ${currentY}px; left: ${currentX}px;`" :menu="currentMenu" :itemComponent="itemComponent">
|
|
8
|
+
<template v-slot="data">
|
|
9
|
+
<div class="su-context-menu--item star-ui-context-menu--item" @click="handleItemClick(data)">
|
|
10
|
+
<span class="star-ui-context-menu--text">{{data.title}}</span>
|
|
11
|
+
<span v-if="!data.click">></span>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
</component>
|
|
15
|
+
</div>
|
|
16
|
+
</teleport>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { Vue } from "vue-class-component";
|
|
21
|
+
import { Prop, Register } from "@ui-root/reg";
|
|
22
|
+
import { SuViewCtrlInjectClassName, SuViewCtrlInjectIsMobile } from "@ui-root/outher";
|
|
23
|
+
import MenuBox from "../menu/menu-h/menu-h-child.vue";
|
|
24
|
+
import MenuBoxMobile from "../menu/menu-v/index.vue";
|
|
25
|
+
import MenuItem from "../menu/menu-h/menu-h-item.vue";
|
|
26
|
+
import "@ui-root/global-style.css";
|
|
27
|
+
import { ContextMenuItem } from "@ui-root/types";
|
|
28
|
+
|
|
29
|
+
@Register({
|
|
30
|
+
name:"su-context-menu-box",
|
|
31
|
+
components: {
|
|
32
|
+
MenuBox,
|
|
33
|
+
MenuBoxMobile,
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
export default class SuMain extends Vue {
|
|
37
|
+
private itemComponent = MenuItem;
|
|
38
|
+
declare $refs:{
|
|
39
|
+
mask:HTMLDivElement,
|
|
40
|
+
};
|
|
41
|
+
@SuViewCtrlInjectIsMobile readonly isMobile!:boolean;
|
|
42
|
+
@SuViewCtrlInjectClassName readonly ctrlClass!:string[];
|
|
43
|
+
private get component(){
|
|
44
|
+
if(this.isMobile){
|
|
45
|
+
return MenuBoxMobile;
|
|
46
|
+
}
|
|
47
|
+
return MenuBox;
|
|
48
|
+
}
|
|
49
|
+
@Prop({
|
|
50
|
+
type: [Array, Function],
|
|
51
|
+
required: true,
|
|
52
|
+
})
|
|
53
|
+
private menu!:ContextMenuItem[] | ((ev: MouseEvent) => ContextMenuItem[]);
|
|
54
|
+
private isOpenMenu = false;
|
|
55
|
+
private currentMenu: ContextMenuItem[] = [];
|
|
56
|
+
private currentX = 0;
|
|
57
|
+
private currentY = 0;
|
|
58
|
+
private handleContextMenu(ev: MouseEvent){
|
|
59
|
+
// ev.stopPropagation();
|
|
60
|
+
ev.preventDefault();
|
|
61
|
+
if(typeof this.menu === 'function'){
|
|
62
|
+
this.currentMenu = this.menu(ev) || [];
|
|
63
|
+
}else{
|
|
64
|
+
this.currentMenu = this.menu || [];
|
|
65
|
+
}
|
|
66
|
+
// this.currentMenu=[{title: 'aa', children: [ {title: 'aa.1', click: () => console.log('aa.1 click')} ]}, {title: 'bb', click: () => console.log('bb click')}];
|
|
67
|
+
this.currentX=ev.clientX;
|
|
68
|
+
this.currentY=ev.clientY;
|
|
69
|
+
this.isOpenMenu = true;
|
|
70
|
+
}
|
|
71
|
+
handleMaskClick(ev: MouseEvent){
|
|
72
|
+
if (ev.target === this.$refs.mask) {
|
|
73
|
+
this.isOpenMenu = false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
handleItemClick(item: ContextMenuItem){
|
|
77
|
+
if (item.click) {
|
|
78
|
+
this.isOpenMenu = false;
|
|
79
|
+
item.click();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style>
|
|
86
|
+
.star-ui-context-menu--mask{
|
|
87
|
+
position: fixed;
|
|
88
|
+
top: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
}
|
|
93
|
+
.star-ui-context-menu{
|
|
94
|
+
position: absolute;
|
|
95
|
+
opacity: 1;
|
|
96
|
+
}
|
|
97
|
+
.star-ui-context-menu--item{
|
|
98
|
+
min-width: 100px;
|
|
99
|
+
padding: var(--star-ui-default-padding);
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: row;
|
|
103
|
+
}
|
|
104
|
+
.star-ui-context-menu--text{
|
|
105
|
+
flex: 1;
|
|
106
|
+
}
|
|
107
|
+
.star-ui-view-control-mobile.star-ui-context-menu--mask{
|
|
108
|
+
background: var(--star-ui-mask-color);
|
|
109
|
+
}
|
|
110
|
+
.star-ui-view-control-mobile .star-ui-context-menu{
|
|
111
|
+
width: 100%;
|
|
112
|
+
background-color: var(--star-ui-backgorund-color);
|
|
113
|
+
position: absolute;
|
|
114
|
+
bottom: 0;
|
|
115
|
+
left: 0;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export { default as SuPage } from "./page.vue";
|
|
1
|
+
export { default as SuPage } from "./page.vue";
|
|
2
|
+
export { default as SuMenu } from "./menu/index.vue";
|
|
3
|
+
export { default as SuContextMenuBox } from "./context-menu-box/index.vue";
|
|
4
|
+
export { default as SuModal } from "./modals/modal.vue";
|
|
5
|
+
export { default as SuModalConfirm } from "./modals/confirm.vue";
|
|
File without changes
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<div :class="['star-ui', 'star-ui-menu', 'star-ui-menu-h']">
|
|
3
3
|
<su-h-menu-item v-for="item in menu" :key="item.path" :item="item" childDirection="bottom">
|
|
4
4
|
<template v-slot="data">
|
|
5
|
-
<
|
|
5
|
+
<div class="star-ui star-ui-menu--item star-ui-menu-h--item">
|
|
6
|
+
<slot v-bind="data" />
|
|
7
|
+
</div>
|
|
6
8
|
</template>
|
|
7
9
|
</su-h-menu-item>
|
|
8
10
|
</div>
|
|
File without changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="star-ui star-ui-menu--item-box star-ui-menu-h--item-box">
|
|
3
|
-
<div class="star-ui star-ui-menu--item star-ui-menu-h--item">
|
|
3
|
+
<!-- <div class="star-ui star-ui-menu--item star-ui-menu-h--item" @click="handleItemClick(item)">
|
|
4
4
|
<slot v-bind="item" />
|
|
5
|
-
</div>
|
|
5
|
+
</div> -->
|
|
6
|
+
<slot v-bind="item" />
|
|
6
7
|
<su-h-menu-child :menu="item.children || []" :itemComponent="selfClass" :direction="childDirection">
|
|
7
8
|
<template v-slot="item">
|
|
8
9
|
<slot v-bind="item" />
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
</template>
|
|
13
14
|
|
|
14
15
|
<script lang="ts">
|
|
15
|
-
import { Register, Prop } from "@ui-root/reg";
|
|
16
|
+
import { Register, Prop, Emit } from "@ui-root/reg";
|
|
16
17
|
import { Vue } from "vue-class-component";
|
|
17
18
|
import SuHMenuChild from "./menu-h-child.vue";
|
|
18
19
|
import isFocus from "@ui-root/directives/is-focus";
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<su-modal :visible="visible" @close="close">
|
|
3
|
+
<template v-slot:title>
|
|
4
|
+
{{title}}
|
|
5
|
+
</template>
|
|
6
|
+
<template v-slot:footer>
|
|
7
|
+
<su-button @click="confirm">确认</su-button>
|
|
8
|
+
<su-button @click="close">取消</su-button>
|
|
9
|
+
</template>
|
|
10
|
+
</su-modal>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import { Vue } from 'vue-class-component';
|
|
15
|
+
import { Register, Prop, Emit } from "@ui-root/reg";
|
|
16
|
+
import SuModal from "./modal.vue";
|
|
17
|
+
import {SuButton} from "@ui-root/main";
|
|
18
|
+
|
|
19
|
+
@Register({
|
|
20
|
+
name:"su-modal-confirm",
|
|
21
|
+
components:{
|
|
22
|
+
SuModal,
|
|
23
|
+
SuButton
|
|
24
|
+
},
|
|
25
|
+
hideInDoc: true,
|
|
26
|
+
})
|
|
27
|
+
export default class SuModalConfirm extends Vue {
|
|
28
|
+
@Prop({
|
|
29
|
+
type: String,
|
|
30
|
+
})
|
|
31
|
+
private readonly title!:string|undefined;
|
|
32
|
+
@Prop({
|
|
33
|
+
type: Boolean,
|
|
34
|
+
})
|
|
35
|
+
private readonly visible!:boolean|undefined;
|
|
36
|
+
@Emit()
|
|
37
|
+
private close(){
|
|
38
|
+
return 1;
|
|
39
|
+
}
|
|
40
|
+
@Emit()
|
|
41
|
+
private confirm(){
|
|
42
|
+
return 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<teleport to="body" v-if="locVisable">
|
|
3
|
+
<div class="star-ui-modal--mask">
|
|
4
|
+
<div class="star-ui star-ui-modal su-modal">
|
|
5
|
+
<div class="star-ui-modal--header">
|
|
6
|
+
<div class="star-ui-modal--title">
|
|
7
|
+
<slot name="title" />
|
|
8
|
+
{{title}}
|
|
9
|
+
</div>
|
|
10
|
+
<i class="star-ui-icon-font star-ui-icon-close" @click="close"/>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="star-ui-modal--body">
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
15
|
+
<div class="star-ui-modal--footer">
|
|
16
|
+
<slot name="footer" />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</teleport>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { Vue } from 'vue-class-component';
|
|
25
|
+
import { Register, Prop, Emit } from "@ui-root/reg";
|
|
26
|
+
import "@ui-root/global-style.css";
|
|
27
|
+
import { SuViewCtrlInjectIsMobile } from '@ui-root/outher';
|
|
28
|
+
|
|
29
|
+
@Register({
|
|
30
|
+
name:"su-modal",
|
|
31
|
+
watch: {
|
|
32
|
+
visible(v){
|
|
33
|
+
console.log(v)
|
|
34
|
+
if (typeof v !== 'undefined') {
|
|
35
|
+
this.locVisable = v;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
export default class SuModalConfirm extends Vue {
|
|
41
|
+
@Prop({
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: undefined
|
|
44
|
+
})
|
|
45
|
+
private readonly visible!:boolean|undefined;
|
|
46
|
+
private locVisable = false;
|
|
47
|
+
@Emit('update:visable')
|
|
48
|
+
private updateVisable(visable:boolean):boolean{
|
|
49
|
+
return visable;
|
|
50
|
+
}
|
|
51
|
+
@Emit()
|
|
52
|
+
public close():void{
|
|
53
|
+
if(typeof this.visible === 'undefined'){
|
|
54
|
+
this.locVisable = false;
|
|
55
|
+
}
|
|
56
|
+
this.updateVisable(false);
|
|
57
|
+
}
|
|
58
|
+
public show():void{
|
|
59
|
+
if(typeof this.visible === 'undefined'){
|
|
60
|
+
this.locVisable = true;
|
|
61
|
+
}
|
|
62
|
+
this.updateVisable(true);
|
|
63
|
+
}
|
|
64
|
+
@Prop({
|
|
65
|
+
type: String,
|
|
66
|
+
})
|
|
67
|
+
private readonly title!:string|undefined;
|
|
68
|
+
created():void{
|
|
69
|
+
if (typeof this.visible !== 'undefined') {
|
|
70
|
+
this.locVisable = this.visible;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
@SuViewCtrlInjectIsMobile readonly isMobile!: boolean;
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style>
|
|
78
|
+
.star-ui-modal{
|
|
79
|
+
background-color: var(--star-ui-backgorund-color);
|
|
80
|
+
border-radius: var(--star-ui-border-radius);
|
|
81
|
+
}
|
|
82
|
+
.star-ui-modal--mask{
|
|
83
|
+
position: fixed;
|
|
84
|
+
top: 0;
|
|
85
|
+
left: 0;
|
|
86
|
+
width: 100vw;
|
|
87
|
+
height: 100vh;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
background-color: var(--star-ui-mask-color);
|
|
92
|
+
}
|
|
93
|
+
.star-ui-modal--header,
|
|
94
|
+
.star-ui-modal--body,
|
|
95
|
+
.star-ui-modal--footer{
|
|
96
|
+
padding: var(--star-ui-default-padding);
|
|
97
|
+
}
|
|
98
|
+
.star-ui-modal--header{
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
}
|
|
102
|
+
.star-ui-modal--title{
|
|
103
|
+
flex: 1 1 0;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
}
|
|
106
|
+
.star-ui-modal--header>i{
|
|
107
|
+
flex: 0 0 auto;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
import { Vue } from "vue-class-component";
|
|
37
37
|
import { Prop, Register } from "@ui-root/reg";
|
|
38
38
|
import { SuViewCtrlInjectIsMobile } from "@ui-root/outher";
|
|
39
|
-
import { SuMenu } from "@ui-root/
|
|
39
|
+
import { SuMenu } from "@ui-root/main";
|
|
40
40
|
import { MenuItem } from "@ui-root/types";
|
|
41
41
|
import "@ui-root/global-style.css";
|
|
42
42
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function(data:Blob|Uint8Array, name:string): void{
|
|
2
|
+
let out:Blob;
|
|
3
|
+
if (data instanceof Uint8Array) {
|
|
4
|
+
out = new Blob([data]);
|
|
5
|
+
} else {
|
|
6
|
+
out = data;
|
|
7
|
+
}
|
|
8
|
+
const link = document.createElement('a');
|
|
9
|
+
link.href = URL.createObjectURL(out);
|
|
10
|
+
link.download = name;
|
|
11
|
+
document.body.appendChild(link);
|
|
12
|
+
link.click();
|
|
13
|
+
document.body.removeChild(link);
|
|
14
|
+
URL.revokeObjectURL(link.href);
|
|
15
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createVNode, render, VNode } from 'vue';
|
|
2
|
+
import { SuModal,SuModalConfirm,SuViewControl } from '@ui-root/main';
|
|
3
|
+
|
|
4
|
+
type PWidthClose = Promise<boolean>&{close: () => void};
|
|
5
|
+
export function confirm(title: string):PWidthClose{
|
|
6
|
+
let vnode:VNode;
|
|
7
|
+
const p:Promise<boolean>&{
|
|
8
|
+
close?: () => void;
|
|
9
|
+
} = new Promise<boolean>((resolve) => {
|
|
10
|
+
const dom = document.createElement("div");
|
|
11
|
+
vnode = createVNode(SuModalConfirm, {
|
|
12
|
+
visible: true,
|
|
13
|
+
title,
|
|
14
|
+
onClose: () => {
|
|
15
|
+
if(vnode.props) vnode.props.visible = false;
|
|
16
|
+
render(null, dom);
|
|
17
|
+
resolve(false);
|
|
18
|
+
},
|
|
19
|
+
onConfirm: () => {
|
|
20
|
+
render(null, dom);
|
|
21
|
+
resolve(true);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
render(createVNode(SuViewControl, {}, () => vnode), dom);
|
|
26
|
+
});
|
|
27
|
+
p.close = () => (vnode.component as any).proxy.close();
|
|
28
|
+
return p as PWidthClose;
|
|
29
|
+
}
|
|
30
|
+
export function modal(slots:{
|
|
31
|
+
title?: string|VNode|(() => VNode|string);
|
|
32
|
+
body?: string|VNode|(() => VNode|string);
|
|
33
|
+
footer?: string|VNode|(() => VNode|string);
|
|
34
|
+
}|VNode|string|(() => VNode|string), controlProp = {}, defalueShow = true){
|
|
35
|
+
const sendSlots:Record<string, () => VNode|string> = {};
|
|
36
|
+
if(typeof slots === 'function'){
|
|
37
|
+
sendSlots.default = slots;
|
|
38
|
+
} else if(typeof slots === 'string' || 'type' in slots) {
|
|
39
|
+
sendSlots.default = () => slots;
|
|
40
|
+
} else {
|
|
41
|
+
const map = {
|
|
42
|
+
body: 'defalut',
|
|
43
|
+
}
|
|
44
|
+
Object.keys(slots).forEach((key) => {
|
|
45
|
+
const fn = typeof slots[key as keyof typeof slots];
|
|
46
|
+
sendSlots[key in map ? map[key as keyof typeof map] : key] = typeof fn === "function" ? fn : () => fn;
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
const dom = document.createElement("div");
|
|
50
|
+
const vnode = createVNode(
|
|
51
|
+
SuModal,
|
|
52
|
+
{
|
|
53
|
+
'onUpdate:visable': (value: boolean) => {
|
|
54
|
+
if (value) {
|
|
55
|
+
//
|
|
56
|
+
} else {
|
|
57
|
+
render(null, dom);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
sendSlots,
|
|
62
|
+
);
|
|
63
|
+
render(createVNode(SuViewControl, controlProp, () => vnode), dom);
|
|
64
|
+
|
|
65
|
+
if (defalueShow) {
|
|
66
|
+
(vnode.component as any).proxy.show();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
close: () => (vnode.component as any).proxy.close()
|
|
71
|
+
};
|
|
72
|
+
}
|
package/src/global-style.css
CHANGED
package/src/main.ts
CHANGED
|
@@ -20,10 +20,11 @@ export { default as SuCalendar } from "./components/calendar.vue";
|
|
|
20
20
|
|
|
21
21
|
export { default as SuViewControl } from "./components/view-control.vue";
|
|
22
22
|
|
|
23
|
-
export * from "./components/menu";
|
|
24
23
|
export * from "./components/layout"
|
|
25
24
|
export * from "./components/content";
|
|
26
25
|
|
|
26
|
+
export * as func from "./func/index";
|
|
27
|
+
|
|
27
28
|
import { data } from "./reg";
|
|
28
29
|
export * from "./outher";
|
|
29
30
|
|
|
@@ -51,5 +52,6 @@ export default {
|
|
|
51
52
|
components,
|
|
52
53
|
install(app:App):void{
|
|
53
54
|
registComponents(app)
|
|
55
|
+
app.config.globalProperties
|
|
54
56
|
}
|
|
55
57
|
}
|
package/src/types.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Vue } from "vue-class-component";
|
|
2
|
+
import "@ui-root/global-style.css";
|
|
3
|
+
import { ContextMenuItem } from "../../../types";
|
|
4
|
+
export default class SuMain extends Vue {
|
|
5
|
+
private itemComponent;
|
|
6
|
+
$refs: {
|
|
7
|
+
mask: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
readonly isMobile: boolean;
|
|
10
|
+
readonly ctrlClass: string[];
|
|
11
|
+
private get component();
|
|
12
|
+
private menu;
|
|
13
|
+
private isOpenMenu;
|
|
14
|
+
private currentMenu;
|
|
15
|
+
private currentX;
|
|
16
|
+
private currentY;
|
|
17
|
+
private handleContextMenu;
|
|
18
|
+
handleMaskClick(ev: MouseEvent): void;
|
|
19
|
+
handleItemClick(item: ContextMenuItem): void;
|
|
20
|
+
}
|
|
@@ -1 +1,5 @@
|
|
|
1
1
|
export { default as SuPage } from "./page.vue";
|
|
2
|
+
export { default as SuMenu } from "./menu/index.vue";
|
|
3
|
+
export { default as SuContextMenuBox } from "./context-menu-box/index.vue";
|
|
4
|
+
export { default as SuModal } from "./modals/modal.vue";
|
|
5
|
+
export { default as SuModalConfirm } from "./modals/confirm.vue";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Vue } from 'vue-class-component';
|
|
2
|
+
import "@ui-root/global-style.css";
|
|
3
|
+
export default class SuModalConfirm extends Vue {
|
|
4
|
+
private readonly visible;
|
|
5
|
+
private locVisable;
|
|
6
|
+
private updateVisable;
|
|
7
|
+
close(): void;
|
|
8
|
+
show(): void;
|
|
9
|
+
private readonly title;
|
|
10
|
+
created(): void;
|
|
11
|
+
readonly isMobile: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (data: Blob | Uint8Array, name: string): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
declare type PWidthClose = Promise<boolean> & {
|
|
3
|
+
close: () => void;
|
|
4
|
+
};
|
|
5
|
+
export declare function confirm(title: string): PWidthClose;
|
|
6
|
+
export declare function modal(slots: {
|
|
7
|
+
title?: string | VNode | (() => VNode | string);
|
|
8
|
+
body?: string | VNode | (() => VNode | string);
|
|
9
|
+
footer?: string | VNode | (() => VNode | string);
|
|
10
|
+
} | VNode | string | (() => VNode | string), controlProp?: {}, defalueShow?: boolean): {
|
|
11
|
+
close: () => any;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
package/types/main.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export { default as SuSwitch } from "./components/switch.vue";
|
|
|
14
14
|
export { default as SuSlider } from "./components/slider.vue";
|
|
15
15
|
export { default as SuCalendar } from "./components/calendar.vue";
|
|
16
16
|
export { default as SuViewControl } from "./components/view-control.vue";
|
|
17
|
-
export * from "./components/menu";
|
|
18
17
|
export * from "./components/layout";
|
|
19
18
|
export * from "./components/content";
|
|
19
|
+
export * as func from "./func/index";
|
|
20
20
|
export * from "./outher";
|
|
21
21
|
import { App } from "vue";
|
|
22
22
|
export declare const components: Record<string, any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {default as SuMenu} from "./index.vue";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SuMenu } from "./index.vue";
|