UNPKG

forms-reactive

Version:

Reactive Form Web Component

109 lines (105 loc) 4.81 kB
import { r as registerInstance, h, H as Host, e as getElement } from './index-c364827c.js'; import { shouldUseCloseWatcher } from './hardware-back-button-a8cb5b77.js'; import { p as printIonWarning } from './index-ad7a76eb.js'; import { g as getIonMode, c as config, a as isPlatform } from './ionic-global-9c20d605.js'; import './index-51ff1772.js'; const appCss = "html.plt-mobile ion-app{user-select:none}html.plt-mobile ion-app [contenteditable]{user-select:text}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}"; const IonAppStyle0 = appCss; const App = class { constructor(hostRef) { registerInstance(this, hostRef); } componentDidLoad() { { rIC(async () => { const isHybrid = isPlatform(window, 'hybrid'); if (!config.getBoolean('_testing')) { import('./index-4766946b.js').then((module) => module.startTapClick(config)); } if (config.getBoolean('statusTap', isHybrid)) { import('./status-tap-b13263f8.js').then((module) => module.startStatusTap()); } if (config.getBoolean('inputShims', needInputShims())) { /** * needInputShims() ensures that only iOS and Android * platforms proceed into this block. */ const platform = isPlatform(window, 'ios') ? 'ios' : 'android'; import('./input-shims-dc9fe9ea.js').then((module) => module.startInputShims(config, platform)); } const hardwareBackButtonModule = await import('./hardware-back-button-a8cb5b77.js'); const supportsHardwareBackButtonEvents = isHybrid || shouldUseCloseWatcher(); if (config.getBoolean('hardwareBackButton', supportsHardwareBackButtonEvents)) { hardwareBackButtonModule.startHardwareBackButton(); } else { /** * If an app sets hardwareBackButton: false and experimentalCloseWatcher: true * then the close watcher will not be used. */ if (shouldUseCloseWatcher()) { printIonWarning('experimentalCloseWatcher was set to `true`, but hardwareBackButton was set to `false`. Both config options must be `true` for the Close Watcher API to be used.'); } hardwareBackButtonModule.blockHardwareBackButton(); } if (typeof window !== 'undefined') { import('./keyboard-e9381f78.js').then((module) => module.startKeyboardAssist(window)); } import('./focus-visible-4037a6a5.js').then((module) => (this.focusVisible = module.startFocusVisible())); }); } } /** * Used to set focus on an element that uses `ion-focusable`. * Do not use this if focusing the element as a result of a keyboard * event as the focus utility should handle this for us. This method * should be used when we want to programmatically focus an element as * a result of another user action. (Ex: We focus the first element * inside of a popover when the user presents it, but the popover is not always * presented as a result of keyboard action.) */ async setFocus(elements) { if (this.focusVisible) { this.focusVisible.setFocus(elements); } } render() { const mode = getIonMode(this); return (h(Host, { key: '96715520fd05d6f0e6fa26a8ba78792cfccd4c0a', class: { [mode]: true, 'ion-page': true, 'force-statusbar-padding': config.getBoolean('_forceStatusbarPadding'), } })); } get el() { return getElement(this); } }; const needInputShims = () => { /** * iOS always needs input shims */ const needsShimsIOS = isPlatform(window, 'ios') && isPlatform(window, 'mobile'); if (needsShimsIOS) { return true; } /** * Android only needs input shims when running * in the browser and only if the browser is using the * new Chrome 108+ resize behavior: https://developer.chrome.com/blog/viewport-resize-behavior/ */ const isAndroidMobileWeb = isPlatform(window, 'android') && isPlatform(window, 'mobileweb'); if (isAndroidMobileWeb) { return true; } return false; }; const rIC = (callback) => { if ('requestIdleCallback' in window) { window.requestIdleCallback(callback); } else { setTimeout(callback, 32); } }; App.style = IonAppStyle0; export { App as ion_app }; //# sourceMappingURL=ion-app.entry.js.map