@vyr/element-plus 0.0.1 → 0.0.2

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 (71) hide show
  1. package/package.json +1 -24
  2. package/src/actor/ElButtonActor.ts +2 -3
  3. package/src/actor/ElCascaderActor.ts +3 -3
  4. package/src/actor/ElCheckboxActor.ts +3 -3
  5. package/src/actor/ElColActor.ts +2 -3
  6. package/src/actor/ElDatePickerActor.ts +2 -3
  7. package/src/actor/ElDialogActor.ts +2 -3
  8. package/src/actor/ElFormActor.ts +2 -3
  9. package/src/actor/ElInputActor.ts +2 -3
  10. package/src/actor/ElInputNumberActor.ts +2 -3
  11. package/src/actor/ElMenuActor.ts +2 -3
  12. package/src/actor/ElMenuItemActor.ts +3 -3
  13. package/src/actor/ElPaginationActor.ts +2 -3
  14. package/src/actor/ElRadioActor.ts +3 -3
  15. package/src/actor/ElRowActor.ts +2 -3
  16. package/src/actor/ElSelectActor.ts +3 -3
  17. package/src/actor/ElSubMenuActor.ts +3 -3
  18. package/src/actor/ElSwitchActor.ts +2 -3
  19. package/src/actor/ElTableActor.ts +2 -3
  20. package/src/actor/ElTableColumnActor.ts +4 -4
  21. package/src/descriptor/ElFormDescriptor.ts +3 -3
  22. package/src/descriptor/ElPaginationDescriptor.ts +3 -3
  23. package/src/interpreter/ElButtonInterpreter.ts +1 -2
  24. package/src/interpreter/ElCascaderInterpreter.ts +1 -2
  25. package/src/interpreter/ElCheckboxInterpreter.ts +1 -2
  26. package/src/interpreter/ElColInterpreter.ts +1 -2
  27. package/src/interpreter/ElDatePickerInterpreter.ts +1 -2
  28. package/src/interpreter/ElDialogInterpreter.ts +1 -2
  29. package/src/interpreter/ElFormInterpreter.ts +1 -2
  30. package/src/interpreter/ElInputInterpreter.ts +1 -2
  31. package/src/interpreter/ElInputNumberInterpreter.ts +1 -2
  32. package/src/interpreter/ElMenuInterpreter.ts +1 -2
  33. package/src/interpreter/ElMenuItemInterpreter.ts +1 -2
  34. package/src/interpreter/ElPaginationInterpreter.ts +1 -2
  35. package/src/interpreter/ElRadioInterpreter.ts +1 -2
  36. package/src/interpreter/ElRowInterpreter.ts +1 -2
  37. package/src/interpreter/ElSelectInterpreter.ts +1 -2
  38. package/src/interpreter/ElSubMenuInterpreter.ts +1 -2
  39. package/src/interpreter/ElSwitchInterpreter.ts +1 -2
  40. package/src/interpreter/ElTableColumnInterpreter.ts +1 -2
  41. package/src/interpreter/ElTableInterpreter.ts +1 -2
  42. package/src/preset/execute/ElDialog/close.ts +6 -7
  43. package/src/preset/execute/ElDialog/open.ts +7 -8
  44. package/src/preset/execute/ElForm/branch.ts +6 -7
  45. package/src/preset/execute/ElForm/create.ts +3 -3
  46. package/src/preset/execute/ElForm/edit.ts +3 -3
  47. package/src/preset/execute/ElForm/getData.ts +6 -7
  48. package/src/preset/execute/ElForm/reset.ts +6 -7
  49. package/src/preset/execute/ElPagination/getData.ts +6 -7
  50. package/src/preset/execute/ElPagination/reset.ts +6 -7
  51. package/src/preset/execute/ElTable/create.ts +6 -7
  52. package/src/preset/execute/ElTable/delete.ts +7 -7
  53. package/src/preset/execute/ElTable/edit.ts +7 -7
  54. package/src/preset/execute/ElTableColumn/formatter.ts +7 -7
  55. package/src/preset/index.ts +2 -2
  56. package/src/preset/interaction/ElDialog/close.ts +26 -0
  57. package/src/preset/interaction/ElTable/create.ts +31 -0
  58. package/src/preset/interaction/ElTable/delete.ts +31 -0
  59. package/src/preset/interaction/ElTable/edit.ts +33 -0
  60. package/src/preset/interaction/ElTable/list.ts +32 -0
  61. package/src/preset/interaction/ElTable/reset.ts +31 -0
  62. package/src/preset/{routine → interaction}/ElTable/submit.ts +14 -14
  63. package/src/preset/routine/ElDialog/close.ts +0 -26
  64. package/src/preset/routine/ElTable/create.ts +0 -31
  65. package/src/preset/routine/ElTable/delete.ts +0 -31
  66. package/src/preset/routine/ElTable/edit.ts +0 -33
  67. package/src/preset/routine/ElTable/list.ts +0 -32
  68. package/src/preset/routine/ElTable/reset.ts +0 -31
  69. /package/src/preset/{routine → interaction}/ElDialog/index.ts +0 -0
  70. /package/src/preset/{routine → interaction}/ElTable/index.ts +0 -0
  71. /package/src/preset/{routine → interaction}/index.ts +0 -0
