@vyr/element-plus 0.0.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.
- package/package.json +24 -0
- package/src/actor/ElButtonActor.ts +42 -0
- package/src/actor/ElCascaderActor.ts +43 -0
- package/src/actor/ElCheckboxActor.ts +46 -0
- package/src/actor/ElColActor.ts +36 -0
- package/src/actor/ElDatePickerActor.ts +42 -0
- package/src/actor/ElDialogActor.ts +38 -0
- package/src/actor/ElFormActor.ts +46 -0
- package/src/actor/ElFormItemActor.ts +81 -0
- package/src/actor/ElInputActor.ts +47 -0
- package/src/actor/ElInputNumberActor.ts +38 -0
- package/src/actor/ElMenuActor.ts +35 -0
- package/src/actor/ElMenuItemActor.ts +46 -0
- package/src/actor/ElPaginationActor.ts +83 -0
- package/src/actor/ElRadioActor.ts +46 -0
- package/src/actor/ElRowActor.ts +37 -0
- package/src/actor/ElSelectActor.ts +49 -0
- package/src/actor/ElSubMenuActor.ts +46 -0
- package/src/actor/ElSwitchActor.ts +26 -0
- package/src/actor/ElTableActor.ts +35 -0
- package/src/actor/ElTableColumnActor.ts +72 -0
- package/src/actor/index.ts +20 -0
- package/src/asset/index.ts +17 -0
- package/src/descriptor/ElButtonDescriptor.ts +36 -0
- package/src/descriptor/ElCascaderDescriptor.ts +43 -0
- package/src/descriptor/ElCheckboxDescriptor.ts +41 -0
- package/src/descriptor/ElColDescriptor.ts +20 -0
- package/src/descriptor/ElDatePickerDescriptor.ts +43 -0
- package/src/descriptor/ElDialogDescriptor.ts +24 -0
- package/src/descriptor/ElFormDescriptor.ts +60 -0
- package/src/descriptor/ElFormItemDescriptor.ts +14 -0
- package/src/descriptor/ElInputDescriptor.ts +56 -0
- package/src/descriptor/ElInputNumberDescriptor.ts +38 -0
- package/src/descriptor/ElMenuDescriptor.ts +26 -0
- package/src/descriptor/ElMenuItemDescriptor.ts +22 -0
- package/src/descriptor/ElPaginationDescriptor.ts +52 -0
- package/src/descriptor/ElRadioDescriptor.ts +41 -0
- package/src/descriptor/ElRowDescriptor.ts +22 -0
- package/src/descriptor/ElSelectDescriptor.ts +43 -0
- package/src/descriptor/ElSubMenuDescriptor.ts +20 -0
- package/src/descriptor/ElSwitchDescriptor.ts +35 -0
- package/src/descriptor/ElTableColumnDescriptor.ts +41 -0
- package/src/descriptor/ElTableDescriptor.ts +26 -0
- package/src/descriptor/index.ts +20 -0
- package/src/index.ts +7 -0
- package/src/interpreter/ElButtonInterpreter.ts +18 -0
- package/src/interpreter/ElCascaderInterpreter.ts +18 -0
- package/src/interpreter/ElCheckboxInterpreter.ts +18 -0
- package/src/interpreter/ElColInterpreter.ts +18 -0
- package/src/interpreter/ElDatePickerInterpreter.ts +18 -0
- package/src/interpreter/ElDialogInterpreter.ts +18 -0
- package/src/interpreter/ElFormInterpreter.ts +18 -0
- package/src/interpreter/ElInputInterpreter.ts +18 -0
- package/src/interpreter/ElInputNumberInterpreter.ts +18 -0
- package/src/interpreter/ElMenuInterpreter.ts +18 -0
- package/src/interpreter/ElMenuItemInterpreter.ts +18 -0
- package/src/interpreter/ElPaginationInterpreter.ts +18 -0
- package/src/interpreter/ElRadioInterpreter.ts +18 -0
- package/src/interpreter/ElRowInterpreter.ts +18 -0
- package/src/interpreter/ElSelectInterpreter.ts +18 -0
- package/src/interpreter/ElSubMenuInterpreter.ts +18 -0
- package/src/interpreter/ElSwitchInterpreter.ts +18 -0
- package/src/interpreter/ElTableColumnInterpreter.ts +18 -0
- package/src/interpreter/ElTableInterpreter.ts +18 -0
- package/src/interpreter/index.ts +33 -0
- package/src/locale/Language.ts +10 -0
- package/src/locale/LanguageProvider.ts +64 -0
- package/src/locale/index.ts +2 -0
- package/src/preset/execute/ElDialog/close.ts +48 -0
- package/src/preset/execute/ElDialog/index.ts +2 -0
- package/src/preset/execute/ElDialog/open.ts +51 -0
- package/src/preset/execute/ElForm/branch.ts +47 -0
- package/src/preset/execute/ElForm/create.ts +31 -0
- package/src/preset/execute/ElForm/edit.ts +31 -0
- package/src/preset/execute/ElForm/getData.ts +51 -0
- package/src/preset/execute/ElForm/index.ts +5 -0
- package/src/preset/execute/ElForm/reset.ts +55 -0
- package/src/preset/execute/ElPagination/getData.ts +48 -0
- package/src/preset/execute/ElPagination/index.ts +2 -0
- package/src/preset/execute/ElPagination/reset.ts +46 -0
- package/src/preset/execute/ElTable/create.ts +38 -0
- package/src/preset/execute/ElTable/delete.ts +53 -0
- package/src/preset/execute/ElTable/edit.ts +38 -0
- package/src/preset/execute/ElTable/index.ts +3 -0
- package/src/preset/execute/ElTableColumn/formatter.ts +74 -0
- package/src/preset/execute/ElTableColumn/index.ts +1 -0
- package/src/preset/execute/index.ts +5 -0
- package/src/preset/index.ts +7 -0
- package/src/preset/routine/ElDialog/close.ts +26 -0
- package/src/preset/routine/ElDialog/index.ts +1 -0
- package/src/preset/routine/ElTable/create.ts +31 -0
- package/src/preset/routine/ElTable/delete.ts +31 -0
- package/src/preset/routine/ElTable/edit.ts +33 -0
- package/src/preset/routine/ElTable/index.ts +6 -0
- package/src/preset/routine/ElTable/list.ts +32 -0
- package/src/preset/routine/ElTable/reset.ts +31 -0
- package/src/preset/routine/ElTable/submit.ts +45 -0
- package/src/preset/routine/index.ts +2 -0
- package/src/shims-vue.d.ts +5 -0
- package/src/utils/form.ts +72 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/style.ts +9 -0
- package/src/utils/validator.ts +30 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
import { ElFormItemDescriptor } from "./ElFormItemDescriptor";
|
|
4
|
+
|
|
5
|
+
class ElInputDescriptor extends ElFormItemDescriptor {
|
|
6
|
+
static type = 'ElInput'
|
|
7
|
+
|
|
8
|
+
columnName: string
|
|
9
|
+
columnComment: string
|
|
10
|
+
columnType: string
|
|
11
|
+
modelValue: string
|
|
12
|
+
labelWidth: string | number
|
|
13
|
+
placeholder: string
|
|
14
|
+
|
|
15
|
+
inputType: string
|
|
16
|
+
rows: number
|
|
17
|
+
step: string | number
|
|
18
|
+
readonly: boolean
|
|
19
|
+
clearable: boolean
|
|
20
|
+
showPassword: boolean
|
|
21
|
+
showWordLimit: boolean
|
|
22
|
+
disabled: boolean
|
|
23
|
+
autofocus: boolean
|
|
24
|
+
required: boolean
|
|
25
|
+
maxlength: string | number
|
|
26
|
+
minlength: string | number
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
constructor(descriptor: Partial<DeserializationObject<ElInputDescriptor>> = {}) {
|
|
30
|
+
super(descriptor)
|
|
31
|
+
this.columnName = descriptor.columnName ?? ''
|
|
32
|
+
this.columnComment = descriptor.columnComment ?? ''
|
|
33
|
+
this.columnType = descriptor.columnType ?? ''
|
|
34
|
+
this.modelValue = descriptor.modelValue ?? ''
|
|
35
|
+
this.labelWidth = descriptor.labelWidth ?? ''
|
|
36
|
+
this.placeholder = descriptor.placeholder ?? ''
|
|
37
|
+
|
|
38
|
+
this.inputType = descriptor.inputType ?? 'text'
|
|
39
|
+
this.rows = descriptor.rows ?? 2
|
|
40
|
+
this.step = descriptor.step ?? ''
|
|
41
|
+
this.readonly = descriptor.readonly ?? false
|
|
42
|
+
this.clearable = descriptor.clearable ?? false
|
|
43
|
+
this.showPassword = descriptor.showPassword ?? false
|
|
44
|
+
this.disabled = descriptor.disabled ?? false
|
|
45
|
+
this.showWordLimit = descriptor.showWordLimit ?? true
|
|
46
|
+
this.autofocus = descriptor.autofocus ?? false
|
|
47
|
+
this.required = descriptor.required ?? false
|
|
48
|
+
this.maxlength = descriptor.maxlength ?? ''
|
|
49
|
+
this.minlength = descriptor.minlength ?? ''
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
VueDescriptor.register(ElInputDescriptor)
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
ElInputDescriptor
|
|
56
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
import { ElFormItemDescriptor } from "./ElFormItemDescriptor";
|
|
4
|
+
|
|
5
|
+
class ElInputNumberDescriptor extends ElFormItemDescriptor {
|
|
6
|
+
static type = 'ElInputNumber'
|
|
7
|
+
|
|
8
|
+
columnName: string
|
|
9
|
+
columnComment: string
|
|
10
|
+
columnType: string
|
|
11
|
+
modelValue: string
|
|
12
|
+
labelWidth: string | number
|
|
13
|
+
required: boolean
|
|
14
|
+
|
|
15
|
+
min: number
|
|
16
|
+
max: number
|
|
17
|
+
step: number
|
|
18
|
+
disabled: boolean
|
|
19
|
+
|
|
20
|
+
constructor(descriptor: Partial<DeserializationObject<ElInputNumberDescriptor>> = {}) {
|
|
21
|
+
super(descriptor)
|
|
22
|
+
this.columnName = descriptor.columnName ?? ''
|
|
23
|
+
this.columnComment = descriptor.columnComment ?? ''
|
|
24
|
+
this.columnType = descriptor.columnType ?? ''
|
|
25
|
+
this.modelValue = descriptor.modelValue ?? ''
|
|
26
|
+
this.labelWidth = descriptor.labelWidth ?? ''
|
|
27
|
+
this.required = descriptor.required ?? false
|
|
28
|
+
this.min = descriptor.min ?? Number.MIN_SAFE_INTEGER
|
|
29
|
+
this.max = descriptor.max ?? Number.MAX_SAFE_INTEGER
|
|
30
|
+
this.step = descriptor.step ?? 1
|
|
31
|
+
this.disabled = descriptor.disabled ?? false
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
VueDescriptor.register(ElInputNumberDescriptor)
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
ElInputNumberDescriptor
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DefaultStyleColor, DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
|
|
4
|
+
class ElMenuDescriptor extends VueDescriptor {
|
|
5
|
+
static type = 'ElMenu'
|
|
6
|
+
|
|
7
|
+
mode: 'horizontal' | 'vertical'
|
|
8
|
+
defaultActive: string
|
|
9
|
+
backgroundColor: DefaultStyleColor
|
|
10
|
+
textColor: string
|
|
11
|
+
activeTextColor: string
|
|
12
|
+
|
|
13
|
+
constructor(descriptor: Partial<DeserializationObject<ElMenuDescriptor>> = {}) {
|
|
14
|
+
super(descriptor)
|
|
15
|
+
this.mode = descriptor.mode ?? 'vertical'
|
|
16
|
+
this.defaultActive = descriptor.defaultActive ?? ''
|
|
17
|
+
this.backgroundColor = new DefaultStyleColor(descriptor.backgroundColor)
|
|
18
|
+
this.textColor = descriptor.textColor ?? '#303133'
|
|
19
|
+
this.activeTextColor = descriptor.activeTextColor ?? '#409eff'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
VueDescriptor.register(ElMenuDescriptor)
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
ElMenuDescriptor
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
|
|
4
|
+
class ElMenuItemDescriptor extends VueDescriptor {
|
|
5
|
+
static type = 'ElMenuItem'
|
|
6
|
+
|
|
7
|
+
icon: string
|
|
8
|
+
label: string
|
|
9
|
+
content: string
|
|
10
|
+
|
|
11
|
+
constructor(descriptor: Partial<DeserializationObject<ElMenuItemDescriptor>> = {}) {
|
|
12
|
+
super(descriptor)
|
|
13
|
+
this.icon = descriptor.icon ?? ''
|
|
14
|
+
this.label = descriptor.label ?? ''
|
|
15
|
+
this.content = descriptor.content ?? ''
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
VueDescriptor.register(ElMenuItemDescriptor)
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
ElMenuItemDescriptor
|
|
22
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DeserializationObject, Graphics } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
import { ElPaginationActor } from "../actor";
|
|
4
|
+
|
|
5
|
+
class ElPaginationDescriptor extends VueDescriptor {
|
|
6
|
+
static type = 'ElPagination'
|
|
7
|
+
|
|
8
|
+
total: number
|
|
9
|
+
currentPage: number
|
|
10
|
+
pageSize: number
|
|
11
|
+
pageSizes: string
|
|
12
|
+
background: boolean
|
|
13
|
+
layoutSizes: boolean
|
|
14
|
+
layoutPrev: boolean
|
|
15
|
+
layoutPager: boolean
|
|
16
|
+
layoutNext: boolean
|
|
17
|
+
layoutJumper: boolean
|
|
18
|
+
layoutArrow: boolean
|
|
19
|
+
layoutTotal: boolean
|
|
20
|
+
|
|
21
|
+
constructor(descriptor: Partial<DeserializationObject<ElPaginationDescriptor>> = {}) {
|
|
22
|
+
super(descriptor)
|
|
23
|
+
this.total = descriptor.total ?? 0
|
|
24
|
+
this.currentPage = descriptor.currentPage ?? 1
|
|
25
|
+
this.pageSize = descriptor.pageSize ?? 10
|
|
26
|
+
this.pageSizes = descriptor.pageSizes ?? '10,20,30,40,50,100'
|
|
27
|
+
this.background = descriptor.background ?? false
|
|
28
|
+
this.layoutSizes = descriptor.layoutSizes ?? true
|
|
29
|
+
this.layoutPrev = descriptor.layoutPrev ?? true
|
|
30
|
+
this.layoutPager = descriptor.layoutPager ?? true
|
|
31
|
+
this.layoutNext = descriptor.layoutNext ?? true
|
|
32
|
+
this.layoutJumper = descriptor.layoutJumper ?? true
|
|
33
|
+
this.layoutArrow = descriptor.layoutArrow ?? true
|
|
34
|
+
this.layoutTotal = descriptor.layoutTotal ?? true
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
getData(graphics: Graphics) {
|
|
38
|
+
const itemActor = graphics.getActor<ElPaginationActor>(this, { delta: 0 })
|
|
39
|
+
|
|
40
|
+
return itemActor === null ? {} : itemActor.getData()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
reset(graphics: Graphics) {
|
|
44
|
+
const itemActor = graphics.getActor<ElPaginationActor>(this, { delta: 0 })
|
|
45
|
+
if(itemActor) itemActor.reset()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
VueDescriptor.register(ElPaginationDescriptor)
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
ElPaginationDescriptor
|
|
52
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
import { ElFormItemDescriptor } from "./ElFormItemDescriptor";
|
|
4
|
+
|
|
5
|
+
class ElRadioDescriptor extends ElFormItemDescriptor {
|
|
6
|
+
static type = 'ElRadio'
|
|
7
|
+
|
|
8
|
+
columnName: string
|
|
9
|
+
columnComment: string
|
|
10
|
+
columnType: string
|
|
11
|
+
modelValue: string
|
|
12
|
+
labelWidth: string | number
|
|
13
|
+
required: boolean
|
|
14
|
+
|
|
15
|
+
options: string
|
|
16
|
+
label: string
|
|
17
|
+
value: string
|
|
18
|
+
disabled: boolean
|
|
19
|
+
border: boolean
|
|
20
|
+
|
|
21
|
+
constructor(descriptor: Partial<DeserializationObject<ElRadioDescriptor>> = {}) {
|
|
22
|
+
super(descriptor)
|
|
23
|
+
this.columnName = descriptor.columnName ?? ''
|
|
24
|
+
this.columnComment = descriptor.columnComment ?? ''
|
|
25
|
+
this.columnType = descriptor.columnType ?? ''
|
|
26
|
+
this.modelValue = descriptor.modelValue ?? ''
|
|
27
|
+
this.labelWidth = descriptor.labelWidth ?? ''
|
|
28
|
+
this.required = descriptor.required ?? false
|
|
29
|
+
|
|
30
|
+
this.options = descriptor.options ?? ''
|
|
31
|
+
this.label = descriptor.label ?? 'label'
|
|
32
|
+
this.value = descriptor.value ?? 'value'
|
|
33
|
+
this.disabled = descriptor.disabled ?? false
|
|
34
|
+
this.border = descriptor.border ?? false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
VueDescriptor.register(ElRadioDescriptor)
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
ElRadioDescriptor
|
|
41
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
|
|
4
|
+
class ElRowDescriptor extends VueDescriptor {
|
|
5
|
+
static type = 'ElRow'
|
|
6
|
+
|
|
7
|
+
gutter: number
|
|
8
|
+
justify: string
|
|
9
|
+
align: string
|
|
10
|
+
|
|
11
|
+
constructor(descriptor: Partial<DeserializationObject<ElRowDescriptor>> = {}) {
|
|
12
|
+
super(descriptor)
|
|
13
|
+
this.gutter = descriptor.gutter ?? 0
|
|
14
|
+
this.justify = descriptor.justify ?? 'start'
|
|
15
|
+
this.align = descriptor.align ?? 'top'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
VueDescriptor.register(ElRowDescriptor)
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
ElRowDescriptor
|
|
22
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
import { ElFormItemDescriptor } from "./ElFormItemDescriptor";
|
|
4
|
+
|
|
5
|
+
class ElSelectDescriptor extends ElFormItemDescriptor {
|
|
6
|
+
static type = 'ElSelect'
|
|
7
|
+
|
|
8
|
+
columnName: string
|
|
9
|
+
columnComment: string
|
|
10
|
+
columnType: string
|
|
11
|
+
modelValue: string
|
|
12
|
+
labelWidth: string | number
|
|
13
|
+
placeholder: string
|
|
14
|
+
required: boolean
|
|
15
|
+
|
|
16
|
+
options: string
|
|
17
|
+
label: string
|
|
18
|
+
value: string
|
|
19
|
+
clearable: boolean
|
|
20
|
+
disabled: boolean
|
|
21
|
+
|
|
22
|
+
constructor(descriptor: Partial<DeserializationObject<ElSelectDescriptor>> = {}) {
|
|
23
|
+
super(descriptor)
|
|
24
|
+
this.columnName = descriptor.columnName ?? ''
|
|
25
|
+
this.columnComment = descriptor.columnComment ?? ''
|
|
26
|
+
this.columnType = descriptor.columnType ?? ''
|
|
27
|
+
this.modelValue = descriptor.modelValue ?? ''
|
|
28
|
+
this.labelWidth = descriptor.labelWidth ?? ''
|
|
29
|
+
this.placeholder = descriptor.placeholder ?? ''
|
|
30
|
+
this.required = descriptor.required ?? false
|
|
31
|
+
|
|
32
|
+
this.options = descriptor.options ?? ''
|
|
33
|
+
this.label = descriptor.label ?? 'label'
|
|
34
|
+
this.value = descriptor.value ?? 'value'
|
|
35
|
+
this.clearable = descriptor.clearable ?? false
|
|
36
|
+
this.disabled = descriptor.disabled ?? false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
VueDescriptor.register(ElSelectDescriptor)
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
ElSelectDescriptor
|
|
43
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
|
|
4
|
+
class ElSubMenuDescriptor extends VueDescriptor {
|
|
5
|
+
static type = 'ElSubMenu'
|
|
6
|
+
|
|
7
|
+
icon: string
|
|
8
|
+
label: string
|
|
9
|
+
|
|
10
|
+
constructor(descriptor: Partial<DeserializationObject<ElSubMenuDescriptor>> = {}) {
|
|
11
|
+
super(descriptor)
|
|
12
|
+
this.icon = descriptor.icon ?? ''
|
|
13
|
+
this.label = descriptor.label ?? ''
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
VueDescriptor.register(ElSubMenuDescriptor)
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
ElSubMenuDescriptor
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
import { ElFormItemDescriptor } from "./ElFormItemDescriptor";
|
|
4
|
+
|
|
5
|
+
class ElSwitchDescriptor extends ElFormItemDescriptor {
|
|
6
|
+
static type = 'ElSwitch'
|
|
7
|
+
|
|
8
|
+
columnName: string
|
|
9
|
+
columnComment: string
|
|
10
|
+
columnType: string
|
|
11
|
+
modelValue: boolean
|
|
12
|
+
labelWidth: string | number
|
|
13
|
+
required: boolean
|
|
14
|
+
|
|
15
|
+
disabled: boolean
|
|
16
|
+
loading: boolean
|
|
17
|
+
|
|
18
|
+
constructor(descriptor: Partial<DeserializationObject<ElSwitchDescriptor>> = {}) {
|
|
19
|
+
super(descriptor)
|
|
20
|
+
this.columnName = descriptor.columnName ?? ''
|
|
21
|
+
this.columnComment = descriptor.columnComment ?? ''
|
|
22
|
+
this.columnType = descriptor.columnType ?? ''
|
|
23
|
+
this.modelValue = descriptor.modelValue ?? false
|
|
24
|
+
this.labelWidth = descriptor.labelWidth ?? ''
|
|
25
|
+
this.required = false
|
|
26
|
+
|
|
27
|
+
this.disabled = descriptor.disabled ?? false
|
|
28
|
+
this.loading = descriptor.loading ?? false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
VueDescriptor.register(ElSwitchDescriptor)
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
ElSwitchDescriptor
|
|
35
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
|
|
4
|
+
class ElTableColumnDescriptor extends VueDescriptor {
|
|
5
|
+
static type = 'ElTableColumn'
|
|
6
|
+
|
|
7
|
+
columnName: string
|
|
8
|
+
columnType: string
|
|
9
|
+
columnComment: string
|
|
10
|
+
columnWidth: string
|
|
11
|
+
columnFixed: string | boolean
|
|
12
|
+
columnAlign: string
|
|
13
|
+
columnTooltip: boolean
|
|
14
|
+
|
|
15
|
+
formattingDataset: string
|
|
16
|
+
formattingLabel: string
|
|
17
|
+
formattingValue: string
|
|
18
|
+
formattingSeparator: string
|
|
19
|
+
formattingScript: string
|
|
20
|
+
|
|
21
|
+
constructor(descriptor: Partial<DeserializationObject<ElTableColumnDescriptor>> = {}) {
|
|
22
|
+
super(descriptor)
|
|
23
|
+
this.columnName = descriptor.columnName ?? ''
|
|
24
|
+
this.columnType = descriptor.columnType ?? 'default'
|
|
25
|
+
this.columnComment = descriptor.columnComment ?? ''
|
|
26
|
+
this.columnWidth = descriptor.columnWidth ?? ''
|
|
27
|
+
this.columnFixed = descriptor.columnFixed ?? false
|
|
28
|
+
this.columnAlign = descriptor.columnAlign ?? 'left'
|
|
29
|
+
this.columnTooltip = descriptor.columnTooltip ?? false
|
|
30
|
+
this.formattingDataset = descriptor.formattingDataset ?? ''
|
|
31
|
+
this.formattingLabel = descriptor.formattingLabel ?? 'label'
|
|
32
|
+
this.formattingValue = descriptor.formattingValue ?? 'value'
|
|
33
|
+
this.formattingSeparator = descriptor.formattingSeparator ?? '、'
|
|
34
|
+
this.formattingScript = descriptor.formattingScript ?? ''
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
VueDescriptor.register(ElTableColumnDescriptor)
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
ElTableColumnDescriptor
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { VueDescriptor } from "@vyr/vue";
|
|
3
|
+
|
|
4
|
+
class ElTableDescriptor extends VueDescriptor {
|
|
5
|
+
static type = 'ElTable'
|
|
6
|
+
|
|
7
|
+
data: any[]
|
|
8
|
+
border: boolean
|
|
9
|
+
stripe: boolean
|
|
10
|
+
fit: boolean
|
|
11
|
+
showHeader: boolean
|
|
12
|
+
|
|
13
|
+
constructor(descriptor: Partial<DeserializationObject<ElTableDescriptor>> = {}) {
|
|
14
|
+
super(descriptor)
|
|
15
|
+
this.data = descriptor.data ?? []
|
|
16
|
+
this.border = descriptor.border ?? false
|
|
17
|
+
this.stripe = descriptor.stripe ?? false
|
|
18
|
+
this.fit = descriptor.fit ?? true
|
|
19
|
+
this.showHeader = descriptor.showHeader ?? true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
VueDescriptor.register(ElTableDescriptor)
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
ElTableDescriptor
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './ElButtonDescriptor'
|
|
2
|
+
export * from './ElRowDescriptor'
|
|
3
|
+
export * from './ElColDescriptor'
|
|
4
|
+
export * from './ElFormDescriptor'
|
|
5
|
+
export * from './ElFormItemDescriptor'
|
|
6
|
+
export * from './ElInputDescriptor'
|
|
7
|
+
export * from './ElInputNumberDescriptor'
|
|
8
|
+
export * from './ElSelectDescriptor'
|
|
9
|
+
export * from './ElCascaderDescriptor'
|
|
10
|
+
export * from './ElCheckboxDescriptor'
|
|
11
|
+
export * from './ElDatePickerDescriptor'
|
|
12
|
+
export * from './ElRadioDescriptor'
|
|
13
|
+
export * from './ElSwitchDescriptor'
|
|
14
|
+
export * from './ElTableColumnDescriptor'
|
|
15
|
+
export * from './ElTableDescriptor'
|
|
16
|
+
export * from './ElDialogDescriptor'
|
|
17
|
+
export * from './ElPaginationDescriptor'
|
|
18
|
+
export * from './ElMenuDescriptor'
|
|
19
|
+
export * from './ElSubMenuDescriptor'
|
|
20
|
+
export * from './ElMenuItemDescriptor'
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElButtonDescriptor } from "../descriptor";
|
|
5
|
+
import { ElButtonActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElButtonInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElButtonDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElButtonDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElButtonActor(descriptor.uuid)) as ElButtonActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElButtonInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElButtonInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElCascaderDescriptor } from "../descriptor";
|
|
5
|
+
import { ElCascaderActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElCascaderInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElCascaderDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElCascaderDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElCascaderActor(descriptor.uuid)) as ElCascaderActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElCascaderInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElCascaderInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElCheckboxDescriptor } from "../descriptor";
|
|
5
|
+
import { ElCheckboxActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElCheckboxInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElCheckboxDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElCheckboxDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElCheckboxActor(descriptor.uuid)) as ElCheckboxActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElCheckboxInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElCheckboxInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElColDescriptor } from "../descriptor";
|
|
5
|
+
import { ElColActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElColInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElColDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElColDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElColActor(descriptor.uuid)) as ElColActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElColInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElColInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElDatePickerDescriptor } from "../descriptor";
|
|
5
|
+
import { ElDatePickerActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElDatePickerInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElDatePickerDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElDatePickerDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElDatePickerActor(descriptor.uuid)) as ElDatePickerActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElDatePickerInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElDatePickerInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElDialogDescriptor } from "../descriptor";
|
|
5
|
+
import { ElDialogActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElDialogInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElDialogDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElDialogDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElDialogActor(descriptor.uuid)) as ElDialogActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElDialogInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElDialogInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElFormDescriptor } from "../descriptor";
|
|
5
|
+
import { ElFormActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElFormInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElFormDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElFormDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElFormActor(descriptor.uuid)) as ElFormActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElFormInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElFormInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElInputDescriptor } from "../descriptor";
|
|
5
|
+
import { ElInputActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElInputInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElInputDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElInputDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElInputActor(descriptor.uuid)) as ElInputActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElInputInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElInputInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElInputNumberDescriptor } from "../descriptor";
|
|
5
|
+
import { ElInputNumberActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElInputNumberInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElInputNumberDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElInputNumberDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElInputNumberActor(descriptor.uuid)) as ElInputNumberActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElInputNumberInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElInputNumberInterpreter
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { reactive } from "vue";
|
|
2
|
+
import { UpdateArgs } from "@vyr/engine";
|
|
3
|
+
import { VueInterpreter } from "@vyr/vue";
|
|
4
|
+
import { ElMenuDescriptor } from "../descriptor";
|
|
5
|
+
import { ElMenuActor } from "../actor";
|
|
6
|
+
|
|
7
|
+
class ElMenuInterpreter extends VueInterpreter {
|
|
8
|
+
static type = ElMenuDescriptor.type
|
|
9
|
+
|
|
10
|
+
protected createActor(descriptor: ElMenuDescriptor, args: UpdateArgs) {
|
|
11
|
+
return reactive(new ElMenuActor(descriptor.uuid)) as ElMenuActor
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
VueInterpreter.register(ElMenuInterpreter)
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ElMenuInterpreter
|
|
18
|
+
}
|