@rdlabo/ionic-theme-ios27 1.2.0-2 → 1.2.0-4

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 (180) hide show
  1. package/README.md +15 -2
  2. package/dist/_virtual/_rolldown/runtime.js +13 -0
  3. package/dist/css/ionic-theme-ios27.css +1 -1
  4. package/dist/css/vertical-bars.css +1 -1
  5. package/dist/focus-controller/index.d.ts +4 -2
  6. package/dist/focus-controller/index.d.ts.map +1 -1
  7. package/dist/focus-controller/index.js +100 -57
  8. package/dist/focus-controller/index.js.map +1 -0
  9. package/dist/index.d.ts +10 -8
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +54 -60
  12. package/dist/index.js.map +1 -0
  13. package/dist/native/components/index.d.ts +13 -10
  14. package/dist/native/components/index.d.ts.map +1 -1
  15. package/dist/native/components/index.js +39 -41
  16. package/dist/native/components/index.js.map +1 -0
  17. package/dist/native/components/ion-back-button.d.ts +6 -1
  18. package/dist/native/components/ion-back-button.d.ts.map +1 -1
  19. package/dist/native/components/ion-back-button.js +19 -13
  20. package/dist/native/components/ion-back-button.js.map +1 -0
  21. package/dist/native/components/ion-button.d.ts +8 -2
  22. package/dist/native/components/ion-button.d.ts.map +1 -1
  23. package/dist/native/components/ion-button.js +22 -17
  24. package/dist/native/components/ion-button.js.map +1 -0
  25. package/dist/native/components/ion-buttons.d.ts +8 -2
  26. package/dist/native/components/ion-buttons.d.ts.map +1 -1
  27. package/dist/native/components/ion-buttons.js +29 -33
  28. package/dist/native/components/ion-buttons.js.map +1 -0
  29. package/dist/native/components/ion-fab.d.ts +6 -1
  30. package/dist/native/components/ion-fab.d.ts.map +1 -1
  31. package/dist/native/components/ion-fab.js +131 -151
  32. package/dist/native/components/ion-fab.js.map +1 -0
  33. package/dist/native/components/ion-menu-button.d.ts +8 -2
  34. package/dist/native/components/ion-menu-button.d.ts.map +1 -1
  35. package/dist/native/components/ion-menu-button.js +29 -19
  36. package/dist/native/components/ion-menu-button.js.map +1 -0
  37. package/dist/native/components/ion-segment.d.ts +6 -1
  38. package/dist/native/components/ion-segment.d.ts.map +1 -1
  39. package/dist/native/components/ion-segment.js +29 -23
  40. package/dist/native/components/ion-segment.js.map +1 -0
  41. package/dist/native/components/ion-tab-bar.d.ts +6 -1
  42. package/dist/native/components/ion-tab-bar.d.ts.map +1 -1
  43. package/dist/native/components/ion-tab-bar.js +49 -40
  44. package/dist/native/components/ion-tab-bar.js.map +1 -0
  45. package/dist/native/components/searchable-tabs.d.ts +17 -15
  46. package/dist/native/components/searchable-tabs.d.ts.map +1 -1
  47. package/dist/native/components/searchable-tabs.js +382 -435
  48. package/dist/native/components/searchable-tabs.js.map +1 -0
  49. package/dist/native/definitions.d.ts +118 -111
  50. package/dist/native/definitions.d.ts.map +1 -1
  51. package/dist/native/definitions.js +0 -1
  52. package/dist/native/foldable/fold-state.d.ts +5 -0
  53. package/dist/native/foldable/fold-state.d.ts.map +1 -0
  54. package/dist/native/foldable/fold-state.js +14 -0
  55. package/dist/native/foldable/fold-state.js.map +1 -0
  56. package/dist/native/foldable/types.d.ts +12 -0
  57. package/dist/native/foldable/types.d.ts.map +1 -0
  58. package/dist/native/foldable/types.js +0 -0
  59. package/dist/native/index.d.ts +6 -3
  60. package/dist/native/index.d.ts.map +1 -1
  61. package/dist/native/index.js +228 -204
  62. package/dist/native/index.js.map +1 -0
  63. package/dist/native/prehide.d.ts +4 -2
  64. package/dist/native/prehide.d.ts.map +1 -1
  65. package/dist/native/prehide.js +220 -242
  66. package/dist/native/prehide.js.map +1 -0
  67. package/dist/native/runtime.d.ts +3 -1
  68. package/dist/native/runtime.d.ts.map +1 -1
  69. package/dist/native/runtime.js +626 -724
  70. package/dist/native/runtime.js.map +1 -0
  71. package/dist/native/shared/candidate.d.ts +16 -11
  72. package/dist/native/shared/candidate.d.ts.map +1 -1
  73. package/dist/native/shared/candidate.js +96 -95
  74. package/dist/native/shared/candidate.js.map +1 -0
  75. package/dist/native/shared/crossfade.d.ts +6 -4
  76. package/dist/native/shared/crossfade.d.ts.map +1 -1
  77. package/dist/native/shared/crossfade.js +49 -45
  78. package/dist/native/shared/crossfade.js.map +1 -0
  79. package/dist/native/shared/dom.d.ts +7 -5
  80. package/dist/native/shared/dom.d.ts.map +1 -1
  81. package/dist/native/shared/dom.js +163 -211
  82. package/dist/native/shared/dom.js.map +1 -0
  83. package/dist/native/shared/events.d.ts +8 -6
  84. package/dist/native/shared/events.d.ts.map +1 -1
  85. package/dist/native/shared/events.js +12 -7
  86. package/dist/native/shared/events.js.map +1 -0
  87. package/dist/native/shared/icons.d.ts +4 -2
  88. package/dist/native/shared/icons.d.ts.map +1 -1
  89. package/dist/native/shared/icons.js +59 -53
  90. package/dist/native/shared/icons.js.map +1 -0
  91. package/dist/native/shared/modal.d.ts +3 -1
  92. package/dist/native/shared/modal.d.ts.map +1 -1
  93. package/dist/native/shared/modal.js +156 -139
  94. package/dist/native/shared/modal.js.map +1 -0
  95. package/dist/native/vertical-bars-web.d.ts +3 -1
  96. package/dist/native/vertical-bars-web.d.ts.map +1 -1
  97. package/dist/native/vertical-bars-web.js +332 -346
  98. package/dist/native/vertical-bars-web.js.map +1 -0
  99. package/dist/native-integration/index.d.ts +10 -8
  100. package/dist/native-integration/index.d.ts.map +1 -1
  101. package/dist/native-integration/index.js +102 -100
  102. package/dist/native-integration/index.js.map +1 -0
  103. package/dist/native-integration/transition.d.ts +3 -1
  104. package/dist/native-integration/transition.d.ts.map +1 -1
  105. package/dist/native-integration/transition.js +15 -6
  106. package/dist/native-integration/transition.js.map +1 -0
  107. package/dist/searchbar/index.d.ts +4 -2
  108. package/dist/searchbar/index.d.ts.map +1 -1
  109. package/dist/searchbar/index.js +64 -56
  110. package/dist/searchbar/index.js.map +1 -0
  111. package/dist/segment/index.d.ts +3 -1
  112. package/dist/segment/index.d.ts.map +1 -1
  113. package/dist/segment/index.js +465 -324
  114. package/dist/segment/index.js.map +1 -0
  115. package/dist/sheets-of-glass/animations.d.ts +13 -12
  116. package/dist/sheets-of-glass/animations.d.ts.map +1 -1
  117. package/dist/sheets-of-glass/animations.js +496 -306
  118. package/dist/sheets-of-glass/animations.js.map +1 -0
  119. package/dist/sheets-of-glass/index.d.ts +3 -1
  120. package/dist/sheets-of-glass/index.d.ts.map +1 -1
  121. package/dist/sheets-of-glass/index.js +294 -357
  122. package/dist/sheets-of-glass/index.js.map +1 -0
  123. package/dist/sheets-of-glass/interfaces.d.ts +11 -9
  124. package/dist/sheets-of-glass/interfaces.d.ts.map +1 -1
  125. package/dist/sheets-of-glass/interfaces.js +0 -1
  126. package/dist/tab-bar-searchable/animations/enter.d.ts +4 -2
  127. package/dist/tab-bar-searchable/animations/enter.d.ts.map +1 -1
  128. package/dist/tab-bar-searchable/animations/enter.js +50 -69
  129. package/dist/tab-bar-searchable/animations/enter.js.map +1 -0
  130. package/dist/tab-bar-searchable/animations/leave.d.ts +4 -2
  131. package/dist/tab-bar-searchable/animations/leave.d.ts.map +1 -1
  132. package/dist/tab-bar-searchable/animations/leave.js +48 -62
  133. package/dist/tab-bar-searchable/animations/leave.js.map +1 -0
  134. package/dist/tab-bar-searchable/index.d.ts +5 -3
  135. package/dist/tab-bar-searchable/index.d.ts.map +1 -1
  136. package/dist/tab-bar-searchable/index.js +125 -109
  137. package/dist/tab-bar-searchable/index.js.map +1 -0
  138. package/dist/transition/index.d.ts +9 -8
  139. package/dist/transition/index.d.ts.map +1 -1
  140. package/dist/transition/index.js +203 -192
  141. package/dist/transition/index.js.map +1 -0
  142. package/dist/transition/ios.transition.d.ts +7 -5
  143. package/dist/transition/ios.transition.d.ts.map +1 -1
  144. package/dist/transition/ios.transition.js +15 -11
  145. package/dist/transition/ios.transition.js.map +1 -0
  146. package/dist/utils.d.ts +10 -8
  147. package/dist/utils.d.ts.map +1 -1
  148. package/dist/utils.js +58 -66
  149. package/dist/utils.js.map +1 -0
  150. package/dist/vertical-bars.d.ts +5 -4
  151. package/dist/vertical-bars.js +4 -2
  152. package/docs/iphone-duo-with-original-theme.md +18 -29
  153. package/docs/iphone-duo.md +44 -204
  154. package/docs/native-ui-shell.md +15 -11
  155. package/docs/special-markup.md +2 -0
  156. package/docs/vertical-bars.md +283 -0
  157. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellSearchController.swift +1 -1
  158. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalBars.swift +61 -16
  159. package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalSearch.swift +118 -0
  160. package/ios/Sources/IonicNativeUIShellPlugin/IonicNativeUIShellPlugin.swift +17 -8
  161. package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellSnapshot.swift +2 -0
  162. package/ios/Tests/IonicNativeUIShellPluginTests/ShellSnapshotTests.swift +40 -0
  163. package/package.json +9 -6
  164. package/src/native/components/index.ts +3 -2
  165. package/src/native/components/ion-button.ts +3 -2
  166. package/src/native/components/ion-buttons.ts +4 -3
  167. package/src/native/components/ion-menu-button.ts +3 -2
  168. package/src/native/components/searchable-tabs.ts +8 -11
  169. package/src/native/definitions.ts +22 -1
  170. package/src/native/foldable/fold-state.ts +9 -0
  171. package/src/native/foldable/types.ts +4 -0
  172. package/src/native/index.ts +17 -3
  173. package/src/native/prehide.ts +3 -1
  174. package/src/native/runtime.ts +14 -9
  175. package/src/native/shared/candidate.ts +39 -10
  176. package/src/native/shared/dom.ts +4 -4
  177. package/src/styles/vertical-bars.scss +12 -2
  178. package/src/tab-bar-searchable/index.ts +40 -9
  179. package/src/vertical-bars.ts +9 -1
  180. package/dist/vertical-bars.d.ts.map +0 -1
