@ionic/core 7.6.2-dev.11704998705.1e1f9850 → 7.6.2-dev.11705355381.14b22962

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.
Files changed (40) hide show
  1. package/components/ion-menu.js +21 -15
  2. package/components/ion-split-pane.js +26 -15
  3. package/css/themes/dark.always.css +3 -3
  4. package/css/themes/dark.system.css +3 -3
  5. package/css/themes/dark.system.css.map +1 -1
  6. package/dist/cjs/ion-menu_3.cjs.entry.js +21 -16
  7. package/dist/cjs/ion-split-pane.cjs.entry.js +24 -14
  8. package/dist/cjs/ionic.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/components/menu/menu.ios.css +64 -3
  11. package/dist/collection/components/menu/menu.js +19 -13
  12. package/dist/collection/components/menu/menu.md.css +64 -3
  13. package/dist/collection/components/split-pane/split-pane.ios.css +1 -53
  14. package/dist/collection/components/split-pane/split-pane.js +46 -12
  15. package/dist/collection/components/split-pane/split-pane.md.css +1 -53
  16. package/dist/collection/components/split-pane/test/wrapped-menu/split-pane.e2e.js +41 -0
  17. package/dist/docs.json +1 -1
  18. package/dist/esm/ion-menu_3.entry.js +21 -16
  19. package/dist/esm/ion-split-pane.entry.js +24 -14
  20. package/dist/esm/ionic.js +1 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  23. package/dist/esm-es5/ion-split-pane.entry.js +1 -1
  24. package/dist/esm-es5/ionic.js +1 -1
  25. package/dist/esm-es5/loader.js +1 -1
  26. package/dist/ionic/ionic.esm.js +1 -1
  27. package/dist/ionic/p-19d9ceb8.system.js +1 -1
  28. package/dist/ionic/p-4eae8c91.entry.js +4 -0
  29. package/dist/ionic/p-56944895.entry.js +4 -0
  30. package/dist/ionic/p-b231b7cf.system.entry.js +4 -0
  31. package/dist/ionic/p-cb3ef9c1.system.entry.js +4 -0
  32. package/dist/types/components/menu/menu.d.ts +11 -1
  33. package/dist/types/components/split-pane/split-pane.d.ts +14 -2
  34. package/dist/types/components.d.ts +1 -0
  35. package/hydrate/index.js +42 -29
  36. package/package.json +1 -1
  37. package/dist/ionic/p-308b6cf2.system.entry.js +0 -4
  38. package/dist/ionic/p-38531958.system.entry.js +0 -4
  39. package/dist/ionic/p-950c05ad.entry.js +0 -4
  40. package/dist/ionic/p-aa8b021d.entry.js +0 -4
@@ -127,51 +127,21 @@
127
127
  contain: strict;
128
128
  }
129
129
 
130
- /**
131
- * Do not pass CSS Variables down on larger
132
- * screens as we want them to affect the outer
133
- * `ion-menu` rather than the inner content
134
- */
135
- ::slotted(ion-menu.menu-pane-visible) {
136
- flex: 0 1 auto;
137
- width: var(--side-width);
138
- min-width: var(--side-min-width);
139
- max-width: var(--side-max-width);
140
- }
141
-
142
- :host(.split-pane-visible) ::slotted(.split-pane-side),
143
130
  :host(.split-pane-visible) ::slotted(.split-pane-main) {
144
131
  left: 0;
145
132
  right: 0;
146
133
  top: 0;
147
134
  bottom: 0;
148
135
  position: relative;
136
+ flex: 1;
149
137
  box-shadow: none;
150
138
  z-index: 0;
151
139
  }
152
140
 
153
- :host(.split-pane-visible) ::slotted(.split-pane-main) {
154
- flex: 1;
155
- }
156
-
157
- :host(.split-pane-visible) ::slotted(.split-pane-side:not(ion-menu)),
158
- :host(.split-pane-visible) ::slotted(ion-menu.split-pane-side.menu-enabled) {
159
- display: flex;
160
- flex-shrink: 0;
161
- }
162
-
163
141
  ::slotted(.split-pane-side:not(ion-menu)) {
164
142
  display: none;
165
143
  }
