Skip to content

Commit

Permalink
Added Action and ActionButton
Browse files Browse the repository at this point in the history
  • Loading branch information
dropmann committed Jul 24, 2023
1 parent 5551aca commit d132cec
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions schemas/analysisschema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ properties:
- Outputs
- Pair
- Group
- Action
required:
- name
- type
Expand Down
16 changes: 16 additions & 0 deletions schemas/optionschemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ Bool:
type: boolean
description: *Description

Action:
"$schema": http://json-schema.org/draft-04/schema#
additionalProperties: false
properties:
name:
type: string
type:
type: string
title:
type: string
hidden:
type: boolean
default:
type: boolean
description: *Description

Integer:
"$schema": http://json-schema.org/draft-04/schema#
additionalProperties: false
Expand Down
5 changes: 5 additions & 0 deletions schemas/uictrlschemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ControlBase:
- CustomControl
- ModeSelector
- Content
- ActionButton
name:
type: string
stage:
Expand Down Expand Up @@ -538,6 +539,10 @@ ControlInheritance:
- ControlBase
- GridControl
- OptionControl
ActionButton:
- ControlBase
- GridControl
- OptionControl
CheckBox:
- ControlBase
- GridControl
Expand Down
30 changes: 30 additions & 0 deletions uicompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,21 @@ const constructors = {
}
},

Action: {
create: function (item, isTemplate) {
let ctrl = {};
ctrl.type = 'ActionButton';
CheckTemplateState(item, ctrl, isTemplate);
return ctrl
},
toRaw: function (obj, key) {
if (key === undefined || key.length === 0)
return "boolean";

return null;
}
},

Output: {
create: function(item, isTemplate) {
let ctrl = { };
Expand Down Expand Up @@ -1334,6 +1349,21 @@ const uiOptionControl = {
}
},

ActionButton: {
usesSingleCell: function (ctrl) {
return true;
},
isContainerControl: function (ctrl) {
return false;
},
isOptionControl: function (ctrl) {
return ctrl.isVirtual !== true;
},
toRaw: function (ctrl) {
return "boolean";
}
},

Output: {
usesSingleCell: function(ctrl) {
return true;
Expand Down

0 comments on commit d132cec

Please sign in to comment.