@ixon-cdk/iframe-adapter 1.21.0 → 1.22.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +408 -394
- package/dist/index.umd.cjs +1 -1
- package/package.json +4 -4
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g["@ixon-cdk/iframe-adapter"]={}))})(this,function(g){"use strict";var tt=Object.defineProperty;var at=(g,l,r)=>l in g?tt(g,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):g[l]=r;var p=(g,l,r)=>(at(g,typeof l!="symbol"?l+"":l,r),r);const l="cdk:cmpctx:",r={Create:`${l}create`,Created:`${l}created`,Destroy:`${l}destroy`,BackendComponentClientCreate:`${l}bcc:create`,BackendComponentClientDestroy:`${l}bcc:destroy`,BackendComponentClientCall:`${l}bcc:call`,BackendComponentClientCallResult:`${l}bcc:callresult`,LoggingDataClientCreate:`${l}ldc:create`,LoggingDataClientDestroy:`${l}ldc:destroy`,LoggingDataClientQuery:`${l}ldc:query`,LoggingDataClientQueryResult:`${l}ldc:queryresult`,ResourceDataClientCreate:`${l}rdc:create`,ResourceDataClientDestroy:`${l}rdc:destroy`,ResourceDataClientQuery:`${l}rdc:query`,ResourceDataClientQueryResult:`${l}rdc:queryresult`,ResourceDataClientRender:`${l}rdc:render`,ResourceDataClientRenderResult:`${l}rdc:renderresult`,ResourceDataClientUpdate:`${l}rdc:update`,ResourceDataClientUpdated:`${l}rdc:updated`,OpenActionMenu:`${l}openactionmenu`,OpenActionMenuResult:`${l}openactionmenuresult`,OpenActionBottomSheet:`${l}openactionbottomsheet`,OpenActionBottomSheetResult:`${l}openactionbottomsheetresult`,OpenAlertDialog:`${l}openalertdialog`,OpenAlertDialogResult:`${l}openalertdialogresult`,OpenConfirmDialog:`${l}openconfirmdialog`,OpenConfirmDialogResult:`${l}openconfirmdialogresult`,OpenContentDialog:`${l}opencontentdialog`,OpenContentDialogResult:`${l}opencontentdialogresult`,OpenFormDialog:`${l}openformdialog`,OpenFormDialogResult:`${l}openformdialogresult`,OpenSelectPanel:`${l}openselectpanel`,OpenSelectPanelResult:`${l}openselectpanelresult`,OpenToast:`${l}opentoast`,OpenToastResult:`${l}opentoastresult`,ShowVpnStatusDetails:`${l}showvpnstatusdetails`,ToggleVpn:`${l}togglevpn`,VpnClientStatusChange:`${l}vpnclientstatuschange`,NavigateByUrl:`${l}navigatebyurl`,SetTimeRange:`${l}settimerange`,TimeRangeChange:`${l}timerangechange`},j=["color-scheme","background","on-background","primary","on-primary","secondary","on-secondary","error","on-error","success","on-success"];function P({iframe:t,context:e}){return window.addEventListener("message",o,!1),e.ontimerangechange=(...n)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.TimeRangeChange,payload:n},"*")},e.onvpnclientstatuschange=(...n)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.VpnClientStatusChange,payload:n},"*")},{destroy(){window.removeEventListener("message",o,!1)}};function s(n){return{_apiLinkEntries:[...n._getApiLinks().entries()],_designTokenEntries:j.map(a=>[a,n.getDesignToken(a)]),appData:n.appData,componentBaseUrl:n.componentBaseUrl,destroyed:n.destroyed,mode:n.mode,inputs:n.inputs,timeRange:n.timeRange,timeRangeIsAdjustable:n.timeRangeIsAdjustable,vpnClientStatus:n.vpnClientStatus}}function o(n){if(o._clients=o._clients||new Map([]),n.source===t.contentWindow)switch(n.data.type){case r.Create:t.contentWindow.postMessage({type:r.Created,payload:s(e)},"*");break;case r.Destroy:e.destroy();break;case r.BackendComponentClientCreate:{const{clientId:a}=n.data.payload,i=e.createBackendComponentClient(a);o._clients.set(a,i);break}case r.BackendComponentClientDestroy:{const{clientId:a}=n.data.payload;o._clients.has(a)&&(o._clients.get(a).destroy(),o._clients.delete(a));break}case r.BackendComponentClientCall:{const{clientId:a,callId:i,functionName:c,functionArguments:d}=n.data.payload;let u=o._clients.get(a);u&&!u._destroyed&&u.call(c,d).then(M=>{u&&!u.destroyed&&t.contentWindow.postMessage({type:r.BackendComponentClientCallResult,payload:{callId:i,result:M}},"*")});break}case r.LoggingDataClientCreate:{const{clientId:a}=n.data.payload,i=e.createLoggingDataClient(a);o._clients.set(a,i);break}case r.LoggingDataClientDestroy:{const{clientId:a}=n.data.payload;o._clients.has(a)&&(o._clients.get(a).destroy(),o._clients.delete(a));break}case r.LoggingDataClientQuery:{const{clientId:a,queryId:i,query:c}=n.data.payload;let d=o._clients.get(a);d&&!d._destroyed&&d.query(c,u=>{d._destroyed||t.contentWindow.postMessage({type:r.LoggingDataClientQueryResult,payload:{queryId:i,results:u}},"*")});break}case r.ResourceDataClientCreate:{const{clientId:a}=n.data.payload,i=e.createResourceDataClient(a);o._clients.set(a,i);break}case r.ResourceDataClientDestroy:{const{clientId:a}=n.data.payload;o._clients.has(a)&&(o._clients.get(a).destroy(),o._clients.delete(a));break}case r.ResourceDataClientQuery:{const{clientId:a,queryId:i,query:c}=n.data.payload;let d=o._clients.get(a);d&&!d._destroyed&&d.query(c,u=>{d._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientQueryResult,payload:{queryId:i,results:u}},"*")});break}case r.ResourceDataClientRender:{const{clientId:a,queryId:i,query:c}=n.data.payload;let d=o._clients.get(a);d&&!d._destroyed&&d.render(c,u=>{d._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientRenderResult,payload:{queryId:i,results:u}},"*")});break}case r.ResourceDataClientUpdate:{const{clientId:a,updateId:i,update:c}=n.data.payload;let d=o._clients.get(a);d&&!d._destroyed&&d.update(c).then(()=>{d&&!d._destroyed&&t.contentWindow.postMessage({type:r.ResourceDataClientUpdated,payload:{updateId:i}},"*")});break}case r.OpenActionBottomSheet:e.openActionBottomSheet(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenActionBottomSheetResult,payload:{result:a}},"*")});break;case r.OpenActionMenu:{const a=n.data.payload.targetRect,i={getBoundingClientRect:()=>{const c=t.getBoundingClientRect();return{...JSON.parse(JSON.stringify(a)),top:c.top+a.top,x:c.x+a.x}}};e.openActionMenu(i,n.data.payload.options).then(c=>{t.contentWindow.postMessage({type:r.OpenActionMenuResult,payload:{result:c}},"*")})}break;case r.OpenAlertDialog:e.openAlertDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenAlertDialogResult,payload:{result:a}},"*")});break;case r.OpenConfirmDialog:e.openConfirmDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenConfirmDialogResult,payload:{result:a}},"*")});break;case r.OpenContentDialog:e.openContentDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenContentDialogResult,payload:{result:a}},"*")});break;case r.OpenFormDialog:e.openFormDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenFormDialogResult,payload:{result:a}},"*")});break;case r.OpenSelectPanel:{const a=n.data.payload.targetRect,i={getBoundingClientRect:()=>{const c=t.getBoundingClientRect();return{...JSON.parse(JSON.stringify(a)),top:c.top+a.top,x:c.x+a.x}}};e.openSelectPanel(i,n.data.payload.options).then(c=>{t.contentWindow.postMessage({type:r.OpenSelectPanelResult,payload:{result:c}},"*")})}break;case r.OpenToast:e.openToast(n.data.payload.options).then(a=>{const{id:i}=n.data.payload;t.contentWindow&&t.contentWindow.postMessage({type:r.OpenToastResult,payload:{id:i,result:a}},"*")});break;case r.ShowVpnStatusDetails:e.showVpnStatusDetails(n.data.payload.agentId);break;case r.ToggleVpn:e.toggleVpn(n.data.payload.agentId);break;case r.NavigateByUrl:e.navigateByUrl(n.data.payload.url);break;case r.SetTimeRange:e.setTimeRange(n.data.payload.timeRange);break}}}class B{constructor(e,s,o,n){this.query=e,this.variable=s,this.tag=o,this._onCancel=n,Object.freeze(this)}cancel(){this._onCancel&&this._onCancel()}}var F=typeof global=="object"&&global&&global.Object===Object&&global;const H=F;var V=typeof self=="object"&&self&&self.Object===Object&&self,N=H||V||Function("return this")();const S=N;var W=S.Symbol;const _=W;var v=Object.prototype,Q=v.hasOwnProperty,z=v.toString,m=_?_.toStringTag:void 0;function G(t){var e=Q.call(t,m),s=t[m];try{t[m]=void 0;var o=!0}catch{}var n=z.call(t);return o&&(e?t[m]=s:delete t[m]),n}var J=Object.prototype,K=J.toString;function X(t){return K.call(t)}var Y="[object Null]",Z="[object Undefined]",T=_?_.toStringTag:void 0;function x(t){return t==null?t===void 0?Z:Y:T&&T in Object(t)?G(t):X(t)}function E(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ee="[object AsyncFunction]",te="[object Function]",ae="[object GeneratorFunction]",ne="[object Proxy]";function oe(t){if(!E(t))return!1;var e=x(t);return e==te||e==ae||e==ee||e==ne}var se=S["__core-js_shared__"];const $=se;var L=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function re(t){return!!L&&L in t}var ie=Function.prototype,le=ie.toString;function de(t){if(t!=null){try{return le.call(t)}catch{}try{return t+""}catch{}}return""}var ce=/[\\^$.*+?()[\]{}|]/g,pe=/^\[object .+?Constructor\]$/,ue=Function.prototype,ge=Object.prototype,ye=ue.toString,he=ge.hasOwnProperty,fe=RegExp("^"+ye.call(he).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function we(t){if(!E(t)||re(t))return!1;var e=oe(t)?fe:pe;return e.test(de(t))}function me(t,e){return t==null?void 0:t[e]}function k(t,e){var s=me(t,e);return we(s)?s:void 0}function Ce(t,e){return t===e||t!==t&&e!==e}var _e=k(Object,"create");const C=_e;function De(){this.__data__=C?C(null):{},this.size=0}function Re(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var be="__lodash_hash_undefined__",Oe=Object.prototype,Se=Oe.hasOwnProperty;function $e(t){var e=this.__data__;if(C){var s=e[t];return s===be?void 0:s}return Se.call(e,t)?e[t]:void 0}var Ie=Object.prototype,Me=Ie.hasOwnProperty;function ve(t){var e=this.__data__;return C?e[t]!==void 0:Me.call(e,t)}var Te="__lodash_hash_undefined__";function Ee(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=C&&e===void 0?Te:e,this}function h(t){var e=-1,s=t==null?0:t.length;for(this.clear();++e<s;){var o=t[e];this.set(o[0],o[1])}}h.prototype.clear=De,h.prototype.delete=Re,h.prototype.get=$e,h.prototype.has=ve,h.prototype.set=Ee;function Le(){this.__data__=[],this.size=0}function D(t,e){for(var s=t.length;s--;)if(Ce(t[s][0],e))return s;return-1}var ke=Array.prototype,Ae=ke.splice;function Ue(t){var e=this.__data__,s=D(e,t);if(s<0)return!1;var o=e.length-1;return s==o?e.pop():Ae.call(e,s,1),--this.size,!0}function qe(t){var e=this.__data__,s=D(e,t);return s<0?void 0:e[s][1]}function je(t){return D(this.__data__,t)>-1}function Pe(t,e){var s=this.__data__,o=D(s,t);return o<0?(++this.size,s.push([t,e])):s[o][1]=e,this}function w(t){var e=-1,s=t==null?0:t.length;for(this.clear();++e<s;){var o=t[e];this.set(o[0],o[1])}}w.prototype.clear=Le,w.prototype.delete=Ue,w.prototype.get=qe,w.prototype.has=je,w.prototype.set=Pe;var Be=k(S,"Map");const Fe=Be;function He(){this.size=0,this.__data__={hash:new h,map:new(Fe||w),string:new h}}function Ve(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function R(t,e){var s=t.__data__;return Ve(e)?s[typeof e=="string"?"string":"hash"]:s.map}function Ne(t){var e=R(this,t).delete(t);return this.size-=e?1:0,e}function We(t){return R(this,t).get(t)}function Qe(t){return R(this,t).has(t)}function ze(t,e){var s=R(this,t),o=s.size;return s.set(t,e),this.size+=s.size==o?0:1,this}function f(t){var e=-1,s=t==null?0:t.length;for(this.clear();++e<s;){var o=t[e];this.set(o[0],o[1])}}f.prototype.clear=He,f.prototype.delete=Ne,f.prototype.get=We,f.prototype.has=Qe,f.prototype.set=ze;var Ge="Expected a function";function I(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Ge);var s=function(){var o=arguments,n=e?e.apply(this,o):o[0],a=s.cache;if(a.has(n))return a.get(n);var i=t.apply(this,o);return s.cache=a.set(n,i)||a,i};return s.cache=new(I.Cache||f),s}I.Cache=f;const Je=2,A=1,U="";class b{constructor(e,s,o){this.locale=e,this.queryRef=s,this.rawValue=o}static create(e,s,o){return s.query.postAggr==="count"?new Ke(e,s,o):new b(e,s,o)}getDecimals(e=Je){return this.decimals??this.queryRef.query.decimals??e}getFactor(){var e,s,o;return this.factor??this.queryRef.query.factor??((s=(e=this.queryRef.tag)==null?void 0:e.variable)!=null&&s.factor?parseFloat(this.queryRef.tag.variable.factor):null)??((o=this.queryRef.variable)!=null&&o.factor?parseFloat(this.queryRef.variable.factor):null)??A}getUnit(){var e,s,o;return this.unit??this.queryRef.query.unit??((s=(e=this.queryRef.tag)==null?void 0:e.variable)==null?void 0:s.unit)??((o=this.queryRef.variable)==null?void 0:o.unit)??U}setDecimals(e){this.decimals=e}setFactor(e){this.factor=e}setUnit(e){this.unit=e}getValue(){return this.rawValue}toString(){var o,n,a,i;const e=this.locale??void 0,s=I((c,d,u,M)=>{const et={style:"decimal",minimumFractionDigits:Math.floor(d),maximumFractionDigits:Math.floor(d)};return`${new Intl.NumberFormat(M,et).format(c)}${u?" "+u:""}`});return this.rawValue===null?"":this.queryRef.query.postAggr==="count"?s(this.rawValue,this.getDecimals(0),this.unit??this.queryRef.query.unit,e):((o=this.queryRef.variable)==null?void 0:o.type)==="str"?this.rawValue:((n=this.queryRef.variable)==null?void 0:n.type)==="bool"?this.rawValue?"True":"False":((a=this.queryRef.variable)==null?void 0:a.type)==="int"?s(this.rawValue,Number.isInteger(this.getFactor())?this.getDecimals(0):this.getDecimals(),this.getUnit(),e):((i=this.queryRef.variable)==null?void 0:i.type)==="float"?s(this.rawValue,this.getDecimals(),this.getUnit(),e):String(this.getValue())}}class Ke extends b{getFactor(){return this.factor??this.queryRef.query.factor??A}getUnit(){return this.unit??this.queryRef.query.unit??U}}function q(t){return t.map(({queryRef:s,time:o,value:n})=>{const a=new B(s.query,s.variable,s.tag),i=b.create(n.locale,a,n.rawValue);return{queryRef:a,time:o,value:i}})}class y extends Error{constructor(e="Method is not implemented"){super(e),this.name="NotImplementedError",this.message=e,this.stack=`NotImplementedError: ${e}`}}class Xe{constructor(e){p(this,"ontimerangechange",null);p(this,"onvpnclientstatuschange",null);p(this,"_getApiLinks");p(this,"_getDesignTokens");p(this,"appData");p(this,"componentBaseUrl");p(this,"destroyed");p(this,"mode");p(this,"inputs");p(this,"inputMap");p(this,"timeRange");p(this,"timeRangeIsAdjustable");p(this,"vpnClientStatus");p(this,"getDesignToken");this._getApiLinks=()=>new Map(e._apiLinkEntries),this._getDesignTokens=()=>new Map(e._designTokenEntries),this.appData=e.appData,this.componentBaseUrl=e.componentBaseUrl,this.destroyed=e.destroyed,this.mode=e.mode,this.inputs=e.inputs,this.inputMap=new Map(Object.entries(this.inputs)),this.timeRange=e.timeRange,this.timeRangeIsAdjustable=e.timeRangeIsAdjustable,this.vpnClientStatus=e.vpnClientStatus,this._messageHandler=this._messageHandler.bind(this),window.addEventListener("message",this._messageHandler,!1);const s=a=>this._getDesignTokens().get(a)??"";s.var=a=>`var(--uic-${a})`,this.getDesignToken=s;const o=new CSSStyleSheet,n=e._designTokenEntries.map(([a,i])=>`--uic-${a}:${i}`);o.replaceSync(`:root {${n.join(";")}}`),window.document.adoptedStyleSheets.push(o)}_messageHandler(e){if(e.source===window.parent)switch(e.data.type){case r.TimeRangeChange:this.ontimerangechange&&this.ontimerangechange(...e.data.payload);break;case r.VpnClientStatusChange:this.onvpnclientstatuschange&&this.onvpnclientstatuschange(...e.data.payload);break}}createBackendComponentClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.BackendComponentClientCreate,payload:{clientId:e}},"*"),new Ye(e)}createLoggingDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.LoggingDataClientCreate,payload:{clientId:e}},"*"),new Ze(e)}createObjectStorageClient(){throw new y}createResourceDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.ResourceDataClientCreate,payload:{clientId:e}},"*"),new xe(e)}createTooltip(){throw new y}destroy(){window.parent.postMessage({type:r.Destroy},"*"),window.removeEventListener("message",this._messageHandler,!1),this.destroyed=!0}getApiUrl(e,s){const o=this._getApiLinks().get(e);if(!o)throw new Error("IxApiError: entry not found");return s?Object.keys(s).sort().reduce((n,a)=>{if(n.includes(`{${a}}`))return n.replace(`{${a}}`,s[a]);const i=new URL(n);return i.searchParams.set(a,s[a]),decodeURIComponent(i.href)},o.href):o.href}navigateByUrl(e){window.parent.postMessage({type:r.NavigateByUrl,payload:{url:e}},"*")}openActionBottomSheet(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenActionBottomSheet,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenActionBottomSheetResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openActionMenu(e,s){return new Promise(o=>{window.addEventListener("message",a,!1);const n=e.getBoundingClientRect();window.parent.postMessage({type:r.OpenActionMenu,payload:{targetRect:n,options:s}},"*");function a(i){i.source===window.parent&&i.data.type===r.OpenActionMenuResult&&(window.removeEventListener("message",a,!1),o(i.data.payload.result))}})}openAlertDialog(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenAlertDialog,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenAlertDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openConfirmDialog(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenConfirmDialog,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenConfirmDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openContentDialog(e){if(typeof e.onopened=="function")throw new y('The "onopened" option is not implemented');if(typeof e.onclose=="function")throw new y('The "onclose" option is not implemented');if(e.pagination)throw new y('The "pagination" option is not implemented');return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenContentDialog,payload:{options:e.htmlContent&&typeof e.htmlContent!="string"?{...e,htmlContent:e.htmlContent.cloneNode(!0).outerHTML}:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenContentDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openFormDialog(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenFormDialog,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenFormDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openSelectPanel(e,s){return new Promise(o=>{window.addEventListener("message",a,!1);const n=e.getBoundingClientRect();window.parent.postMessage({type:r.OpenSelectPanel,payload:{targetRect:n,options:s}},"*");function a(i){i.source===window.parent&&i.data.type===r.OpenSelectPanelResult&&(window.removeEventListener("message",a,!1),o(i.data.payload.result))}})}openToast(...e){return new Promise(s=>{window.addEventListener("message",a,!1);const o=crypto.randomUUID(),n=typeof e[0]=="string"?{...e[1],message:e[0]}:e[0];window.parent.postMessage({type:r.OpenToast,payload:{id:o,options:n}},"*");function a(i){i.source===window.parent&&i.data.type===r.OpenToastResult&&i.data.payload.id===o&&(window.removeEventListener("message",a,!1),s(i.data.payload.result))}})}sanitizeHtml(){throw new y}saveAsFile(){throw new y}setTimeRange(e){window.parent.postMessage({type:r.SetTimeRange,payload:{timeRange:e}},"*")}showVpnStatusDetails(e){window.parent.postMessage({type:r.ShowVpnStatusDetails,payload:{agentId:e}},"*")}testVpnAccess(){throw new y}toggleVpn(e){window.parent.postMessage({type:r.ToggleVpn,payload:{agentId:e}},"*")}translate(){throw new y}}class Ye{constructor(e){this.id=e}call(e,s){return new Promise(o=>{const n=crypto.randomUUID();window.addEventListener("message",a,!1),window.parent.postMessage({type:r.BackendComponentClientCall,payload:{clientId:this.id,callId:n,functionName:e,functionArguments:s}},"*");function a(i){i.source===window.parent&&i.data.type===r.BackendComponentClientCallResult&&i.data.payload.callId===n&&(window.removeEventListener("message",a,!1),o(i.data.payload.result))}})}destroy(){window.parent.postMessage({type:r.BackendComponentClientDestroy,payload:{clientId:this.id}},"*")}}class Ze{constructor(e){this.id=e}query(e,s){const o=crypto.randomUUID();return window.addEventListener("message",n,!1),window.parent.postMessage({type:r.LoggingDataClientQuery,payload:{clientId:this.id,queryId:o,query:e}},"*"),()=>{window.removeEventListener("message",n,!1)};function n(a){if(a.source===window.parent&&a.data.type===r.LoggingDataClientQueryResult&&a.data.payload.queryId===o){const{results:i}=a.data.payload;if(e.length)if(!e.queries||e.format!=="csv"){const c=i.map(d=>q(d));s(c)}else throw new y;else{const c=q(i);s(c)}}}}destroy(){window.parent.postMessage({type:r.LoggingDataClientDestroy,payload:{clientId:this.id}},"*")}}class xe{constructor(e){this.id=e}query(e,s){const o=crypto.randomUUID();return window.addEventListener("message",n,!1),window.parent.postMessage({type:r.ResourceDataClientQuery,payload:{clientId:this.id,queryId:o,query:e}},"*"),()=>{window.removeEventListener("message",n,!1)};function n(a){a.source===window.parent&&a.data.type===r.ResourceDataClientQueryResult&&a.data.payload.queryId===o&&s(a.data.payload.results)}}update(e){return new Promise(s=>{const o=crypto.randomUUID();window.addEventListener("message",n,!1),window.parent.postMessage({type:r.ResourceDataClientUpdate,payload:{clientId:this.id,updateId:o,update:e}},"*");function n(a){a.source===window.parent&&a.data.type===r.ResourceDataClientUpdated&&a.data.payload.updateId===o&&(window.removeEventListener("message",n,!1),s())}})}render(e,s){const o=crypto.randomUUID();return window.addEventListener("message",n,!1),window.parent.postMessage({type:r.ResourceDataClientRender,payload:{clientId:this.id,queryId:o,query:e}},"*"),()=>{window.removeEventListener("message",n,!1)};function n(a){a.source===window.parent&&a.data.type===r.ResourceDataClientRenderResult&&a.data.payload.queryId===o&&s(a.data.payload.results)}}destroy(){window.parent.postMessage({type:r.ResourceDataClientDestroy,payload:{clientId:this.id}},"*")}}function O(t){const e=!!(t&&t.migrateInputs);return!e&&O.__cache__?Promise.resolve(O.__cache__):new Promise(s=>{window.addEventListener("message",function o(n){if(n.source===window.parent&&n.data&&n.data.type===r.Created){let a=n.data.payload;e&&(a.inputs=t.migrateInputs(a.inputs,null));const i=new Xe(a);s(i),e||(O.__cache__=i),window.removeEventListener("message",o,!1)}},!1),window.parent.postMessage({type:r.Create},"*")})}g.connect=P,g.getComponentContext=O,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(g,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(g=typeof globalThis<"u"?globalThis:g||self,l(g["@ixon-cdk/iframe-adapter"]={}))})(this,(function(g){"use strict";const l="cdk:cmpctx:",r={Create:`${l}create`,Created:`${l}created`,Destroy:`${l}destroy`,BackendComponentClientCreate:`${l}bcc:create`,BackendComponentClientDestroy:`${l}bcc:destroy`,BackendComponentClientCall:`${l}bcc:call`,BackendComponentClientCallResult:`${l}bcc:callresult`,LoggingDataClientCreate:`${l}ldc:create`,LoggingDataClientDestroy:`${l}ldc:destroy`,LoggingDataClientQuery:`${l}ldc:query`,LoggingDataClientQueryResult:`${l}ldc:queryresult`,ResourceDataClientCreate:`${l}rdc:create`,ResourceDataClientDestroy:`${l}rdc:destroy`,ResourceDataClientQuery:`${l}rdc:query`,ResourceDataClientQueryResult:`${l}rdc:queryresult`,ResourceDataClientRender:`${l}rdc:render`,ResourceDataClientRenderResult:`${l}rdc:renderresult`,ResourceDataClientUpdate:`${l}rdc:update`,ResourceDataClientUpdated:`${l}rdc:updated`,OpenActionMenu:`${l}openactionmenu`,OpenActionMenuResult:`${l}openactionmenuresult`,OpenActionBottomSheet:`${l}openactionbottomsheet`,OpenActionBottomSheetResult:`${l}openactionbottomsheetresult`,OpenAlertDialog:`${l}openalertdialog`,OpenAlertDialogResult:`${l}openalertdialogresult`,OpenConfirmDialog:`${l}openconfirmdialog`,OpenConfirmDialogResult:`${l}openconfirmdialogresult`,OpenContentDialog:`${l}opencontentdialog`,OpenContentDialogResult:`${l}opencontentdialogresult`,OpenFormDialog:`${l}openformdialog`,OpenFormDialogResult:`${l}openformdialogresult`,OpenSelectPanel:`${l}openselectpanel`,OpenSelectPanelResult:`${l}openselectpanelresult`,OpenToast:`${l}opentoast`,OpenToastResult:`${l}opentoastresult`,ShowVpnStatusDetails:`${l}showvpnstatusdetails`,ToggleVpn:`${l}togglevpn`,VpnClientStatusChange:`${l}vpnclientstatuschange`,NavigateByUrl:`${l}navigatebyurl`,SetTimeRange:`${l}settimerange`,TimeRangeChange:`${l}timerangechange`},U=["color-scheme","background","on-background","primary","on-primary","secondary","on-secondary","error","on-error","success","on-success"];function q({iframe:t,context:e}){return window.addEventListener("message",o,!1),e.ontimerangechange=(...n)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.TimeRangeChange,payload:n},"*")},e.onvpnclientstatuschange=(...n)=>{t.contentWindow&&t.contentWindow.postMessage({type:r.VpnClientStatusChange,payload:n},"*")},{destroy(){window.removeEventListener("message",o,!1)}};function s(n){return{_apiLinkEntries:[...n._getApiLinks().entries()],_designTokenEntries:U.map(a=>[a,n.getDesignToken(a)]),appData:n.appData,componentBaseUrl:n.componentBaseUrl,destroyed:n.destroyed,mode:n.mode,inputs:n.inputs,timeRange:n.timeRange,timeRangeIsAdjustable:n.timeRangeIsAdjustable,vpnClientStatus:n.vpnClientStatus}}function o(n){if(o._clients=o._clients||new Map([]),n.source===t.contentWindow)switch(n.data.type){case r.Create:t.contentWindow.postMessage({type:r.Created,payload:s(e)},"*");break;case r.Destroy:e.destroy();break;case r.BackendComponentClientCreate:{const{clientId:a}=n.data.payload,i=e.createBackendComponentClient(a);o._clients.set(a,i);break}case r.BackendComponentClientDestroy:{const{clientId:a}=n.data.payload;o._clients.has(a)&&(o._clients.get(a).destroy(),o._clients.delete(a));break}case r.BackendComponentClientCall:{const{clientId:a,callId:i,functionName:d,functionArguments:c}=n.data.payload;let p=o._clients.get(a);p&&!p._destroyed&&p.call(d,c).then(ze=>{p&&!p.destroyed&&t.contentWindow.postMessage({type:r.BackendComponentClientCallResult,payload:{callId:i,result:ze}},"*")});break}case r.LoggingDataClientCreate:{const{clientId:a}=n.data.payload,i=e.createLoggingDataClient(a);o._clients.set(a,i);break}case r.LoggingDataClientDestroy:{const{clientId:a}=n.data.payload;o._clients.has(a)&&(o._clients.get(a).destroy(),o._clients.delete(a));break}case r.LoggingDataClientQuery:{const{clientId:a,queryId:i,query:d}=n.data.payload;let c=o._clients.get(a);c&&!c._destroyed&&c.query(d,p=>{c._destroyed||t.contentWindow.postMessage({type:r.LoggingDataClientQueryResult,payload:{queryId:i,results:p}},"*")});break}case r.ResourceDataClientCreate:{const{clientId:a}=n.data.payload,i=e.createResourceDataClient(a);o._clients.set(a,i);break}case r.ResourceDataClientDestroy:{const{clientId:a}=n.data.payload;o._clients.has(a)&&(o._clients.get(a).destroy(),o._clients.delete(a));break}case r.ResourceDataClientQuery:{const{clientId:a,queryId:i,query:d}=n.data.payload;let c=o._clients.get(a);c&&!c._destroyed&&c.query(d,p=>{c._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientQueryResult,payload:{queryId:i,results:p}},"*")});break}case r.ResourceDataClientRender:{const{clientId:a,queryId:i,query:d}=n.data.payload;let c=o._clients.get(a);c&&!c._destroyed&&c.render(d,p=>{c._destroyed||t.contentWindow.postMessage({type:r.ResourceDataClientRenderResult,payload:{queryId:i,results:p}},"*")});break}case r.ResourceDataClientUpdate:{const{clientId:a,updateId:i,update:d}=n.data.payload;let c=o._clients.get(a);c&&!c._destroyed&&c.update(d).then(()=>{c&&!c._destroyed&&t.contentWindow.postMessage({type:r.ResourceDataClientUpdated,payload:{updateId:i}},"*")});break}case r.OpenActionBottomSheet:e.openActionBottomSheet(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenActionBottomSheetResult,payload:{result:a}},"*")});break;case r.OpenActionMenu:{const a=n.data.payload.targetRect,i={getBoundingClientRect:()=>{const d=t.getBoundingClientRect();return{...JSON.parse(JSON.stringify(a)),top:d.top+a.top,x:d.x+a.x}}};e.openActionMenu(i,n.data.payload.options).then(d=>{t.contentWindow.postMessage({type:r.OpenActionMenuResult,payload:{result:d}},"*")})}break;case r.OpenAlertDialog:e.openAlertDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenAlertDialogResult,payload:{result:a}},"*")});break;case r.OpenConfirmDialog:e.openConfirmDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenConfirmDialogResult,payload:{result:a}},"*")});break;case r.OpenContentDialog:e.openContentDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenContentDialogResult,payload:{result:a}},"*")});break;case r.OpenFormDialog:e.openFormDialog(n.data.payload.options).then(a=>{t.contentWindow.postMessage({type:r.OpenFormDialogResult,payload:{result:a}},"*")});break;case r.OpenSelectPanel:{const a=n.data.payload.targetRect,i={getBoundingClientRect:()=>{const d=t.getBoundingClientRect();return{...JSON.parse(JSON.stringify(a)),top:d.top+a.top,x:d.x+a.x}}};e.openSelectPanel(i,n.data.payload.options).then(d=>{t.contentWindow.postMessage({type:r.OpenSelectPanelResult,payload:{result:d}},"*")})}break;case r.OpenToast:e.openToast(n.data.payload.options).then(a=>{const{id:i}=n.data.payload;t.contentWindow&&t.contentWindow.postMessage({type:r.OpenToastResult,payload:{id:i,result:a}},"*")});break;case r.ShowVpnStatusDetails:e.showVpnStatusDetails(n.data.payload.agentId);break;case r.ToggleVpn:e.toggleVpn(n.data.payload.agentId);break;case r.NavigateByUrl:e.navigateByUrl(n.data.payload.url);break;case r.SetTimeRange:e.setTimeRange(n.data.payload.timeRange);break}}}class j{constructor(e,s,o,n){this.query=e,this.variable=s,this.tag=o,this._onCancel=n,Object.freeze(this)}cancel(){this._onCancel&&this._onCancel()}}var P=typeof global=="object"&&global&&global.Object===Object&&global,B=typeof self=="object"&&self&&self.Object===Object&&self,O=P||B||Function("return this")(),C=O.Symbol,M=Object.prototype,F=M.hasOwnProperty,H=M.toString,w=C?C.toStringTag:void 0;function V(t){var e=F.call(t,w),s=t[w];try{t[w]=void 0;var o=!0}catch{}var n=H.call(t);return o&&(e?t[w]=s:delete t[w]),n}var N=Object.prototype,W=N.toString;function Q(t){return W.call(t)}var z="[object Null]",G="[object Undefined]",v=C?C.toStringTag:void 0;function J(t){return t==null?t===void 0?G:z:v&&v in Object(t)?V(t):Q(t)}function $(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var K="[object AsyncFunction]",X="[object Function]",Y="[object GeneratorFunction]",Z="[object Proxy]";function x(t){if(!$(t))return!1;var e=J(t);return e==X||e==Y||e==K||e==Z}var S=O["__core-js_shared__"],T=(function(){var t=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ee(t){return!!T&&T in t}var te=Function.prototype,ae=te.toString;function ne(t){if(t!=null){try{return ae.call(t)}catch{}try{return t+""}catch{}}return""}var oe=/[\\^$.*+?()[\]{}|]/g,se=/^\[object .+?Constructor\]$/,re=Function.prototype,ie=Object.prototype,le=re.toString,de=ie.hasOwnProperty,ce=RegExp("^"+le.call(de).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function pe(t){if(!$(t)||ee(t))return!1;var e=x(t)?ce:se;return e.test(ne(t))}function ue(t,e){return t?.[e]}function E(t,e){var s=ue(t,e);return pe(s)?s:void 0}function ge(t,e){return t===e||t!==t&&e!==e}var m=E(Object,"create");function ye(){this.__data__=m?m(null):{},this.size=0}function he(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var fe="__lodash_hash_undefined__",we=Object.prototype,me=we.hasOwnProperty;function Ce(t){var e=this.__data__;if(m){var s=e[t];return s===fe?void 0:s}return me.call(e,t)?e[t]:void 0}var _e=Object.prototype,De=_e.hasOwnProperty;function Re(t){var e=this.__data__;return m?e[t]!==void 0:De.call(e,t)}var be="__lodash_hash_undefined__";function Oe(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=m&&e===void 0?be:e,this}function y(t){var e=-1,s=t==null?0:t.length;for(this.clear();++e<s;){var o=t[e];this.set(o[0],o[1])}}y.prototype.clear=ye,y.prototype.delete=he,y.prototype.get=Ce,y.prototype.has=Re,y.prototype.set=Oe;function Se(){this.__data__=[],this.size=0}function _(t,e){for(var s=t.length;s--;)if(ge(t[s][0],e))return s;return-1}var Ie=Array.prototype,Me=Ie.splice;function ve(t){var e=this.__data__,s=_(e,t);if(s<0)return!1;var o=e.length-1;return s==o?e.pop():Me.call(e,s,1),--this.size,!0}function $e(t){var e=this.__data__,s=_(e,t);return s<0?void 0:e[s][1]}function Te(t){return _(this.__data__,t)>-1}function Ee(t,e){var s=this.__data__,o=_(s,t);return o<0?(++this.size,s.push([t,e])):s[o][1]=e,this}function f(t){var e=-1,s=t==null?0:t.length;for(this.clear();++e<s;){var o=t[e];this.set(o[0],o[1])}}f.prototype.clear=Se,f.prototype.delete=ve,f.prototype.get=$e,f.prototype.has=Te,f.prototype.set=Ee;var Le=E(O,"Map");function ke(){this.size=0,this.__data__={hash:new y,map:new(Le||f),string:new y}}function Ae(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function D(t,e){var s=t.__data__;return Ae(e)?s[typeof e=="string"?"string":"hash"]:s.map}function Ue(t){var e=D(this,t).delete(t);return this.size-=e?1:0,e}function qe(t){return D(this,t).get(t)}function je(t){return D(this,t).has(t)}function Pe(t,e){var s=D(this,t),o=s.size;return s.set(t,e),this.size+=s.size==o?0:1,this}function h(t){var e=-1,s=t==null?0:t.length;for(this.clear();++e<s;){var o=t[e];this.set(o[0],o[1])}}h.prototype.clear=ke,h.prototype.delete=Ue,h.prototype.get=qe,h.prototype.has=je,h.prototype.set=Pe;var Be="Expected a function";function I(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Be);var s=function(){var o=arguments,n=e?e.apply(this,o):o[0],a=s.cache;if(a.has(n))return a.get(n);var i=t.apply(this,o);return s.cache=a.set(n,i)||a,i};return s.cache=new(I.Cache||h),s}I.Cache=h;const Fe=2,L=1,k="";class R{constructor(e,s,o){this.locale=e,this.queryRef=s,this.rawValue=o}static create(e,s,o){return s.query.postAggr==="count"?new He(e,s,o):new R(e,s,o)}getDecimals(e=Fe){return this.decimals??this.queryRef.query.decimals??e}getFactor(){return this.factor??this.queryRef.query.factor??(this.queryRef.tag?.variable?.factor?parseFloat(this.queryRef.tag.variable.factor):null)??(this.queryRef.variable?.factor?parseFloat(this.queryRef.variable.factor):null)??L}getUnit(){return this.unit??this.queryRef.query.unit??this.queryRef.tag?.variable?.unit??this.queryRef.variable?.unit??k}setDecimals(e){this.decimals=e}setFactor(e){this.factor=e}setUnit(e){this.unit=e}getValue(){return this.rawValue}toString(){const e=this.locale??void 0,s=I((o,n,a,i)=>{const d={style:"decimal",minimumFractionDigits:Math.floor(n),maximumFractionDigits:Math.floor(n)};return`${new Intl.NumberFormat(i,d).format(o)}${a?" "+a:""}`});return this.rawValue===null?"":this.queryRef.query.postAggr==="count"?s(this.rawValue,this.getDecimals(0),this.unit??this.queryRef.query.unit,e):this.queryRef.variable?.type==="str"?this.rawValue:this.queryRef.variable?.type==="bool"?this.rawValue?"True":"False":this.queryRef.variable?.type==="int"?s(this.rawValue,Number.isInteger(this.getFactor())?this.getDecimals(0):this.getDecimals(),this.getUnit(),e):this.queryRef.variable?.type==="float"?s(this.rawValue,this.getDecimals(),this.getUnit(),e):String(this.getValue())}}class He extends R{getFactor(){return this.factor??this.queryRef.query.factor??L}getUnit(){return this.unit??this.queryRef.query.unit??k}}function A(t){return t.map(({queryRef:s,time:o,value:n})=>{const a=new j(s.query,s.variable,s.tag),i=R.create(n.locale,a,n.rawValue);return{queryRef:a,time:o,value:i}})}class u extends Error{constructor(e="Method is not implemented"){super(e),this.name="NotImplementedError",this.message=e,this.stack=`NotImplementedError: ${e}`}}class Ve{ontimerangechange=null;onvpnclientstatuschange=null;_getApiLinks;_getDesignTokens;appData;componentBaseUrl;destroyed;mode;inputs;inputMap;timeRange;timeRangeIsAdjustable;vpnClientStatus;getDesignToken;constructor(e){this._getApiLinks=()=>new Map(e._apiLinkEntries),this._getDesignTokens=()=>new Map(e._designTokenEntries),this.appData=e.appData,this.componentBaseUrl=e.componentBaseUrl,this.destroyed=e.destroyed,this.mode=e.mode,this.inputs=e.inputs,this.inputMap=new Map(Object.entries(this.inputs)),this.timeRange=e.timeRange,this.timeRangeIsAdjustable=e.timeRangeIsAdjustable,this.vpnClientStatus=e.vpnClientStatus,this._messageHandler=this._messageHandler.bind(this),window.addEventListener("message",this._messageHandler,!1);const s=a=>this._getDesignTokens().get(a)??"";s.var=a=>`var(--uic-${a})`,this.getDesignToken=s;const o=new CSSStyleSheet,n=e._designTokenEntries.map(([a,i])=>`--uic-${a}:${i}`);o.replaceSync(`:root {${n.join(";")}}`),window.document.adoptedStyleSheets.push(o)}_messageHandler(e){if(e.source===window.parent)switch(e.data.type){case r.TimeRangeChange:this.ontimerangechange&&this.ontimerangechange(...e.data.payload);break;case r.VpnClientStatusChange:this.onvpnclientstatuschange&&this.onvpnclientstatuschange(...e.data.payload);break}}createBackendComponentClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.BackendComponentClientCreate,payload:{clientId:e}},"*"),new Ne(e)}createLoggingDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.LoggingDataClientCreate,payload:{clientId:e}},"*"),new We(e)}createObjectStorageClient(){throw new u}createResourceDataClient(){const e=crypto.randomUUID();return window.parent.postMessage({type:r.ResourceDataClientCreate,payload:{clientId:e}},"*"),new Qe(e)}createTooltip(){throw new u}destroy(){window.parent.postMessage({type:r.Destroy},"*"),window.removeEventListener("message",this._messageHandler,!1),this.destroyed=!0}getApiUrl(e,s){const o=this._getApiLinks().get(e);if(!o)throw new Error("IxApiError: entry not found");return s?Object.keys(s).sort().reduce((n,a)=>{if(n.includes(`{${a}}`))return n.replace(`{${a}}`,s[a]);const i=new URL(n);return i.searchParams.set(a,s[a]),decodeURIComponent(i.href)},o.href):o.href}navigateByUrl(e){window.parent.postMessage({type:r.NavigateByUrl,payload:{url:e}},"*")}openActionBottomSheet(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenActionBottomSheet,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenActionBottomSheetResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openActionMenu(e,s){return new Promise(o=>{window.addEventListener("message",a,!1);const n=e.getBoundingClientRect();window.parent.postMessage({type:r.OpenActionMenu,payload:{targetRect:n,options:s}},"*");function a(i){i.source===window.parent&&i.data.type===r.OpenActionMenuResult&&(window.removeEventListener("message",a,!1),o(i.data.payload.result))}})}openAlertDialog(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenAlertDialog,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenAlertDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openConfirmDialog(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenConfirmDialog,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenConfirmDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openContentDialog(e){if(typeof e.onopened=="function")throw new u('The "onopened" option is not implemented');if(typeof e.onclose=="function")throw new u('The "onclose" option is not implemented');if(e.pagination)throw new u('The "pagination" option is not implemented');return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenContentDialog,payload:{options:e.htmlContent&&typeof e.htmlContent!="string"?{...e,htmlContent:e.htmlContent.cloneNode(!0).outerHTML}:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenContentDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openFormDialog(e){return new Promise(s=>{window.addEventListener("message",o,!1),window.parent.postMessage({type:r.OpenFormDialog,payload:{options:e}},"*");function o(n){n.source===window.parent&&n.data.type===r.OpenFormDialogResult&&(window.removeEventListener("message",o,!1),s(n.data.payload.result))}})}openSelectPanel(e,s){return new Promise(o=>{window.addEventListener("message",a,!1);const n=e.getBoundingClientRect();window.parent.postMessage({type:r.OpenSelectPanel,payload:{targetRect:n,options:s}},"*");function a(i){i.source===window.parent&&i.data.type===r.OpenSelectPanelResult&&(window.removeEventListener("message",a,!1),o(i.data.payload.result))}})}openToast(...e){return new Promise(s=>{window.addEventListener("message",a,!1);const o=crypto.randomUUID(),n=typeof e[0]=="string"?{...e[1],message:e[0]}:e[0];window.parent.postMessage({type:r.OpenToast,payload:{id:o,options:n}},"*");function a(i){i.source===window.parent&&i.data.type===r.OpenToastResult&&i.data.payload.id===o&&(window.removeEventListener("message",a,!1),s(i.data.payload.result))}})}sanitizeHtml(){throw new u}saveAsFile(){throw new u}setTimeRange(e){window.parent.postMessage({type:r.SetTimeRange,payload:{timeRange:e}},"*")}showVpnStatusDetails(e){window.parent.postMessage({type:r.ShowVpnStatusDetails,payload:{agentId:e}},"*")}testVpnAccess(){throw new u}toggleVpn(e){window.parent.postMessage({type:r.ToggleVpn,payload:{agentId:e}},"*")}translate(){throw new u}}class Ne{constructor(e){this.id=e}call(e,s){return new Promise(o=>{const n=crypto.randomUUID();window.addEventListener("message",a,!1),window.parent.postMessage({type:r.BackendComponentClientCall,payload:{clientId:this.id,callId:n,functionName:e,functionArguments:s}},"*");function a(i){i.source===window.parent&&i.data.type===r.BackendComponentClientCallResult&&i.data.payload.callId===n&&(window.removeEventListener("message",a,!1),o(i.data.payload.result))}})}destroy(){window.parent.postMessage({type:r.BackendComponentClientDestroy,payload:{clientId:this.id}},"*")}}class We{constructor(e){this.id=e}query(e,s){const o=crypto.randomUUID();return window.addEventListener("message",n,!1),window.parent.postMessage({type:r.LoggingDataClientQuery,payload:{clientId:this.id,queryId:o,query:e}},"*"),()=>{window.removeEventListener("message",n,!1)};function n(a){if(a.source===window.parent&&a.data.type===r.LoggingDataClientQueryResult&&a.data.payload.queryId===o){const{results:i}=a.data.payload;if(e.length)if(!e.queries||e.format!=="csv"){const d=i.map(c=>A(c));s(d)}else throw new u;else{const d=A(i);s(d)}}}}destroy(){window.parent.postMessage({type:r.LoggingDataClientDestroy,payload:{clientId:this.id}},"*")}}class Qe{constructor(e){this.id=e}query(e,s){const o=crypto.randomUUID();return window.addEventListener("message",n,!1),window.parent.postMessage({type:r.ResourceDataClientQuery,payload:{clientId:this.id,queryId:o,query:e}},"*"),()=>{window.removeEventListener("message",n,!1)};function n(a){a.source===window.parent&&a.data.type===r.ResourceDataClientQueryResult&&a.data.payload.queryId===o&&s(a.data.payload.results)}}update(e){return new Promise(s=>{const o=crypto.randomUUID();window.addEventListener("message",n,!1),window.parent.postMessage({type:r.ResourceDataClientUpdate,payload:{clientId:this.id,updateId:o,update:e}},"*");function n(a){a.source===window.parent&&a.data.type===r.ResourceDataClientUpdated&&a.data.payload.updateId===o&&(window.removeEventListener("message",n,!1),s())}})}render(e,s){const o=crypto.randomUUID();return window.addEventListener("message",n,!1),window.parent.postMessage({type:r.ResourceDataClientRender,payload:{clientId:this.id,queryId:o,query:e}},"*"),()=>{window.removeEventListener("message",n,!1)};function n(a){a.source===window.parent&&a.data.type===r.ResourceDataClientRenderResult&&a.data.payload.queryId===o&&s(a.data.payload.results)}}destroy(){window.parent.postMessage({type:r.ResourceDataClientDestroy,payload:{clientId:this.id}},"*")}}function b(t){const e=!!(t&&t.migrateInputs);return!e&&b.__cache__?Promise.resolve(b.__cache__):new Promise(s=>{window.addEventListener("message",function o(n){if(n.source===window.parent&&n.data&&n.data.type===r.Created){let a=n.data.payload;e&&(a.inputs=t.migrateInputs(a.inputs,null));const i=new Ve(a);s(i),e||(b.__cache__=i),window.removeEventListener("message",o,!1)}},!1),window.parent.postMessage({type:r.Create},"*")})}g.connect=q,g.getComponentContext=b,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixon-cdk/iframe-adapter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0-next.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@ixon-cdk/types": "^1.
|
|
17
|
+
"@ixon-cdk/types": "^1.22.0-next.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"typescript": "~5.5.4",
|
|
21
|
-
"vite": "^
|
|
22
|
-
"vite-plugin-dts": "
|
|
21
|
+
"vite": "^7.2.6",
|
|
22
|
+
"vite-plugin-dts": "4.5.4"
|
|
23
23
|
}
|
|
24
24
|
}
|