-
Notifications
You must be signed in to change notification settings - Fork 0
/
887.55317b592cf28f403a39.js
1 lines (1 loc) · 4.89 KB
/
887.55317b592cf28f403a39.js
1
"use strict";(self.webpackChunksparkworks_console=self.webpackChunksparkworks_console||[]).push([[887],{99887:function(g,h,r){r.r(h),r.d(h,{amplify_form_field:function(){return p},amplify_hint:function(){return f},amplify_input:function(){return c},amplify_label:function(){return m}});var l=r(75134),s=r(47289),e=r(65513),d=(r(82073),r(30031),r(36755)),p=function(){function o(t){(0,l.Z)(this,o),(0,e.r)(this,t),this.type="text",this.required=!1,this.placeholder=""}return(0,s.Z)(o,[{key:"render",value:function(){return(0,e.h)("div",{class:"form-field"},this.label&&(0,e.h)("div",{class:"form-field-label"},(0,e.h)("amplify-label",{htmlFor:this.fieldId},this.label)),this.description&&(0,e.h)("div",{id:"".concat(this.fieldId,"-description"),class:"form-field-description","data-test":"form-field-description"},this.description),(0,e.h)("div",null,(0,e.h)("slot",{name:"input"},(0,e.h)("amplify-input",{fieldId:this.fieldId,description:this.description,type:this.type,handleInputChange:this.handleInputChange,placeholder:this.placeholder,name:this.name,value:this.value,inputProps:this.inputProps,disabled:this.disabled,required:this.required}))),this.hint&&(0,e.h)("amplify-hint",{id:"".concat(this.fieldId,"-hint")},this.hint))}}]),o}();p.style="amplify-form-field{--label-font-size:var(--amplify-text-md);--description-font-size:var(--amplify-text-sm)}.form-field{margin-bottom:15px}.form-field-label{display:block;font-size:var(--label-font-size);padding-bottom:0.5em}.form-field-description{font-size:var(--description-font-size);padding-top:0.5em}";var f=function(){function o(t){(0,l.Z)(this,o),(0,e.r)(this,t)}return(0,s.Z)(o,[{key:"render",value:function(){return(0,e.h)("div",{class:"hint"},(0,e.h)("slot",null))}}]),o}();f.style=":host{--color:var(--amplify-grey);--font-family:var(--amplify-font-family);--font-size:var(--amplify-text-xs);--font-weight:var(--amplify-font-weight)}.hint{color:var(--color);font-family:var(--font-family);font-weight:var(--font-weight);font-size:var(--font-size);margin-bottom:2.625rem}";var c=function(){function o(t){(0,l.Z)(this,o),(0,e.r)(this,t),this.type="text",this.handleInputChange=function(){},this.placeholder="",this.required=!1,this.autoCompleted=!1}return(0,s.Z)(o,[{key:"setAutoCompleteValue",value:function(i){var n=this.el.querySelector("input");!n||(n.value=i,n.dispatchEvent(new Event("input")),this.autoCompleted=!0)}},{key:"checkAutoCompletion",value:function(i){var n=this;!i||(i.value?this.setAutoCompleteValue(i.value):i.addEventListener("input",function(a){n.setAutoCompleteValue(a.target.value)}))}},{key:"disconnectedCallback",value:function(){this.removeHubListener&&this.removeHubListener()}},{key:"componentWillLoad",value:function(){var i=this;!(0,d.e)("amplify-authenticator",this.el)||(this.removeHubListener=(0,d.o)(function(){var n=i.el.querySelector("input");n&&(n.value=""),i.autoCompleted=!1}))}},{key:"componentDidLoad",value:function(){if(!this.autoCompleted&&!this.value&&!/Firefox/.test(navigator.userAgent)){var i=(0,d.e)("amplify-auth-container",this.el),n=(0,d.e)("amplify-sign-in",this.el);if(i&&n){var a=i.querySelector("input[name='username']"),u=i.querySelector("input[name='password']");"username"===this.name||"email"===this.name||"phone"===this.name?this.checkAutoCompletion(a):"password"===this.name&&this.checkAutoCompletion(u)}}}},{key:"render",value:function(){var i=this;return(0,e.h)(e.H,{class:"input-host"},(0,e.h)("input",Object.assign({id:this.fieldId,"aria-describedby":this.fieldId&&this.description?"".concat(this.fieldId,"-description"):null,"data-autocompleted":this.autoCompleted,type:this.type,onInput:function(a){i.autoCompleted=!1,i.handleInputChange(a)},placeholder:this.placeholder,name:this.name,class:"input",value:this.value,disabled:this.disabled,required:this.required},this.inputProps)))}},{key:"el",get:function(){return(0,e.g)(this)}}]),o}();c.style="amplify-input{--color:var(--amplify-secondary-color);--background-color:var(--amplify-secondary-contrast);--border-color:var(--amplify-light-grey);--border-color-focus:var(--amplify-primary-color);--border:1px solid var(--border-color);--margin:0 0 0.625rem 0}[data-autocompleted]{background-color:#e8f0fe !important}.input-host{width:100%}.input{display:block;width:100%;padding:1rem;font-size:var(--amplify-text-sm);color:var(--color);background-color:var(--background-color);background-image:none;border:var(--border);border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:var(--margin);height:3.125rem;line-height:1.1;-webkit-box-shadow:none;box-shadow:none}.input:focus{outline:none;border-color:var(--border-color-focus)}.input:disabled{opacity:0.5}";var m=function(){function o(t){(0,l.Z)(this,o),(0,e.r)(this,t)}return(0,s.Z)(o,[{key:"render",value:function(){return(0,e.h)("label",{class:"label",htmlFor:this.htmlFor},(0,e.h)("slot",null))}}]),o}();m.style=":host{--label-color:var(--amplify-secondary-color)}.label{color:var(--label-color);font-size:var(--amplify-text-sm);margin-bottom:16px}"}}]);