@ionic/core 7.5.6-dev.11700520218.1c07312e → 7.5.6-dev.11701102039.134ebc28

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 (154) hide show
  1. package/components/icon.js +14 -23
  2. package/components/index7.js +1 -1
  3. package/components/ion-datetime.js +2 -15
  4. package/dist/cjs/{index-09471526.js → index-5ea49600.js} +1 -1
  5. package/dist/cjs/ion-accordion_2.cjs.entry.js +1 -1
  6. package/dist/cjs/ion-back-button.cjs.entry.js +1 -1
  7. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +1 -1
  8. package/dist/cjs/ion-button_2.cjs.entry.js +14 -23
  9. package/dist/cjs/ion-datetime_3.cjs.entry.js +3 -16
  10. package/dist/cjs/ion-fab_3.cjs.entry.js +1 -1
  11. package/dist/cjs/ion-input.cjs.entry.js +1 -1
  12. package/dist/cjs/ion-item_8.cjs.entry.js +1 -1
  13. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  14. package/dist/cjs/ion-refresher_2.cjs.entry.js +1 -1
  15. package/dist/cjs/ion-reorder_2.cjs.entry.js +1 -1
  16. package/dist/cjs/ion-searchbar.cjs.entry.js +1 -1
  17. package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
  18. package/dist/cjs/ion-toggle.cjs.entry.js +1 -1
  19. package/dist/collection/collection-manifest.json +4 -4
  20. package/dist/collection/components/datetime/datetime.js +2 -15
  21. package/dist/docs.json +21 -21
  22. package/dist/esm/{index-c132c5f1.js → index-d1a56aed.js} +1 -1
  23. package/dist/esm/ion-accordion_2.entry.js +1 -1
  24. package/dist/esm/ion-back-button.entry.js +1 -1
  25. package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
  26. package/dist/esm/ion-button_2.entry.js +14 -23
  27. package/dist/esm/ion-datetime_3.entry.js +3 -16
  28. package/dist/esm/ion-fab_3.entry.js +1 -1
  29. package/dist/esm/ion-input.entry.js +1 -1
  30. package/dist/esm/ion-item_8.entry.js +1 -1
  31. package/dist/esm/ion-menu_3.entry.js +1 -1
  32. package/dist/esm/ion-refresher_2.entry.js +1 -1
  33. package/dist/esm/ion-reorder_2.entry.js +1 -1
  34. package/dist/esm/ion-searchbar.entry.js +1 -1
  35. package/dist/esm/ion-select_3.entry.js +1 -1
  36. package/dist/esm/ion-toggle.entry.js +1 -1
  37. package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
  38. package/dist/esm-es5/ion-back-button.entry.js +1 -1
  39. package/dist/esm-es5/ion-breadcrumb_2.entry.js +1 -1
  40. package/dist/esm-es5/ion-button_2.entry.js +1 -1
  41. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  42. package/dist/esm-es5/ion-fab_3.entry.js +1 -1
  43. package/dist/esm-es5/ion-input.entry.js +1 -1
  44. package/dist/esm-es5/ion-item_8.entry.js +1 -1
  45. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  46. package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
  47. package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
  48. package/dist/esm-es5/ion-searchbar.entry.js +1 -1
  49. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  50. package/dist/esm-es5/ion-toggle.entry.js +1 -1
  51. package/dist/ionic/ionic.esm.js +1 -1
  52. package/dist/ionic/{p-14aca3fb.entry.js → p-04dca48d.entry.js} +1 -1
  53. package/dist/ionic/{p-a8e68fd9.entry.js → p-0838e6bb.entry.js} +1 -1
  54. package/dist/ionic/{p-abacb44b.system.entry.js → p-14923cd7.system.entry.js} +1 -1
  55. package/dist/ionic/{p-b203659a.system.entry.js → p-19a7c660.system.entry.js} +1 -1
  56. package/dist/ionic/p-29adc040.entry.js +4 -0
  57. package/dist/ionic/p-40903d34.system.js +1 -1
  58. package/dist/ionic/{p-664d2b07.system.entry.js → p-42435018.system.entry.js} +1 -1
  59. package/dist/ionic/{p-a5c1e6ce.entry.js → p-431151f2.entry.js} +1 -1
  60. package/dist/ionic/p-47c2e0a5.entry.js +4 -0
  61. package/dist/ionic/{p-d3952bd5.system.entry.js → p-4d786d1f.system.entry.js} +1 -1
  62. package/dist/ionic/{p-3ce8c3e3.entry.js → p-52360c7a.entry.js} +1 -1
  63. package/dist/ionic/{p-bed722c4.system.entry.js → p-61c30156.system.entry.js} +1 -1
  64. package/dist/ionic/{p-f5a750e4.system.entry.js → p-640efee6.system.entry.js} +1 -1
  65. package/dist/ionic/{p-5da0eb3e.system.entry.js → p-6594d76a.system.entry.js} +1 -1
  66. package/dist/ionic/{p-b2a74a72.entry.js → p-68166ba6.entry.js} +1 -1
  67. package/dist/ionic/{p-39044fe6.system.entry.js → p-7b4cd5fc.system.entry.js} +1 -1
  68. package/dist/ionic/{p-377c636c.system.entry.js → p-7d7fdaf0.system.entry.js} +1 -1
  69. package/dist/ionic/{p-3fb57e1b.system.entry.js → p-8659f9a9.system.entry.js} +1 -1
  70. package/dist/ionic/{p-48d9faa7.entry.js → p-899fb2da.entry.js} +1 -1
  71. package/dist/ionic/{p-a21b8d05.entry.js → p-8cbf0979.entry.js} +1 -1
  72. package/dist/ionic/{p-0dc0d9b5.entry.js → p-8d5a30dd.entry.js} +1 -1
  73. package/dist/ionic/{p-f4cc91f6.entry.js → p-97a96f5f.entry.js} +1 -1
  74. package/dist/ionic/p-a3cbbb36.system.entry.js +4 -0
  75. package/dist/ionic/{p-1e86a71b.entry.js → p-a43603ce.entry.js} +1 -1
  76. package/dist/ionic/{p-73411c1b.entry.js → p-bd76524d.entry.js} +1 -1
  77. package/dist/ionic/{p-07d9e9cd.system.entry.js → p-c429a314.system.entry.js} +1 -1
  78. package/dist/ionic/{p-d21bfe66.system.entry.js → p-cd2808f5.system.entry.js} +1 -1
  79. package/dist/ionic/{p-34d2de14.system.entry.js → p-dbf7d6e5.system.entry.js} +1 -1
  80. package/dist/ionic/{p-b6f8ee31.entry.js → p-ee2469c1.entry.js} +1 -1
  81. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +1 -0
  82. package/hydrate/index.js +17 -38
  83. package/package.json +3 -4
  84. package/dist/collection/components/accordion/test/accordion.spec.js +0 -195
  85. package/dist/collection/components/action-sheet/test/action-sheet-id.spec.js +0 -32
  86. package/dist/collection/components/action-sheet/test/basic/action-sheet.spec.js +0 -18
  87. package/dist/collection/components/alert/test/alert-id.spec.js +0 -32
  88. package/dist/collection/components/alert/test/alert.spec.js +0 -37
  89. package/dist/collection/components/back-button/test/back-button.spec.js +0 -86
  90. package/dist/collection/components/breadcrumb/test/aria.spec.js +0 -22
  91. package/dist/collection/components/breadcrumbs/test/breadcrumbs.spec.js +0 -58
  92. package/dist/collection/components/button/test/form-reference/button.spec.js +0 -26
  93. package/dist/collection/components/card/test/aria.spec.js +0 -16
  94. package/dist/collection/components/checkbox/test/checkbox.spec.js +0 -20
  95. package/dist/collection/components/datetime/test/a11y/datetime.spec.js +0 -43
  96. package/dist/collection/components/datetime/test/comparison.spec.js +0 -43
  97. package/dist/collection/components/datetime/test/data.spec.js +0 -456
  98. package/dist/collection/components/datetime/test/format.spec.js +0 -124
  99. package/dist/collection/components/datetime/test/helpers.spec.js +0 -72
  100. package/dist/collection/components/datetime/test/manipulation.spec.js +0 -433
  101. package/dist/collection/components/datetime/test/parse.spec.js +0 -222
  102. package/dist/collection/components/datetime/test/state.spec.js +0 -114
  103. package/dist/collection/components/infinite-scroll-content/test/infinite-scroll-content.spec.js +0 -37
  104. package/dist/collection/components/input/test/input.spec.js +0 -85
  105. package/dist/collection/components/input/test/item/input.spec.js +0 -24
  106. package/dist/collection/components/item/test/a11y/item.spec.js +0 -48
  107. package/dist/collection/components/loading/test/basic/loading.spec.js +0 -16
  108. package/dist/collection/components/loading/test/loading-id.spec.js +0 -32
  109. package/dist/collection/components/loading/test/loading.spec.js +0 -37
  110. package/dist/collection/components/modal/test/a11y/modal.spec.js +0 -22
  111. package/dist/collection/components/modal/test/basic/modal.spec.js +0 -16
  112. package/dist/collection/components/modal/test/can-dismiss/modal.spec.js +0 -191
  113. package/dist/collection/components/modal/test/modal-id.spec.js +0 -32
  114. package/dist/collection/components/nav/test/nav-controller.spec.js +0 -749
  115. package/dist/collection/components/picker/test/picker-id.spec.js +0 -32
  116. package/dist/collection/components/picker-column/test/picker-column-aria.spec.js +0 -35
  117. package/dist/collection/components/picker-column/test/picker-column-dynamic.spec.js +0 -29
  118. package/dist/collection/components/picker-column/test/picker-column.spec.js +0 -17
  119. package/dist/collection/components/popover/test/basic/popover.spec.js +0 -16
  120. package/dist/collection/components/popover/test/popover-id.spec.js +0 -32
  121. package/dist/collection/components/popover/test/util.spec.js +0 -53
  122. package/dist/collection/components/radio/test/radio.spec.js +0 -46
  123. package/dist/collection/components/range/test/label/range.spec.js +0 -23
  124. package/dist/collection/components/range/test/range.spec.js +0 -205
  125. package/dist/collection/components/refresher-content/test/refresher-content.spec.js +0 -46
  126. package/dist/collection/components/router/test/matching.spec.js +0 -250
  127. package/dist/collection/components/router/test/parser.spec.js +0 -133
  128. package/dist/collection/components/router/test/path.spec.js +0 -218
  129. package/dist/collection/components/router/test/router.spec.js +0 -55
  130. package/dist/collection/components/searchbar/test/searchbar.spec.js +0 -15
  131. package/dist/collection/components/segment/test/segment.spec.js +0 -37
  132. package/dist/collection/components/select/test/select.spec.js +0 -59
  133. package/dist/collection/components/textarea/test/textarea.spec.js +0 -59
  134. package/dist/collection/components/toast/test/toast-id.spec.js +0 -32
  135. package/dist/collection/components/toast/test/toast.spec.js +0 -120
  136. package/dist/collection/components/toggle/test/toggle.spec.js +0 -55
  137. package/dist/collection/global/test/config-controller.spec.js +0 -77
  138. package/dist/collection/utils/animation/test/animation.spec.js +0 -431
  139. package/dist/collection/utils/keyboard/test/keyboard-controller.spec.js +0 -21
  140. package/dist/collection/utils/keyboard/test/keyboard.spec.js +0 -214
  141. package/dist/collection/utils/sanitization/test/sanitization.spec.js +0 -43
  142. package/dist/collection/utils/test/aria.spec.js +0 -79
  143. package/dist/collection/utils/test/attributes.spec.js +0 -53
  144. package/dist/collection/utils/test/hardware-back-button.spec.js +0 -53
  145. package/dist/collection/utils/test/overlays/overlays.spec.js +0 -102
  146. package/dist/collection/utils/test/platform.spec.js +0 -132
  147. package/dist/collection/utils/test/ready.spec.js +0 -39
  148. package/dist/collection/utils/test/theme.spec.js +0 -56
  149. package/dist/ionic/p-1dc91702.entry.js +0 -4
  150. package/dist/ionic/p-ad61e508.entry.js +0 -4
  151. package/dist/ionic/p-d91e93ac.system.entry.js +0 -4
  152. /package/dist/esm-es5/{index-c132c5f1.js → index-d1a56aed.js} +0 -0
  153. /package/dist/ionic/{p-ea96fa73.js → p-6e383534.js} +0 -0
  154. /package/dist/ionic/{p-8050b9b9.system.js → p-84c6dece.system.js} +0 -0
