@v-miniapp/ui-react 1.0.45 → 1.0.59

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 (255) hide show
  1. package/dist/components/app/app.d.ts +17 -0
  2. package/dist/components/app/bottom-tab-bar-layout/hook.d.ts +21 -0
  3. package/dist/components/app/bottom-tab-bar-layout/store.d.ts +13 -0
  4. package/dist/components/app/bottom-tab-bar-layout/type.d.ts +13 -0
  5. package/dist/components/app/data-theme.d.ts +8 -0
  6. package/dist/components/app/index.d.ts +9 -18
  7. package/dist/components/app/navigation-bar-layout/hook.d.ts +17 -0
  8. package/dist/components/app/navigation-bar-layout/store.d.ts +13 -0
  9. package/dist/components/app/navigation-bar-layout/type.d.ts +7 -0
  10. package/dist/components/app/page-layout/hook.d.ts +21 -0
  11. package/dist/components/app/page-layout/store.d.ts +13 -0
  12. package/dist/components/app/page-layout/type.d.ts +8 -0
  13. package/dist/components/app/type.d.ts +27 -0
  14. package/dist/components/calendar/default-render.d.ts +1 -1
  15. package/dist/components/calendar/utils.d.ts +1 -1
  16. package/dist/components/carousel/index.d.ts +1 -0
  17. package/dist/components/input-wrapper/input-wrapper.d.ts +2 -2
  18. package/dist/components/layout/page.d.ts +8 -1
  19. package/dist/external/index.js +11344 -7959
  20. package/dist/external/styles.css +1 -1
  21. package/dist/index.d.ts +4 -1
  22. package/dist/index.js +4194 -4376
  23. package/dist/styles.css +1 -1
  24. package/dist/utils/event-emitter.d.ts +4 -0
  25. package/dist-storybook/assets/App-Dp1UG-xp.js +93 -0
  26. package/dist-storybook/assets/{Color-AVL7NMMY-1_8XTICv.js → Color-AVL7NMMY-XA8cFKdV.js} +1 -1
  27. package/dist-storybook/assets/DEEPLINK-cjgFMuRJ.js +33 -0
  28. package/dist-storybook/assets/{DocsRenderer-PQXLIZUC-BO86igwd.js → DocsRenderer-PQXLIZUC-D10-0Yfb.js} +2 -2
  29. package/dist-storybook/assets/EVENTS-BY66PjI7.js +65 -0
  30. package/dist-storybook/assets/GETTING_STARTED-580o-9Mx.js +64 -0
  31. package/dist-storybook/assets/GETTING_STARTED-BiQMvjvo.js +62 -0
  32. package/dist-storybook/assets/GETTING_STARTED-CIVMqKZW.js +80 -0
  33. package/dist-storybook/assets/{INFINITE_SCROLL-BtM3uoX0.js → INFINITE_SCROLL-BbeR5HeP.js} +1 -1
  34. package/dist-storybook/assets/LocalesProvider-CMlmwAyY.js +53 -0
  35. package/dist-storybook/assets/MIGRATE_DARKMODE_TO_THEME-CBDyZyg2.js +107 -0
  36. package/dist-storybook/assets/{MIGRATION_GUIDE-2LONslE4.js → MIGRATION_GUIDE-FZyRWI-B.js} +3 -3
  37. package/dist-storybook/assets/OVERVIEW-C9_6gX5Q.js +51 -0
  38. package/dist-storybook/assets/Router-B5U8bubH.js +71 -0
  39. package/dist-storybook/assets/{TAILWIND_INTEGRATION-_T-VfvkM.js → TAILWIND_INTEGRATION-BJdy5DAv.js} +1 -1
  40. package/dist-storybook/assets/THEME-CRbvH7KT.js +103 -0
  41. package/dist-storybook/assets/_baseClone-DQVxEhny.js +1 -0
  42. package/dist-storybook/assets/alert-CKwsuaPI.js +1 -0
  43. package/dist-storybook/assets/{alert.stories-B-vuojPh.js → alert.stories-D0X5wUHk.js} +3 -3
  44. package/dist-storybook/assets/app-CTv8lFU3.js +1 -0
  45. package/dist-storybook/assets/avatar-rWcYGe6j.js +1 -0
  46. package/dist-storybook/assets/{avatar.stories-KYFztAc8.js → avatar.stories-8lrbhMma.js} +6 -6
  47. package/dist-storybook/assets/{axe-CmvD4WV5.js → axe-BHGdSCoA.js} +1 -1
  48. package/dist-storybook/assets/badge-VcjGVEum.js +1 -0
  49. package/dist-storybook/assets/{badge.stories-Be2ItCmQ.js → badge.stories-BEFNaUA1.js} +3 -3
  50. package/dist-storybook/assets/{blocks-BuaOUtiH.js → blocks-DKR3P4qW.js} +3 -3
  51. package/dist-storybook/assets/{bottom-tab-bar-CtcTAxuI.js → bottom-tab-bar-B6IAoRwz.js} +1 -1
  52. package/dist-storybook/assets/{bottom-tab-bar.stories-CDmEve6z.js → bottom-tab-bar.stories-DXzLlO5o.js} +3 -3
  53. package/dist-storybook/assets/button-DJH3RlJl.js +1 -0
  54. package/dist-storybook/assets/{button.stories-CaqLWQiY.js → button.stories-DgYDJ6x7.js} +3 -3
  55. package/dist-storybook/assets/calendar-C4Xe_TW2.js +1 -0
  56. package/dist-storybook/assets/{calendar.stories-DLWZldet.js → calendar.stories-IVvRAjWN.js} +3 -3
  57. package/dist-storybook/assets/carousel-DJlgMyS5.js +37 -0
  58. package/dist-storybook/assets/{carousel.stories-B8YbGOOr.js → carousel.stories-3rA3nxdL.js} +3 -3
  59. package/dist-storybook/assets/checkbox-JOxcmyCZ.js +1 -0
  60. package/dist-storybook/assets/{checkbox.stories-CLvfZPiw.js → checkbox.stories-ge3pgfBb.js} +3 -3
  61. package/dist-storybook/assets/chip-Crt60rph.js +1 -0
  62. package/dist-storybook/assets/{chip.stories-BbwJb5eD.js → chip.stories-D7E6fdiV.js} +3 -3
  63. package/dist-storybook/assets/{date-Cg-Uk_pp.js → date-B3PFMb6s.js} +1 -1
  64. package/dist-storybook/assets/date-field-range-B-sv9nbW.js +1 -0
  65. package/dist-storybook/assets/date-field.stories-B9G2heHt.js +129 -0
  66. package/dist-storybook/assets/date-picker-BPzKPdhO.js +1 -0
  67. package/dist-storybook/assets/{date-picker.stories-BuGWvzFL.js → date-picker.stories-CIFgk4q_.js} +3 -3
  68. package/dist-storybook/assets/dialog-BAfGQzk5.js +1 -0
  69. package/dist-storybook/assets/{dialog.stories-DJ0WsSkA.js → dialog.stories-vDMKz9Tw.js} +3 -3
  70. package/dist-storybook/assets/{chip-kG4p82WT.js → dropdown-Dtomaqpw.js} +2 -2
  71. package/dist-storybook/assets/{dropdown.stories-D6JUYP73.js → dropdown.stories-Cj0HM0VI.js} +3 -3
  72. package/dist-storybook/assets/{embla-carousel-react.esm-BYjpaHZ9.js → embla-carousel-react.esm-5D5fs7OQ.js} +1 -1
  73. package/dist-storybook/assets/icon-CdiFzFyf.js +1 -0
  74. package/dist-storybook/assets/{icon.stories-B-ZvRzFf.js → icon.stories-DWwbUUY-.js} +3 -3
  75. package/dist-storybook/assets/iframe-BHaCv4dM.css +1 -0
  76. package/dist-storybook/assets/{iframe-CQAwSt4E.js → iframe-DfPay7Zl.js} +42 -42
  77. package/dist-storybook/assets/image-CMKb-R3x.js +9 -0
  78. package/dist-storybook/assets/{image.stories-C4l8D3ju.js → image.stories-BhZU057W.js} +3 -3
  79. package/dist-storybook/assets/index-BWpuenI4.js +1 -0
  80. package/dist-storybook/assets/{index-CgMRTj-o.js → index-DqZh6B0b.js} +1 -1
  81. package/dist-storybook/assets/{index-BV0AJWP6.js → index-EGt7xBnA.js} +1 -1
  82. package/dist-storybook/assets/{index-DHiZ-gXR.js → index-cMNObl2z.js} +1 -1
  83. package/dist-storybook/assets/input-wrapper-CgaUwbbE.js +1 -0
  84. package/dist-storybook/assets/{label-DV2iCDmN.js → label-D44azUgi.js} +1 -1
  85. package/dist-storybook/assets/{label.stories-BwTIPFXX.js → label.stories-CXJjdYf_.js} +3 -3
  86. package/dist-storybook/assets/{navigation-bar-vI-FPasP.js → navigation-bar-DK3TxcTu.js} +2 -2
  87. package/dist-storybook/assets/{navigation-bar.stories-DYuFaJFD.js → navigation-bar.stories-CB3Kg-sH.js} +3 -3
  88. package/dist-storybook/assets/number-field-Bz7su9S1.js +1 -0
  89. package/dist-storybook/assets/{number-field.stories--fn26TJu.js → number-field.stories-DSxPSzLv.js} +3 -3
  90. package/dist-storybook/assets/omit-BWHsnDSR.js +1 -0
  91. package/dist-storybook/assets/option-item-CpeNcb5w.js +1 -0
  92. package/dist-storybook/assets/{option-item.stories-snjAvgay.js → option-item.stories-BvXoc8WX.js} +3 -3
  93. package/dist-storybook/assets/pagination-Cp-DHO4Q.js +1 -0
  94. package/dist-storybook/assets/{pagination.stories-BoEs0jzS.js → pagination.stories-_5qj2nTS.js} +4 -4
  95. package/dist-storybook/assets/proxy-B4G9nIBd.js +1 -0
  96. package/dist-storybook/assets/radio-D0aV0RIg.js +1 -0
  97. package/dist-storybook/assets/{radio.stories-DuN-Awi_.js → radio.stories-BNR-wwuw.js} +3 -3
  98. package/dist-storybook/assets/rating-D2e8RTGl.js +1 -0
  99. package/dist-storybook/assets/{rating.stories-BCcQjMEx.js → rating.stories-CI0LG0Qq.js} +3 -3
  100. package/dist-storybook/assets/{react-18-CNyWQ7je.js → react-18-C7pDmBBf.js} +1 -1
  101. package/dist-storybook/assets/{react-hufnxGVs.js → react-I9jCW2VV.js} +1 -1
  102. package/dist-storybook/assets/search-field-DINESW8Y.js +1 -0
  103. package/dist-storybook/assets/{search-field.stories-DiCZbhng.js → search-field.stories-CKXC6-Za.js} +3 -3
  104. package/dist-storybook/assets/section-content-D49PabBW.js +1 -0
  105. package/dist-storybook/assets/{section.stories-C2I_kKhu.js → section.stories-9vd48AgB.js} +3 -3
  106. package/dist-storybook/assets/sheet-footer-nEdxsYan.js +1 -0
  107. package/dist-storybook/assets/{sheet.stories-wk1JaKU5.js → sheet.stories-C3gLIQsn.js} +3 -3
  108. package/dist-storybook/assets/skeleton-B12XbNAJ.js +1 -0
  109. package/dist-storybook/assets/{skeleton.stories-BCmX-VNr.js → skeleton.stories-C0y1o1Y_.js} +3 -3
  110. package/dist-storybook/assets/{store-D2RudmNr.js → store-Ce3Ikv5g.js} +5 -5
  111. package/dist-storybook/assets/switch-D0Z9tWin.js +1 -0
  112. package/dist-storybook/assets/{switch.stories-BqPLNKB9.js → switch.stories-BdWFln-M.js} +3 -3
  113. package/dist-storybook/assets/{tab-bar-CSeCmtIZ.js → tab-bar-kExoGg5P.js} +1 -1
  114. package/dist-storybook/assets/{tab-bar.stories-Cb6v8H2w.js → tab-bar.stories-BgDXX0of.js} +3 -3
  115. package/dist-storybook/assets/text-area-GKy5HL12.js +1 -0
  116. package/dist-storybook/assets/{text-area.stories-By8bCfgc.js → text-area.stories-DCt3RB3A.js} +3 -3
  117. package/dist-storybook/assets/text-field-CGWNqitB.js +1 -0
  118. package/dist-storybook/assets/{text-field.stories-CrWBAhvI.js → text-field.stories-Bqv7f948.js} +3 -3
  119. package/dist-storybook/assets/toast-provider-DKSrfhJD.js +9 -0
  120. package/dist-storybook/assets/{toast.stories-iWAToAZA.js → toast.stories-CcFzS6QI.js} +1 -1
  121. package/dist-storybook/assets/tooltip-B9rDI6z9.js +1 -0
  122. package/dist-storybook/assets/{tooltip.stories-RC6SuPPD.js → tooltip.stories-DDdsuU3U.js} +3 -3
  123. package/dist-storybook/assets/typography-CB8hPDyK.js +1 -0
  124. package/dist-storybook/assets/{typography.stories-Bu8qFugR.js → typography.stories-BzCxaZQU.js} +3 -3
  125. package/dist-storybook/assets/{uploader.stories-B2wW9qVy.js → uploader.stories-izVumFqZ.js} +3 -3
  126. package/dist-storybook/assets/use-app-pause-ClsUnndr.js +21 -0
  127. package/dist-storybook/assets/use-app-resume-D_EcIvMd.js +21 -0
  128. package/dist-storybook/assets/use-bottom-tab-bar-BC1cz2uE.js +49 -0
  129. package/dist-storybook/assets/use-custom-icon-event-cUk4Md0Y.js +26 -0
  130. package/dist-storybook/assets/use-did-hide-BmABiaUE.js +30 -0
  131. package/dist-storybook/assets/use-did-show-CQuySkkT.js +30 -0
  132. package/dist-storybook/assets/use-histories-CBm09Lno.js +30 -0
  133. package/dist-storybook/assets/use-history-7yguNz6O.js +33 -0
  134. package/dist-storybook/assets/use-language-DPyWMce2.js +46 -0
  135. package/dist-storybook/assets/use-load-more-KlDJZhj2.js +42 -0
  136. package/dist-storybook/assets/use-location-C7kE1yla.js +39 -0
  137. package/dist-storybook/assets/use-navigate-BpIyvtwc.js +36 -0
  138. package/dist-storybook/assets/use-navigation-bar-guzwhM_u.js +42 -0
  139. package/dist-storybook/assets/use-navigation-type-DOndDqQH.js +27 -0
  140. package/dist-storybook/assets/use-page-layout-dO6ylI1b.js +37 -0
  141. package/dist-storybook/assets/use-page-scroll-CCG2d2Gb.js +42 -0
  142. package/dist-storybook/assets/use-pull-to-refresh-lhumDu1H.js +38 -0
  143. package/dist-storybook/assets/use-settings-changed-Bt58DJ-c.js +30 -0
  144. package/dist-storybook/assets/use-translate-Jhz6jTXo.js +59 -0
  145. package/dist-storybook/assets/{visibility-sensor-CwrzJO06.js → visibility-sensor-Jf-Nmil6.js} +1 -1
  146. package/dist-storybook/iframe.html +2 -2
  147. package/dist-storybook/index.json +1 -1
  148. package/dist-storybook/project.json +1 -1
  149. package/dist-storybook/sb-addons/a11y-2/manager-bundle.js +2 -2
  150. package/dist-storybook/sb-addons/docs-1/manager-bundle.js +2 -2
  151. package/dist-storybook/sb-addons/storybook-build-3/manager-bundle.js +1 -1
  152. package/dist-storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +4 -4
  153. package/dist-storybook/stories-data.json +152 -122
  154. package/package.json +3 -1
  155. package/dist/components/app/components/app.d.ts +0 -13
  156. package/dist/components/app/components/link.d.ts +0 -8
  157. package/dist/components/app/components/navigation-analytic.d.ts +0 -2
  158. package/dist/components/app/components/pages-render.d.ts +0 -2
  159. package/dist/components/app/context/location-key.d.ts +0 -4
  160. package/dist/components/app/hooks/use-app-pause.d.ts +0 -1
  161. package/dist/components/app/hooks/use-app-resume.d.ts +0 -1
  162. package/dist/components/app/hooks/use-app-state.d.ts +0 -7
  163. package/dist/components/app/hooks/use-bottom-tab-bar.d.ts +0 -13
  164. package/dist/components/app/hooks/use-did-hide.d.ts +0 -1
  165. package/dist/components/app/hooks/use-did-show.d.ts +0 -1
  166. package/dist/components/app/hooks/use-history.d.ts +0 -2
  167. package/dist/components/app/hooks/use-location.d.ts +0 -1
  168. package/dist/components/app/hooks/use-navigate.d.ts +0 -1
  169. package/dist/components/app/hooks/use-navigation-bar.d.ts +0 -12
  170. package/dist/components/app/hooks/use-navigation-type.d.ts +0 -1
  171. package/dist/components/app/hooks/use-page-config.d.ts +0 -1
  172. package/dist/components/app/hooks/use-page-layout.d.ts +0 -14
  173. package/dist/components/app/hooks/use-page-scroll.d.ts +0 -5
  174. package/dist/components/app/hooks/use-page-state.d.ts +0 -6
  175. package/dist/components/app/stores/app.d.ts +0 -24
  176. package/dist/components/app/stores/app.selector.d.ts +0 -11
  177. package/dist/components/app/types/app.d.ts +0 -55
  178. package/dist/components/app/types/navigation.d.ts +0 -30
  179. package/dist/components/app/utils/animation.d.ts +0 -2
  180. package/dist/components/app/utils/data-theme.d.ts +0 -5
  181. package/dist/components/app/utils/history.d.ts +0 -7
  182. package/dist/hooks/use-analytic.d.ts +0 -1
  183. package/dist/hooks/use-is-using-app.d.ts +0 -1
  184. package/dist/hooks/use-is-using-locales.d.ts +0 -1
  185. package/dist/locales/defaultResources/en.d.ts +0 -27
  186. package/dist/locales/defaultResources/vi.d.ts +0 -27
  187. package/dist/locales/fns.d.ts +0 -6
  188. package/dist/locales/hooks.d.ts +0 -9
  189. package/dist/locales/index.d.ts +0 -4
  190. package/dist/locales/provider.d.ts +0 -6
  191. package/dist/locales/store.d.ts +0 -13
  192. package/dist/locales/types.d.ts +0 -37
  193. package/dist/locales/utils.d.ts +0 -2
  194. package/dist-storybook/assets/ANIMATION-CUdn1GTK.js +0 -99
  195. package/dist-storybook/assets/APP_FRAMEWORK-ljbIOHYd.js +0 -197
  196. package/dist-storybook/assets/BOTTOM_TAB_BAR-DxCwCfBK.js +0 -175
  197. package/dist-storybook/assets/CUSTOM_ERROR_BOUNDARY-B4wTQNZc.js +0 -250
  198. package/dist-storybook/assets/DARK_MODE-CoHseCDO.js +0 -57
  199. package/dist-storybook/assets/GETTING_STARTED-H_vVi5cv.js +0 -77
  200. package/dist-storybook/assets/KEEP_ALIVE-CL2au0al.js +0 -126
  201. package/dist-storybook/assets/LOCALE-XTCey55y.js +0 -465
  202. package/dist-storybook/assets/MOBILE_BEHAVIOURS-DZ6alKTX.js +0 -177
  203. package/dist-storybook/assets/PAGE_LAYOUT-BuOpN-1Y.js +0 -192
  204. package/dist-storybook/assets/ROUTING_NAVIGATION-BCPHXNto.js +0 -335
  205. package/dist-storybook/assets/_setToString-CbM921C9.js +0 -1
  206. package/dist-storybook/assets/alert-DLW8CoyB.js +0 -1
  207. package/dist-storybook/assets/avatar-GxcYPA1p.js +0 -1
  208. package/dist-storybook/assets/badge-D_LzMVtw.js +0 -1
  209. package/dist-storybook/assets/button-CL7GeC23.js +0 -1
  210. package/dist-storybook/assets/calendar-dOCsjhVU.js +0 -1
  211. package/dist-storybook/assets/carousel-1Kww3hIz.js +0 -37
  212. package/dist-storybook/assets/checkbox-MGytNNRt.js +0 -1
  213. package/dist-storybook/assets/classname-CUR_zgkh.js +0 -1
  214. package/dist-storybook/assets/date-field.stories-Diptwqfv.js +0 -129
  215. package/dist-storybook/assets/date-picker-Dnq_-0Md.js +0 -1
  216. package/dist-storybook/assets/icon-DdQsMyRa.js +0 -1
  217. package/dist-storybook/assets/iframe-yMKl6hJA.css +0 -1
  218. package/dist-storybook/assets/image-C3EsNRhz.js +0 -9
  219. package/dist-storybook/assets/input-wrapper-BKHgnPy6.js +0 -1
  220. package/dist-storybook/assets/number-field-CXKmnfKe.js +0 -1
  221. package/dist-storybook/assets/omit-Bsx5nTI0.js +0 -1
  222. package/dist-storybook/assets/option-item-LRh_OyV4.js +0 -1
  223. package/dist-storybook/assets/pagination-DZHoBs_4.js +0 -1
  224. package/dist-storybook/assets/pick-BhmhLmLe.js +0 -1
  225. package/dist-storybook/assets/radio-B5NJxG_l.js +0 -1
  226. package/dist-storybook/assets/rating-BdXViYBv.js +0 -1
  227. package/dist-storybook/assets/search-field-CQqgFbfg.js +0 -1
  228. package/dist-storybook/assets/section-content-DGNB4eLN.js +0 -1
  229. package/dist-storybook/assets/skeleton-C91JgehG.js +0 -1
  230. package/dist-storybook/assets/store-CPumdfcU.js +0 -1
  231. package/dist-storybook/assets/switch-p-aXI-ev.js +0 -1
  232. package/dist-storybook/assets/text-area-DwSXyqOe.js +0 -1
  233. package/dist-storybook/assets/text-field-jK6rpOo2.js +0 -1
  234. package/dist-storybook/assets/toast-provider-DurnMJhd.js +0 -9
  235. package/dist-storybook/assets/tooltip-QDdel5My.js +0 -1
  236. package/dist-storybook/assets/typography-DEpAJl_i.js +0 -1
  237. package/dist-storybook/assets/use-app-pause-B_tWHKJK.js +0 -29
  238. package/dist-storybook/assets/use-app-resume--900G-dV.js +0 -29
  239. package/dist-storybook/assets/use-custom-icon-event-3VExRzvC.js +0 -29
  240. package/dist-storybook/assets/use-did-hide-BUsL73ab.js +0 -48
  241. package/dist-storybook/assets/use-did-show-C1-VLDxi.js +0 -49
  242. package/dist-storybook/assets/use-histories-E4E2jJEY.js +0 -50
  243. package/dist-storybook/assets/use-history-o1im8IDj.js +0 -67
  244. package/dist-storybook/assets/use-location-CUEaBO4P.js +0 -56
  245. package/dist-storybook/assets/use-navigate-C4CTuFSZ.js +0 -84
  246. package/dist-storybook/assets/use-navigation-type-Dcz4hgKo.js +0 -44
  247. package/dist-storybook/assets/use-page-config-DSJBVQbq.js +0 -48
  248. package/dist-storybook/assets/use-page-scroll-dY-U1Vv4.js +0 -69
  249. package/dist-storybook/assets/use-page-state-CtNpwGPN.js +0 -79
  250. package/dist-storybook/assets/use-settings-changed-BBJwIHTE.js +0 -29
  251. /package/dist/components/app/{components/bottom-tab-bar.d.ts → bottom-tab-bar-layout/index.d.ts} +0 -0
  252. /package/dist/components/app/{components/navigation-bar.d.ts → navigation-bar-layout/index.d.ts} +0 -0
  253. /package/dist/components/app/{components/page-layout.d.ts → page-layout/index.d.ts} +0 -0
  254. /package/dist/{components/app/hooks → hooks}/use-custom-icon-event.d.ts +0 -0
  255. /package/dist/{components/app/hooks → hooks}/use-settings-changed.d.ts +0 -0
