1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | const animation = require('./animation-13cbbb20.js');
|
6 | const ios_transition = require('./ios.transition-ce21ff9f.js');
|
7 | const md_transition = require('./md.transition-59017746.js');
|
8 | const cubicBezier = require('./cubic-bezier-0b2ccc35.js');
|
9 | const index = require('./index-a1dd5c93.js');
|
10 | const ionicGlobal = require('./ionic-global-06f21c1a.js');
|
11 | const helpers = require('./helpers-d381ec4d.js');
|
12 | const index$1 = require('./index-e1bb33c3.js');
|
13 | const index$2 = require('./index-222357e4.js');
|
14 | const index$3 = require('./index-ea5f8e16.js');
|
15 | const overlays = require('./overlays-59863ad4.js');
|
16 | require('./gesture-controller-29adda71.js');
|
17 | require('./index-a0a08b2a.js');
|
18 | require('./hardware-back-button-148ce546.js');
|
19 |
|
20 | const setupConfig = (config) => {
|
21 | const win = window;
|
22 | const Ionic = win.Ionic;
|
23 | if (Ionic && Ionic.config && Ionic.config.constructor.name !== 'Object') {
|
24 | return;
|
25 | }
|
26 | win.Ionic = win.Ionic || {};
|
27 | win.Ionic.config = Object.assign(Object.assign({}, win.Ionic.config), config);
|
28 | return win.Ionic.config;
|
29 | };
|
30 | const getMode = () => {
|
31 | const win = window;
|
32 | const config = win && win.Ionic && win.Ionic.config;
|
33 | if (config) {
|
34 | if (config.mode) {
|
35 | return config.mode;
|
36 | }
|
37 | else {
|
38 | return config.get('mode');
|
39 | }
|
40 | }
|
41 | return 'md';
|
42 | };
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | const setupSwiperInIonic = (swiper, watchForIonPageChanges = true) => {
|
52 | if (typeof window === 'undefined') {
|
53 | return;
|
54 | }
|
55 | const swiperEl = swiper.el;
|
56 | const ionPage = swiperEl.closest('.ion-page');
|
57 | if (!ionPage) {
|
58 | if (watchForIonPageChanges) {
|
59 | |
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 | const rootNode = swiperEl.getRootNode();
|
68 | if (rootNode.tagName === 'DIV') {
|
69 | const mo = new MutationObserver((m) => {
|
70 | const mutation = m[0];
|
71 | const wasEmpty = mutation.oldValue === null;
|
72 | const hasIonPage = rootNode.classList.contains('ion-page');
|
73 | |
74 |
|
75 |
|
76 |
|
77 | if (wasEmpty && hasIonPage) {
|
78 | mo.disconnect();
|
79 | |
80 |
|
81 |
|
82 |
|
83 | setupSwiperInIonic(swiper, false);
|
84 | }
|
85 | });
|
86 | mo.observe(rootNode, {
|
87 | attributeFilter: ['class'],
|
88 | attributeOldValue: true
|
89 | });
|
90 | }
|
91 | }
|
92 | return;
|
93 | }
|
94 | |
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | const modalOrPopover = swiperEl.closest('ion-modal, ion-popover');
|
101 | if (modalOrPopover) {
|
102 | const eventName = modalOrPopover.tagName === 'ION-MODAL' ? 'ionModalWillPresent' : 'ionPopoverWillPresent';
|
103 | const overlayCallback = () => {
|
104 | |
105 |
|
106 |
|
107 |
|
108 | helpers.raf(() => {
|
109 | swiperEl.swiper.update();
|
110 | helpers.removeEventListener(modalOrPopover, eventName, overlayCallback);
|
111 | });
|
112 | };
|
113 | helpers.addEventListener(modalOrPopover, eventName, overlayCallback);
|
114 | }
|
115 | else {
|
116 | |
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | const mo = new MutationObserver((m) => {
|
123 | var _a;
|
124 | const mutation = m[0];
|
125 | const wasPageHidden = (_a = mutation.oldValue) === null || _a === void 0 ? void 0 : _a.includes('ion-page-invisible');
|
126 | const isPageHidden = ionPage.classList.contains('ion-page-invisible');
|
127 | |
128 |
|
129 |
|
130 |
|
131 | if (!isPageHidden && isPageHidden !== wasPageHidden) {
|
132 | swiperEl.swiper.update();
|
133 | }
|
134 | });
|
135 | mo.observe(ionPage, {
|
136 | attributeFilter: ['class'],
|
137 | attributeOldValue: true
|
138 | });
|
139 | }
|
140 | |
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | const onAppLoad = () => {
|
147 | swiperEl.swiper.update();
|
148 | helpers.removeEventListener(window, 'appload', onAppLoad);
|
149 | };
|
150 | helpers.addEventListener(window, 'appload', onAppLoad);
|
151 | };
|
152 | const IonicSwiper = {
|
153 | name: 'ionic',
|
154 | on: {
|
155 | afterInit(swiper) {
|
156 | setupSwiperInIonic(swiper);
|
157 | }
|
158 | }
|
159 | };
|
160 |
|
161 | exports.createAnimation = animation.createAnimation;
|
162 | exports.iosTransitionAnimation = ios_transition.iosTransitionAnimation;
|
163 | exports.mdTransitionAnimation = md_transition.mdTransitionAnimation;
|
164 | exports.getTimeGivenProgression = cubicBezier.getTimeGivenProgression;
|
165 | exports.createGesture = index.createGesture;
|
166 | exports.getPlatforms = ionicGlobal.getPlatforms;
|
167 | exports.initialize = ionicGlobal.initialize;
|
168 | exports.isPlatform = ionicGlobal.isPlatform;
|
169 | exports.componentOnReady = helpers.componentOnReady;
|
170 | exports.IonicSafeString = index$1.IonicSafeString;
|
171 | exports.LIFECYCLE_DID_ENTER = index$2.LIFECYCLE_DID_ENTER;
|
172 | exports.LIFECYCLE_DID_LEAVE = index$2.LIFECYCLE_DID_LEAVE;
|
173 | exports.LIFECYCLE_WILL_ENTER = index$2.LIFECYCLE_WILL_ENTER;
|
174 | exports.LIFECYCLE_WILL_LEAVE = index$2.LIFECYCLE_WILL_LEAVE;
|
175 | exports.LIFECYCLE_WILL_UNLOAD = index$2.LIFECYCLE_WILL_UNLOAD;
|
176 | exports.menuController = index$3.menuController;
|
177 | exports.actionSheetController = overlays.actionSheetController;
|
178 | exports.alertController = overlays.alertController;
|
179 | exports.loadingController = overlays.loadingController;
|
180 | exports.modalController = overlays.modalController;
|
181 | exports.pickerController = overlays.pickerController;
|
182 | exports.popoverController = overlays.popoverController;
|
183 | exports.toastController = overlays.toastController;
|
184 | exports.IonicSwiper = IonicSwiper;
|
185 | exports.getMode = getMode;
|
186 | exports.setupConfig = setupConfig;
|