166
144
 
167
- :host(.split-pane-visible) ::slotted(.split-pane-side) {
168
- order: -1;
169
- }
170
-
171
- :host(.split-pane-visible) ::slotted(.split-pane-side[side=end]) {
172
- order: 1;
173
- }
174
-
175
145
  /**
176
146
  * Convert a font size to a dynamic font size.
177
147
  * Fonts that participate in Dynamic Type should use
@@ -231,26 +201,4 @@
231
201
  --border: 0.55px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));
232
202
  --side-min-width: 270px;
233
203
  --side-max-width: 28%;
234
- }
235
-
236
- :host(.split-pane-visible) ::slotted(.split-pane-side) {
237
- -webkit-border-start: 0;
238
- border-inline-start: 0;
239
- -webkit-border-end: var(--border);
240
- border-inline-end: var(--border);
241
- border-top: 0;
242
- border-bottom: 0;
243
- min-width: var(--side-min-width);
244
- max-width: var(--side-max-width);
245
- }
246
-
247
- :host(.split-pane-visible) ::slotted(.split-pane-side[side=end]) {
248
- -webkit-border-start: var(--border);
249
- border-inline-start: var(--border);
250
- -webkit-border-end: 0;
251
- border-inline-end: 0;
252
- border-top: 0;
253
- border-bottom: 0;
254
- min-width: var(--side-min-width);
255
- max-width: var(--side-max-width);
256
204
  }
@@ -22,8 +22,13 @@ export class SplitPane {
22
22
  this.when = QUERY['lg'];
23
23
  }
24
24
  visibleChanged(visible) {
25
- const detail = { visible, isPane: this.isPane.bind(this) };
26
- this.ionSplitPaneVisible.emit(detail);
25
+ this.ionSplitPaneVisible.emit({ visible });
26
+ }
27
+ /**
28
+ * @internal
29
+ */
30
+ async isVisible() {
31
+ return Promise.resolve(this.visible);
27
32
  }
28
33
  async connectedCallback() {
29
34
  // TODO: connectedCallback is fired in CE build
@@ -31,7 +36,7 @@ export class SplitPane {
31
36
  if (typeof customElements !== 'undefined' && customElements != null) {
32
37
  await customElements.whenDefined('ion-split-pane');
33
38
  }
34
- this.styleChildren();
39
+ this.styleMainElement();
35
40
  this.updateState();
36
41
  }
37
42
  disconnectedCallback() {
@@ -77,13 +82,16 @@ export class SplitPane {
77
82
  this.visible = mediaList.matches;
78
83
  }
79
84
  }
80
- isPane(element) {
81
- if (!this.visible) {
82
- return false;
83
- }
84
- return element.parentElement === this.el && element.classList.contains(SPLIT_PANE_SIDE);
85
- }
86
- styleChildren() {
85
+ /**
86
+ * Attempt to find the main content
87
+ * element inside of the split pane.
88
+ * If found, set it as the main node.
89
+ *
90
+ * We assume that the main node
91
+ * is available in the DOM on split
92
+ * pane load.
93
+ */
94
+ styleMainElement() {
87
95
  if (!Build.isBrowser) {
88
96
  return;
89
97
  }
@@ -99,9 +107,11 @@ export class SplitPane {
99
107
  console.warn('split pane cannot have more than one main node');
100
108
  return;
101
109
  }
102
- foundMain = true;
110
+ else {
111
+ setPaneClass(child, isMain);
112
+ foundMain = true;
113
+ }
103
114
  }
104
- setPaneClass(child, isMain);
105
115
  }
106
116
  if (!foundMain) {
107
117
  console.warn('split pane does not have a specified main node');
@@ -210,6 +220,30 @@ export class SplitPane {
210
220
  }
211
221
  }];
212
222
  }
