@ionic/core 8.8.6-dev.11777668103.132817bd → 8.8.6-dev.11777928681.1e4919af

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 (305) hide show
  1. package/components/ion-action-sheet.js +1 -1
  2. package/components/ion-alert.js +1 -1
  3. package/components/ion-back-button.js +1 -1
  4. package/components/ion-button.js +1 -1
  5. package/components/ion-card.js +1 -1
  6. package/components/ion-chip.js +1 -1
  7. package/components/ion-col.js +1 -1
  8. package/components/ion-datetime-button.js +1 -1
  9. package/components/ion-datetime.js +1 -1
  10. package/components/ion-fab-button.js +1 -1
  11. package/components/ion-grid.js +1 -1
  12. package/components/ion-header.js +1 -1
  13. package/components/ion-img.js +1 -1
  14. package/components/ion-infinite-scroll-content.js +1 -1
  15. package/components/ion-infinite-scroll.js +1 -1
  16. package/components/ion-input-otp.js +1 -1
  17. package/components/ion-input-password-toggle.js +1 -1
  18. package/components/ion-input.js +1 -1
  19. package/components/ion-item-divider.js +1 -1
  20. package/components/ion-item-group.js +1 -1
  21. package/components/ion-item-option.js +1 -1
  22. package/components/ion-item-options.js +1 -1
  23. package/components/ion-item-sliding.js +1 -1
  24. package/components/ion-item.js +1 -1
  25. package/components/ion-label.js +1 -1
  26. package/components/ion-list-header.js +1 -1
  27. package/components/ion-list.js +1 -1
  28. package/components/ion-loading.js +1 -1
  29. package/components/ion-menu-button.js +1 -1
  30. package/components/ion-menu-toggle.js +1 -1
  31. package/components/ion-menu.js +1 -1
  32. package/components/ion-modal.js +1 -1
  33. package/components/ion-nav-link.js +1 -1
  34. package/components/ion-nav.js +1 -1
  35. package/components/ion-note.js +1 -1
  36. package/components/ion-picker-column-option.js +1 -1
  37. package/components/ion-picker-legacy-column.js +1 -1
  38. package/components/ion-picker-legacy.js +1 -1
  39. package/components/ion-popover.js +1 -1
  40. package/components/ion-progress-bar.js +1 -1
  41. package/components/ion-radio-group.js +1 -1
  42. package/components/ion-radio.js +1 -1
  43. package/components/ion-range.js +1 -1
  44. package/components/ion-refresher-content.js +1 -1
  45. package/components/ion-refresher.js +1 -1
  46. package/components/ion-reorder-group.js +1 -1
  47. package/components/ion-reorder.js +1 -1
  48. package/components/ion-ripple-effect.js +1 -1
  49. package/components/ion-router-link.js +1 -1
  50. package/components/ion-router-outlet.js +1 -1
  51. package/components/ion-row.js +1 -1
  52. package/components/ion-searchbar.js +1 -1
  53. package/components/ion-segment-button.js +1 -1
  54. package/components/ion-segment-content.js +1 -1
  55. package/components/ion-segment-view.js +1 -1
  56. package/components/ion-segment.js +1 -1
  57. package/components/ion-select-modal.js +1 -1
  58. package/components/ion-select-option.js +1 -1
  59. package/components/ion-select-popover.js +1 -1
  60. package/components/ion-select.js +1 -1
  61. package/components/ion-skeleton-text.js +1 -1
  62. package/components/ion-spinner.js +1 -1
  63. package/components/ion-split-pane.js +1 -1
  64. package/components/ion-tab-bar.js +1 -1
  65. package/components/ion-tab-button.js +1 -1
  66. package/components/ion-tab.js +1 -1
  67. package/components/ion-tabs.js +1 -1
  68. package/components/ion-text.js +1 -1
  69. package/components/ion-textarea.js +1 -1
  70. package/components/ion-thumbnail.js +1 -1
  71. package/components/ion-title.js +1 -1
  72. package/components/ion-toast.js +1 -1
  73. package/components/ion-toggle.js +1 -1
  74. package/components/ion-toolbar.js +1 -1
  75. package/components/{p-Di5rHO3q.js → p-BTYqyHph.js} +1 -1
  76. package/components/{p-BqImG3uk.js → p-BU8N7ZrK.js} +1 -1
  77. package/components/{p-BXcCGjEc.js → p-BfHB6wX_.js} +1 -1
  78. package/components/{p-CIoAIKEr.js → p-BhfW3d9j.js} +1 -1
  79. package/components/{p-B71c6yUH.js → p-Brxa0j7O.js} +1 -1
  80. package/components/{p-IMXp2Inn.js → p-BtAlyZ0b.js} +1 -1
  81. package/components/{p-BCFZKMI6.js → p-ByuCfbYy.js} +1 -1
  82. package/components/{p-DXUyXgVL.js → p-C-_EGKki.js} +1 -1
  83. package/components/{p-BFbsici0.js → p-C2cZvGcF.js} +1 -1
  84. package/components/{p-DTtRWhIZ.js → p-CdYTq34D.js} +1 -1
  85. package/components/{p-DH_9VCbD.js → p-CeYwuysM.js} +1 -1
  86. package/components/p-CnOTQxHB.js +4 -0
  87. package/components/{p-CoFqDNc5.js → p-CnwZE7CW.js} +1 -1
  88. package/components/{p-BLCuPAtN.js → p-CoarhFWH.js} +1 -1
  89. package/components/{p-C8ktKu9j.js → p-D5lMX0xt.js} +1 -1
  90. package/components/{p-TR4ubkPu.js → p-DAeMHNER.js} +1 -1
  91. package/components/{p-BRWWcnBq.js → p-GnGGIfCd.js} +1 -1
  92. package/components/{p-DAv9P_LE.js → p-TpZHKDyk.js} +1 -1
  93. package/components/p-XFUFdPrc.js +4 -0
  94. package/components/p-tYh73xQe.js +4 -0
  95. package/dist/cjs/ion-app_8.cjs.entry.js +7 -7
  96. package/dist/cjs/ion-avatar_3.cjs.entry.js +2 -2
  97. package/dist/cjs/ion-col_3.cjs.entry.js +6 -8
  98. package/dist/cjs/ion-datetime_3.cjs.entry.js +4 -4
  99. package/dist/cjs/ion-img.cjs.entry.js +2 -2
  100. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +3 -3
  101. package/dist/cjs/ion-input-otp.cjs.entry.js +3 -3
  102. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +3 -3
  103. package/dist/cjs/ion-input.cjs.entry.js +4 -4
  104. package/dist/cjs/ion-item-option_3.cjs.entry.js +4 -4
  105. package/dist/cjs/ion-item_8.cjs.entry.js +12 -12
  106. package/dist/cjs/ion-loading.cjs.entry.js +2 -2
  107. package/dist/cjs/ion-menu_3.cjs.entry.js +6 -6
  108. package/dist/cjs/ion-modal.cjs.entry.js +4 -4
  109. package/dist/cjs/ion-nav_2.cjs.entry.js +2 -2
  110. package/dist/cjs/ion-picker-column-option.cjs.entry.js +2 -2
  111. package/dist/cjs/ion-popover.cjs.entry.js +2 -2
  112. package/dist/cjs/ion-progress-bar.cjs.entry.js +1 -1
  113. package/dist/cjs/ion-radio_2.cjs.entry.js +5 -5
  114. package/dist/cjs/ion-range.cjs.entry.js +3 -3
  115. package/dist/cjs/ion-refresher_2.cjs.entry.js +3 -3
  116. package/dist/cjs/ion-reorder_2.cjs.entry.js +3 -3
  117. package/dist/cjs/ion-ripple-effect.cjs.entry.js +1 -1
  118. package/dist/cjs/ion-route_4.cjs.entry.js +2 -2
  119. package/dist/cjs/ion-searchbar.cjs.entry.js +4 -4
  120. package/dist/cjs/ion-segment-content.cjs.entry.js +1 -1
  121. package/dist/cjs/ion-segment-view.cjs.entry.js +5 -2
  122. package/dist/cjs/ion-segment_2.cjs.entry.js +4 -4
  123. package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
  124. package/dist/cjs/ion-select_3.cjs.entry.js +6 -6
  125. package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
  126. package/dist/cjs/ion-split-pane.cjs.entry.js +2 -3
  127. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
  128. package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
  129. package/dist/cjs/ion-text.cjs.entry.js +2 -2
  130. package/dist/cjs/ion-textarea.cjs.entry.js +3 -3
  131. package/dist/cjs/ion-toast.cjs.entry.js +2 -2
  132. package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
  133. package/dist/cjs/ionic.cjs.js +1 -1
  134. package/dist/cjs/loader.cjs.js +1 -1
  135. package/dist/collection/collection-manifest.json +0 -6
  136. package/dist/collection/components/col/col.js +2 -3
  137. package/dist/collection/components/grid/grid.js +2 -2
  138. package/dist/collection/components/header/header.js +2 -2
  139. package/dist/collection/components/img/img.js +2 -2
  140. package/dist/collection/components/infinite-scroll/infinite-scroll.js +1 -1
  141. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +2 -2
  142. package/dist/collection/components/input/input.js +4 -4
  143. package/dist/collection/components/input-otp/input-otp.js +3 -3
  144. package/dist/collection/components/input-password-toggle/input-password-toggle.js +3 -3
  145. package/dist/collection/components/item-divider/item-divider.js +2 -2
  146. package/dist/collection/components/item-group/item-group.js +1 -1
  147. package/dist/collection/components/item-option/item-option.js +2 -2
  148. package/dist/collection/components/item-options/item-options.js +1 -1
  149. package/dist/collection/components/item-sliding/item-sliding.js +1 -1
  150. package/dist/collection/components/label/label.js +2 -2
  151. package/dist/collection/components/list/list.js +1 -1
  152. package/dist/collection/components/list-header/list-header.js +2 -2
  153. package/dist/collection/components/loading/loading.js +2 -2
  154. package/dist/collection/components/menu/menu.js +2 -2
  155. package/dist/collection/components/menu-button/menu-button.js +2 -2
  156. package/dist/collection/components/menu-toggle/menu-toggle.js +2 -2
  157. package/dist/collection/components/modal/modal.js +4 -4
  158. package/dist/collection/components/nav/nav.js +1 -1
  159. package/dist/collection/components/nav-link/nav-link.js +1 -1
  160. package/dist/collection/components/note/note.js +2 -2
  161. package/dist/collection/components/picker-column-option/picker-column-option.js +2 -2
  162. package/dist/collection/components/picker-legacy/picker.js +2 -2
  163. package/dist/collection/components/picker-legacy-column/picker-column.js +2 -2
  164. package/dist/collection/components/popover/popover.js +2 -2
  165. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  166. package/dist/collection/components/radio/radio.js +3 -3
  167. package/dist/collection/components/radio-group/radio-group.js +2 -2
  168. package/dist/collection/components/range/range.js +3 -3
  169. package/dist/collection/components/refresher/refresher.js +1 -1
  170. package/dist/collection/components/refresher-content/refresher-content.js +2 -2
  171. package/dist/collection/components/reorder/reorder.js +2 -2
  172. package/dist/collection/components/reorder-group/reorder-group.js +1 -1
  173. package/dist/collection/components/ripple-effect/ripple-effect.js +1 -1
  174. package/dist/collection/components/router-link/router-link.js +2 -2
  175. package/dist/collection/components/router-outlet/router-outlet.js +1 -1
  176. package/dist/collection/components/row/row.js +2 -2
  177. package/dist/collection/components/searchbar/searchbar.js +4 -4
  178. package/dist/collection/components/segment/segment.js +2 -2
  179. package/dist/collection/components/segment-button/segment-button.js +2 -2
  180. package/dist/collection/components/segment-content/segment-content.js +1 -1
  181. package/dist/collection/components/segment-view/segment-view.js +5 -2
  182. package/dist/collection/components/select/select.js +3 -3
  183. package/dist/collection/components/select-modal/select-modal.js +1 -1
  184. package/dist/collection/components/select-option/select-option.js +1 -1
  185. package/dist/collection/components/select-popover/select-popover.js +2 -2
  186. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
  187. package/dist/collection/components/spinner/spinner.js +1 -1
  188. package/dist/collection/components/split-pane/split-pane.js +2 -3
  189. package/dist/collection/components/tab/tab.js +2 -2
  190. package/dist/collection/components/tab-bar/tab-bar.js +2 -2
  191. package/dist/collection/components/tab-button/tab-button.js +2 -2
  192. package/dist/collection/components/tabs/tabs.js +1 -1
  193. package/dist/collection/components/text/text.js +2 -2
  194. package/dist/collection/components/textarea/textarea.js +3 -3
  195. package/dist/collection/components/thumbnail/thumbnail.js +2 -2
  196. package/dist/collection/components/title/title.js +2 -2
  197. package/dist/collection/components/toast/toast.js +2 -2
  198. package/dist/collection/components/toggle/toggle.js +3 -3
  199. package/dist/collection/components/toolbar/toolbar.js +2 -2
  200. package/dist/collection/utils/media.js +0 -1
  201. package/dist/docs.json +1 -212
  202. package/dist/esm/ion-app_8.entry.js +7 -7
  203. package/dist/esm/ion-avatar_3.entry.js +2 -2
  204. package/dist/esm/ion-col_3.entry.js +6 -8
  205. package/dist/esm/ion-datetime_3.entry.js +4 -4
  206. package/dist/esm/ion-img.entry.js +2 -2
  207. package/dist/esm/ion-infinite-scroll_2.entry.js +3 -3
  208. package/dist/esm/ion-input-otp.entry.js +3 -3
  209. package/dist/esm/ion-input-password-toggle.entry.js +3 -3
  210. package/dist/esm/ion-input.entry.js +4 -4
  211. package/dist/esm/ion-item-option_3.entry.js +4 -4
  212. package/dist/esm/ion-item_8.entry.js +12 -12
  213. package/dist/esm/ion-loading.entry.js +2 -2
  214. package/dist/esm/ion-menu_3.entry.js +6 -6
  215. package/dist/esm/ion-modal.entry.js +4 -4
  216. package/dist/esm/ion-nav_2.entry.js +2 -2
  217. package/dist/esm/ion-picker-column-option.entry.js +2 -2
  218. package/dist/esm/ion-popover.entry.js +2 -2
  219. package/dist/esm/ion-progress-bar.entry.js +1 -1
  220. package/dist/esm/ion-radio_2.entry.js +5 -5
  221. package/dist/esm/ion-range.entry.js +3 -3
  222. package/dist/esm/ion-refresher_2.entry.js +3 -3
  223. package/dist/esm/ion-reorder_2.entry.js +3 -3
  224. package/dist/esm/ion-ripple-effect.entry.js +1 -1
  225. package/dist/esm/ion-route_4.entry.js +2 -2
  226. package/dist/esm/ion-searchbar.entry.js +4 -4
  227. package/dist/esm/ion-segment-content.entry.js +1 -1
  228. package/dist/esm/ion-segment-view.entry.js +5 -2
  229. package/dist/esm/ion-segment_2.entry.js +4 -4
  230. package/dist/esm/ion-select-modal.entry.js +1 -1
  231. package/dist/esm/ion-select_3.entry.js +6 -6
  232. package/dist/esm/ion-spinner.entry.js +1 -1
  233. package/dist/esm/ion-split-pane.entry.js +2 -3
  234. package/dist/esm/ion-tab-bar_2.entry.js +4 -4
  235. package/dist/esm/ion-tab_2.entry.js +3 -3
  236. package/dist/esm/ion-text.entry.js +2 -2
  237. package/dist/esm/ion-textarea.entry.js +3 -3
  238. package/dist/esm/ion-toast.entry.js +2 -2
  239. package/dist/esm/ion-toggle.entry.js +3 -3
  240. package/dist/esm/ionic.js +1 -1
  241. package/dist/esm/loader.js +1 -1
  242. package/dist/html.html-data.json +0 -70
  243. package/dist/ionic/ionic.esm.js +1 -1
  244. package/dist/ionic/{p-83c693c4.entry.js → p-091a95ea.entry.js} +1 -1
  245. package/dist/ionic/{p-e3abffbe.entry.js → p-1855fcb6.entry.js} +1 -1
  246. package/dist/ionic/{p-15e3e8f5.entry.js → p-192e7509.entry.js} +1 -1
  247. package/dist/ionic/{p-a9fb086b.entry.js → p-1faf270d.entry.js} +1 -1
  248. package/dist/ionic/{p-d6299c37.entry.js → p-228b6a9c.entry.js} +1 -1
  249. package/dist/ionic/{p-8537b2fb.entry.js → p-2aa44c65.entry.js} +1 -1
  250. package/dist/ionic/{p-1c2c1869.entry.js → p-2bf931ae.entry.js} +1 -1
  251. package/dist/ionic/{p-b3c9f19c.entry.js → p-2effd05d.entry.js} +1 -1
  252. package/dist/ionic/p-308beb71.entry.js +4 -0
  253. package/dist/ionic/{p-586d4270.entry.js → p-3093958a.entry.js} +1 -1
  254. package/dist/ionic/{p-1c4de46b.entry.js → p-3bf01c2c.entry.js} +1 -1
  255. package/dist/ionic/{p-50b61fab.entry.js → p-4091ad21.entry.js} +1 -1
  256. package/dist/ionic/{p-e18d3fdb.entry.js → p-4610e447.entry.js} +1 -1
  257. package/dist/ionic/{p-fad05840.entry.js → p-4c864eb2.entry.js} +1 -1
  258. package/dist/ionic/{p-bd71a4a7.entry.js → p-4e46439d.entry.js} +1 -1
  259. package/dist/ionic/{p-5274f999.entry.js → p-50d90690.entry.js} +1 -1
  260. package/dist/ionic/{p-3f79f594.entry.js → p-59b4f8d0.entry.js} +1 -1
  261. package/dist/ionic/{p-2f0073af.entry.js → p-5a3fc28e.entry.js} +1 -1
  262. package/dist/ionic/{p-1709b0aa.entry.js → p-5ac21be2.entry.js} +1 -1
  263. package/dist/ionic/p-64341e32.entry.js +4 -0
  264. package/dist/ionic/{p-b653f4c2.entry.js → p-6c8c37c2.entry.js} +1 -1
  265. package/dist/ionic/p-76d0e7ef.entry.js +4 -0
  266. package/dist/ionic/{p-05a30032.entry.js → p-79ae0425.entry.js} +1 -1
  267. package/dist/ionic/{p-c10fa162.entry.js → p-8180abe5.entry.js} +1 -1
  268. package/dist/ionic/{p-50cd2d57.entry.js → p-8516eb69.entry.js} +1 -1
  269. package/dist/ionic/{p-00c0bd38.entry.js → p-96549175.entry.js} +1 -1
  270. package/dist/ionic/{p-9d789053.entry.js → p-98c34fd7.entry.js} +1 -1
  271. package/dist/ionic/{p-72491468.entry.js → p-9b9b1450.entry.js} +1 -1
  272. package/dist/ionic/p-ae4ea663.entry.js +4 -0
  273. package/dist/ionic/{p-d976e777.entry.js → p-b0c54b4c.entry.js} +1 -1
  274. package/dist/ionic/{p-71b6014c.entry.js → p-b8b20b7e.entry.js} +1 -1
  275. package/dist/ionic/{p-2ad79c23.entry.js → p-bc5713f7.entry.js} +1 -1
  276. package/dist/ionic/p-d395b5cb.entry.js +4 -0
  277. package/dist/ionic/{p-d4ed5710.entry.js → p-d954cd19.entry.js} +1 -1
  278. package/dist/ionic/{p-ae667493.entry.js → p-e7f216ae.entry.js} +1 -1
  279. package/dist/ionic/{p-b2fe6c1c.entry.js → p-edb0b0c8.entry.js} +1 -1
  280. package/dist/ionic/{p-48026d15.entry.js → p-f061fcb7.entry.js} +1 -1
  281. package/dist/ionic/{p-7d5057c4.entry.js → p-f740c359.entry.js} +1 -1
  282. package/dist/types/components.d.ts +0 -66
  283. package/hydrate/index.js +129 -487
  284. package/hydrate/index.mjs +129 -487
  285. package/package.json +1 -1
  286. package/components/ion-gallery.d.ts +0 -11
  287. package/components/ion-gallery.js +0 -4
  288. package/components/p-B2rpt1JV.js +0 -4
  289. package/components/p-B6zr9RZN.js +0 -4
  290. package/components/p-CN-WzkJE.js +0 -4
  291. package/dist/cjs/ion-gallery.cjs.entry.js +0 -348
  292. package/dist/collection/components/gallery/gallery-interface.js +0 -1
  293. package/dist/collection/components/gallery/gallery.css +0 -103
  294. package/dist/collection/components/gallery/gallery.js +0 -439
  295. package/dist/collection/components/gallery/test/utils.js +0 -100
  296. package/dist/esm/ion-gallery.entry.js +0 -346
  297. package/dist/ionic/p-1e1c8d61.entry.js +0 -4
  298. package/dist/ionic/p-2aa7567e.entry.js +0 -4
  299. package/dist/ionic/p-4079cee3.entry.js +0 -4
  300. package/dist/ionic/p-8f127a9c.entry.js +0 -4
  301. package/dist/ionic/p-bf972309.entry.js +0 -4
  302. package/dist/ionic/p-cdb5fc03.entry.js +0 -4
  303. package/dist/types/components/gallery/gallery-interface.d.ts +0 -9
  304. package/dist/types/components/gallery/gallery.d.ts +0 -125
  305. package/dist/types/components/gallery/test/utils.d.ts +0 -2