@@ -1,67 +0,0 @@
1
- import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as t}from"./index-CgMRTj-o.js";import{b as s}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function o(i){const e={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...t(),...i.components};return n.jsxs(n.Fragment,{children:[`
2
- `,`
3
- `,n.jsx(s,{title:"Hooks/useHistory"}),`
4
- `,n.jsx(e.h1,{id:"usehistory",children:"useHistory"}),`
5
- `,n.jsx(e.p,{children:"Hook để lấy history entry hiện tại của page."}),`
6
- `,n.jsx(e.h2,{id:"import",children:"Import"}),`
7
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useHistory } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,n.jsx(e.h2,{id:"returns",children:"Returns"}),`
10
- `,n.jsxs(e.ul,{children:[`
11
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"history"}),": ",n.jsx(e.code,{children:"IHistory"})," object hoặc ",n.jsx(e.code,{children:"undefined"})," chứa:",`
12
- `,n.jsxs(e.ul,{children:[`
13
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"action"}),": ",n.jsx(e.code,{children:"'PUSH' | 'REPLACE' | 'POP'"})," - Navigation action type"]}),`
14
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"location"}),": ",n.jsx(e.code,{children:"ILocation"})," object chứa:",`
15
- `,n.jsxs(e.ul,{children:[`
16
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"key"}),": ",n.jsx(e.code,{children:"string"})," - Unique key cho location này"]}),`
17
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"pathname"}),": ",n.jsx(e.code,{children:"string"})," - Pathname của page"]}),`
18
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"params?"}),": ",n.jsx(e.code,{children:"Record<string, string>"})," - Query parameters"]}),`
19
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"state?"}),": ",n.jsx(e.code,{children:"any"})," - State object"]}),`
20
- `]}),`
21
- `]}),`
22
- `]}),`
23
- `]}),`
24
- `]}),`
25
- `,n.jsx(e.h2,{id:"type-definitions",children:"Type Definitions"}),`
26
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`type IHistory = {
27
- action: IHistoryAction
28
- location: ILocation
29
- }
30
-
31
- type IHistoryAction = 'POP' | 'REPLACE' | 'PUSH'
32
-
33
- type ILocation = {
34
- key: string
35
- pathname: string
36
- params?: Record&lt;string, string&gt;
37
- state?: any
38
- }
39
- `})}),`
40
- `,n.jsx(e.h2,{id:"usage",children:"Usage"}),`
41
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useHistory } from '@v-miniapp/ui-react'
42
-
43
- const MyPage = () => {
44
- const history = useHistory()
45
-
46
- if (!history) return null
47
-
48
- console.log(history.location.pathname) // '/home'
49
- console.log(history.location.params) // { id: '123' }
50
- console.log(history.location.state) // { from: 'home' }
51
- console.log(history.location.key) // Unique key
52
- console.log(history.action) // 'PUSH' | 'REPLACE' | 'POP'
53
-
54
- return (
55
- <div>
56
- <p>Current path: {history.location.pathname}</p>
57
- <p>Action: {history.action}</p>
58
- </div>
59
- )
60
- }
61
- `})}),`
62
- `,n.jsx(e.h2,{id:"notes",children:"Notes"}),`
63
- `,n.jsxs(e.ul,{children:[`
64
- `,n.jsxs(e.li,{children:["Hook này sử dụng ",n.jsx(e.code,{children:"LocationKeyContext"})," để lấy history entry tương ứng với page hiện tại"]}),`
65
- `,n.jsxs(e.li,{children:["Nếu không có ",n.jsx(e.code,{children:"locationKey"})," trong context, sẽ trả về last history entry"]}),`
66
- `,n.jsx(e.li,{children:"History entry được tạo mới mỗi khi navigate (với unique key)"}),`
67
- `]})]})}function a(i={}){const{wrapper:e}={...t(),...i.components};return e?n.jsx(e,{...i,children:n.jsx(o,{...i})}):o(i)}const x=[];export{x as __namedExportsOrder,a as default};
@@ -1,56 +0,0 @@
1
- import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as s}from"./index-CgMRTj-o.js";import{b as c}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function o(i){const e={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...s(),...i.components};return n.jsxs(n.Fragment,{children:[`
2
- `,`
3
- `,n.jsx(c,{title:"Hooks/useLocation"}),`
4
- `,n.jsx(e.h1,{id:"uselocation",children:"useLocation"}),`
5
- `,n.jsx(e.p,{children:"Hook để lấy location object hiện tại (pathname, params, state, key)."}),`
6
- `,n.jsx(e.h2,{id:"import",children:"Import"}),`
7
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useLocation } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,n.jsx(e.h2,{id:"returns",children:"Returns"}),`
10
- `,n.jsxs(e.ul,{children:[`
11
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"location"}),": ",n.jsx(e.code,{children:"ILocation"})," object hoặc ",n.jsx(e.code,{children:"undefined"})," chứa:",`
12
- `,n.jsxs(e.ul,{children:[`
13
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"key"}),": ",n.jsx(e.code,{children:"string"})," - Unique key cho location này"]}),`
14
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"pathname"}),": ",n.jsx(e.code,{children:"string"})," - Pathname của page"]}),`
15
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"params?"}),": ",n.jsx(e.code,{children:"Record<string, string>"})," - Query parameters"]}),`
16
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"state?"}),": ",n.jsx(e.code,{children:"any"})," - State object"]}),`
17
- `]}),`
18
- `]}),`
19
- `]}),`
20
- `,n.jsx(e.h2,{id:"type-definitions",children:"Type Definitions"}),`
21
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`type ILocation = {
22
- key: string
23
- pathname: string
24
- params?: Record&lt;string, string&gt;
25
- state?: any
26
- }
27
- `})}),`
28
- `,n.jsx(e.h2,{id:"usage",children:"Usage"}),`
29
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useLocation } from '@v-miniapp/ui-react'
30
-
31
- const MyPage = () => {
32
- const location = useLocation()
33
-
34
- if (!location) return null
35
-
36
- console.log(location.pathname) // '/home'
37
- console.log(location.params) // { id: '123' }
38
- console.log(location.state) // { from: 'home' }
39
- console.log(location.key) // Unique key
40
-
41
- return (
42
- <div>
43
- <p>Path: {location.pathname}</p>
44
- {location.params && (
45
- <p>Params: {JSON.stringify(location.params)}</p>
46
- )}
47
- </div>
48
- )
49
- }
50
- `})}),`
51
- `,n.jsx(e.h2,{id:"notes",children:"Notes"}),`
52
- `,n.jsxs(e.ul,{children:[`
53
- `,n.jsxs(e.li,{children:["Hook này là wrapper của ",n.jsx(e.code,{children:"useHistory().location"})]}),`
54
- `,n.jsxs(e.li,{children:["Có thể trả về ",n.jsx(e.code,{children:"undefined"})," nếu không có history entry"]}),`
55
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"location.key"})," là unique identifier cho mỗi navigation instance"]}),`
56
- `]})]})}function h(i={}){const{wrapper:e}={...s(),...i.components};return e?n.jsx(e,{...i,children:n.jsx(o,{...i})}):o(i)}export{h as default};
@@ -1,84 +0,0 @@
1
- import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as o}from"./index-CgMRTj-o.js";import{b as s,M as t}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function i(a){const e={code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...o(),...a.components};return n.jsxs(n.Fragment,{children:[`
2
- `,`
3
- `,n.jsx(s,{title:"Hooks/useNavigate"}),`
4
- `,n.jsx(e.h1,{id:"usenavigate",children:"useNavigate"}),`
5
- `,n.jsxs(e.p,{children:["Hook để lấy function ",n.jsx(e.code,{children:"navigate"})," để điều hướng giữa các pages."]}),`
6
- `,n.jsx(e.h2,{id:"import",children:"Import"}),`
7
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useNavigate } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,n.jsx(e.h2,{id:"returns",children:"Returns"}),`
10
- `,n.jsxs(e.ul,{children:[`
11
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"navigate"}),": Function để điều hướng với type ",n.jsx(e.code,{children:"INavigate"}),":",`
12
- `,n.jsxs(e.ul,{children:[`
13
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"navigate(pathname: string, options?: INavigatePathnameOptions): void"})," - Navigate bằng pathname"]}),`
14
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"navigate(delta: number, options?: INavigateDeltaOptions): void"})," - Navigate bằng delta (back/forward)"]}),`
15
- `]}),`
16
- `]}),`
17
- `]}),`
18
- `,n.jsx(e.h2,{id:"type-definitions",children:"Type Definitions"}),`
19
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`type INavigate = {
20
- (to: string, options?: INavigatePathnameOptions): void
21
- (to: number, options?: INavigateDeltaOptions): void
22
- }
23
-
24
- type INavigatePathnameOptions = {
25
- replace?: boolean
26
- params?: Record&lt;string, string&gt;
27
- state?: any
28
- } & IPageState
29
-
30
- type INavigateDeltaOptions = {
31
- animation?: IAppAnimationState
32
- }
33
- `})}),`
34
- `,n.jsx(e.h2,{id:"usage",children:"Usage"}),`
35
- `,n.jsx(e.h3,{id:"navigate-bằng-pathname",children:"Navigate bằng pathname"}),`
36
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useNavigate } from '@v-miniapp/ui-react'
37
-
38
- const MyPage = () => {
39
- const navigate = useNavigate()
40
-
41
- const handleClick = () => {
42
- navigate('/settings', {
43
- params: { id: '123' },
44
- state: { from: 'home' },
45
- replace: false,
46
- })
47
- }
48
-
49
- return <button onClick={handleClick}>Go to Settings</button>
50
- }
51
- `})}),`
52
- `,n.jsx(e.h3,{id:"navigate-với-page-level-config",children:"Navigate với page-level config"}),`
53
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const navigate = useNavigate()
54
-
55
- navigate('/detail', {
56
- params: { id: '123' },
57
- navigationBar: {
58
- title: 'Detail Page',
59
- },
60
- animation: {
61
- type: 'fade_in',
62
- },
63
- })
64
- `})}),`
65
- `,n.jsx(e.h3,{id:"navigate-backforward",children:"Navigate back/forward"}),`
66
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const navigate = useNavigate()
67
-
68
- // Navigate back 1 page
69
- navigate(-1)
70
-
71
- // Navigate forward 1 page
72
- navigate(1)
73
-
74
- // Navigate back với custom animation
75
- navigate(-1, {
76
- animation: { type: 'none' },
77
- })
78
- `})}),`
79
- `,n.jsx(e.h2,{id:"options",children:"Options"}),`
80
- `,n.jsx(e.h3,{id:"inavigatepathnameoptions",children:"INavigatePathnameOptions"}),`
81
- `,n.jsx(t,{children:"\n| Option | Type | Mô tả |\n| :--- | :--- | :--- |\n| `replace` | `boolean` | Nếu `true`, replace history entry thay vì push mới |\n| `params` | `Record&lt;string, string&gt;` | Query parameters (sẽ được thêm vào URL) |\n| `state` | `any` | State object (không hiển thị trong URL, lưu trong history) |\n| `animation` | `IAppAnimationState` | Override animation cho navigation này |\n| `navigationBar` | `IAppNavigationBarState` | Override navigation bar cho page này |\n| `bottomTabBar` | `IAppBottomTabBarState` | Override bottom tab bar cho page này |\n| `keepAlive` | `boolean | IAppKeepAliveState` | Override keep-alive cho page này |\n| `pageLayout` | `IAppPageLayoutState` | Override page layout cho page này |\n"}),`
82
- `,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Lưu ý:"})," `INavigatePathnameOptions` extends `IPageState`, nên bạn có thể truyền các page-level config trong navigate options để override config cho page mới."]}),`
83
- `,n.jsx(e.h3,{id:"inavigatedeltaoptions",children:"INavigateDeltaOptions"}),`
84
- `,n.jsx(t,{children:"\n| Option | Type | Mô tả |\n| :--- | :--- | :--- |\n| `animation` | `IAppAnimationState` | Override animation cho navigation này |\n"})]})}function d(a={}){const{wrapper:e}={...o(),...a.components};return e?n.jsx(e,{...a,children:n.jsx(i,{...a})}):i(a)}export{d as default};
@@ -1,44 +0,0 @@
1
- import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as s}from"./index-CgMRTj-o.js";import{b as r}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function t(i){const e={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...s(),...i.components};return n.jsxs(n.Fragment,{children:[`
2
- `,`
3
- `,n.jsx(r,{title:"Hooks/useNavigationType"}),`
4
- `,n.jsx(e.h1,{id:"usenavigationtype",children:"useNavigationType"}),`
5
- `,n.jsx(e.p,{children:"Hook để lấy navigation action type (PUSH, REPLACE, POP)."}),`
6
- `,n.jsx(e.h2,{id:"import",children:"Import"}),`
7
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useNavigationType } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,n.jsx(e.h2,{id:"returns",children:"Returns"}),`
10
- `,n.jsxs(e.ul,{children:[`
11
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"action"}),": ",n.jsx(e.code,{children:"'PUSH' | 'REPLACE' | 'POP'"})," hoặc ",n.jsx(e.code,{children:"undefined"})]}),`
12
- `]}),`
13
- `,n.jsx(e.h2,{id:"type-definitions",children:"Type Definitions"}),`
14
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`type IHistoryAction = 'POP' | 'REPLACE' | 'PUSH'
15
- `})}),`
16
- `,n.jsx(e.h2,{id:"usage",children:"Usage"}),`
17
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useNavigationType } from '@v-miniapp/ui-react'
18
-
19
- const MyPage = () => {
20
- const action = useNavigationType()
21
-
22
- console.log(action) // 'PUSH' | 'REPLACE' | 'POP'
23
-
24
- return (
25
- <div>
26
- <p>Navigation type: {action}</p>
27
- {action === 'PUSH' && <p>New page pushed to stack</p>}
28
- {action === 'REPLACE' && <p>Current page replaced</p>}
29
- {action === 'POP' && <p>Navigated back/forward</p>}
30
- </div>
31
- )
32
- }
33
- `})}),`
34
- `,n.jsx(e.h2,{id:"action-types",children:"Action Types"}),`
35
- `,n.jsxs(e.ul,{children:[`
36
- `,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"PUSH"}),": Navigate đến page mới (push vào history stack)"]}),`
37
- `,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"REPLACE"}),": Replace current page (thay thế history entry hiện tại)"]}),`
38
- `,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"POP"}),": Navigate back/forward trong history stack (browser back/forward button)"]}),`
39
- `]}),`
40
- `,n.jsx(e.h2,{id:"notes",children:"Notes"}),`
41
- `,n.jsxs(e.ul,{children:[`
42
- `,n.jsxs(e.li,{children:["Hook này là wrapper của ",n.jsx(e.code,{children:"useHistory().action"})]}),`
43
- `,n.jsxs(e.li,{children:["Có thể trả về ",n.jsx(e.code,{children:"undefined"})," nếu không có history entry"]}),`
44
- `]})]})}function p(i={}){const{wrapper:e}={...s(),...i.components};return e?n.jsx(e,{...i,children:n.jsx(t,{...i})}):t(i)}export{p as default};
@@ -1,48 +0,0 @@
1
- import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as a}from"./index-CgMRTj-o.js";import{b as t}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function o(i){const e={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...a(),...i.components};return n.jsxs(n.Fragment,{children:[`
2
- `,`
3
- `,n.jsx(t,{title:"Hooks/usePageConfig"}),`
4
- `,n.jsx(e.h1,{id:"usepageconfig",children:"usePageConfig"}),`
5
- `,n.jsx(e.p,{children:"Hook để lấy config của page hiện tại."}),`
6
- `,n.jsx(e.h2,{id:"import",children:"Import"}),`
7
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { usePageConfig } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,n.jsx(e.h2,{id:"returns",children:"Returns"}),`
10
- `,n.jsxs(e.ul,{children:[`
11
- `,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"pageConfig"}),": ",n.jsx(e.code,{children:"IPageConfig"})," của page hiện tại hoặc ",n.jsx(e.code,{children:"undefined"})]}),`
12
- `]}),`
13
- `,n.jsx(e.h2,{id:"type-definitions",children:"Type Definitions"}),`
14
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`type IPageConfig = {
15
- pathname: string
16
- Component: ComponentType
17
- Layouts?: IPageLayout[]
18
- bottomTabBarId?: string
19
- } & IPageState
20
- `})}),`
21
- `,n.jsx(e.h2,{id:"usage",children:"Usage"}),`
22
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { usePageConfig } from '@v-miniapp/ui-react'
23
-
24
- const MyPage = () => {
25
- const pageConfig = usePageConfig()
26
-
27
- if (!pageConfig) return null
28
-
29
- console.log(pageConfig.pathname) // '/home'
30
- console.log(pageConfig.Component) // Component của page
31
- console.log(pageConfig.navigationBar) // Navigation bar config
32
- console.log(pageConfig.animation) // Animation config
33
- console.log(pageConfig.Layouts) // Layouts array
34
-
35
- return (
36
- <div>
37
- <p>Page: {pageConfig.pathname}</p>
38
- <p>Title: {pageConfig.navigationBar?.title}</p>
39
- </div>
40
- )
41
- }
42
- `})}),`
43
- `,n.jsx(e.h2,{id:"notes",children:"Notes"}),`
44
- `,n.jsxs(e.ul,{children:[`
45
- `,n.jsxs(e.li,{children:["Hook này tìm page config dựa trên ",n.jsx(e.code,{children:"pathname"})," hiện tại"]}),`
46
- `,n.jsxs(e.li,{children:["Trả về ",n.jsx(e.code,{children:"undefined"})," nếu không tìm thấy page config"]}),`
47
- `,n.jsxs(e.li,{children:["Page config chứa tất cả thông tin được định nghĩa trong ",n.jsx(e.code,{children:"IAppConfig.pages"})]}),`
48
- `]})]})}function l(i={}){const{wrapper:e}={...a(),...i.components};return e?n.jsx(e,{...i,children:n.jsx(o,{...i})}):o(i)}export{l as default};
@@ -1,69 +0,0 @@
1
- import{j as e}from"./iframe-CQAwSt4E.js";import{useMDXComponents as o}from"./index-CgMRTj-o.js";import{b as r}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function t(l){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...o(),...l.components};return e.jsxs(e.Fragment,{children:[`
2
- `,`
3
- `,e.jsx(r,{title:"Hooks/usePageScroll"}),`
4
- `,e.jsx(n.h1,{id:"usepagescroll",children:"usePageScroll"}),`
5
- `,e.jsx(n.p,{children:"Hook để lắng nghe sự kiện scroll của page."}),`
6
- `,e.jsx(n.h2,{id:"import",children:"Import"}),`
7
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-typescript",children:`import { usePageScroll } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,e.jsx(n.h2,{id:"parameters",children:"Parameters"}),`
10
- `,e.jsxs(n.ul,{children:[`
11
- `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"callback: (target: HTMLDivElement, event: Event) => void"}),": Callback được gọi khi scroll"]}),`
12
- `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"options?: IUsePageScrollOptions"}),": Options cho throttle"]}),`
13
- `]}),`
14
- `,e.jsx(n.h2,{id:"type-definitions",children:"Type Definitions"}),`
15
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-typescript",children:`type IUsePageScrollOptions = {
16
- throttle?: ThrottleOptions
17
- }
18
-
19
- type ThrottleOptions = {
20
- wait?: number
21
- leading?: boolean
22
- trailing?: boolean
23
- }
24
- `})}),`
25
- `,e.jsx(n.h2,{id:"usage",children:"Usage"}),`
26
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { usePageScroll } from '@v-miniapp/ui-react'
27
-
28
- const MyPage = () => {
29
- usePageScroll((target, event) => {
30
- console.log('Scroll position:', target.scrollTop)
31
- // Handle scroll event
32
- }, {
33
- throttle: {
34
- wait: 200, // Throttle 200ms
35
- trailing: true,
36
- }
37
- })
38
-
39
- return <div>Scroll me</div>
40
- }
41
- `})}),`
42
- `,e.jsx(n.h3,{id:"với-throttle-options",children:"Với throttle options"}),`
43
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`usePageScroll(
44
- (target, event) => {
45
- const scrollTop = target.scrollTop
46
- const scrollHeight = target.scrollHeight
47
- const clientHeight = target.clientHeight
48
-
49
- // Detect scroll to bottom
50
- if (scrollTop + clientHeight >= scrollHeight - 10) {
51
- loadMore()
52
- }
53
- },
54
- {
55
- throttle: {
56
- wait: 100,
57
- leading: false,
58
- trailing: true,
59
- }
60
- }
61
- )
62
- `})}),`
63
- `,e.jsx(n.h2,{id:"notes",children:"Notes"}),`
64
- `,e.jsxs(n.ul,{children:[`
65
- `,e.jsxs(n.li,{children:["Hook chỉ hoạt động khi page được hiển thị (",e.jsx(n.code,{children:"didShow === true"}),")"]}),`
66
- `,e.jsxs(n.li,{children:["Sử dụng ",e.jsx(n.code,{children:"useThrottleFn"})," từ ",e.jsx(n.code,{children:"ahooks"})," để throttle scroll events (mặc định 200ms)"]}),`
67
- `,e.jsxs(n.li,{children:["Scroll element là element có ",e.jsx(n.code,{children:'id="vsf-global-page"'})]}),`
68
- `,e.jsxs(n.li,{children:["Callback nhận 2 parameters: ",e.jsx(n.code,{children:"target"})," (scroll element) và ",e.jsx(n.code,{children:"event"})," (scroll event)"]}),`
69
- `]})]})}function d(l={}){const{wrapper:n}={...o(),...l.components};return n?e.jsx(n,{...l,children:e.jsx(t,{...l})}):t(l)}export{d as default};
@@ -1,79 +0,0 @@
1
- import{j as e}from"./iframe-CQAwSt4E.js";import{useMDXComponents as i}from"./index-CgMRTj-o.js";import{b as s}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function a(t){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...i(),...t.components};return e.jsxs(e.Fragment,{children:[`
2
- `,`
3
- `,e.jsx(s,{title:"Hooks/usePageState"}),`
4
- `,e.jsx(n.h1,{id:"usepagestate",children:"usePageState"}),`
5
- `,e.jsx(n.p,{children:"Hook để quản lý state của page hiện tại."}),`
6
- `,e.jsx(n.h2,{id:"import",children:"Import"}),`
7
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-typescript",children:`import { usePageState } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,e.jsx(n.h2,{id:"returns",children:"Returns"}),`
10
- `,e.jsxs(n.ul,{children:[`
11
- `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"pageState"}),": ",e.jsx(n.code,{children:"IPageState"})," của page hiện tại hoặc ",e.jsx(n.code,{children:"undefined"})]}),`
12
- `,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"setPageState"}),": ",e.jsx(n.code,{children:"Dispatch<SetStateAction<IPageState | undefined>>"})," - Function để update page state"]}),`
13
- `]}),`
14
- `,e.jsx(n.h2,{id:"type-definitions",children:"Type Definitions"}),`
15
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-typescript",children:`type IPageState = Omit&lt;IAppState, 'keepAlive'&gt; & { keepAlive?: boolean }
16
-
17
- type IAppState = {
18
- animation?: IAppAnimationState
19
- navigationBar?: IAppNavigationBarState
20
- bottomTabBar?: IAppBottomTabBarState
21
- keepAlive?: boolean | IAppKeepAliveState
22
- pageLayout?: IAppPageLayoutState
23
- }
24
- `})}),`
25
- `,e.jsx(n.h2,{id:"usage",children:"Usage"}),`
26
- `,e.jsx(n.h3,{id:"update-navigation-bar",children:"Update navigation bar"}),`
27
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { usePageState } from '@v-miniapp/ui-react'
28
-
29
- const MyPage = () => {
30
- const { pageState, setPageState } = usePageState()
31
-
32
- const updateTitle = () => {
33
- setPageState({
34
- navigationBar: {
35
- title: 'New Title',
36
- },
37
- })
38
- }
39
-
40
- return <button onClick={updateTitle}>Update Title</button>
41
- }
42
- `})}),`
43
- `,e.jsx(n.h3,{id:"update-với-function",children:"Update với function"}),`
44
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`const { setPageState } = usePageState()
45
-
46
- setPageState(prevState => ({
47
- ...prevState,
48
- navigationBar: {
49
- ...prevState?.navigationBar,
50
- title: 'Updated Title',
51
- },
52
- }))
53
- `})}),`
54
- `,e.jsx(n.h3,{id:"update-animation",children:"Update animation"}),`
55
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`setPageState({
56
- animation: {
57
- type: 'fade_in',
58
- },
59
- })
60
- `})}),`
61
- `,e.jsx(n.h3,{id:"update-page-layout",children:"Update page layout"}),`
62
- `,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`setPageState({
63
- pageLayout: {
64
- contentClassName: 'custom-class',
65
- pullToRefresh: {
66
- onRefresh: async () => {
67
- await fetchData()
68
- },
69
- },
70
- },
71
- })
72
- `})}),`
73
- `,e.jsx(n.h2,{id:"notes",children:"Notes"}),`
74
- `,e.jsxs(n.ul,{children:[`
75
- `,e.jsxs(n.li,{children:["Page state được lưu theo ",e.jsx(n.code,{children:"location.key"}),", mỗi navigation instance có state riêng"]}),`
76
- `,e.jsx(n.li,{children:"State được merge với app-level config và page-level config"}),`
77
- `,e.jsxs(n.li,{children:["Có thể set ",e.jsx(n.code,{children:"undefined"})," để xóa page state"]}),`
78
- `,e.jsx(n.li,{children:"State được persist trong navigation stack (với keep-alive)"}),`
79
- `]})]})}function p(t={}){const{wrapper:n}={...i(),...t.components};return n?e.jsx(n,{...t,children:e.jsx(a,{...t})}):a(t)}export{p as default};
@@ -1,29 +0,0 @@
1
- import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as r}from"./index-CgMRTj-o.js";import{b as d,M as i}from"./blocks-BuaOUtiH.js";import{t as s}from"./store-D2RudmNr.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function o(t){const e={code:"code",h1:"h1",h2:"h2",pre:"pre",...r(),...t.components};return n.jsxs(n.Fragment,{children:[`
2
- `,`
3
- `,n.jsx(d,{title:"Hooks/useSettingsChanged"}),`
4
- `,n.jsx(e.h1,{id:"usesettingschanged",children:"useSettingsChanged"}),`
5
- `,n.jsx(i,{children:s("hooks.useSettingsChanged.description")}),`
6
- `,n.jsx(e.h2,{id:"import",children:"Import"}),`
7
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useSettingsChanged } from '@v-miniapp/ui-react'
8
- `})}),`
9
- `,n.jsx(e.h2,{id:"props",children:"Props"}),`
10
- `,n.jsx(i,{children:`
11
- | Name | Type | Required | Default | Description |
12
- | ----------------- | ---------------------------------------- | -------- | ------- | ----------- |
13
- | onSettingsChanged | (settings: ISettings) => void | Yes | - | ${s("hooks.useSettingsChanged.onSettingsChangedDescription")} |
14
- `}),`
15
- `,n.jsx(e.h2,{id:"",children:s("hooks.usageExample")}),`
16
- `,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useSettingsChanged } from '@v-miniapp/ui-react';
17
-
18
- function MyComponent() {
19
- useSettingsChanged((settings) => {
20
- console.log('Settings changed:', settings);
21
- });
22
-
23
- return (
24
- <div>
25
- <h1>My Component</h1>
26
- </div>
27
- );
28
- }
29
- `})})]})}function u(t={}){const{wrapper:e}={...r(),...t.components};return e?n.jsx(e,{...t,children:n.jsx(o,{...t})}):o(t)}export{u as default};