@thestarweb/ui 1.5.0 → 1.6.1

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.
Files changed (48) hide show
  1. package/dist/star-ui.common.js +1673 -1173
  2. package/dist/star-ui.common.js.map +1 -1
  3. package/dist/star-ui.umd.js +1673 -1173
  4. package/dist/star-ui.umd.js.map +1 -1
  5. package/dist/star-ui.umd.min.js +72 -72
  6. package/dist/star-ui.umd.min.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/button.vue +4 -4
  9. package/src/components/calendar.vue +8 -8
  10. package/src/components/card.vue +1 -1
  11. package/src/components/common/base-popper.vue +31 -35
  12. package/src/components/content/page.vue +26 -9
  13. package/src/components/form/form/form-item.vue +117 -0
  14. package/src/components/form/form/form.vue +109 -0
  15. package/src/components/form/form/index.ts +2 -0
  16. package/src/components/form/index.ts +1 -0
  17. package/src/components/input.vue +2 -1
  18. package/src/components/layout/auto-direction/index.vue +28 -0
  19. package/src/components/layout/index.ts +1 -0
  20. package/src/components/layout-h.vue +4 -4
  21. package/src/components/layout-main.vue +2 -2
  22. package/src/components/layout-v.vue +4 -4
  23. package/src/components/line-h.vue +2 -2
  24. package/src/components/line-v.vue +2 -2
  25. package/src/components/menu/index.vue +7 -4
  26. package/src/components/select.vue +10 -12
  27. package/src/components/switch.vue +1 -1
  28. package/src/components/table.vue +11 -11
  29. package/src/components/tree/index.vue +1 -0
  30. package/src/components/view-control.vue +19 -21
  31. package/src/global-style.css +73 -1
  32. package/src/main.ts +3 -0
  33. package/src/outher/index.ts +8 -0
  34. package/src/reg.ts +38 -3
  35. package/src/types.d.ts +1 -1
  36. package/types/components/common/base-popper.vue.d.ts +6 -4
  37. package/types/components/content/page.vue.d.ts +1 -2
  38. package/types/components/form/form/form-item.vue.d.ts +22 -0
  39. package/types/components/form/form/form.vue.d.ts +24 -0
  40. package/types/components/form/form/index.d.ts +2 -0
  41. package/types/components/form/index.d.ts +1 -0
  42. package/types/components/layout/auto-direction/index.vue.d.ts +4 -0
  43. package/types/components/layout/index.d.ts +1 -0
  44. package/types/components/select.vue.d.ts +1 -2
  45. package/types/components/view-control.vue.d.ts +3 -2
  46. package/types/main.d.ts +3 -0
  47. package/types/outher/index.d.ts +5 -0
  48. package/types/reg.d.ts +10 -1
@@ -1,10 +1,13 @@
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" />
6
- <component v-else :is="displayComponent" :[useedKey]="data.path" @click.prevent>
7
- {{data.title}}
6
+ <component v-else :is="displayComponent" :[useedKey]="data.path||'#'" @click.prevent>
7
+ <slot v-if="$slots['menu-text']" name="menu-text" v-bind="data" />
8
+ <template v-else>
9
+ {{data.title}}
10
+ </template>
8
11
  </component>
9
12
  </div>
10
13
  </template>