223
+ static get methods() {
224
+ return {
225
+ "isVisible": {
226
+ "complexType": {
227
+ "signature": "() => Promise<boolean>",
228
+ "parameters": [],
229
+ "references": {
230
+ "Promise": {
231
+ "location": "global",
232
+ "id": "global::Promise"
233
+ }
234
+ },
235
+ "return": "Promise<boolean>"
236
+ },
237
+ "docs": {
238
+ "text": "",
239
+ "tags": [{
240
+ "name": "internal",
241
+ "text": undefined
242
+ }]
243
+ }
244
+ }
245
+ };
246
+ }
213
247
  static get elementRef() { return "el"; }
214
248
  static get watchers() {
215
249
  return [{
@@ -127,51 +127,21 @@
127
127
  contain: strict;
128
128
  }
129
129
 
130
- /**
131
- * Do not pass CSS Variables down on larger
132
- * screens as we want them to affect the outer
133
- * `ion-menu` rather than the inner content
134
- */
135
- ::slotted(ion-menu.menu-pane-visible) {
136
- flex: 0 1 auto;
137
- width: var(--side-width);
138
- min-width: var(--side-min-width);
139
- max-width: var(--side-max-width);
140
- }
141
-
142
- :host(.split-pane-visible) ::slotted(.split-pane-side),
143
130
  :host(.split-pane-visible) ::slotted(.split-pane-main) {
144
131
  left: 0;
145
132
  right: 0;
146
133
  top: 0;
147
134
  bottom: 0;
148
135
  position: relative;
136
+ flex: 1;
149
137
  box-shadow: none;
150
138
  z-index: 0;
151
139
  }
152
140
 
153
- :host(.split-pane-visible) ::slotted(.split-pane-main) {
154
- flex: 1;
155
- }
156
-
157
- :host(.split-pane-visible) ::slotted(.split-pane-side:not(ion-menu)),
158
- :host(.split-pane-visible) ::slotted(ion-menu.split-pane-side.menu-enabled) {
159
- display: flex;
160
- flex-shrink: 0;
161
- }
162
-
163
141
  ::slotted(.split-pane-side:not(ion-menu)) {
164
142
  display: none;
165
143
  }
166
144
 
167
- :host(.split-pane-visible) ::slotted(.split-pane-side) {
168
- order: -1;
169
- }
170
-
171
- :host(.split-pane-visible) ::slotted(.split-pane-side[side=end]) {
172
- order: 1;
173
- }
174
-
175
145
  /**
176
146
  * Convert a font size to a dynamic font size.
177
147
  * Fonts that participate in Dynamic Type should use
@@ -231,26 +201,4 @@
231
201
  --border: 1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));
232
202
  --side-min-width: 270px;
233
203
  --side-max-width: 28%;
234
- }
235
-
236
- :host(.split-pane-visible) ::slotted(.split-pane-side) {
237
- -webkit-border-start: 0;
238
- border-inline-start: 0;
239
- -webkit-border-end: var(--border);
240
- border-inline-end: var(--border);
241
- border-top: 0;
242
- border-bottom: 0;
243
- min-width: var(--side-min-width);
244
- max-width: var(--side-max-width);
245
- }
246
-
247
- :host(.split-pane-visible) ::slotted(.split-pane-side[side=end]) {
248
- -webkit-border-start: var(--border);
249
- border-inline-start: var(--border);
250
- -webkit-border-end: 0;
251
- border-inline-end: 0;
252
- border-top: 0;
253
- border-bottom: 0;
254
- min-width: var(--side-min-width);
255
- max-width: var(--side-max-width);
256
204
  }
@@ -0,0 +1,41 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ import { expect } from "@playwright/test";
5
+ import { configs, test, Viewports } from "../../../../utils/test/playwright/index";
6
+ configs({ directions: ['ltr'], modes: ['ios'] }).forEach(({ title, config }) => {
7
+ test.describe(title('split-pane: functionality'), () => {
8
+ test('should be visible on larger viewports', async ({ page }) => {
9
+ test.info().annotations.push({
10
+ type: 'issue',
11
+ description: 'https://github.com/ionic-team/ionic-framework/issues/16304',
12
+ });
13
+ await page.setViewportSize(Viewports.large);
14
+ await page.goto(`/src/components/split-pane/test/wrapped-menu`, config);
15
+ const menu = page.locator('ion-menu');
16
+ await expect(menu).toBeVisible();
17
+ });
18
+ test('should be visible on larger viewports when added async', async ({ page }) => {
19
+ test.info().annotations.push({
20
+ type: 'issue',
21
+ description: 'https://github.com/ionic-team/ionic-framework/issues/16304',
22
+ });
23
+ await page.setViewportSize(Viewports.large);
24
+ await page.goto(`/src/components/split-pane/test/wrapped-menu`, config);
25
+ // Asynchronously add a second menu
26
+ await page.evaluate(() => {
27
+ const menu = document.createElement('app-menu');
28
+ menu.setAttribute('side', 'end');
29
+ const splitPane = document.querySelector('ion-split-pane');
30
+ splitPane.appendChild(menu);
31
+ });
32
+ const menus = page.locator('ion-menu');
33
+ const menuButton = page.locator('ion-menu-button');
34
+ await expect(menus).toHaveCount(2);
35
+ await expect(menus.nth(0)).toBeVisible();
36
+ await expect(menus.nth(1)).toBeVisible();
37
+ // Menu button should be hidden because menus are visible
38
+ await expect(menuButton).toBeHidden();
39
+ });
40
+ });
41
+ });
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-01-11T18:46:55",
2
+ "timestamp": "2024-01-15T21:51:41",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.8.2",
@@ -7,8 +7,8 @@ import { G as GESTURE_CONTROLLER } from './gesture-controller-314a54f6.js';
7
7
  import { p as isEndSide, i as inheritAriaAttributes, o as assert, l as clamp } from './helpers-ae653409.js';
8
8
  import { m as menuController } from './index-1193f005.js';
9
9
  import { q as getPresentedOverlay } from './overlays-94dac1cb.js';
10
+ import { h as hostContext, c as createColorClasses } from './theme-01f3f29c.js';
10
11
  import { c as config, b as getIonMode } from './ionic-global-1f99b929.js';
11
- import { c as createColorClasses, h as hostContext } from './theme-01f3f29c.js';
12
12
  import { u as menuOutline, v as menuSharp } from './index-c132c5f1.js';
13
13
  import './index-a5d50daf.js';
14
14
  import './hardware-back-button-b2bc76db.js';
@@ -16,9 +16,9 @@ import './index-9b0d46f4.js';
16
16
  import './animation-dde8cc0d.js';
17
17
  import './framework-delegate-bc1fd82a.js';
18
18
 
19
- const menuIosCss = ":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none;transform:none;-webkit-box-shadow:none;box-shadow:none}:host(.menu-pane-visible) ion-backdrop{display:hidden !important}:host(.menu-type-push){z-index:1000}:host(.menu-type-push) .show-backdrop{display:block}";
19
+ const menuIosCss = ":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){-ms-flex:0 1 auto;flex:0 1 auto;width:var(--side-width, var(--width));min-width:var(--side-min-width, var(--min-width));max-width:var(--side-max-width, var(--max-width))}:host(.menu-pane-visible.split-pane-side){left:0;right:0;top:0;bottom:0;position:relative;-webkit-box-shadow:none;box-shadow:none;z-index:0}:host(.menu-pane-visible.split-pane-side.menu-enabled){display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}:host(.menu-pane-visible.split-pane-side){-ms-flex-order:-1;order:-1}:host(.menu-pane-visible.split-pane-side[side=end]){-ms-flex-order:1;order:1}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none;transform:none;-webkit-box-shadow:none;box-shadow:none}:host(.menu-pane-visible) ion-backdrop{display:hidden !important}:host(.menu-pane-visible.split-pane-side){-webkit-border-start:0;border-inline-start:0;-webkit-border-end:var(--border);border-inline-end:var(--border);border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.menu-pane-visible.split-pane-side[side=end]){-webkit-border-start:var(--border);border-inline-start:var(--border);-webkit-border-end:0;border-inline-end:0;border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.menu-type-push){z-index:1000}:host(.menu-type-push) .show-backdrop{display:block}";
20
20
 
21
- const menuMdCss = ":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none;transform:none;-webkit-box-shadow:none;box-shadow:none}:host(.menu-pane-visible) ion-backdrop{display:hidden !important}:host(.menu-type-overlay) .menu-inner{-webkit-box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18);box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18)}";
21
+ const menuMdCss = ":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{-webkit-transform:translateX(-9999px);transform:translateX(-9999px);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{inset-inline-start:0;inset-inline-end:auto}}@supports not (inset-inline-start: 0){:host(.menu-side-start) .menu-inner{left:0;right:auto}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{left:unset;right:unset;left:auto;right:0}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{left:unset;right:unset;left:auto;right:0}}}:host-context([dir=rtl]):host(.menu-side-start) .menu-inner,:host-context([dir=rtl]).menu-side-start .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}@supports selector(:dir(rtl)){:host(.menu-side-start:dir(rtl)) .menu-inner{--ion-safe-area-right:unset;--ion-safe-area-left:0px}}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;top:0;bottom:0}@supports (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{inset-inline-start:auto;inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.menu-side-end) .menu-inner{left:auto;right:0}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{left:unset;right:unset;left:0;right:auto}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{left:unset;right:unset;left:0;right:auto}}}:host-context([dir=rtl]):host(.menu-side-end) .menu-inner,:host-context([dir=rtl]).menu-side-end .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}@supports selector(:dir(rtl)){:host(.menu-side-end:dir(rtl)) .menu-inner{--ion-safe-area-left:unset;--ion-safe-area-right:0px}}ion-backdrop{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}:host(.menu-type-overlay){z-index:1000}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible){-ms-flex:0 1 auto;flex:0 1 auto;width:var(--side-width, var(--width));min-width:var(--side-min-width, var(--min-width));max-width:var(--side-max-width, var(--max-width))}:host(.menu-pane-visible.split-pane-side){left:0;right:0;top:0;bottom:0;position:relative;-webkit-box-shadow:none;box-shadow:none;z-index:0}:host(.menu-pane-visible.split-pane-side.menu-enabled){display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}:host(.menu-pane-visible.split-pane-side){-ms-flex-order:-1;order:-1}:host(.menu-pane-visible.split-pane-side[side=end]){-ms-flex-order:1;order:1}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none;transform:none;-webkit-box-shadow:none;box-shadow:none}:host(.menu-pane-visible) ion-backdrop{display:hidden !important}:host(.menu-pane-visible.split-pane-side){-webkit-border-start:0;border-inline-start:0;-webkit-border-end:var(--border);border-inline-end:var(--border);border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.menu-pane-visible.split-pane-side[side=end]){-webkit-border-start:var(--border);border-inline-start:var(--border);-webkit-border-end:0;border-inline-end:0;border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.menu-type-overlay) .menu-inner{-webkit-box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18);box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18)}";
22
22
 
23
23
  const iosEasing = 'cubic-bezier(0.32,0.72,0,1)';
24
24
  const mdEasing = 'cubic-bezier(0.0,0.0,0.2,1)';
@@ -148,6 +148,19 @@ const Menu = class {
148
148
  }
149
149
  async componentDidLoad() {
150
150
  this.didLoad = true;
151
+ /**
152
+ * A menu inside of a split pane is assumed
153
+ * to be a side pane.
154
+ *
155
+ * When the menu is loaded it needs to
156
+ * see if it should be considered visible inside
157
+ * of the split pane. If the split pane is
158
+ * hidden then the menu should be too.
159
+ */
160
+ const splitPane = this.el.closest('ion-split-pane');
161
+ if (splitPane !== null) {
162
+ this.isPaneVisible = await splitPane.isVisible();
163
+ }
151
164
  this.menuChanged();
152
165
  this.updateState();
153
166
  }
@@ -183,20 +196,11 @@ const Menu = class {
183
196
  this.contentEl = undefined;
184
197
  }
185
198
  onSplitPaneChanged(ev) {
186
- const { target } = ev;
187
199
  const closestSplitPane = this.el.closest('ion-split-pane');
188
- /**
189
- * Menu listens on the body for "ionSplitPaneVisible".
190
- * However, this means the callback will run any time
191
- * a SplitPane changes visibility. As a result, we only want
192
- * Menu's visibility state to update if its parent SplitPane
193
- * changes visibility.
194
- */
195
- if (target !== closestSplitPane) {
196
- return;
200
+ if (closestSplitPane !== null && closestSplitPane === ev.target) {
201
+ this.isPaneVisible = ev.detail.visible;
202
+ this.updateState();
197
203
  }
198
- this.isPaneVisible = ev.detail.isPane(this.el);
199
- this.updateState();
200
204
  }
201
205
  onBackdropClick(ev) {
202
206
  // TODO(FW-2832): type (CustomEvent triggers errors which should be sorted)
@@ -603,7 +607,7 @@ const Menu = class {
603
607
  }
604
608
  }
605
609
  render() {
606
- const { type, disabled, isPaneVisible, inheritedAttributes, side } = this;
610
+ const { type, disabled, el, isPaneVisible, inheritedAttributes, side } = this;
607
611
  const mode = getIonMode(this);
608
612
  return (h(Host, { role: "navigation", "aria-label": inheritedAttributes['aria-label'] || 'menu', class: {
609
613
  [mode]: true,
@@ -611,6 +615,7 @@ const Menu = class {
611
615
  'menu-enabled': !disabled,
612
616
  [`menu-side-${side}`]: true,
613
617
  'menu-pane-visible': isPaneVisible,
618
+ 'split-pane-side': hostContext('ion-split-pane', el),
614
619
  } }, h("div", { class: "menu-inner", part: "container", ref: (el) => (this.menuInnerEl = el) }, h("slot", null)), h("ion-backdrop", { ref: (el) => (this.backdropEl = el), class: "menu-backdrop", tappable: false, stopPropagation: false, part: "backdrop" })));
615
620
  }
616
621
  get el() { return getElement(this); }
@@ -4,9 +4,9 @@
4
4
  import { r as registerInstance, d as createEvent, h, H as Host, f as getElement } from './index-b7d870cf.js';
5
5
  import { b as getIonMode } from './ionic-global-1f99b929.js';
6
6
 
7
- const splitPaneIosCss = ":host{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}::slotted(ion-menu.menu-pane-visible){-ms-flex:0 1 auto;flex:0 1 auto;width:var(--side-width);min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.split-pane-visible) ::slotted(.split-pane-side),:host(.split-pane-visible) ::slotted(.split-pane-main){left:0;right:0;top:0;bottom:0;position:relative;-webkit-box-shadow:none;box-shadow:none;z-index:0}:host(.split-pane-visible) ::slotted(.split-pane-main){-ms-flex:1;flex:1}:host(.split-pane-visible) ::slotted(.split-pane-side:not(ion-menu)),:host(.split-pane-visible) ::slotted(ion-menu.split-pane-side.menu-enabled){display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host(.split-pane-visible) ::slotted(.split-pane-side){-ms-flex-order:-1;order:-1}:host(.split-pane-visible) ::slotted(.split-pane-side[side=end]){-ms-flex-order:1;order:1}:host{--border:0.55px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--side-min-width:270px;--side-max-width:28%}:host(.split-pane-visible) ::slotted(.split-pane-side){-webkit-border-start:0;border-inline-start:0;-webkit-border-end:var(--border);border-inline-end:var(--border);border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.split-pane-visible) ::slotted(.split-pane-side[side=end]){-webkit-border-start:var(--border);border-inline-start:var(--border);-webkit-border-end:0;border-inline-end:0;border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}";
7
+ const splitPaneIosCss = ":host{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}:host(.split-pane-visible) ::slotted(.split-pane-main){left:0;right:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none;box-shadow:none;z-index:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host{--border:0.55px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--side-min-width:270px;--side-max-width:28%}";
8
8
 
9
- const splitPaneMdCss = ":host{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}::slotted(ion-menu.menu-pane-visible){-ms-flex:0 1 auto;flex:0 1 auto;width:var(--side-width);min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.split-pane-visible) ::slotted(.split-pane-side),:host(.split-pane-visible) ::slotted(.split-pane-main){left:0;right:0;top:0;bottom:0;position:relative;-webkit-box-shadow:none;box-shadow:none;z-index:0}:host(.split-pane-visible) ::slotted(.split-pane-main){-ms-flex:1;flex:1}:host(.split-pane-visible) ::slotted(.split-pane-side:not(ion-menu)),:host(.split-pane-visible) ::slotted(ion-menu.split-pane-side.menu-enabled){display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host(.split-pane-visible) ::slotted(.split-pane-side){-ms-flex-order:-1;order:-1}:host(.split-pane-visible) ::slotted(.split-pane-side[side=end]){-ms-flex-order:1;order:1}:host{--border:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--side-min-width:270px;--side-max-width:28%}:host(.split-pane-visible) ::slotted(.split-pane-side){-webkit-border-start:0;border-inline-start:0;-webkit-border-end:var(--border);border-inline-end:var(--border);border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}:host(.split-pane-visible) ::slotted(.split-pane-side[side=end]){-webkit-border-start:var(--border);border-inline-start:var(--border);-webkit-border-end:0;border-inline-end:0;border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}";
9
+ const splitPaneMdCss = ":host{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}:host(.split-pane-visible) ::slotted(.split-pane-main){left:0;right:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none;box-shadow:none;z-index:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host{--border:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--side-min-width:270px;--side-max-width:28%}";
10
10
 
11
11
  // TODO(FW-2832): types
12
12
  const SPLIT_PANE_MAIN = 'split-pane-main';
@@ -29,8 +29,13 @@ const SplitPane = class {
29
29
  this.when = QUERY['lg'];
30
30
  }
31
31
  visibleChanged(visible) {
32
- const detail = { visible, isPane: this.isPane.bind(this) };
33
- this.ionSplitPaneVisible.emit(detail);
32
+ this.ionSplitPaneVisible.emit({ visible });
33
+ }
34
+ /**
35
+ * @internal
36
+ */
37
+ async isVisible() {
38
+ return Promise.resolve(this.visible);
34
39
  }
35
40
  async connectedCallback() {
36
41
  // TODO: connectedCallback is fired in CE build
@@ -38,7 +43,7 @@ const SplitPane = class {
38
43
  if (typeof customElements !== 'undefined' && customElements != null) {
39
44
  await customElements.whenDefined('ion-split-pane');
40
45
  }
41
- this.styleChildren();
46
+ this.styleMainElement();
42
47
  this.updateState();
43
48
  }
44
49
  disconnectedCallback() {
@@ -81,13 +86,16 @@ const SplitPane = class {
81
86
  this.visible = mediaList.matches;
82
87
  }
83
88
  }
84
- isPane(element) {
85
- if (!this.visible) {
86
- return false;
87
- }
88
- return element.parentElement === this.el && element.classList.contains(SPLIT_PANE_SIDE);
89
- }
90
- styleChildren() {
89
+ /**
90
+ * Attempt to find the main content
91
+ * element inside of the split pane.
92
+ * If found, set it as the main node.
93
+ *
94
+ * We assume that the main node
95
+ * is available in the DOM on split
96
+ * pane load.
97
+ */
98
+ styleMainElement() {
91
99
  const contentId = this.contentId;
92
100
  const children = this.el.children;
93
101
  const nu = this.el.childElementCount;
@@ -100,9 +108,11 @@ const SplitPane = class {
100
108
  console.warn('split pane cannot have more than one main node');
101
109
  return;
102
110
  }
103
- foundMain = true;
111
+ else {
112
+ setPaneClass(child, isMain);
113
+ foundMain = true;
114
+ }
104
115
  }
105
- setPaneClass(child, isMain);
106
116
  }
107
117
  if (!foundMain) {
108
118
  console.warn('split pane does not have a specified main node');