@@ -1,152 +1,132 @@
1
- import { childElements, excluded, isDark, text } from '../shared/dom';
2
- import { iconSource } from '../shared/icons';
3
- export const tag = 'ion-fab';
4
- export const shadowSelector = 'ion-fab-button, ion-fab-list';
5
- const hasHostMotion = (style) => style.animationName !== 'none' || style.transitionDuration.split(',').some((value) => parseFloat(value) > 0);
6
- export const read = (fab, id) => {
7
- if (fab.slot !== 'fixed' || !fab.parentElement?.matches('ion-content') || fab.contains(fab.ownerDocument.activeElement))
8
- return;
9
- const children = childElements(fab);
10
- const main = children.filter((child) => child.matches('ion-fab-button'));
11
- const lists = children.filter((child) => child.matches('ion-fab-list'));
12
- if (main.length !== 1 || main.length + lists.length !== children.length)
13
- return;
14
- if (lists.some((list) => list.closest(excluded) || childElements(list).some((child) => !child.matches('ion-fab-button'))))
15
- return;
16
- const buttons = [main[0], ...lists.flatMap((list) => childElements(list))];
17
- const style = getComputedStyle(fab);
18
- if (hasHostMotion(style))
19
- return;
20
- const transform = new DOMMatrixReadOnly(style.transform);
21
- if (!transform.is2D || transform.a !== 1 || transform.d !== 1 || transform.b || transform.c)
22
- return;
23
- const candidate = {
24
- element: fab,
25
- control: {
26
- id: id(fab),
27
- kind: tag,
28
- x: 0,
29
- y: 0,
30
- width: innerWidth,
31
- height: innerHeight,
32
- dark: isDark(style),
33
- rtl: style.direction === 'rtl',
34
- items: [],
35
- },
36
- actions: new Map(),
37
- icons: [],
38
- };
39
- for (const button of buttons) {
40
- if (!button.classList.contains('ios') || button.closest(excluded) || button.color || button.type !== 'button' || button.href)
41
- return;
42
- if (button.querySelector('input, button, a, img, canvas, video, ion-spinner, ion-avatar, ion-badge'))
43
- return;
44
- const native = button.shadowRoot?.querySelector('[part=native]');
45
- if (!native)
46
- return;
47
- const s = getComputedStyle(button), n = getComputedStyle(native);
48
- const alpha = n.backgroundColor.startsWith('rgba(') ? Number(n.backgroundColor.slice(5, -1).split(',')[3]) : 1;
49
- if (s.backgroundColor !== 'rgba(0, 0, 0, 0)' ||
50
- s.backgroundImage !== 'none' ||
51
- n.backgroundImage.includes('url(') ||
52
- !n.backdropFilter.includes('blur') ||
53
- !(alpha > 0 && alpha < 1))
54
- return;
55
- const width = parseFloat(s.width), height = parseFloat(s.height);
56
- if (!(width > 0 && height > 0) || Math.abs(width - height) > 0.5 || !n.borderRadius.includes('50%'))
57
- return;
58
- const list = button.parentElement?.matches('ion-fab-list') ? button.parentElement : undefined;
59
- const listStyle = list && getComputedStyle(list);
60
- const laidOut = s.display !== 'none' && (!listStyle || listStyle.display !== 'none');
61
- const visible = laidOut &&
62
- (!list || (list.activated && button.show && listStyle.visibility === 'visible' && Number(listStyle.opacity) > 0)) &&
63
- s.visibility === 'visible' &&
64
- Number(s.opacity) > 0;
65
- const matrix = new DOMMatrixReadOnly(s.transform);
66
- if (!matrix.is2D || matrix.b || matrix.c || matrix.e || matrix.f || matrix.a !== matrix.d || matrix.a < 0)
67
- return;
68
- if (matrix.a !== 1 && (matrix.a !== 0 || !list || button.classList.contains('fab-button-show')))
69
- return;
70
- if (laidOut && !matrix.isIdentity) {
71
- const origin = s.transformOrigin.split(' ').map(parseFloat);
72
- if (Math.abs(origin[0] - width / 2) > 0.5 || Math.abs(origin[1] - height / 2) > 0.5)
73
- return;
74
- }
75
- if (hasHostMotion(s))
76
- return;
77
- if (listStyle) {
78
- if (hasHostMotion(listStyle))
79
- return;
80
- const transform = new DOMMatrixReadOnly(listStyle.transform);
81
- if (!transform.is2D || transform.a !== 1 || transform.d !== 1 || transform.b || transform.c)
82
- return;
83
- }
84
- const rect = button.getBoundingClientRect();
85
- const x = laidOut ? rect.x + rect.width / 2 - width / 2 : 0;
86
- const y = laidOut ? rect.y + rect.height / 2 - height / 2 : 0;
87
- if (visible && (x < -1 || y < -1 || x + width > innerWidth + 1 || y + height > innerHeight + 1))
88
- return;
89
- const label = text(button);
90
- const item = {
91
- id: id(button),
92
- x,
93
- y,
94
- width,
95
- height,
96
- label,
97
- accessibilityLabel: button.getAttribute('aria-label') ?? native.getAttribute('aria-label') ?? label,
98
- disabled: button.disabled || s.pointerEvents === 'none',
99
- selected: button.activated,
100
- visible,
101
- fontSize: parseFloat(s.fontSize),
102
- fontWeight: parseInt(s.fontWeight, 10) || 400,
103
- color: n.color,
104
- };
105
- const normal = Array.from(button.querySelectorAll('ion-icon, svg'));
106
- if (normal.length > 1)
107
- return;
108
- const close = button.shadowRoot?.querySelector('ion-icon[part=close-icon]');
109
- for (const [index, icon] of [normal[0], close].entries()) {
110
- if (!icon) {
111
- if (index === 1 || !label)
112
- return;
113
- else
114
- continue;
115
- }
116
- const svg = icon.matches('svg') ? icon : icon.shadowRoot?.querySelector('svg');
117
- if (!svg)
118
- return;
119
- const iconStyle = getComputedStyle(icon);
120
- const inner = icon.shadowRoot?.querySelector('.icon-inner');
121
- if (index === 0 && inner && !new DOMMatrixReadOnly(iconStyle.transform).isIdentity)
122
- return;
123
- const transform = new DOMMatrixReadOnly(inner ? getComputedStyle(inner).transform : iconStyle.transform);
124
- const mirrored = transform.is2D && transform.a === -1 && transform.d === 1 && !transform.b && !transform.c && !transform.e && !transform.f;
125
- if (index === 0 && !transform.isIdentity && !mirrored)
126
- return;
127
- const source = iconSource(svg, index === 0 && mirrored);
128
- const iconWidth = parseFloat(iconStyle.width), iconHeight = parseFloat(iconStyle.height);
129
- const size = index === 1 ? parseFloat(iconStyle.fontSize) : iconWidth;
130
- const h = index === 1 ? size : iconHeight;
131
- if (!source || !(size > 0 && h > 0))
132
- return;
133
- if (index === 0) {
134
- item.iconWidth = size;
135
- item.iconHeight = h;
136
- }
137
- else {
138
- item.closeIconWidth = size;
139
- item.closeIconHeight = h;
140
- item.iconTransition =
141
- parseFloat(iconStyle.transitionDuration) * (iconStyle.transitionDuration.split(',')[0].trim().endsWith('ms') ? 0.001 : 1);
142
- }
143
- candidate.icons.push({ item, source, ...(index === 1 ? { field: 'closeIcon' } : {}) });
144
- }
145
- if (!visible && !list)
146
- return;
147
- candidate.control.items.push(item);
148
- if (visible)
149
- candidate.actions.set(item.id, button);
150
- }
151
- return candidate;
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { childElements, excluded, isDark, text } from "../shared/dom.js";
3
+ import { iconSource } from "../shared/icons.js";
4
+ //#region src/native/components/ion-fab.ts
5
+ var ion_fab_exports = /* @__PURE__ */ __exportAll({
6
+ read: () => read,
7
+ shadowSelector: () => shadowSelector,
8
+ tag: () => tag
9
+ });
10
+ const tag = "ion-fab";
11
+ const shadowSelector = "ion-fab-button, ion-fab-list";
12
+ const hasHostMotion = (style) => style.animationName !== "none" || style.transitionDuration.split(",").some((value) => parseFloat(value) > 0);
13
+ const read = (fab, id) => {
14
+ if (fab.slot !== "fixed" || !fab.parentElement?.matches("ion-content") || fab.contains(fab.ownerDocument.activeElement)) return;
15
+ const children = childElements(fab);
16
+ const main = children.filter((child) => child.matches("ion-fab-button"));
17
+ const lists = children.filter((child) => child.matches("ion-fab-list"));
18
+ if (main.length !== 1 || main.length + lists.length !== children.length) return;
19
+ if (lists.some((list) => list.closest(excluded) || childElements(list).some((child) => !child.matches("ion-fab-button")))) return;
20
+ const buttons = [main[0], ...lists.flatMap((list) => childElements(list))];
21
+ const style = getComputedStyle(fab);
22
+ if (hasHostMotion(style)) return;
23
+ const transform = new DOMMatrixReadOnly(style.transform);
24
+ if (!transform.is2D || transform.a !== 1 || transform.d !== 1 || transform.b || transform.c) return;
25
+ const candidate = {
26
+ element: fab,
27
+ control: {
28
+ id: id(fab),
29
+ kind: tag,
30
+ x: 0,
31
+ y: 0,
32
+ width: innerWidth,
33
+ height: innerHeight,
34
+ dark: isDark(style),
35
+ rtl: style.direction === "rtl",
36
+ items: []
37
+ },
38
+ actions: /* @__PURE__ */ new Map(),
39
+ icons: []
40
+ };
41
+ for (const button of buttons) {
42
+ if (!button.classList.contains("ios") || button.closest(excluded) || button.color || button.type !== "button" || button.href) return;
43
+ if (button.querySelector("input, button, a, img, canvas, video, ion-spinner, ion-avatar, ion-badge")) return;
44
+ const native = button.shadowRoot?.querySelector("[part=native]");
45
+ if (!native) return;
46
+ const s = getComputedStyle(button), n = getComputedStyle(native);
47
+ const alpha = n.backgroundColor.startsWith("rgba(") ? Number(n.backgroundColor.slice(5, -1).split(",")[3]) : 1;
48
+ if (s.backgroundColor !== "rgba(0, 0, 0, 0)" || s.backgroundImage !== "none" || n.backgroundImage.includes("url(") || !n.backdropFilter.includes("blur") || !(alpha > 0 && alpha < 1)) return;
49
+ const width = parseFloat(s.width), height = parseFloat(s.height);
50
+ if (!(width > 0 && height > 0) || Math.abs(width - height) > .5 || !n.borderRadius.includes("50%")) return;
51
+ const list = button.parentElement?.matches("ion-fab-list") ? button.parentElement : void 0;
52
+ const listStyle = list && getComputedStyle(list);
53
+ const laidOut = s.display !== "none" && (!listStyle || listStyle.display !== "none");
54
+ const visible = laidOut && (!list || list.activated && button.show && listStyle.visibility === "visible" && Number(listStyle.opacity) > 0) && s.visibility === "visible" && Number(s.opacity) > 0;
55
+ const matrix = new DOMMatrixReadOnly(s.transform);
56
+ if (!matrix.is2D || matrix.b || matrix.c || matrix.e || matrix.f || matrix.a !== matrix.d || matrix.a < 0) return;
57
+ if (matrix.a !== 1 && (matrix.a !== 0 || !list || button.classList.contains("fab-button-show"))) return;
58
+ if (laidOut && !matrix.isIdentity) {
59
+ const origin = s.transformOrigin.split(" ").map(parseFloat);
60
+ if (Math.abs(origin[0] - width / 2) > .5 || Math.abs(origin[1] - height / 2) > .5) return;
61
+ }
62
+ if (hasHostMotion(s)) return;
63
+ if (listStyle) {
64
+ if (hasHostMotion(listStyle)) return;
65
+ const transform = new DOMMatrixReadOnly(listStyle.transform);
66
+ if (!transform.is2D || transform.a !== 1 || transform.d !== 1 || transform.b || transform.c) return;
67
+ }
68
+ const rect = button.getBoundingClientRect();
69
+ const x = laidOut ? rect.x + rect.width / 2 - width / 2 : 0;
70
+ const y = laidOut ? rect.y + rect.height / 2 - height / 2 : 0;
71
+ if (visible && (x < -1 || y < -1 || x + width > innerWidth + 1 || y + height > innerHeight + 1)) return;
72
+ const label = text(button);
73
+ const item = {
74
+ id: id(button),
75
+ x,
76
+ y,
77
+ width,
78
+ height,
79
+ label,
80
+ accessibilityLabel: button.getAttribute("aria-label") ?? native.getAttribute("aria-label") ?? label,
81
+ disabled: button.disabled || s.pointerEvents === "none",
82
+ selected: button.activated,
83
+ visible,
84
+ fontSize: parseFloat(s.fontSize),
85
+ fontWeight: parseInt(s.fontWeight, 10) || 400,
86
+ color: n.color
87
+ };
88
+ const normal = Array.from(button.querySelectorAll("ion-icon, svg"));
89
+ if (normal.length > 1) return;
90
+ const close = button.shadowRoot?.querySelector("ion-icon[part=close-icon]");
91
+ for (const [index, icon] of [normal[0], close].entries()) {
92
+ if (!icon) {
93
+ if (index === 1 || !label) return;
94
+ else continue;
95
+ }
96
+ const svg = icon.matches("svg") ? icon : icon.shadowRoot?.querySelector("svg");
97
+ if (!svg) return;
98
+ const iconStyle = getComputedStyle(icon);
99
+ const inner = icon.shadowRoot?.querySelector(".icon-inner");
100
+ if (index === 0 && inner && !new DOMMatrixReadOnly(iconStyle.transform).isIdentity) return;
101
+ const transform = new DOMMatrixReadOnly(inner ? getComputedStyle(inner).transform : iconStyle.transform);
102
+ const mirrored = transform.is2D && transform.a === -1 && transform.d === 1 && !transform.b && !transform.c && !transform.e && !transform.f;
103
+ if (index === 0 && !transform.isIdentity && !mirrored) return;
104
+ const source = iconSource(svg, index === 0 && mirrored);
105
+ const iconWidth = parseFloat(iconStyle.width), iconHeight = parseFloat(iconStyle.height);
106
+ const size = index === 1 ? parseFloat(iconStyle.fontSize) : iconWidth;
107
+ const h = index === 1 ? size : iconHeight;
108
+ if (!source || !(size > 0 && h > 0)) return;
109
+ if (index === 0) {
110
+ item.iconWidth = size;
111
+ item.iconHeight = h;
112
+ } else {
113
+ item.closeIconWidth = size;
114
+ item.closeIconHeight = h;
115
+ item.iconTransition = parseFloat(iconStyle.transitionDuration) * (iconStyle.transitionDuration.split(",")[0].trim().endsWith("ms") ? .001 : 1);
116
+ }
117
+ candidate.icons.push({
118
+ item,
119
+ source,
120
+ ...index === 1 ? { field: "closeIcon" } : {}
121
+ });
122
+ }
123
+ if (!visible && !list) return;
124
+ candidate.control.items.push(item);
125
+ if (visible) candidate.actions.set(item.id, button);
126
+ }
127
+ return candidate;
152
128
  };
129
+ //#endregion
130
+ export { ion_fab_exports, read, shadowSelector, tag };
131
+
132
+ //# sourceMappingURL=ion-fab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ion-fab.js","names":[],"sources":["../../../src/native/components/ion-fab.ts"],"sourcesContent":["import type { Candidate } from '../shared/candidate';\nimport { childElements, excluded, isDark, text } from '../shared/dom';\nimport { iconSource } from '../shared/icons';\nimport type { ShellItem } from '../definitions';\n\nexport const tag = 'ion-fab';\nexport const shadowSelector = 'ion-fab-button, ion-fab-list';\n\nconst hasHostMotion = (style: CSSStyleDeclaration): boolean =>\n style.animationName !== 'none' || style.transitionDuration.split(',').some((value) => parseFloat(value) > 0);\n\n// FAB owns the batch; only its buttons draw glass. Closed lists keep their IDs\n// and resolved artwork, without inventing layout for display:none descendants.\nexport const read = (fab: HTMLElement, id: (element: HTMLElement) => string): Candidate | undefined => {\n if (fab.slot !== 'fixed' || !fab.parentElement?.matches('ion-content') || fab.contains(fab.ownerDocument.activeElement)) return;\n const children = childElements(fab);\n const main = children.filter((child) => child.matches('ion-fab-button'));\n const lists = children.filter((child) => child.matches('ion-fab-list'));\n if (main.length !== 1 || main.length + lists.length !== children.length) return;\n if (lists.some((list) => list.closest(excluded) || childElements(list).some((child) => !child.matches('ion-fab-button')))) return;\n const buttons = [main[0], ...lists.flatMap((list) => childElements(list))] as HTMLIonFabButtonElement[];\n const style = getComputedStyle(fab);\n if (hasHostMotion(style)) return;\n const transform = new DOMMatrixReadOnly(style.transform);\n if (!transform.is2D || transform.a !== 1 || transform.d !== 1 || transform.b || transform.c) return;\n const candidate: Candidate = {\n element: fab,\n control: {\n id: id(fab),\n kind: tag,\n x: 0,\n y: 0,\n width: innerWidth,\n height: innerHeight,\n dark: isDark(style),\n rtl: style.direction === 'rtl',\n items: [],\n },\n actions: new Map(),\n icons: [],\n };\n for (const button of buttons) {\n if (!button.classList.contains('ios') || button.closest(excluded) || button.color || button.type !== 'button' || button.href) return;\n if (button.querySelector('input, button, a, img, canvas, video, ion-spinner, ion-avatar, ion-badge')) return;\n const native = button.shadowRoot?.querySelector<HTMLElement>('[part=native]');\n if (!native) return;\n const s = getComputedStyle(button),\n n = getComputedStyle(native);\n // An opaque custom host/background or custom shape cannot be discarded.\n const alpha = n.backgroundColor.startsWith('rgba(') ? Number(n.backgroundColor.slice(5, -1).split(',')[3]) : 1;\n if (\n s.backgroundColor !== 'rgba(0, 0, 0, 0)' ||\n s.backgroundImage !== 'none' ||\n n.backgroundImage.includes('url(') ||\n !n.backdropFilter.includes('blur') ||\n !(alpha > 0 && alpha < 1)\n )\n return;\n const width = parseFloat(s.width),\n height = parseFloat(s.height);\n if (!(width > 0 && height > 0) || Math.abs(width - height) > 0.5 || !n.borderRadius.includes('50%')) return;\n const list = button.parentElement?.matches('ion-fab-list') ? (button.parentElement as HTMLIonFabListElement) : undefined;\n const listStyle = list && getComputedStyle(list);\n const laidOut = s.display !== 'none' && (!listStyle || listStyle.display !== 'none');\n const visible =\n laidOut &&\n (!list || (list.activated && button.show && listStyle!.visibility === 'visible' && Number(listStyle!.opacity) > 0)) &&\n s.visibility === 'visible' &&\n Number(s.opacity) > 0;\n // Standard scale is centered: even scale(0) retains its actual layout center.\n // Static list translation is already included in the DOM rect (including RTL).\n const matrix = new DOMMatrixReadOnly(s.transform);\n if (!matrix.is2D || matrix.b || matrix.c || matrix.e || matrix.f || matrix.a !== matrix.d || matrix.a < 0) return;\n // Only Ionic's hidden list child may use scale(0). Custom static scaling\n // changes the actual glass/hit area and must retain its Web rendering.\n // Stencil updates show before rendering its host class. Judge the rendered\n // scale against that class so this normal one-frame gap keeps its cover.\n if (matrix.a !== 1 && (matrix.a !== 0 || !list || button.classList.contains('fab-button-show'))) return;\n if (laidOut && !matrix.isIdentity) {\n const origin = s.transformOrigin.split(' ').map(parseFloat);\n if (Math.abs(origin[0] - width / 2) > 0.5 || Math.abs(origin[1] - height / 2) > 0.5) return;\n }\n // Ionic's list appearance is staggered show changes, without a host CSS\n // transition. Custom host animations keep their complete Web rendering.\n if (hasHostMotion(s)) return;\n if (listStyle) {\n if (hasHostMotion(listStyle)) return;\n const transform = new DOMMatrixReadOnly(listStyle.transform);\n if (!transform.is2D || transform.a !== 1 || transform.d !== 1 || transform.b || transform.c) return;\n }\n const rect = button.getBoundingClientRect();\n const x = laidOut ? rect.x + rect.width / 2 - width / 2 : 0;\n const y = laidOut ? rect.y + rect.height / 2 - height / 2 : 0;\n if (visible && (x < -1 || y < -1 || x + width > innerWidth + 1 || y + height > innerHeight + 1)) return;\n const label = text(button);\n const item: ShellItem = {\n id: id(button),\n x,\n y,\n width,\n height,\n label,\n accessibilityLabel: button.getAttribute('aria-label') ?? native.getAttribute('aria-label') ?? label,\n disabled: button.disabled || s.pointerEvents === 'none',\n selected: button.activated,\n visible,\n fontSize: parseFloat(s.fontSize),\n fontWeight: parseInt(s.fontWeight, 10) || 400,\n color: n.color,\n };\n const normal = Array.from(button.querySelectorAll('ion-icon, svg'));\n if (normal.length > 1) return;\n const close = button.shadowRoot?.querySelector<HTMLElement>('ion-icon[part=close-icon]');\n for (const [index, icon] of [normal[0], close].entries()) {\n if (!icon) {\n if (index === 1 || !label) return;\n else continue;\n }\n const svg = icon.matches('svg') ? (icon as SVGElement) : icon.shadowRoot?.querySelector<SVGElement>('svg');\n if (!svg) return;\n const iconStyle = getComputedStyle(icon);\n const inner = icon.shadowRoot?.querySelector('.icon-inner');\n if (index === 0 && inner && !new DOMMatrixReadOnly(iconStyle.transform).isIdentity) return;\n const transform = new DOMMatrixReadOnly(inner ? getComputedStyle(inner).transform : iconStyle.transform);\n const mirrored =\n transform.is2D && transform.a === -1 && transform.d === 1 && !transform.b && !transform.c && !transform.e && !transform.f;\n if (index === 0 && !transform.isIdentity && !mirrored) return;\n const source = iconSource(svg, index === 0 && mirrored);\n const iconWidth = parseFloat(iconStyle.width),\n iconHeight = parseFloat(iconStyle.height);\n // The internal close-icon fills the button vertically; its glyph uses font-size.\n const size = index === 1 ? parseFloat(iconStyle.fontSize) : iconWidth;\n const h = index === 1 ? size : iconHeight;\n if (!source || !(size > 0 && h > 0)) return;\n if (index === 0) {\n item.iconWidth = size;\n item.iconHeight = h;\n } else {\n item.closeIconWidth = size;\n item.closeIconHeight = h;\n item.iconTransition =\n parseFloat(iconStyle.transitionDuration) * (iconStyle.transitionDuration.split(',')[0].trim().endsWith('ms') ? 0.001 : 1);\n }\n candidate.icons.push({ item, source, ...(index === 1 ? { field: 'closeIcon' as const } : {}) });\n }\n if (!visible && !list) return;\n candidate.control.items.push(item);\n if (visible) candidate.actions.set(item.id, button);\n }\n return candidate;\n};\n"],"mappings":";;;;;;;;;AAKA,MAAa,MAAM;AACnB,MAAa,iBAAiB;AAE9B,MAAM,iBAAiB,UACrB,MAAM,kBAAkB,UAAU,MAAM,mBAAmB,MAAM,GAAG,CAAC,CAAC,MAAM,UAAU,WAAW,KAAK,IAAI,CAAC;AAI7G,MAAa,QAAQ,KAAkB,OAAgE;CACrG,IAAI,IAAI,SAAS,WAAW,CAAC,IAAI,eAAe,QAAQ,aAAa,KAAK,IAAI,SAAS,IAAI,cAAc,aAAa,GAAG;CACzH,MAAM,WAAW,cAAc,GAAG;CAClC,MAAM,OAAO,SAAS,QAAQ,UAAU,MAAM,QAAQ,gBAAgB,CAAC;CACvE,MAAM,QAAQ,SAAS,QAAQ,UAAU,MAAM,QAAQ,cAAc,CAAC;CACtE,IAAI,KAAK,WAAW,KAAK,KAAK,SAAS,MAAM,WAAW,SAAS,QAAQ;CACzE,IAAI,MAAM,MAAM,SAAS,KAAK,QAAQ,QAAQ,KAAK,cAAc,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,MAAM,QAAQ,gBAAgB,CAAC,CAAC,GAAG;CAC3H,MAAM,UAAU,CAAC,KAAK,IAAI,GAAG,MAAM,SAAS,SAAS,cAAc,IAAI,CAAC,CAAC;CACzE,MAAM,QAAQ,iBAAiB,GAAG;CAClC,IAAI,cAAc,KAAK,GAAG;CAC1B,MAAM,YAAY,IAAI,kBAAkB,MAAM,SAAS;CACvD,IAAI,CAAC,UAAU,QAAQ,UAAU,MAAM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AM,IAAI,UAAU,IAAI,OAAO;GAC/B,IAAI,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,IAAI;GACrC,IAAI,UAAU,GAAG;IACf,KAAK,YAAY;IACjB,KAAK,aAAa;GACpB,OAAO;IACL,KAAK,iBAAiB;IACtB,KAAK,kBAAkB;IACvB,KAAK,iBACH,WAAW,UAAU,kBAAkB,KAAK,UAAU,mBAAmB,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,SAAS,IAAI,IAAI,OAAQ;GAC3H;GACA,UAAU,MAAM,KAAK;IAAE;IAAM;IAAQ,GAAI,UAAU,IAAI,EAAE,OAAO,YAAqB,IAAI,CAAC;GAAG,CAAC;EAChG;EACA,IAAI,CAAC,WAAW,CAAC,MAAM;EACvB,UAAU,QAAQ,MAAM,KAAK,IAAI;EACjC,IAAI,SAAS,UAAU,QAAQ,IAAI,KAAK,IAAI,MAAM;CACpD;CACA,OAAO;AACT"}
@@ -1,7 +1,13 @@
1
- import type { Candidate, Identify } from '../shared/candidate';
1
+ import { VerticalControlAreaOptions } from "../definitions.js";
2
+ import { Candidate, Identify } from "../shared/candidate.js";
3
+ declare namespace ion_menu_button_d_exports {
4
+ export { append, read, selector, shadowSelector, tag };
5
+ }
2
6
  export declare const tag = "ion-menu-button";
3
7
  export declare const selector = "";
4
8
  export declare const shadowSelector = "ion-menu-button";
5
9
  export declare const append: (candidate: Candidate, button: HTMLIonMenuButtonElement, id: Identify) => boolean;
6
- export declare const read: (group: HTMLElement, id: Identify) => Candidate | undefined;
10
+ export declare const read: (group: HTMLElement, id: Identify, options?: VerticalControlAreaOptions) => Candidate | undefined;
11
+ //#endregion
12
+ export { ion_menu_button_d_exports };
7
13
  //# sourceMappingURL=ion-menu-button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ion-menu-button.d.ts","sourceRoot":"","sources":["../../../src/native/components/ion-menu-button.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/D,eAAO,MAAM,GAAG,oBAAoB,CAAC;AAErC,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,cAAc,oBAAM,CAAC;AAElC,eAAO,MAAM,MAAM,GAAI,WAAW,SAAS,EAAE,QAAQ,wBAAwB,EAAE,IAAI,QAAQ,KAAG,OAI7F,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,OAAO,WAAW,EAAE,IAAI,QAAQ,KAAG,SAAS,GAAG,SAOnE,CAAC"}
1
+ {"version":3,"file":"ion-menu-button.d.ts","names":[],"sources":["../../../src/native/components/ion-menu-button.ts"],"mappings":";;;;;qBAKa;qBAEA;qBACA;qBAEA,SAAU,WAAW,WAAW,QAAQ,0BAA0B,IAAI;qBAMtE,OAAQ,OAAO,aAAa,IAAI,UAAU,UAAS,+BAAkC"}
@@ -1,21 +1,31 @@
1
- import { createCandidate, appendItem } from '../shared/candidate';
2
- import { childElements, inFixedToolbar } from '../shared/dom';
3
- export const tag = 'ion-menu-button';
4
- export const selector = '';
5
- export const shadowSelector = tag;
6
- export const append = (candidate, button, id) => {
7
- if (button.type !== 'button')
8
- return false;
9
- const content = !button.shadowRoot?.querySelector('slot')?.assignedNodes().length ? button.shadowRoot : button;
10
- return !!content && !!appendItem(candidate, button, id, content);
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { childElements, inFixedToolbar } from "../shared/dom.js";
3
+ import { appendItem, createCandidate } from "../shared/candidate.js";
4
+ //#region src/native/components/ion-menu-button.ts
5
+ var ion_menu_button_exports = /* @__PURE__ */ __exportAll({
6
+ append: () => append,
7
+ read: () => read,
8
+ selector: () => "",
9
+ shadowSelector: () => shadowSelector,
10
+ tag: () => tag
11
+ });
12
+ const tag = "ion-menu-button";
13
+ const selector = "";
14
+ const shadowSelector = tag;
15
+ const append = (candidate, button, id) => {
16
+ if (button.type !== "button") return false;
17
+ const content = !button.shadowRoot?.querySelector("slot")?.assignedNodes().length ? button.shadowRoot : button;
18
+ return !!content && !!appendItem(candidate, button, id, content);
11
19
  };
12
- export const read = (group, id) => {
13
- const children = group.matches('ion-buttons') ? childElements(group) : [];
14
- if (!inFixedToolbar(group) || children.length !== 1)
15
- return;
16
- const button = children[0];
17
- if (!button?.matches(`${tag}${group.closest('ion-app.ios-theme-vertical-bars') ? '' : '.ios'}`))
18
- return;
19
- const candidate = createCandidate(group, tag, id);
20
- return append(candidate, button, id) ? candidate : undefined;
20
+ const read = (group, id, options = {}) => {
21
+ const children = group.matches("ion-buttons") ? childElements(group) : [];
22
+ if (!inFixedToolbar(group) || children.length !== 1) return;
23
+ const button = children[0];
24
+ if (!button?.matches(`ion-menu-button${group.closest("ion-app.ios-theme-vertical-bars") ? "" : ".ios"}`)) return;
25
+ const candidate = createCandidate(group, tag, id, options);
26
+ return append(candidate, button, id) ? candidate : void 0;
21
27
  };
28
+ //#endregion
29
+ export { append, ion_menu_button_exports, read, selector, shadowSelector, tag };
30
+
31
+ //# sourceMappingURL=ion-menu-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ion-menu-button.js","names":[],"sources":["../../../src/native/components/ion-menu-button.ts"],"sourcesContent":["import { createCandidate, appendItem } from '../shared/candidate';\nimport type { Candidate, Identify } from '../shared/candidate';\nimport type { VerticalControlAreaOptions } from '../definitions';\nimport { childElements, inFixedToolbar } from '../shared/dom';\n\nexport const tag = 'ion-menu-button';\n// The glass and projection ownership belong to ion-buttons, even for one menu button.\nexport const selector = '';\nexport const shadowSelector = tag;\n\nexport const append = (candidate: Candidate, button: HTMLIonMenuButtonElement, id: Identify): boolean => {\n if (button.type !== 'button') return false;\n const content = !button.shadowRoot?.querySelector('slot')?.assignedNodes().length ? button.shadowRoot : button;\n return !!content && !!appendItem(candidate, button, id, content);\n};\n\nexport const read = (group: HTMLElement, id: Identify, options: VerticalControlAreaOptions = {}): Candidate | undefined => {\n const children = group.matches('ion-buttons') ? childElements(group) : [];\n if (!inFixedToolbar(group) || children.length !== 1) return;\n const button = children[0];\n if (!button?.matches(`${tag}${group.closest('ion-app.ios-theme-vertical-bars') ? '' : '.ios'}`)) return;\n const candidate = createCandidate(group, tag, id, options);\n return append(candidate, button as HTMLIonMenuButtonElement, id) ? candidate : undefined;\n};\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,MAAM;AAEnB,MAAa,WAAW;AACxB,MAAa,iBAAiB;AAE9B,MAAa,UAAU,WAAsB,QAAkC,OAA0B;CACvG,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,MAAM,UAAU,CAAC,OAAO,YAAY,cAAc,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,SAAS,OAAO,aAAa;CACxG,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,WAAW,QAAQ,IAAI,OAAO;AACjE;AAEA,MAAa,QAAQ,OAAoB,IAAc,UAAsC,CAAC,MAA6B;CACzH,MAAM,WAAW,MAAM,QAAQ,aAAa,IAAI,cAAc,KAAK,IAAI,CAAC;CACxE,IAAI,CAAC,eAAe,KAAK,KAAK,SAAS,WAAW,GAAG;CACrD,MAAM,SAAS,SAAS;CACxB,IAAI,CAAC,QAAQ,QAAQ,kBAAS,MAAM,QAAQ,iCAAiC,IAAI,KAAK,QAAQ,GAAG;CACjG,MAAM,YAAY,gBAAgB,OAAO,KAAK,IAAI,OAAO;CACzD,OAAO,OAAO,WAAW,QAAoC,EAAE,IAAI,YAAY,KAAA;AACjF"}
@@ -1,6 +1,11 @@
1
- import type { Candidate, Identify } from '../shared/candidate';
1
+ import { Candidate, Identify } from "../shared/candidate.js";
2
+ declare namespace ion_segment_d_exports {
3
+ export { read, shadowSelector, tag, tracksMotion };
4
+ }
2
5
  export declare const tag = "ion-segment";
3
6
  export declare const shadowSelector = "ion-segment-button";
4
7
  export declare const tracksMotion = true;
5
8
  export declare const read: (element: HTMLElement, id: Identify) => Candidate | undefined;
9
+ //#endregion
10
+ export { ion_segment_d_exports };
6
11
  //# sourceMappingURL=ion-segment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ion-segment.d.ts","sourceRoot":"","sources":["../../../src/native/components/ion-segment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/D,eAAO,MAAM,GAAG,gBAAgB,CAAC;AACjC,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,eAAO,MAAM,IAAI,GAAI,SAAS,WAAW,EAAE,IAAI,QAAQ,KAAG,SAAS,GAAG,SAkBrE,CAAC"}
1
+ {"version":3,"file":"ion-segment.d.ts","names":[],"sources":["../../../src/native/components/ion-segment.ts"],"mappings":";;;;qBAIa;qBACA;qBACA;qBAEA,OAAQ,SAAS,aAAa,IAAI,aAAW"}
@@ -1,24 +1,30 @@
1
- import { createCandidate, appendItem } from '../shared/candidate';
2
- import { inFixedToolbar } from '../shared/dom';
3
- export const tag = 'ion-segment';
4
- export const shadowSelector = 'ion-segment-button';
5
- export const tracksMotion = true;
6
- export const read = (element, id) => {
7
- const segment = element;
8
- if (!inFixedToolbar(element) ||
9
- segment.scrollable ||
10
- element.classList.contains('segment-expand') ||
11
- element.querySelector('ion-segment-button[content-id]'))
12
- return;
13
- const children = Array.from(element.querySelectorAll(':scope > ion-segment-button'));
14
- if (!children.length)
15
- return;
16
- const candidate = createCandidate(element, tag, id);
17
- for (const child of children) {
18
- const item = appendItem(candidate, child, id);
19
- if (!item || (item.label && item.iconWidth))
20
- return;
21
- item.selected = segment.value === child.value;
22
- }
23
- return candidate;
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { inFixedToolbar } from "../shared/dom.js";
3
+ import { appendItem, createCandidate } from "../shared/candidate.js";
4
+ //#region src/native/components/ion-segment.ts
5
+ var ion_segment_exports = /* @__PURE__ */ __exportAll({
6
+ read: () => read,
7
+ shadowSelector: () => shadowSelector,
8
+ tag: () => tag,
9
+ tracksMotion: () => true
10
+ });
11
+ const tag = "ion-segment";
12
+ const shadowSelector = "ion-segment-button";
13
+ const tracksMotion = true;
14
+ const read = (element, id) => {
15
+ const segment = element;
16
+ if (!inFixedToolbar(element) || segment.scrollable || element.classList.contains("segment-expand") || element.querySelector("ion-segment-button[content-id]")) return;
17
+ const children = Array.from(element.querySelectorAll(":scope > ion-segment-button"));
18
+ if (!children.length) return;
19
+ const candidate = createCandidate(element, tag, id);
20
+ for (const child of children) {
21
+ const item = appendItem(candidate, child, id);
22
+ if (!item || item.label && item.iconWidth) return;
23
+ item.selected = segment.value === child.value;
24
+ }
25
+ return candidate;
24
26
  };
27
+ //#endregion
28
+ export { ion_segment_exports, read, shadowSelector, tag, tracksMotion };
29
+
30
+ //# sourceMappingURL=ion-segment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ion-segment.js","names":[],"sources":["../../../src/native/components/ion-segment.ts"],"sourcesContent":["import { createCandidate, appendItem } from '../shared/candidate';\nimport type { Candidate, Identify } from '../shared/candidate';\nimport { inFixedToolbar } from '../shared/dom';\n\nexport const tag = 'ion-segment';\nexport const shadowSelector = 'ion-segment-button';\nexport const tracksMotion = true;\n\nexport const read = (element: HTMLElement, id: Identify): Candidate | undefined => {\n const segment = element as HTMLIonSegmentElement;\n if (\n !inFixedToolbar(element) ||\n segment.scrollable ||\n element.classList.contains('segment-expand') ||\n element.querySelector('ion-segment-button[content-id]')\n )\n return;\n const children = Array.from(element.querySelectorAll<HTMLIonSegmentButtonElement>(':scope > ion-segment-button'));\n if (!children.length) return;\n const candidate = createCandidate(element, tag, id);\n for (const child of children) {\n const item = appendItem(candidate, child, id);\n if (!item || (item.label && item.iconWidth)) return;\n item.selected = segment.value === child.value;\n }\n return candidate;\n};\n"],"mappings":";;;;;;;;;;AAIA,MAAa,MAAM;AACnB,MAAa,iBAAiB;AAC9B,MAAa,eAAe;AAE5B,MAAa,QAAQ,SAAsB,OAAwC;CACjF,MAAM,UAAU;CAChB,IACE,CAAC,eAAe,OAAO,KACvB,QAAQ,cACR,QAAQ,UAAU,SAAS,gBAAgB,KAC3C,QAAQ,cAAc,gCAAgC,GAEtD;CACF,MAAM,WAAW,MAAM,KAAK,QAAQ,iBAA8C,6BAA6B,CAAC;CAChH,IAAI,CAAC,SAAS,QAAQ;CACtB,MAAM,YAAY,gBAAgB,SAAS,KAAK,EAAE;CAClD,KAAK,MAAM,SAAS,UAAU;EAC5B,MAAM,OAAO,WAAW,WAAW,OAAO,EAAE;EAC5C,IAAI,CAAC,QAAS,KAAK,SAAS,KAAK,WAAY;EAC7C,KAAK,WAAW,QAAQ,UAAU,MAAM;CAC1C;CACA,OAAO;AACT"}
@@ -1,6 +1,11 @@
1
- import type { Candidate, Identify } from '../shared/candidate';
1
+ import { Candidate, Identify } from "../shared/candidate.js";
2
+ declare namespace ion_tab_bar_d_exports {
3
+ export { read, shadowSelector, tag, tracksMotion };
4
+ }
2
5
  export declare const tag = "ion-tab-bar";
3
6
  export declare const shadowSelector = "ion-tab-button";
4
7
  export declare const tracksMotion = true;
5
8
  export declare const read: (element: HTMLElement, id: Identify) => Candidate | undefined;
9
+ //#endregion
10
+ export { ion_tab_bar_d_exports };
6
11
  //# sourceMappingURL=ion-tab-bar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ion-tab-bar.d.ts","sourceRoot":"","sources":["../../../src/native/components/ion-tab-bar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/D,eAAO,MAAM,GAAG,gBAAgB,CAAC;AACjC,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,eAAO,MAAM,IAAI,GAAI,SAAS,WAAW,EAAE,IAAI,QAAQ,KAAG,SAAS,GAAG,SA0CrE,CAAC"}
1
+ {"version":3,"file":"ion-tab-bar.d.ts","names":[],"sources":["../../../src/native/components/ion-tab-bar.ts"],"mappings":";;;;qBAGa;qBACA;qBACA;qBAEA,OAAQ,SAAS,aAAa,IAAI,aAAW"}
@@ -1,41 +1,50 @@
1
- import { createCandidate, appendItem } from '../shared/candidate';
2
- export const tag = 'ion-tab-bar';
3
- export const shadowSelector = 'ion-tab-button';
4
- export const tracksMotion = true;
5
- export const read = (element, id) => {
6
- if (element.closest('ion-content'))
7
- return;
8
- const children = Array.from(element.querySelectorAll(':scope > ion-tab-button:not(.ion-cloned-element)'));
9
- if (!children.length)
10
- return;
11
- const width = children[0].getBoundingClientRect().width;
12
- if (children.some((child) => (child.layout ?? 'icon-top') !== 'icon-top' ||
13
- Math.abs(child.getBoundingClientRect().width - width) > 1))
14
- return undefined;
15
- const candidate = createCandidate(element, tag, id);
16
- const style = getComputedStyle(element);
17
- const rtl = style.direction === 'rtl';
18
- const position = ['start', 'center', 'end'].find((value) => element.classList.contains(`tab-bar-position-${value}`));
19
- candidate.control.tabBarAnchor = {
20
- x: position === 'center' ? 0.5 : position ? ((position === 'start') !== rtl ? 0 : 1) : style.left !== 'auto' ? 0 : 1,
21
- y: element.slot === 'bottom' ? 1 : 0,
22
- };
23
- for (const child of children) {
24
- const item = appendItem(candidate, child, id);
25
- if (!item)
26
- return;
27
- const svg = child.querySelector('svg') ?? child.querySelector('ion-icon')?.shadowRoot?.querySelector('svg');
28
- if (svg) {
29
- item.iconPosition = 'top';
30
- const color = getComputedStyle(svg).color;
31
- const shapes = Array.from(svg.querySelectorAll('path, rect, circle, ellipse, line, polygon, polyline'));
32
- item.iconTemplate =
33
- shapes.length > 0 &&
34
- shapes.every((shape) => {
35
- const paint = getComputedStyle(shape);
36
- return [paint.fill, paint.stroke].every((value) => value === 'none' || value === color);
37
- });
38
- }
39
- }
40
- return candidate;
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { appendItem, createCandidate } from "../shared/candidate.js";
3
+ //#region src/native/components/ion-tab-bar.ts
4
+ var ion_tab_bar_exports = /* @__PURE__ */ __exportAll({
5
+ read: () => read,
6
+ shadowSelector: () => shadowSelector,
7
+ tag: () => tag,
8
+ tracksMotion: () => true
9
+ });
10
+ const tag = "ion-tab-bar";
11
+ const shadowSelector = "ion-tab-button";
12
+ const tracksMotion = true;
13
+ const read = (element, id) => {
14
+ if (element.closest("ion-content")) return;
15
+ const children = Array.from(element.querySelectorAll(":scope > ion-tab-button:not(.ion-cloned-element)"));
16
+ if (!children.length) return;
17
+ const width = children[0].getBoundingClientRect().width;
18
+ if (children.some((child) => (child.layout ?? "icon-top") !== "icon-top" || Math.abs(child.getBoundingClientRect().width - width) > 1)) return void 0;
19
+ const candidate = createCandidate(element, tag, id);
20
+ const style = getComputedStyle(element);
21
+ const rtl = style.direction === "rtl";
22
+ const position = [
23
+ "start",
24
+ "center",
25
+ "end"
26
+ ].find((value) => element.classList.contains(`tab-bar-position-${value}`));
27
+ candidate.control.tabBarAnchor = {
28
+ x: position === "center" ? .5 : position ? position === "start" !== rtl ? 0 : 1 : style.left !== "auto" ? 0 : 1,
29
+ y: element.slot === "bottom" ? 1 : 0
30
+ };
31
+ for (const child of children) {
32
+ const item = appendItem(candidate, child, id);
33
+ if (!item) return;
34
+ const svg = child.querySelector("svg") ?? child.querySelector("ion-icon")?.shadowRoot?.querySelector("svg");
35
+ if (svg) {
36
+ item.iconPosition = "top";
37
+ const color = getComputedStyle(svg).color;
38
+ const shapes = Array.from(svg.querySelectorAll("path, rect, circle, ellipse, line, polygon, polyline"));
39
+ item.iconTemplate = shapes.length > 0 && shapes.every((shape) => {
40
+ const paint = getComputedStyle(shape);
41
+ return [paint.fill, paint.stroke].every((value) => value === "none" || value === color);
42
+ });
43
+ }
44
+ }
45
+ return candidate;
41
46
  };
47
+ //#endregion
48
+ export { ion_tab_bar_exports, read, shadowSelector, tag, tracksMotion };
49
+
50
+ //# sourceMappingURL=ion-tab-bar.js.map