@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.
- package/dist/components/app/app.d.ts +17 -0
- package/dist/components/app/bottom-tab-bar-layout/hook.d.ts +21 -0
- package/dist/components/app/bottom-tab-bar-layout/store.d.ts +13 -0
- package/dist/components/app/bottom-tab-bar-layout/type.d.ts +13 -0
- package/dist/components/app/data-theme.d.ts +8 -0
- package/dist/components/app/index.d.ts +9 -18
- package/dist/components/app/navigation-bar-layout/hook.d.ts +17 -0
- package/dist/components/app/navigation-bar-layout/store.d.ts +13 -0
- package/dist/components/app/navigation-bar-layout/type.d.ts +7 -0
- package/dist/components/app/page-layout/hook.d.ts +21 -0
- package/dist/components/app/page-layout/store.d.ts +13 -0
- package/dist/components/app/page-layout/type.d.ts +8 -0
- package/dist/components/app/type.d.ts +27 -0
- package/dist/components/calendar/default-render.d.ts +1 -1
- package/dist/components/calendar/utils.d.ts +1 -1
- package/dist/components/carousel/index.d.ts +1 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +2 -2
- package/dist/components/layout/page.d.ts +8 -1
- package/dist/external/index.js +11344 -7959
- package/dist/external/styles.css +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4194 -4376
- package/dist/styles.css +1 -1
- package/dist/utils/event-emitter.d.ts +4 -0
- package/dist-storybook/assets/App-Dp1UG-xp.js +93 -0
- package/dist-storybook/assets/{Color-AVL7NMMY-1_8XTICv.js → Color-AVL7NMMY-XA8cFKdV.js} +1 -1
- package/dist-storybook/assets/DEEPLINK-cjgFMuRJ.js +33 -0
- package/dist-storybook/assets/{DocsRenderer-PQXLIZUC-BO86igwd.js → DocsRenderer-PQXLIZUC-D10-0Yfb.js} +2 -2
- package/dist-storybook/assets/EVENTS-BY66PjI7.js +65 -0
- package/dist-storybook/assets/GETTING_STARTED-580o-9Mx.js +64 -0
- package/dist-storybook/assets/GETTING_STARTED-BiQMvjvo.js +62 -0
- package/dist-storybook/assets/GETTING_STARTED-CIVMqKZW.js +80 -0
- package/dist-storybook/assets/{INFINITE_SCROLL-BtM3uoX0.js → INFINITE_SCROLL-BbeR5HeP.js} +1 -1
- package/dist-storybook/assets/LocalesProvider-CMlmwAyY.js +53 -0
- package/dist-storybook/assets/MIGRATE_DARKMODE_TO_THEME-CBDyZyg2.js +107 -0
- package/dist-storybook/assets/{MIGRATION_GUIDE-2LONslE4.js → MIGRATION_GUIDE-FZyRWI-B.js} +3 -3
- package/dist-storybook/assets/OVERVIEW-C9_6gX5Q.js +51 -0
- package/dist-storybook/assets/Router-B5U8bubH.js +71 -0
- package/dist-storybook/assets/{TAILWIND_INTEGRATION-_T-VfvkM.js → TAILWIND_INTEGRATION-BJdy5DAv.js} +1 -1
- package/dist-storybook/assets/THEME-CRbvH7KT.js +103 -0
- package/dist-storybook/assets/_baseClone-DQVxEhny.js +1 -0
- package/dist-storybook/assets/alert-CKwsuaPI.js +1 -0
- package/dist-storybook/assets/{alert.stories-B-vuojPh.js → alert.stories-D0X5wUHk.js} +3 -3
- package/dist-storybook/assets/app-CTv8lFU3.js +1 -0
- package/dist-storybook/assets/avatar-rWcYGe6j.js +1 -0
- package/dist-storybook/assets/{avatar.stories-KYFztAc8.js → avatar.stories-8lrbhMma.js} +6 -6
- package/dist-storybook/assets/{axe-CmvD4WV5.js → axe-BHGdSCoA.js} +1 -1
- package/dist-storybook/assets/badge-VcjGVEum.js +1 -0
- package/dist-storybook/assets/{badge.stories-Be2ItCmQ.js → badge.stories-BEFNaUA1.js} +3 -3
- package/dist-storybook/assets/{blocks-BuaOUtiH.js → blocks-DKR3P4qW.js} +3 -3
- package/dist-storybook/assets/{bottom-tab-bar-CtcTAxuI.js → bottom-tab-bar-B6IAoRwz.js} +1 -1
- package/dist-storybook/assets/{bottom-tab-bar.stories-CDmEve6z.js → bottom-tab-bar.stories-DXzLlO5o.js} +3 -3
- package/dist-storybook/assets/button-DJH3RlJl.js +1 -0
- package/dist-storybook/assets/{button.stories-CaqLWQiY.js → button.stories-DgYDJ6x7.js} +3 -3
- package/dist-storybook/assets/calendar-C4Xe_TW2.js +1 -0
- package/dist-storybook/assets/{calendar.stories-DLWZldet.js → calendar.stories-IVvRAjWN.js} +3 -3
- package/dist-storybook/assets/carousel-DJlgMyS5.js +37 -0
- package/dist-storybook/assets/{carousel.stories-B8YbGOOr.js → carousel.stories-3rA3nxdL.js} +3 -3
- package/dist-storybook/assets/checkbox-JOxcmyCZ.js +1 -0
- package/dist-storybook/assets/{checkbox.stories-CLvfZPiw.js → checkbox.stories-ge3pgfBb.js} +3 -3
- package/dist-storybook/assets/chip-Crt60rph.js +1 -0
- package/dist-storybook/assets/{chip.stories-BbwJb5eD.js → chip.stories-D7E6fdiV.js} +3 -3
- package/dist-storybook/assets/{date-Cg-Uk_pp.js → date-B3PFMb6s.js} +1 -1
- package/dist-storybook/assets/date-field-range-B-sv9nbW.js +1 -0
- package/dist-storybook/assets/date-field.stories-B9G2heHt.js +129 -0
- package/dist-storybook/assets/date-picker-BPzKPdhO.js +1 -0
- package/dist-storybook/assets/{date-picker.stories-BuGWvzFL.js → date-picker.stories-CIFgk4q_.js} +3 -3
- package/dist-storybook/assets/dialog-BAfGQzk5.js +1 -0
- package/dist-storybook/assets/{dialog.stories-DJ0WsSkA.js → dialog.stories-vDMKz9Tw.js} +3 -3
- package/dist-storybook/assets/{chip-kG4p82WT.js → dropdown-Dtomaqpw.js} +2 -2
- package/dist-storybook/assets/{dropdown.stories-D6JUYP73.js → dropdown.stories-Cj0HM0VI.js} +3 -3
- package/dist-storybook/assets/{embla-carousel-react.esm-BYjpaHZ9.js → embla-carousel-react.esm-5D5fs7OQ.js} +1 -1
- package/dist-storybook/assets/icon-CdiFzFyf.js +1 -0
- package/dist-storybook/assets/{icon.stories-B-ZvRzFf.js → icon.stories-DWwbUUY-.js} +3 -3
- package/dist-storybook/assets/iframe-BHaCv4dM.css +1 -0
- package/dist-storybook/assets/{iframe-CQAwSt4E.js → iframe-DfPay7Zl.js} +42 -42
- package/dist-storybook/assets/image-CMKb-R3x.js +9 -0
- package/dist-storybook/assets/{image.stories-C4l8D3ju.js → image.stories-BhZU057W.js} +3 -3
- package/dist-storybook/assets/index-BWpuenI4.js +1 -0
- package/dist-storybook/assets/{index-CgMRTj-o.js → index-DqZh6B0b.js} +1 -1
- package/dist-storybook/assets/{index-BV0AJWP6.js → index-EGt7xBnA.js} +1 -1
- package/dist-storybook/assets/{index-DHiZ-gXR.js → index-cMNObl2z.js} +1 -1
- package/dist-storybook/assets/input-wrapper-CgaUwbbE.js +1 -0
- package/dist-storybook/assets/{label-DV2iCDmN.js → label-D44azUgi.js} +1 -1
- package/dist-storybook/assets/{label.stories-BwTIPFXX.js → label.stories-CXJjdYf_.js} +3 -3
- package/dist-storybook/assets/{navigation-bar-vI-FPasP.js → navigation-bar-DK3TxcTu.js} +2 -2
- package/dist-storybook/assets/{navigation-bar.stories-DYuFaJFD.js → navigation-bar.stories-CB3Kg-sH.js} +3 -3
- package/dist-storybook/assets/number-field-Bz7su9S1.js +1 -0
- package/dist-storybook/assets/{number-field.stories--fn26TJu.js → number-field.stories-DSxPSzLv.js} +3 -3
- package/dist-storybook/assets/omit-BWHsnDSR.js +1 -0
- package/dist-storybook/assets/option-item-CpeNcb5w.js +1 -0
- package/dist-storybook/assets/{option-item.stories-snjAvgay.js → option-item.stories-BvXoc8WX.js} +3 -3
- package/dist-storybook/assets/pagination-Cp-DHO4Q.js +1 -0
- package/dist-storybook/assets/{pagination.stories-BoEs0jzS.js → pagination.stories-_5qj2nTS.js} +4 -4
- package/dist-storybook/assets/proxy-B4G9nIBd.js +1 -0
- package/dist-storybook/assets/radio-D0aV0RIg.js +1 -0
- package/dist-storybook/assets/{radio.stories-DuN-Awi_.js → radio.stories-BNR-wwuw.js} +3 -3
- package/dist-storybook/assets/rating-D2e8RTGl.js +1 -0
- package/dist-storybook/assets/{rating.stories-BCcQjMEx.js → rating.stories-CI0LG0Qq.js} +3 -3
- package/dist-storybook/assets/{react-18-CNyWQ7je.js → react-18-C7pDmBBf.js} +1 -1
- package/dist-storybook/assets/{react-hufnxGVs.js → react-I9jCW2VV.js} +1 -1
- package/dist-storybook/assets/search-field-DINESW8Y.js +1 -0
- package/dist-storybook/assets/{search-field.stories-DiCZbhng.js → search-field.stories-CKXC6-Za.js} +3 -3
- package/dist-storybook/assets/section-content-D49PabBW.js +1 -0
- package/dist-storybook/assets/{section.stories-C2I_kKhu.js → section.stories-9vd48AgB.js} +3 -3
- package/dist-storybook/assets/sheet-footer-nEdxsYan.js +1 -0
- package/dist-storybook/assets/{sheet.stories-wk1JaKU5.js → sheet.stories-C3gLIQsn.js} +3 -3
- package/dist-storybook/assets/skeleton-B12XbNAJ.js +1 -0
- package/dist-storybook/assets/{skeleton.stories-BCmX-VNr.js → skeleton.stories-C0y1o1Y_.js} +3 -3
- package/dist-storybook/assets/{store-D2RudmNr.js → store-Ce3Ikv5g.js} +5 -5
- package/dist-storybook/assets/switch-D0Z9tWin.js +1 -0
- package/dist-storybook/assets/{switch.stories-BqPLNKB9.js → switch.stories-BdWFln-M.js} +3 -3
- package/dist-storybook/assets/{tab-bar-CSeCmtIZ.js → tab-bar-kExoGg5P.js} +1 -1
- package/dist-storybook/assets/{tab-bar.stories-Cb6v8H2w.js → tab-bar.stories-BgDXX0of.js} +3 -3
- package/dist-storybook/assets/text-area-GKy5HL12.js +1 -0
- package/dist-storybook/assets/{text-area.stories-By8bCfgc.js → text-area.stories-DCt3RB3A.js} +3 -3
- package/dist-storybook/assets/text-field-CGWNqitB.js +1 -0
- package/dist-storybook/assets/{text-field.stories-CrWBAhvI.js → text-field.stories-Bqv7f948.js} +3 -3
- package/dist-storybook/assets/toast-provider-DKSrfhJD.js +9 -0
- package/dist-storybook/assets/{toast.stories-iWAToAZA.js → toast.stories-CcFzS6QI.js} +1 -1
- package/dist-storybook/assets/tooltip-B9rDI6z9.js +1 -0
- package/dist-storybook/assets/{tooltip.stories-RC6SuPPD.js → tooltip.stories-DDdsuU3U.js} +3 -3
- package/dist-storybook/assets/typography-CB8hPDyK.js +1 -0
- package/dist-storybook/assets/{typography.stories-Bu8qFugR.js → typography.stories-BzCxaZQU.js} +3 -3
- package/dist-storybook/assets/{uploader.stories-B2wW9qVy.js → uploader.stories-izVumFqZ.js} +3 -3
- package/dist-storybook/assets/use-app-pause-ClsUnndr.js +21 -0
- package/dist-storybook/assets/use-app-resume-D_EcIvMd.js +21 -0
- package/dist-storybook/assets/use-bottom-tab-bar-BC1cz2uE.js +49 -0
- package/dist-storybook/assets/use-custom-icon-event-cUk4Md0Y.js +26 -0
- package/dist-storybook/assets/use-did-hide-BmABiaUE.js +30 -0
- package/dist-storybook/assets/use-did-show-CQuySkkT.js +30 -0
- package/dist-storybook/assets/use-histories-CBm09Lno.js +30 -0
- package/dist-storybook/assets/use-history-7yguNz6O.js +33 -0
- package/dist-storybook/assets/use-language-DPyWMce2.js +46 -0
- package/dist-storybook/assets/use-load-more-KlDJZhj2.js +42 -0
- package/dist-storybook/assets/use-location-C7kE1yla.js +39 -0
- package/dist-storybook/assets/use-navigate-BpIyvtwc.js +36 -0
- package/dist-storybook/assets/use-navigation-bar-guzwhM_u.js +42 -0
- package/dist-storybook/assets/use-navigation-type-DOndDqQH.js +27 -0
- package/dist-storybook/assets/use-page-layout-dO6ylI1b.js +37 -0
- package/dist-storybook/assets/use-page-scroll-CCG2d2Gb.js +42 -0
- package/dist-storybook/assets/use-pull-to-refresh-lhumDu1H.js +38 -0
- package/dist-storybook/assets/use-settings-changed-Bt58DJ-c.js +30 -0
- package/dist-storybook/assets/use-translate-Jhz6jTXo.js +59 -0
- package/dist-storybook/assets/{visibility-sensor-CwrzJO06.js → visibility-sensor-Jf-Nmil6.js} +1 -1
- package/dist-storybook/iframe.html +2 -2
- package/dist-storybook/index.json +1 -1
- package/dist-storybook/project.json +1 -1
- package/dist-storybook/sb-addons/a11y-2/manager-bundle.js +2 -2
- package/dist-storybook/sb-addons/docs-1/manager-bundle.js +2 -2
- package/dist-storybook/sb-addons/storybook-build-3/manager-bundle.js +1 -1
- package/dist-storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +4 -4
- package/dist-storybook/stories-data.json +152 -122
- package/package.json +3 -1
- package/dist/components/app/components/app.d.ts +0 -13
- package/dist/components/app/components/link.d.ts +0 -8
- package/dist/components/app/components/navigation-analytic.d.ts +0 -2
- package/dist/components/app/components/pages-render.d.ts +0 -2
- package/dist/components/app/context/location-key.d.ts +0 -4
- package/dist/components/app/hooks/use-app-pause.d.ts +0 -1
- package/dist/components/app/hooks/use-app-resume.d.ts +0 -1
- package/dist/components/app/hooks/use-app-state.d.ts +0 -7
- package/dist/components/app/hooks/use-bottom-tab-bar.d.ts +0 -13
- package/dist/components/app/hooks/use-did-hide.d.ts +0 -1
- package/dist/components/app/hooks/use-did-show.d.ts +0 -1
- package/dist/components/app/hooks/use-history.d.ts +0 -2
- package/dist/components/app/hooks/use-location.d.ts +0 -1
- package/dist/components/app/hooks/use-navigate.d.ts +0 -1
- package/dist/components/app/hooks/use-navigation-bar.d.ts +0 -12
- package/dist/components/app/hooks/use-navigation-type.d.ts +0 -1
- package/dist/components/app/hooks/use-page-config.d.ts +0 -1
- package/dist/components/app/hooks/use-page-layout.d.ts +0 -14
- package/dist/components/app/hooks/use-page-scroll.d.ts +0 -5
- package/dist/components/app/hooks/use-page-state.d.ts +0 -6
- package/dist/components/app/stores/app.d.ts +0 -24
- package/dist/components/app/stores/app.selector.d.ts +0 -11
- package/dist/components/app/types/app.d.ts +0 -55
- package/dist/components/app/types/navigation.d.ts +0 -30
- package/dist/components/app/utils/animation.d.ts +0 -2
- package/dist/components/app/utils/data-theme.d.ts +0 -5
- package/dist/components/app/utils/history.d.ts +0 -7
- package/dist/hooks/use-analytic.d.ts +0 -1
- package/dist/hooks/use-is-using-app.d.ts +0 -1
- package/dist/hooks/use-is-using-locales.d.ts +0 -1
- package/dist/locales/defaultResources/en.d.ts +0 -27
- package/dist/locales/defaultResources/vi.d.ts +0 -27
- package/dist/locales/fns.d.ts +0 -6
- package/dist/locales/hooks.d.ts +0 -9
- package/dist/locales/index.d.ts +0 -4
- package/dist/locales/provider.d.ts +0 -6
- package/dist/locales/store.d.ts +0 -13
- package/dist/locales/types.d.ts +0 -37
- package/dist/locales/utils.d.ts +0 -2
- package/dist-storybook/assets/ANIMATION-CUdn1GTK.js +0 -99
- package/dist-storybook/assets/APP_FRAMEWORK-ljbIOHYd.js +0 -197
- package/dist-storybook/assets/BOTTOM_TAB_BAR-DxCwCfBK.js +0 -175
- package/dist-storybook/assets/CUSTOM_ERROR_BOUNDARY-B4wTQNZc.js +0 -250
- package/dist-storybook/assets/DARK_MODE-CoHseCDO.js +0 -57
- package/dist-storybook/assets/GETTING_STARTED-H_vVi5cv.js +0 -77
- package/dist-storybook/assets/KEEP_ALIVE-CL2au0al.js +0 -126
- package/dist-storybook/assets/LOCALE-XTCey55y.js +0 -465
- package/dist-storybook/assets/MOBILE_BEHAVIOURS-DZ6alKTX.js +0 -177
- package/dist-storybook/assets/PAGE_LAYOUT-BuOpN-1Y.js +0 -192
- package/dist-storybook/assets/ROUTING_NAVIGATION-BCPHXNto.js +0 -335
- package/dist-storybook/assets/_setToString-CbM921C9.js +0 -1
- package/dist-storybook/assets/alert-DLW8CoyB.js +0 -1
- package/dist-storybook/assets/avatar-GxcYPA1p.js +0 -1
- package/dist-storybook/assets/badge-D_LzMVtw.js +0 -1
- package/dist-storybook/assets/button-CL7GeC23.js +0 -1
- package/dist-storybook/assets/calendar-dOCsjhVU.js +0 -1
- package/dist-storybook/assets/carousel-1Kww3hIz.js +0 -37
- package/dist-storybook/assets/checkbox-MGytNNRt.js +0 -1
- package/dist-storybook/assets/classname-CUR_zgkh.js +0 -1
- package/dist-storybook/assets/date-field.stories-Diptwqfv.js +0 -129
- package/dist-storybook/assets/date-picker-Dnq_-0Md.js +0 -1
- package/dist-storybook/assets/icon-DdQsMyRa.js +0 -1
- package/dist-storybook/assets/iframe-yMKl6hJA.css +0 -1
- package/dist-storybook/assets/image-C3EsNRhz.js +0 -9
- package/dist-storybook/assets/input-wrapper-BKHgnPy6.js +0 -1
- package/dist-storybook/assets/number-field-CXKmnfKe.js +0 -1
- package/dist-storybook/assets/omit-Bsx5nTI0.js +0 -1
- package/dist-storybook/assets/option-item-LRh_OyV4.js +0 -1
- package/dist-storybook/assets/pagination-DZHoBs_4.js +0 -1
- package/dist-storybook/assets/pick-BhmhLmLe.js +0 -1
- package/dist-storybook/assets/radio-B5NJxG_l.js +0 -1
- package/dist-storybook/assets/rating-BdXViYBv.js +0 -1
- package/dist-storybook/assets/search-field-CQqgFbfg.js +0 -1
- package/dist-storybook/assets/section-content-DGNB4eLN.js +0 -1
- package/dist-storybook/assets/skeleton-C91JgehG.js +0 -1
- package/dist-storybook/assets/store-CPumdfcU.js +0 -1
- package/dist-storybook/assets/switch-p-aXI-ev.js +0 -1
- package/dist-storybook/assets/text-area-DwSXyqOe.js +0 -1
- package/dist-storybook/assets/text-field-jK6rpOo2.js +0 -1
- package/dist-storybook/assets/toast-provider-DurnMJhd.js +0 -9
- package/dist-storybook/assets/tooltip-QDdel5My.js +0 -1
- package/dist-storybook/assets/typography-DEpAJl_i.js +0 -1
- package/dist-storybook/assets/use-app-pause-B_tWHKJK.js +0 -29
- package/dist-storybook/assets/use-app-resume--900G-dV.js +0 -29
- package/dist-storybook/assets/use-custom-icon-event-3VExRzvC.js +0 -29
- package/dist-storybook/assets/use-did-hide-BUsL73ab.js +0 -48
- package/dist-storybook/assets/use-did-show-C1-VLDxi.js +0 -49
- package/dist-storybook/assets/use-histories-E4E2jJEY.js +0 -50
- package/dist-storybook/assets/use-history-o1im8IDj.js +0 -67
- package/dist-storybook/assets/use-location-CUEaBO4P.js +0 -56
- package/dist-storybook/assets/use-navigate-C4CTuFSZ.js +0 -84
- package/dist-storybook/assets/use-navigation-type-Dcz4hgKo.js +0 -44
- package/dist-storybook/assets/use-page-config-DSJBVQbq.js +0 -48
- package/dist-storybook/assets/use-page-scroll-dY-U1Vv4.js +0 -69
- package/dist-storybook/assets/use-page-state-CtNpwGPN.js +0 -79
- package/dist-storybook/assets/use-settings-changed-BBJwIHTE.js +0 -29
- /package/dist/components/app/{components/bottom-tab-bar.d.ts → bottom-tab-bar-layout/index.d.ts} +0 -0
- /package/dist/components/app/{components/navigation-bar.d.ts → navigation-bar-layout/index.d.ts} +0 -0
- /package/dist/components/app/{components/page-layout.d.ts → page-layout/index.d.ts} +0 -0
- /package/dist/{components/app/hooks → hooks}/use-custom-icon-event.d.ts +0 -0
- /package/dist/{components/app/hooks → hooks}/use-settings-changed.d.ts +0 -0
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as h}from"./index-CgMRTj-o.js";import{b as r,M as s}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function t(i){const e={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...h(),...i.components};return n.jsxs(n.Fragment,{children:[`
|
|
2
|
-
`,`
|
|
3
|
-
`,n.jsx(r,{title:"App Framework/Mobile Behaviours"}),`
|
|
4
|
-
`,n.jsx(e.h1,{id:"mobile-behaviours",children:"Mobile Behaviours"}),`
|
|
5
|
-
`,n.jsxs(e.p,{children:["Component ",n.jsx(e.code,{children:"App"})," đã tích hợp sẵn nhiều behaviours giống native app để mang lại trải nghiệm mobile tự nhiên và mượt mà."]}),`
|
|
6
|
-
`,n.jsx(e.h2,{id:"tổng-quan",children:"Tổng quan"}),`
|
|
7
|
-
`,n.jsxs(e.p,{children:["Các behaviours sau đã được implement sẵn trong ",n.jsx(e.code,{children:"App"}),":"]}),`
|
|
8
|
-
`,n.jsxs(e.ol,{children:[`
|
|
9
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Swipe Navigation"})," - Swipe từ cạnh màn hình để navigate back/forward"]}),`
|
|
10
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Pull to Refresh"})," - Kéo xuống để refresh page"]}),`
|
|
11
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Keep Alive"})," - Giữ state và scroll position của page khi navigate. Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-keep-alive--docs",children:"Keep Alive Config"})]}),`
|
|
12
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Scroll Restoration"})," - Tự động khôi phục scroll position khi navigate back"]}),`
|
|
13
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Page Stacking"})," - Stack các pages giống native app với keep-alive"]}),`
|
|
14
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Animation"})," - Animation chuyển trang giữa các pages. Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-animation--docs",children:"Animation Config"})]}),`
|
|
15
|
-
`]}),`
|
|
16
|
-
`,n.jsx(e.hr,{}),`
|
|
17
|
-
`,n.jsx(e.h2,{id:"1-swipe-navigation",children:"1. Swipe Navigation"}),`
|
|
18
|
-
`,n.jsx(e.p,{children:"Swipe navigation cho phép user swipe từ cạnh màn hình để navigate back/forward, giống như native app iOS/Android."}),`
|
|
19
|
-
`,n.jsx(e.h3,{id:"cách-hoạt-động",children:"Cách hoạt động"}),`
|
|
20
|
-
`,n.jsxs(e.ul,{children:[`
|
|
21
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Phát hiện gesture"}),": Hệ thống phát hiện swipe gesture từ cạnh trái hoặc phải màn hình"]}),`
|
|
22
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Tự động tắt animation"}),": Khi phát hiện swipe gesture, animation chuyển trang sẽ tự động bị tắt để tránh conflict với gesture animation tự nhiên"]}),`
|
|
23
|
-
`]}),`
|
|
24
|
-
`,n.jsx(e.h3,{id:"lưu-ý",children:"Lưu ý"}),`
|
|
25
|
-
`,n.jsxs(e.ul,{children:[`
|
|
26
|
-
`,n.jsx(e.li,{children:"Swipe navigation hoạt động tự động, không cần config"}),`
|
|
27
|
-
`,n.jsx(e.li,{children:"Chỉ hoạt động trên mobile/touch devices"}),`
|
|
28
|
-
`,n.jsxs(e.li,{children:["Animation sẽ tự động tắt khi swipe để tránh conflict. Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-animation--docs",children:"Animation Config"})]}),`
|
|
29
|
-
`]}),`
|
|
30
|
-
`,n.jsx(e.hr,{}),`
|
|
31
|
-
`,n.jsx(e.h2,{id:"2-pull-to-refresh",children:"2. Pull to Refresh"}),`
|
|
32
|
-
`,n.jsx(e.p,{children:"Pull to Refresh cho phép user kéo xuống để refresh page, giống như native app."}),`
|
|
33
|
-
`,n.jsx(e.h3,{id:"cách-sử-dụng",children:"Cách sử dụng"}),`
|
|
34
|
-
`,n.jsxs(e.h4,{id:"sử-dụng-hook-usepulltorefresh",children:["Sử dụng Hook ",n.jsx(e.code,{children:"usePullToRefresh"})]}),`
|
|
35
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { usePullToRefresh } from '@v-miniapp/ui-react'
|
|
36
|
-
|
|
37
|
-
const MyPage: FC = () => {
|
|
38
|
-
const handleRefresh = async () => {
|
|
39
|
-
// Fetch data mới
|
|
40
|
-
await fetchData()
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
usePullToRefresh(handleRefresh)
|
|
44
|
-
|
|
45
|
-
return <div>Page content</div>
|
|
46
|
-
}
|
|
47
|
-
`})}),`
|
|
48
|
-
`,n.jsx(e.h4,{id:"sử-dụng-page-layout-config",children:"Sử dụng Page Layout Config"}),`
|
|
49
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
50
|
-
pages: [
|
|
51
|
-
{
|
|
52
|
-
pathname: '/home',
|
|
53
|
-
Component: HomePage,
|
|
54
|
-
pageLayout: {
|
|
55
|
-
pullToRefresh: {
|
|
56
|
-
onRefresh: async () => {
|
|
57
|
-
// Fetch data mới
|
|
58
|
-
await fetchData()
|
|
59
|
-
},
|
|
60
|
-
pullingText: 'Kéo xuống để làm mới',
|
|
61
|
-
canReleaseText: 'Thả để làm mới',
|
|
62
|
-
refreshingText: 'Đang tải...',
|
|
63
|
-
completeText: 'Làm mới thành công',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
}
|
|
69
|
-
`})}),`
|
|
70
|
-
`,n.jsx(e.h3,{id:"options",children:"Options"}),`
|
|
71
|
-
`,n.jsx(s,{children:"\n| Thuộc tính | Kiểu dữ liệu | Mặc định | Mô tả |\n| :--- | :--- | :--- | :--- |\n| `onRefresh` | `() => Promise<unknown> \\| unknown` | - | Function được gọi khi refresh. Phải return Promise |\n| `pullingText` | `ReactNode` | `'Kéo xuống để làm mới'` | Text hiển thị khi đang kéo |\n| `canReleaseText` | `ReactNode` | `'Thả để làm mới'` | Text hiển thị khi đã đủ threshold |\n| `refreshingText` | `ReactNode` | `'Đang tải...'` | Text hiển thị khi đang refresh |\n| `completeText` | `ReactNode` | `'Làm mới thành công'` | Text hiển thị sau khi refresh xong |\n| `completeDelay` | `number` | `500` | Delay (ms) trước khi reset sau khi complete |\n| `headHeight` | `number` | `40` | Chiều cao của refresh head (px) |\n| `threshold` | `number` | `60` | Khoảng cách kéo tối thiểu để trigger refresh (px) |\n| `disabled` | `boolean` | `false` | Tắt pull to refresh |\n| `renderText` | `(status: IPullToRefreshStatus) => ReactNode` | - | Custom render function cho text theo status |\n"}),`
|
|
72
|
-
`,n.jsx(e.h3,{id:"các-trạng-thái",children:"Các trạng thái"}),`
|
|
73
|
-
`,n.jsx(s,{children:"\n| Trạng thái | Mô tả |\n| :--- | :--- |\n| `pulling` | User đang kéo xuống nhưng chưa đủ threshold |\n| `canRelease` | User đã kéo đủ threshold, có thể thả để refresh |\n| `refreshing` | Đang thực hiện refresh (đang chạy `onRefresh`) |\n| `complete` | Refresh hoàn thành |\n"}),`
|
|
74
|
-
`,n.jsx(e.h3,{id:"lưu-ý-1",children:"Lưu ý"}),`
|
|
75
|
-
`,n.jsxs(e.ul,{children:[`
|
|
76
|
-
`,n.jsxs(e.li,{children:["Pull to refresh chỉ hoạt động khi scroll ở ",n.jsx(e.strong,{children:"top"})," (scrollTop = 0)"]}),`
|
|
77
|
-
`,n.jsxs(e.li,{children:["Sử dụng ",n.jsx(e.strong,{children:"rubberband effect"})," để tạo cảm giác tự nhiên khi kéo quá threshold"]}),`
|
|
78
|
-
`,n.jsx(e.li,{children:"Tự động prevent default scroll behavior khi đang pull"}),`
|
|
79
|
-
`]}),`
|
|
80
|
-
`,n.jsx(e.hr,{}),`
|
|
81
|
-
`,n.jsx(e.h2,{id:"3-keep-alive",children:"3. Keep Alive"}),`
|
|
82
|
-
`,n.jsx(e.p,{children:"Keep Alive giữ các pages trong DOM (ẩn) thay vì unmount khi navigate, giúp giữ state và scroll position."}),`
|
|
83
|
-
`,n.jsx(e.h3,{id:"cách-hoạt-động-1",children:"Cách hoạt động"}),`
|
|
84
|
-
`,n.jsxs(e.ul,{children:[`
|
|
85
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Giữ trong DOM"}),": Pages được ẩn (",n.jsx(e.code,{children:"display: none"}),") nhưng vẫn trong DOM"]}),`
|
|
86
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Freeze"}),": Sử dụng ",n.jsx(e.code,{children:"react-freeze"})," để prevent re-render cho pages không hiển thị"]}),`
|
|
87
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Giới hạn"}),": Chỉ giữ tối đa ",n.jsx(e.code,{children:"maxStack"})," pages trong DOM"]}),`
|
|
88
|
-
`]}),`
|
|
89
|
-
`,n.jsx(e.h3,{id:"cấu-hình",children:"Cấu hình"}),`
|
|
90
|
-
`,n.jsxs(e.p,{children:["Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-keep-alive--docs",children:"Keep Alive Config"})]}),`
|
|
91
|
-
`,n.jsx(e.h3,{id:"lợi-ích",children:"Lợi ích"}),`
|
|
92
|
-
`,n.jsxs(e.ul,{children:[`
|
|
93
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Giữ state"}),": Component state không bị mất khi navigate"]}),`
|
|
94
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Giữ scroll position"}),": Scroll position được giữ nguyên (kết hợp với scroll restoration)"]}),`
|
|
95
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Form data"}),": Form data không bị mất khi navigate back"]}),`
|
|
96
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Performance"}),": Không cần re-render khi navigate back/forward"]}),`
|
|
97
|
-
`]}),`
|
|
98
|
-
`,n.jsx(e.hr,{}),`
|
|
99
|
-
`,n.jsx(e.h2,{id:"4-scroll-restoration",children:"4. Scroll Restoration"}),`
|
|
100
|
-
`,n.jsx(e.p,{children:"Scroll Restoration tự động khôi phục scroll position khi navigate back đến page đã từng visit."}),`
|
|
101
|
-
`,n.jsx(e.h3,{id:"cách-hoạt-động-2",children:"Cách hoạt động"}),`
|
|
102
|
-
`,n.jsxs(e.ul,{children:[`
|
|
103
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Lưu scroll position"}),": Khi navigate đi, scroll position được lưu vào cache với key là ",n.jsx(e.code,{children:"location.key"})]}),`
|
|
104
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Khôi phục scroll"}),": Khi navigate back, scroll position được khôi phục từ cache"]}),`
|
|
105
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Manual management"}),": Sử dụng ",n.jsx(e.code,{children:"window.history.scrollRestoration = 'manual'"})," để tắt auto scroll restoration của browser"]}),`
|
|
106
|
-
`]}),`
|
|
107
|
-
`,n.jsx(e.h3,{id:"cấu-hình-1",children:"Cấu hình"}),`
|
|
108
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
109
|
-
pages: [
|
|
110
|
-
{
|
|
111
|
-
pathname: '/list',
|
|
112
|
-
Component: ListPage,
|
|
113
|
-
pageLayout: {
|
|
114
|
-
scrollRestoration: true, // Bật scroll restoration cho page này
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
}
|
|
119
|
-
`})}),`
|
|
120
|
-
`,n.jsx(e.h3,{id:"lưu-ý-2",children:"Lưu ý"}),`
|
|
121
|
-
`,n.jsxs(e.ul,{children:[`
|
|
122
|
-
`,n.jsxs(e.li,{children:["Scroll restoration chỉ hoạt động khi ",n.jsx(e.code,{children:"scrollRestoration: true"})," trong page layout config"]}),`
|
|
123
|
-
`,n.jsxs(e.li,{children:["Scroll position được lưu theo ",n.jsx(e.code,{children:"location.key"})," (unique cho mỗi lần visit)"]}),`
|
|
124
|
-
`,n.jsxs(e.li,{children:["Kết hợp với Keep Alive để đạt hiệu quả tốt nhất. Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-keep-alive--docs",children:"Keep Alive Config"})]}),`
|
|
125
|
-
`]}),`
|
|
126
|
-
`,n.jsx(e.hr,{}),`
|
|
127
|
-
`,n.jsx(e.h2,{id:"5-page-stacking",children:"5. Page Stacking"}),`
|
|
128
|
-
`,n.jsx(e.p,{children:"Page Stacking là cơ chế stack các pages giống native app, cho phép navigate back/forward qua history stack."}),`
|
|
129
|
-
`,n.jsx(e.h3,{id:"cách-hoạt-động-3",children:"Cách hoạt động"}),`
|
|
130
|
-
`,n.jsxs(e.ul,{children:[`
|
|
131
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"History Stack"}),": Mỗi lần navigate tạo một entry mới trong history stack"]}),`
|
|
132
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Stack Management"}),": Pages được stack và quản lý theo thứ tự LIFO (Last In First Out)"]}),`
|
|
133
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Keep Alive Integration"}),": Pages trong stack được keep-alive để giữ state. Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-keep-alive--docs",children:"Keep Alive Config"})]}),`
|
|
134
|
-
`]}),`
|
|
135
|
-
`,n.jsx(e.h3,{id:"ví-dụ",children:"Ví dụ"}),`
|
|
136
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`// User navigate: Home → List → Detail
|
|
137
|
-
// History stack: [Home, List, Detail]
|
|
138
|
-
// Current page: Detail
|
|
139
|
-
|
|
140
|
-
// User navigate back
|
|
141
|
-
navigate(-1) // → List
|
|
142
|
-
// History stack: [Home, List, Detail]
|
|
143
|
-
// Current page: List (từ stack)
|
|
144
|
-
|
|
145
|
-
// User navigate back lần nữa
|
|
146
|
-
navigate(-1) // → Home
|
|
147
|
-
// History stack: [Home, List, Detail]
|
|
148
|
-
// Current page: Home (từ stack)
|
|
149
|
-
`})}),`
|
|
150
|
-
`,n.jsx(e.h3,{id:"lưu-ý-3",children:"Lưu ý"}),`
|
|
151
|
-
`,n.jsxs(e.ul,{children:[`
|
|
152
|
-
`,n.jsxs(e.li,{children:["Pages trong stack được keep-alive (nếu enabled). Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-keep-alive--docs",children:"Keep Alive Config"})]}),`
|
|
153
|
-
`,n.jsx(e.li,{children:"Scroll position được restore khi navigate back (nếu scrollRestoration enabled)"}),`
|
|
154
|
-
`,n.jsxs(e.li,{children:["Stack size bị giới hạn bởi ",n.jsx(e.code,{children:"keepAlive.maxStack"})]}),`
|
|
155
|
-
`]}),`
|
|
156
|
-
`,n.jsx(e.hr,{}),`
|
|
157
|
-
`,n.jsx(e.h2,{id:"6-animation",children:"6. Animation"}),`
|
|
158
|
-
`,n.jsx(e.p,{children:"Animation chuyển trang giữa các pages, hỗ trợ các loại animation như slide, fade."}),`
|
|
159
|
-
`,n.jsx(e.h3,{id:"cách-hoạt-động-4",children:"Cách hoạt động"}),`
|
|
160
|
-
`,n.jsxs(e.ul,{children:[`
|
|
161
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"View Transition API"}),": Sử dụng View Transition API của browser để tạo animation mượt mà"]}),`
|
|
162
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Tự động tắt khi swipe"}),": Animation tự động tắt khi phát hiện swipe gesture để tránh conflict"]}),`
|
|
163
|
-
`]}),`
|
|
164
|
-
`,n.jsx(e.h3,{id:"cấu-hình-2",children:"Cấu hình"}),`
|
|
165
|
-
`,n.jsxs(e.p,{children:["Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-animation--docs",children:"Animation Config"})]}),`
|
|
166
|
-
`,n.jsx(e.hr,{}),`
|
|
167
|
-
`,n.jsx(e.h2,{id:"tổng-kết",children:"Tổng kết"}),`
|
|
168
|
-
`,n.jsx(e.p,{children:"Các mobile behaviours trên giúp Mini App có trải nghiệm giống native app:"}),`
|
|
169
|
-
`,n.jsxs(e.ul,{children:[`
|
|
170
|
-
`,n.jsxs(e.li,{children:["✅ ",n.jsx(e.strong,{children:"Swipe Navigation"}),": Navigate tự nhiên bằng gesture"]}),`
|
|
171
|
-
`,n.jsxs(e.li,{children:["✅ ",n.jsx(e.strong,{children:"Pull to Refresh"}),": Refresh page bằng gesture kéo xuống"]}),`
|
|
172
|
-
`,n.jsxs(e.li,{children:["✅ ",n.jsx(e.strong,{children:"Keep Alive"}),": Giữ state và scroll position. Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-keep-alive--docs",children:"Keep Alive Config"})]}),`
|
|
173
|
-
`,n.jsxs(e.li,{children:["✅ ",n.jsx(e.strong,{children:"Scroll Restoration"}),": Tự động khôi phục scroll position"]}),`
|
|
174
|
-
`,n.jsxs(e.li,{children:["✅ ",n.jsx(e.strong,{children:"Page Stacking"}),": Stack pages giống native app"]}),`
|
|
175
|
-
`,n.jsxs(e.li,{children:["✅ ",n.jsx(e.strong,{children:"Animation"}),": Animation chuyển trang mượt mà. Xem chi tiết tại ",n.jsx(e.a,{href:"?path=/docs/app-framework-animation--docs",children:"Animation Config"})]}),`
|
|
176
|
-
`]}),`
|
|
177
|
-
`,n.jsxs(e.p,{children:["Tất cả các behaviours này đã được tích hợp sẵn trong component ",n.jsx(e.code,{children:"App"}),", bạn chỉ cần config và sử dụng!"]})]})}function g(i={}){const{wrapper:e}={...h(),...i.components};return e?n.jsx(e,{...i,children:n.jsx(t,{...i})}):t(i)}export{g as default};
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as t}from"./index-CgMRTj-o.js";import{b as s,M as r}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function o(a){const e={code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...t(),...a.components};return n.jsxs(n.Fragment,{children:[`
|
|
2
|
-
`,`
|
|
3
|
-
`,n.jsx(s,{title:"App Framework/Page Layout"}),`
|
|
4
|
-
`,n.jsx(e.h1,{id:"page-layout",children:"Page Layout"}),`
|
|
5
|
-
`,n.jsx(e.p,{children:"Page Layout config cho phép bạn cấu hình layout cho các pages với các thuộc tính như spacing, safe area offsets, pull-to-refresh, và scroll restoration."}),`
|
|
6
|
-
`,n.jsx(e.h2,{id:"cấu-trúc",children:"Cấu trúc"}),`
|
|
7
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`type IAppPageLayoutState = IPageBaseProps & {
|
|
8
|
-
hidden?: boolean
|
|
9
|
-
scrollRestoration?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type IPageBaseProps = {
|
|
13
|
-
hasSpacing?: boolean
|
|
14
|
-
headerOffset?: boolean
|
|
15
|
-
safeAreaTopOffset?: boolean
|
|
16
|
-
safeAreaBottomOffset?: boolean
|
|
17
|
-
contentClassName?: string
|
|
18
|
-
pullToRefresh?: IPullToRefreshBasProps
|
|
19
|
-
onEndReached?: () => void
|
|
20
|
-
onEndReachedThreshold?: number
|
|
21
|
-
id?: string
|
|
22
|
-
className?: string
|
|
23
|
-
style?: React.CSSProperties
|
|
24
|
-
}
|
|
25
|
-
`})}),`
|
|
26
|
-
`,n.jsx(e.h2,{id:"thuộc-tính",children:"Thuộc tính"}),`
|
|
27
|
-
`,n.jsx(r,{children:"\n| Thuộc tính | Kiểu dữ liệu | Mặc định | Mô tả |\n| :--- | :--- | :--- | :--- |\n| `hidden` | `boolean` | `false` | Không render page layout wrapper (chỉ render children trực tiếp) |\n| `scrollRestoration` | `boolean` | `true` | Giữ scroll position khi navigate (kết hợp với keep-alive) |\n| `hasSpacing` | `boolean` | `true` | Thêm padding cho content |\n| `headerOffset` | `boolean` | `false` | Thêm offset cho header |\n| `safeAreaTopOffset` | `boolean` | `true` | Thêm safe area top inset padding |\n| `safeAreaBottomOffset` | `boolean` | `true` | Thêm safe area bottom inset padding |\n| `contentClassName` | `string` | - | CSS class name cho content wrapper |\n| `pullToRefresh` | `IPullToRefreshBasProps` | - | Cấu hình pull-to-refresh |\n| `onEndReached` | `() => void` | - | Callback khi scroll đến cuối page |\n| `onEndReachedThreshold` | `number` | `50` | Khoảng cách (px) từ cuối để trigger `onEndReached` |\n| `className` | `string` | - | CSS class name cho page wrapper |\n| `style` | `React.CSSProperties` | - | Inline styles cho page wrapper |\n| `id` | `string` | - | HTML id cho page wrapper |\n"}),`
|
|
28
|
-
`,n.jsx(e.h2,{id:"cách-hoạt-động",children:"Cách hoạt động"}),`
|
|
29
|
-
`,n.jsxs(e.ol,{children:[`
|
|
30
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Page Layout Wrapper"}),": Mỗi page được wrap bởi ",n.jsx(e.code,{children:"PageLayout"})," component, cung cấp các tính năng như safe area, spacing, và scroll restoration"]}),`
|
|
31
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Scroll Restoration"}),": Khi ",n.jsx(e.code,{children:"scrollRestoration: true"})," và keep-alive enabled, scroll position sẽ được giữ khi navigate back/forward"]}),`
|
|
32
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Safe Area"}),": Tự động thêm padding cho safe area top/bottom (quan trọng trên iOS với notch)"]}),`
|
|
33
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Hidden"}),": Khi ",n.jsx(e.code,{children:"hidden: true"}),", page layout wrapper sẽ không render, chỉ render children trực tiếp"]}),`
|
|
34
|
-
`]}),`
|
|
35
|
-
`,n.jsx(e.h2,{id:"cấu-hình",children:"Cấu hình"}),`
|
|
36
|
-
`,n.jsx(e.h3,{id:"app-level-config",children:"App-level Config"}),`
|
|
37
|
-
`,n.jsx(e.p,{children:"Cấu hình page layout mặc định cho tất cả pages:"}),`
|
|
38
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
39
|
-
pageLayout: {
|
|
40
|
-
hasSpacing: true,
|
|
41
|
-
safeAreaTopOffset: true,
|
|
42
|
-
safeAreaBottomOffset: true,
|
|
43
|
-
scrollRestoration: true,
|
|
44
|
-
contentClassName: 'p-4',
|
|
45
|
-
},
|
|
46
|
-
pages: [
|
|
47
|
-
// Tất cả pages sẽ dùng config này
|
|
48
|
-
],
|
|
49
|
-
}
|
|
50
|
-
`})}),`
|
|
51
|
-
`,n.jsx(e.h3,{id:"page-level-config",children:"Page-level Config"}),`
|
|
52
|
-
`,n.jsx(e.p,{children:"Override page layout cho từng page:"}),`
|
|
53
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
54
|
-
pageLayout: {
|
|
55
|
-
hasSpacing: true,
|
|
56
|
-
scrollRestoration: true,
|
|
57
|
-
},
|
|
58
|
-
pages: [
|
|
59
|
-
{
|
|
60
|
-
pathname: '/home',
|
|
61
|
-
Component: HomePage,
|
|
62
|
-
// Page này dùng app-level config
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
pathname: '/detail',
|
|
66
|
-
Component: DetailPage,
|
|
67
|
-
// Override page layout cho page này
|
|
68
|
-
pageLayout: {
|
|
69
|
-
hasSpacing: false, // Không có spacing
|
|
70
|
-
contentClassName: 'p-0', // Không có padding
|
|
71
|
-
scrollRestoration: false, // Reset scroll khi vào page này
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
pathname: '/fullscreen',
|
|
76
|
-
Component: FullscreenPage,
|
|
77
|
-
// Ẩn page layout wrapper
|
|
78
|
-
pageLayout: {
|
|
79
|
-
hidden: true, // Không wrap với PageLayout
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
}
|
|
84
|
-
`})}),`
|
|
85
|
-
`,n.jsx(e.h2,{id:"ví-dụ-với-pull-to-refresh",children:"Ví dụ với Pull-to-Refresh"}),`
|
|
86
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
87
|
-
pageLayout: {
|
|
88
|
-
pullToRefresh: {
|
|
89
|
-
onRefresh: async () => {
|
|
90
|
-
// Refresh data
|
|
91
|
-
await fetchData()
|
|
92
|
-
},
|
|
93
|
-
pullingText: 'Kéo xuống để làm mới',
|
|
94
|
-
canReleaseText: 'Thả ra để làm mới',
|
|
95
|
-
refreshingText: 'Đang làm mới...',
|
|
96
|
-
completeText: 'Hoàn thành',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
pages: [
|
|
100
|
-
{
|
|
101
|
-
pathname: '/home',
|
|
102
|
-
Component: HomePage,
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
}
|
|
106
|
-
`})}),`
|
|
107
|
-
`,n.jsx(e.h2,{id:"ví-dụ-với-infinite-scroll",children:"Ví dụ với Infinite Scroll"}),`
|
|
108
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
109
|
-
pageLayout: {
|
|
110
|
-
onEndReached: () => {
|
|
111
|
-
// Load more data
|
|
112
|
-
loadMore()
|
|
113
|
-
},
|
|
114
|
-
onEndReachedThreshold: 100, // Trigger khi còn 100px từ cuối
|
|
115
|
-
},
|
|
116
|
-
pages: [
|
|
117
|
-
{
|
|
118
|
-
pathname: '/list',
|
|
119
|
-
Component: ListPage,
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
}
|
|
123
|
-
`})}),`
|
|
124
|
-
`,n.jsx(e.h2,{id:"ví-dụ-với-custom-styling",children:"Ví dụ với Custom Styling"}),`
|
|
125
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
126
|
-
pageLayout: {
|
|
127
|
-
contentClassName: 'bg-gray-50 min-h-screen',
|
|
128
|
-
className: 'custom-page-wrapper',
|
|
129
|
-
style: {
|
|
130
|
-
backgroundColor: '#f5f5f5',
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
pages: [
|
|
134
|
-
{
|
|
135
|
-
pathname: '/home',
|
|
136
|
-
Component: HomePage,
|
|
137
|
-
// Override với custom styling
|
|
138
|
-
pageLayout: {
|
|
139
|
-
contentClassName: 'bg-white p-6',
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
}
|
|
144
|
-
`})}),`
|
|
145
|
-
`,n.jsx(e.h2,{id:"scroll-restoration-với-keep-alive",children:"Scroll Restoration với Keep-Alive"}),`
|
|
146
|
-
`,n.jsx(e.p,{children:"Khi kết hợp với keep-alive, scroll restoration sẽ giữ scroll position:"}),`
|
|
147
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
148
|
-
keepAlive: {
|
|
149
|
-
enable: true,
|
|
150
|
-
},
|
|
151
|
-
pageLayout: {
|
|
152
|
-
scrollRestoration: true, // Giữ scroll position
|
|
153
|
-
},
|
|
154
|
-
pages: [
|
|
155
|
-
{
|
|
156
|
-
pathname: '/list',
|
|
157
|
-
Component: ListPage,
|
|
158
|
-
// Khi navigate back, scroll position sẽ được giữ
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
}
|
|
162
|
-
`})}),`
|
|
163
|
-
`,n.jsx(e.h2,{id:"safe-area-offsets",children:"Safe Area Offsets"}),`
|
|
164
|
-
`,n.jsx(e.p,{children:"Safe area offsets tự động điều chỉnh dựa trên navigation bar và bottom tab bar:"}),`
|
|
165
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const appConfig: IAppConfig = {
|
|
166
|
-
navigationBar: {
|
|
167
|
-
hidden: false, // Navigation bar hiển thị
|
|
168
|
-
},
|
|
169
|
-
bottomTabBar: {
|
|
170
|
-
items: [{ id: 'home', name: 'Home', path: '/home' }],
|
|
171
|
-
},
|
|
172
|
-
pageLayout: {
|
|
173
|
-
// safeAreaTopOffset tự động = true khi navigationBar.hidden = false
|
|
174
|
-
// safeAreaBottomOffset tự động = false khi bottomTabBar hiển thị
|
|
175
|
-
},
|
|
176
|
-
pages: [
|
|
177
|
-
{
|
|
178
|
-
pathname: '/home',
|
|
179
|
-
Component: HomePage,
|
|
180
|
-
bottomTabBarId: 'home',
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
}
|
|
184
|
-
`})}),`
|
|
185
|
-
`,n.jsx(e.h2,{id:"lưu-ý",children:"Lưu ý"}),`
|
|
186
|
-
`,n.jsxs(e.ul,{children:[`
|
|
187
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Scroll Restoration"}),": Chỉ hoạt động tốt khi kết hợp với keep-alive. Khi ",n.jsx(e.code,{children:"scrollRestoration: false"}),", scroll sẽ reset về top khi navigate"]}),`
|
|
188
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Safe Area"}),": Safe area offsets tự động điều chỉnh dựa trên navigation bar và bottom tab bar visibility"]}),`
|
|
189
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Hidden"}),": Khi ",n.jsx(e.code,{children:"hidden: true"}),", tất cả các tính năng của page layout (safe area, spacing, scroll restoration) sẽ không hoạt động"]}),`
|
|
190
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Content ClassName"}),": ",n.jsx(e.code,{children:"contentClassName"})," được áp dụng cho content wrapper bên trong page, không phải page wrapper"]}),`
|
|
191
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Pull-to-Refresh"}),": Pull-to-refresh chỉ hoạt động khi page có thể scroll"]}),`
|
|
192
|
-
`]})]})}function g(a={}){const{wrapper:e}={...t(),...a.components};return e?n.jsx(e,{...a,children:n.jsx(o,{...a})}):o(a)}export{g as default};
|