UNPKG

@aws-amplify/amplify-appsync-simulator

Version:

An AppSync Simulator to test AppSync API.

2 lines 2.4 kB
(self.webpackChunk_aws_amplify_amplify_graphiql_explorer=self.webpackChunk_aws_amplify_amplify_graphiql_explorer||[]).push([[976],{5976:(e,n,o)=>{!function(e){function n(n,o,t){var i,l=n.getWrapperElement();return(i=l.appendChild(document.createElement("div"))).className=t?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof o?i.innerHTML=o:i.appendChild(o),e.addClass(l,"dialog-opened"),i}function o(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}e.defineExtension("openDialog",(function(t,i,l){l||(l={}),o(this,null);var a=n(this,t,l.bottom),r=!1,u=this;function s(n){if("string"==typeof n)f.value=n;else{if(r)return;r=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),u.focus(),l.onClose&&l.onClose(a)}}var c,f=a.getElementsByTagName("input")[0];return f?(f.focus(),l.value&&(f.value=l.value,!1!==l.selectValueOnOpen&&f.select()),l.onInput&&e.on(f,"input",(function(e){l.onInput(e,f.value,s)})),l.onKeyUp&&e.on(f,"keyup",(function(e){l.onKeyUp(e,f.value,s)})),e.on(f,"keydown",(function(n){l&&l.onKeyDown&&l.onKeyDown(n,f.value,s)||((27==n.keyCode||!1!==l.closeOnEnter&&13==n.keyCode)&&(f.blur(),e.e_stop(n),s()),13==n.keyCode&&i(f.value,n))})),!1!==l.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&s()}))):(c=a.getElementsByTagName("button")[0])&&(e.on(c,"click",(function(){s(),u.focus()})),!1!==l.closeOnBlur&&e.on(c,"blur",s),c.focus()),s})),e.defineExtension("openConfirm",(function(t,i,l){o(this,null);var a=n(this,t,l&&l.bottom),r=a.getElementsByTagName("button"),u=!1,s=this,c=1;function f(){u||(u=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),s.focus())}r[0].focus();for(var d=0;d<r.length;++d){var p=r[d];!function(n){e.on(p,"click",(function(o){e.e_preventDefault(o),f(),n&&n(s)}))}(i[d]),e.on(p,"blur",(function(){--c,setTimeout((function(){c<=0&&f()}),200)})),e.on(p,"focus",(function(){++c}))}})),e.defineExtension("openNotification",(function(t,i){o(this,s);var l,a=n(this,t,i&&i.bottom),r=!1,u=i&&"undefined"!==typeof i.duration?i.duration:5e3;function s(){r||(r=!0,clearTimeout(l),e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a))}return e.on(a,"click",(function(n){e.e_preventDefault(n),s()})),u&&(l=setTimeout(s,u)),s}))}(o(8355))}}]); //# sourceMappingURL=976.a1b82232.chunk.js.map