@@ -76,7 +79,7 @@ export default class SuHMenu extends Vue {
76
79
 
77
80
  </script>
78
81
  <style>
79
- .su-menu a{
82
+ .star-ui-menu a{
80
83
  color: inherit;
81
84
  text-decoration: none;
82
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">
@@ -11,8 +11,8 @@
11
11
  </div>
12
12
  <!-- 选项弹窗 -->
13
13
  <base-popper :from-item="$el" :visible="isFocused" @out-click="isFocused=false">
14
- <div :class="['star-ui','star-ui-select--pooper',pooperClass]" :style="{width:suControl.isMobile?'100%':(width+'px')}">
15
- <div class="star-ui star-ui-select--pooper-title" v-if="suControl.isMobile">请选择</div>
14
+ <div :class="['star-ui','star-ui-select--pooper',pooperClass]" :style="{width:isMobile?'100%':(width+'px')}">
15
+ <div class="star-ui star-ui-select--pooper-title" v-if="isMobile">请选择</div>
16
16
  <div :class="['star-ui','star-ui-select--pooper-item-list','star-ui-size-'+size]">
17
17
 
18
18
  <su-tree v-if="showAsTree" ref="tree" highlight-current :size="size" :treeData="options" :label="labelName" :value="valueName" :children="children" @node-click="haandleNodeClick"></su-tree>
@@ -28,11 +28,9 @@
28
28
  <script lang="ts">
29
29
  import { Vue } from 'vue-class-component';
30
30
  import BasePopper from "./common/base-popper.vue";
31
- import { Inject } from "vue-property-decorator";
32
31
  import { Register, Emit, Prop } from "@ui-root/reg";
33
- import { ViewCtrlInfo } from "../types";
32
+ import { SuViewCtrlInjectIsMobile } from "@ui-root/outher";
34
33
  import SuTree from "./tree/index.vue";
35
- import ViewControl from "./view-control.vue";
36
34
 
37
35
 
38
36
  import "../global-style.css";
@@ -113,7 +111,7 @@ export default class SuSelect extends Vue {
113
111
  })
114
112
  readonly pooperClass!:string;
115
113
  isFocused=false;
116
- @Inject({from:ViewControl.injectSymbol,default:{}}) readonly suControl!: ViewCtrlInfo;
114
+ @SuViewCtrlInjectIsMobile readonly isMobile!: boolean;
117
115
  get valueMap():Map<string|number,string>{
118
116
  const map=new Map();
119
117
  if(this.showAsTree){
@@ -242,26 +240,26 @@ export default class SuSelect extends Vue {
242
240
  font-weight: bold;
243
241
  padding: var(--star-ui-default-padding);
244
242
  }
245
- .su-view-control-mobile .star-ui-select--pooper{
243
+ .star-ui-view-control-mobile .star-ui-select--pooper{
246
244
  width: 100%;
247
245
  }
248
- .su-view-control.su-view-control-mobile .star-ui-select--pooper{
246
+ .star-ui-view-control.star-ui-view-control-mobile .star-ui-select--pooper{
249
247
  border-radius: 0;
250
248
  border-width: 0;
251
249
  }
252
- .su-view-control.su-view-control-mobile .star-ui-select--option{
250
+ .star-ui-view-control.star-ui-view-control-mobile .star-ui-select--option{
253
251
  border-radius: 0;
254
252
  padding-left: 10px;
255
253
  border-left: 5px solid transparent;
256
254
  border-top: 1px solid var(--star-ui-input-border-color);
257
255
  line-height: 1.5;
258
256
  }
259
- .su-view-control.su-view-control-mobile .star-ui-select--option-sel{
257
+ .star-ui-view-control.star-ui-view-control-mobile .star-ui-select--option-sel{
260
258
  background: initial;
261
259
  color: var(--star-ui-base-color);
262
260
  border-left: 5px solid var(--star-ui-base-color);
263
261
  }
264
- .su-view-control-mobile .star-ui-select--pooper-item-list.star-ui-size-medium{
262
+ .star-ui-view-control-mobile .star-ui-select--pooper-item-list.star-ui-size-medium{
265
263
  max-height: 50vh;
266
264
  }
267
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>
@@ -1,14 +1,14 @@
1
1
  <template>
2
- <div class="star-ui su-table">
3
- <table class="star-ui su-table--inner" rules="none" frame="void">
4
- <thead class="star-ui su-table--inner-thead">
5
- <tr class="star-ui su-table--inner-tr">
6
- <th v-for="item in columns" :key="item.name+item.key" class="star-ui star-ui-container su-table--inner-th">{{item.name}}</th>
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 su-table--inner-tbody">
10
- <tr v-for="(row,index) in data" :key="index" class="star-ui su-table--inner-tr">
11
- <td v-for="item in columns" :key="item.name+item.key" class="star-ui star-ui-container su-table--inner-td">{{row[item.field]}}</td>
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
- .su-tabl{
50
+ .star-ui-tabl{
51
51
  width: 100%;
52
52
  }
53
- .su-table--inner-thead{
53
+ .star-ui-table--inner-thead{
54
54
  background-color: var(--star-ui-table-head-color);
55
55
  }
56
- .su-table--inner-tr{
56
+ .star-ui-table--inner-tr{
57
57
  border-bottom: 1px solid #e8eaec;
58
58
  }
59
59
  </style>
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div :class="[
3
3
  'star-ui',
4
+ 'su-tree',
4
5
  'star-ui-tree',
5
6
  {
6
7
  'star-ui-tree-highlight-current':highlightCurrent
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="['star-ui', 'su-view-control', $isMobile?'su-view-control-mobile':'su-view-control-pc']">
2
+ <div :class="['star-ui', className]">
3
3
  <slot></slot>
4
4
  </div>
5
5
  </template>
@@ -8,9 +8,8 @@
8
8
  import { Vue } from 'vue-class-component';
9
9
 
10
10
  import { Register, Prop } from "@ui-root/reg";
11
+ import { SuViewCtrlInjectKeyClassName, SuViewCtrlInjectKeyIsMobile } from "@ui-root/outher";
11
12
  import { Provide } from "vue-property-decorator";
12
-
13
- import { ViewCtrlInfo } from "../types";
14
13
  import "../global-style.css";
15
14
 
16
15
  type DeviceType='auto'|'mobile'|'pc';
@@ -18,29 +17,11 @@ type DeviceType='auto'|'mobile'|'pc';
18
17
 
19
18
  @Register({
20
19
  name:"su-view-control",
21
- watch:{
22
- $isMobile(newValue){
23
- this.sendData.isMobile = newValue;
24
- }
25
- },
26
- provide() {
27
- return {
28
- viewCtrlInfo: this.sendData
29
- }
30
- },
31
- created(){
32
- this.sendData.isMobile = this.$isMobile;
33
- }
34
20
  })
35
21
  export default class SuViewControl extends Vue {
36
- public static readonly injectSymbol=Symbol();
37
22
  mounted():void{
38
23
  this.$el._vue = this;
39
24
  }
40
- @Provide({to:SuViewControl.injectSymbol})
41
- private sendData:ViewCtrlInfo={
42
- isMobile:false
43
- }
44
25
  @Prop({
45
26
  type: String,
46
27
  default: "auto",
@@ -63,6 +44,7 @@ export default class SuViewControl extends Vue {
63
44
  this.windowWidth = window.innerWidth;
64
45
  this.windowHeight = window.innerHeight;
65
46
  }
47
+ @Provide({to:SuViewCtrlInjectKeyIsMobile,reactive:true})
66
48
  public get $isMobile():boolean{
67
49
  switch (this.deviceType) {
68
50
  case "mobile":
@@ -78,6 +60,22 @@ export default class SuViewControl extends Vue {
78
60
  }
79
61
  return false;
80
62
  }
63
+ @Provide({to:SuViewCtrlInjectKeyClassName,reactive:true})
64
+ public get className():string[]{
65
+ return [
66
+ 'su-view-control',
67
+ 'star-ui-view-control',
68
+ `star-ui-view-control-${this.$isMobile?'mobile':'pc'}`,
69
+ `su-view-control-${this.$isMobile?'mobile':'pc'}`
70
+ ];
71
+ }
72
+ beforeMount(){
73
+ this.checkWindowSize();
74
+ window.addEventListener("resize", this.checkWindowSize);
75
+ }
76
+ beforeUnmount(){
77
+ window.removeEventListener("resize", this.checkWindowSize);
78
+ }
81
79
  }
82
80
  </script>
83
81
 
@@ -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";
@@ -20,9 +21,11 @@ export { default as SuCalendar } from "./components/calendar.vue";
20
21
  export { default as SuViewControl } from "./components/view-control.vue";
21
22
 
22
23
  export * from "./components/menu";
24
+ export * from "./components/layout"
23
25
  export * from "./components/content";
24
26
 
25
27
  import { data } from "./reg";
28
+ export * from "./outher";
26
29
 
27
30
  import { App, readonly } from "vue";
28
31
 
@@ -0,0 +1,8 @@
1
+ import { Inject } from "vue-property-decorator";
2
+
3
+ export const SuViewCtrlInjectKeyIsMobile=Symbol('SuViewCtrlInjectKeyIsMobile');
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;
package/src/reg.ts CHANGED
@@ -1,11 +1,18 @@
1
1
  import { VueDecorator, PropOptions, createDecorator, Vue, VueConstructor, VueBase } from "vue-class-component";
2
- import { ComponentOptions, reactive } from "vue";
2
+ import { ComponentOptions, PropType, reactive } from "vue";
3
3
  interface ComponentInfo{
4
4
  hideInDoc?:boolean;
5
5
  internalOnly?:boolean;
6
6
  type?:'from'|'layout';
7
7
  }
8
8
 
9
+ const AutoTypes = {
10
+ FormLabelAlign: {
11
+ allow: ['left','right','top'],
12
+ type: String,
13
+ }
14
+ }
15
+
9
16
  export const data = reactive({
10
17
  //
11
18
  } as {[key:string]: {
@@ -80,7 +87,18 @@ export function Emit(event?:string, shouldEmit?:(res:any)=>boolean):VueDecorator
80
87
  });
81
88
  }
82
89
 
83
- export function Prop(propOptions:PropOptions):VueDecorator{
90
+ interface RegPropOptions<T = any, D = T> extends PropOptions<T>{
91
+ autoType?: keyof typeof AutoTypes;
92
+ }
93
+
94
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
95
+ function checkPropInAllow(list:any[]){
96
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
+ return function(value:any){
98
+ return list.includes(value);
99
+ }
100
+ }
101
+ export function Prop({ autoType , ...propOptions}:RegPropOptions):VueDecorator{
84
102
  return createDecorator((componentOptions, key) => {
85
103
  if(componentOptions.name){
86
104
  if(!data[componentOptions.name]) data[componentOptions.name] = {};
@@ -88,7 +106,24 @@ export function Prop(propOptions:PropOptions):VueDecorator{
88
106
  // eslint-disable-next-line
89
107
  (data[componentOptions.name].props!)[key] = propOptions;
90
108
  }
109
+ const eData:PropOptions = {};
110
+ if(autoType){
111
+ const autoTypeData = AutoTypes[autoType];
112
+ if(autoTypeData.type){
113
+ eData.type = autoTypeData.type;
114
+ }
115
+ const validator = [];
116
+ if(autoTypeData.allow){
117
+ validator.push(checkPropInAllow(autoTypeData.allow))
118
+ }
119
+ if(validator.length === 1){
120
+ eData.validator = validator[0];
121
+ }
122
+ }
91
123
  if(!componentOptions.props) componentOptions.props={};
92
- componentOptions.props[key] = propOptions;
124
+ componentOptions.props[key] = {
125
+ ...eData,
126
+ ...propOptions
127
+ };
93
128
  });
94
129
  }
package/src/types.d.ts CHANGED
@@ -3,7 +3,7 @@ export interface ViewCtrlInfo{
3
3
  }
4
4
  export interface MenuItem{
5
5
  name?:string;
6
- path:string;
6
+ path?:string;
7
7
  title:string;
8
8
  children?:MenuItem[];
9
9
  }
@@ -1,19 +1,21 @@
1
1
  import { Vue } from 'vue-class-component';
2
- import { ViewCtrlInfo } from "../../types";
3
2
  import "../../global-style.css";
4
3
  export default class SuButton extends Vue {
4
+ $refs: {
5
+ root: HTMLDivElement;
6
+ };
5
7
  fromItem: Vue | HTMLElement;
6
8
  private div;
7
9
  private id;
8
10
  private updateType;
9
11
  private visible;
10
- readonly suControl: ViewCtrlInfo;
11
- beforeCreate(): void;
12
- unmounted(): void;
12
+ readonly isMobile: false;
13
13
  mounted(): void;
14
14
  beforeUnmount(): void;
15
15
  _clickCheck(ev: MouseEvent): boolean;
16
16
  private syncRequestId;
17
17
  _updateVisible(): void;
18
+ readonly ctrlClass: string[];
19
+ private baseStyle;
18
20
  updatePos(): void;
19
21
  }
@@ -1,8 +1,7 @@
1
1
  import { Vue } from "vue-class-component";
2
- import { ViewCtrlInfo } from "../../types";
3
2
  import "@ui-root/global-style.css";
4
3
  export default class SuMain extends Vue {
5
- readonly suControl: ViewCtrlInfo;
4
+ readonly isMobile: boolean;
6
5
  private title;
7
6
  private logo;
8
7
  private menu;
@@ -0,0 +1,22 @@
1
+ import { Vue } from "vue-class-component";
2
+ import { TypeFormLabelAlign } from "../../../outher";
3
+ import { Bus } from "./form.vue";
4
+ import "@ui-root/global-style.css";
5
+ export declare const InjectLabelWidth: unique symbol;
6
+ export declare const InjectLabelAlign: unique symbol;
7
+ export declare const InjectEventBus: unique symbol;
8
+ export default class SuButton extends Vue {
9
+ $refs: {
10
+ labelDiv: HTMLDivElement;
11
+ };
12
+ readonly label: string;
13
+ readonly labelWidth: string | number | undefined;
14
+ readonly pLabelWidth: string | number | undefined;
15
+ readonly labelAlign: TypeFormLabelAlign;
16
+ readonly pLabelAlign: TypeFormLabelAlign;
17
+ readonly col: number;
18
+ private get labelStyle();
19
+ readonly bus: Bus | undefined;
20
+ created(): void;
21
+ beforeUnmount(): void;
22
+ }
@@ -0,0 +1,24 @@
1
+ import { Vue } from "vue-class-component";
2
+ import type { TypeFormLabelAlign } from "../../../outher";
3
+ import Item from "./form-item.vue";
4
+ import "@ui-root/global-style.css";
5
+ export interface Bus {
6
+ addItem: (item: Item) => void;
7
+ removeItem: (item: Item) => void;
8
+ labelUpdate: (item: Item) => void;
9
+ }
10
+ export default class SuButton extends Vue {
11
+ readonly labelAlign: TypeFormLabelAlign;
12
+ readonly labelWidth: number | undefined;
13
+ readonly allowAotoMobile: boolean;
14
+ private bus;
15
+ private items;
16
+ private addItem;
17
+ private removeItem;
18
+ private updateLabelWidth;
19
+ private isLoaded;
20
+ private sendLabelWidth;
21
+ created(): void;
22
+ mounted(): void;
23
+ beforeUnmount(): void;
24
+ }
@@ -0,0 +1,2 @@
1
+ export { default as SuForm } from "./form.vue";
2
+ export { default as SuFormItem } from "./form-item.vue";
@@ -0,0 +1 @@
1
+ export * from "./form/index";
@@ -0,0 +1,4 @@
1
+ import { Vue } from "vue-class-component";
2
+ import "@ui-root/global-style.css";
3
+ export default class SuAutoDirection extends Vue {
4
+ }
@@ -0,0 +1 @@
1
+ export { default as SuAutoDirection } from "./auto-direction/index.vue";
@@ -1,5 +1,4 @@
1
1
  import { Vue } from 'vue-class-component';
2
- import { ViewCtrlInfo } from "../types";
3
2
  import SuTree from "./tree/index.vue";
4
3
  import "../global-style.css";
5
4
  export default class SuSelect extends Vue {
@@ -17,7 +16,7 @@ export default class SuSelect extends Vue {
17
16
  readonly showAsTree: boolean;
18
17
  readonly pooperClass: string;
19
18
  isFocused: boolean;
20
- readonly suControl: ViewCtrlInfo;
19
+ readonly isMobile: boolean;
21
20
  get valueMap(): Map<string | number, string>;
22
21
  get showValue(): string;
23
22
  private width;
@@ -2,14 +2,15 @@ import { Vue } from 'vue-class-component';
2
2
  import "../global-style.css";
3
3
  declare type DeviceType = 'auto' | 'mobile' | 'pc';
4
4
  export default class SuViewControl extends Vue {
5
- static readonly injectSymbol: unique symbol;
6
5
  mounted(): void;
7
- private sendData;
8
6
  deviceType: DeviceType;
9
7
  checkFunction: 'ua' | 'screen-width';
10
8
  private windowWidth;
11
9
  private windowHeight;
12
10
  checkWindowSize(): void;
13
11
  get $isMobile(): boolean;
12
+ get className(): string[];
13
+ beforeMount(): void;
14
+ beforeUnmount(): void;
14
15
  }
15
16
  export {};
package/types/main.d.ts CHANGED
@@ -6,6 +6,7 @@ export { default as SuHLine } from "./components/line-h.vue";
6
6
  export { default as SuVLine } from "./components/line-v.vue";
7
7
  export { default as SuCard } from "./components/card.vue";
8
8
  export { default as SuTree } from "./components/tree/index.vue";
9
+ export * from "./components/form";
9
10
  export { default as SuInput } from "./components/input.vue";
10
11
  export { default as SuSelect } from "./components/select.vue";
11
12
  export { default as SuButton } from "./components/button.vue";
@@ -14,7 +15,9 @@ export { default as SuSlider } from "./components/slider.vue";
14
15
  export { default as SuCalendar } from "./components/calendar.vue";
15
16
  export { default as SuViewControl } from "./components/view-control.vue";
16
17
  export * from "./components/menu";
18
+ export * from "./components/layout";
17
19
  export * from "./components/content";
20
+ export * from "./outher";
18
21
  import { App } from "vue";
19
22
  export declare const components: Record<string, any>;
20
23
  export declare const allData: {
@@ -0,0 +1,5 @@
1
+ export declare const SuViewCtrlInjectKeyIsMobile: unique symbol;
2
+ export declare const SuViewCtrlInjectIsMobile: import("vue-class-component").VueDecorator;
3
+ export declare const SuViewCtrlInjectKeyClassName: unique symbol;
4
+ export declare const SuViewCtrlInjectClassName: import("vue-class-component").VueDecorator;
5
+ export declare type TypeFormLabelAlign = 'left' | 'right' | 'top' | undefined;
package/types/reg.d.ts CHANGED
@@ -5,6 +5,12 @@ interface ComponentInfo {
5
5
  internalOnly?: boolean;
6
6
  type?: 'from' | 'layout';
7
7
  }
8
+ declare const AutoTypes: {
9
+ FormLabelAlign: {
10
+ allow: string[];
11
+ type: StringConstructor;
12
+ };
13
+ };
8
14
  export declare const data: {
9
15
  [x: string]: {
10
16
  props?: {
@@ -32,5 +38,8 @@ export declare const data: {
32
38
  export declare type RegisterOptions<V> = ComponentOptions & ThisType<V> & ComponentInfo;
33
39
  export declare function Register<V extends Vue>({ hideInDoc, internalOnly, ...options }: RegisterOptions<V>): <VC extends VueConstructor<VueBase>>(target: VC) => VC;
34
40
  export declare function Emit(event?: string, shouldEmit?: (res: any) => boolean): VueDecorator;
35
- export declare function Prop(propOptions: PropOptions): VueDecorator;
41
+ interface RegPropOptions<T = any, D = T> extends PropOptions<T> {
42
+ autoType?: keyof typeof AutoTypes;
43
+ }
44
+ export declare function Prop({ autoType, ...propOptions }: RegPropOptions): VueDecorator;
36
45
  export {};