@enablerr-ui/workflow
Version:
enablerr - the Next Enterprise Solution
2 lines (1 loc) • 15.5 kB
JavaScript
System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth"],function(t){"use strict";var e,n;return{setters:[function(t){e=t.Request},function(t){n=t.getAttractions},function(){}],execute:function(){t("version","0.2.47");function o(){}function r(t){return t()}function i(){return Object.create(null)}function s(t){t.forEach(r)}function l(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function a(t,e){t.appendChild(e)}function u(t,e,n){t.insertBefore(e,n||null)}function f(t){t.parentNode.removeChild(t)}function d(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function p(t){return document.createElement(t)}function m(t){return document.createTextNode(t)}function g(){return m(" ")}function h(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function $(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}let b;function y(t){b=t}function v(){if(!b)throw new Error("Function called outside component initialization");return b}const w=[],k=[],x=[],j=[],E=Promise.resolve();let _=!1;function O(t){x.push(t)}let P=!1;const I=new Set;function S(){if(!P){P=!0;do{for(let t=0;t<w.length;t+=1){const e=w[t];y(e),C(e.$$)}for(y(null),w.length=0;k.length;)k.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];I.has(e)||(I.add(e),e())}x.length=0}while(w.length);for(;j.length;)j.pop()();_=!1,P=!1,I.clear()}}function C(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(O)}}const N=new Set;let q;function B(){q={r:0,c:[],p:q}}function A(){q.r||s(q.c),q=q.p}function D(t,e){t&&t.i&&(N.delete(t),t.i(e))}function G(t,e,n,o){if(t&&t.o){if(N.has(t))return;N.add(t),q&&q.c.push(()=>{N.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}function T(t,e){const n=e.token={};function o(t,o,r,i){if(e.token!==n)return;e.resolved=i;let s=e.ctx;void 0!==r&&(s=s.slice(),s[r]=i);const l=t&&(e.current=t)(s);let c=!1;e.block&&(e.blocks?e.blocks.forEach((t,n)=>{n!==o&&t&&(B(),G(t,1,1,()=>{e.blocks[n]===t&&(e.blocks[n]=null)}),A())}):e.block.d(1),l.c(),D(l,1),l.m(e.mount(),e.anchor),c=!0),e.block=l,e.blocks&&(e.blocks[o]=l),c&&S()}if((r=t)&&"object"==typeof r&&"function"==typeof r.then){const n=v();if(t.then(t=>{y(n),o(e.then,1,e.value,t),y(null)},t=>{if(y(n),o(e.catch,2,e.error,t),y(null),!e.hasCatch)throw t}),e.current!==e.pending)return o(e.pending,0),!0}else{if(e.current!==e.then)return o(e.then,1,e.value,t),!0;e.resolved=t}var r}const M="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function L(t){t&&t.c()}function F(t,e,n,o){const{fragment:i,on_mount:c,on_destroy:a,after_update:u}=t.$$;i&&i.m(e,n),o||O(()=>{const e=c.map(r).filter(l);a?a.push(...e):s(e),t.$$.on_mount=[]}),u.forEach(O)}function z(t,e){const n=t.$$;null!==n.fragment&&(s(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function R(t,e){-1===t.$$.dirty[0]&&(w.push(t),_||(_=!0,E.then(S)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function W(t,e,n,r,l,c,a=[-1]){const u=b;y(t);const d=t.$$={fragment:null,ctx:null,props:c,update:o,not_equal:l,bound:i(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:e.context||[]),callbacks:i(),dirty:a,skip_bound:!1};let p=!1;if(d.ctx=n?n(t,e.props||{},(e,n,...o)=>{const r=o.length?o[0]:n;return d.ctx&&l(d.ctx[e],d.ctx[e]=r)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](r),p&&R(t,e)),n}):[],d.update(),p=!0,s(d.before_update),d.fragment=!!r&&r(d.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);d.fragment&&d.fragment.l(t),t.forEach(f)}else d.fragment&&d.fragment.c();e.intro&&D(t.$$.fragment),F(t,e.target,e.anchor,e.customElement),S()}y(u)}class H{$destroy(){z(this,1),this.$destroy=o}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const{document:J}=M;function K(t){let e,n,o,r,i,s,l,c;return n=new t[3]({props:{id:"loading"}}),{c(){e=p("div"),L(n.$$.fragment),o=g(),r=p("iframe"),h(e,"id","loading"),h(e,"class","svelte-5o4mjj"),r.src!==(i=t[0])&&h(r,"src",i),h(r,"title",t[1]),h(r,"height",Q),h(r,"class","svelte-5o4mjj")},m(i,a){var f,d,p,m;u(i,e,a),F(n,e,null),u(i,o,a),u(i,r,a),t[5](r),s=!0,l||(f=window,d="message",p=t[4],f.addEventListener(d,p,m),c=()=>f.removeEventListener(d,p,m),l=!0)},p(t,[e]){(!s||1&e&&r.src!==(i=t[0]))&&h(r,"src",i),(!s||2&e)&&h(r,"title",t[1])},i(t){s||(D(n.$$.fragment,t),s=!0)},o(t){G(n.$$.fragment,t),s=!1},d(i){i&&f(e),z(n),i&&f(o),i&&f(r),t[5](null),l=!1,c()}}}let Q="90%";function U(t,e,o){const{Loading:r}=n;let i,{src:s=""}=e,{title:l=""}=e;return t.$$set=t=>{"src"in t&&o(0,s=t.src),"title"in t&&o(1,l=t.title)},[s,l,i,r,t=>{if("completed"===t.data){const t=document.getElementById("loading");t&&(t.style.display="none")}},function(t){k[t?"unshift":"push"](()=>{i=t,o(2,i)})}]}class V extends H{constructor(t){var e;super(),J.getElementById("svelte-5o4mjj-style")||((e=p("style")).id="svelte-5o4mjj-style",e.textContent="iframe.svelte-5o4mjj{border:0;width:99%}#loading.svelte-5o4mjj{margin-top:3em}",a(J.head,e)),W(this,t,U,K,c,{src:0,title:1})}}function X(t){t[11]=t[13].followers,t[12]=t[13].reports}function Y(t,e,n){const o=t.slice();return o[14]=e[n],o}function Z(t,e,n){const o=t.slice();return o[17]=e[n],o}function tt(t){return{c:o,m:o,p:o,i:o,o:o,d:o}}function et(t){let e,n,o;X(t);let r=t[11].length&&nt(t),i=t[12].length&&it(t);return{c(){r&&r.c(),e=g(),i&&i.c(),n=m("")},m(t,s){r&&r.m(t,s),u(t,e,s),i&&i.m(t,s),u(t,n,s),o=!0},p(t,o){X(t),t[11].length?r?(r.p(t,o),1&o&&D(r,1)):(r=nt(t),r.c(),D(r,1),r.m(e.parentNode,e)):r&&(B(),G(r,1,1,()=>{r=null}),A()),t[12].length?i?(i.p(t,o),1&o&&D(i,1)):(i=it(t),i.c(),D(i,1),i.m(n.parentNode,n)):i&&(B(),G(i,1,1,()=>{i=null}),A())},i(t){o||(D(r),D(i),o=!0)},o(t){G(r),G(i),o=!1},d(t){r&&r.d(t),t&&f(e),i&&i.d(t),t&&f(n)}}}function nt(t){let e,n,o,r;e=new t[2]({props:{text:"Mögliche nächste Arbeitsschritte"}});let i=t[11],s=[];for(let e=0;e<i.length;e+=1)s[e]=rt(Z(t,i,e));const l=t=>G(s[t],1,1,()=>{s[t]=null});return{c(){L(e.$$.fragment),n=g(),o=p("div");for(let t=0;t<s.length;t+=1)s[t].c();h(o,"class","buttons svelte-10fqitu")},m(t,i){F(e,t,i),u(t,n,i),u(t,o,i);for(let t=0;t<s.length;t+=1)s[t].m(o,null);r=!0},p(t,e){if(97&e){let n;for(i=t[11],n=0;n<i.length;n+=1){const r=Z(t,i,n);s[n]?(s[n].p(r,e),D(s[n],1)):(s[n]=rt(r),s[n].c(),D(s[n],1),s[n].m(o,null))}for(B(),n=i.length;n<s.length;n+=1)l(n);A()}},i(t){if(!r){D(e.$$.fragment,t);for(let t=0;t<i.length;t+=1)D(s[t]);r=!0}},o(t){G(e.$$.fragment,t),s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)G(s[t]);r=!1},d(t){z(e,t),t&&f(n),t&&f(o),d(s,t)}}}function ot(t){let e,n=t[17].identity.designation+"";return{c(){e=m(n)},m(t,n){u(t,e,n)},p(t,o){1&o&&n!==(n=t[17].identity.designation+"")&&$(e,n)},d(t){t&&f(e)}}}function rt(t){let e,n;return e=new t[1]({props:{disabled:t[17].disabled,filled:!0,$$slots:{default:[ot]},$$scope:{ctx:t}}}),e.$on("click",function(){l(t[6](t[17]))&&t[6](t[17]).apply(this,arguments)}),{c(){L(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(n,o){t=n;const r={};1&o&&(r.disabled=t[17].disabled),1048577&o&&(r.$$scope={dirty:o,ctx:t}),e.$set(r)},i(t){n||(D(e.$$.fragment,t),n=!0)},o(t){G(e.$$.fragment,t),n=!1},d(t){z(e,t)}}}function it(t){let e,n,o,r;e=new t[2]({props:{text:"Auswertungen"}});let i=t[12],s=[];for(let e=0;e<i.length;e+=1)s[e]=lt(Y(t,i,e));const l=t=>G(s[t],1,1,()=>{s[t]=null});return{c(){L(e.$$.fragment),n=g(),o=p("div");for(let t=0;t<s.length;t+=1)s[t].c();h(o,"class","buttons svelte-10fqitu")},m(t,i){F(e,t,i),u(t,n,i),u(t,o,i);for(let t=0;t<s.length;t+=1)s[t].m(o,null);r=!0},p(t,e){if(161&e){let n;for(i=t[12],n=0;n<i.length;n+=1){const r=Y(t,i,n);s[n]?(s[n].p(r,e),D(s[n],1)):(s[n]=lt(r),s[n].c(),D(s[n],1),s[n].m(o,null))}for(B(),n=i.length;n<s.length;n+=1)l(n);A()}},i(t){if(!r){D(e.$$.fragment,t);for(let t=0;t<i.length;t+=1)D(s[t]);r=!0}},o(t){G(e.$$.fragment,t),s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)G(s[t]);r=!1},d(t){z(e,t),t&&f(n),t&&f(o),d(s,t)}}}function st(t){let e,n=t[14].identity.designation+"";return{c(){e=m(n)},m(t,n){u(t,e,n)},p(t,o){1&o&&n!==(n=t[14].identity.designation+"")&&$(e,n)},d(t){t&&f(e)}}}function lt(t){let e,n;return e=new t[1]({props:{filled:!0,$$slots:{default:[st]},$$scope:{ctx:t}}}),e.$on("click",function(){l(t[7](t[14]))&&t[7](t[14]).apply(this,arguments)}),{c(){L(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(n,o){t=n;const r={};1048577&o&&(r.$$scope={dirty:o,ctx:t}),e.$set(r)},i(t){n||(D(e.$$.fragment,t),n=!0)},o(t){G(e.$$.fragment,t),n=!1},d(t){z(e,t)}}}function ct(t){return{c:o,m:o,p:o,i:o,o:o,d:o}}function at(t){let e;return{c(){e=m("In eigenem Fenster anzeigen")},m(t,n){u(t,e,n)},d(t){t&&f(e)}}}function ut(t){let e,n,o,r,i,s,l,c,d,m,$,b={ctx:t,current:null,token:null,hasCatch:!1,pending:ct,then:et,catch:tt,value:13,blocks:[,,,]};return T(o=t[5](t[0]),b),i=new t[2]({props:{text:"Graphische Aufbereitung des Workflows"}}),c=new t[1]({props:{outline:!0,style:"margin-bottom: 1em;",$$slots:{default:[at]},$$scope:{ctx:t}}}),c.$on("click",t[4]),m=new V({props:{src:t[3]}}),{c(){var t,o,a;e=p("div"),e.textContent=" ",n=g(),b.block.c(),r=g(),L(i.$$.fragment),s=g(),l=p("div"),L(c.$$.fragment),d=g(),L(m.$$.fragment),t="height",o=".25em",e.style.setProperty(t,o,a?"important":""),h(l,"class","grid-container svelte-10fqitu"),h(l,"id","workflowContainer")},m(t,o){u(t,e,o),u(t,n,o),b.block.m(t,b.anchor=o),b.mount=()=>r.parentNode,b.anchor=r,u(t,r,o),F(i,t,o),u(t,s,o),u(t,l,o),F(c,l,null),a(l,d),F(m,l,null),$=!0},p(e,[n]){t=e,b.ctx=t,1&n&&o!==(o=t[5](t[0]))&&T(o,b)||function(t,e,n){const o=e.slice(),{resolved:r}=t;t.current===t.then&&(o[t.value]=r),t.current===t.catch&&(o[t.error]=r),t.block.p(o,n)}(b,t,n);const r={};1048576&n&&(r.$$scope={dirty:n,ctx:t}),c.$set(r)},i(t){$||(D(b.block),D(i.$$.fragment,t),D(c.$$.fragment,t),D(m.$$.fragment,t),$=!0)},o(t){for(let t=0;t<3;t+=1){G(b.blocks[t])}G(i.$$.fragment,t),G(c.$$.fragment,t),G(m.$$.fragment,t),$=!1},d(t){t&&f(e),t&&f(n),b.block.d(t),b.token=null,b=null,t&&f(r),z(i,t),t&&f(s),t&&f(l),z(c),z(m)}}}function ft(t,o,r){const{Button:i,Loading:s,Divider:l}=n;let{task:c}=o,{eventItem:a}=o;const u=`/api/graph/${c._id}?h=${window.location.hostname}`;return t.$$set=t=>{"task"in t&&r(8,c=t.task),"eventItem"in t&&r(0,a=t.eventItem)},[a,i,l,u,t=>{window.open(u+"&view=standalone","_blank","location=0, toolbar=1, menubar=0, status=1, titlebar=0, height=1200, width=1500")},async t=>{const n=await e.getEvents();let o=n.filter(e=>e.input?.class?.at(0)?.name===t.output.class[0].name)||[];o=o.filter(t=>t.trigger?.startOn?.find(t=>"Manual"===t.type)),o=await Promise.all(o.map(async n=>{let o=n.input.class[0].refStatus;const r=n.input.class[0].refFilter;if(o||r){if(o&&(o=[].concat(o),n.disabled=!o.find(t=>c.status===t)),r&&!n.disabled){const t=await e.getDocById(n.input.class[0].name,c.docId);t&&(n.disabled=!t[r])}}else n.disabled=!("Information"==t.state.task||"Information"===n.state.task||"Ready"===c.status)||"Closed"===c.status;return n})),n.forEach(e=>{const r=e.input?.class?.at(0);if(Array.isArray(r?.name)&&r.name.includes(t.output.class[0].name)){const r=e.output.class[0].name,i=n.filter(t=>t.input?.class?.at(1)?.name===r).map(e=>(e.refName=t.input?.class?.at(0)?.name,e.disabled="Closed"!==c.status,e));i?.length&&o.unshift(...i)}});const r=n.filter(e=>{if(!t.output?.class)return!1;if("report"!==e.output.type)return!1;const n=(e.output.class[0].item||[]).find(e=>e.refClass===t.output.class[0].name);return!!n&&!1!==n.properties?.query});return{followers:o,reports:r}},async t=>{let n=c.event,o=c._id,r="";if(t.refName){const i=(await e.getTask(a.output.class[0].name,c.docId))[t.refName];n=(await e.getSchemaByClass(t.refName)).id;if(o=(await e.getTaskByDocId(i,!0))._id,c.docId){const e=t.input.class[0];e.name!==e.selection&&(r=":"+c.docId)}}window.singleSpaNavigate(`/task/${n}/${o}/task/${t._id}${r}`)},async t=>{const e=c._id,n=`/reporting/${t._id}/${e}?view=standalone&back=true`;window.singleSpaNavigate(n)},c]}class dt extends H{constructor(t){var e;super(),document.getElementById("svelte-10fqitu-style")||((e=p("style")).id="svelte-10fqitu-style",e.textContent=".grid-container.svelte-10fqitu{overflow-y:hidden;overflow-x:hidden;min-height:500px;height:62vh;padding-top:1.5em}div.spinner{margin-top:2em}.buttons.svelte-10fqitu{display:flex;gap:1em;padding-top:1.75em;padding-bottom:2.25em}",a(document.head,e)),W(this,t,ft,ut,c,{task:8,eventItem:0})}}function pt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mt,gt,ht=(mt=function(t,e){function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function o(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?n(Object(o),!0).forEach(function(e){r(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("object"!==i(t))throw new Error("single-spa-svelte requires a configuration object");var e=o(o({},s),t);if(!e.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:l.bind(null,e,n),mount:c.bind(null,e,n),unmount:a.bind(null,e,n),update:u.bind(null,e,n)}};var s={component:null,domElementGetter:null,props:{}};function l(t){return Promise.resolve()}function c(t,e,n){var r=Object.keys(s),i=Object.keys(t).reduce(function(e,n){return r.includes(n)||(e[n]=t[n]),e},{});return Promise.resolve().then(function(){var r=function(t,e){return(e=e&&e.customProps?e.customProps:e).domElement?function(){return e.domElement}:e.domElementGetter?function(){return e.domElementGetter(e)}:t.domElementGetter?function(){return t.domElementGetter(e)}:function(t){var e=t.appName||t.name;if(!e)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)}(t,n),s=r();e.instance=new t.component(o(o({},i),{},{target:s,props:Object.assign({},n,t.props)}))})}function a(t,e){return Promise.resolve().then(function(){e.instance.$destroy?e.instance.$destroy():e.instance.destroy()})}function u(t,e,n){return Promise.resolve().then(function(){e.instance.$set?e.instance.$set(n):e.instance.set(n)})}},mt(gt={exports:{}},gt.exports),gt.exports);const $t=pt(ht)({component:dt,domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:bt,mount:yt,unmount:vt}=$t;t({bootstrap:bt,mount:yt,unmount:vt});t("Workflow",dt)}}});