6feb6d4b3a0ec972eaaf80f0351ee3a72c77a53a842628908eb7d603d4322035.json 16 KB

1
  1. {"ast":null,"code":"/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';\nimport { p as printIonWarning } from './index6.js';\nimport { c as createColorClasses } from './theme.js';\nimport { l as eye, m as eyeOff } from './index7.js';\nimport { b as getIonMode } from './ionic-global.js';\nimport { d as defineCustomElement$4 } from './button.js';\nimport { d as defineCustomElement$3 } from './icon.js';\nimport { d as defineCustomElement$2 } from './ripple-effect.js';\nconst iosInputPasswordToggleCss = \"\";\nconst IonInputPasswordToggleIosStyle0 = iosInputPasswordToggleCss;\nconst mdInputPasswordToggleCss = \"\";\nconst IonInputPasswordToggleMdStyle0 = mdInputPasswordToggleCss;\nconst InputPasswordToggle = /*@__PURE__*/proxyCustomElement(class InputPasswordToggle extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.togglePasswordVisibility = () => {\n const {\n inputElRef\n } = this;\n if (!inputElRef) {\n return;\n }\n inputElRef.type = inputElRef.type === 'text' ? 'password' : 'text';\n };\n this.color = undefined;\n this.showIcon = undefined;\n this.hideIcon = undefined;\n this.type = 'password';\n }\n /**\n * Whenever the input type changes we need to re-run validation to ensure the password\n * toggle is being used with the correct input type. If the application changes the type\n * outside of this component we also need to re-render so the correct icon is shown.\n */\n onTypeChange(newValue) {\n if (newValue !== 'text' && newValue !== 'password') {\n printIonWarning(`ion-input-password-toggle only supports inputs of type \"text\" or \"password\". Input of type \"${newValue}\" is not compatible.`, this.el);\n return;\n }\n }\n connectedCallback() {\n const {\n el\n } = this;\n const inputElRef = this.inputElRef = el.closest('ion-input');\n if (!inputElRef) {\n printIonWarning('No ancestor ion-input found for ion-input-password-toggle. This component must be slotted inside of an ion-input.', el);\n return;\n }\n /**\n * Important: Set the type in connectedCallback because the default value\n * of this.type may not always be accurate. Usually inputs have the \"password\" type\n * but it is possible to have the input to initially have the \"text\" type. In that scenario\n * the wrong icon will show briefly before switching to the correct icon. Setting the\n * type here allows us to avoid that flicker.\n */\n this.type = inputElRef.type;\n }\n disconnectedCallback() {\n this.inputElRef = null;\n }\n render() {\n var _a, _b;\n const {\n color,\n type\n } = this;\n const mode = getIonMode(this);\n const showPasswordIcon = (_a = this.showIcon) !== null && _a !== void 0 ? _a : eye;\n const hidePasswordIcon = (_b = this.hideIcon) !== null && _b !== void 0 ? _b : eyeOff;\n const isPasswordVisible = type === 'text';\n return h(Host, {\n key: 'd9811e25bfeb2aa197352bb9be852e9e420739d5',\n class: createColorClasses(color, {\n [mode]: true\n })\n }, h(\"ion-button\", {\n key: '1eaea1442b248fb2b8d61538b27274e647a07804',\n mode: mode,\n color: color,\n fill: \"clear\",\n shape: \"round\",\n \"aria-checked\": isPasswordVisible ? 'true' : 'false',\n \"aria-label\": \"show password\",\n role: \"switch\",\n type: \"button\",\n onPointerDown: ev => {\n /**\n * This prevents mobile browsers from\n * blurring the input when the password toggle\n * button is activated.\n */\n ev.preventDefault();\n },\n onClick: this.togglePasswordVisibility\n }, h(\"ion-icon\", {\n key: '9c88de8f4631d9bde222ce2edf6950d639e04773',\n slot: \"icon-only\",\n \"aria-hidden\": \"true\",\n icon: isPasswordVisible ? hidePasswordIcon : showPasswordIcon\n })));\n }\n get el() {\n return this;\n }\n static get watchers() {\n return {\n \"type\": [\"onTypeChange\"]\n };\n }\n static get style() {\n return {\n ios: IonInputPasswordToggleIosStyle0,\n md: IonInputPasswordToggleMdStyle0\n };\n }\n}, [33, \"ion-input-password-toggle\", {\n \"color\": [513],\n \"showIcon\": [1, \"show-icon\"],\n \"hideIcon\": [1, \"hide-icon\"],\n \"type\": [1025]\n}, undefined, {\n \"type\": [\"onTypeChange\"]\n}]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"ion-input-password-toggle\", \"ion-button\", \"ion-icon\", \"ion-ripple-effect\"];\n components.forEach(tagName => {\n switch (tagName) {\n case \"ion-input-password-toggle\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, InputPasswordToggle);\n }\n break;\n case \"ion-button\":\n if (!customElements.get(tagName)) {\n defineCustomElement$4();\n }\n break;\n case \"ion-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$3();\n }\n break;\n case \"ion-ripple-effect\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n }\n });\n}\nconst IonInputPasswordToggle = InputPasswordToggle;\nconst defineCustomElement = defineCustomElement$1;\nexport { IonInputPasswordToggle, defineCustomElement };","map":{"version":3,"names":["proxyCustomElement","HTMLElement","h","Host","p","printIonWarning","c","createColorClasses","l","eye","m","eyeOff","b","getIonMode","d","defineCustomElement$4","defineCustomElement$3","defineCustomElement$2","iosInputPasswordToggleCss","IonInputPasswordToggleIosStyle0","mdInputPasswordToggleCss","IonInputPasswordToggleMdStyle0","InputPasswordToggle","constructor","__registerHost","__attachShadow","togglePasswordVisibility","inputElRef","type","color","undefined","showIcon","hideIcon","onTypeChange","newValue","el","connectedCallback","closest","disconnectedCallback","render","_a","_b","mode","showPasswordIcon","hidePasswordIcon","isPasswordVisible","key","class","fill","shape","role","onPointerDown","ev","preventDefault","onClick","slot","icon","watchers","style","ios","md","defineCustomElement$1","customElements","components","forEach","tagName","get","define","IonInputPasswordToggle","defineCustomElement"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@ionic/core/components/ion-input-password-toggle.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';\nimport { p as printIonWarning } from './index6.js';\nimport { c as createColorClasses } from './theme.js';\nimport { l as eye, m as eyeOff } from './index7.js';\nimport { b as getIonMode } from './ionic-global.js';\nimport { d as defineCustomElement$4 } from './button.js';\nimport { d as defineCustomElement$3 } from './icon.js';\nimport { d as defineCustomElement$2 } from './ripple-effect.js';\n\nconst iosInputPasswordToggleCss = \"\";\nconst IonInputPasswordToggleIosStyle0 = iosInputPasswordToggleCss;\n\nconst mdInputPasswordToggleCss = \"\";\nconst IonInputPasswordToggleMdStyle0 = mdInputPasswordToggleCss;\n\nconst InputPasswordToggle = /*@__PURE__*/ proxyCustomElement(class InputPasswordToggle extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.togglePasswordVisibility = () => {\n const { inputElRef } = this;\n if (!inputElRef) {\n return;\n }\n inputElRef.type = inputElRef.type === 'text' ? 'password' : 'text';\n };\n this.color = undefined;\n this.showIcon = undefined;\n this.hideIcon = undefined;\n this.type = 'password';\n }\n /**\n * Whenever the input type changes we need to re-run validation to ensure the password\n * toggle is being used with the correct input type. If the application changes the type\n * outside of this component we also need to re-render so the correct icon is shown.\n */\n onTypeChange(newValue) {\n if (newValue !== 'text' && newValue !== 'password') {\n printIonWarning(`ion-input-password-toggle only supports inputs of type \"text\" or \"password\". Input of type \"${newValue}\" is not compatible.`, this.el);\n return;\n }\n }\n connectedCallback() {\n const { el } = this;\n const inputElRef = (this.inputElRef = el.closest('ion-input'));\n if (!inputElRef) {\n printIonWarning('No ancestor ion-input found for ion-input-password-toggle. This component must be slotted inside of an ion-input.', el);\n return;\n }\n /**\n * Important: Set the type in connectedCallback because the default value\n * of this.type may not always be accurate. Usually inputs have the \"password\" type\n * but it is possible to have the input to initially have the \"text\" type. In that scenario\n * the wrong icon will show briefly before switching to the correct icon. Setting the\n * type here allows us to avoid that flicker.\n */\n this.type = inputElRef.type;\n }\n disconnectedCallback() {\n this.inputElRef = null;\n }\n render() {\n var _a, _b;\n const { color, type } = this;\n const mode = getIonMode(this);\n const showPasswordIcon = (_a = this.showIcon) !== null && _a !== void 0 ? _a : eye;\n const hidePasswordIcon = (_b = this.hideIcon) !== null && _b !== void 0 ? _b : eyeOff;\n const isPasswordVisible = type === 'text';\n return (h(Host, { key: 'd9811e25bfeb2aa197352bb9be852e9e420739d5', class: createColorClasses(color, {\n [mode]: true,\n }) }, h(\"ion-button\", { key: '1eaea1442b248fb2b8d61538b27274e647a07804', mode: mode, color: color, fill: \"clear\", shape: \"round\", \"aria-checked\": isPasswordVisible ? 'true' : 'false', \"aria-label\": \"show password\", role: \"switch\", type: \"button\", onPointerDown: (ev) => {\n /**\n * This prevents mobile browsers from\n * blurring the input when the password toggle\n * button is activated.\n */\n ev.preventDefault();\n }, onClick: this.togglePasswordVisibility }, h(\"ion-icon\", { key: '9c88de8f4631d9bde222ce2edf6950d639e04773', slot: \"icon-only\", \"aria-hidden\": \"true\", icon: isPasswordVisible ? hidePasswordIcon : showPasswordIcon }))));\n }\n get el() { return this; }\n static get watchers() { return {\n \"type\": [\"onTypeChange\"]\n }; }\n static get style() { return {\n ios: IonInputPasswordToggleIosStyle0,\n md: IonInputPasswordToggleMdStyle0\n }; }\n}, [33, \"ion-input-password-toggle\", {\n \"color\": [513],\n \"showIcon\": [1, \"show-icon\"],\n \"hideIcon\": [1, \"hide-icon\"],\n \"type\": [1025]\n }, undefined, {\n \"type\": [\"onTypeChange\"]\n }]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"ion-input-password-toggle\", \"ion-button\", \"ion-icon\", \"ion-ripple-effect\"];\n components.forEach(tagName => { switch (tagName) {\n case \"ion-input-password-toggle\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, InputPasswordToggle);\n }\n break;\n case \"ion-button\":\n if (!customElements.get(tagName)) {\n defineCustomElement$4();\n }\n break;\n case \"ion-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$3();\n }\n break;\n case \"ion-ripple-effect\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n } });\n}\n\nconst IonInputPasswordToggle = InputPasswordToggle;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { IonInputPasswordToggle, defineCustomElement };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,kBAAkB,EAAEC,WAAW,EAAEC,CAAC,EAAEC,IAAI,QAAQ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