UNPKG

forms-reactive

Version:

Reactive Form Web Component

2 lines 1.78 kB
import{r as t,h as o,H as s,e}from"./p-3e1171f6.js";import{p as n}from"./p-8613551a.js";import{c as i}from"./p-100c2286.js";import{o as r,p as a}from"./p-6a27012a.js";import{g as c}from"./p-9c83f640.js";const p="";const d=p;const l="";const u=l;const h=class{constructor(o){t(this,o);this.togglePasswordVisibility=()=>{const{inputElRef:t}=this;if(!t){return}t.type=t.type==="text"?"password":"text"};this.color=undefined;this.showIcon=undefined;this.hideIcon=undefined;this.type="password"}onTypeChange(t){if(t!=="text"&&t!=="password"){n(`ion-input-password-toggle only supports inputs of type "text" or "password". Input of type "${t}" is not compatible.`,this.el);return}}connectedCallback(){const{el:t}=this;const o=this.inputElRef=t.closest("ion-input");if(!o){n("No ancestor ion-input found for ion-input-password-toggle. This component must be slotted inside of an ion-input.",t);return}this.type=o.type}disconnectedCallback(){this.inputElRef=null}render(){var t,e;const{color:n,type:p}=this;const d=c(this);const l=(t=this.showIcon)!==null&&t!==void 0?t:r;const u=(e=this.hideIcon)!==null&&e!==void 0?e:a;const h=p==="text";return o(s,{key:"d9811e25bfeb2aa197352bb9be852e9e420739d5",class:i(n,{[d]:true})},o("ion-button",{key:"1eaea1442b248fb2b8d61538b27274e647a07804",mode:d,color:n,fill:"clear",shape:"round","aria-checked":h?"true":"false","aria-label":"show password",role:"switch",type:"button",onPointerDown:t=>{t.preventDefault()},onClick:this.togglePasswordVisibility},o("ion-icon",{key:"9c88de8f4631d9bde222ce2edf6950d639e04773",slot:"icon-only","aria-hidden":"true",icon:h?u:l})))}get el(){return e(this)}static get watchers(){return{type:["onTypeChange"]}}};h.style={ios:d,md:u};export{h as ion_input_password_toggle}; //# sourceMappingURL=p-f9ae2167.entry.js.map