@v-miniapp/ui-react 1.0.47 → 1.0.60
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/input-wrapper/input-wrapper.d.ts +2 -2
- package/dist/components/layout/page.d.ts +8 -1
- package/dist/external/index.js +11456 -8093
- package/dist/external/styles.css +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3787 -3991
- package/dist/styles.css +1 -1
- package/dist/utils/event-emitter.d.ts +4 -0
- package/dist-storybook/assets/App-CJxOxRXd.js +93 -0
- package/dist-storybook/assets/{Color-AVL7NMMY-OD8SQvXt.js → Color-AVL7NMMY-DwohVA43.js} +1 -1
- package/dist-storybook/assets/DEEPLINK-B5vUshJ4.js +33 -0
- package/dist-storybook/assets/{DocsRenderer-PQXLIZUC-D8kbgtPd.js → DocsRenderer-PQXLIZUC-vNsl3A7z.js} +2 -2
- package/dist-storybook/assets/EVENTS-DIl-sE2t.js +65 -0
- package/dist-storybook/assets/GETTING_STARTED-CR4dG_o7.js +62 -0
- package/dist-storybook/assets/GETTING_STARTED-CS2BpDsP.js +80 -0
- package/dist-storybook/assets/GETTING_STARTED-CtonLhRi.js +64 -0
- package/dist-storybook/assets/{INFINITE_SCROLL-O36i5W8i.js → INFINITE_SCROLL-BerukJIr.js} +1 -1
- package/dist-storybook/assets/LocalesProvider-CehS9yzW.js +53 -0
- package/dist-storybook/assets/MIGRATE_DARKMODE_TO_THEME-CRf-7Wcz.js +107 -0
- package/dist-storybook/assets/{MIGRATION_GUIDE-Dn2gFk5v.js → MIGRATION_GUIDE-CRIHuXpT.js} +3 -3
- package/dist-storybook/assets/OVERVIEW-DayETux4.js +51 -0
- package/dist-storybook/assets/Router-CGsO5Wd_.js +71 -0
- package/dist-storybook/assets/{TAILWIND_INTEGRATION-CVrohRXO.js → TAILWIND_INTEGRATION-RPvFP-GI.js} +1 -1
- package/dist-storybook/assets/THEME-C-pA_uq_.js +103 -0
- package/dist-storybook/assets/_baseClone-4nOrhHpR.js +1 -0
- package/dist-storybook/assets/alert-D3VdqAYm.js +1 -0
- package/dist-storybook/assets/{alert.stories-XyvS4WTm.js → alert.stories-CFBhdabd.js} +3 -3
- package/dist-storybook/assets/app-B__CxZQv.js +1 -0
- package/dist-storybook/assets/avatar-BVV1WSnD.js +1 -0
- package/dist-storybook/assets/{avatar.stories-glTjw5Kd.js → avatar.stories-D0RA2Mhh.js} +6 -6
- package/dist-storybook/assets/{axe-B8nlqekz.js → axe-Cj9fkEY9.js} +1 -1
- package/dist-storybook/assets/badge-DLt8CmDs.js +1 -0
- package/dist-storybook/assets/{badge.stories-CeNmmdtv.js → badge.stories-DhVKBE64.js} +3 -3
- package/dist-storybook/assets/{blocks-CpOj9FQ_.js → blocks-D4qvS4eZ.js} +3 -3
- package/dist-storybook/assets/{bottom-tab-bar-BsPd0FD7.js → bottom-tab-bar-UaYvPAic.js} +1 -1
- package/dist-storybook/assets/{bottom-tab-bar.stories-BG1ee2eN.js → bottom-tab-bar.stories--7Qh-68J.js} +3 -3
- package/dist-storybook/assets/button-CbLEqALK.js +1 -0
- package/dist-storybook/assets/{button.stories-3d_T0h_Z.js → button.stories-DgRH6oVV.js} +3 -3
- package/dist-storybook/assets/calendar-C7tiySn0.js +1 -0
- package/dist-storybook/assets/{calendar.stories-DEleEKoa.js → calendar.stories-B0K_T9ak.js} +3 -3
- package/dist-storybook/assets/carousel-C1nQGnJZ.js +37 -0
- package/dist-storybook/assets/{carousel.stories-DY9nDa3M.js → carousel.stories-C5d6yLzd.js} +3 -3
- package/dist-storybook/assets/checkbox-Bs8ghsWP.js +1 -0
- package/dist-storybook/assets/{checkbox.stories-BY8W9TRC.js → checkbox.stories-CG74gIlt.js} +3 -3
- package/dist-storybook/assets/chip-D4_ukvFv.js +1 -0
- package/dist-storybook/assets/{chip.stories-CXh30Tdq.js → chip.stories-D0908ZyT.js} +3 -3
- package/dist-storybook/assets/{date-Ci5dIit0.js → date-C1W0DfQy.js} +1 -1
- package/dist-storybook/assets/date-field-range-DSAQp9qR.js +1 -0
- package/dist-storybook/assets/date-field.stories-Dx6-qeWT.js +129 -0
- package/dist-storybook/assets/date-picker--PiU9sOL.js +1 -0
- package/dist-storybook/assets/{date-picker.stories-DUaL7sft.js → date-picker.stories-Bahq3f1W.js} +3 -3
- package/dist-storybook/assets/dialog-8K5u-kre.js +1 -0
- package/dist-storybook/assets/{dialog.stories-BtQMDA-1.js → dialog.stories-BxYc78Eo.js} +3 -3
- package/dist-storybook/assets/{chip-zY6gJxDk.js → dropdown-BeoO7m-R.js} +2 -2
- package/dist-storybook/assets/{dropdown.stories-DF69os0J.js → dropdown.stories-Bfhg63tZ.js} +3 -3
- package/dist-storybook/assets/{embla-carousel-react.esm-CCQjHA-d.js → embla-carousel-react.esm-Pp2OIUrN.js} +1 -1
- package/dist-storybook/assets/icon-CgGksgRS.js +1 -0
- package/dist-storybook/assets/{icon.stories-Ch36FMIn.js → icon.stories-qg8UAHBM.js} +3 -3
- package/dist-storybook/assets/iframe-BKfReaAn.css +1 -0
- package/dist-storybook/assets/{iframe-CLEfhyJc.js → iframe-C0PGuV5s.js} +42 -42
- package/dist-storybook/assets/image-BdsCB1je.js +9 -0
- package/dist-storybook/assets/{image.stories-CJPB43ys.js → image.stories-sQtCaoL2.js} +3 -3
- package/dist-storybook/assets/{index-CaMbLGUB.js → index-1AHvPexM.js} +1 -1
- package/dist-storybook/assets/index-BLzgbpm2.js +1 -0
- package/dist-storybook/assets/{index-DRIh_SUo.js → index-DWjPAWoJ.js} +1 -1
- package/dist-storybook/assets/{index-7xlKHfV2.js → index-SzFZQQjs.js} +1 -1
- package/dist-storybook/assets/input-wrapper-DkEl0Eih.js +1 -0
- package/dist-storybook/assets/{label-fI1oWVKU.js → label-CHVpMhb5.js} +1 -1
- package/dist-storybook/assets/{label.stories-C3xDUHd-.js → label.stories-CCtGPDrS.js} +3 -3
- package/dist-storybook/assets/{navigation-bar-CiGSH7u8.js → navigation-bar-TpF0DSXB.js} +2 -2
- package/dist-storybook/assets/{navigation-bar.stories-BvGp7uJf.js → navigation-bar.stories-CNXAxMYL.js} +3 -3
- package/dist-storybook/assets/number-field-CvCF5adO.js +1 -0
- package/dist-storybook/assets/{number-field.stories-B_Bj8RqE.js → number-field.stories-Dsb_eChm.js} +3 -3
- package/dist-storybook/assets/omit-D04qL5V_.js +1 -0
- package/dist-storybook/assets/option-item-Bmby544G.js +1 -0
- package/dist-storybook/assets/{option-item.stories-BjtolfPz.js → option-item.stories-ClUj8qVT.js} +3 -3
- package/dist-storybook/assets/pagination-MBP1YLhT.js +1 -0
- package/dist-storybook/assets/{pagination.stories-CrGsYeRw.js → pagination.stories-C9j6mE5z.js} +4 -4
- package/dist-storybook/assets/proxy-edvPwIiD.js +1 -0
- package/dist-storybook/assets/radio-DRPO7cjx.js +1 -0
- package/dist-storybook/assets/{radio.stories-BEG-zTwI.js → radio.stories-D8_YUTw1.js} +3 -3
- package/dist-storybook/assets/rating-CTv8C1tH.js +1 -0
- package/dist-storybook/assets/{rating.stories-Dwk8Ov3Q.js → rating.stories-BIftLeu2.js} +3 -3
- package/dist-storybook/assets/{react-18-4mLDkQmf.js → react-18-CacBUmwb.js} +1 -1
- package/dist-storybook/assets/{react-mAVd1wAc.js → react-zqqxT5R_.js} +1 -1
- package/dist-storybook/assets/search-field-CophTGGH.js +1 -0
- package/dist-storybook/assets/{search-field.stories-BnsT36yY.js → search-field.stories-D1okdN8e.js} +3 -3
- package/dist-storybook/assets/section-content-dVOJuOaN.js +1 -0
- package/dist-storybook/assets/{section.stories-B5IhLkbG.js → section.stories-Cq5CY978.js} +3 -3
- package/dist-storybook/assets/sheet-footer-BL2JAvmb.js +1 -0
- package/dist-storybook/assets/{sheet.stories-COzxyiqj.js → sheet.stories-DPcC0I5i.js} +3 -3
- package/dist-storybook/assets/skeleton-CmGRbWqE.js +1 -0
- package/dist-storybook/assets/{skeleton.stories-B71MlMyi.js → skeleton.stories-CD3J1XrJ.js} +3 -3
- package/dist-storybook/assets/{store-D2RudmNr.js → store-BmYgrUro.js} +5 -5
- package/dist-storybook/assets/switch-Cc-NvT4X.js +1 -0
- package/dist-storybook/assets/{switch.stories-DMBBwZef.js → switch.stories-C5SDbdGL.js} +3 -3
- package/dist-storybook/assets/{tab-bar-DZ3oOU50.js → tab-bar-DTyg7tFP.js} +1 -1
- package/dist-storybook/assets/{tab-bar.stories-Bp9w6nc3.js → tab-bar.stories-zKrihgXo.js} +3 -3
- package/dist-storybook/assets/text-area-WRb8Dkvn.js +1 -0
- package/dist-storybook/assets/{text-area.stories-BZ3HXtij.js → text-area.stories-3Z574UAD.js} +3 -3
- package/dist-storybook/assets/text-field-DrODy0yz.js +1 -0
- package/dist-storybook/assets/{text-field.stories-vSXYvs0U.js → text-field.stories-DzjpcKin.js} +3 -3
- package/dist-storybook/assets/toast-provider-ChNGFQlt.js +9 -0
- package/dist-storybook/assets/{toast.stories-DQKbk7dO.js → toast.stories-Zj4qfKO_.js} +1 -1
- package/dist-storybook/assets/tooltip-CrxOWTXS.js +1 -0
- package/dist-storybook/assets/{tooltip.stories-wuthZ3Sv.js → tooltip.stories-DEnYdL1d.js} +3 -3
- package/dist-storybook/assets/typography-BcLxefPi.js +1 -0
- package/dist-storybook/assets/{typography.stories-DD9HLY16.js → typography.stories-DWxFgTz3.js} +3 -3
- package/dist-storybook/assets/{uploader.stories-sModULvT.js → uploader.stories-DQN8yjt-.js} +3 -3
- package/dist-storybook/assets/use-app-pause-CyjeIEPG.js +21 -0
- package/dist-storybook/assets/use-app-resume-DntO6Rkm.js +21 -0
- package/dist-storybook/assets/use-bottom-tab-bar-Da7gjw6y.js +49 -0
- package/dist-storybook/assets/use-custom-icon-event-BEYPYrKY.js +26 -0
- package/dist-storybook/assets/use-did-hide-Do-KOSzV.js +30 -0
- package/dist-storybook/assets/use-did-show-Bv9k7DdG.js +30 -0
- package/dist-storybook/assets/use-histories-Ci1HfRe-.js +30 -0
- package/dist-storybook/assets/use-history-CkVE1jRy.js +33 -0
- package/dist-storybook/assets/use-language-Bg-LzpzQ.js +46 -0
- package/dist-storybook/assets/use-load-more-eaC8W6Cc.js +42 -0
- package/dist-storybook/assets/use-location-BMrQnhPi.js +39 -0
- package/dist-storybook/assets/use-navigate-BwwmhToy.js +36 -0
- package/dist-storybook/assets/use-navigation-bar-DzgWeTpM.js +42 -0
- package/dist-storybook/assets/use-navigation-type-DNvXTqYH.js +27 -0
- package/dist-storybook/assets/use-page-layout-BA2HvjAQ.js +37 -0
- package/dist-storybook/assets/use-page-scroll-D_gjlV-S.js +42 -0
- package/dist-storybook/assets/use-pull-to-refresh-SZfswIA6.js +38 -0
- package/dist-storybook/assets/use-settings-changed-D2gdx5rD.js +30 -0
- package/dist-storybook/assets/use-translate-BTC2AQ0k.js +59 -0
- package/dist-storybook/assets/{visibility-sensor-huP-8j4n.js → visibility-sensor-FN9n9CLs.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 -65
- 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 -4
- 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-DLCDVwPI.js +0 -99
- package/dist-storybook/assets/APP_FRAMEWORK-B9Mrudgl.js +0 -197
- package/dist-storybook/assets/BOTTOM_TAB_BAR-Bgfy-nnv.js +0 -175
- package/dist-storybook/assets/CUSTOM_ERROR_BOUNDARY-G_i_6aho.js +0 -250
- package/dist-storybook/assets/GETTING_STARTED-Bf6ENjZo.js +0 -77
- package/dist-storybook/assets/KEEP_ALIVE-CicDtVw6.js +0 -126
- package/dist-storybook/assets/LOCALE-D_43J3RD.js +0 -465
- package/dist-storybook/assets/MOBILE_BEHAVIOURS-D5jOxNiz.js +0 -177
- package/dist-storybook/assets/PAGE_LAYOUT-C0sW9iZo.js +0 -192
- package/dist-storybook/assets/ROUTING_NAVIGATION-Bpj_mu5r.js +0 -335
- package/dist-storybook/assets/THEME_MODE-Sc8cgznR.js +0 -111
- package/dist-storybook/assets/_setToString-CjYxL0rS.js +0 -1
- package/dist-storybook/assets/alert-abKmNYys.js +0 -1
- package/dist-storybook/assets/avatar-B-jvPnzm.js +0 -1
- package/dist-storybook/assets/badge-Cc9u7jBX.js +0 -1
- package/dist-storybook/assets/button-GtWXUngt.js +0 -1
- package/dist-storybook/assets/calendar-CJ5_NxYx.js +0 -1
- package/dist-storybook/assets/carousel-sbzGq2WF.js +0 -37
- package/dist-storybook/assets/checkbox-CMpJJxvm.js +0 -1
- package/dist-storybook/assets/classname-DoNrELT0.js +0 -1
- package/dist-storybook/assets/date-field.stories-CerGwXZy.js +0 -129
- package/dist-storybook/assets/date-picker-BCIW_1-h.js +0 -1
- package/dist-storybook/assets/icon-TJ3FHxUI.js +0 -1
- package/dist-storybook/assets/iframe-yMKl6hJA.css +0 -1
- package/dist-storybook/assets/image-D6Yo4ht9.js +0 -9
- package/dist-storybook/assets/input-wrapper-D_9hAdHZ.js +0 -1
- package/dist-storybook/assets/number-field-DNj4myBV.js +0 -1
- package/dist-storybook/assets/omit-CStFhbPt.js +0 -1
- package/dist-storybook/assets/option-item-BloohEvW.js +0 -1
- package/dist-storybook/assets/pagination-Dcazh6R_.js +0 -1
- package/dist-storybook/assets/pick-DbIUGM9R.js +0 -1
- package/dist-storybook/assets/radio-t2E8E0Oc.js +0 -1
- package/dist-storybook/assets/rating-DsULci27.js +0 -1
- package/dist-storybook/assets/search-field-CuiHMy7j.js +0 -1
- package/dist-storybook/assets/section-content-pkGNuEs6.js +0 -1
- package/dist-storybook/assets/skeleton-Dn8rwbgX.js +0 -1
- package/dist-storybook/assets/store-DxAqU1JB.js +0 -1
- package/dist-storybook/assets/switch-BziC1t_8.js +0 -1
- package/dist-storybook/assets/text-area-CAmJ2yms.js +0 -1
- package/dist-storybook/assets/text-field-CjrgfYOZ.js +0 -1
- package/dist-storybook/assets/toast-provider-B9k1NBG6.js +0 -9
- package/dist-storybook/assets/tooltip-VnA8Hy0S.js +0 -1
- package/dist-storybook/assets/typography-DoV67nnS.js +0 -1
- package/dist-storybook/assets/use-app-pause-BQYQ2_kc.js +0 -29
- package/dist-storybook/assets/use-app-resume-BHDCAORn.js +0 -29
- package/dist-storybook/assets/use-custom-icon-event-BCGSFwaE.js +0 -29
- package/dist-storybook/assets/use-did-hide-Cosc0Bts.js +0 -48
- package/dist-storybook/assets/use-did-show-CTWe5NYk.js +0 -49
- package/dist-storybook/assets/use-histories-CAcE6nVz.js +0 -50
- package/dist-storybook/assets/use-history-FuEbPpap.js +0 -67
- package/dist-storybook/assets/use-location-CdUC1tic.js +0 -56
- package/dist-storybook/assets/use-navigate-DP9paY1K.js +0 -84
- package/dist-storybook/assets/use-navigation-type-BWVxMUtZ.js +0 -44
- package/dist-storybook/assets/use-page-config-5u8OF-8L.js +0 -48
- package/dist-storybook/assets/use-page-scroll-nPQcBn5B.js +0 -69
- package/dist-storybook/assets/use-page-state-CULl52gw.js +0 -79
- package/dist-storybook/assets/use-settings-changed-2GP5ZsJS.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,58 +1,4 @@
|
|
|
1
1
|
[
|
|
2
|
-
{
|
|
3
|
-
"id": "app-framework-animation--docs",
|
|
4
|
-
"title": "App Framework/Animation",
|
|
5
|
-
"subtitle": "Cấu hình animation chuyển trang giữa các pages trong App Framework.",
|
|
6
|
-
"content": "Animation Config cho phép cấu hình animation chuyển trang. Các loại animation bao gồm none, slide_up, slide_left và fade_in. Cấu trúc IAppAnimationState với type INavigationAnimationType."
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": "app-framework-bottom-tab-bar--docs",
|
|
10
|
-
"title": "App Framework/Bottom Tab Bar",
|
|
11
|
-
"subtitle": "Cấu hình bottom tab bar cho ứng dụng Mini App.",
|
|
12
|
-
"content": "Bottom Tab Bar Config cho phép cấu hình bottom tab bar với các items, styling và behavior. IAppBottomTabBarState extends IBottomTabBarProps và thêm items với path và hidden property."
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"id": "app-framework-general--docs",
|
|
16
|
-
"title": "App Framework/General",
|
|
17
|
-
"subtitle": "App Framework là bộ khung để xây dựng Mini App hoàn chỉnh với routing, mobile behaviours và các tính năng native app.",
|
|
18
|
-
"content": "App Framework cung cấp component App với nhiều tính năng global như Error Boundary, Toast Provider, Navigation Analytics và Multi-language. Có thể cấu hình với IAppConfig bao gồm animation, keepAlive, pages và các tính năng khác. Hỗ trợ pull-to-refresh, swipe navigation, page stacking với keep-alive."
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": "app-framework-keep-alive--docs",
|
|
22
|
-
"title": "App Framework/Keep Alive",
|
|
23
|
-
"subtitle": "Keep Alive cho phép giữ các pages trong DOM thay vì unmount khi navigate, giúp giữ state và scroll position.",
|
|
24
|
-
"content": "Keep Alive cho phép giữ các pages trong DOM (ẩn) thay vì unmount khi navigate. IAppKeepAliveState có enable, maxStack, freeze và freezeDelay. Page-level có thể override bằng boolean hoặc config object với keepAlive, freeze và freezeDelay."
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"id": "app-framework-locale--docs",
|
|
28
|
-
"title": "App Framework/Locale",
|
|
29
|
-
"subtitle": "Locales module cung cấp giải pháp quản lý đa ngôn ngữ với TypeScript type safety và hỗ trợ custom locales keys.",
|
|
30
|
-
"content": "Locales Module cung cấp quản lý đa ngôn ngữ với TypeScript type safety. Hỗ trợ custom locales keys và custom language codes thông qua module augmentation. Có sẵn tiếng Việt và tiếng Anh. Hỗ trợ hooks useTranslate, useLanguage và standalone functions. Tự động lấy ngôn ngữ từ URL search params."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"id": "app-framework-mobile-behaviours--docs",
|
|
34
|
-
"title": "App Framework/Mobile Behaviours",
|
|
35
|
-
"subtitle": "Component 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.",
|
|
36
|
-
"content": "Mobile Behaviours bao gồm Swipe Navigation, Pull to Refresh, Keep Alive, Scroll Restoration, Page Stacking và Animation. Swipe navigation cho phép swipe từ cạnh màn hình để navigate. Pull to Refresh kéo xuống để refresh page. Keep Alive giữ state và scroll position. Scroll Restoration tự động khôi phục scroll position khi navigate back."
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"id": "app-framework-page-layout--docs",
|
|
40
|
-
"title": "App Framework/Page Layout",
|
|
41
|
-
"subtitle": "Cấu hình page layout cho các pages trong ứng dụng Mini App.",
|
|
42
|
-
"content": "Page Layout Config cho phép cấu hình layout cho pages với các thuộc tính như spacing, safe area offsets, pull-to-refresh, và scroll restoration. IAppPageLayoutState extends IPageBaseProps và thêm hidden và scrollRestoration."
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"id": "app-framework-routing-navigation--docs",
|
|
46
|
-
"title": "App Framework/Routing & Navigation",
|
|
47
|
-
"subtitle": "Hệ thống routing và navigation cung cấp các hooks và utilities để quản lý navigation và lifecycle events.",
|
|
48
|
-
"content": "Routing & Navigation sử dụng exact path matching. Navigation được thực hiện qua function navigate từ hook useNavigate. Có thể navigate bằng pathname hoặc delta. Các hooks bao gồm useNavigate, useLocation, useHistory, useHistories, usePageState, usePageConfig, usePageScroll, useNavigationType, useDidShow, useDidHide, useAppPause, useAppResume, useCustomIconEvent và useSettingsChanged."
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"id": "app-framework-theme-mode--docs",
|
|
52
|
-
"title": "App Framework/Theme Mode",
|
|
53
|
-
"subtitle": "Cấu hình theme cho ứng dụng Mini App.",
|
|
54
|
-
"content": "Theme Config cho phép cấu hình theme mặc định cho ứng dụng. IThemeConfig có defaultMode để thiết lập theme mặc định (light, dark, hoặc system)."
|
|
55
|
-
},
|
|
56
2
|
{
|
|
57
3
|
"id": "components-alert--docs",
|
|
58
4
|
"title": "Components/Alert",
|
|
@@ -258,106 +204,184 @@
|
|
|
258
204
|
"content": "Component Uploader là component upload file. Có thể được tùy chỉnh với các props value, onChange, limit, disabled, showPreview, includeBase64 và className. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: value: IFileUpload[] - Danh sách các file đã upload. onChange: (files: IFileUpload[]) => void - Callback khi danh sách file thay đổi. limit: number - Số lượng file tối đa. disabled: boolean - Trạng thái disabled. showPreview: boolean - Hiển thị preview. includeBase64: boolean - Bao gồm base64. className: string - Class name tùy chỉnh."
|
|
259
205
|
},
|
|
260
206
|
{
|
|
261
|
-
"id": "
|
|
262
|
-
"title": "
|
|
263
|
-
"subtitle": "
|
|
264
|
-
"content": "
|
|
207
|
+
"id": "locale-components-localesprovider--docs",
|
|
208
|
+
"title": "Locale/LocalesProvider",
|
|
209
|
+
"subtitle": "Component provider khởi tạo Locale module, cung cấp resources và context cho toàn bộ cây component.",
|
|
210
|
+
"content": "LocalesProvider nhận config (ILocalesConfig) và children. Chỉ init một lần khi mount. Đặt ở top-level. Khi dùng App thì không cần dùng trực tiếp."
|
|
265
211
|
},
|
|
266
212
|
{
|
|
267
|
-
"id": "
|
|
268
|
-
"title": "
|
|
269
|
-
"subtitle": "
|
|
270
|
-
"content": "
|
|
213
|
+
"id": "locale-getting-started--docs",
|
|
214
|
+
"title": "Locale/Getting Started",
|
|
215
|
+
"subtitle": "Hướng dẫn bắt đầu sử dụng Locale module cho đa ngôn ngữ với TypeScript type safety.",
|
|
216
|
+
"content": "Cài đặt và khởi tạo Locale với LocalesProvider. Thứ tự ưu tiên ngôn ngữ, text mặc định cho component, và mở rộng custom languages/keys qua module augmentation."
|
|
271
217
|
},
|
|
272
218
|
{
|
|
273
|
-
"id": "hooks-
|
|
274
|
-
"title": "
|
|
275
|
-
"subtitle": "Hook
|
|
276
|
-
"content": "
|
|
219
|
+
"id": "locale-hooks-uselanguage--docs",
|
|
220
|
+
"title": "Locale/useLanguage",
|
|
221
|
+
"subtitle": "Hook trả về ngôn ngữ hiện tại, ngôn ngữ system và function setLanguage.",
|
|
222
|
+
"content": "useLanguage() trả về { language, systemLanguage, setLanguage }. Có reactivity. Dùng để hiển thị/đổi ngôn ngữ trong component."
|
|
277
223
|
},
|
|
278
224
|
{
|
|
279
|
-
"id": "hooks-
|
|
280
|
-
"title": "
|
|
281
|
-
"subtitle": "Hook
|
|
282
|
-
"content": "
|
|
225
|
+
"id": "locale-hooks-usetranslate--docs",
|
|
226
|
+
"title": "Locale/useTranslate",
|
|
227
|
+
"subtitle": "Hook trả về function translate với reactivity khi đổi ngôn ngữ.",
|
|
228
|
+
"content": "useTranslate() trả về function (key, params?, lang?) => string. Có reactivity: component re-render khi ngôn ngữ thay đổi. Nên dùng trong React component thay cho t() để UI cập nhật đúng."
|
|
283
229
|
},
|
|
284
230
|
{
|
|
285
|
-
"id": "
|
|
286
|
-
"title": "
|
|
287
|
-
"subtitle": "
|
|
288
|
-
"content": "
|
|
231
|
+
"id": "migration-guide--docs",
|
|
232
|
+
"title": "UI React/Migration Guide",
|
|
233
|
+
"subtitle": "Hướng dẫn migrate từ @vsf-miniapp/ui-react sang @v-miniapp/ui-react với nhiều tính năng và cải tiến hơn.",
|
|
234
|
+
"content": "Migration Guide từ @vsf-miniapp/ui-react sang @v-miniapp/ui-react. Phiên bản mới có App Framework hoàn chỉnh, Mobile Behaviours, Multi-language với TypeScript type safety, nhiều component mới và tính năng nâng cao như Animation, Error Boundary, Toast Provider, Analytics."
|
|
289
235
|
},
|
|
290
236
|
{
|
|
291
|
-
"id": "
|
|
292
|
-
"title": "
|
|
293
|
-
"subtitle": "
|
|
294
|
-
"content": "
|
|
237
|
+
"id": "overview--docs",
|
|
238
|
+
"title": "Overview",
|
|
239
|
+
"subtitle": "Tổng quan bộ thư viện @v-miniapp/* và ba thư viện chính: ui-react, router, locale.",
|
|
240
|
+
"content": "Giới thiệu ecosystem @v-miniapp/* dùng để phát triển V-MiniApp với React. Ba thư viện chính: @v-miniapp/ui-react (UI + App Framework), @v-miniapp/router (routing), @v-miniapp/locale (đa ngôn ngữ)."
|
|
295
241
|
},
|
|
296
242
|
{
|
|
297
|
-
"id": "
|
|
298
|
-
"title": "
|
|
299
|
-
"subtitle": "
|
|
300
|
-
"content": "
|
|
243
|
+
"id": "router-deeplink--docs",
|
|
244
|
+
"title": "Router/Deeplink",
|
|
245
|
+
"subtitle": "Định dạng Deeplink và Universal link để mở V-MiniApp tới pathname và params cụ thể.",
|
|
246
|
+
"content": "Deeplink: vapp://mini/{appid}/{pathname}?{params}. Universal link: https://v-app.vn/mini/{appid}/{pathname}?{params}."
|
|
301
247
|
},
|
|
302
248
|
{
|
|
303
|
-
"id": "
|
|
304
|
-
"title": "
|
|
305
|
-
"subtitle": "
|
|
306
|
-
"content": "
|
|
249
|
+
"id": "router-events--docs",
|
|
250
|
+
"title": "Router/Events",
|
|
251
|
+
"subtitle": "routerEvents: EventEmitter để lắng nghe before/after history change, before/after navigate và afterInit.",
|
|
252
|
+
"content": "routerEvents.on(event, handler) trả về hàm unsubscribe. Các event: beforeHistoryChange, beforeHistoryChangeP2, afterHistoryChange, afterHistoryChangeP2, beforeNavigate, afterNavigate, afterInit. Payload chứa history, histories, nextHistory/prevHistory, nextHistories/prevHistories. Hỗ trợ CustomEvent trên window."
|
|
307
253
|
},
|
|
308
254
|
{
|
|
309
|
-
"id": "
|
|
310
|
-
"title": "
|
|
311
|
-
"subtitle": "
|
|
312
|
-
"content": "
|
|
255
|
+
"id": "router-getting-started--docs",
|
|
256
|
+
"title": "Router/Getting Started",
|
|
257
|
+
"subtitle": "Hướng dẫn bắt đầu sử dụng @v-miniapp/router cho routing và navigation trong V-MiniApp.",
|
|
258
|
+
"content": "Cài đặt, import styles, cấu hình IRouterConfig với pages, animation, keepAlive. Ví dụ Router component và điều hướng cơ bản."
|
|
313
259
|
},
|
|
314
260
|
{
|
|
315
|
-
"id": "hooks-
|
|
316
|
-
"title": "
|
|
317
|
-
"subtitle": "Hook
|
|
318
|
-
"content": "
|
|
261
|
+
"id": "router-hooks-useapppause--docs",
|
|
262
|
+
"title": "Router/useAppPause",
|
|
263
|
+
"subtitle": "Hook lắng nghe sự kiện onAppPause (app vào nền).",
|
|
264
|
+
"content": "useAppPause(onPause) đăng ký listener cho window event 'onAppPause'. Gọi onPause khi app bị pause (ví dụ chuyển tab, thu nhỏ). Dùng cho mini app / native bridge."
|
|
319
265
|
},
|
|
320
266
|
{
|
|
321
|
-
"id": "hooks-
|
|
322
|
-
"title": "
|
|
323
|
-
"subtitle": "Hook
|
|
324
|
-
"content": "
|
|
267
|
+
"id": "router-hooks-useappresume--docs",
|
|
268
|
+
"title": "Router/useAppResume",
|
|
269
|
+
"subtitle": "Hook lắng nghe sự kiện onAppResume (app quay lại foreground).",
|
|
270
|
+
"content": "useAppResume(onResume) đăng ký listener cho window event 'onAppResume'. Gọi onResume khi app resume. Dùng cho mini app / native bridge."
|
|
325
271
|
},
|
|
326
272
|
{
|
|
327
|
-
"id": "hooks-
|
|
328
|
-
"title": "
|
|
329
|
-
"subtitle": "Hook
|
|
330
|
-
"content": "
|
|
273
|
+
"id": "router-hooks-usedidhide--docs",
|
|
274
|
+
"title": "Router/useDidHide",
|
|
275
|
+
"subtitle": "Hook gọi callback khi page bị ẩn (hide) và trả về trạng thái didHide.",
|
|
276
|
+
"content": "useDidHide(func?) gọi func khi page hide (beforeHistoryChange khi nextHistory khác location key). Trả về boolean didHide. Dùng để dọn dẹp, pause khi rời page."
|
|
331
277
|
},
|
|
332
278
|
{
|
|
333
|
-
"id": "hooks-
|
|
334
|
-
"title": "
|
|
335
|
-
"subtitle": "Hook
|
|
336
|
-
"content": "
|
|
279
|
+
"id": "router-hooks-usedidshow--docs",
|
|
280
|
+
"title": "Router/useDidShow",
|
|
281
|
+
"subtitle": "Hook gọi callback khi page được hiển thị (show) và trả về trạng thái didShow.",
|
|
282
|
+
"content": "useDidShow(func?) gọi func khi page show (sau beforeHistoryChangeP2 khi nextHistory trùng location key). Trả về boolean didShow. Dùng để fetch data, analytics khi vào page."
|
|
337
283
|
},
|
|
338
284
|
{
|
|
339
|
-
"id": "hooks-
|
|
340
|
-
"title": "
|
|
341
|
-
"subtitle": "Hook
|
|
342
|
-
"content": "
|
|
285
|
+
"id": "router-hooks-usehistories--docs",
|
|
286
|
+
"title": "Router/useHistories",
|
|
287
|
+
"subtitle": "Hook trả về toàn bộ history stack (mảng IHistory).",
|
|
288
|
+
"content": "useHistories() trả về IHistory[]. Dùng để biết số lượng page trong stack, có thể back hay không, hoặc render breadcrumb."
|
|
343
289
|
},
|
|
344
290
|
{
|
|
345
|
-
"id": "hooks-
|
|
346
|
-
"title": "
|
|
347
|
-
"subtitle": "Hook
|
|
348
|
-
"content": "
|
|
291
|
+
"id": "router-hooks-usehistory--docs",
|
|
292
|
+
"title": "Router/useHistory",
|
|
293
|
+
"subtitle": "Hook trả về history entry hiện tại (action + location).",
|
|
294
|
+
"content": "useHistory() trả về IHistory: action (PUSH | REPLACE | POP) và location. Phụ thuộc LocationKeyContext nên trả về entry tương ứng với page/component đang render."
|
|
349
295
|
},
|
|
350
296
|
{
|
|
351
|
-
"id": "
|
|
352
|
-
"title": "
|
|
353
|
-
"subtitle": "
|
|
354
|
-
"content": "
|
|
297
|
+
"id": "router-hooks-uselocation--docs",
|
|
298
|
+
"title": "Router/useLocation",
|
|
299
|
+
"subtitle": "Hook trả về location hiện tại (pathname, params, state, key).",
|
|
300
|
+
"content": "useLocation() trả về ILocation | undefined. Dựa trên useHistory(); location tương ứng với history entry của page/context hiện tại."
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"id": "router-hooks-usenavigate--docs",
|
|
304
|
+
"title": "Router/useNavigate",
|
|
305
|
+
"subtitle": "Hook trả về function navigate để điều hướng bằng pathname hoặc delta.",
|
|
306
|
+
"content": "useNavigate() trả về INavigate: navigate(pathname, options?) hoặc navigate(delta, options?). Options gồm replace, params, state và IRouterPageState."
|
|
355
307
|
},
|
|
356
308
|
{
|
|
357
|
-
"id": "
|
|
358
|
-
"title": "
|
|
359
|
-
"subtitle": "
|
|
360
|
-
"content": "
|
|
309
|
+
"id": "router-hooks-usenavigationtype--docs",
|
|
310
|
+
"title": "Router/useNavigationType",
|
|
311
|
+
"subtitle": "Hook trả về action type của history hiện tại (PUSH, REPLACE, POP).",
|
|
312
|
+
"content": "useNavigationType() trả về IHistoryAction. Bằng useHistory().action. Dùng để biết user vào page bằng push, replace hay back/forward."
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"id": "router-router--docs",
|
|
316
|
+
"title": "Router/Router",
|
|
317
|
+
"subtitle": "Component Router: props, IRouterConfig, IRouterPageConfig, animation, keepAlive, ErrorPage, NotFoundPage.",
|
|
318
|
+
"content": "Router nhận config (IRouterConfig hoặc function trả về config). Hỗ trợ animation (type, mode), keepAlive, Layouts, ErrorPage, NotFoundPage. Config chỉ được đọc lần đầu khi mount."
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"id": "ui-react-app--docs",
|
|
322
|
+
"title": "UI React/App",
|
|
323
|
+
"subtitle": "Component App: props, IAppConfig, IPageConfig. Tích hợp Router, Locale, ErrorBoundary, Toast, NavigationBar, BottomTabBar.",
|
|
324
|
+
"content": "App nhận config, localesConfig, className. IAppConfig gồm pages, animation, navigationBar, bottomTabBar, keepAlive, pageLayout, theme. IPageConfig mở rộng từ router với navigationBar, bottomTabBar, pageLayout. App-level áp dụng mặc định, page-level override."
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"id": "ui-react-getting-started--docs",
|
|
328
|
+
"title": "UI React/Getting Started",
|
|
329
|
+
"subtitle": "Hướng dẫn bắt đầu sử dụng @v-miniapp/ui-react để phát triển V-MiniApp.",
|
|
330
|
+
"content": "Cài đặt, import styles (CSS hoặc Tailwind), ví dụ App với IAppConfig. Thư viện tích hợp Router, Locale, UI components, theme, pull-to-refresh, swipe navigation, keep-alive."
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"id": "ui-react-theme--docs",
|
|
334
|
+
"title": "UI React/Theme",
|
|
335
|
+
"subtitle": "Hướng dẫn sử dụng theme (light/dark/system) trong @v-miniapp/ui-react.",
|
|
336
|
+
"content": "Theme hỗ trợ 3 chế độ: light, dark, system. Cấu hình qua IAppConfig.theme.mode. Các hàm: getDataTheme, setDataTheme, toggleDataTheme. Theme được áp dụng qua data-theme attribute trên documentElement."
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"id": "ui-react-usebottomtabbar--docs",
|
|
340
|
+
"title": "UI React/useBottomTabBar",
|
|
341
|
+
"subtitle": "Hook đọc và cập nhật state bottom tab bar (app-level và page-level).",
|
|
342
|
+
"content": "useBottomTabBar() trả về state (merged), pageState, appState, hidden và các setter: setPageBottomTabBar, setAppBottomTabBar, remove*, reset*. hidden true khi bar ẩn hoặc page không có bottomTabBarId/items."
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"id": "ui-react-usecustomiconevent--docs",
|
|
346
|
+
"title": "UI React/useCustomIconEvent",
|
|
347
|
+
"subtitle": "Hook xử lý khi user bấm custom icon trên navigation bar.",
|
|
348
|
+
"content": "useCustomIconEvent(onCustomIconEvent). Callback nhận index của icon được bấm. Dùng khi navigationBar có custom icons."
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"id": "ui-react-useloadmore--docs",
|
|
352
|
+
"title": "UI React/useLoadMore",
|
|
353
|
+
"subtitle": "Hook đăng ký handler load more (onEndReached) cho page hiện tại.",
|
|
354
|
+
"content": "useLoadMore(onEndReached) gọi setPagePageLayout với onEndReached. Khi scroll tới cuối (hoặc trigger tương đương), onEndReached được gọi. Chỉ áp dụng cho page hiện tại."
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"id": "ui-react-usenavigationbar--docs",
|
|
358
|
+
"title": "UI React/useNavigationBar",
|
|
359
|
+
"subtitle": "Hook đọc và cập nhật state navigation bar (app-level và page-level).",
|
|
360
|
+
"content": "useNavigationBar() trả về state (merged), pageState, appState và các setter: setPageNavigationBar, setAppNavigationBar, removePageNavigationBar, removeAppNavigationBar, resetPageNavigationBar, resetAppNavigationBar."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"id": "ui-react-usepagelayout--docs",
|
|
364
|
+
"title": "UI React/usePageLayout",
|
|
365
|
+
"subtitle": "Hook đọc và cập nhật state page layout (app-level và page-level).",
|
|
366
|
+
"content": "usePageLayout() trả về state (merged), pageState, appState và các setter: setPagePageLayout, setAppPageLayout, remove/removeApp, resetPagePageLayout, resetAppPageLayout. State gồm scrollRestoration, pullToRefresh, onEndReached, contentClassName, hidden."
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"id": "ui-react-usepagescroll--docs",
|
|
370
|
+
"title": "UI React/usePageScroll",
|
|
371
|
+
"subtitle": "Hook lắng nghe sự kiện scroll của page.",
|
|
372
|
+
"content": "usePageScroll(callback, options?) với throttle. Callback nhận target (HTMLDivElement) và event. Chỉ hoạt động khi page đang hiển thị."
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"id": "ui-react-usepulltorefresh--docs",
|
|
376
|
+
"title": "UI React/usePullToRefresh",
|
|
377
|
+
"subtitle": "Hook đăng ký handler pull-to-refresh cho page hiện tại.",
|
|
378
|
+
"content": "usePullToRefresh(onRefresh) gọi setPagePageLayout với pullToRefresh.onRefresh. onRefresh có thể sync hoặc async. Chỉ áp dụng cho page hiện tại."
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"id": "ui-react-usesettingschanged--docs",
|
|
382
|
+
"title": "UI React/useSettingsChanged",
|
|
383
|
+
"subtitle": "Hook lắng nghe khi settings của app thay đổi.",
|
|
384
|
+
"content": "useSettingsChanged(onSettingsChanged). Callback nhận object settings. Dùng để phản ứng với thay đổi theme, language hoặc cài đặt khác từ native/môi trường."
|
|
361
385
|
},
|
|
362
386
|
{
|
|
363
387
|
"id": "use-cases-infinite-scroll--docs",
|
|
@@ -365,6 +389,12 @@
|
|
|
365
389
|
"subtitle": "Hướng dẫn implement infinite scroll để tự động load thêm data khi user scroll đến cuối danh sách.",
|
|
366
390
|
"content": "Infinite Scroll cho phép tự động load thêm data khi user scroll đến cuối danh sách. Có thể sử dụng hook useLoadMore để quản lý loading state, hasMore state và loadMore function. Hook này tự động phát hiện khi scroll đến cuối và gọi loadMore function."
|
|
367
391
|
},
|
|
392
|
+
{
|
|
393
|
+
"id": "use-cases-migrate-darkmode-to-theme--docs",
|
|
394
|
+
"title": "Use Cases/Migrate darkMode to theme",
|
|
395
|
+
"subtitle": "Hướng dẫn migrate từ deprecated darkMode sang theme.mode mới trong @v-miniapp/ui-react.",
|
|
396
|
+
"content": "darkMode đã được deprecated và sẽ bị xóa trong tương lai. Cần migrate sang theme.mode với các giá trị: 'light', 'dark', hoặc 'system'. Mapping: darkMode.defaultEnabled: true → theme.mode: 'dark', darkMode.defaultEnabled: false → theme.mode: 'light'."
|
|
397
|
+
},
|
|
368
398
|
{
|
|
369
399
|
"id": "use-cases-tailwind-integration--docs",
|
|
370
400
|
"title": "Use Cases/Tailwind Integration",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-miniapp/ui-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@types/lodash": "^4.17.23",
|
|
21
21
|
"@use-gesture/react": "^10.3.1",
|
|
22
|
+
"@v-miniapp/locale": "1.0.2",
|
|
23
|
+
"@v-miniapp/router": "1.0.5",
|
|
22
24
|
"ahooks": "^3.9.6",
|
|
23
25
|
"classnames": "^2.5.1",
|
|
24
26
|
"dayjs": "^1.11.19",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
-
import { IAppConfig } from '../types/app';
|
|
3
|
-
import { ILocalesConfig, IResourceKey, ITemplateParams } from '../../../locales/types';
|
|
4
|
-
export type IAppConfigContext = {
|
|
5
|
-
t: (key: IResourceKey, params?: ITemplateParams) => ReactNode;
|
|
6
|
-
};
|
|
7
|
-
export type IAppConfigFunction = (context: IAppConfigContext) => IAppConfig;
|
|
8
|
-
export type IAppProps = ComponentPropsWithRef<'div'> & {
|
|
9
|
-
config: IAppConfig | IAppConfigFunction;
|
|
10
|
-
localesConfig?: ILocalesConfig;
|
|
11
|
-
};
|
|
12
|
-
export declare const AppInner: ({ config: configProp }: IAppProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const App: ({ className, config, localesConfig, ...props }: IAppProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, FC } from 'react';
|
|
2
|
-
import { INavigatePathnameOptions, INavigateDeltaOptions } from '../types/navigation';
|
|
3
|
-
export type ILinkProps = Omit<ComponentProps<'a'>, 'href' | 'onClick'> & (({
|
|
4
|
-
to: number;
|
|
5
|
-
} & INavigateDeltaOptions) | ({
|
|
6
|
-
to: string;
|
|
7
|
-
} & INavigatePathnameOptions));
|
|
8
|
-
export declare const Link: FC<ILinkProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useAppPause: (onPause: () => void) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useAppResume: (onResume: () => void) => void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IAppBottomTabBarState } from '../types/app';
|
|
2
|
-
export declare const useBottomTabBar: () => {
|
|
3
|
-
state: IAppBottomTabBarState;
|
|
4
|
-
pageState: IAppBottomTabBarState | undefined;
|
|
5
|
-
appState: IAppBottomTabBarState | undefined;
|
|
6
|
-
hidden: boolean;
|
|
7
|
-
setPageBottomTabBar: (bottomTabBar: Partial<IAppBottomTabBarState>) => void;
|
|
8
|
-
setAppBottomTabBar: (bottomTabBar: Partial<IAppBottomTabBarState>) => void;
|
|
9
|
-
removePageBottomTabBar: () => void;
|
|
10
|
-
removeAppBottomTabBar: () => void;
|
|
11
|
-
resetPageBottomTabBar: () => void;
|
|
12
|
-
resetAppBottomTabBar: () => void;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useDidHide: (func?: () => void) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useDidShow: (func?: () => void) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useLocation: () => import('..').ILocation;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useNavigate: () => import('..').INavigate;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IAppNavigationBarState } from '../types/app';
|
|
2
|
-
export declare const useNavigationBar: () => {
|
|
3
|
-
state: IAppNavigationBarState;
|
|
4
|
-
pageState: IAppNavigationBarState | undefined;
|
|
5
|
-
appState: IAppNavigationBarState | undefined;
|
|
6
|
-
setPageNavigationBar: (navigationBar: Partial<IAppNavigationBarState>) => void;
|
|
7
|
-
setAppNavigationBar: (navigationBar: Partial<IAppNavigationBarState>) => void;
|
|
8
|
-
removePageNavigationBar: () => void;
|
|
9
|
-
removeAppNavigationBar: () => void;
|
|
10
|
-
resetPageNavigationBar: () => void;
|
|
11
|
-
resetAppNavigationBar: () => void;
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useNavigationType: () => import('..').IHistoryAction;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const usePageConfig: () => import('..').IPageConfig | undefined;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IAppPageLayoutState } from '../types/app';
|
|
2
|
-
export declare const usePageLayout: () => {
|
|
3
|
-
state: IAppPageLayoutState;
|
|
4
|
-
pageState: IAppPageLayoutState | undefined;
|
|
5
|
-
appState: IAppPageLayoutState | undefined;
|
|
6
|
-
setPagePagelayout: (pageLayoutState: Partial<IAppPageLayoutState>) => void;
|
|
7
|
-
setAppPageLayout: (pageLayoutState: Partial<IAppPageLayoutState>) => void;
|
|
8
|
-
removePagePagelayout: () => void;
|
|
9
|
-
removeAppPageLayout: () => void;
|
|
10
|
-
resetPagePagelayout: () => void;
|
|
11
|
-
resetAppPageLayout: () => void;
|
|
12
|
-
};
|
|
13
|
-
export declare const usePullToRefresh: (onRefresh: () => Promise<unknown> | unknown) => void;
|
|
14
|
-
export declare const useLoadMore: (onEndReached: () => void) => void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ThrottleOptions } from 'ahooks/lib/useThrottle/throttleOptions';
|
|
2
|
-
export type IUsePageScrollOptions = {
|
|
3
|
-
throttle?: ThrottleOptions;
|
|
4
|
-
};
|
|
5
|
-
export declare const usePageScroll: (callback: (target: HTMLDivElement, event: Event) => void, options?: IUsePageScrollOptions) => void;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IAppConfig, IAppState, IPageState } from '../types/app';
|
|
2
|
-
import { IHistory, INavigate } from '../types/navigation';
|
|
3
|
-
import { EventEmitter } from '../../../utils/event-emitter';
|
|
4
|
-
export type IAppStoreState = {
|
|
5
|
-
config: IAppConfig;
|
|
6
|
-
initialized: boolean;
|
|
7
|
-
appState: IAppState;
|
|
8
|
-
pageStates: Partial<Record<string, IPageState>>;
|
|
9
|
-
histories: IHistory[];
|
|
10
|
-
init: (config: IAppConfig) => void;
|
|
11
|
-
navigate: INavigate;
|
|
12
|
-
};
|
|
13
|
-
type IBeforeLocationChangeData = {
|
|
14
|
-
history: IHistory;
|
|
15
|
-
histories: IHistory[];
|
|
16
|
-
nextHistory: IHistory;
|
|
17
|
-
nextHistories: IHistory[];
|
|
18
|
-
};
|
|
19
|
-
export declare const navigationEventEmitter: EventEmitter<{
|
|
20
|
-
beforeLocationChangeP1: IBeforeLocationChangeData;
|
|
21
|
-
beforeLocationChangeP2: IBeforeLocationChangeData;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const useAppStore: import('zustand').UseBoundStore<import('zustand').StoreApi<IAppStoreState>>;
|
|
24
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IAppStoreState } from './app';
|
|
2
|
-
export declare const historiesSelector: (state: IAppStoreState) => import('..').IHistory[];
|
|
3
|
-
export declare const lastHistorySelector: (state: IAppStoreState) => import('..').IHistory;
|
|
4
|
-
export declare const historySelector: (locationKey: string | null) => (state: IAppStoreState) => import('..').IHistory | undefined;
|
|
5
|
-
export declare const lastLocationSelector: (state: IAppStoreState) => import('..').ILocation;
|
|
6
|
-
export declare const pageStatesSelector: (state: IAppStoreState) => Partial<Record<string, import('..').IPageState>>;
|
|
7
|
-
export declare const pageStateSelector: (locationKey: string | null) => (state: IAppStoreState) => import('..').IPageState | undefined;
|
|
8
|
-
export declare const lastPageStateSelector: (state: IAppStoreState) => import('..').IPageState | undefined;
|
|
9
|
-
export declare const pageConfigsSelector: (state: IAppStoreState) => import('..').IPageConfig[];
|
|
10
|
-
export declare const pageConfigSelector: (locationKey: string | null) => (state: IAppStoreState) => import('..').IPageConfig | undefined;
|
|
11
|
-
export declare const lastPageConfigSelector: (state: IAppStoreState) => import('..').IPageConfig | undefined;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ComponentType, PropsWithChildren } from 'react';
|
|
2
|
-
import { INavigationAnimationType } from './navigation';
|
|
3
|
-
import { INavigationBarProps } from '../../navigation-bar';
|
|
4
|
-
import { IBottomTabBarItem, IBottomTabBarProps } from '../../bottom-tab-bar';
|
|
5
|
-
import { IPageBaseProps } from '../../layout';
|
|
6
|
-
export type IAppAnimationState = {
|
|
7
|
-
type?: INavigationAnimationType;
|
|
8
|
-
};
|
|
9
|
-
export type IAppKeepAliveState = {
|
|
10
|
-
enable?: boolean;
|
|
11
|
-
maxStack?: number;
|
|
12
|
-
freeze?: boolean;
|
|
13
|
-
freezeDelay?: number;
|
|
14
|
-
};
|
|
15
|
-
export type IAppPageLayoutState = IPageBaseProps & {
|
|
16
|
-
hidden?: boolean;
|
|
17
|
-
scrollRestoration?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export type IAppNavigationBarState = INavigationBarProps & {
|
|
20
|
-
hidden?: boolean;
|
|
21
|
-
};
|
|
22
|
-
export type IAppBottomTabBarState = Partial<Omit<IBottomTabBarProps, 'activeId' | 'items'>> & {
|
|
23
|
-
items: Array<IBottomTabBarItem & {
|
|
24
|
-
path: string;
|
|
25
|
-
params?: Record<string, string>;
|
|
26
|
-
}>;
|
|
27
|
-
hidden?: boolean;
|
|
28
|
-
};
|
|
29
|
-
export type ILayout = ComponentType<PropsWithChildren>;
|
|
30
|
-
export type IAppState = {
|
|
31
|
-
animation?: IAppAnimationState;
|
|
32
|
-
navigationBar?: IAppNavigationBarState;
|
|
33
|
-
bottomTabBar?: IAppBottomTabBarState;
|
|
34
|
-
keepAlive?: IAppKeepAliveState;
|
|
35
|
-
pageLayout?: IAppPageLayoutState;
|
|
36
|
-
Layouts?: ILayout[];
|
|
37
|
-
};
|
|
38
|
-
export type IPageState = Omit<IAppState, 'keepAlive'> & {
|
|
39
|
-
keepAlive?: boolean;
|
|
40
|
-
freeze?: boolean;
|
|
41
|
-
freezeDelay?: number;
|
|
42
|
-
};
|
|
43
|
-
export type IPageConfig = {
|
|
44
|
-
pathname: string;
|
|
45
|
-
Component: ComponentType;
|
|
46
|
-
Layouts?: ILayout[];
|
|
47
|
-
bottomTabBarId?: string;
|
|
48
|
-
} & IPageState;
|
|
49
|
-
export type IDarkModeConfig = {
|
|
50
|
-
defaultEnabled?: boolean;
|
|
51
|
-
};
|
|
52
|
-
export type IThemeConfig = {
|
|
53
|
-
defaultMode?: 'dark' | 'light' | 'system';
|
|
54
|
-
};
|
|
55
|
-
export type IAppConfig = {
|
|
56
|
-
pages: IPageConfig[];
|
|
57
|
-
theme?: IThemeConfig;
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated This will be removed soon. Use `theme.darkMode` instead.
|
|
60
|
-
*/
|
|
61
|
-
darkMode?: IDarkModeConfig;
|
|
62
|
-
navigation?: {
|
|
63
|
-
alwaysRootPage?: boolean;
|
|
64
|
-
};
|
|
65
|
-
} & IAppState;
|