@thestarweb/ui 1.4.2 → 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 +24 -4
- package/dist/star-ui.common.js +1494 -726
- package/dist/star-ui.common.js.map +1 -1
- package/dist/star-ui.umd.js +1494 -726
- package/dist/star-ui.umd.js.map +1 -1
- package/dist/star-ui.umd.min.js +71 -71
- package/dist/star-ui.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/readme.md +2 -2
- package/src/components/button.vue +3 -3
- package/src/components/calendar.vue +3 -3
- package/src/components/call-render.tsx +4 -3
- 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 +3 -3
- 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 +3 -3
- 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 +5 -0
- package/types/components/calendar.vue.d.ts +26 -0
- package/types/components/card.vue.d.ts +13 -0
- package/types/components/common/base-popper.vue.d.ts +19 -0
- package/types/components/content/index.d.ts +1 -0
- package/types/components/content/page.vue.d.ts +10 -0
- package/types/components/input.vue.d.ts +15 -0
- package/types/components/layout-h.vue.d.ts +4 -0
- package/types/components/layout-main.vue.d.ts +4 -0
- package/types/components/layout-v.vue.d.ts +4 -0
- package/types/components/line-h.vue.d.ts +4 -0
- package/types/components/line-v.vue.d.ts +4 -0
- 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/select.vue.d.ts +27 -0
- package/types/components/slider.vue.d.ts +29 -0
- package/types/components/switch.vue.d.ts +12 -0
- package/types/components/table.vue.d.ts +5 -0
- package/types/components/tree/index.vue.d.ts +15 -0
- package/types/components/tree/tree-item.vue.d.ts +18 -0
- package/types/components/view-control.vue.d.ts +15 -0
- package/types/directives/is-focus.d.ts +4 -0
- package/types/main.d.ts +68 -6
- package/types/reg.d.ts +14 -1
- package/dist/img/iconfont.ff1d7f50.svg +0 -62
- package/types/utils.d.ts +0 -3
|
@@ -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,
|
|
@@ -7,11 +7,11 @@
|
|
|
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 {
|
|
@@ -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){
|
package/src/global-style.css
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
:root{
|
|
2
2
|
/*背景颜色*/
|
|
3
3
|
--star-ui-backgorund-color:#FFF;
|
|
4
|
+
/*背景颜色*/
|
|
5
|
+
--star-ui-font-color:#222;
|
|
4
6
|
/*表格头*/
|
|
5
7
|
--star-ui-table-head-color:#f8f8f9;
|
|
6
8
|
/*基础颜色*/
|
|
@@ -30,6 +32,7 @@
|
|
|
30
32
|
margin:0;
|
|
31
33
|
padding: 0;
|
|
32
34
|
position: relative;
|
|
35
|
+
box-sizing: border-box;
|
|
33
36
|
}
|
|
34
37
|
/*内容容器大大小*/
|
|
35
38
|
.star-ui-container{
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
|
|
3
|
-
src: url('iconfont.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
url('iconfont.ttf?t=1618646407015') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
|
7
|
-
url('iconfont.svg?t=1618646407015#star-ui-iconfont') format('svg'); /* iOS 4.1- */
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "star-ui-iconfont"; /* Project id 2493685 */
|
|
3
|
+
src: url('iconfont.woff2?t=1636814190896') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1636814190896') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1636814190896') format('truetype');
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
.star-ui-icon-font {
|
|
@@ -15,6 +13,18 @@
|
|
|
15
13
|
-moz-osx-font-smoothing: grayscale;
|
|
16
14
|
}
|
|
17
15
|
|
|
16
|
+
.star-ui-icon-menu:before {
|
|
17
|
+
content: "\e65f";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.star-ui-icon-add:before {
|
|
21
|
+
content: "\e6da";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.star-ui-icon-home:before {
|
|
25
|
+
content: "\e6b8";
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
.star-ui-icon-code:before {
|
|
19
29
|
content: "\e667";
|
|
20
30
|
}
|
|
@@ -2,9 +2,30 @@
|
|
|
2
2
|
"id": "2493685",
|
|
3
3
|
"name": "star-ui",
|
|
4
4
|
"font_family": "star-ui-iconfont",
|
|
5
|
-
"css_prefix_text": "star-ui-icon",
|
|
5
|
+
"css_prefix_text": "star-ui-icon-",
|
|
6
6
|
"description": "",
|
|
7
7
|
"glyphs": [
|
|
8
|
+
{
|
|
9
|
+
"icon_id": "1251228",
|
|
10
|
+
"name": "menu",
|
|
11
|
+
"font_class": "menu",
|
|
12
|
+
"unicode": "e65f",
|
|
13
|
+
"unicode_decimal": 58975
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"icon_id": "38747",
|
|
17
|
+
"name": "add",
|
|
18
|
+
"font_class": "add",
|
|
19
|
+
"unicode": "e6da",
|
|
20
|
+
"unicode_decimal": 59098
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"icon_id": "33516",
|
|
24
|
+
"name": "home",
|
|
25
|
+
"font_class": "home",
|
|
26
|
+
"unicode": "e6b8",
|
|
27
|
+
"unicode_decimal": 59064
|
|
28
|
+
},
|
|
8
29
|
{
|
|
9
30
|
"icon_id": "15838443",
|
|
10
31
|
"name": "code",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/main.ts
CHANGED
|
@@ -1,37 +1,48 @@
|
|
|
1
1
|
//布局
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export { default as SuHLayout } from "./components/layout-h.vue";
|
|
3
|
+
export { default as SuVLayout } from "./components/layout-v.vue";
|
|
4
|
+
export { default as SuMain } from "./components/layout-main.vue";
|
|
5
|
+
export { default as SuTable } from "./components/table.vue";
|
|
6
|
+
export { default as SuHLine } from "./components/line-h.vue";
|
|
7
|
+
export { default as SuVLine } from "./components/line-v.vue";
|
|
8
|
+
export { default as SuCard } from "./components/card.vue";
|
|
9
|
+
export { default as SuTree } from "./components/tree/index.vue";
|
|
10
10
|
//表单
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
export { default as SuInput } from "./components/input.vue";
|
|
12
|
+
export { default as SuSelect } from "./components/select.vue";
|
|
13
|
+
export { default as SuButton } from "./components/button.vue";
|
|
14
|
+
export { default as SuSwitch } from "./components/switch.vue";
|
|
15
|
+
export { default as SuSlider } from "./components/slider.vue";
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
export { default as SuCalendar } from "./components/calendar.vue";
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
export { default as SuViewControl } from "./components/view-control.vue";
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
export * from "./components/menu";
|
|
23
|
+
export * from "./components/content";
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
import { data } from "./reg";
|
|
26
|
+
|
|
27
|
+
import { App, readonly } from "vue";
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line
|
|
30
|
+
export const components:Record<string,any>={};
|
|
31
|
+
Object.keys(data).map((key) => {
|
|
32
|
+
if(data[key].component&&!data[key].internalOnly){
|
|
33
|
+
components[key]=data[key].component;
|
|
33
34
|
}
|
|
35
|
+
});
|
|
36
|
+
export const allData = readonly(data);
|
|
37
|
+
|
|
38
|
+
const registComponents=function(app:App):void{
|
|
39
|
+
Object.keys(data).map((key) => {
|
|
40
|
+
if(data[key].component&&!data[key].internalOnly){
|
|
41
|
+
app.component(components[key].__o.name,components[key]);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
34
44
|
}
|
|
45
|
+
export const infos = readonly(data);
|
|
35
46
|
export default {
|
|
36
47
|
...components,
|
|
37
48
|
components,
|
package/src/reg.ts
CHANGED
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
import { VueDecorator, PropOptions, createDecorator } from
|
|
2
|
-
import { reactive } from
|
|
3
|
-
|
|
1
|
+
import { VueDecorator, PropOptions, createDecorator, Vue, VueConstructor, VueBase } from "vue-class-component";
|
|
2
|
+
import { ComponentOptions, reactive } from "vue";
|
|
3
|
+
interface ComponentInfo{
|
|
4
|
+
hideInDoc?:boolean;
|
|
5
|
+
internalOnly?:boolean;
|
|
6
|
+
type?:'from'|'layout';
|
|
7
|
+
}
|
|
4
8
|
|
|
5
9
|
export const data = reactive({
|
|
6
10
|
//
|
|
7
11
|
} as {[key:string]: {
|
|
8
12
|
props?:{
|
|
9
13
|
[key:string]: PropOptions
|
|
14
|
+
};
|
|
15
|
+
component?:VueConstructor<VueBase>;
|
|
16
|
+
}&ComponentInfo});
|
|
17
|
+
|
|
18
|
+
export type RegisterOptions<V> = ComponentOptions & ThisType<V> & ComponentInfo;
|
|
19
|
+
export function Register<V extends Vue>({ hideInDoc, internalOnly, ...options }:RegisterOptions<V>):<VC extends VueConstructor<VueBase>>(target: VC) => VC{
|
|
20
|
+
return (Component) => {
|
|
21
|
+
if(options.name){
|
|
22
|
+
if(!data[options.name]) data[options.name] = {};
|
|
23
|
+
// eslint-disable-next-line
|
|
24
|
+
data[options.name].component = Component;
|
|
25
|
+
data[options.name].hideInDoc = hideInDoc;
|
|
26
|
+
data[options.name].internalOnly = internalOnly;
|
|
27
|
+
}
|
|
28
|
+
// eslint-disable-next-line
|
|
29
|
+
(Component as any).__o = options
|
|
30
|
+
return Component
|
|
10
31
|
}
|
|
11
|
-
}
|
|
32
|
+
}
|
|
12
33
|
|
|
13
34
|
const hyphenate = (str:string) => str.replace(/\B([A-Z])/g, '-$1').toLowerCase();
|
|
14
35
|
// eslint-disable-next-line
|
|
@@ -62,7 +83,6 @@ export function Emit(event?:string, shouldEmit?:(res:any)=>boolean):VueDecorator
|
|
|
62
83
|
export function Prop(propOptions:PropOptions):VueDecorator{
|
|
63
84
|
return createDecorator((componentOptions, key) => {
|
|
64
85
|
if(componentOptions.name){
|
|
65
|
-
// console.log(componentOptions.name);
|
|
66
86
|
if(!data[componentOptions.name]) data[componentOptions.name] = {};
|
|
67
87
|
if(!data[componentOptions.name].props) data[componentOptions.name].props={};
|
|
68
88
|
// eslint-disable-next-line
|
|
@@ -71,4 +91,4 @@ export function Prop(propOptions:PropOptions):VueDecorator{
|
|
|
71
91
|
if(!componentOptions.props) componentOptions.props={};
|
|
72
92
|
componentOptions.props[key] = propOptions;
|
|
73
93
|
});
|
|
74
|
-
}
|
|
94
|
+
}
|
package/src/types.d.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Vue } from "vue-class-component";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
import "../global-style.css";
|
|
4
|
+
interface DateBaseInfo {
|
|
5
|
+
display: number;
|
|
6
|
+
isPrevious: boolean;
|
|
7
|
+
isNext: boolean;
|
|
8
|
+
week: string;
|
|
9
|
+
date: moment.Moment;
|
|
10
|
+
}
|
|
11
|
+
export default class SuCalendar extends Vue {
|
|
12
|
+
readonly displayMonth: Date | string;
|
|
13
|
+
private dYear;
|
|
14
|
+
private dMonth;
|
|
15
|
+
private get displayMonthDate();
|
|
16
|
+
readonly weekName: string[];
|
|
17
|
+
weekOffect: number;
|
|
18
|
+
private get displayHead();
|
|
19
|
+
private get displayData();
|
|
20
|
+
readonly renderCell: (arg: DateBaseInfo) => unknown;
|
|
21
|
+
private showSelYear;
|
|
22
|
+
private dShowSelYear;
|
|
23
|
+
private showSelMonth;
|
|
24
|
+
private dateClick;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Vue } from 'vue-class-component';
|
|
2
|
+
import "../global-style.css";
|
|
3
|
+
export default class SuCard extends Vue {
|
|
4
|
+
$refs: {
|
|
5
|
+
body: HTMLDivElement;
|
|
6
|
+
bodyInner: HTMLDivElement;
|
|
7
|
+
};
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly collapsible: boolean;
|
|
10
|
+
isCollaps: boolean;
|
|
11
|
+
collapsChange(): void;
|
|
12
|
+
handleTransitionEnd(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Vue } from 'vue-class-component';
|
|
2
|
+
import { ViewCtrlInfo } from "../../types";
|
|
3
|
+
import "../../global-style.css";
|
|
4
|
+
export default class SuButton extends Vue {
|
|
5
|
+
fromItem: Vue | HTMLElement;
|
|
6
|
+
private div;
|
|
7
|
+
private id;
|
|
8
|
+
private updateType;
|
|
9
|
+
private visible;
|
|
10
|
+
readonly suControl: ViewCtrlInfo;
|
|
11
|
+
beforeCreate(): void;
|
|
12
|
+
unmounted(): void;
|
|
13
|
+
mounted(): void;
|
|
14
|
+
beforeUnmount(): void;
|
|
15
|
+
_clickCheck(ev: MouseEvent): boolean;
|
|
16
|
+
private syncRequestId;
|
|
17
|
+
_updateVisible(): void;
|
|
18
|
+
updatePos(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SuPage } from "./page.vue";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Vue } from "vue-class-component";
|
|
2
|
+
import { ViewCtrlInfo } from "../../types";
|
|
3
|
+
import "@ui-root/global-style.css";
|
|
4
|
+
export default class SuMain extends Vue {
|
|
5
|
+
readonly suControl: ViewCtrlInfo;
|
|
6
|
+
private title;
|
|
7
|
+
private logo;
|
|
8
|
+
private menu;
|
|
9
|
+
private isOpenMenu;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Vue } from 'vue-class-component';
|
|
2
|
+
import "../global-style.css";
|
|
3
|
+
export default class SuInput extends Vue {
|
|
4
|
+
modelValue: string | number;
|
|
5
|
+
$refs: {
|
|
6
|
+
input: HTMLInputElement;
|
|
7
|
+
};
|
|
8
|
+
name: string;
|
|
9
|
+
size: string;
|
|
10
|
+
isFocused: boolean;
|
|
11
|
+
emitInput(data: string): string;
|
|
12
|
+
handleInput(event: InputEvent): void;
|
|
13
|
+
handleFocus(): void;
|
|
14
|
+
handleBlur(): void;
|
|
15
|
+
}
|