UNPKG

kre-form

Version:

本项目由 Angular8+ 编写的表单设计器和表单应用,所有的配置都是 JSON 结构体组成,PC 端是基于 ANT 组件库封装

713 lines (702 loc) 81.1 kB
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{ /***/ "./node_modules/@ionic/core/dist/esm-es5/ion-app_8.entry.js": /*!******************************************************************!*\ !*** ./node_modules/@ionic/core/dist/esm-es5/ion-app_8.entry.js ***! \******************************************************************/ /*! exports provided: ion_app, ion_buttons, ion_content, ion_footer, ion_header, ion_router_outlet, ion_title, ion_toolbar */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_app", function() { return App; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_buttons", function() { return Buttons; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_content", function() { return Content; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_footer", function() { return Footer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_header", function() { return Header; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_router_outlet", function() { return RouterOutlet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_title", function() { return ToolbarTitle; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_toolbar", function() { return Toolbar; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _index_92848855_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index-92848855.js */ "./node_modules/@ionic/core/dist/esm-es5/index-92848855.js"); /* harmony import */ var _ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ionic-global-23e7365a.js */ "./node_modules/@ionic/core/dist/esm-es5/ionic-global-23e7365a.js"); /* harmony import */ var _helpers_5c745fbd_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers-5c745fbd.js */ "./node_modules/@ionic/core/dist/esm-es5/helpers-5c745fbd.js"); /* harmony import */ var _index_9b2fc761_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./index-9b2fc761.js */ "./node_modules/@ionic/core/dist/esm-es5/index-9b2fc761.js"); /* harmony import */ var _cubic_bezier_685f606a_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cubic-bezier-685f606a.js */ "./node_modules/@ionic/core/dist/esm-es5/cubic-bezier-685f606a.js"); /* harmony import */ var _theme_5641d27f_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./theme-5641d27f.js */ "./node_modules/@ionic/core/dist/esm-es5/theme-5641d27f.js"); /* harmony import */ var _framework_delegate_d1eb6504_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./framework-delegate-d1eb6504.js */ "./node_modules/@ionic/core/dist/esm-es5/framework-delegate-d1eb6504.js"); var appCss = "html.plt-mobile ion-app{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}"; var App = /** @class */ (function () { function App(hostRef) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["r"])(this, hostRef); } App.prototype.componentDidLoad = function () { { rIC(function () { var isHybrid = Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["i"])(window, 'hybrid'); if (!_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"].getBoolean('_testing')) { __webpack_require__.e(/*! import() | tap-click-252af35a-js */ "tap-click-252af35a-js").then(__webpack_require__.bind(null, /*! ./tap-click-252af35a.js */ "./node_modules/@ionic/core/dist/esm-es5/tap-click-252af35a.js")).then(function (module) { return module.startTapClick(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"]); }); } if (_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"].getBoolean('statusTap', isHybrid)) { __webpack_require__.e(/*! import() | status-tap-0b3e89c4-js */ "status-tap-0b3e89c4-js").then(__webpack_require__.bind(null, /*! ./status-tap-0b3e89c4.js */ "./node_modules/@ionic/core/dist/esm-es5/status-tap-0b3e89c4.js")).then(function (module) { return module.startStatusTap(); }); } if (_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"].getBoolean('inputShims', needInputShims())) { __webpack_require__.e(/*! import() | input-shims-4f0dbb39-js */ "input-shims-4f0dbb39-js").then(__webpack_require__.bind(null, /*! ./input-shims-4f0dbb39.js */ "./node_modules/@ionic/core/dist/esm-es5/input-shims-4f0dbb39.js")).then(function (module) { return module.startInputShims(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"]); }); } if (_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"].getBoolean('hardwareBackButton', isHybrid)) { Promise.resolve(/*! import() */).then(__webpack_require__.bind(null, /*! ./hardware-back-button-7b6ede21.js */ "./node_modules/@ionic/core/dist/esm-es5/hardware-back-button-7b6ede21.js")).then(function (module) { return module.startHardwareBackButton(); }); } if (typeof window !== 'undefined') { __webpack_require__.e(/*! import() | keyboard-dd970efc-js */ "keyboard-dd970efc-js").then(__webpack_require__.bind(null, /*! ./keyboard-dd970efc.js */ "./node_modules/@ionic/core/dist/esm-es5/keyboard-dd970efc.js")).then(function (module) { return module.startKeyboardAssist(window); }); } __webpack_require__.e(/*! import() | focus-visible-15ada7f7-js */ "focus-visible-15ada7f7-js").then(__webpack_require__.bind(null, /*! ./focus-visible-15ada7f7.js */ "./node_modules/@ionic/core/dist/esm-es5/focus-visible-15ada7f7.js")).then(function (module) { return module.startFocusVisible(); }); }); } }; App.prototype.render = function () { var _a; var mode = Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["b"])(this); return (Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["H"], { class: (_a = {}, _a[mode] = true, _a['ion-page'] = true, _a['force-statusbar-padding'] = _ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"].getBoolean('_forceStatusbarPadding'), _a) })); }; Object.defineProperty(App.prototype, "el", { get: function () { return Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["i"])(this); }, enumerable: false, configurable: true }); return App; }()); var needInputShims = function () { return Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["i"])(window, 'ios') && Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["i"])(window, 'mobile'); }; var rIC = function (callback) { if ('requestIdleCallback' in window) { window.requestIdleCallback(callback); } else { setTimeout(callback, 32); } }; App.style = appCss; var buttonsIosCss = ".sc-ion-buttons-ios-h{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:99}.sc-ion-buttons-ios-s ion-button{--padding-top:0;--padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-buttons-ios-s ion-button{--padding-start:5px;--padding-end:5px;margin-left:2px;margin-right:2px;height:32px;font-size:17px;font-weight:400}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-ios-s ion-button{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}.sc-ion-buttons-ios-s ion-button:not(.button-round){--border-radius:4px}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button{--color:initial;--border-color:initial;--background-focused:var(--ion-color-contrast)}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button-solid,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button-solid{--background:var(--ion-color-contrast);--background-focused:#000;--background-focused-opacity:.12;--background-activated:#000;--background-activated-opacity:.12;--background-hover:var(--ion-color-base);--background-hover-opacity:0.45;--color:var(--ion-color-base);--color-focused:var(--ion-color-base)}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button-clear,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button-clear{--color-activated:var(--ion-color-contrast);--color-focused:var(--ion-color-contrast)}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button-outline,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button-outline{--color-activated:var(--ion-color-base);--color-focused:var(--ion-color-contrast)}.sc-ion-buttons-ios-s .button-clear,.sc-ion-buttons-ios-s .button-outline{--background-activated:transparent;--background-focused:currentColor;--background-hover:transparent}.sc-ion-buttons-ios-s .button-solid:not(.ion-color){--background-focused:#000;--background-focused-opacity:.12;--background-activated:#000;--background-activated-opacity:.12}.sc-ion-buttons-ios-s ion-icon[slot=start]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-right:0.3em;font-size:24px;line-height:0.67}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-ios-s ion-icon[slot=start]{margin-right:unset;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}.sc-ion-buttons-ios-s ion-icon[slot=end]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-left:0.4em;font-size:24px;line-height:0.67}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-ios-s ion-icon[slot=end]{margin-left:unset;-webkit-margin-start:0.4em;margin-inline-start:0.4em}}.sc-ion-buttons-ios-s ion-icon[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;font-size:28px;line-height:0.67}"; var buttonsMdCss = ".sc-ion-buttons-md-h{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:99}.sc-ion-buttons-md-s ion-button{--padding-top:0;--padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-buttons-md-s ion-button{--padding-top:0;--padding-bottom:0;--padding-start:8px;--padding-end:8px;--box-shadow:none;margin-left:2px;margin-right:2px;height:32px;font-size:14px;font-weight:500}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-md-s ion-button{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}.sc-ion-buttons-md-s ion-button:not(.button-round){--border-radius:2px}.sc-ion-buttons-md-h.ion-color.sc-ion-buttons-md-s .button,.ion-color .sc-ion-buttons-md-h.sc-ion-buttons-md-s .button{--color:initial;--color-focused:var(--ion-color-contrast);--color-hover:var(--ion-color-contrast);--background-activated:transparent;--background-focused:var(--ion-color-contrast);--background-hover:var(--ion-color-contrast)}.sc-ion-buttons-md-h.ion-color.sc-ion-buttons-md-s .button-solid,.ion-color .sc-ion-buttons-md-h.sc-ion-buttons-md-s .button-solid{--background:var(--ion-color-contrast);--background-activated:transparent;--background-focused:var(--ion-color-shade);--background-hover:var(--ion-color-base);--color:var(--ion-color-base);--color-focused:var(--ion-color-base);--color-hover:var(--ion-color-base)}.sc-ion-buttons-md-h.ion-color.sc-ion-buttons-md-s .button-outline,.ion-color .sc-ion-buttons-md-h.sc-ion-buttons-md-s .button-outline{--border-color:var(--ion-color-contrast)}.sc-ion-buttons-md-s .button-has-icon-only.button-clear{--padding-top:12px;--padding-end:12px;--padding-bottom:12px;--padding-start:12px;--border-radius:50%;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:48px;height:48px}.sc-ion-buttons-md-s .button{--background-hover:currentColor}.sc-ion-buttons-md-s .button-solid{--color:var(--ion-toolbar-background, var(--ion-background-color, #fff));--background:var(--ion-toolbar-color, var(--ion-text-color, #424242));--background-activated:transparent;--background-focused:currentColor}.sc-ion-buttons-md-s .button-outline{--color:initial;--background:transparent;--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--border-color:currentColor}.sc-ion-buttons-md-s .button-clear{--color:initial;--background:transparent;--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor}.sc-ion-buttons-md-s ion-icon[slot=start]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-right:0.3em;font-size:1.4em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-md-s ion-icon[slot=start]{margin-right:unset;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}.sc-ion-buttons-md-s ion-icon[slot=end]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-left:0.4em;font-size:1.4em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-md-s ion-icon[slot=end]{margin-left:unset;-webkit-margin-start:0.4em;margin-inline-start:0.4em}}.sc-ion-buttons-md-s ion-icon[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;font-size:1.8em}"; var Buttons = /** @class */ (function () { function Buttons(hostRef) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["r"])(this, hostRef); /** * If true, buttons will disappear when its * parent toolbar has fully collapsed if the toolbar * is not the first toolbar. If the toolbar is the * first toolbar, the buttons will be hidden and will * only be shown once all toolbars have fully collapsed. * * Only applies in `ios` mode with `collapse` set to * `true` on `ion-header`. * * Typically used for [Collapsible Large Titles](https://ionicframework.com/docs/api/title#collapsible-large-titles) */ this.collapse = false; } Buttons.prototype.render = function () { var _a; var mode = Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["b"])(this); return (Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["H"], { class: (_a = {}, _a[mode] = true, _a['buttons-collapse'] = this.collapse, _a) })); }; return Buttons; }()); Buttons.style = { ios: buttonsIosCss, md: buttonsMdCss }; var contentCss = ":host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;-ms-flex:1;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.outer-content){--background:var(--ion-color-step-50, #f2f2f2)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.inner-scroll{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;will-change:scroll-position}.scroll-y{-ms-touch-action:pan-y;touch-action:pan-y;overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{-ms-touch-action:pan-x;touch-action:pan-x;overflow-x:var(--overflow);overscroll-behavior-x:contain}.scroll-x.scroll-y{-ms-touch-action:auto;touch-action:auto}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:\"\"}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){contain:none}:host(.content-sizing) .inner-scroll{position:relative}.transition-effect{display:none;position:absolute;left:-100%;width:100%;height:100vh;opacity:0;pointer-events:none}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;right:0;width:10px;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTE3MDgzRkQ5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTE3MDgzRkU5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMTcwODNGQjlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMTcwODNGQzlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmePEuQAAABNSURBVHjaYvz//z8DIxAwMDAwATGMhmFmPDQuOSZks0AMmoJBaQHjkPfB0Lfg/2gQjVow+HPy/yHvg9GiYjQfjMbBqAWjFgy/4hogwADYqwdzxy5BuwAAAABJRU5ErkJggg==);background-repeat:repeat-y;background-size:10px 16px}::slotted([slot=fixed]){position:absolute}"; var Content = /** @class */ (function () { function class_1(hostRef) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["r"])(this, hostRef); this.ionScrollStart = Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["e"])(this, "ionScrollStart", 7); this.ionScroll = Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["e"])(this, "ionScroll", 7); this.ionScrollEnd = Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["e"])(this, "ionScrollEnd", 7); this.isScrolling = false; this.lastScroll = 0; this.queued = false; this.cTop = -1; this.cBottom = -1; // Detail is used in a hot loop in the scroll event, by allocating it here // V8 will be able to inline any read/write to it since it's a monomorphic class. // https://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.html this.detail = { scrollTop: 0, scrollLeft: 0, type: 'scroll', event: undefined, startX: 0, startY: 0, startTime: 0, currentX: 0, currentY: 0, velocityX: 0, velocityY: 0, deltaX: 0, deltaY: 0, currentTime: 0, data: undefined, isScrolling: true, }; /** * If `true`, the content will scroll behind the headers * and footers. This effect can easily be seen by setting the toolbar * to transparent. */ this.fullscreen = false; /** * If you want to enable the content scrolling in the X axis, set this property to `true`. */ this.scrollX = false; /** * If you want to disable the content scrolling in the Y axis, set this property to `false`. */ this.scrollY = true; /** * Because of performance reasons, ionScroll events are disabled by default, in order to enable them * and start listening from (ionScroll), set this property to `true`. */ this.scrollEvents = false; } class_1.prototype.disconnectedCallback = function () { this.onScrollEnd(); }; class_1.prototype.onAppLoad = function () { this.resize(); }; class_1.prototype.onClick = function (ev) { if (this.isScrolling) { ev.preventDefault(); ev.stopPropagation(); } }; class_1.prototype.shouldForceOverscroll = function () { var forceOverscroll = this.forceOverscroll; var mode = Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["b"])(this); return forceOverscroll === undefined ? mode === 'ios' && Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["i"])('ios') : forceOverscroll; }; class_1.prototype.resize = function () { var _this = this; if (this.fullscreen) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["f"])(function () { return _this.readDimensions(); }); } else if (this.cTop !== 0 || this.cBottom !== 0) { this.cTop = this.cBottom = 0; Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["j"])(this); } }; class_1.prototype.readDimensions = function () { var page = getPageElement(this.el); var top = Math.max(this.el.offsetTop, 0); var bottom = Math.max(page.offsetHeight - top - this.el.offsetHeight, 0); var dirty = top !== this.cTop || bottom !== this.cBottom; if (dirty) { this.cTop = top; this.cBottom = bottom; Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["j"])(this); } }; class_1.prototype.onScroll = function (ev) { var _this = this; var timeStamp = Date.now(); var shouldStart = !this.isScrolling; this.lastScroll = timeStamp; if (shouldStart) { this.onScrollStart(); } if (!this.queued && this.scrollEvents) { this.queued = true; Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["f"])(function (ts) { _this.queued = false; _this.detail.event = ev; updateScrollDetail(_this.detail, _this.scrollEl, ts, shouldStart); _this.ionScroll.emit(_this.detail); }); } }; /** * Get the element where the actual scrolling takes place. * This element can be used to subscribe to `scroll` events or manually modify * `scrollTop`. However, it's recommended to use the API provided by `ion-content`: * * i.e. Using `ionScroll`, `ionScrollStart`, `ionScrollEnd` for scrolling events * and `scrollToPoint()` to scroll the content into a certain point. */ class_1.prototype.getScrollElement = function () { return Promise.resolve(this.scrollEl); }; /** * Scroll to the top of the component. * * @param duration The amount of time to take scrolling to the top. Defaults to `0`. */ class_1.prototype.scrollToTop = function (duration) { if (duration === void 0) { duration = 0; } return this.scrollToPoint(undefined, 0, duration); }; /** * Scroll to the bottom of the component. * * @param duration The amount of time to take scrolling to the bottom. Defaults to `0`. */ class_1.prototype.scrollToBottom = function (duration) { if (duration === void 0) { duration = 0; } var y = this.scrollEl.scrollHeight - this.scrollEl.clientHeight; return this.scrollToPoint(undefined, y, duration); }; /** * Scroll by a specified X/Y distance in the component. * * @param x The amount to scroll by on the horizontal axis. * @param y The amount to scroll by on the vertical axis. * @param duration The amount of time to take scrolling by that amount. */ class_1.prototype.scrollByPoint = function (x, y, duration) { return this.scrollToPoint(x + this.scrollEl.scrollLeft, y + this.scrollEl.scrollTop, duration); }; /** * Scroll to a specified X/Y location in the component. * * @param x The point to scroll to on the horizontal axis. * @param y The point to scroll to on the vertical axis. * @param duration The amount of time to take scrolling to that point. Defaults to `0`. */ class_1.prototype.scrollToPoint = function (x, y, duration) { if (duration === void 0) { duration = 0; } return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () { var el, resolve, startTime, promise, fromY, fromX, deltaY, deltaX, step; return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) { el = this.scrollEl; if (duration < 32) { if (y != null) { el.scrollTop = y; } if (x != null) { el.scrollLeft = x; } return [2 /*return*/]; } startTime = 0; promise = new Promise(function (r) { return resolve = r; }); fromY = el.scrollTop; fromX = el.scrollLeft; deltaY = y != null ? y - fromY : 0; deltaX = x != null ? x - fromX : 0; step = function (timeStamp) { var linearTime = Math.min(1, ((timeStamp - startTime) / duration)) - 1; var easedT = Math.pow(linearTime, 3) + 1; if (deltaY !== 0) { el.scrollTop = Math.floor((easedT * deltaY) + fromY); } if (deltaX !== 0) { el.scrollLeft = Math.floor((easedT * deltaX) + fromX); } if (easedT < 1) { // do not use DomController here // must use nativeRaf in order to fire in the next frame // TODO: remove as any requestAnimationFrame(step); } else { resolve(); } }; // chill out for a frame first requestAnimationFrame(function (ts) { startTime = ts; step(ts); }); return [2 /*return*/, promise]; }); }); }; class_1.prototype.onScrollStart = function () { var _this = this; this.isScrolling = true; this.ionScrollStart.emit({ isScrolling: true }); if (this.watchDog) { clearInterval(this.watchDog); } // watchdog this.watchDog = setInterval(function () { if (_this.lastScroll < Date.now() - 120) { _this.onScrollEnd(); } }, 100); }; class_1.prototype.onScrollEnd = function () { clearInterval(this.watchDog); this.watchDog = null; if (this.isScrolling) { this.isScrolling = false; this.ionScrollEnd.emit({ isScrolling: false }); } }; class_1.prototype.render = function () { var _a; var _this = this; var _b = this, scrollX = _b.scrollX, scrollY = _b.scrollY; var mode = Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["b"])(this); var forceOverscroll = this.shouldForceOverscroll(); var transitionShadow = (mode === 'ios' && _ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["c"].getBoolean('experimentalTransitionShadow', true)); this.resize(); return (Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["H"], { class: Object(_theme_5641d27f_js__WEBPACK_IMPORTED_MODULE_6__["c"])(this.color, (_a = {}, _a[mode] = true, _a['content-sizing'] = Object(_theme_5641d27f_js__WEBPACK_IMPORTED_MODULE_6__["h"])('ion-popover', this.el), _a['overscroll'] = forceOverscroll, _a)), style: { '--offset-top': this.cTop + "px", '--offset-bottom': this.cBottom + "px", } }, Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("div", { id: "background-content", part: "background" }), Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("main", { class: { 'inner-scroll': true, 'scroll-x': scrollX, 'scroll-y': scrollY, 'overscroll': (scrollX || scrollY) && forceOverscroll }, ref: function (el) { return _this.scrollEl = el; }, onScroll: (this.scrollEvents) ? function (ev) { return _this.onScroll(ev); } : undefined, part: "scroll" }, Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("slot", null)), transitionShadow ? (Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("div", { class: "transition-effect" }, Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("div", { class: "transition-cover" }), Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("div", { class: "transition-shadow" }))) : null, Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("slot", { name: "fixed" }))); }; Object.defineProperty(class_1.prototype, "el", { get: function () { return Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["i"])(this); }, enumerable: false, configurable: true }); return class_1; }()); var getParentElement = function (el) { if (el.parentElement) { // normal element with a parent element return el.parentElement; } if (el.parentNode && el.parentNode.host) { // shadow dom's document fragment return el.parentNode.host; } return null; }; var getPageElement = function (el) { var tabs = el.closest('ion-tabs'); if (tabs) { return tabs; } var page = el.closest('ion-app,ion-page,.ion-page,page-inner'); if (page) { return page; } return getParentElement(el); }; // ******** DOM READ **************** var updateScrollDetail = function (detail, el, timestamp, shouldStart) { var prevX = detail.currentX; var prevY = detail.currentY; var prevT = detail.currentTime; var currentX = el.scrollLeft; var currentY = el.scrollTop; var timeDelta = timestamp - prevT; if (shouldStart) { // remember the start positions detail.startTime = timestamp; detail.startX = currentX; detail.startY = currentY; detail.velocityX = detail.velocityY = 0; } detail.currentTime = timestamp; detail.currentX = detail.scrollLeft = currentX; detail.currentY = detail.scrollTop = currentY; detail.deltaX = currentX - detail.startX; detail.deltaY = currentY - detail.startY; if (timeDelta > 0 && timeDelta < 100) { var velocityX = (currentX - prevX) / timeDelta; var velocityY = (currentY - prevY) / timeDelta; detail.velocityX = velocityX * 0.7 + detail.velocityX * 0.3; detail.velocityY = velocityY * 0.7 + detail.velocityY * 0.3; } }; Content.style = contentCss; var footerIosCss = "ion-footer{display:block;position:relative;-ms-flex-order:1;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-ios ion-toolbar:first-of-type{--border-width:0.55px 0 0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.footer-background{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.footer-translucent-ios ion-toolbar{--opacity:.8}}.footer-ios.ion-no-border ion-toolbar:first-of-type{--border-width:0}"; var footerMdCss = "ion-footer{display:block;position:relative;-ms-flex-order:1;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-md::before{left:0;top:-2px;bottom:auto;background-position:left 0 top 0;position:absolute;width:100%;height:2px;background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==\");background-repeat:repeat-x;content:\"\"}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{left:unset;right:unset;right:0}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{background-position:right 0 top 0}.footer-md.ion-no-border::before{display:none}"; var Footer = /** @class */ (function () { function Footer(hostRef) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["r"])(this, hostRef); /** * If `true`, the footer will be translucent. * Only applies when the mode is `"ios"` and the device supports * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility). * * Note: In order to scroll content behind the footer, the `fullscreen` * attribute needs to be set on the content. */ this.translucent = false; } Footer.prototype.render = function () { var _a; var mode = Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["b"])(this); var translucent = this.translucent; return (Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["H"], { role: "contentinfo", class: (_a = {}, _a[mode] = true, // Used internally for styling _a["footer-" + mode] = true, _a["footer-translucent"] = translucent, _a["footer-translucent-" + mode] = translucent, _a) }, mode === 'ios' && translucent && Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("div", { class: "footer-background" }), Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["h"])("slot", null))); }; return Footer; }()); Footer.style = { ios: footerIosCss, md: footerMdCss }; var TRANSITION = 'all 0.2s ease-in-out'; var cloneElement = function (tagName) { var getCachedEl = document.querySelector(tagName + ".ion-cloned-element"); if (getCachedEl !== null) { return getCachedEl; } var clonedEl = document.createElement(tagName); clonedEl.classList.add('ion-cloned-element'); clonedEl.style.setProperty('display', 'none'); document.body.appendChild(clonedEl); return clonedEl; }; var createHeaderIndex = function (headerEl) { if (!headerEl) { return; } var toolbars = headerEl.querySelectorAll('ion-toolbar'); return { el: headerEl, toolbars: Array.from(toolbars).map(function (toolbar) { var ionTitleEl = toolbar.querySelector('ion-title'); return { el: toolbar, background: toolbar.shadowRoot.querySelector('.toolbar-background'), ionTitleEl: ionTitleEl, innerTitleEl: (ionTitleEl) ? ionTitleEl.shadowRoot.querySelector('.toolbar-title') : null, ionButtonsEl: Array.from(toolbar.querySelectorAll('ion-buttons')) || [] }; }) || [] }; }; var handleContentScroll = function (scrollEl, scrollHeaderIndex, contentEl) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["f"])(function () { var scrollTop = scrollEl.scrollTop; var scale = Object(_helpers_5c745fbd_js__WEBPACK_IMPORTED_MODULE_3__["c"])(1, 1 + (-scrollTop / 500), 1.1); // Native refresher should not cause titles to scale var nativeRefresher = contentEl.querySelector('ion-refresher.refresher-native'); if (nativeRefresher === null) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["c"])(function () { scaleLargeTitles(scrollHeaderIndex.toolbars, scale); }); } }); }; var setToolbarBackgroundOpacity = function (toolbar, opacity) { if (opacity === undefined) { toolbar.background.style.removeProperty('--opacity'); } else { toolbar.background.style.setProperty('--opacity', opacity.toString()); } }; var handleToolbarBorderIntersection = function (ev, mainHeaderIndex) { if (!ev[0].isIntersecting) { return; } /** * There is a bug in Safari where overflow scrolling on a non-body element * does not always reset the scrollTop position to 0 when letting go. It will * set to 1 once the rubber band effect has ended. This causes the background to * appear slightly on certain app setups. */ var scale = (ev[0].intersectionRatio > 0.9) ? 0 : ((1 - ev[0].intersectionRatio) * 100) / 75; mainHeaderIndex.toolbars.forEach(function (toolbar) { setToolbarBackgroundOpacity(toolbar, (scale === 1) ? undefined : scale); }); }; /** * If toolbars are intersecting, hide the scrollable toolbar content * and show the primary toolbar content. If the toolbars are not intersecting, * hide the primary toolbar content and show the scrollable toolbar content */ var handleToolbarIntersection = function (ev, mainHeaderIndex, scrollHeaderIndex) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["c"])(function () { handleToolbarBorderIntersection(ev, mainHeaderIndex); var event = ev[0]; var intersection = event.intersectionRect; var intersectionArea = intersection.width * intersection.height; var rootArea = event.rootBounds.width * event.rootBounds.height; var isPageHidden = intersectionArea === 0 && rootArea === 0; var leftDiff = Math.abs(intersection.left - event.boundingClientRect.left); var rightDiff = Math.abs(intersection.right - event.boundingClientRect.right); var isPageTransitioning = intersectionArea > 0 && (leftDiff >= 5 || rightDiff >= 5); if (isPageHidden || isPageTransitioning) { return; } if (event.isIntersecting) { setHeaderActive(mainHeaderIndex, false); setHeaderActive(scrollHeaderIndex); } else { /** * There is a bug with IntersectionObserver on Safari * where `event.isIntersecting === false` when cancelling * a swipe to go back gesture. Checking the intersection * x, y, width, and height provides a workaround. This bug * does not happen when using Safari + Web Animations, * only Safari + CSS Animations. */ var hasValidIntersection = (intersection.x === 0 && intersection.y === 0) || (intersection.width !== 0 && intersection.height !== 0); if (hasValidIntersection) { setHeaderActive(mainHeaderIndex); setHeaderActive(scrollHeaderIndex, false); setToolbarBackgroundOpacity(mainHeaderIndex.toolbars[0]); } } }); }; var setHeaderActive = function (headerIndex, active) { if (active === void 0) { active = true; } if (active) { headerIndex.el.classList.remove('header-collapse-condense-inactive'); } else { headerIndex.el.classList.add('header-collapse-condense-inactive'); } }; var scaleLargeTitles = function (toolbars, scale, transition) { if (toolbars === void 0) { toolbars = []; } if (scale === void 0) { scale = 1; } if (transition === void 0) { transition = false; } toolbars.forEach(function (toolbar) { var ionTitle = toolbar.ionTitleEl; var titleDiv = toolbar.innerTitleEl; if (!ionTitle || ionTitle.size !== 'large') { return; } titleDiv.style.transition = (transition) ? TRANSITION : ''; titleDiv.style.transform = "scale3d(" + scale + ", " + scale + ", 1)"; }); }; var headerIosCss = "ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:-webkit-sticky;position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:7px;z-index:1}.header-collapse-condense ion-toolbar{--background:var(--ion-background-color, #fff);z-index:0}.header-collapse-condense ion-toolbar ion-searchbar{height:48px;padding-top:0px;padding-bottom:13px}.header-collapse-main ion-toolbar.in-toolbar ion-title,.header-collapse-main ion-toolbar.in-toolbar ion-buttons{-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse{opacity:0;pointer-events:none}.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse{visibility:hidden}"; var headerMdCss = "ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-md::after{left:0;bottom:-5px;background-position:left 0 top -2px;position:absolute;width:100%;height:5px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==);background-repeat:repeat-x;content:\"\"}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{left:unset;right:unset;right:0}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{background-position:right 0 top -2px}.header-collapse-condense{display:none}.header-md.ion-no-border::after{display:none}"; var Header = /** @class */ (function () { function class_2(hostRef) { Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["r"])(this, hostRef); this.collapsibleHeaderInitialized = false; /** * If `true`, the header will be translucent. * Only applies when the mode is `"ios"` and the device supports * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility). * * Note: In order to scroll content behind the header, the `fullscreen` * attribute needs to be set on the content. */ this.translucent = false; } class_2.prototype.componentDidLoad = function () { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this.checkCollapsibleHeader()]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; class_2.prototype.componentDidUpdate = function () { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this.checkCollapsibleHeader()]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; class_2.prototype.disconnectedCallback = function () { this.destroyCollapsibleHeader(); }; class_2.prototype.checkCollapsibleHeader = function () { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () { var hasCollapse, canCollapse, pageEl, contentEl; return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) { switch (_a.label) { case 0: hasCollapse = this.collapse === 'condense'; canCollapse = (hasCollapse && Object(_ionic_global_23e7365a_js__WEBPACK_IMPORTED_MODULE_2__["b"])(this) === 'ios') ? hasCollapse : false; if (!(!canCollapse && this.collapsibleHeaderInitialized)) return [3 /*break*/, 1]; this.destroyCollapsibleHeader(); return [3 /*break*/, 3]; case 1: if (!(canCollapse && !this.collapsibleHeaderInitialized)) return [3 /*break*/, 3]; pageEl = this.el.closest('ion-app,ion-page,.ion-page,page-inner'); contentEl = (pageEl) ? pageEl.querySelector('ion-content') : null; // Cloned elements are always needed in iOS transition Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_1__["c"])(function () { var title = cloneElement('ion-title'); title.size = 'large'; cloneElement('ion-back-button'); }); return [4 /*yield*/, this.setupCollapsibleHeader(contentEl, pageEl)]; case 2: _a.sent(); _a.label = 3; case 3: return [2 /*return*/]; } }); }); }; class_2.prototype.destroyCollapsibleHeader = function () { if (this.intersectionObserver) { this.intersectionObserver.disconnect(); this.intersectionObserver = undefined; } if (this.scrollEl && this.contentScrollCallback) { this.scrollEl.removeEventListener('scroll', this.contentScrollCallback); this.contentScrollCallback = undefined; } if (this.collapsibleMainHeader) { this.collapsibleMainHeader.classList.remove('header-collapse-main'); this.collapsibleMainHeader = undefined; } }; class_2.prototype.setupCollapsibleHeader = function (contentEl, pageEl) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function () { var _a, headers, mainHeaderIndex, scrollHeaderIndex, toolbarIntersection; var _this = this; return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_b) { switch (_b.label) { case 0: if (!contentEl || !pageEl) { console.error('ion-header requires a content to collapse, make sure there is an ion-content.'); return [2 /*return*/]; } if (typeof IntersectionObserver === 'undefined') { return [2 /*return*/]; } _a = this; return [4 /*yield*/, contentEl.getScrollElement()]; case 1: _a.scrollEl = _b.sent(); headers = pageEl.querySelectorAll('ion-header'); this.collapsibleMainHeader = Array.from(headers).find(function (header) { return header.collapse !== 'condense'; }); if (!this.collapsibleMainHeader) { return [2 /*return*/]; } mainHeaderIndex = createHeaderIndex(this.collapsibleMainHeader);