@@ -1,43 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { IonicSafeString, sanitizeDOMString } from "..";
5
- describe('sanitizeDOMString', () => {
6
- it('disable sanitizer', () => {
7
- enableSanitizer(false);
8
- expect(sanitizeDOMString('<img src="x" onerror="alert(document.cookie);">')).toEqual('<img src="x" onerror="alert(document.cookie);">');
9
- });
10
- it('bypass sanitizer', () => {
11
- expect(sanitizeDOMString(new IonicSafeString('<img src="x" onerror="alert(document.cookie);">'))).toEqual('<img src="x" onerror="alert(document.cookie);">');
12
- });
13
- it('filter onerror', () => {
14
- expect(sanitizeDOMString('<img src="x" onerror="alert(document.cookie);">')).toEqual('<img src="x">');
15
- });
16
- it('filter onclick', () => {
17
- expect(sanitizeDOMString('<button id="myButton" name="myButton" onclick="alert(document.cookie);">harmless button</button>')).toEqual('<button id="myButton" name="myButton">harmless button</button>');
18
- });
19
- it('filter <a> href JS', () => {
20
- expect(sanitizeDOMString('<a href="javascript:alert(document.cookie)">harmless link</a>')).toEqual('<a>harmless link</a>');
21
- expect(sanitizeDOMString('<a href="javascr&Tab;ipt:alert(document.cookie)">harmless link</a>')).toEqual('<a>harmless link</a>');
22
- });
23
- it('filter <a> href JS + class attribute', () => {
24
- expect(sanitizeDOMString('<a class="link" href="Javascript&#58;alert(document.cookie)">harmless link</a>')).toEqual('<a class="link">harmless link</a>');
25
- });
26
- it('filter <iframe>', () => {
27
- expect(sanitizeDOMString('<iframe src="javascript:alert(document.cookie)"></iframe>')).toEqual('');
28
- });
29
- it('filter href + javascript ', () => {
30
- expect(sanitizeDOMString('<div><button><a href="javascript:alert(document.cookie)">click me</a></button></div>')).toEqual('<div><button><a>click me</a></button></div>');
31
- });
32
- it('filter <object>', () => {
33
- expect(sanitizeDOMString('<object><img src="x" onerror="alert(document.cookie);"></object>')).toEqual('');
34
- });
35
- it('sanitizeDOMString', () => {
36
- expect(sanitizeDOMString('<ion-item><ion-label>Hello!</ion-label><ion-button onclick="alert(document.cookie);">Click me</ion-button>')).toEqual('<ion-item><ion-label>Hello!</ion-label><ion-button>Click me</ion-button></ion-item>');
37
- });
38
- });
39
- const enableSanitizer = (enable = true) => {
40
- window.Ionic = {};
41
- window.Ionic.config = {};
42
- window.Ionic.config.sanitizerEnabled = enable;
43
- };
@@ -1,79 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { newSpecPage } from "@stencil/core/testing";
5
- import { Item } from "../../components/item/item";
6
- import { Label } from "../../components/label/label";
7
- import { Toggle } from "../../components/toggle/toggle";
8
- import { getAriaLabel } from "../helpers";
9
- describe('getAriaLabel()', () => {
10
- it('should correctly link component to label', async () => {
11
- const page = await newSpecPage({
12
- components: [Item, Label, Toggle],
13
- html: `
14
- <ion-item>
15
- <ion-label>My Label</ion-label>
16
- <ion-toggle></ion-toggle>
17
- </ion-item>
18
- `,
19
- });
20
- const toggle = page.body.querySelector('ion-toggle');
21
- const { label, labelId, labelText } = getAriaLabel(toggle, 'ion-tg-0');
22
- expect(labelText).toEqual('My Label');
23
- expect(labelId).toEqual('ion-tg-0-lbl');
24
- expect(label).toEqual(page.body.querySelector('ion-label'));
25
- });
26
- it('should correctly link component when using custom label', async () => {
27
- const page = await newSpecPage({
28
- components: [Toggle],
29
- html: `
30
- <div id="my-label">Hello World</div>
31
- <ion-toggle legacy="true" aria-labelledby="my-label"></ion-toggle>
32
- `,
33
- });
34
- const toggle = page.body.querySelector('ion-toggle');
35
- const { label, labelId, labelText } = getAriaLabel(toggle, 'ion-tg-0');
36
- expect(labelText).toEqual('Hello World');
37
- expect(labelId).toEqual('my-label');
38
- expect(label).toEqual(page.body.querySelector('#my-label'));
39
- });
40
- it('should correctly link component when special characters are used', async () => {
41
- const page = await newSpecPage({
42
- components: [Toggle],
43
- html: `
44
- <div id="id.1">Hello World</div>
45
- <ion-toggle legacy="true" aria-labelledby="id.1"></ion-toggle>
46
- `,
47
- });
48
- const toggle = page.body.querySelector('ion-toggle');
49
- const { labelId, labelText } = getAriaLabel(toggle, 'ion-tg-0');
50
- expect(labelText).toEqual('Hello World');
51
- expect(labelId).toEqual('id.1');
52
- });
53
- it('should only set the label id if one was not set already', async () => {
54
- const page = await newSpecPage({
55
- components: [Toggle],
56
- html: `
57
- <label id="my-id" for="id.1">Hello World</label>
58
- <ion-toggle legacy="true" id="id.1"></ion-toggle>
59
- `,
60
- });
61
- const toggle = page.body.querySelector('ion-toggle');
62
- const { labelId, labelText } = getAriaLabel(toggle, 'ion-tg-0');
63
- expect(labelText).toEqual('Hello World');
64
- expect(labelId).toEqual('my-id');
65
- });
66
- it('should set label id', async () => {
67
- const page = await newSpecPage({
68
- components: [Toggle],
69
- html: `
70
- <label for="id.1">Hello World</label>
71
- <ion-toggle legacy="true" id="id.1"></ion-toggle>
72
- `,
73
- });
74
- const toggle = page.body.querySelector('ion-toggle');
75
- const { labelId, labelText } = getAriaLabel(toggle, 'ion-tg-0');
76
- expect(labelText).toEqual('Hello World');
77
- expect(labelId).toEqual('id.1-lbl');
78
- });
79
- });
@@ -1,53 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { inheritAttributes, inheritAriaAttributes } from "../helpers";
5
- describe('inheritAttributes()', () => {
6
- it('should create an attribute inheritance object', () => {
7
- const el = document.createElement('div');
8
- el.setAttribute('tabindex', '20');
9
- el.setAttribute('title', 'myTitle');
10
- const attributeObject = inheritAttributes(el, ['tabindex', 'title']);
11
- expect(attributeObject).toEqual({
12
- tabindex: '20',
13
- title: 'myTitle',
14
- });
15
- });
16
- it('should not inherit attributes that are not defined on the element', () => {
17
- const el = document.createElement('div');
18
- el.setAttribute('tabindex', '20');
19
- const attributeObject = inheritAttributes(el, ['tabindex', 'title']);
20
- expect(attributeObject).toEqual({
21
- tabindex: '20',
22
- });
23
- });
24
- it('should not inherit attributes that are not defined on the input array', () => {
25
- const el = document.createElement('div');
26
- el.setAttribute('tabindex', '20');
27
- el.setAttribute('title', 'myTitle');
28
- const attributeObject = inheritAttributes(el, ['title']);
29
- expect(attributeObject).toEqual({
30
- title: 'myTitle',
31
- });
32
- });
33
- });
34
- describe('inheritAriaAttributes()', () => {
35
- it('should inherit ARIA attributes defined on the HTML element', () => {
36
- const el = document.createElement('div');
37
- el.setAttribute('aria-label', 'myLabel');
38
- el.setAttribute('aria-describedby', 'myDescription');
39
- const attributeObject = inheritAriaAttributes(el);
40
- expect(attributeObject).toEqual({
41
- 'aria-label': 'myLabel',
42
- 'aria-describedby': 'myDescription',
43
- });
44
- });
45
- it('should inherit the role attribute defined on the HTML element', () => {
46
- const el = document.createElement('div');
47
- el.setAttribute('role', 'button');
48
- const attributeObject = inheritAriaAttributes(el);
49
- expect(attributeObject).toEqual({
50
- role: 'button',
51
- });
52
- });
53
- });
@@ -1,53 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { startHardwareBackButton } from "../hardware-back-button";
5
- describe('Hardware Back Button', () => {
6
- beforeEach(() => startHardwareBackButton());
7
- it('should call handler', () => {
8
- const cbSpy = jest.fn();
9
- document.addEventListener('ionBackButton', (ev) => {
10
- ev.detail.register(0, cbSpy);
11
- });
12
- dispatchBackButtonEvent();
13
- expect(cbSpy).toHaveBeenCalled();
14
- });
15
- it('should call handlers in order of priority', () => {
16
- const cbSpy = jest.fn();
17
- const cbSpyTwo = jest.fn();
18
- document.addEventListener('ionBackButton', (ev) => {
19
- ev.detail.register(100, cbSpy);
20
- ev.detail.register(99, cbSpyTwo);
21
- });
22
- dispatchBackButtonEvent();
23
- expect(cbSpy).toHaveBeenCalled();
24
- expect(cbSpyTwo).not.toHaveBeenCalled();
25
- });
26
- it('should only call last handler to be added for handlers with same priority', () => {
27
- const cbSpy = jest.fn();
28
- const cbSpyTwo = jest.fn();
29
- document.addEventListener('ionBackButton', (ev) => {
30
- ev.detail.register(100, cbSpy);
31
- ev.detail.register(100, cbSpyTwo);
32
- });
33
- dispatchBackButtonEvent();
34
- expect(cbSpy).not.toHaveBeenCalled();
35
- expect(cbSpyTwo).toHaveBeenCalled();
36
- });
37
- it('should call multiple callbacks', () => {
38
- const cbSpy = (processNextHandler) => {
39
- processNextHandler();
40
- };
41
- const cbSpyTwo = jest.fn();
42
- document.addEventListener('ionBackButton', (ev) => {
43
- ev.detail.register(100, cbSpy);
44
- ev.detail.register(99, cbSpyTwo);
45
- });
46
- dispatchBackButtonEvent();
47
- expect(cbSpyTwo).toHaveBeenCalled();
48
- });
49
- });
50
- const dispatchBackButtonEvent = () => {
51
- const ev = new Event('backbutton');
52
- document.dispatchEvent(ev);
53
- };
@@ -1,102 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { newSpecPage } from "@stencil/core/testing";
5
- import { Modal } from "../../../components/modal/modal";
6
- import { Nav } from "../../../components/nav/nav";
7
- import { RouterOutlet } from "../../../components/router-outlet/router-outlet";
8
- import { setRootAriaHidden } from "../../overlays";
9
- describe('setRootAriaHidden()', () => {
10
- it('should correctly remove and re-add router outlet from accessibility tree', async () => {
11
- const page = await newSpecPage({
12
- components: [RouterOutlet],
13
- html: `
14
- <ion-router-outlet></ion-router-outlet>
15
- `,
16
- });
17
- const routerOutlet = page.body.querySelector('ion-router-outlet');
18
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(false);
19
- setRootAriaHidden(true);
20
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(true);
21
- setRootAriaHidden(false);
22
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(false);
23
- });
24
- it('should correctly remove and re-add nav from accessibility tree', async () => {
25
- const page = await newSpecPage({
26
- components: [Nav],
27
- html: `
28
- <ion-nav></ion-nav>
29
- `,
30
- });
31
- const nav = page.body.querySelector('ion-nav');
32
- expect(nav.hasAttribute('aria-hidden')).toEqual(false);
33
- setRootAriaHidden(true);
34
- expect(nav.hasAttribute('aria-hidden')).toEqual(true);
35
- setRootAriaHidden(false);
36
- expect(nav.hasAttribute('aria-hidden')).toEqual(false);
37
- });
38
- it('should correctly remove and re-add custom container from accessibility tree', async () => {
39
- const page = await newSpecPage({
40
- components: [],
41
- html: `
42
- <div id="ion-view-container-root"></div>
43
- <div id="not-container-root"></div>
44
- `,
45
- });
46
- const containerRoot = page.body.querySelector('#ion-view-container-root');
47
- const notContainerRoot = page.body.querySelector('#not-container-root');
48
- expect(containerRoot.hasAttribute('aria-hidden')).toEqual(false);
49
- expect(notContainerRoot.hasAttribute('aria-hidden')).toEqual(false);
50
- setRootAriaHidden(true);
51
- expect(containerRoot.hasAttribute('aria-hidden')).toEqual(true);
52
- expect(notContainerRoot.hasAttribute('aria-hidden')).toEqual(false);
53
- setRootAriaHidden(false);
54
- expect(containerRoot.hasAttribute('aria-hidden')).toEqual(false);
55
- expect(notContainerRoot.hasAttribute('aria-hidden')).toEqual(false);
56
- });
57
- it('should not error if router outlet was not found', async () => {
58
- await newSpecPage({
59
- components: [],
60
- html: `
61
- <div></div>
62
- `,
63
- });
64
- setRootAriaHidden(true);
65
- });
66
- it('should remove router-outlet from accessibility tree when overlay is presented', async () => {
67
- const page = await newSpecPage({
68
- components: [RouterOutlet, Modal],
69
- html: `
70
- <ion-router-outlet>
71
- <ion-modal></ion-modal>
72
- </ion-router-outlet>
73
- `,
74
- });
75
- const routerOutlet = page.body.querySelector('ion-router-outlet');
76
- const modal = page.body.querySelector('ion-modal');
77
- await modal.present();
78
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(true);
79
- });
80
- it('should add router-outlet from accessibility tree when then final overlay is dismissed', async () => {
81
- const page = await newSpecPage({
82
- components: [RouterOutlet, Modal],
83
- html: `
84
- <ion-router-outlet>
85
- <ion-modal id="one"></ion-modal>
86
- <ion-modal id="two"></ion-modal>
87
- </ion-router-outlet>
88
- `,
89
- });
90
- const routerOutlet = page.body.querySelector('ion-router-outlet');
91
- const modalOne = page.body.querySelector('ion-modal#one');
92
- const modalTwo = page.body.querySelector('ion-modal#two');
93
- await modalOne.present();
94
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(true);
95
- await modalTwo.present();
96
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(true);
97
- await modalOne.dismiss();
98
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(true);
99
- await modalTwo.dismiss();
100
- expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(false);
101
- });
102
- });
@@ -1,132 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import initialize from "../../global/ionic-global";
5
- import { testUserAgent, getPlatforms, isPlatform } from "../platform";
6
- import { PlatformConfiguration, configureBrowser } from "./platform.utils";
7
- describe('Platform Tests', () => {
8
- describe('testUserAgent()', () => {
9
- it('should return true when testing if user agent is an iPhone', () => {
10
- const win = configureBrowser(PlatformConfiguration.iPhone);
11
- expect(testUserAgent(win, /iPhone/)).toEqual(true);
12
- });
13
- it('should return false when testing if user agent is an iPad', () => {
14
- const win = configureBrowser(PlatformConfiguration.iPhone);
15
- expect(testUserAgent(win, /iPad/)).toEqual(false);
16
- });
17
- it('should return false when testing if user agent is an Android', () => {
18
- const win = configureBrowser(PlatformConfiguration.iPhone);
19
- expect(testUserAgent(win, /android|sink/i)).toEqual(false);
20
- });
21
- it('should return true when testing if user agent is an Android', () => {
22
- const win = configureBrowser(PlatformConfiguration.AndroidTablet);
23
- expect(testUserAgent(win, /android|sink/i)).toEqual(true);
24
- });
25
- });
26
- describe('getPlatforms()', () => {
27
- it('should contain "desktop" platform', () => {
28
- const win = configureBrowser(PlatformConfiguration.DesktopSafari);
29
- expect(getPlatforms(win)).toContain('desktop');
30
- });
31
- it('should contain "android" and "tablet" platforms', () => {
32
- const win = configureBrowser(PlatformConfiguration.AndroidTablet);
33
- const platforms = getPlatforms(win);
34
- expect(platforms).toContain('android');
35
- expect(platforms).toContain('tablet');
36
- });
37
- it('should contain "capacitor" platform', () => {
38
- const win = configureBrowser(PlatformConfiguration.Capacitor);
39
- expect(getPlatforms(win)).toContain('capacitor');
40
- });
41
- });
42
- describe('isPlatform()', () => {
43
- it('should return true for "capacitor" and "hybrid" in a Capacitor app', () => {
44
- const win = configureBrowser(PlatformConfiguration.Capacitor);
45
- expect(isPlatform(win, 'capacitor')).toEqual(true);
46
- expect(isPlatform(win, 'hybrid')).toEqual(true);
47
- });
48
- it('should work without win parameter', () => {
49
- global.window = configureBrowser(PlatformConfiguration.DesktopSafari);
50
- expect(isPlatform('capacitor')).toEqual(false);
51
- expect(isPlatform('desktop')).toEqual(true);
52
- });
53
- it('should return false for "capacitor" and true for "desktop" on desktop safari', () => {
54
- const win = configureBrowser(PlatformConfiguration.DesktopSafari);
55
- expect(isPlatform(win, 'capacitor')).toEqual(false);
56
- expect(isPlatform(win, 'desktop')).toEqual(true);
57
- });
58
- it('should return true for "android" and "tablet" and false for "ios" on an android tablet', () => {
59
- const win = configureBrowser(PlatformConfiguration.AndroidTablet);
60
- expect(isPlatform(win, 'android')).toEqual(true);
61
- expect(isPlatform(win, 'tablet')).toEqual(true);
62
- expect(isPlatform(win, 'ios')).toEqual(false);
63
- });
64
- it('should return true for "cordova" and "hybrid" in a Cordova app', () => {
65
- const win = configureBrowser(PlatformConfiguration.Cordova);
66
- expect(isPlatform(win, 'cordova')).toEqual(true);
67
- expect(isPlatform(win, 'hybrid')).toEqual(true);
68
- });
69
- it('should return true for "ipad" and "tablet" on an iPad Pro', () => {
70
- const win = configureBrowser(PlatformConfiguration.iPadPro);
71
- expect(isPlatform(win, 'ipad')).toEqual(true);
72
- expect(isPlatform(win, 'tablet')).toEqual(true);
73
- });
74
- it('should return true for "android", false for "tablet, and false for "desktop"" on a Pixel 2 XL', () => {
75
- const win = configureBrowser(PlatformConfiguration.Pixel2XL);
76
- expect(isPlatform(win, 'android')).toEqual(true);
77
- expect(isPlatform(win, 'tablet')).toEqual(false);
78
- expect(isPlatform(win, 'desktop')).toEqual(false);
79
- });
80
- it('should return true for "android" and "tablet" and false for "desktop" on a Galaxy View', () => {
81
- const win = configureBrowser(PlatformConfiguration.GalaxyView);
82
- expect(isPlatform(win, 'android')).toEqual(true);
83
- expect(isPlatform(win, 'tablet')).toEqual(true);
84
- expect(isPlatform(win, 'desktop')).toEqual(false);
85
- });
86
- it('should return false for "android", "tablet", and "ipad" on desktop Safari', () => {
87
- const win = configureBrowser(PlatformConfiguration.DesktopSafari);
88
- expect(isPlatform(win, 'android')).toEqual(false);
89
- expect(isPlatform(win, 'tablet')).toEqual(false);
90
- expect(isPlatform(win, 'ipad')).toEqual(false);
91
- });
92
- it('should return false for "android" and "tablet" and false for "desktop" on iPhone', () => {
93
- const win = configureBrowser(PlatformConfiguration.iPhone);
94
- expect(isPlatform(win, 'android')).toEqual(false);
95
- expect(isPlatform(win, 'tablet')).toEqual(false);
96
- expect(isPlatform(win, 'desktop')).toEqual(false);
97
- });
98
- it('should return true for "android", false for "tablet", and false for "desktop" on Galaxy S9 Plus', () => {
99
- const win = configureBrowser(PlatformConfiguration.GalaxyS9Plus);
100
- expect(isPlatform(win, 'android')).toEqual(true);
101
- expect(isPlatform(win, 'tablet')).toEqual(false);
102
- expect(isPlatform(win, 'desktop')).toEqual(false);
103
- });
104
- it('should return true for "pwa" and false for "cordova"', () => {
105
- const win = configureBrowser(PlatformConfiguration.PWA);
106
- expect(isPlatform(win, 'pwa')).toEqual(true);
107
- expect(isPlatform(win, 'cordova')).toEqual(false);
108
- });
109
- it('should return true for "ios", "ipad", and "tablet" and false for "iphone" and "android"', () => {
110
- const win = configureBrowser(PlatformConfiguration.iPadOS);
111
- expect(isPlatform(win, 'ios')).toEqual(true);
112
- expect(isPlatform(win, 'ipad')).toEqual(true);
113
- expect(isPlatform(win, 'tablet')).toEqual(true);
114
- expect(isPlatform(win, 'iphone')).toEqual(false);
115
- expect(isPlatform(win, 'android')).toEqual(false);
116
- });
117
- });
118
- describe('Custom Platform Config', () => {
119
- it('should use custom platform detection methods', () => {
120
- const win = configureBrowser(PlatformConfiguration.DesktopSafari);
121
- initialize({
122
- platform: {
123
- desktop: () => false,
124
- cordova: () => true,
125
- },
126
- });
127
- expect(isPlatform(win, 'desktop')).toEqual(false);
128
- expect(isPlatform(win, 'cordova')).toEqual(true);
129
- expect(getPlatforms(win).includes('cordova')).toEqual(true);
130
- });
131
- });
132
- });
@@ -1,39 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { componentOnReady } from "../helpers";
5
- describe('componentOnReady()', () => {
6
- it('should correctly call callback for a custom element', (done) => {
7
- customElements.define('hello-world', class extends HTMLElement {
8
- constructor() {
9
- super();
10
- }
11
- });
12
- const component = document.createElement('hello-world');
13
- componentOnReady(component, (el) => {
14
- expect(el).toBe(component);
15
- done();
16
- });
17
- });
18
- it('should correctly call callback for a lazy loaded component', (done) => {
19
- const cb = jest.fn((el) => {
20
- return new Promise((resolve) => {
21
- setTimeout(() => resolve(el), 250);
22
- });
23
- });
24
- customElements.define('hello-world', class extends HTMLElement {
25
- constructor() {
26
- super();
27
- }
28
- componentOnReady() {
29
- return cb(this);
30
- }
31
- });
32
- const component = document.createElement('hello-world');
33
- componentOnReady(component, (el) => {
34
- expect(el).toBe(component);
35
- expect(cb).toHaveBeenCalledTimes(1);
36
- done();
37
- });
38
- });
39
- });
@@ -1,56 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { getClassList, getClassMap } from "../theme";
5
- describe('getClassList()', () => {
6
- it('should parse string', () => {
7
- expect(getClassList(' class class-event THEME-ios-bar-button')).toEqual([
8
- 'class',
9
- 'class-event',
10
- 'THEME-ios-bar-button',
11
- ]);
12
- expect(getClassList('')).toEqual([]);
13
- expect(getClassList(' ')).toEqual([]);
14
- });
15
- it('should pass array', () => {
16
- expect(getClassList(['class', 'class-event', 'THEME-ios-bar-button'])).toEqual([
17
- 'class',
18
- 'class-event',
19
- 'THEME-ios-bar-button',
20
- ]);
21
- expect(getClassList(['class ', ' class-event', ' THEME-ios-bar-button '])).toEqual([
22
- 'class',
23
- 'class-event',
24
- 'THEME-ios-bar-button',
25
- ]);
26
- expect(getClassList(['class ', null, undefined, '', ' class-event', ' ', ' THEME-ios-bar-button '])).toEqual(['class', 'class-event', 'THEME-ios-bar-button']);
27
- });
28
- });
29
- describe('getClassMap()', () => {
30
- it('should parse string', () => {
31
- expect(getClassMap(' class class-event THEME-ios-bar-button')).toEqual({
32
- class: true,
33
- 'class-event': true,
34
- 'THEME-ios-bar-button': true,
35
- });
36
- expect(getClassMap('')).toEqual({});
37
- expect(getClassMap(' ')).toEqual({});
38
- });
39
- it('should pass array', () => {
40
- expect(getClassMap(['class', 'class-event', 'THEME-ios-bar-button'])).toEqual({
41
- class: true,
42
- 'class-event': true,
43
- 'THEME-ios-bar-button': true,
44
- });
45
- expect(getClassMap(['class ', ' class-event', ' THEME-ios-bar-button '])).toEqual({
46
- class: true,
47
- 'class-event': true,
48
- 'THEME-ios-bar-button': true,
49
- });
50
- expect(getClassMap(['class ', null, undefined, '', ' class-event', ' ', ' THEME-ios-bar-button '])).toEqual({
51
- class: true,
52
- 'class-event': true,
53
- 'THEME-ios-bar-button': true,
54
- });
55
- });
56
- });
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import{r as o,h as t,H as i,f as n,d as e}from"./p-c224b9a9.js";import{r,t as a,a as s,b as d,g as c}from"./p-63eb0acd.js";import{l as h}from"./p-ea96fa73.js";import{c as l,b as p}from"./p-6c3d5383.js";import{p as u}from"./p-1b8e1d03.js";const x=class{constructor(t){o(this,t),this.updateListener=()=>this.updateState(!1),this.setItemDefaults=()=>{const o=this.getSlottedHeaderIonItem();o&&(o.button=!0,o.detail=!1,void 0===o.lines&&(o.lines="full"))},this.getSlottedHeaderIonItem=()=>{const{headerEl:o}=this;if(!o)return;const t=o.querySelector("slot");return t&&void 0!==t.assignedElements?t.assignedElements().find((o=>"ION-ITEM"===o.tagName)):void 0},this.setAria=(o=!1)=>{const t=this.getSlottedHeaderIonItem();if(!t)return;const i=c(t).querySelector("button");i&&i.setAttribute("aria-expanded",`${o}`)},this.slotToggleIcon=()=>{const o=this.getSlottedHeaderIonItem();if(!o)return;const{toggleIconSlot:t,toggleIcon:i}=this;if(o.querySelector(".ion-accordion-toggle-icon"))return;const n=document.createElement("ion-icon");n.slot=t,n.lazy=!1,n.classList.add("ion-accordion-toggle-icon"),n.icon=i,n.setAttribute("aria-hidden","true"),o.appendChild(n)},this.expandAccordion=(o=!1)=>{const{contentEl:t,contentElWrapper:i}=this;o||void 0===t||void 0===i?this.state=4:4!==this.state&&(void 0!==this.currentRaf&&cancelAnimationFrame(this.currentRaf),this.shouldAnimate()?r((()=>{this.state=8,this.currentRaf=r((async()=>{const o=i.offsetHeight,n=a(t,2e3);t.style.setProperty("max-height",`${o}px`),await n,this.state=4,t.style.removeProperty("max-height")}))})):this.state=4)},this.collapseAccordion=(o=!1)=>{const{contentEl:t}=this;o||void 0===t?this.state=1:1!==this.state&&(void 0!==this.currentRaf&&cancelAnimationFrame(this.currentRaf),this.shouldAnimate()?this.currentRaf=r((async()=>{t.style.setProperty("max-height",`${t.offsetHeight}px`),r((async()=>{const o=a(t,2e3);this.state=2,await o,this.state=1,t.style.removeProperty("max-height")}))})):this.state=1)},this.shouldAnimate=()=>"undefined"!=typeof window&&(!matchMedia("(prefers-reduced-motion: reduce)").matches&&!(!l.get("animated",!0)||this.accordionGroupEl&&!this.accordionGroupEl.animated)),this.updateState=async(o=!1)=>{const t=this.accordionGroupEl,i=this.value;if(!t)return;const n=t.value;if(Array.isArray(n)?n.includes(i):n===i)this.expandAccordion(o),this.isNext=this.isPrevious=!1;else{this.collapseAccordion(o);const t=this.getNextSibling(),i=null==t?void 0:t.value;void 0!==i&&(this.isPrevious=Array.isArray(n)?n.includes(i):n===i);const e=this.getPreviousSibling(),r=null==e?void 0:e.value;void 0!==r&&(this.isNext=Array.isArray(n)?n.includes(r):n===r)}},this.getNextSibling=()=>{if(!this.el)return;const o=this.el.nextElementSibling;return"ION-ACCORDION"===(null==o?void 0:o.tagName)?o:void 0},this.getPreviousSibling=()=>{if(!this.el)return;const o=this.el.previousElementSibling;return"ION-ACCORDION"===(null==o?void 0:o.tagName)?o:void 0},this.state=1,this.isNext=!1,this.isPrevious=!1,this.value="ion-accordion-"+g++,this.disabled=!1,this.readonly=!1,this.toggleIcon=h,this.toggleIconSlot="end"}valueChanged(){this.updateState()}connectedCallback(){var o;const t=this.accordionGroupEl=null===(o=this.el)||void 0===o?void 0:o.closest("ion-accordion-group");t&&(this.updateState(!0),s(t,"ionValueChange",this.updateListener))}disconnectedCallback(){const o=this.accordionGroupEl;o&&d(o,"ionValueChange",this.updateListener)}componentDidLoad(){this.setItemDefaults(),this.slotToggleIcon(),r((()=>{this.setAria(4===this.state||8===this.state)}))}toggleExpanded(){const{accordionGroupEl:o,value:t,state:i}=this;o&&o.requestAccordionToggle(t,1===i||2===i)}render(){const{disabled:o,readonly:n}=this,e=p(this),r=4===this.state||8===this.state,a=r?"header expanded":"header",s=r?"content expanded":"content";return this.setAria(r),t(i,{class:{[e]:!0,"accordion-expanding":8===this.state,"accordion-expanded":4===this.state,"accordion-collapsing":2===this.state,"accordion-collapsed":1===this.state,"accordion-next":this.isNext,"accordion-previous":this.isPrevious,"accordion-disabled":o,"accordion-readonly":n,"accordion-animated":this.shouldAnimate()}},t("div",{onClick:()=>this.toggleExpanded(),id:"header",part:a,"aria-controls":"content",ref:o=>this.headerEl=o},t("slot",{name:"header"})),t("div",{id:"content",part:s,role:"region","aria-labelledby":"header",ref:o=>this.contentEl=o},t("div",{id:"content-wrapper",ref:o=>this.contentElWrapper=o},t("slot",{name:"content"}))))}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{value:["valueChanged"]}}};let g=0;x.style={ios:":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host(.accordion-next) ::slotted(ion-item[slot=header]){--border-width:0.55px 0px 0.55px 0px}",md:":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}"};const m=class{constructor(t){o(this,t),this.ionChange=e(this,"ionChange",7),this.ionValueChange=e(this,"ionValueChange",7),this.animated=!0,this.multiple=void 0,this.value=void 0,this.disabled=!1,this.readonly=!1,this.expand="compact"}valueChanged(){const{value:o,multiple:t}=this;!t&&Array.isArray(o)&&u(`ion-accordion-group was passed an array of values, but multiple="false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: [${o.map((o=>`'${o}'`)).join(", ")}]\n`,this.el),this.ionValueChange.emit({value:this.value})}async disabledChanged(){const{disabled:o}=this,t=await this.getAccordions();for(const i of t)i.disabled=o}async readonlyChanged(){const{readonly:o}=this,t=await this.getAccordions();for(const i of t)i.readonly=o}async onKeydown(o){const t=document.activeElement;if(!t)return;if(!t.closest('ion-accordion [slot="header"]'))return;const i="ION-ACCORDION"===t.tagName?t:t.closest("ion-accordion");if(!i)return;if(i.closest("ion-accordion-group")!==this.el)return;const n=await this.getAccordions(),e=n.findIndex((o=>o===i));if(-1===e)return;let r;"ArrowDown"===o.key?r=this.findNextAccordion(n,e):"ArrowUp"===o.key?r=this.findPreviousAccordion(n,e):"Home"===o.key?r=n[0]:"End"===o.key&&(r=n[n.length-1]),void 0!==r&&r!==t&&r.focus()}async componentDidLoad(){this.disabled&&this.disabledChanged(),this.readonly&&this.readonlyChanged(),this.valueChanged()}setValue(o){const t=this.value=o;this.ionChange.emit({value:t})}async requestAccordionToggle(o,t){const{multiple:i,value:n,readonly:e,disabled:r}=this;if(!e&&!r)if(t)if(i){const t=null!=n?n:[],i=Array.isArray(t)?t:[t];void 0===i.find((t=>t===o))&&void 0!==o&&this.setValue([...i,o])}else this.setValue(o);else if(i){const t=null!=n?n:[],i=Array.isArray(t)?t:[t];this.setValue(i.filter((t=>t!==o)))}else this.setValue(void 0)}findNextAccordion(o,t){const i=o[t+1];return void 0===i?o[0]:i}findPreviousAccordion(o,t){const i=o[t-1];return void 0===i?o[o.length-1]:i}async getAccordions(){return Array.from(this.el.querySelectorAll(":scope > ion-accordion"))}render(){const{disabled:o,readonly:n,expand:e}=this,r=p(this);return t(i,{class:{[r]:!0,"accordion-group-disabled":o,"accordion-group-readonly":n,[`accordion-group-expand-${e}`]:!0},role:"presentation"},t("slot",null))}get el(){return n(this)}static get watchers(){return{value:["valueChanged"],disabled:["disabledChanged"],readonly:["readonlyChanged"]}}};m.style={ios:":host{display:block}:host(.accordion-group-expand-inset){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:16px;margin-bottom:16px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanding),:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanded){border-bottom:none}",md:":host{display:block}:host(.accordion-group-expand-inset){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:16px;margin-bottom:16px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion){-webkit-box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanding),:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanded){margin-left:0;margin-right:0;margin-top:16px;margin-bottom:16px;border-radius:6px}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}:host-context([dir=rtl]):host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-previous),:host-context([dir=rtl]).accordion-group-expand-inset ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}@supports selector(:dir(rtl)){:host(.accordion-group-expand-inset:dir(rtl)) ::slotted(ion-accordion.accordion-previous){border-bottom-right-radius:6px;border-bottom-left-radius:6px}}:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}:host-context([dir=rtl]):host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-next),:host-context([dir=rtl]).accordion-group-expand-inset ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}@supports selector(:dir(rtl)){:host(.accordion-group-expand-inset:dir(rtl)) ::slotted(ion-accordion.accordion-next){border-top-left-radius:6px;border-top-right-radius:6px}}:host(.accordion-group-expand-inset) ::slotted(ion-accordion):first-of-type{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}"};export{x as ion_accordion,m as ion_accordion_group}