@@ -1,5 +1,4 @@
1
1
  import { reactive } from "vue";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { VueInterpreter } from "@vyr/vue";
4
3
  import { ElSelectDescriptor } from "../descriptor";
5
4
  import { ElSelectActor } from "../actor";
@@ -7,7 +6,7 @@ import { ElSelectActor } from "../actor";
7
6
  class ElSelectInterpreter extends VueInterpreter {
8
7
  static type = ElSelectDescriptor.type
9
8
 
10
- protected createActor(descriptor: ElSelectDescriptor, args: UpdateArgs) {
9
+ protected createActor(descriptor: ElSelectDescriptor) {
11
10
  return reactive(new ElSelectActor(descriptor.uuid)) as ElSelectActor
12
11
  }
13
12
  }
@@ -1,5 +1,4 @@
1
1
  import { reactive } from "vue";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { VueInterpreter } from "@vyr/vue";
4
3
  import { ElSubMenuDescriptor } from "../descriptor";
5
4
  import { ElSubMenuActor } from "../actor";
@@ -7,7 +6,7 @@ import { ElSubMenuActor } from "../actor";
7
6
  class ElSubMenuInterpreter extends VueInterpreter {
8
7
  static type = ElSubMenuDescriptor.type
9
8
 
10
- protected createActor(descriptor: ElSubMenuDescriptor, args: UpdateArgs) {
9
+ protected createActor(descriptor: ElSubMenuDescriptor) {
11
10
  return reactive(new ElSubMenuActor(descriptor.uuid)) as ElSubMenuActor
12
11
  }
13
12
  }
@@ -1,5 +1,4 @@
1
1
  import { reactive } from "vue";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { VueInterpreter } from "@vyr/vue";
4
3
  import { ElSwitchDescriptor } from "../descriptor";
5
4
  import { ElSwitchActor } from "../actor";
@@ -7,7 +6,7 @@ import { ElSwitchActor } from "../actor";
7
6
  class ElSwitchInterpreter extends VueInterpreter {
8
7
  static type = ElSwitchDescriptor.type
9
8
 
10
- protected createActor(descriptor: ElSwitchDescriptor, args: UpdateArgs) {
9
+ protected createActor(descriptor: ElSwitchDescriptor) {
11
10
  return reactive(new ElSwitchActor(descriptor.uuid)) as ElSwitchActor
12
11
  }
13
12
  }
@@ -1,5 +1,4 @@
1
1
  import { reactive } from "vue";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { VueInterpreter } from "@vyr/vue";
4
3
  import { ElTableColumnDescriptor } from "../descriptor";
5
4
  import { ElTableColumnActor } from "../actor";
@@ -7,7 +6,7 @@ import { ElTableColumnActor } from "../actor";
7
6
  class ElTableColumnInterpreter extends VueInterpreter {
8
7
  static type = ElTableColumnDescriptor.type
9
8
 
10
- protected createActor(descriptor: ElTableColumnDescriptor, args: UpdateArgs) {
9
+ protected createActor(descriptor: ElTableColumnDescriptor) {
11
10
  return reactive(new ElTableColumnActor(descriptor.uuid)) as ElTableColumnActor
12
11
  }
13
12
  }
@@ -1,5 +1,4 @@
1
1
  import { reactive } from "vue";
2
- import { UpdateArgs } from "@vyr/engine";
3
2
  import { VueInterpreter } from "@vyr/vue";
4
3
  import { ElTableDescriptor } from "../descriptor";
5
4
  import { ElTableActor } from "../actor";
@@ -7,7 +6,7 @@ import { ElTableActor } from "../actor";
7
6
  class ElTableInterpreter extends VueInterpreter {
8
7
  static type = ElTableDescriptor.type
9
8
 
10
- protected createActor(descriptor: ElTableDescriptor, args: UpdateArgs) {
9
+ protected createActor(descriptor: ElTableDescriptor) {
11
10
  return reactive(new ElTableActor(descriptor.uuid)) as ElTableActor
12
11
  }
13
12
  }
@@ -1,11 +1,10 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Graphics, InteractionNode, Scriptable, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
  import { ElDialogDescriptor } from "../../../descriptor"
4
4
 
5
5
  const scriptable = Asset.createVirtualUrl('preset/ElDialog/close.ts')
6
- class RoutineScriptable extends Scriptable {
7
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
8
- //@ts-ignore
6
+ class InteractionScriptable extends Scriptable {
7
+ async execute(graphics: Graphics, args: ScriptableArgs) {
9
8
  const { input } = args
10
9
  const dialog = input?.user?.dialog.value ?? input.default.dialog.value
11
10
 
@@ -17,7 +16,7 @@ class RoutineScriptable extends Scriptable {
17
16
  dialogDescriptor.setNeedsUpdate()
18
17
  }
19
18
  }
20
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
19
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
21
20
 
22
21
  const createExecuteInput = (args: any = {}) => {
23
22
  const input = {
@@ -28,11 +27,11 @@ const createExecuteInput = (args: any = {}) => {
28
27
  }
29
28
 
30
29
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
31
- const executeNode: RoutineNode = {
30
+ const executeNode: InteractionNode = {
32
31
  id: options.id,
33
32
  label: language.get(scriptable as any),
34
33
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
35
- routine: 'Execute',
34
+ interaction: 'Execute',
36
35
  url: scriptable,
37
36
  input: createExecuteInput(options.input)
38
37
  }
@@ -1,11 +1,10 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Graphics, InteractionNode, Scriptable, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
  import { ElDialogDescriptor } from "../../../descriptor"
4
4
 
5
5
  const scriptable = Asset.createVirtualUrl('preset/ElDialog/open.ts')
6
- class RoutineScriptable extends Scriptable {
7
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
8
- //@ts-ignore
6
+ class InteractionScriptable extends Scriptable {
7
+ async execute(graphics: Graphics, args: ScriptableArgs) {
9
8
  const { input } = args
10
9
  const dialog = input?.user?.dialog.value ?? input.default.dialog.value
11
10
  const title = input?.user?.title.value ?? input.default.title.value
@@ -19,23 +18,23 @@ class RoutineScriptable extends Scriptable {
19
18
  dialogDescriptor.setNeedsUpdate()
20
19
  }
21
20
  }
22
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
21
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
23
22
 
24
23
  const createExecuteInput = (args: any = {}) => {
25
24
  const input = {
26
25
  dialog: { value: args.dialog ?? '' },
27
- title: { value: args.title ?? '系统弹窗' }
26
+ title: { value: args.title ?? '' }
28
27
  }
29
28
 
30
29
  return input
31
30
  }
32
31
 
33
32
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
34
- const executeNode: RoutineNode = {
33
+ const executeNode: InteractionNode = {
35
34
  id: options.id,
36
35
  label: language.get(scriptable as any),
37
36
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
38
- routine: 'Execute',
37
+ interaction: 'Execute',
39
38
  url: scriptable,
40
39
  input: createExecuteInput(options.input)
41
40
  }
@@ -1,10 +1,9 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Graphics, InteractionNode, Scriptable, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
 
4
4
  const scriptable = Asset.createVirtualUrl('preset/ElForm/branch.ts')
5
- class RoutineScriptable extends Scriptable {
6
- execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
7
- //@ts-ignore
5
+ class InteractionScriptable extends Scriptable {
6
+ execute(graphics: Graphics, args: ScriptableArgs) {
8
7
  const { input, result } = args
9
8
  const primaryKey = input?.user?.primaryKey.value ?? input.default.primaryKey.value
10
9
 
@@ -17,7 +16,7 @@ class RoutineScriptable extends Scriptable {
17
16
  return ['number', 'string'].includes(typeof value) && value.length > 0 ? '1' : '0'
18
17
  }
19
18
  }
20
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
19
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
21
20
 
22
21
  const createExecuteInput = (args: any = {}) => {
23
22
  const input = {
@@ -28,11 +27,11 @@ const createExecuteInput = (args: any = {}) => {
28
27
  }
29
28
 
30
29
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
31
- const executeNode: RoutineNode = {
30
+ const executeNode: InteractionNode = {
32
31
  id: options.id,
33
32
  label: language.get(scriptable as any),
34
33
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
35
- routine: 'Branch',
34
+ interaction: 'Branch',
36
35
  url: scriptable,
37
36
  input: createExecuteInput(options.input)
38
37
  }
@@ -1,4 +1,4 @@
1
- import { Asset, RoutineNode } from "@vyr/engine"
1
+ import { Asset, InteractionNode } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
 
4
4
  const scriptable = Asset.createVirtualUrl('preset/ElForm/branch/create.ts')
@@ -12,11 +12,11 @@ const createExecuteInput = (args: any = {}) => {
12
12
  }
13
13
 
14
14
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
15
- const executeNode: RoutineNode = {
15
+ const executeNode: InteractionNode = {
16
16
  id: options.id,
17
17
  label: language.get(scriptable as any),
18
18
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
19
- routine: 'Condition',
19
+ interaction: 'Condition',
20
20
  url: '',
21
21
  input: createExecuteInput(options.input)
22
22
  }
@@ -1,4 +1,4 @@
1
- import { Asset, RoutineNode } from "@vyr/engine"
1
+ import { Asset, InteractionNode } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
 
4
4
  const scriptable = Asset.createVirtualUrl('preset/ElForm/branch/edit.ts')
@@ -12,11 +12,11 @@ const createExecuteInput = (args: any = {}) => {
12
12
  }
13
13
 
14
14
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
15
- const executeNode: RoutineNode = {
15
+ const executeNode: InteractionNode = {
16
16
  id: options.id,
17
17
  label: language.get(scriptable as any),
18
18
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
19
- routine: 'Condition',
19
+ interaction: 'Condition',
20
20
  url: '',
21
21
  input: createExecuteInput(options.input)
22
22
  }
@@ -1,11 +1,10 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Descriptor, Graphics, InteractionNode, Scriptable, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
  import { ElFormDescriptor } from "../../../descriptor"
4
4
 
5
5
  const scriptable = Asset.createVirtualUrl('preset/ElForm/getData.ts')
6
- class RoutineScriptable extends Scriptable {
7
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
8
- //@ts-ignore
6
+ class InteractionScriptable extends Scriptable {
7
+ async execute(graphics: Graphics, args: ScriptableArgs) {
9
8
  const { input } = args
10
9
  const form = input?.user?.form.value ?? input.default.form.value
11
10
  const validate = input?.user?.validate.value ?? input.default.validate.value
@@ -19,7 +18,7 @@ class RoutineScriptable extends Scriptable {
19
18
  }
20
19
  }
21
20
  }
22
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
21
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
23
22
 
24
23
  const createExecuteInput = (args: any = {}) => {
25
24
  const input = {
@@ -31,11 +30,11 @@ const createExecuteInput = (args: any = {}) => {
31
30
  }
32
31
 
33
32
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
34
- const executeNode: RoutineNode = {
33
+ const executeNode: InteractionNode = {
35
34
  id: options.id,
36
35
  label: language.get(scriptable as any),
37
36
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
38
- routine: 'Execute',
37
+ interaction: 'Execute',
39
38
  url: scriptable,
40
39
  input: createExecuteInput(options.input)
41
40
  }
@@ -1,11 +1,10 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs, AsyncTask } from "@vyr/engine"
1
+ import { Asset, Descriptor, Graphics, InteractionNode, Scriptable, AsyncTask, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
  import { ElFormDescriptor, ElFormItemDescriptor } from "../../../descriptor"
4
4
 
5
5
  const scriptable = Asset.createVirtualUrl('preset/ElForm/reset.ts')
6
- class RoutineScriptable extends Scriptable {
7
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
8
- //@ts-ignore
6
+ class InteractionScriptable extends Scriptable {
7
+ async execute(graphics: Graphics, args: ScriptableArgs) {
9
8
  const { input } = args
10
9
  const form = input?.user?.form.value ?? input.default.form.value
11
10
 
@@ -24,7 +23,7 @@ class RoutineScriptable extends Scriptable {
24
23
  await task.done()
25
24
  }
26
25
  }
27
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
26
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
28
27
 
29
28
  const createExecuteInput = (args: any = {}) => {
30
29
  const input = {
@@ -35,11 +34,11 @@ const createExecuteInput = (args: any = {}) => {
35
34
  }
36
35
 
37
36
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
38
- const executeNode: RoutineNode = {
37
+ const executeNode: InteractionNode = {
39
38
  id: options.id,
40
39
  label: language.get(scriptable as any),
41
40
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
42
- routine: 'Execute',
41
+ interaction: 'Execute',
43
42
  url: scriptable,
44
43
  input: createExecuteInput(options.input)
45
44
  }
@@ -1,11 +1,10 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Descriptor, Graphics, InteractionNode, Scriptable, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
  import { ElPaginationDescriptor } from "../../../descriptor"
4
4
 
5
5
  const scriptable = Asset.createVirtualUrl('preset/ElPagination/getData.ts')
6
- class RoutineScriptable extends Scriptable {
7
- execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
8
- //@ts-ignore
6
+ class InteractionScriptable extends Scriptable {
7
+ execute(graphics: Graphics, args: ScriptableArgs) {
9
8
  const { input } = args
10
9
  const pagination = input?.user?.pagination.value ?? input.default.pagination.value
11
10
 
@@ -17,7 +16,7 @@ class RoutineScriptable extends Scriptable {
17
16
  }
18
17
  }
19
18
  }
20
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
19
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
21
20
 
22
21
  const createExecuteInput = (args: any = {}) => {
23
22
  const input = {
@@ -28,11 +27,11 @@ const createExecuteInput = (args: any = {}) => {
28
27
  }
29
28
 
30
29
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
31
- const executeNode: RoutineNode = {
30
+ const executeNode: InteractionNode = {
32
31
  id: options.id,
33
32
  label: language.get(scriptable as any),
34
33
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
35
- routine: 'Execute',
34
+ interaction: 'Execute',
36
35
  url: scriptable,
37
36
  input: createExecuteInput(options.input)
38
37
  }
@@ -1,11 +1,10 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Descriptor, Graphics, InteractionNode, Scriptable, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
  import { ElPaginationDescriptor } from "../../../descriptor"
4
4
 
5
5
  const scriptable = Asset.createVirtualUrl('preset/ElPagination/reset.ts')
6
- class RoutineScriptable extends Scriptable {
7
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
8
- //@ts-ignore
6
+ class InteractionScriptable extends Scriptable {
7
+ async execute(graphics: Graphics, args: ScriptableArgs) {
9
8
  const { input } = args
10
9
  const pagination = input?.user?.pagination.value ?? input.default.pagination.value
11
10
 
@@ -15,7 +14,7 @@ class RoutineScriptable extends Scriptable {
15
14
  }
16
15
  }
17
16
  }
18
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
17
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
19
18
 
20
19
  const createExecuteInput = (args: any = {}) => {
21
20
  const input = {
@@ -26,11 +25,11 @@ const createExecuteInput = (args: any = {}) => {
26
25
  }
27
26
 
28
27
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
29
- const executeNode: RoutineNode = {
28
+ const executeNode: InteractionNode = {
30
29
  id: options.id,
31
30
  label: language.get(scriptable as any),
32
31
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
33
- routine: 'Execute',
32
+ interaction: 'Execute',
34
33
  url: scriptable,
35
34
  input: createExecuteInput(options.input)
36
35
  }
@@ -1,15 +1,14 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Graphics, InteractionNode, Scriptable, ScriptableArgs } from "@vyr/engine"
2
2
  import { language } from '../../../locale'
3
3
 
4
4
  const scriptable = Asset.createVirtualUrl('preset/ElTable/create.ts')
5
- class RoutineScriptable extends Scriptable {
6
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
7
- //@ts-ignore
5
+ class InteractionScriptable extends Scriptable {
6
+ async execute(graphics: Graphics, args: ScriptableArgs) {
8
7
 
9
8
  return {}
10
9
  }
11
10
  }
12
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
11
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
13
12
 
14
13
  const createExecuteInput = (args: any = {}) => {
15
14
  const input = {
@@ -19,11 +18,11 @@ const createExecuteInput = (args: any = {}) => {
19
18
  }
20
19
 
21
20
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
22
- const executeNode: RoutineNode = {
21
+ const executeNode: InteractionNode = {
23
22
  id: options.id,
24
23
  label: language.get(scriptable as any),
25
24
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
26
- routine: 'Execute',
25
+ interaction: 'Execute',
27
26
  url: scriptable,
28
27
  input: createExecuteInput(options.input)
29
28
  }
@@ -1,12 +1,12 @@
1
1
  import { ElMessageBox } from "element-plus"
2
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
2
+ import { Asset, Graphics, InteractionNode, Scriptable } from "@vyr/engine"
3
+ import { VueScriptableArgs } from "@vyr/vue"
3
4
  import { ElTableColumnDescriptor } from "../../../descriptor"
4
5
  import { language } from '../../../locale'
5
6
 
6
7
  const scriptable = Asset.createVirtualUrl('preset/ElTable/delete.ts')
7
- class RoutineScriptable extends Scriptable {
8
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
9
- //@ts-ignore
8
+ class InteractionScriptable extends Scriptable {
9
+ async execute(graphics: Graphics, args: VueScriptableArgs) {
10
10
  const { VYR_STORE, trigger } = args
11
11
 
12
12
  return new Promise((resolve, reject) => {
@@ -23,7 +23,7 @@ class RoutineScriptable extends Scriptable {
23
23
  })
24
24
  }
25
25
  }
26
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
26
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
27
27
 
28
28
  const createExecuteInput = (args: any = {}) => {
29
29
  const input = {
@@ -33,11 +33,11 @@ const createExecuteInput = (args: any = {}) => {
33
33
  }
34
34
 
35
35
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
36
- const executeNode: RoutineNode = {
36
+ const executeNode: InteractionNode = {
37
37
  id: options.id,
38
38
  label: language.get(scriptable as any),
39
39
  position: { x: 20, y: 20 },
40
- routine: 'Execute',
40
+ interaction: 'Execute',
41
41
  url: scriptable,
42
42
  input: createExecuteInput(options.input)
43
43
  }
@@ -1,15 +1,15 @@
1
- import { Asset, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Graphics, InteractionNode, Scriptable } from "@vyr/engine"
2
+ import { VueScriptableArgs } from "@vyr/vue"
2
3
  import { language } from '../../../locale'
3
4
 
4
5
  const scriptable = Asset.createVirtualUrl('preset/ElTable/edit.ts')
5
- class RoutineScriptable extends Scriptable {
6
- async execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
7
- //@ts-ignore
6
+ class InteractionScriptable extends Scriptable {
7
+ async execute(graphics: Graphics, args: VueScriptableArgs) {
8
8
  const { VYR_STORE } = args
9
9
  return VYR_STORE.slot.row
10
10
  }
11
11
  }
12
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
12
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
13
13
 
14
14
  const createExecuteInput = (args: any = {}) => {
15
15
  const input = {
@@ -19,11 +19,11 @@ const createExecuteInput = (args: any = {}) => {
19
19
  }
20
20
 
21
21
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
22
- const executeNode: RoutineNode = {
22
+ const executeNode: InteractionNode = {
23
23
  id: options.id,
24
24
  label: language.get(scriptable as any),
25
25
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
26
- routine: 'Execute',
26
+ interaction: 'Execute',
27
27
  url: scriptable,
28
28
  input: createExecuteInput(options.input)
29
29
  }
@@ -1,9 +1,10 @@
1
- import { Asset, Category, DatasetDescriptor, Descriptor, Graphics, RoutineNode, Scriptable, UpdateArgs } from "@vyr/engine"
1
+ import { Asset, Category, DatasetDescriptor, Graphics, InteractionNode, Scriptable } from "@vyr/engine"
2
+ import { VueScriptableArgs } from "@vyr/vue"
2
3
  import { language } from '../../../locale'
3
4
  import { ElTableColumnDescriptor } from "../../../descriptor"
4
5
 
5
6
  const scriptable = Asset.createVirtualUrl('preset/ElTableColumn/formatter.ts')
6
- class RoutineScriptable extends Scriptable {
7
+ class InteractionScriptable extends Scriptable {
7
8
  traverseData = (options: any[], col: ElTableColumnDescriptor, cache: Map<string, any>) => {
8
9
  for (const option of options) {
9
10
  cache.set(option[col.formattingValue], option[col.formattingLabel])
@@ -27,8 +28,7 @@ class RoutineScriptable extends Scriptable {
27
28
  return labels.join(col.formattingSeparator)
28
29
  }
29
30
 
30
- execute(descriptor: Descriptor, graphics: Graphics, args: UpdateArgs) {
31
- //@ts-ignore
31
+ execute(graphics: Graphics, args: VueScriptableArgs<ElTableColumnDescriptor>) {
32
32
  const { trigger, input, result } = args
33
33
  const dataset = input?.user?.dataset.value
34
34
 
@@ -44,7 +44,7 @@ class RoutineScriptable extends Scriptable {
44
44
  }
45
45
  }
46
46
  }
47
- Asset.provider(scriptable, async () => ({ default: RoutineScriptable }))
47
+ Asset.provider(scriptable, async () => ({ default: InteractionScriptable }))
48
48
 
49
49
  const createExecuteInput = (args: any = {}) => {
50
50
  const input = {
@@ -55,11 +55,11 @@ const createExecuteInput = (args: any = {}) => {
55
55
  }
56
56
 
57
57
  const createExecuteNode = (options: { id: string; position?: any; input?: any }) => {
58
- const executeNode: RoutineNode = {
58
+ const executeNode: InteractionNode = {
59
59
  id: options.id,
60
60
  label: language.get(scriptable as any),
61
61
  position: { x: options?.position?.x ?? 20, y: options?.position?.y ?? 20 },
62
- routine: 'Execute',
62
+ interaction: 'Execute',
63
63
  url: scriptable,
64
64
  input: createExecuteInput(options.input)
65
65
  }
@@ -1,7 +1,7 @@
1
1
  import * as executePreset from './execute'
2
- import * as routinePreset from './routine'
2
+ import * as interactionPreset from './interaction'
3
3
 
4
4
  export {
5
5
  executePreset,
6
- routinePreset
6
+ interactionPreset
7
7
  }
@@ -0,0 +1,26 @@
1
+ import { Asset, InteractionDescriptor } from "@vyr/engine"
2
+ import { ElDialog } from '../../execute'
3
+
4
+ const url = Asset.createVirtualUrl('preset/ElDialog/close.interaction.json')
5
+ const nodes = {
6
+ dialog: 'dialog',
7
+ }
8
+ let _currentInteraction: InteractionDescriptor | null = null
9
+ const interactionProvider = async () => {
10
+ if (_currentInteraction === null) {
11
+ _currentInteraction = new InteractionDescriptor()
12
+ const dialogNode = ElDialog.close.createExecuteNode({ id: nodes.dialog })
13
+ _currentInteraction.addNode([dialogNode])
14
+ _currentInteraction.roots.push(dialogNode.id)
15
+ }
16
+ return _currentInteraction
17
+ }
18
+
19
+ Asset.provider(url, interactionProvider)
20
+
21
+ export {
22
+ url,
23
+ nodes,
24
+ }
25
+
26
+
@@ -0,0 +1,31 @@
1
+ import { Asset, InteractionDescriptor, executePreset } from "@vyr/engine"
2
+ import { ElDialog, ElTable } from '../../execute'
3
+
4
+ const url = Asset.createVirtualUrl('preset/ElTable/create.interaction.json')
5
+ const nodes = {
6
+ create: 'create',
7
+ dataset: 'dataset',
8
+ dialog: 'dialog',
9
+ }
10
+ let _currentInteraction: InteractionDescriptor | null = null
11
+ const interactionProvider = async () => {
12
+ if (_currentInteraction === null) {
13
+ _currentInteraction = new InteractionDescriptor()
14
+ const createNode = ElTable.create.createExecuteNode({ id: nodes.create })
15
+ const datasetNode = executePreset.dataset.update.createExecuteNode({ id: nodes.dataset, position: { x: 250, y: 20 } })
16
+ const dialogNode = ElDialog.open.createExecuteNode({ id: nodes.dialog, position: { x: 500, y: 20 } })
17
+
18
+ _currentInteraction.addNode([createNode, datasetNode, dialogNode])
19
+ _currentInteraction.roots.push(createNode.id)
20
+ }
21
+ return _currentInteraction
22
+ }
23
+
24
+ Asset.provider(url, interactionProvider)
25
+
26
+ export {
27
+ url,
28
+ nodes,
29
+ }
30
+
31
+
@@ -0,0 +1,31 @@
1
+ import { Asset, InteractionDescriptor, executePreset } from "@vyr/engine"
2
+ import { ElTable } from '../../execute'
3
+
4
+ const url = Asset.createVirtualUrl('preset/ElTable/delete.interaction.json')
5
+ const nodes = {
6
+ delete: 'delete',
7
+ request: 'request',
8
+ refresh: 'refresh',
9
+ }
10
+ let _currentInteraction: InteractionDescriptor | null = null
11
+ const interactionProvider = async () => {
12
+ if (_currentInteraction === null) {
13
+ _currentInteraction = new InteractionDescriptor()
14
+ const deleteNode = ElTable.delete.createExecuteNode({ id: nodes.delete })
15
+ const requestNode = executePreset.net.http.createExecuteNode({ id: nodes.request, position: { x: 250, y: 20 } })
16
+ const refreshNode = executePreset.graphics.invoke.createExecuteNode({ id: nodes.refresh, position: { x: 500, y: 20 } })
17
+
18
+ _currentInteraction.addNode([deleteNode, requestNode, refreshNode])
19
+ _currentInteraction.roots.push(deleteNode.id)
20
+ }
21
+ return _currentInteraction
22
+ }
23
+
24
+ Asset.provider(url, interactionProvider)
25
+
26
+ export {
27
+ url,
28
+ nodes,
29
+ }
30
+
31
+