diff --git a/src/actions.ts b/src/actions.ts index d55238d..be790a4 100644 --- a/src/actions.ts +++ b/src/actions.ts @@ -26,6 +26,7 @@ import SetName from "~/actions/set-name"; import Output from "~/actions/output"; import CopyToClipboard from "~/actions/copy-to-clipboard"; import RunShortcut from "~/actions/run-shortcut"; +import CalculateExpression from "~/actions/calculate-expression"; interface ActionDefinitions { [key: string]: ActionDefinition @@ -73,6 +74,7 @@ export let actions: ActionDefinitions = { 'output': Output, 'setclipboard': CopyToClipboard, 'runworkflow': RunShortcut, + 'calculateexpression': CalculateExpression, }; export function actionText(value: string): HTMLElement { diff --git a/src/actions/calculate-expression.ts b/src/actions/calculate-expression.ts new file mode 100644 index 0000000..2c77a2a --- /dev/null +++ b/src/actions/calculate-expression.ts @@ -0,0 +1,20 @@ +import {renderValue} from "~/value"; +import {renderActionHeader} from "~/render"; +import {actions} from "~/actions"; + +interface CalculateExpressionParameters { + Input: string | object +} + +export default { + title: "Calculate expression", + icon: 'f_cursive_circle', + background: '#8e8e93', + render: (container: HTMLElement, params: CalculateExpressionParameters) => { + container.className += ' sp-date-action'; + + return renderActionHeader(actions['calculateexpression'], + renderValue(params['Input'], '7 + 7'), + ); + } +} \ No newline at end of file