@thestarweb/ui 1.5.2 → 1.6.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 +1053 -758
- package/dist/star-ui.common.js.map +1 -1
- package/dist/star-ui.umd.js +1053 -758
- package/dist/star-ui.umd.js.map +1 -1
- package/dist/star-ui.umd.min.js +62 -62
- package/dist/star-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button.vue +1 -1
- package/src/components/calendar.vue +8 -8
- package/src/components/card.vue +1 -1
- package/src/components/common/base-popper.vue +9 -6
- package/src/components/form/form/form-item.vue +96 -0
- package/src/components/form/form/form.vue +51 -0
- package/src/components/form/form/index.ts +2 -0
- package/src/components/form/index.ts +1 -0
- package/src/components/input.vue +2 -1
- package/src/components/layout-h.vue +4 -4
- package/src/components/layout-main.vue +2 -2
- package/src/components/layout-v.vue +4 -4
- package/src/components/line-h.vue +2 -2
- package/src/components/line-v.vue +2 -2
- package/src/components/menu/index.vue +2 -2
- package/src/components/select.vue +6 -6
- package/src/components/switch.vue +1 -1
- package/src/components/table.vue +11 -11
- package/src/components/tree/index.vue +1 -0
- package/src/components/view-control.vue +11 -17
- package/src/global-style.css +73 -1
- package/src/main.ts +1 -0
- package/src/outher/index.ts +5 -1
- package/src/reg.ts +38 -3
- package/types/components/common/base-popper.vue.d.ts +1 -0
- package/types/components/form/form/form-item.vue.d.ts +15 -0
- package/types/components/form/form/form.vue.d.ts +8 -0
- package/types/components/form/form/index.d.ts +2 -0
- package/types/components/form/index.d.ts +1 -0
- package/types/components/view-control.vue.d.ts +1 -0
- package/types/main.d.ts +1 -0
- package/types/outher/index.d.ts +3 -0
- package/types/reg.d.ts +10 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui star-ui-calendar">
|
|
2
|
+
<div class="star-ui su-calendar star-ui-calendar">
|
|
3
3
|
<div class="star-ui-calendar--ctrl" :style="{opacity: showSelYear||showSelMonth?0:1}">
|
|
4
4
|
<div @click="dYear--"><<</div>
|
|
5
5
|
<div @click="dMonth--"><</div>
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
<div @click="dYear++">>></div>
|
|
13
13
|
</div>
|
|
14
14
|
<table cellspacing="0" cellpadding="0" :style="{opacity: showSelYear||showSelMonth?0:1}">
|
|
15
|
-
<tr class="
|
|
16
|
-
<th :class="`
|
|
15
|
+
<tr class="star-ui-calendar--inner-head">
|
|
16
|
+
<th :class="`star-ui-calendar--${item.week}`" v-for="(item,index) in displayHead" :key="index">{{item.display}}</th>
|
|
17
17
|
</tr>
|
|
18
18
|
<tr v-for="(row,index) in displayData" :key="index">
|
|
19
|
-
<td v-for="(day,index) in row" :key="index" :class="['
|
|
19
|
+
<td v-for="(day,index) in row" :key="index" :class="['star-ui-calendar--inner-cell',`star-ui-calendar--${day.week}`,{'star-ui-calendar--previous':day.isPrevious,'star-ui-calendar--next':day.isNext}]" @clcik="dateClick(day)">
|
|
20
20
|
|
|
21
21
|
<slot v-if="$slots['default']" v-bind="day" />
|
|
22
22
|
<vnodes v-else-if="renderCell" :func="renderCell" :args="[day]" />
|
|
@@ -189,17 +189,17 @@ export default class SuCalendar extends Vue {
|
|
|
189
189
|
.star-ui-calendar th,.star-ui-calendar td{
|
|
190
190
|
padding: 5px 0;
|
|
191
191
|
}
|
|
192
|
-
.
|
|
192
|
+
.star-ui-calendar--inner-head{
|
|
193
193
|
background-color: var(--star-ui-table-head-color);
|
|
194
194
|
}
|
|
195
|
-
.
|
|
195
|
+
.star-ui-calendar--inner-cell{
|
|
196
196
|
border: 1px solid #e8eaec;
|
|
197
197
|
width: 42px
|
|
198
198
|
}
|
|
199
|
-
.
|
|
199
|
+
.star-ui-calendar--inner-cell.star-ui-calendar--Sat,.star-ui-calendar--inner-cell.star-ui-calendar--Sun{
|
|
200
200
|
color: #f00;
|
|
201
201
|
}
|
|
202
|
-
.
|
|
202
|
+
.star-ui-calendar--inner-cell.star-ui-calendar--previous,.star-ui-calendar--inner-cell.star-ui-calendar--next{
|
|
203
203
|
opacity: 0.5;
|
|
204
204
|
}
|
|
205
205
|
|
package/src/components/card.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui star-ui-card">
|
|
2
|
+
<div class="star-ui su-card star-ui-card">
|
|
3
3
|
<div v-if="title!=''||collapsible||this.$slots.title" class="star-ui star-ui-container star-ui-card--inner-head">
|
|
4
4
|
<div class="star-ui star-ui-card--inner-title">{{title}}</div>
|
|
5
5
|
<button v-if="collapsible" :class="['star-ui','star-ui-card--inner-button-collapsible',isCollaps?'show':'hidden']" @click="collapsChange"></button>
|
|
@@ -8,15 +8,16 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import {
|
|
12
|
-
import { SuViewCtrlInjectIsMobile } from "@ui-root/outher";
|
|
13
|
-
import { Emit, Prop } from "@ui-root/reg";
|
|
11
|
+
import { Vue } from 'vue-class-component';
|
|
12
|
+
import { SuViewCtrlInjectClassName, SuViewCtrlInjectIsMobile } from "@ui-root/outher";
|
|
13
|
+
import { Emit, Prop, Register } from "@ui-root/reg";
|
|
14
14
|
|
|
15
15
|
import "../../global-style.css";
|
|
16
16
|
let nowId=0;
|
|
17
17
|
|
|
18
|
-
@
|
|
18
|
+
@Register({
|
|
19
19
|
name:"su-base-popper",
|
|
20
|
+
internalOnly:true,
|
|
20
21
|
props: {
|
|
21
22
|
fromItem:{
|
|
22
23
|
type:Object
|
|
@@ -89,6 +90,8 @@ export default class SuButton extends Vue {
|
|
|
89
90
|
if(this.syncRequestId)cancelAnimationFrame(this.syncRequestId);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
93
|
+
@SuViewCtrlInjectClassName
|
|
94
|
+
readonly ctrlClass!:string[];
|
|
92
95
|
updatePos():void{
|
|
93
96
|
if(this.fromItem){
|
|
94
97
|
let dom=(this.fromItem instanceof HTMLElement)?this.fromItem:this.fromItem.$el;
|
|
@@ -97,9 +100,9 @@ export default class SuButton extends Vue {
|
|
|
97
100
|
this.div.style.left="0";
|
|
98
101
|
this.div.style.width="100%";
|
|
99
102
|
// this.div.style.height="100%";
|
|
100
|
-
this.div.className=
|
|
103
|
+
this.div.className=this.ctrlClass.join(' ');
|
|
101
104
|
}else{
|
|
102
|
-
this.div.className=
|
|
105
|
+
this.div.className=this.ctrlClass.join(' ');
|
|
103
106
|
const height=dom.clientHeight;
|
|
104
107
|
let top=0,left=0;
|
|
105
108
|
while(dom&&dom!=document){
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="`star-ui su-form-item star-ui-form-item star-ui-col-${col} star-ui-form--label-align-${labelAlign||pLabelAlign}`">
|
|
3
|
+
<div class="start-ui star-ui-container star-ui-form-item--label" :style="labelStyle">
|
|
4
|
+
{{label}}
|
|
5
|
+
<slot name="label"></slot>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="start-ui star-ui-container star-ui-form-item--content">
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import { Vue } from "vue-class-component";
|
|
15
|
+
import { Inject } from "vue-property-decorator";
|
|
16
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
17
|
+
import { TypeFormLabelAlign } from "@ui-root/outher";
|
|
18
|
+
|
|
19
|
+
import "@ui-root/global-style.css";
|
|
20
|
+
|
|
21
|
+
export const InjectLabelWidth = Symbol('InjectLabelWidth');
|
|
22
|
+
export const InjectLabelAlign = Symbol('InjectLabelAlign');
|
|
23
|
+
|
|
24
|
+
@Register({
|
|
25
|
+
name:"su-form-item",
|
|
26
|
+
hideInDoc:true,
|
|
27
|
+
})
|
|
28
|
+
export default class SuButton extends Vue {
|
|
29
|
+
@Prop({
|
|
30
|
+
type:String,
|
|
31
|
+
default:()=>{
|
|
32
|
+
return 'label';
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
readonly label!:string;
|
|
36
|
+
@Prop({
|
|
37
|
+
type:[String, Number],
|
|
38
|
+
})
|
|
39
|
+
readonly labelWidth!:string|number|undefined;
|
|
40
|
+
@Inject({from:InjectLabelWidth})
|
|
41
|
+
readonly pLabelWidth!:string|number|undefined;
|
|
42
|
+
@Prop({
|
|
43
|
+
autoType: "FormLabelAlign",
|
|
44
|
+
})
|
|
45
|
+
readonly labelAlign!:TypeFormLabelAlign;
|
|
46
|
+
@Inject({from:InjectLabelAlign,default:"right"})
|
|
47
|
+
readonly pLabelAlign!:TypeFormLabelAlign;
|
|
48
|
+
@Prop({
|
|
49
|
+
type:Number,
|
|
50
|
+
default:()=>{
|
|
51
|
+
return 24;
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
readonly col!:number;
|
|
55
|
+
private get labelStyle():Record<string, unknown>{
|
|
56
|
+
const ret:Record<string, unknown>={};
|
|
57
|
+
const labelWidth = this.labelWidth || this.pLabelWidth;
|
|
58
|
+
if(labelWidth){
|
|
59
|
+
ret.width=typeof labelWidth === 'number' ? `${labelWidth}px` : labelWidth;
|
|
60
|
+
}
|
|
61
|
+
return ret;
|
|
62
|
+
}
|
|
63
|
+
created(){
|
|
64
|
+
console.log(this.col);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style>
|
|
70
|
+
.star-ui-form-item{
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: row;
|
|
73
|
+
align-items: center;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
}
|
|
76
|
+
.star-ui-form-item--label{
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
}
|
|
79
|
+
.star-ui-form-item--content{
|
|
80
|
+
flex: 1;
|
|
81
|
+
}
|
|
82
|
+
.star-ui-form-item--content>.star-ui-select,.star-ui-form-item--content>.star-ui-input{
|
|
83
|
+
width: 100%;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.star-ui-form--label-align-left .star-ui-form-item--label, .star-ui-form--label-align-top .star-ui-form-item--label{
|
|
87
|
+
text-align: left;
|
|
88
|
+
}
|
|
89
|
+
.star-ui-form--label-align-right .star-ui-form-item--label{
|
|
90
|
+
text-align: right;
|
|
91
|
+
}
|
|
92
|
+
.star-ui-form-item.star-ui-form--label-align-top{
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
align-items: stretch;
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form :class="`star-ui su-form star-ui-form ${allowAotoMobile?'star-ui-form--auto-mobile':''}`">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</form>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { Vue } from "vue-class-component";
|
|
9
|
+
import { Register, Prop } from "@ui-root/reg";
|
|
10
|
+
import type { TypeFormLabelAlign } from "@ui-root/outher";
|
|
11
|
+
|
|
12
|
+
import "@ui-root/global-style.css";
|
|
13
|
+
import { Provide } from "vue-property-decorator";
|
|
14
|
+
import { InjectLabelAlign, InjectLabelWidth } from "./form-item.vue";
|
|
15
|
+
|
|
16
|
+
@Register({
|
|
17
|
+
name:"su-form"
|
|
18
|
+
})
|
|
19
|
+
export default class SuButton extends Vue {
|
|
20
|
+
@Prop({
|
|
21
|
+
autoType: "FormLabelAlign",
|
|
22
|
+
default:()=>{
|
|
23
|
+
return "right"
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
@Provide({to:InjectLabelAlign})
|
|
27
|
+
readonly labelAlign!:TypeFormLabelAlign;
|
|
28
|
+
@Prop({
|
|
29
|
+
type: Number
|
|
30
|
+
})
|
|
31
|
+
@Provide({to:InjectLabelWidth})
|
|
32
|
+
readonly labelWidth!:number|undefined;
|
|
33
|
+
@Prop({
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default:()=>{
|
|
36
|
+
return true
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
readonly allowAotoMobile!:boolean;
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
<style>
|
|
43
|
+
.star-ui-form{
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
}
|
|
48
|
+
.star-ui-view-control.star-ui-view-control-mobile .star-ui-form--auto-mobile>.star-ui-form-item{
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./form/index";
|
package/src/components/input.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="['star-ui','star-ui-input',{'is-focus':isFocused}]">
|
|
2
|
+
<div :class="['star-ui', 'su-input','star-ui-input',{'is-focus':isFocused}]">
|
|
3
3
|
<input type="text" ref="input" :value="modelValue" :name="name" :class="['star-ui','star-ui-input--inner','star-ui-size-'+size]" @input.stop="handleInput" @focus="handleFocus" @blur="handleBlur">
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -76,5 +76,6 @@ export default class SuInput extends Vue {
|
|
|
76
76
|
flex:1;
|
|
77
77
|
color: unset;
|
|
78
78
|
background: unset;
|
|
79
|
+
width: 100%;
|
|
79
80
|
}
|
|
80
81
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui su-h-layout">
|
|
2
|
+
<div class="star-ui su-h-layout star-ui-h-layout">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -17,7 +17,7 @@ export default class SuHLayout extends Vue {
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<style>
|
|
20
|
-
.
|
|
20
|
+
.star-ui-h-layout{
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: row;
|
|
23
23
|
width: 100%;
|
|
@@ -25,10 +25,10 @@ export default class SuHLayout extends Vue {
|
|
|
25
25
|
padding: 0;
|
|
26
26
|
overflow: hidden;
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
.star-ui-h-layout>*{
|
|
29
29
|
flex:0 0 auto;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.star-ui-h-layout>.star-ui-main{
|
|
32
32
|
width: 0;
|
|
33
33
|
}
|
|
34
34
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui su-main">
|
|
2
|
+
<div class="star-ui su-main star-ui-main">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -19,7 +19,7 @@ export default class SuMain extends Vue {
|
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<style>
|
|
22
|
-
.
|
|
22
|
+
.star-ui-main{
|
|
23
23
|
flex: 1;
|
|
24
24
|
}
|
|
25
25
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui su-v-layout">
|
|
2
|
+
<div class="star-ui su-v-layout star-ui-v-layout">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -19,7 +19,7 @@ export default class SuVLayout extends Vue {
|
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<style>
|
|
22
|
-
.
|
|
22
|
+
.star-ui-v-layout{
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
width: 100%;
|
|
@@ -27,10 +27,10 @@ export default class SuVLayout extends Vue {
|
|
|
27
27
|
padding: 0;
|
|
28
28
|
overflow: hidden;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.star-ui-v-layout>*{
|
|
31
31
|
flex:0 0 auto;
|
|
32
32
|
}
|
|
33
|
-
.
|
|
33
|
+
.star-ui-v-layout>.star-ui-main{
|
|
34
34
|
height: 0;
|
|
35
35
|
}
|
|
36
36
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui su-h-line"></div>
|
|
2
|
+
<div class="star-ui su-h-line star-ui-h-line"></div>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts">
|
|
@@ -17,7 +17,7 @@ export default class SuHLine extends Vue {
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<style>
|
|
20
|
-
.
|
|
20
|
+
.star-ui-h-line{
|
|
21
21
|
background-color:var(--star-ui-line-color);
|
|
22
22
|
width:100%;
|
|
23
23
|
height:var(--star-ui-line-width);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui su-v-line"></div>
|
|
2
|
+
<div class="star-ui su-v-line star-ui-v-line"></div>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script lang="ts">
|
|
@@ -17,7 +17,7 @@ export default class SuVLine extends Vue {
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<style>
|
|
20
|
-
.
|
|
20
|
+
.star-ui-v-line{
|
|
21
21
|
background-color:var(--star-ui-line-color);
|
|
22
22
|
/*height:100%;*/
|
|
23
23
|
width:var(--star-ui-line-width);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="menuComponent" :menu="menu" class="su-menu">
|
|
2
|
+
<component :is="menuComponent" :menu="menu" class="star-ui su-menu star-ui-menu">
|
|
3
3
|
<template v-slot="data">
|
|
4
4
|
<div @click="handleItemClick(data)">
|
|
5
5
|
<slot v-if="$slots['default']" v-bind="data" />
|
|
@@ -79,7 +79,7 @@ export default class SuHMenu extends Vue {
|
|
|
79
79
|
|
|
80
80
|
</script>
|
|
81
81
|
<style>
|
|
82
|
-
.
|
|
82
|
+
.star-ui-menu a{
|
|
83
83
|
color: inherit;
|
|
84
84
|
text-decoration: none;
|
|
85
85
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="['star-ui','star-ui-select',{'is-focus':isFocused}]" @click="isFocused=!isFocused">
|
|
2
|
+
<div :class="['star-ui', 'su-select','star-ui-select',{'is-focus':isFocused}]" @click="isFocused=!isFocused">
|
|
3
3
|
<!-- 原生组件 -->
|
|
4
4
|
<select :name="name" style="display: none"></select>
|
|
5
5
|
<input v-if="false" type="text" :value="1" class="star-ui star-ui-select--inner">
|
|
@@ -240,26 +240,26 @@ export default class SuSelect extends Vue {
|
|
|
240
240
|
font-weight: bold;
|
|
241
241
|
padding: var(--star-ui-default-padding);
|
|
242
242
|
}
|
|
243
|
-
.
|
|
243
|
+
.star-ui-view-control-mobile .star-ui-select--pooper{
|
|
244
244
|
width: 100%;
|
|
245
245
|
}
|
|
246
|
-
.
|
|
246
|
+
.star-ui-view-control.star-ui-view-control-mobile .star-ui-select--pooper{
|
|
247
247
|
border-radius: 0;
|
|
248
248
|
border-width: 0;
|
|
249
249
|
}
|
|
250
|
-
.
|
|
250
|
+
.star-ui-view-control.star-ui-view-control-mobile .star-ui-select--option{
|
|
251
251
|
border-radius: 0;
|
|
252
252
|
padding-left: 10px;
|
|
253
253
|
border-left: 5px solid transparent;
|
|
254
254
|
border-top: 1px solid var(--star-ui-input-border-color);
|
|
255
255
|
line-height: 1.5;
|
|
256
256
|
}
|
|
257
|
-
.
|
|
257
|
+
.star-ui-view-control.star-ui-view-control-mobile .star-ui-select--option-sel{
|
|
258
258
|
background: initial;
|
|
259
259
|
color: var(--star-ui-base-color);
|
|
260
260
|
border-left: 5px solid var(--star-ui-base-color);
|
|
261
261
|
}
|
|
262
|
-
.
|
|
262
|
+
.star-ui-view-control-mobile .star-ui-select--pooper-item-list.star-ui-size-medium{
|
|
263
263
|
max-height: 50vh;
|
|
264
264
|
}
|
|
265
265
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="['star-ui','star-ui-switch','star-ui-size-'+size]">
|
|
2
|
+
<div :class="['star-ui', 'su-switch','star-ui-switch','star-ui-size-'+size]">
|
|
3
3
|
<label>
|
|
4
4
|
<input ref="input" type="checkbox" :name="name" :checked="modelValue" @change="handeleChange"/>
|
|
5
5
|
<div><span></span></div>
|
package/src/components/table.vue
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="star-ui su-table">
|
|
3
|
-
<table class="star-ui
|
|
4
|
-
<thead class="star-ui
|
|
5
|
-
<tr class="star-ui
|
|
6
|
-
<th v-for="item in columns" :key="item.name+item.key" class="star-ui star-ui-container
|
|
2
|
+
<div class="star-ui su-table star-ui-table">
|
|
3
|
+
<table class="star-ui star-ui-table--inner" rules="none" frame="void">
|
|
4
|
+
<thead class="star-ui star-ui-table--inner-thead">
|
|
5
|
+
<tr class="star-ui star-ui-table--inner-tr">
|
|
6
|
+
<th v-for="item in columns" :key="item.name+item.key" class="star-ui star-ui-container star-ui-table--inner-th">{{item.name}}</th>
|
|
7
7
|
</tr>
|
|
8
8
|
</thead>
|
|
9
|
-
<tbody class="star-ui
|
|
10
|
-
<tr v-for="(row,index) in data" :key="index" class="star-ui
|
|
11
|
-
<td v-for="item in columns" :key="item.name+item.key" class="star-ui star-ui-container
|
|
9
|
+
<tbody class="star-ui star-ui-table--inner-tbody">
|
|
10
|
+
<tr v-for="(row,index) in data" :key="index" class="star-ui star-ui-table--inner-tr">
|
|
11
|
+
<td v-for="item in columns" :key="item.name+item.key" class="star-ui star-ui-container star-ui-table--inner-td">{{row[item.field]}}</td>
|
|
12
12
|
</tr>
|
|
13
13
|
<slot></slot>
|
|
14
14
|
</tbody>
|
|
@@ -47,13 +47,13 @@ export default class SuTable extends Vue {
|
|
|
47
47
|
</script>
|
|
48
48
|
|
|
49
49
|
<style>
|
|
50
|
-
.
|
|
50
|
+
.star-ui-tabl{
|
|
51
51
|
width: 100%;
|
|
52
52
|
}
|
|
53
|
-
.
|
|
53
|
+
.star-ui-table--inner-thead{
|
|
54
54
|
background-color: var(--star-ui-table-head-color);
|
|
55
55
|
}
|
|
56
|
-
.
|
|
56
|
+
.star-ui-table--inner-tr{
|
|
57
57
|
border-bottom: 1px solid #e8eaec;
|
|
58
58
|
}
|
|
59
59
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="['star-ui',
|
|
2
|
+
<div :class="['star-ui', className]">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Vue } from 'vue-class-component';
|
|
9
9
|
|
|
10
10
|
import { Register, Prop } from "@ui-root/reg";
|
|
11
|
-
import { SuViewCtrlInjectKeyIsMobile } from "@ui-root/outher";
|
|
11
|
+
import { SuViewCtrlInjectKeyClassName, SuViewCtrlInjectKeyIsMobile } from "@ui-root/outher";
|
|
12
12
|
import { Provide } from "vue-property-decorator";
|
|
13
13
|
import "../global-style.css";
|
|
14
14
|
|
|
@@ -17,26 +17,11 @@ type DeviceType='auto'|'mobile'|'pc';
|
|
|
17
17
|
|
|
18
18
|
@Register({
|
|
19
19
|
name:"su-view-control",
|
|
20
|
-
watch:{
|
|
21
|
-
$isMobile(newValue){
|
|
22
|
-
//this.sendData.isMobile = newValue;
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
// provide() {
|
|
26
|
-
// return {
|
|
27
|
-
// viewCtrlInfo: this.sendData
|
|
28
|
-
// }
|
|
29
|
-
// },
|
|
30
|
-
// created(){
|
|
31
|
-
// this.sendData.isMobile = this.$isMobile;
|
|
32
|
-
// }
|
|
33
20
|
})
|
|
34
21
|
export default class SuViewControl extends Vue {
|
|
35
22
|
mounted():void{
|
|
36
23
|
this.$el._vue = this;
|
|
37
24
|
}
|
|
38
|
-
// @Provide({to:SuViewCtrlInjectKeyIsMobile})
|
|
39
|
-
// isMobile=false;
|
|
40
25
|
@Prop({
|
|
41
26
|
type: String,
|
|
42
27
|
default: "auto",
|
|
@@ -76,6 +61,15 @@ export default class SuViewControl extends Vue {
|
|
|
76
61
|
}
|
|
77
62
|
return false;
|
|
78
63
|
}
|
|
64
|
+
@Provide({to:SuViewCtrlInjectKeyClassName})
|
|
65
|
+
public get className():string[]{
|
|
66
|
+
return [
|
|
67
|
+
'su-view-control',
|
|
68
|
+
'star-ui-view-control',
|
|
69
|
+
`star-ui-view-control-${this.$isMobile?'mobile':'pc'}`,
|
|
70
|
+
`su-view-control-${this.$isMobile?'mobile':'pc'}`
|
|
71
|
+
];
|
|
72
|
+
}
|
|
79
73
|
beforeMount(){
|
|
80
74
|
this.checkWindowSize();
|
|
81
75
|
window.addEventListener("resize", this.checkWindowSize);
|
package/src/global-style.css
CHANGED
|
@@ -50,4 +50,76 @@
|
|
|
50
50
|
line-height: var(--star-ui-input-mini-font-size);
|
|
51
51
|
padding: calc(var(--star-ui-default-padding) / 2);
|
|
52
52
|
border-radius: calc(var(--star-ui-border-radius) / 2);
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
|
+
.star-ui-col-1{
|
|
55
|
+
width: calc(100% / 24 * 1);
|
|
56
|
+
}
|
|
57
|
+
.star-ui-col-2{
|
|
58
|
+
width: calc(100% / 24 * 2);
|
|
59
|
+
}
|
|
60
|
+
.star-ui-col-3{
|
|
61
|
+
width: calc(100% / 24 * 3);
|
|
62
|
+
}
|
|
63
|
+
.star-ui-col-4{
|
|
64
|
+
width: calc(100% / 24 * 4);
|
|
65
|
+
}
|
|
66
|
+
.star-ui-col-5{
|
|
67
|
+
width: calc(100% / 24 * 5);
|
|
68
|
+
}
|
|
69
|
+
.star-ui-col-6{
|
|
70
|
+
width: calc(100% / 24 * 6);
|
|
71
|
+
}
|
|
72
|
+
.star-ui-col-7{
|
|
73
|
+
width: calc(100% / 24 * 7);
|
|
74
|
+
}
|
|
75
|
+
.star-ui-col-8{
|
|
76
|
+
width: calc(100% / 24 * 8);
|
|
77
|
+
}
|
|
78
|
+
.star-ui-col-9{
|
|
79
|
+
width: calc(100% / 24 * 9);
|
|
80
|
+
}
|
|
81
|
+
.star-ui-col-10{
|
|
82
|
+
width: calc(100% / 24 * 10);
|
|
83
|
+
}
|
|
84
|
+
.star-ui-col-11{
|
|
85
|
+
width: calc(100% / 24 * 11);
|
|
86
|
+
}
|
|
87
|
+
.star-ui-col-12{
|
|
88
|
+
width: calc(100% / 24 * 12);
|
|
89
|
+
}
|
|
90
|
+
.star-ui-col-13{
|
|
91
|
+
width: calc(100% / 24 * 13);
|
|
92
|
+
}
|
|
93
|
+
.star-ui-col-14{
|
|
94
|
+
width: calc(100% / 24 * 14);
|
|
95
|
+
}
|
|
96
|
+
.star-ui-col-15{
|
|
97
|
+
width: calc(100% / 24 * 15);
|
|
98
|
+
}
|
|
99
|
+
.star-ui-col-16{
|
|
100
|
+
width: calc(100% / 24 * 16);
|
|
101
|
+
}
|
|
102
|
+
.star-ui-col-17{
|
|
103
|
+
width: calc(100% / 24 * 17);
|
|
104
|
+
}
|
|
105
|
+
.star-ui-col-18{
|
|
106
|
+
width: calc(100% / 24 * 18);
|
|
107
|
+
}
|
|
108
|
+
.star-ui-col-19{
|
|
109
|
+
width: calc(100% / 24 * 19);
|
|
110
|
+
}
|
|
111
|
+
.star-ui-col-20{
|
|
112
|
+
width: calc(100% / 24 * 20);
|
|
113
|
+
}
|
|
114
|
+
.star-ui-col-21{
|
|
115
|
+
width: calc(100% / 24 * 22);
|
|
116
|
+
}
|
|
117
|
+
.star-ui-col-22{
|
|
118
|
+
width: calc(100% / 24 * 22);
|
|
119
|
+
}
|
|
120
|
+
.star-ui-col-23{
|
|
121
|
+
width: calc(100% / 24 * 23);
|
|
122
|
+
}
|
|
123
|
+
.star-ui-col-24{
|
|
124
|
+
width: calc(100% / 24 * 24);
|
|
125
|
+
}
|
package/src/main.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { default as SuVLine } from "./components/line-v.vue";
|
|
|
8
8
|
export { default as SuCard } from "./components/card.vue";
|
|
9
9
|
export { default as SuTree } from "./components/tree/index.vue";
|
|
10
10
|
//表单
|
|
11
|
+
export * from "./components/form";
|
|
11
12
|
export { default as SuInput } from "./components/input.vue";
|
|
12
13
|
export { default as SuSelect } from "./components/select.vue";
|
|
13
14
|
export { default as SuButton } from "./components/button.vue";
|
package/src/outher/index.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Inject } from "vue-property-decorator";
|
|
2
2
|
|
|
3
3
|
export const SuViewCtrlInjectKeyIsMobile=Symbol('SuViewCtrlInjectKeyIsMobile');
|
|
4
|
-
export const SuViewCtrlInjectIsMobile = Inject({from:SuViewCtrlInjectKeyIsMobile,default:false})
|
|
4
|
+
export const SuViewCtrlInjectIsMobile = Inject({from:SuViewCtrlInjectKeyIsMobile,default:false});
|
|
5
|
+
export const SuViewCtrlInjectKeyClassName=Symbol('SuViewCtrlInjectKeyClassName');
|
|
6
|
+
export const SuViewCtrlInjectClassName = Inject({from:SuViewCtrlInjectKeyClassName,default:[]});
|
|
7
|
+
|
|
8
|
+
export type TypeFormLabelAlign = 'left'|'right'|'top'|undefined;
|