UNPKG

forms-reactive

Version:

Reactive Form Web Component

66 lines (61 loc) 4.54 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-6e930523.js'); const index$1 = require('./index-547caae3.js'); const index$2 = require('./index-f13359cc.js'); const ionicGlobal = require('./ionic-global-59ee60c1.js'); const refresher_utils = require('./refresher.utils-27902c7b.js'); const spinnerConfigs = require('./spinner-configs-11dba05c.js'); require('./animation-38c620f1.js'); require('./index-a370c7e1.js'); require('./helpers-4dca71bf.js'); const RefresherContent = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.customHTMLEnabled = ionicGlobal.config.get('innerHTMLTemplatesEnabled', index$1.ENABLE_HTML_CONTENT_DEFAULT); this.pullingIcon = undefined; this.pullingText = undefined; this.refreshingSpinner = undefined; this.refreshingText = undefined; } componentWillLoad() { if (this.pullingIcon === undefined) { /** * The native iOS refresher uses a spinner instead of * an icon, so we need to see if this device supports * the native iOS refresher. */ const hasRubberBandScrolling = refresher_utils.supportsRubberBandScrolling(); const mode = ionicGlobal.getIonMode(this); const overflowRefresher = hasRubberBandScrolling ? 'lines' : index$2.arrowDown; this.pullingIcon = ionicGlobal.config.get('refreshingIcon', mode === 'ios' && hasRubberBandScrolling ? ionicGlobal.config.get('spinner', overflowRefresher) : 'circular'); } if (this.refreshingSpinner === undefined) { const mode = ionicGlobal.getIonMode(this); this.refreshingSpinner = ionicGlobal.config.get('refreshingSpinner', ionicGlobal.config.get('spinner', mode === 'ios' ? 'lines' : 'circular')); } } renderPullingText() { const { customHTMLEnabled, pullingText } = this; if (customHTMLEnabled) { return index.h("div", { class: "refresher-pulling-text", innerHTML: index$1.sanitizeDOMString(pullingText) }); } return index.h("div", { class: "refresher-pulling-text" }, pullingText); } renderRefreshingText() { const { customHTMLEnabled, refreshingText } = this; if (customHTMLEnabled) { return index.h("div", { class: "refresher-refreshing-text", innerHTML: index$1.sanitizeDOMString(refreshingText) }); } return index.h("div", { class: "refresher-refreshing-text" }, refreshingText); } render() { const pullingIcon = this.pullingIcon; const hasSpinner = pullingIcon != null && spinnerConfigs.SPINNERS[pullingIcon] !== undefined; const mode = ionicGlobal.getIonMode(this); return (index.h(index.Host, { key: 'fb78d7e31f8feb31025e58903eb9de85cb928dbd', class: mode }, index.h("div", { key: '23f67800f09765ef8fde8cf85a843e19e667f337', class: "refresher-pulling" }, this.pullingIcon && hasSpinner && (index.h("div", { key: '5a08d3b69762f8b51dcd3dcfbaf3fddb707257fa', class: "refresher-pulling-icon" }, index.h("div", { key: '42a613b029e092acdff7fe613a429375d89f157e', class: "spinner-arrow-container" }, index.h("ion-spinner", { key: '2f9cdc75938c4d306de7a717ed67901daef71c2c', name: this.pullingIcon, paused: true }), mode === 'md' && this.pullingIcon === 'circular' && (index.h("div", { key: '1f8a6347b4a46417ba55286a79f1a41f04bf9c91', class: "arrow-container" }, index.h("ion-icon", { key: '326713d11d482d420ba5a739ff4528400a37e9ca', icon: index$2.caretBackSharp, "aria-hidden": "true" })))))), this.pullingIcon && !hasSpinner && (index.h("div", { key: 'ab18c7cbea7bcbfa034f90f317652af4d93660ed', class: "refresher-pulling-icon" }, index.h("ion-icon", { key: 'f488acd54acc8a61b6c5a279f0d7f9a437c370c0', icon: this.pullingIcon, lazy: false, "aria-hidden": "true" }))), this.pullingText !== undefined && this.renderPullingText()), index.h("div", { key: '914ad6139442dac53af47120ea821fa11c309a38', class: "refresher-refreshing" }, this.refreshingSpinner && (index.h("div", { key: '7eba732f5e2d72b90399d68a3e89617d8979b3d1', class: "refresher-refreshing-icon" }, index.h("ion-spinner", { key: '838d66d8bef6f56622c62b1068e7fed29e094302', name: this.refreshingSpinner }))), this.refreshingText !== undefined && this.renderRefreshingText()))); } get el() { return index.getElement(this); } }; exports.ion_refresher_content = RefresherContent; //# sourceMappingURL=ion-refresher-content.cjs.entry.js.map