@thestarweb/ui 1.4.0 → 1.5.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/build-ts/main.js +26 -4
- package/dist/star-ui.common.js +24800 -2754
- package/dist/star-ui.common.js.map +1 -1
- package/dist/star-ui.umd.js +24800 -2754
- package/dist/star-ui.umd.js.map +1 -1
- package/dist/star-ui.umd.min.js +280 -3
- package/dist/star-ui.umd.min.js.map +1 -1
- package/package.json +3 -2
- package/readme.md +2 -2
- package/src/components/button.vue +3 -3
- package/src/components/calendar.vue +193 -47
- package/src/components/call-render.tsx +22 -0
- package/src/components/card.vue +4 -4
- package/src/components/content/index.ts +1 -0
- package/src/components/content/page.vue +117 -0
- package/src/components/input.vue +5 -5
- package/src/components/layout-h.vue +3 -4
- package/src/components/layout-main.vue +3 -2
- package/src/components/layout-v.vue +3 -2
- package/src/components/line-h.vue +9 -8
- package/src/components/line-v.vue +9 -8
- package/src/components/menu/index.ts +1 -0
- package/src/components/menu/index.vue +83 -0
- package/src/components/menu/menu-h/index.vue +66 -0
- package/src/components/menu/menu-h/menu-h-child.vue +74 -0
- package/src/components/menu/menu-h/menu-h-item.vue +65 -0
- package/src/components/menu/menu-v/index.vue +56 -0
- package/src/components/select.vue +3 -3
- package/src/components/slider.vue +33 -8
- package/src/components/switch.vue +43 -43
- package/src/components/table.vue +3 -3
- package/src/components/tree/index.vue +3 -3
- package/src/components/tree/tree-item.vue +5 -4
- package/src/components/view-control.vue +3 -4
- package/src/directives/is-focus.ts +10 -0
- package/src/global-style.css +3 -0
- package/src/icon-font/iconfont.css +17 -7
- package/src/icon-font/iconfont.json +22 -1
- package/src/icon-font/iconfont.ttf +0 -0
- package/src/icon-font/iconfont.woff +0 -0
- package/src/icon-font/iconfont.woff2 +0 -0
- package/src/main.ts +36 -25
- package/src/reg.ts +26 -6
- package/src/types.d.ts +6 -0
- package/src/utils.ts +1 -1
- package/types/components/button.vue.d.ts +1 -1
- package/types/components/calendar.vue.d.ts +20 -4
- package/types/components/call-render.d.ts +6 -0
- package/types/components/content/index.d.ts +1 -0
- package/types/components/content/page.vue.d.ts +10 -0
- package/types/components/layout-h.vue.d.ts +1 -1
- package/types/components/layout-main.vue.d.ts +1 -1
- package/types/components/layout-v.vue.d.ts +1 -1
- package/types/components/line-h.vue.d.ts +1 -1
- package/types/components/line-v.vue.d.ts +1 -1
- package/types/components/menu/index.d.ts +1 -0
- package/types/components/menu/index.vue.d.ts +12 -0
- package/types/components/menu/menu-h/index.vue.d.ts +8 -0
- package/types/components/menu/menu-h/menu-h-child.vue.d.ts +7 -0
- package/types/components/menu/menu-h/menu-h-item.vue.d.ts +8 -0
- package/types/components/menu/menu-v/index.vue.d.ts +9 -0
- package/types/components/slider.vue.d.ts +2 -0
- package/types/directives/is-focus.d.ts +4 -0
- package/types/main.d.ts +68 -6
- package/types/reg.d.ts +18 -5
- package/dist/img/iconfont.ff1d7f50.svg +0 -62
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="menuComponent" :menu="menu" class="su-menu">
|
|
3
|
+
<template v-slot="data">
|
|
4
|
+
<div @click="handleItemClick(data)">
|
|
5
|
+
<slot v-if="$slots['default']" v-bind="data" />
|
|
6
|
+
<component v-else :is="displayComponent" :[useedKey]="data.path" @click.prevent>
|
|
7
|
+
{{data.title}}
|
|
8
|
+
</component>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
16
|
+
import { ConcreteComponent } from "vue";
|
|
17
|
+
import { Vue } from "vue-class-component";
|
|
18
|
+
import HMenu from "./menu-h/index.vue";
|
|
19
|
+
import VMenu from "./menu-v/index.vue";
|
|
20
|
+
import { MenuItem } from "@ui-root/types";
|
|
21
|
+
import '@ui-root/global-style.css';
|
|
22
|
+
|
|
23
|
+
@Register({
|
|
24
|
+
name: 'su-menu',
|
|
25
|
+
})
|
|
26
|
+
export default class SuHMenu extends Vue {
|
|
27
|
+
@Prop({
|
|
28
|
+
type: Array,
|
|
29
|
+
required: true,
|
|
30
|
+
})
|
|
31
|
+
private menu!:MenuItem[];
|
|
32
|
+
@Prop({
|
|
33
|
+
type: String,
|
|
34
|
+
required: true,
|
|
35
|
+
default: 'h'
|
|
36
|
+
})
|
|
37
|
+
private direction!:"h"|"v"|"row";
|
|
38
|
+
private get menuComponent(){
|
|
39
|
+
if (["h",'row','r'].includes(this.direction)){
|
|
40
|
+
return HMenu;
|
|
41
|
+
}
|
|
42
|
+
return VMenu;
|
|
43
|
+
}
|
|
44
|
+
@Prop({
|
|
45
|
+
type: [String,Function,Object],
|
|
46
|
+
default: undefined,
|
|
47
|
+
})
|
|
48
|
+
private component!:string|Vue|Record<string, unknown>|ConcreteComponent|undefined;
|
|
49
|
+
private get displayComponent():string|Vue|ConcreteComponent|Record<string, unknown>{
|
|
50
|
+
if(this.component) return this.component;
|
|
51
|
+
// const vueRouterLink = resolveComponent('router-link');
|
|
52
|
+
// if(typeof vueRouterLink != 'string') return vueRouterLink;
|
|
53
|
+
return 'a';
|
|
54
|
+
}
|
|
55
|
+
@Prop({
|
|
56
|
+
type: String,
|
|
57
|
+
default: ()=>"",
|
|
58
|
+
})
|
|
59
|
+
private key!:string;
|
|
60
|
+
private get useedKey():string{
|
|
61
|
+
if(this.component && this.key) return this.key;
|
|
62
|
+
if(this.displayComponent == "a") return 'href';
|
|
63
|
+
return 'to';
|
|
64
|
+
}
|
|
65
|
+
private handleItemClick(data:MenuItem){debugger
|
|
66
|
+
if (!["h",'row','r'].includes(this.direction) && data.children){
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if ((this as any).$router) {
|
|
70
|
+
(this as any).$router.push(data.path);
|
|
71
|
+
} else {
|
|
72
|
+
history.pushState(null, '', data.path);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
</script>
|
|
78
|
+
<style>
|
|
79
|
+
.su-menu a{
|
|
80
|
+
color: inherit;
|
|
81
|
+
text-decoration: none;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['star-ui', 'star-ui-menu', 'star-ui-menu-h']">
|
|
3
|
+
<su-h-menu-item v-for="item in menu" :key="item.path" :item="item" childDirection="bottom">
|
|
4
|
+
<template v-slot="data">
|
|
5
|
+
<slot v-bind="data" />
|
|
6
|
+
</template>
|
|
7
|
+
</su-h-menu-item>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
13
|
+
import { Vue } from 'vue-class-component';
|
|
14
|
+
import SuHMenuChild from "./menu-h-child.vue";
|
|
15
|
+
import SuHMenuItem from "./menu-h-item.vue";
|
|
16
|
+
import { MenuItem } from "@ui-root/types";
|
|
17
|
+
import '@ui-root/global-style.css';
|
|
18
|
+
|
|
19
|
+
@Register({
|
|
20
|
+
name: 'su-h-menu',
|
|
21
|
+
watch:{
|
|
22
|
+
menu(this:SuHMenu){
|
|
23
|
+
this.splitMenu();
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
components:{
|
|
27
|
+
SuHMenuChild,
|
|
28
|
+
SuHMenuItem,
|
|
29
|
+
},
|
|
30
|
+
internalOnly:true,
|
|
31
|
+
})
|
|
32
|
+
export default class SuHMenu extends Vue {
|
|
33
|
+
@Prop({
|
|
34
|
+
type: Array,
|
|
35
|
+
required: true,
|
|
36
|
+
})
|
|
37
|
+
private menu!:MenuItem[];
|
|
38
|
+
private splitMenu(){
|
|
39
|
+
this.displayItem=[...this.menu];
|
|
40
|
+
}
|
|
41
|
+
private displayItem:MenuItem[]=[];
|
|
42
|
+
created():void{
|
|
43
|
+
this.splitMenu();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
</script>
|
|
48
|
+
<style>
|
|
49
|
+
.star-ui-menu-h{
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
overflow: visible;
|
|
53
|
+
position: relative;
|
|
54
|
+
padding: 0;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
}
|
|
57
|
+
.star-ui-menu-h>.star-ui-menu-h--item-box>.star-ui-menu-h--item a{
|
|
58
|
+
line-height: 2;
|
|
59
|
+
border: solid 2px transparent;
|
|
60
|
+
transition: border 0.5s;
|
|
61
|
+
padding: 2px;
|
|
62
|
+
}
|
|
63
|
+
.star-ui-menu-h>.star-ui-menu-h--item-box:hover>.star-ui-menu-h--item a{
|
|
64
|
+
border-bottom-color: var(--star-ui-base-color);
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="menu && menu.length>0" :class="['star-ui', 'star-ui-menu--chlild-box', 'star-ui-menu-h--chlild-box', `star-ui-menu-h--chlild-box-${direction}`]">
|
|
3
|
+
<component :is="itemComponent" v-for="item in menu" :key="item.path" :item="item">
|
|
4
|
+
<template v-slot="item">
|
|
5
|
+
<slot v-bind="item" />
|
|
6
|
+
</template>
|
|
7
|
+
</component>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
13
|
+
import { Vue } from 'vue-class-component';
|
|
14
|
+
import { MenuItem } from "@ui-root/types";
|
|
15
|
+
import '@ui-root/global-style.css';
|
|
16
|
+
|
|
17
|
+
@Register({
|
|
18
|
+
name: 'su-h-menu-child',
|
|
19
|
+
internalOnly: true,
|
|
20
|
+
components:{
|
|
21
|
+
// SuHMenuItem,
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
export default class SuHMenuChild extends Vue {
|
|
25
|
+
@Prop({
|
|
26
|
+
type: Array,
|
|
27
|
+
required: true,
|
|
28
|
+
})
|
|
29
|
+
private menu!:MenuItem[];
|
|
30
|
+
@Prop({})
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
+
private itemComponent!:any;
|
|
33
|
+
@Prop({
|
|
34
|
+
type: String,
|
|
35
|
+
})
|
|
36
|
+
private direction!:'right'|'bottom';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
</script>
|
|
40
|
+
<style>
|
|
41
|
+
.star-ui-menu-h--chlild-box{
|
|
42
|
+
position: absolute;
|
|
43
|
+
background-color: var(--star-ui-backgorund-color);
|
|
44
|
+
opacity: 0;
|
|
45
|
+
transition: opacity 0.5s;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
}
|
|
48
|
+
*:hover>.star-ui-menu-h--chlild-box{
|
|
49
|
+
display: block;
|
|
50
|
+
opacity: 1;
|
|
51
|
+
pointer-events: auto;
|
|
52
|
+
}
|
|
53
|
+
.star-ui-menu-h--chlild-box-right{
|
|
54
|
+
left: 100%;
|
|
55
|
+
top:0;
|
|
56
|
+
}
|
|
57
|
+
.star-ui-menu-h--chlild-box-left{
|
|
58
|
+
right: 100%;
|
|
59
|
+
top:0;
|
|
60
|
+
}
|
|
61
|
+
.star-ui-menu-h--chlild-box-bottom{
|
|
62
|
+
left: 0;
|
|
63
|
+
top:100%;
|
|
64
|
+
}
|
|
65
|
+
.star-ui-menu-h--chlild-box{
|
|
66
|
+
border: solid 1px var(--star-ui-line-color);
|
|
67
|
+
}
|
|
68
|
+
.star-ui-menu-h--chlild-box>.star-ui-menu-h--item-box>.star-ui-menu-h--item{
|
|
69
|
+
border-bottom: solid 1px var(--star-ui-line-color);
|
|
70
|
+
}
|
|
71
|
+
.star-ui-menu-h--chlild-box>.star-ui-menu-h--item-box:last-child>.star-ui-menu-h--item{
|
|
72
|
+
border-bottom-width: 0;
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
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">
|
|
4
|
+
<slot v-bind="item" />
|
|
5
|
+
</div>
|
|
6
|
+
<su-h-menu-child :menu="item.children || []" :itemComponent="selfClass" :direction="childDirection">
|
|
7
|
+
<template v-slot="item">
|
|
8
|
+
<slot v-bind="item" />
|
|
9
|
+
</template>
|
|
10
|
+
</su-h-menu-child>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
16
|
+
import { Vue } from "vue-class-component";
|
|
17
|
+
import SuHMenuChild from "./menu-h-child.vue";
|
|
18
|
+
import isFocus from "@ui-root/directives/is-focus";
|
|
19
|
+
import { MenuItem } from "@ui-root/types";
|
|
20
|
+
import '@ui-root/global-style.css';
|
|
21
|
+
|
|
22
|
+
@Register({
|
|
23
|
+
name: 'su-h-menu-item',
|
|
24
|
+
internalOnly: true,
|
|
25
|
+
components:{
|
|
26
|
+
SuHMenuChild,
|
|
27
|
+
},
|
|
28
|
+
directives:{
|
|
29
|
+
isFocus,
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
export default class SuHMenuItem extends Vue {
|
|
33
|
+
isFocus=false;
|
|
34
|
+
@Prop({
|
|
35
|
+
type: Object,
|
|
36
|
+
})
|
|
37
|
+
private item!:MenuItem;
|
|
38
|
+
private selfClass = SuHMenuItem;
|
|
39
|
+
@Prop({
|
|
40
|
+
type: String,
|
|
41
|
+
default:'right',
|
|
42
|
+
})
|
|
43
|
+
private childDirection!:'right'|'bottom';
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
<style>
|
|
47
|
+
.star-ui-menu-h--item-box{
|
|
48
|
+
height: 100%;
|
|
49
|
+
overflow: visible;
|
|
50
|
+
position: relative;
|
|
51
|
+
padding: 0;
|
|
52
|
+
transition: background-color 0.5s;
|
|
53
|
+
}
|
|
54
|
+
.star-ui-menu-h--item-box:hover{
|
|
55
|
+
background-color: rgba(128,128,128,0.4);
|
|
56
|
+
}
|
|
57
|
+
.star-ui-menu-h--item{
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
height: 100%;
|
|
63
|
+
padding: 8px;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['star-ui', 'star-ui-menu', 'star-ui-menu-v']">
|
|
3
|
+
<div>
|
|
4
|
+
<span @click="handlePathClick(0)"><span class="star-ui-icon-font star-ui-icon-home" />></span>
|
|
5
|
+
<span v-for="(item,index) in path" :key="`${index}-${item.path||'nopath'}`" @click="handlePathClick(index+1)">
|
|
6
|
+
{{item.title}}>
|
|
7
|
+
</span>
|
|
8
|
+
</div>
|
|
9
|
+
<div v-for="item in current" :key="item.path" @click="handleItemClick(item)">
|
|
10
|
+
<slot v-bind="item" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
17
|
+
import { Vue } from 'vue-class-component';
|
|
18
|
+
import { MenuItem } from "@ui-root/types";
|
|
19
|
+
import '@ui-root/global-style.css';
|
|
20
|
+
|
|
21
|
+
@Register({
|
|
22
|
+
name: 'su-h-menu',
|
|
23
|
+
internalOnly:true,
|
|
24
|
+
})
|
|
25
|
+
export default class SuHMenu extends Vue {
|
|
26
|
+
@Prop({
|
|
27
|
+
type: Array,
|
|
28
|
+
required: true,
|
|
29
|
+
})
|
|
30
|
+
private menu!:MenuItem[];
|
|
31
|
+
private path:MenuItem[]=[];
|
|
32
|
+
private get current():MenuItem[]{
|
|
33
|
+
if(this.path.length == 0){
|
|
34
|
+
return this.menu;
|
|
35
|
+
}
|
|
36
|
+
const item = this.path[this.path.length-1];
|
|
37
|
+
const res = [...(item.children || [])];
|
|
38
|
+
if(item.path){
|
|
39
|
+
res.unshift(item);
|
|
40
|
+
}
|
|
41
|
+
return res;
|
|
42
|
+
}
|
|
43
|
+
private handlePathClick(index:number){
|
|
44
|
+
this.path = this.path.slice(0,index);
|
|
45
|
+
}
|
|
46
|
+
private handleItemClick(item:MenuItem, ev:MouseEvent){
|
|
47
|
+
if(item.children && item.children.length > 0 && (this.path.length==0 || item!=this.path[this.path.length-1])){
|
|
48
|
+
this.path.push(item);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
</script>
|
|
54
|
+
<style>
|
|
55
|
+
|
|
56
|
+
</style>
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script lang="ts">
|
|
29
|
-
import {
|
|
29
|
+
import { Vue } from 'vue-class-component';
|
|
30
30
|
import BasePopper from "./common/base-popper.vue";
|
|
31
31
|
import { Inject } from "vue-property-decorator";
|
|
32
|
-
import { Emit, Prop } from "
|
|
32
|
+
import { Register, Emit, Prop } from "@ui-root/reg";
|
|
33
33
|
import { ViewCtrlInfo } from "../types";
|
|
34
34
|
import SuTree from "./tree/index.vue";
|
|
35
35
|
import ViewControl from "./view-control.vue";
|
|
@@ -37,7 +37,7 @@ import ViewControl from "./view-control.vue";
|
|
|
37
37
|
|
|
38
38
|
import "../global-style.css";
|
|
39
39
|
|
|
40
|
-
@
|
|
40
|
+
@Register({
|
|
41
41
|
name:"su-select",
|
|
42
42
|
components:{
|
|
43
43
|
BasePopper,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="['star-ui','su-slider','star-ui-size-'+size]">
|
|
3
|
-
<div ref="bar" class="su-slider--inner-runway">
|
|
2
|
+
<div :class="['star-ui','su-slider','star-ui-size-'+size,{'su-slider-moving':isHover}]">
|
|
3
|
+
<div ref="bar" class="su-slider--inner-runway" @click="handleBarClick">
|
|
4
4
|
<div class="su-slider--inner-button-wrapper" :style="{left:positionLeft+'%'}" @mousedown="handleMouseDown" @touchstart="handleTouchStart"></div>
|
|
5
5
|
</div>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script lang="ts">
|
|
10
|
-
import {
|
|
11
|
-
import { Prop, Emit } from "
|
|
10
|
+
import { Vue } from 'vue-class-component';
|
|
11
|
+
import { Register, Prop, Emit } from "@ui-root/reg";
|
|
12
12
|
import "../global-style.css";
|
|
13
13
|
|
|
14
|
-
@
|
|
14
|
+
@Register({
|
|
15
15
|
name:"su-slider"
|
|
16
16
|
})
|
|
17
17
|
export default class SuSlider extends Vue {
|
|
@@ -78,25 +78,41 @@ export default class SuSlider extends Vue {
|
|
|
78
78
|
return value;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
private handleBarClick(ev:MouseEvent){
|
|
82
|
+
if(ev.target&&ev.target==this.refBar){
|
|
83
|
+
let res=this.min+ev.offsetX/this.refBar.clientWidth*(this.max-this.min);
|
|
84
|
+
if(this.setp&&this.setp>0){
|
|
85
|
+
res=Math.round((res-this.min)/this.setp)*this.setp;
|
|
86
|
+
}
|
|
87
|
+
this.updateEvent(res);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
81
91
|
private dx=0;
|
|
92
|
+
private isHover=false;
|
|
82
93
|
|
|
83
94
|
private handleMouseDown():void{
|
|
84
95
|
window.addEventListener("mousemove",this.handleMouseMove);
|
|
85
96
|
window.addEventListener("mouseup",this.handleMouseUp);
|
|
97
|
+
window.addEventListener("blur",this.handleMouseUp);
|
|
86
98
|
this.moveStartValue=this.modelValue;
|
|
99
|
+
this.isHover=true;
|
|
87
100
|
}
|
|
88
101
|
private touchstartPoint:Touch|null=null;
|
|
89
102
|
private handleTouchStart(ev:TouchEvent):void{
|
|
90
103
|
window.addEventListener("touchmove",this.handleTouchMove,{ passive: false });
|
|
91
104
|
window.addEventListener("touchend",this.handleMouseUp,{ passive: false });
|
|
105
|
+
window.addEventListener("blur",this.handleMouseUp);
|
|
92
106
|
this.touchstartPoint=ev.changedTouches[0];
|
|
93
107
|
this.moveStartValue=this.modelValue;
|
|
108
|
+
this.isHover=true;
|
|
94
109
|
}
|
|
95
110
|
private removeEvent():void{
|
|
96
111
|
window.removeEventListener("mousemove",this.handleMouseMove);
|
|
97
112
|
window.removeEventListener("mouseup",this.handleMouseUp);
|
|
98
113
|
window.removeEventListener("touchmove",this.handleTouchMove);
|
|
99
114
|
window.removeEventListener("touchend",this.handleMouseUp);
|
|
115
|
+
window.removeEventListener("blur",this.handleMouseUp);
|
|
100
116
|
}
|
|
101
117
|
private handleMouseMove(ev:MouseEvent):void{
|
|
102
118
|
this.dx+=ev.movementX;
|
|
@@ -118,6 +134,8 @@ export default class SuSlider extends Vue {
|
|
|
118
134
|
this.updateEvent(this.displayValue);
|
|
119
135
|
this.dx=0;
|
|
120
136
|
this.removeEvent();
|
|
137
|
+
this.isHover=false;
|
|
138
|
+
|
|
121
139
|
}
|
|
122
140
|
}
|
|
123
141
|
</script>
|
|
@@ -128,8 +146,9 @@ export default class SuSlider extends Vue {
|
|
|
128
146
|
user-select: none;
|
|
129
147
|
}
|
|
130
148
|
.su-slider--inner-runway{
|
|
131
|
-
height:
|
|
149
|
+
height: 4px;
|
|
132
150
|
background-color: var(--star-ui-input-border-color);
|
|
151
|
+
cursor: pointer;
|
|
133
152
|
}
|
|
134
153
|
.su-slider--inner-button-wrapper{
|
|
135
154
|
width: var(--star-ui-input-medium-font-size);
|
|
@@ -138,9 +157,15 @@ export default class SuSlider extends Vue {
|
|
|
138
157
|
border: 1px solid var(--star-ui-base-color);
|
|
139
158
|
display: inline-block;
|
|
140
159
|
position: relative;
|
|
141
|
-
margin-left: calc(
|
|
142
|
-
top: calc(
|
|
160
|
+
margin-left: calc(2px - var(--star-ui-input-medium-font-size) / 2);
|
|
161
|
+
top: calc(2px - var(--star-ui-input-medium-font-size) / 2);
|
|
143
162
|
cursor: pointer;
|
|
144
163
|
background-color: var(--star-ui-backgorund-color);
|
|
164
|
+
background-image: radial-gradient(var(--star-ui-backgorund-color) 20%, var(--star-ui-base-color));
|
|
165
|
+
}
|
|
166
|
+
.su-slider .su-slider--inner-button-wrapper:hover,.su-slider.su-slider-moving .su-slider--inner-button-wrapper{
|
|
167
|
+
/*background-color: var(--star-ui-base-color);*/
|
|
168
|
+
background-image: radial-gradient(var(--star-ui-backgorund-color) 10%, var(--star-ui-base-color) 90%);
|
|
169
|
+
transform: scale(1.2,1.2);
|
|
145
170
|
}
|
|
146
171
|
</style>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="['star-ui','star-ui-switch','star-ui-size-'+size]">
|
|
3
3
|
<label>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
<input ref="input" type="checkbox" :name="name" :checked="modelValue" @change="handeleChange"/>
|
|
5
|
+
<div><span></span></div>
|
|
6
|
+
</label>
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import {
|
|
11
|
+
import { Vue } from 'vue-class-component';
|
|
12
12
|
import { Watch } from "vue-property-decorator";
|
|
13
|
-
import { Prop, Emit } from "
|
|
13
|
+
import { Register, Prop, Emit } from "@ui-root/reg";
|
|
14
14
|
import "../global-style.css";
|
|
15
15
|
|
|
16
|
-
@
|
|
16
|
+
@Register({
|
|
17
17
|
name:"su-switch"
|
|
18
18
|
})
|
|
19
19
|
export default class SuInput extends Vue {
|
|
@@ -35,61 +35,61 @@ export default class SuInput extends Vue {
|
|
|
35
35
|
default:"medium"
|
|
36
36
|
})
|
|
37
37
|
size!:string;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
@Emit("update:modelValue")
|
|
39
|
+
private handeleChange():boolean{
|
|
40
|
+
const nowChecked = this.$refs.input.checked;
|
|
41
|
+
this.$refs.input.checked = this.modelValue;
|
|
42
|
+
return nowChecked;
|
|
43
|
+
}
|
|
44
|
+
@Watch("modelValue")
|
|
45
|
+
private modelValueChange(newValue:boolean){
|
|
46
|
+
this.$refs.input.checked = newValue;
|
|
47
|
+
}
|
|
48
48
|
}
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
51
|
<style>
|
|
52
52
|
.star-ui-switch{
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
--size: 20px;
|
|
54
|
+
display: inline-block;
|
|
55
55
|
}
|
|
56
56
|
.star-ui-switch.star-ui-size-medium{
|
|
57
|
-
|
|
57
|
+
--size: calc(var(--star-ui-input-medium-font-size) * 1.2);
|
|
58
58
|
}
|
|
59
59
|
.star-ui-switch.star-ui-size-mini{
|
|
60
|
-
|
|
60
|
+
--size: calc(var(--star-ui-input-mini-font-size) * 1.2);
|
|
61
61
|
}
|
|
62
62
|
.star-ui-switch input{
|
|
63
|
-
|
|
63
|
+
display: none;
|
|
64
64
|
}
|
|
65
65
|
.star-ui-switch div{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
width: calc(var(--size) * 2.5);
|
|
67
|
+
height: var(--size);
|
|
68
|
+
border: solid 1px var(--star-ui-base-color);
|
|
69
|
+
border-radius: var(--size);
|
|
70
|
+
overflow: hidden;
|
|
71
71
|
}
|
|
72
72
|
.star-ui-switch div span{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
display: inline-block;
|
|
74
|
+
width: calc(var(--size) - 2px);
|
|
75
|
+
height: calc(var(--size) - 2px);
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
border: solid 1px var(--star-ui-base-color);
|
|
78
|
+
position: relative;
|
|
79
|
+
background: var(--star-ui-backgorund-color);
|
|
80
|
+
transition: margin-left 0.1s;
|
|
81
81
|
}
|
|
82
82
|
.star-ui-switch div span::before{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
content: "";
|
|
84
|
+
width: 100px;
|
|
85
|
+
height: 100px;
|
|
86
|
+
background: var(--star-ui-base-color);
|
|
87
|
+
position: absolute;
|
|
88
|
+
right: 50%;
|
|
89
|
+
top:-20px;
|
|
90
|
+
z-index: -1;
|
|
91
91
|
}
|
|
92
92
|
.star-ui-switch input:checked+div span{
|
|
93
|
-
|
|
93
|
+
margin-left: calc(var(--size) * 1.5);
|
|
94
94
|
}
|
|
95
95
|
</style>
|
package/src/components/table.vue
CHANGED
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
|
-
import {
|
|
21
|
-
import { Prop } from "
|
|
20
|
+
import { Vue } from 'vue-class-component';
|
|
21
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
22
22
|
import "../global-style.css";
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
@
|
|
25
|
+
@Register({
|
|
26
26
|
name:"su-table",
|
|
27
27
|
props: {
|
|
28
28
|
data:{
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
import {
|
|
15
|
-
import { Prop } from "
|
|
14
|
+
import { Vue } from 'vue-class-component';
|
|
15
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
16
16
|
import treeItem from "./tree-item.vue"
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
import "../../global-style.css";
|
|
20
20
|
|
|
21
|
-
@
|
|
21
|
+
@Register({
|
|
22
22
|
name:"su-tree",
|
|
23
23
|
components:{
|
|
24
24
|
treeItem
|
|
@@ -22,18 +22,19 @@
|
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script lang="ts">
|
|
25
|
-
import {
|
|
26
|
-
import { Prop } from "
|
|
25
|
+
import { Vue } from 'vue-class-component';
|
|
26
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
27
27
|
import treeItem from "./tree-item.vue"
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
import "../../global-style.css";
|
|
31
31
|
|
|
32
|
-
@
|
|
32
|
+
@Register({
|
|
33
33
|
name:"su-tree-item",
|
|
34
34
|
components:{
|
|
35
35
|
treeItem
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
|
+
internalOnly: true,
|
|
37
38
|
})
|
|
38
39
|
export default class SuTreeItem extends Vue {
|
|
39
40
|
readonly isExpand=false;
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts">
|
|
8
|
-
import {
|
|
9
|
-
import { InjectionKey } from 'vue';
|
|
8
|
+
import { Vue } from 'vue-class-component';
|
|
10
9
|
|
|
11
|
-
import { Prop } from "
|
|
10
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
12
11
|
import { Provide } from "vue-property-decorator";
|
|
13
12
|
|
|
14
13
|
import { ViewCtrlInfo } from "../types";
|
|
@@ -17,7 +16,7 @@ import "../global-style.css";
|
|
|
17
16
|
type DeviceType='auto'|'mobile'|'pc';
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
@
|
|
19
|
+
@Register({
|
|
21
20
|
name:"su-view-control",
|
|
22
21
|
watch:{
|
|
23
22
|
$isMobile(newValue){
|