@ionic/core 8.5.4 → 8.5.5-dev.11744290727.1ac111ca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/animation.js +1 -1
- package/components/button.js +1 -1
- package/components/capacitor.js +1 -1
- package/components/data.js +1 -1
- package/components/hardware-back-button.js +1 -1
- package/components/index.js +2 -1
- package/components/index2.js +1 -1
- package/components/index4.js +32 -290
- package/components/index5.js +302 -3
- package/components/index6.js +3 -38
- package/components/index8.js +1 -1
- package/components/index9.js +1 -1
- package/components/input-shims.js +1 -1
- package/components/input.utils.js +2 -2
- package/components/ion-accordion-group.js +1 -1
- package/components/ion-app.js +1 -1
- package/components/ion-datetime-button.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-input-password-toggle.js +1 -1
- package/components/ion-menu-button.js +1 -1
- package/components/ion-menu-toggle.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-nav.js +1 -1
- package/components/ion-picker-legacy.js +1 -1
- package/components/ion-range.js +1 -1
- package/components/ion-toast.js +2 -2
- package/components/keyboard-controller.js +1 -1
- package/components/menu-toggle-util.js +1 -1
- package/components/modal.js +2 -2
- package/components/notch-controller.js +1 -1
- package/components/overlays.js +2 -2
- package/components/picker-column.js +1 -1
- package/components/popover.js +1 -1
- package/dist/cjs/{data-27cc2c9c.js → data-f012aa70.js} +1 -1
- package/dist/cjs/{index-48b2a28e.js → index-005a76d5.js} +10 -4
- package/dist/cjs/{index-4b70187a.js → index-17edba6f.js} +1 -1
- package/dist/cjs/{index-e630fd95.js → index-6a469cb9.js} +3 -3
- package/dist/cjs/{index-509ca0d3.js → index-9cf6dc1a.js} +1 -1
- package/dist/cjs/index.cjs.js +13 -7
- package/dist/cjs/{input-shims-22a9973f.js → input-shims-a323e327.js} +2 -2
- package/dist/cjs/{input.utils-e82b8ed0.js → input.utils-bc5dafc5.js} +1 -1
- package/dist/cjs/ion-accordion_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +2 -2
- package/dist/cjs/ion-alert.cjs.entry.js +2 -2
- package/dist/cjs/ion-app_8.cjs.entry.js +5 -5
- package/dist/cjs/ion-button_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-datetime_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-input-password-toggle.cjs.entry.js +1 -1
- package/dist/cjs/ion-input.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-option_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-loading.cjs.entry.js +2 -2
- package/dist/cjs/ion-menu_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-modal.cjs.entry.js +4 -4
- package/dist/cjs/ion-nav_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-popover.cjs.entry.js +3 -3
- package/dist/cjs/ion-range.cjs.entry.js +2 -2
- package/dist/cjs/ion-refresher_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-select-modal.cjs.entry.js +2 -2
- package/dist/cjs/ion-select_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +2 -2
- package/dist/cjs/{ios.transition-ae7afca9.js → ios.transition-e610053b.js} +2 -2
- package/dist/cjs/{md.transition-26003e25.js → md.transition-08f24c5d.js} +2 -2
- package/dist/cjs/{overlays-32e1b66b.js → overlays-ac6467f4.js} +1 -1
- package/dist/cjs/{status-tap-03023755.js → status-tap-ce536b9e.js} +2 -2
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/logging/index.js +10 -4
- package/dist/docs.json +1 -1
- package/dist/esm/{data-174ad5e0.js → data-8e59149f.js} +1 -1
- package/dist/esm/{index-738d7504.js → index-3f5ea295.js} +11 -5
- package/dist/esm/{index-f9f5d018.js → index-9b60ef86.js} +1 -1
- package/dist/esm/{index-e919e353.js → index-c3b1c1b3.js} +1 -1
- package/dist/esm/{index-ecb55b8d.js → index-e3c41997.js} +3 -3
- package/dist/esm/index.js +6 -6
- package/dist/esm/{input-shims-7dc1f6dc.js → input-shims-c9fda993.js} +2 -2
- package/dist/esm/{input.utils-28bf4ef0.js → input.utils-dfc0f424.js} +1 -1
- package/dist/esm/ion-accordion_2.entry.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +2 -2
- package/dist/esm/ion-alert.entry.js +2 -2
- package/dist/esm/ion-app_8.entry.js +5 -5
- package/dist/esm/ion-button_2.entry.js +1 -1
- package/dist/esm/ion-datetime-button.entry.js +2 -2
- package/dist/esm/ion-datetime_3.entry.js +3 -3
- package/dist/esm/ion-infinite-scroll_2.entry.js +2 -2
- package/dist/esm/ion-input-password-toggle.entry.js +1 -1
- package/dist/esm/ion-input.entry.js +2 -2
- package/dist/esm/ion-item-option_3.entry.js +2 -2
- package/dist/esm/ion-loading.entry.js +2 -2
- package/dist/esm/ion-menu_3.entry.js +3 -3
- package/dist/esm/ion-modal.entry.js +4 -4
- package/dist/esm/ion-nav_2.entry.js +2 -2
- package/dist/esm/ion-popover.entry.js +3 -3
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-refresher_2.entry.js +2 -2
- package/dist/esm/ion-reorder_2.entry.js +2 -2
- package/dist/esm/ion-select-modal.entry.js +2 -2
- package/dist/esm/ion-select_3.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +2 -2
- package/dist/esm/{ios.transition-7fe5dbea.js → ios.transition-f05cd241.js} +2 -2
- package/dist/esm/{md.transition-8dc58b46.js → md.transition-2d855241.js} +2 -2
- package/dist/esm/{overlays-41a5d51b.js → overlays-ee8df87c.js} +1 -1
- package/dist/esm/{status-tap-f6d08e9e.js → status-tap-244fc3a0.js} +2 -2
- package/dist/esm-es5/{data-174ad5e0.js → data-8e59149f.js} +1 -1
- package/dist/esm-es5/index-3f5ea295.js +4 -0
- package/dist/esm-es5/{index-f9f5d018.js → index-9b60ef86.js} +1 -1
- package/dist/esm-es5/{index-e919e353.js → index-c3b1c1b3.js} +1 -1
- package/dist/esm-es5/{index-ecb55b8d.js → index-e3c41997.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{input-shims-7dc1f6dc.js → input-shims-c9fda993.js} +1 -1
- package/dist/esm-es5/input.utils-dfc0f424.js +4 -0
- package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-button_2.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-infinite-scroll_2.entry.js +1 -1
- package/dist/esm-es5/ion-input-password-toggle.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-item-option_3.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
- package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
- package/dist/esm-es5/ion-select-modal.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-textarea.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/{ios.transition-7fe5dbea.js → ios.transition-f05cd241.js} +1 -1
- package/dist/esm-es5/md.transition-2d855241.js +4 -0
- package/dist/esm-es5/{overlays-41a5d51b.js → overlays-ee8df87c.js} +1 -1
- package/dist/esm-es5/{status-tap-f6d08e9e.js → status-tap-244fc3a0.js} +1 -1
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-e11ff516.entry.js → p-0122f3e8.entry.js} +1 -1
- package/dist/ionic/p-04ea6c03.system.js +4 -0
- package/dist/ionic/{p-f53ee2e7.js → p-05c178d9.js} +1 -1
- package/dist/ionic/{p-b87a9f1d.entry.js → p-05d22695.entry.js} +1 -1
- package/dist/ionic/{p-cff4f96c.entry.js → p-082676b6.entry.js} +1 -1
- package/dist/ionic/{p-1b0b2210.entry.js → p-09ab0419.entry.js} +1 -1
- package/dist/ionic/{p-ac09b6e9.system.entry.js → p-0e79619d.system.entry.js} +1 -1
- package/dist/ionic/{p-f7ce606e.js → p-13102623.js} +1 -1
- package/dist/ionic/{p-69a96be9.system.entry.js → p-18231ab7.system.entry.js} +1 -1
- package/dist/ionic/{p-f23124c4.system.js → p-184efe9b.system.js} +1 -1
- package/dist/ionic/{p-f5a04e5e.system.entry.js → p-1b158ccc.system.entry.js} +1 -1
- package/dist/ionic/{p-7058a5e4.system.entry.js → p-1cd72515.system.entry.js} +1 -1
- package/dist/ionic/{p-624ecf03.js → p-25865cab.js} +1 -1
- package/dist/ionic/{p-f896194a.system.entry.js → p-2dd088d1.system.entry.js} +1 -1
- package/dist/ionic/{p-d70a9e6d.system.js → p-302a8ba3.system.js} +1 -1
- package/dist/ionic/{p-6c044a1d.system.js → p-33b8e099.system.js} +1 -1
- package/dist/ionic/p-47115825.js +4 -0
- package/dist/ionic/{p-e65b8460.entry.js → p-4a7ec802.entry.js} +1 -1
- package/dist/ionic/{p-44ff75ea.js → p-4a93ffa0.js} +1 -1
- package/dist/ionic/{p-1bf5ec17.system.js → p-4e223bf8.system.js} +1 -1
- package/dist/ionic/{p-db3b409e.system.entry.js → p-51643b5f.system.entry.js} +1 -1
- package/dist/ionic/{p-607aa181.entry.js → p-561b6f5f.entry.js} +1 -1
- package/dist/ionic/p-56f29907.entry.js +4 -0
- package/dist/ionic/p-5de321f1.system.js +4 -0
- package/dist/ionic/{p-978bdf4c.system.js → p-602378f2.system.js} +1 -1
- package/dist/ionic/{p-05b65d7a.entry.js → p-60e0a1bb.entry.js} +1 -1
- package/dist/ionic/{p-99803283.entry.js → p-62ebc711.entry.js} +1 -1
- package/dist/ionic/{p-5578033e.system.entry.js → p-6753cf2a.system.entry.js} +1 -1
- package/dist/ionic/p-706f07f8.system.js +4 -0
- package/dist/ionic/{p-f387b3c6.system.entry.js → p-70f316cf.system.entry.js} +1 -1
- package/dist/ionic/{p-8cf6f383.system.entry.js → p-73bba353.system.entry.js} +1 -1
- package/dist/ionic/{p-38eaf9cf.system.entry.js → p-8204ff6c.system.entry.js} +1 -1
- package/dist/ionic/{p-e6cdfa96.system.entry.js → p-8372c04b.system.entry.js} +1 -1
- package/dist/ionic/{p-f834322a.entry.js → p-83ae1f98.entry.js} +1 -1
- package/dist/ionic/{p-3281aab3.entry.js → p-847f35eb.entry.js} +1 -1
- package/dist/ionic/{p-843ac05d.system.entry.js → p-8e57be35.system.entry.js} +1 -1
- package/dist/ionic/{p-4c7e6fec.system.entry.js → p-909ac6d8.system.entry.js} +1 -1
- package/dist/ionic/{p-7b886108.system.entry.js → p-914da8cc.system.entry.js} +1 -1
- package/dist/ionic/{p-29da3dcd.entry.js → p-971f2e7b.entry.js} +1 -1
- package/dist/ionic/{p-a75a9e5a.system.entry.js → p-a046f1f2.system.entry.js} +1 -1
- package/dist/ionic/{p-cfc08422.entry.js → p-a462834b.entry.js} +1 -1
- package/dist/ionic/{p-c3f9d9fe.js → p-ab53da18.js} +1 -1
- package/dist/ionic/{p-65e732b9.entry.js → p-aeaaf95f.entry.js} +1 -1
- package/dist/ionic/{p-28c81576.entry.js → p-af1deaa4.entry.js} +1 -1
- package/dist/ionic/{p-4630688e.system.entry.js → p-af607af3.system.entry.js} +1 -1
- package/dist/ionic/{p-51479be0.system.entry.js → p-afce4e86.system.entry.js} +1 -1
- package/dist/ionic/{p-48ded460.entry.js → p-b5d28ba8.entry.js} +1 -1
- package/dist/ionic/{p-7f49a9c4.entry.js → p-b5fd4d62.entry.js} +1 -1
- package/dist/ionic/p-ba68c2da.js +4 -0
- package/dist/ionic/p-bbda697a.system.js +4 -0
- package/dist/ionic/p-bf64af90.system.js +1 -1
- package/dist/ionic/{p-87b0d2c9.entry.js → p-c460bf77.entry.js} +1 -1
- package/dist/ionic/{p-a3c931ad.system.js → p-c63b2202.system.js} +1 -1
- package/dist/ionic/{p-7c9daa6f.entry.js → p-c6634933.entry.js} +1 -1
- package/dist/ionic/p-c66658c5.js +4 -0
- package/dist/ionic/{p-b1673667.entry.js → p-d2107af7.entry.js} +1 -1
- package/dist/ionic/{p-f70fc14a.entry.js → p-d24af84f.entry.js} +1 -1
- package/dist/ionic/p-d2dc9133.js +4 -0
- package/dist/ionic/{p-14114a59.system.entry.js → p-d5f9e007.system.entry.js} +1 -1
- package/dist/ionic/{p-8b1c1fd7.entry.js → p-dd1824c8.entry.js} +1 -1
- package/dist/ionic/{p-d882f1e2.system.entry.js → p-de6c76f6.system.entry.js} +1 -1
- package/dist/ionic/{p-a26d7667.system.entry.js → p-deb925eb.system.entry.js} +1 -1
- package/dist/ionic/p-e168d0da.js +4 -0
- package/dist/ionic/{p-756e4559.js → p-e18f5241.js} +1 -1
- package/dist/ionic/{p-4b07c60a.system.js → p-e30453c1.system.js} +1 -1
- package/dist/ionic/{p-a7830ff8.entry.js → p-e464e494.entry.js} +1 -1
- package/dist/ionic/{p-49d53551.system.entry.js → p-e89bbdbb.system.entry.js} +1 -1
- package/dist/ionic/{p-09d185ff.system.js → p-e8f39dca.system.js} +1 -1
- package/dist/ionic/{p-4662a25c.system.entry.js → p-e91fc1f3.system.entry.js} +1 -1
- package/dist/ionic/{p-77aa5fef.system.entry.js → p-e923784c.system.entry.js} +1 -1
- package/dist/types/utils/logging/index.d.ts +1 -1
- package/hydrate/index.js +10 -4
- package/hydrate/index.mjs +10 -4
- package/package.json +1 -1
- package/dist/esm-es5/index-738d7504.js +0 -4
- package/dist/esm-es5/input.utils-28bf4ef0.js +0 -4
- package/dist/esm-es5/md.transition-8dc58b46.js +0 -4
- package/dist/ionic/p-0ec5b7cf.system.js +0 -4
- package/dist/ionic/p-3ba2a2cd.system.js +0 -4
- package/dist/ionic/p-3f4327f7.js +0 -4
- package/dist/ionic/p-61373098.js +0 -4
- package/dist/ionic/p-64d8ac48.js +0 -4
- package/dist/ionic/p-772d1657.system.js +0 -4
- package/dist/ionic/p-9870728f.js +0 -4
- package/dist/ionic/p-a768ae50.entry.js +0 -4
- package/dist/ionic/p-ee86cfff.system.js +0 -4
- package/dist/ionic/p-ffa3ba3c.js +0 -4
package/components/animation.js
CHANGED
package/components/button.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
import { h as hasShadowDom, i as inheritAriaAttributes } from './helpers.js';
|
|
6
|
-
import { p as printIonWarning } from './
|
|
6
|
+
import { p as printIonWarning } from './index4.js';
|
|
7
7
|
import { o as openURL, c as createColorClasses, h as hostContext } from './theme.js';
|
|
8
8
|
import { b as getIonMode } from './ionic-global.js';
|
|
9
9
|
import { d as defineCustomElement$1 } from './ripple-effect.js';
|
package/components/capacitor.js
CHANGED
package/components/data.js
CHANGED
package/components/index.js
CHANGED
|
@@ -10,9 +10,10 @@ export { g as getTimeGivenProgression } from './cubic-bezier.js';
|
|
|
10
10
|
export { createGesture } from './index3.js';
|
|
11
11
|
export { g as getPlatforms, i as initialize, a as isPlatform } from './ionic-global.js';
|
|
12
12
|
export { c as componentOnReady } from './helpers.js';
|
|
13
|
+
export { L as LogLevel } from './index4.js';
|
|
13
14
|
export { I as IonicSafeString, g as getMode, s as setupConfig } from './config.js';
|
|
14
15
|
export { o as openURL } from './theme.js';
|
|
15
|
-
export { m as menuController } from './
|
|
16
|
+
export { m as menuController } from './index5.js';
|
|
16
17
|
export { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays.js';
|
|
17
18
|
|
|
18
19
|
const IonicSlides = (opts) => {
|
package/components/index2.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { c as config } from './ionic-global.js';
|
|
5
5
|
import { writeTask, Build } from '@stencil/core/internal/client';
|
|
6
|
-
import { p as printIonWarning } from './
|
|
6
|
+
import { p as printIonWarning } from './index4.js';
|
|
7
7
|
import { r as raf } from './helpers.js';
|
|
8
8
|
|
|
9
9
|
const LIFECYCLE_WILL_ENTER = 'ionViewWillEnter';
|
package/components/index4.js
CHANGED
|
@@ -1,306 +1,48 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { MENU_BACK_BUTTON_PRIORITY } from './hardware-back-button.js';
|
|
6
|
-
import { p as printIonWarning } from './index6.js';
|
|
7
|
-
import { c as componentOnReady } from './helpers.js';
|
|
8
|
-
import { b as getIonMode } from './ionic-global.js';
|
|
9
|
-
import { c as createAnimation } from './animation.js';
|
|
4
|
+
import { c as config } from './ionic-global.js';
|
|
10
5
|
|
|
6
|
+
var LogLevel;
|
|
7
|
+
(function (LogLevel) {
|
|
8
|
+
LogLevel["OFF"] = "OFF";
|
|
9
|
+
LogLevel["ERROR"] = "ERROR";
|
|
10
|
+
LogLevel["WARN"] = "WARN";
|
|
11
|
+
})(LogLevel || (LogLevel = {}));
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* Logs a warning to the console with an Ionic prefix
|
|
14
|
+
* to indicate the library that is warning the developer.
|
|
15
|
+
*
|
|
16
|
+
* @param message - The string message to be logged to the console.
|
|
16
17
|
*/
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* "Apply the sharp curve to items temporarily leaving the screen that may return
|
|
22
|
-
* from the same exit point. When they return, use the deceleration curve. On mobile,
|
|
23
|
-
* this transition typically occurs over 300ms" -- MD Motion Guide
|
|
24
|
-
*/
|
|
25
|
-
return createAnimation().duration(isIos ? 400 : 300);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Menu Overlay Type
|
|
30
|
-
* The menu slides over the content. The content
|
|
31
|
-
* itself, which is under the menu, does not move.
|
|
32
|
-
*/
|
|
33
|
-
const menuOverlayAnimation = (menu) => {
|
|
34
|
-
let closedX;
|
|
35
|
-
let openedX;
|
|
36
|
-
const width = menu.width + 8;
|
|
37
|
-
const menuAnimation = createAnimation();
|
|
38
|
-
const backdropAnimation = createAnimation();
|
|
39
|
-
if (menu.isEndSide) {
|
|
40
|
-
// right side
|
|
41
|
-
closedX = width + 'px';
|
|
42
|
-
openedX = '0px';
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
// left side
|
|
46
|
-
closedX = -width + 'px';
|
|
47
|
-
openedX = '0px';
|
|
18
|
+
const printIonWarning = (message, ...params) => {
|
|
19
|
+
const logLevel = config.get('logLevel', LogLevel.WARN);
|
|
20
|
+
if ([LogLevel.WARN].includes(logLevel)) {
|
|
21
|
+
return console.warn(`[Ionic Warning]: ${message}`, ...params);
|
|
48
22
|
}
|
|
49
|
-
menuAnimation.addElement(menu.menuInnerEl).fromTo('transform', `translateX(${closedX})`, `translateX(${openedX})`);
|
|
50
|
-
const mode = getIonMode(menu);
|
|
51
|
-
const isIos = mode === 'ios';
|
|
52
|
-
const opacity = isIos ? 0.2 : 0.25;
|
|
53
|
-
backdropAnimation.addElement(menu.backdropEl).fromTo('opacity', 0.01, opacity);
|
|
54
|
-
return baseAnimation(isIos).addAnimation([menuAnimation, backdropAnimation]);
|
|
55
23
|
};
|
|
56
|
-
|
|
57
24
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
25
|
+
* Logs an error to the console with an Ionic prefix
|
|
26
|
+
* to indicate the library that is warning the developer.
|
|
27
|
+
*
|
|
28
|
+
* @param message - The string message to be logged to the console.
|
|
29
|
+
* @param params - Additional arguments to supply to the console.error.
|
|
61
30
|
*/
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const width = menu.width;
|
|
67
|
-
if (menu.isEndSide) {
|
|
68
|
-
contentOpenedX = -width + 'px';
|
|
69
|
-
menuClosedX = width + 'px';
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
contentOpenedX = width + 'px';
|
|
73
|
-
menuClosedX = -width + 'px';
|
|
31
|
+
const printIonError = (message, ...params) => {
|
|
32
|
+
const logLevel = config.get('logLevel', LogLevel.ERROR);
|
|
33
|
+
if ([LogLevel.ERROR, LogLevel.WARN].includes(logLevel)) {
|
|
34
|
+
return console.error(`[Ionic Error]: ${message}`, ...params);
|
|
74
35
|
}
|
|
75
|
-
const menuAnimation = createAnimation()
|
|
76
|
-
.addElement(menu.menuInnerEl)
|
|
77
|
-
.fromTo('transform', `translateX(${menuClosedX})`, 'translateX(0px)');
|
|
78
|
-
const contentAnimation = createAnimation()
|
|
79
|
-
.addElement(menu.contentEl)
|
|
80
|
-
.fromTo('transform', 'translateX(0px)', `translateX(${contentOpenedX})`);
|
|
81
|
-
const backdropAnimation = createAnimation().addElement(menu.backdropEl).fromTo('opacity', 0.01, 0.32);
|
|
82
|
-
return baseAnimation(mode === 'ios').addAnimation([menuAnimation, contentAnimation, backdropAnimation]);
|
|
83
36
|
};
|
|
84
|
-
|
|
85
37
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
38
|
+
* Prints an error informing developers that an implementation requires an element to be used
|
|
39
|
+
* within a specific selector.
|
|
40
|
+
*
|
|
41
|
+
* @param el The web component element this is requiring the element.
|
|
42
|
+
* @param targetSelectors The selector or selectors that were not found.
|
|
89
43
|
*/
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const openedX = menu.width * (menu.isEndSide ? -1 : 1) + 'px';
|
|
93
|
-
const contentOpen = createAnimation()
|
|
94
|
-
.addElement(menu.contentEl) // REVIEW
|
|
95
|
-
.fromTo('transform', 'translateX(0px)', `translateX(${openedX})`);
|
|
96
|
-
return baseAnimation(mode === 'ios').addAnimation(contentOpen);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const createMenuController = () => {
|
|
100
|
-
const menuAnimations = new Map();
|
|
101
|
-
const menus = [];
|
|
102
|
-
const open = async (menu) => {
|
|
103
|
-
const menuEl = await get(menu, true);
|
|
104
|
-
if (menuEl) {
|
|
105
|
-
return menuEl.open();
|
|
106
|
-
}
|
|
107
|
-
return false;
|
|
108
|
-
};
|
|
109
|
-
const close = async (menu) => {
|
|
110
|
-
const menuEl = await (menu !== undefined ? get(menu, true) : getOpen());
|
|
111
|
-
if (menuEl !== undefined) {
|
|
112
|
-
return menuEl.close();
|
|
113
|
-
}
|
|
114
|
-
return false;
|
|
115
|
-
};
|
|
116
|
-
const toggle = async (menu) => {
|
|
117
|
-
const menuEl = await get(menu, true);
|
|
118
|
-
if (menuEl) {
|
|
119
|
-
return menuEl.toggle();
|
|
120
|
-
}
|
|
121
|
-
return false;
|
|
122
|
-
};
|
|
123
|
-
const enable = async (shouldEnable, menu) => {
|
|
124
|
-
const menuEl = await get(menu);
|
|
125
|
-
if (menuEl) {
|
|
126
|
-
menuEl.disabled = !shouldEnable;
|
|
127
|
-
}
|
|
128
|
-
return menuEl;
|
|
129
|
-
};
|
|
130
|
-
const swipeGesture = async (shouldEnable, menu) => {
|
|
131
|
-
const menuEl = await get(menu);
|
|
132
|
-
if (menuEl) {
|
|
133
|
-
menuEl.swipeGesture = shouldEnable;
|
|
134
|
-
}
|
|
135
|
-
return menuEl;
|
|
136
|
-
};
|
|
137
|
-
const isOpen = async (menu) => {
|
|
138
|
-
if (menu != null) {
|
|
139
|
-
const menuEl = await get(menu);
|
|
140
|
-
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
141
|
-
return menuEl !== undefined && menuEl.isOpen();
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
const menuEl = await getOpen();
|
|
145
|
-
return menuEl !== undefined;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
const isEnabled = async (menu) => {
|
|
149
|
-
const menuEl = await get(menu);
|
|
150
|
-
if (menuEl) {
|
|
151
|
-
return !menuEl.disabled;
|
|
152
|
-
}
|
|
153
|
-
return false;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* Finds and returns the menu specified by "menu" if registered.
|
|
157
|
-
* @param menu - The side or ID of the desired menu
|
|
158
|
-
* @param logOnMultipleSideMenus - If true, this function will log a warning
|
|
159
|
-
* if "menu" is a side but multiple menus on the same side were found. Since this function
|
|
160
|
-
* is used in multiple places, we default this log to false so that the calling
|
|
161
|
-
* functions can choose whether or not it is appropriate to log this warning.
|
|
162
|
-
*/
|
|
163
|
-
const get = async (menu, logOnMultipleSideMenus = false) => {
|
|
164
|
-
await waitUntilReady();
|
|
165
|
-
if (menu === 'start' || menu === 'end') {
|
|
166
|
-
// there could be more than one menu on the same side
|
|
167
|
-
// so first try to get the enabled one
|
|
168
|
-
const menuRefs = menus.filter((m) => m.side === menu && !m.disabled);
|
|
169
|
-
if (menuRefs.length >= 1) {
|
|
170
|
-
if (menuRefs.length > 1 && logOnMultipleSideMenus) {
|
|
171
|
-
printIonWarning(`menuController queried for a menu on the "${menu}" side, but ${menuRefs.length} menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side.`, menuRefs.map((m) => m.el));
|
|
172
|
-
}
|
|
173
|
-
return menuRefs[0].el;
|
|
174
|
-
}
|
|
175
|
-
// didn't find a menu side that is enabled
|
|
176
|
-
// so try to get the first menu side found
|
|
177
|
-
const sideMenuRefs = menus.filter((m) => m.side === menu);
|
|
178
|
-
if (sideMenuRefs.length >= 1) {
|
|
179
|
-
if (sideMenuRefs.length > 1 && logOnMultipleSideMenus) {
|
|
180
|
-
printIonWarning(`menuController queried for a menu on the "${menu}" side, but ${sideMenuRefs.length} menus were found. The first menu reference will be used. If this is not the behavior you want then pass the ID of the menu instead of its side.`, sideMenuRefs.map((m) => m.el));
|
|
181
|
-
}
|
|
182
|
-
return sideMenuRefs[0].el;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else if (menu != null) {
|
|
186
|
-
// the menuId was not left or right
|
|
187
|
-
// so try to get the menu by its "id"
|
|
188
|
-
return find((m) => m.menuId === menu);
|
|
189
|
-
}
|
|
190
|
-
// return the first enabled menu
|
|
191
|
-
const menuEl = find((m) => !m.disabled);
|
|
192
|
-
if (menuEl) {
|
|
193
|
-
return menuEl;
|
|
194
|
-
}
|
|
195
|
-
// get the first menu in the array, if one exists
|
|
196
|
-
return menus.length > 0 ? menus[0].el : undefined;
|
|
197
|
-
};
|
|
198
|
-
/**
|
|
199
|
-
* Get the instance of the opened menu. Returns `null` if a menu is not found.
|
|
200
|
-
*/
|
|
201
|
-
const getOpen = async () => {
|
|
202
|
-
await waitUntilReady();
|
|
203
|
-
return _getOpenSync();
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Get all menu instances.
|
|
207
|
-
*/
|
|
208
|
-
const getMenus = async () => {
|
|
209
|
-
await waitUntilReady();
|
|
210
|
-
return getMenusSync();
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Get whether or not a menu is animating. Returns `true` if any
|
|
214
|
-
* menu is currently animating.
|
|
215
|
-
*/
|
|
216
|
-
const isAnimating = async () => {
|
|
217
|
-
await waitUntilReady();
|
|
218
|
-
return isAnimatingSync();
|
|
219
|
-
};
|
|
220
|
-
const registerAnimation = (name, animation) => {
|
|
221
|
-
menuAnimations.set(name, animation);
|
|
222
|
-
};
|
|
223
|
-
const _register = (menu) => {
|
|
224
|
-
if (menus.indexOf(menu) < 0) {
|
|
225
|
-
menus.push(menu);
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
const _unregister = (menu) => {
|
|
229
|
-
const index = menus.indexOf(menu);
|
|
230
|
-
if (index > -1) {
|
|
231
|
-
menus.splice(index, 1);
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
const _setOpen = async (menu, shouldOpen, animated, role) => {
|
|
235
|
-
if (isAnimatingSync()) {
|
|
236
|
-
return false;
|
|
237
|
-
}
|
|
238
|
-
if (shouldOpen) {
|
|
239
|
-
const openedMenu = await getOpen();
|
|
240
|
-
if (openedMenu && menu.el !== openedMenu) {
|
|
241
|
-
await openedMenu.setOpen(false, false);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return menu._setOpen(shouldOpen, animated, role);
|
|
245
|
-
};
|
|
246
|
-
const _createAnimation = (type, menuCmp) => {
|
|
247
|
-
const animationBuilder = menuAnimations.get(type); // TODO(FW-2832): type
|
|
248
|
-
if (!animationBuilder) {
|
|
249
|
-
throw new Error('animation not registered');
|
|
250
|
-
}
|
|
251
|
-
const animation = animationBuilder(menuCmp);
|
|
252
|
-
return animation;
|
|
253
|
-
};
|
|
254
|
-
const _getOpenSync = () => {
|
|
255
|
-
return find((m) => m._isOpen);
|
|
256
|
-
};
|
|
257
|
-
const getMenusSync = () => {
|
|
258
|
-
return menus.map((menu) => menu.el);
|
|
259
|
-
};
|
|
260
|
-
const isAnimatingSync = () => {
|
|
261
|
-
return menus.some((menu) => menu.isAnimating);
|
|
262
|
-
};
|
|
263
|
-
const find = (predicate) => {
|
|
264
|
-
const instance = menus.find(predicate);
|
|
265
|
-
if (instance !== undefined) {
|
|
266
|
-
return instance.el;
|
|
267
|
-
}
|
|
268
|
-
return undefined;
|
|
269
|
-
};
|
|
270
|
-
const waitUntilReady = () => {
|
|
271
|
-
return Promise.all(Array.from(document.querySelectorAll('ion-menu')).map((menu) => new Promise((resolve) => componentOnReady(menu, resolve))));
|
|
272
|
-
};
|
|
273
|
-
registerAnimation('reveal', menuRevealAnimation);
|
|
274
|
-
registerAnimation('push', menuPushAnimation);
|
|
275
|
-
registerAnimation('overlay', menuOverlayAnimation);
|
|
276
|
-
doc === null || doc === void 0 ? void 0 : doc.addEventListener('ionBackButton', (ev) => {
|
|
277
|
-
const openMenu = _getOpenSync();
|
|
278
|
-
if (openMenu) {
|
|
279
|
-
ev.detail.register(MENU_BACK_BUTTON_PRIORITY, () => {
|
|
280
|
-
return openMenu.close();
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
return {
|
|
285
|
-
registerAnimation,
|
|
286
|
-
get,
|
|
287
|
-
getMenus,
|
|
288
|
-
getOpen,
|
|
289
|
-
isEnabled,
|
|
290
|
-
swipeGesture,
|
|
291
|
-
isAnimating,
|
|
292
|
-
isOpen,
|
|
293
|
-
enable,
|
|
294
|
-
toggle,
|
|
295
|
-
close,
|
|
296
|
-
open,
|
|
297
|
-
_getOpenSync,
|
|
298
|
-
_createAnimation,
|
|
299
|
-
_register,
|
|
300
|
-
_unregister,
|
|
301
|
-
_setOpen,
|
|
302
|
-
};
|
|
44
|
+
const printRequiredElementError = (el, ...targetSelectors) => {
|
|
45
|
+
return console.error(`<${el.tagName.toLowerCase()}> must be used inside ${targetSelectors.join(' or ')}.`);
|
|
303
46
|
};
|
|
304
|
-
const menuController = /*@__PURE__*/ createMenuController();
|
|
305
47
|
|
|
306
|
-
export {
|
|
48
|
+
export { LogLevel as L, printIonError as a, printRequiredElementError as b, printIonWarning as p };
|