UNPKG

@yape/plugin-browser-user-task-payload-editor

Version:

Yape Plugin to support exclusive gateways configured with the camunda modeler

1 lines 2.7 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;(t=(t=(t=(t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Yape||(t.Yape={})).Plugins||(t.Plugins={})).Browser||(t.Browser={})).UserTaskPayloadEditor=e()}}(function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var p=n[a]={exports:{}};t[a][0].call(p.exports,function(e){var n=t[a][1][e];return o(n||e)},p,p.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=window.Yape,i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Plugins.UserTask),r(t,[{key:"onActive",value:function(e,t){var n=document.createElement("div");document.body.appendChild(n);var r=CodeMirror(n,{lineNumbers:!0,mode:"javascript",json:!0,tabSize:2,value:js_beautify(JSON.stringify(t.payload),{indent_size:2})}),o=document.createElement("h3");o.innerHTML=e.name,o.style.margin=0,o.style.background="#444",o.style.color="#FFF",o.style.padding="12px",o.style.fontFamily="Arial",r.doc.cm.display.wrapper.prepend(o),r.addKeyMap({"Cmd-Enter":function(){t.payload=JSON.parse(r.getValue()),r.doc.cm.display.wrapper.remove(),document.body.removeChild(n),n.remove(),t.run()}})}}]),t}();n.default=i,"undefined"!=typeof Yape&&Yape.Plugins&&(Yape.Plugins["browser-user-task-payload-editor"]=i)},{}],2:[function(e,t,n){t.exports=e("./dist").default,t.exports.default=t.exports},{"./dist":1}]},{},[2])(2)});