@@ -1,439 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { Host, h } from "@stencil/core";
5
- import { printIonWarning } from "../../utils/logging/index";
6
- import { getIonTheme } from "../../global/ionic-global";
7
- // TODO(FW-7285): Replace with global breakpoints
8
- const BREAKPOINTS = {
9
- xs: 0,
10
- sm: 576,
11
- md: 768,
12
- lg: 992,
13
- xl: 1200,
14
- xxl: 1400,
15
- };
16
- const DEFAULT_COLUMNS = {
17
- xs: 2,
18
- sm: 3,
19
- md: 4,
20
- lg: 6,
21
- xl: 8,
22
- xxl: 10,
23
- };
24
- const BREAKPOINT_ORDER = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
25
- /**
26
- * @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
27
- * @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
28
- *
29
- * @slot - Content is placed in a responsive gallery layout.
30
- */
31
- export class Gallery {
32
- constructor() {
33
- // Keep track of whether we've warned about invalid columns to avoid
34
- // duplicate warnings on screen resize.
35
- this.hasWarnedInvalidColumns = false;
36
- /**
37
- * The visual layout of the gallery. When `uniform`, rows take up the height
38
- * of the tallest item and are spaced evenly across the gallery. Additionally,
39
- * items will have an aspect ratio of 1/1, forcing them to be square unless a
40
- * height is explicitly set. When `masonry`, items will be positioned under each
41
- * other with only the specified gap between them.
42
- */
43
- this.layout = 'uniform';
44
- /**
45
- * The order in which items are positioned. Only applies when layout is
46
- * `masonry`. When `sequential`, items are positioned in the order they are
47
- * placed in the DOM. When `best-fit`, items are positioned under the column
48
- * with the most available space.
49
- */
50
- this.order = 'sequential';
51
- /**
52
- * The number of columns to display. Can be set as a number or an object of
53
- * breakpoint values (e.g. `{ xs: 2, sm: 3, md: 4 }`).
54
- */
55
- this.columns = DEFAULT_COLUMNS;
56
- /**
57
- * Listen for the slotchange event on the slot.
58
- * When the layout is `masonry`, this listener is used to schedule a resize
59
- * of the masonry grid when the slot changes. This is useful for when items
60
- * are added or removed from the gallery.
61
- */
62
- this.onSlotChange = () => {
63
- this.scheduleMasonryResize();
64
- };
65
- /**
66
- * Measure the host and children, then compute masonry placement.
67
- */
68
- this.resizeMasonryGrid = () => {
69
- this.masonryRaf = undefined;
70
- if (this.layout !== 'masonry') {
71
- this.clearMasonryStyles();
72
- return;
73
- }
74
- const styles = getComputedStyle(this.el);
75
- const rowHeight = parseFloat(styles.getPropertyValue('grid-auto-rows')) || 0;
76
- const rowGap = parseFloat(styles.getPropertyValue('row-gap')) || parseFloat(styles.getPropertyValue('gap')) || 0;
77
- const columnsStr = styles.getPropertyValue('--internal-gallery-columns');
78
- // Fallback to 2 columns for masonry calculations when the resolved
79
- // --internal-gallery-columns CSS value is missing or unparsable.
80
- const columns = parseInt(columnsStr, 10) || 2;
81
- const items = this.getItems();
82
- this.layoutMasonry(items, rowHeight, rowGap, columns);
83
- };
84
- }
85
- layoutChanged() {
86
- this.updateResponsiveColumns(true);
87
- this.scheduleMasonryResize();
88
- }
89
- componentDidLoad() {
90
- this.updateResponsiveColumns(true);
91
- this.resizeObserver = new ResizeObserver(() => {
92
- this.updateResponsiveColumns();
93
- this.scheduleMasonryResize();
94
- });
95
- this.resizeObserver.observe(this.el);
96
- this.scheduleMasonryResize();
97
- }
98
- disconnectedCallback() {
99
- var _a;
100
- if (this.masonryRaf !== undefined) {
101
- cancelAnimationFrame(this.masonryRaf);
102
- this.masonryRaf = undefined;
103
- }
104
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
105
- this.resizeObserver = undefined;
106
- }
107
- /**
108
- * Listen for the load event on child elements.
109
- * When the layout is `masonry`, this listener is used to schedule a resize
110
- * of the masonry grid when the child elements load. This is useful for when
111
- * images take time to load.
112
- */
113
- onChildLoad(ev) {
114
- if (this.layout !== 'masonry') {
115
- return;
116
- }
117
- const target = ev.target;
118
- if (target !== null && this.el.contains(target)) {
119
- this.scheduleMasonryResize();
120
- }
121
- }
122
- /**
123
- * Batch masonry measurements to a single animation frame.
124
- * This avoids repeated sync layouts during rapid resize/load/slot changes.
125
- */
126
- scheduleMasonryResize() {
127
- if (this.layout !== 'masonry') {
128
- this.clearMasonryStyles();
129
- return;
130
- }
131
- if (this.masonryRaf !== undefined) {
132
- cancelAnimationFrame(this.masonryRaf);
133
- }
134
- this.masonryRaf = requestAnimationFrame(this.resizeMasonryGrid);
135
- }
136
- /**
137
- * Normalize a columns value to a positive integer.
138
- * Returns undefined when the input cannot be interpreted as a finite number.
139
- */
140
- sanitizeColumns(columns) {
141
- if (columns === undefined) {
142
- return undefined;
143
- }
144
- const numericColumns = typeof columns === 'number' ? columns : Number(columns);
145
- if (!Number.isFinite(numericColumns) || !Number.isInteger(numericColumns) || numericColumns <= 0) {
146
- return undefined;
147
- }
148
- return numericColumns;
149
- }
150
- /**
151
- * Check if the value is a breakpoint columns object.
152
- */
153
- isBreakpointColumns(value) {
154
- return typeof value === 'object' && value !== null && !Array.isArray(value);
155
- }
156
- /**
157
- * Check if the breakpoint columns object has any invalid values.
158
- * Returns true if any value is undefined or not a positive integer.
159
- */
160
- hasInvalidBreakpointColumns(breakpointColumns) {
161
- for (const breakpoint of BREAKPOINT_ORDER) {
162
- const value = breakpointColumns[breakpoint];
163
- if (value !== undefined && this.sanitizeColumns(value) === undefined) {
164
- return true;
165
- }
166
- }
167
- return false;
168
- }
169
- /**
170
- * Get the columns from a responsive breakpoint map.
171
- * Returns the columns for the last matching breakpoint.
172
- */
173
- getColumnsFromBreakpointColumns(width, breakpointColumns) {
174
- let columns;
175
- for (const bp of BREAKPOINT_ORDER) {
176
- const customValue = breakpointColumns[bp];
177
- const parsedCustom = this.sanitizeColumns(customValue);
178
- const parsedDefault = this.sanitizeColumns(DEFAULT_COLUMNS[bp]);
179
- // Use valid custom values when present; otherwise fall back to defaults per breakpoint.
180
- const resolved = customValue === undefined || parsedCustom === undefined ? parsedDefault : parsedCustom;
181
- if (resolved !== undefined && width >= BREAKPOINTS[bp]) {
182
- columns = resolved;
183
- }
184
- }
185
- return columns;
186
- }
187
- /**
188
- * Warn about an invalid columns value when it is set to a non-positive
189
- * integer or a breakpoint map object with invalid values.
190
- */
191
- warnInvalidColumns(columns) {
192
- printIonWarning(`[ion-gallery] - Invalid "columns" value (${JSON.stringify(columns)}). Expected a positive integer or breakpoint map object (e.g. { xs: 2, md: 4 }). Falling back to default responsive columns.`, this.el);
193
- this.hasWarnedInvalidColumns = true;
194
- }
195
- /**
196
- * Resolve the active columns value for the current width. Falls back to
197
- * the default responsive columns when the provided prop is invalid.
198
- */
199
- getColumnsForWidth(width) {
200
- const { columns, hasWarnedInvalidColumns } = this;
201
- const isBreakpointColumns = this.isBreakpointColumns(columns);
202
- const hasInvalidBreakpointColumns = isBreakpointColumns && this.hasInvalidBreakpointColumns(columns);
203
- const sanitizedColumns = isBreakpointColumns
204
- ? this.getColumnsFromBreakpointColumns(width, columns)
205
- : this.sanitizeColumns(columns);
206
- if (!hasWarnedInvalidColumns &&
207
- (hasInvalidBreakpointColumns || (!isBreakpointColumns && sanitizedColumns === undefined))) {
208
- this.warnInvalidColumns(columns);
209
- }
210
- if (sanitizedColumns !== undefined) {
211
- return sanitizedColumns;
212
- }
213
- return this.getColumnsFromBreakpointColumns(width, DEFAULT_COLUMNS);
214
- }
215
- /**
216
- * Update the responsive columns for the gallery.
217
- * This is used to update the columns when the component width changes.
218
- */
219
- updateResponsiveColumns(force = false) {
220
- const width = this.el.getBoundingClientRect().width;
221
- // Only update the columns if the component width has changed by more than
222
- // 1px or if the force flag is true. This prevents unnecessary re-renders
223
- // when the component width has not changed.
224
- if (!width || (!force && this.lastWidth !== undefined && Math.abs(this.lastWidth - width) < 1)) {
225
- return;
226
- }
227
- this.lastWidth = width;
228
- const columns = this.getColumnsForWidth(width);
229
- this.el.style.setProperty('--internal-gallery-columns', `${columns}`);
230
- }
231
- /**
232
- * Return all directly slotted HTMLElement children of the gallery.
233
- */
234
- getItems() {
235
- return Array.from(this.el.children).filter((child) => child instanceof HTMLElement);
236
- }
237
- /**
238
- * Clear the item styles for the given item element.
239
- * This is used to switch between uniform and masonry layouts.
240
- */
241
- clearItemStyles(itemEl) {
242
- itemEl.style.gridRowStart = '';
243
- itemEl.style.gridRowEnd = '';
244
- itemEl.style.gridColumn = '';
245
- itemEl.style.marginBottom = '';
246
- }
247
- /**
248
- * Clear placement styles for all items when leaving masonry mode.
249
- */
250
- clearMasonryStyles() {
251
- this.getItems().forEach((itemEl) => this.clearItemStyles(itemEl));
252
- }
253
- /**
254
- * Convert a rendered item height to the number of grid rows it should span.
255
- * Returns undefined for images that are not fully loaded yet.
256
- */
257
- calculateRowSpan(itemEl, rowHeight, rowGap) {
258
- if (itemEl instanceof HTMLImageElement && (!itemEl.complete || itemEl.naturalHeight === 0)) {
259
- return undefined;
260
- }
261
- const height = itemEl.getBoundingClientRect().height;
262
- const itemStyles = getComputedStyle(itemEl);
263
- const marginBottom = parseFloat(itemStyles.getPropertyValue('margin-bottom')) || 0;
264
- const denominator = rowHeight + rowGap;
265
- if (!denominator || !Number.isFinite(denominator)) {
266
- return 1;
267
- }
268
- return Math.ceil((height + marginBottom + rowGap) / denominator) || 1;
269
- }
270
- /**
271
- * Get the index of the column to position the item in.
272
- * When the order is `best-fit`, the column with the shortest height is
273
- * returned. Otherwise, items are placed in the column that matches their
274
- * natural DOM order.
275
- */
276
- getColumnIndex(index, columnHeights, columns) {
277
- const { order } = this;
278
- if (order === 'best-fit') {
279
- let columnIndex = 0;
280
- for (let i = 1; i < columns; i++) {
281
- if (columnHeights[i] < columnHeights[columnIndex]) {
282
- columnIndex = i;
283
- }
284
- }
285
- return columnIndex;
286
- }
287
- return index % columns;
288
- }
289
- /**
290
- * Apply masonry placement by assigning each item a column and row span.
291
- */
292
- layoutMasonry(items, rowHeight, rowGap, columns) {
293
- const columnHeights = new Array(columns).fill(0);
294
- const lastItemsByColumn = new Array(columns).fill(undefined);
295
- items.forEach((itemEl, i) => {
296
- itemEl.style.marginBottom = '';
297
- const span = this.calculateRowSpan(itemEl, rowHeight, rowGap);
298
- if (span === undefined) {
299
- this.clearItemStyles(itemEl);
300
- return;
301
- }
302
- const columnIndex = this.getColumnIndex(i, columnHeights, columns);
303
- const start = columnHeights[columnIndex] + 1;
304
- itemEl.style.gridColumn = `${columnIndex + 1}`;
305
- itemEl.style.gridRowStart = `${start}`;
306
- itemEl.style.gridRowEnd = `span ${span}`;
307
- columnHeights[columnIndex] = start + span - 1;
308
- lastItemsByColumn[columnIndex] = itemEl;
309
- });
310
- // Remove trailing space from the final item in each column while preserving
311
- // spacing between all non-final items.
312
- lastItemsByColumn.forEach((itemEl) => {
313
- if (itemEl === undefined) {
314
- return;
315
- }
316
- itemEl.style.marginBottom = '0px';
317
- const spanWithoutTrailingGap = this.calculateRowSpan(itemEl, rowHeight, rowGap);
318
- if (spanWithoutTrailingGap === undefined) {
319
- this.clearItemStyles(itemEl);
320
- return;
321
- }
322
- itemEl.style.gridRowEnd = `span ${spanWithoutTrailingGap}`;
323
- });
324
- }
325
- render() {
326
- const { layout, order } = this;
327
- const theme = getIonTheme(this);
328
- return (h(Host, { key: '77cd21eada2c24092cc551d4e647582c820f05d9', class: {
329
- [theme]: true,
330
- [`gallery-layout-${layout}`]: true,
331
- [`gallery-order-${order}`]: layout === 'masonry',
332
- } }, h("slot", { key: 'fa311652848a526a7629476afb963bf3e68455c4', onSlotchange: this.onSlotChange })));
333
- }
334
- static get is() { return "ion-gallery"; }
335
- static get encapsulation() { return "shadow"; }
336
- static get originalStyleUrls() {
337
- return {
338
- "$": ["gallery.scss"]
339
- };
340
- }
341
- static get styleUrls() {
342
- return {
343
- "$": ["gallery.css"]
344
- };
345
- }
346
- static get properties() {
347
- return {
348
- "layout": {
349
- "type": "string",
350
- "mutable": false,
351
- "complexType": {
352
- "original": "'uniform' | 'masonry'",
353
- "resolved": "\"masonry\" | \"uniform\"",
354
- "references": {}
355
- },
356
- "required": false,
357
- "optional": false,
358
- "docs": {
359
- "tags": [],
360
- "text": "The visual layout of the gallery. When `uniform`, rows take up the height\nof the tallest item and are spaced evenly across the gallery. Additionally,\nitems will have an aspect ratio of 1/1, forcing them to be square unless a\nheight is explicitly set. When `masonry`, items will be positioned under each\nother with only the specified gap between them."
361
- },
362
- "getter": false,
363
- "setter": false,
364
- "reflect": true,
365
- "attribute": "layout",
366
- "defaultValue": "'uniform'"
367
- },
368
- "order": {
369
- "type": "string",
370
- "mutable": false,
371
- "complexType": {
372
- "original": "'sequential' | 'best-fit'",
373
- "resolved": "\"best-fit\" | \"sequential\"",
374
- "references": {}
375
- },
376
- "required": false,
377
- "optional": false,
378
- "docs": {
379
- "tags": [],
380
- "text": "The order in which items are positioned. Only applies when layout is\n`masonry`. When `sequential`, items are positioned in the order they are\nplaced in the DOM. When `best-fit`, items are positioned under the column\nwith the most available space."
381
- },
382
- "getter": false,
383
- "setter": false,
384
- "reflect": true,
385
- "attribute": "order",
386
- "defaultValue": "'sequential'"
387
- },
388
- "columns": {
389
- "type": "any",
390
- "mutable": false,
391
- "complexType": {
392
- "original": "GalleryColumns",
393
- "resolved": "GalleryBreakpointColumns | number | string",
394
- "references": {
395
- "GalleryColumns": {
396
- "location": "import",
397
- "path": "./gallery-interface",
398
- "id": "src/components/gallery/gallery-interface.ts::GalleryColumns",
399
- "referenceLocation": "GalleryColumns"
400
- }
401
- }
402
- },
403
- "required": false,
404
- "optional": false,
405
- "docs": {
406
- "tags": [],
407
- "text": "The number of columns to display. Can be set as a number or an object of\nbreakpoint values (e.g. `{ xs: 2, sm: 3, md: 4 }`)."
408
- },
409
- "getter": false,
410
- "setter": false,
411
- "reflect": false,
412
- "attribute": "columns",
413
- "defaultValue": "DEFAULT_COLUMNS"
414
- }
415
- };
416
- }
417
- static get elementRef() { return "el"; }
418
- static get watchers() {
419
- return [{
420
- "propName": "layout",
421
- "methodName": "layoutChanged"
422
- }, {
423
- "propName": "order",
424
- "methodName": "layoutChanged"
425
- }, {
426
- "propName": "columns",
427
- "methodName": "layoutChanged"
428
- }];
429
- }
430
- static get listeners() {
431
- return [{
432
- "name": "load",
433
- "method": "onChildLoad",
434
- "target": undefined,
435
- "capture": true,
436
- "passive": false
437
- }];
438
- }
439
- }
@@ -1,100 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- export const sharedStyles = `
5
- ion-gallery {
6
- width: 343px;
7
- }
8
-
9
- div {
10
- color: #fff;
11
- height: 150px;
12
- }
13
-
14
- div:nth-child(1) {
15
- background: #ff6b6b;
16
- }
17
-
18
- div:nth-child(2) {
19
- background: #4ecdc4;
20
- }
21
-
22
- div:nth-child(3) {
23
- background: #ffe66d;
24
- color: #333;
25
- }
26
-
27
- div:nth-child(4) {
28
- background: #5f27cd;
29
- }
30
-
31
- div:nth-child(5) {
32
- background: #7f8c8d;
33
- }
34
-
35
- div:nth-child(6) {
36
- background: #ff9f43;
37
- }
38
-
39
- div:nth-child(7) {
40
- background: #ff3f34;
41
- }
42
-
43
- div:nth-child(8) {
44
- background: #2ecc71;
45
- }
46
-
47
- div:nth-child(9) {
48
- background: #34495e;
49
- }
50
-
51
- div:nth-child(10) {
52
- background: #1abc9c;
53
- }
54
-
55
- div:nth-child(11) {
56
- background: #e67e22;
57
- }
58
-
59
- div:nth-child(12) {
60
- background: #9b59b6;
61
- }
62
- `;
63
- export const numberToWords = (value) => {
64
- const ones = [
65
- 'zero',
66
- 'one',
67
- 'two',
68
- 'three',
69
- 'four',
70
- 'five',
71
- 'six',
72
- 'seven',
73
- 'eight',
74
- 'nine',
75
- 'ten',
76
- 'eleven',
77
- 'twelve',
78
- 'thirteen',
79
- 'fourteen',
80
- 'fifteen',
81
- 'sixteen',
82
- 'seventeen',
83
- 'eighteen',
84
- 'nineteen',
85
- ];
86
- const tens = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];
87
- if (!Number.isInteger(value) || value < 0 || value >= 100) {
88
- return `${value}`;
89
- }
90
- let word = '';
91
- if (value < 20) {
92
- word = ones[value];
93
- }
94
- else {
95
- const tensValue = Math.floor(value / 10);
96
- const onesValue = value % 10;
97
- word = onesValue === 0 ? tens[tensValue] : `${tens[tensValue]}-${ones[onesValue]}`;
98
- }
99
- return word.charAt(0).toUpperCase() + word.slice(1);
100
- };