n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 2.38 kB
JavaScript
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.16.1`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`ab9b644e-184c-44a2-84b6-6f13ee990468`,e._sentryDebugIdIdentifier=`sentry-dbid-ab9b644e-184c-44a2-84b6-6f13ee990468`)})()}catch{}import{Ft as e,I as t,N as n,Ot as r,Rt as i,X as a,gt as o,q as s,zt as c}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{a as l,i as u,t as d}from"./chart-WZvcQ3IV.js";var f={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:`label`},updateMode:{type:String,default:void 0}},p={type:{type:String,required:!0},...f},m=(e,t)=>Object.assign(e,t);function h(e){return r(e)?c(e):e}function g(e){return r(arguments.length>1&&arguments[1]!==void 0?arguments[1]:e)?new Proxy(e,{}):e}function _(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function v(e,t){e.labels=t}function y(e,t,n){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function b(e,t){let n={labels:[],datasets:[]};return v(n,e.labels),y(n,e.datasets,t),n}var x=n({props:p,setup(n,r){let{expose:l}=r,d=e(null),f=i(null);l({chart:f});let p=()=>{if(!d.value)return;let{type:e,data:t,options:r,plugins:i,datasetIdKey:a}=n,o=g(b(t,a),t);f.value=new u(d.value,{type:e,data:o,options:{...r},plugins:i})},m=()=>{let e=c(f.value);e&&(e.destroy(),f.value=null)},x=e=>{e.update(n.updateMode)};return a(p),s(m),o([()=>n.options,()=>n.data],(e,t)=>{let[r,i]=e,[a,o]=t,s=c(f.value);if(!s)return;let l=!1;if(r){let e=h(r),t=h(a);e&&e!==t&&(_(s,e),l=!0)}if(i){let e=h(i.labels),t=h(o.labels),r=h(i.datasets),a=h(o.datasets);e!==t&&(v(s.config.data,e),l=!0),r&&r!==a&&(y(s.config.data,r,n.datasetIdKey),l=!0)}l&&x(s)},{deep:!0}),()=>t(`canvas`,{ref:d})}});function S(e,r){return u.register(r),n({props:f,setup(n,r){let{expose:a}=r,o=i(null),s=e=>{o.value=e?.chart};return a({chart:o}),()=>t(x,m({ref:s},{type:e,...n}))}})}var C=S(`bar`,d),w=S(`line`,l);export{x as n,w as r,C as t};
//# sourceMappingURL=dist-DHUGszlM.js.map