@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,335 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./iframe-CQAwSt4E.js";import{useMDXComponents as c}from"./index-CgMRTj-o.js";import{b as r,M as o}from"./blocks-BuaOUtiH.js";import"./preload-helper-PPVm8Dsz.js";import"./index-DHiZ-gXR.js";function s(i){const e={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...c(),...i.components};return n.jsxs(n.Fragment,{children:[`
|
|
2
|
-
`,`
|
|
3
|
-
`,n.jsx(r,{title:"App Framework/Routing & Navigation"}),`
|
|
4
|
-
`,n.jsx(e.h1,{id:"routing--navigation",children:"Routing & Navigation"}),`
|
|
5
|
-
`,n.jsxs(e.p,{children:["Hệ thống routing và navigation của ",n.jsx(e.code,{children:"App"})," framework cung cấp các hooks và utilities để quản lý navigation, truy cập thông tin page, và xử lý các lifecycle events."]}),`
|
|
6
|
-
`,n.jsx(e.h2,{id:"routing",children:"Routing"}),`
|
|
7
|
-
`,n.jsxs(e.p,{children:["Hệ thống routing sử dụng ",n.jsx(e.strong,{children:"exact path matching"})," - mỗi page được định nghĩa với một ",n.jsx(e.code,{children:"pathname"})," cụ thể và chỉ match khi pathname khớp chính xác."]}),`
|
|
8
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Lưu ý:"})}),`
|
|
9
|
-
`,n.jsxs(e.ul,{children:[`
|
|
10
|
-
`,n.jsxs(e.li,{children:["Không hỗ trợ dynamic pathname như ",n.jsx(e.code,{children:"/:id"})," hoặc nested routes"]}),`
|
|
11
|
-
`,n.jsxs(e.li,{children:["Hỗ trợ query parameters thông qua ",n.jsx(e.code,{children:"params"})," trong navigate options"]}),`
|
|
12
|
-
`,n.jsx(e.li,{children:"Sử dụng browser history API để quản lý navigation stack"}),`
|
|
13
|
-
`]}),`
|
|
14
|
-
`,n.jsx(e.h2,{id:"navigation",children:"Navigation"}),`
|
|
15
|
-
`,n.jsxs(e.p,{children:["Navigation được thực hiện thông qua function ",n.jsx(e.code,{children:"navigate"})," từ hook ",n.jsx(e.code,{children:"useNavigate()"}),". Có 2 cách navigate:"]}),`
|
|
16
|
-
`,n.jsxs(e.ol,{children:[`
|
|
17
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Navigate bằng pathname"}),": ",n.jsx(e.code,{children:"navigate('/pathname', options)"})]}),`
|
|
18
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"Navigate bằng delta"}),": ",n.jsx(e.code,{children:"navigate(delta)"})," - điều hướng trong history stack (back/forward)"]}),`
|
|
19
|
-
`]}),`
|
|
20
|
-
`,n.jsx(e.h2,{id:"hooks",children:"Hooks"}),`
|
|
21
|
-
`,n.jsx(e.h3,{id:"usenavigate",children:"useNavigate"}),`
|
|
22
|
-
`,n.jsxs(e.p,{children:["Hook để lấy function ",n.jsx(e.code,{children:"navigate"})," để điều hướng giữa các pages."]}),`
|
|
23
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
24
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useNavigate } from '@v-miniapp/ui-react'
|
|
25
|
-
`})}),`
|
|
26
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
27
|
-
`,n.jsxs(e.ul,{children:[`
|
|
28
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"navigate"}),": Function để điều hướng với type ",n.jsx(e.code,{children:"INavigate"}),":",`
|
|
29
|
-
`,n.jsxs(e.ul,{children:[`
|
|
30
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"navigate(pathname: string, options?: INavigatePathnameOptions): void"})," - Navigate bằng pathname"]}),`
|
|
31
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"navigate(delta: number, options?: INavigateDeltaOptions): void"})," - Navigate bằng delta (back/forward)"]}),`
|
|
32
|
-
`]}),`
|
|
33
|
-
`]}),`
|
|
34
|
-
`]}),`
|
|
35
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
36
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useNavigate } from '@v-miniapp/ui-react'
|
|
37
|
-
|
|
38
|
-
const MyPage = () => {
|
|
39
|
-
const navigate = useNavigate()
|
|
40
|
-
|
|
41
|
-
const handleClick = () => {
|
|
42
|
-
// Navigate đến page khác
|
|
43
|
-
navigate('/settings', {
|
|
44
|
-
params: { id: '123' },
|
|
45
|
-
state: { from: 'home' },
|
|
46
|
-
replace: false, // true để replace thay vì push
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const handleBack = () => {
|
|
51
|
-
// Navigate back
|
|
52
|
-
navigate(-1)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return <button onClick={handleClick}>Go to Settings</button>
|
|
56
|
-
}
|
|
57
|
-
`})}),`
|
|
58
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usenavigate--docs",children:"useNavigate Hook"})]}),`
|
|
59
|
-
`,n.jsx(e.hr,{}),`
|
|
60
|
-
`,n.jsx(e.h3,{id:"usehistory",children:"useHistory"}),`
|
|
61
|
-
`,n.jsx(e.p,{children:"Hook để lấy history entry hiện tại của page."}),`
|
|
62
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
63
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useHistory } from '@v-miniapp/ui-react'
|
|
64
|
-
`})}),`
|
|
65
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
66
|
-
`,n.jsxs(e.ul,{children:[`
|
|
67
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"history"}),": ",n.jsx(e.code,{children:"IHistory"})," object chứa:",`
|
|
68
|
-
`,n.jsxs(e.ul,{children:[`
|
|
69
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"action"}),": ",n.jsx(e.code,{children:"'PUSH' | 'REPLACE' | 'POP'"})]}),`
|
|
70
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"location"}),": ",n.jsx(e.code,{children:"ILocation"})," object chứa ",n.jsx(e.code,{children:"key"}),", ",n.jsx(e.code,{children:"pathname"}),", ",n.jsx(e.code,{children:"params?"}),", ",n.jsx(e.code,{children:"state?"})]}),`
|
|
71
|
-
`]}),`
|
|
72
|
-
`]}),`
|
|
73
|
-
`]}),`
|
|
74
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
75
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useHistory } from '@v-miniapp/ui-react'
|
|
76
|
-
|
|
77
|
-
const MyPage = () => {
|
|
78
|
-
const history = useHistory()
|
|
79
|
-
|
|
80
|
-
console.log(history.location.pathname) // '/home'
|
|
81
|
-
console.log(history.location.params) // { id: '123' }
|
|
82
|
-
console.log(history.action) // 'PUSH' | 'REPLACE' | 'POP'
|
|
83
|
-
|
|
84
|
-
return <div>Current path: {history.location.pathname}</div>
|
|
85
|
-
}
|
|
86
|
-
`})}),`
|
|
87
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usehistory--docs",children:"useHistory Hook"})]}),`
|
|
88
|
-
`,n.jsx(e.hr,{}),`
|
|
89
|
-
`,n.jsx(e.h3,{id:"usehistories",children:"useHistories"}),`
|
|
90
|
-
`,n.jsx(e.p,{children:"Hook để lấy toàn bộ history stack."}),`
|
|
91
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
92
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useHistories } from '@v-miniapp/ui-react'
|
|
93
|
-
`})}),`
|
|
94
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
95
|
-
`,n.jsxs(e.ul,{children:[`
|
|
96
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"histories"}),": ",n.jsx(e.code,{children:"IHistory[]"})," - Mảng các history entries"]}),`
|
|
97
|
-
`]}),`
|
|
98
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
99
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useHistories } from '@v-miniapp/ui-react'
|
|
100
|
-
|
|
101
|
-
const MyPage = () => {
|
|
102
|
-
const histories = useHistories()
|
|
103
|
-
|
|
104
|
-
console.log(histories.length) // Số lượng pages trong stack
|
|
105
|
-
|
|
106
|
-
return <div>History stack length: {histories.length}</div>
|
|
107
|
-
}
|
|
108
|
-
`})}),`
|
|
109
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usehistories--docs",children:"useHistories Hook"})]}),`
|
|
110
|
-
`,n.jsx(e.hr,{}),`
|
|
111
|
-
`,n.jsx(e.h3,{id:"uselocation",children:"useLocation"}),`
|
|
112
|
-
`,n.jsx(e.p,{children:"Hook để lấy location object hiện tại (pathname, params, state, key)."}),`
|
|
113
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
114
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useLocation } from '@v-miniapp/ui-react'
|
|
115
|
-
`})}),`
|
|
116
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
117
|
-
`,n.jsxs(e.ul,{children:[`
|
|
118
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"location"}),": ",n.jsx(e.code,{children:"ILocation"})," object hoặc ",n.jsx(e.code,{children:"undefined"})," chứa:",`
|
|
119
|
-
`,n.jsxs(e.ul,{children:[`
|
|
120
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"key"}),": ",n.jsx(e.code,{children:"string"})]}),`
|
|
121
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"pathname"}),": ",n.jsx(e.code,{children:"string"})]}),`
|
|
122
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"params?"}),": ",n.jsx(e.code,{children:"Record<string, string>"})]}),`
|
|
123
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"state?"}),": ",n.jsx(e.code,{children:"any"})]}),`
|
|
124
|
-
`]}),`
|
|
125
|
-
`]}),`
|
|
126
|
-
`]}),`
|
|
127
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
128
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useLocation } from '@v-miniapp/ui-react'
|
|
129
|
-
|
|
130
|
-
const MyPage = () => {
|
|
131
|
-
const location = useLocation()
|
|
132
|
-
|
|
133
|
-
console.log(location.pathname) // '/home'
|
|
134
|
-
console.log(location.params) // { id: '123' }
|
|
135
|
-
console.log(location.state) // { from: 'home' }
|
|
136
|
-
console.log(location.key) // Unique key cho location này
|
|
137
|
-
|
|
138
|
-
return <div>Path: {location.pathname}</div>
|
|
139
|
-
}
|
|
140
|
-
`})}),`
|
|
141
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-uselocation--docs",children:"useLocation Hook"})]}),`
|
|
142
|
-
`,n.jsx(e.hr,{}),`
|
|
143
|
-
`,n.jsx(e.h3,{id:"usepageconfig",children:"usePageConfig"}),`
|
|
144
|
-
`,n.jsx(e.p,{children:"Hook để lấy config của page hiện tại."}),`
|
|
145
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
146
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { usePageConfig } from '@v-miniapp/ui-react'
|
|
147
|
-
`})}),`
|
|
148
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
149
|
-
`,n.jsxs(e.ul,{children:[`
|
|
150
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"pageConfig"}),": ",n.jsx(e.code,{children:"IPageConfig"})," của page hiện tại hoặc ",n.jsx(e.code,{children:"undefined"})]}),`
|
|
151
|
-
`]}),`
|
|
152
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
153
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { usePageConfig } from '@v-miniapp/ui-react'
|
|
154
|
-
|
|
155
|
-
const MyPage = () => {
|
|
156
|
-
const pageConfig = usePageConfig()
|
|
157
|
-
|
|
158
|
-
if (!pageConfig) return null
|
|
159
|
-
|
|
160
|
-
console.log(pageConfig.pathname) // '/home'
|
|
161
|
-
console.log(pageConfig.Component) // Component của page
|
|
162
|
-
console.log(pageConfig.navigationBar) // Navigation bar config
|
|
163
|
-
|
|
164
|
-
return <div>Page: {pageConfig.pathname}</div>
|
|
165
|
-
}
|
|
166
|
-
`})}),`
|
|
167
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usepageconfig--docs",children:"usePageConfig Hook"})]}),`
|
|
168
|
-
`,n.jsx(e.hr,{}),`
|
|
169
|
-
`,n.jsx(e.h3,{id:"usenavigationtype",children:"useNavigationType"}),`
|
|
170
|
-
`,n.jsx(e.p,{children:"Hook để lấy navigation action type (PUSH, REPLACE, POP)."}),`
|
|
171
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
172
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useNavigationType } from '@v-miniapp/ui-react'
|
|
173
|
-
`})}),`
|
|
174
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
175
|
-
`,n.jsxs(e.ul,{children:[`
|
|
176
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"action"}),": ",n.jsx(e.code,{children:"'PUSH' | 'REPLACE' | 'POP'"})," hoặc ",n.jsx(e.code,{children:"undefined"})]}),`
|
|
177
|
-
`]}),`
|
|
178
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
179
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useNavigationType } from '@v-miniapp/ui-react'
|
|
180
|
-
|
|
181
|
-
const MyPage = () => {
|
|
182
|
-
const action = useNavigationType()
|
|
183
|
-
|
|
184
|
-
console.log(action) // 'PUSH' | 'REPLACE' | 'POP'
|
|
185
|
-
|
|
186
|
-
return <div>Navigation type: {action}</div>
|
|
187
|
-
}
|
|
188
|
-
`})}),`
|
|
189
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usenavigationtype--docs",children:"useNavigationType Hook"})]}),`
|
|
190
|
-
`,n.jsx(e.hr,{}),`
|
|
191
|
-
`,n.jsx(e.h3,{id:"usedidshow",children:"useDidShow"}),`
|
|
192
|
-
`,n.jsx(e.p,{children:"Hook để xử lý khi page được hiển thị (show)."}),`
|
|
193
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
194
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useDidShow } from '@v-miniapp/ui-react'
|
|
195
|
-
`})}),`
|
|
196
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Parameters:"})}),`
|
|
197
|
-
`,n.jsxs(e.ul,{children:[`
|
|
198
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"func?: () => void"}),": Callback function được gọi khi page show"]}),`
|
|
199
|
-
`]}),`
|
|
200
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
201
|
-
`,n.jsxs(e.ul,{children:[`
|
|
202
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"didShow"}),": Boolean cho biết page có đang được hiển thị không"]}),`
|
|
203
|
-
`]}),`
|
|
204
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
205
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useDidShow } from '@v-miniapp/ui-react'
|
|
206
|
-
|
|
207
|
-
const MyPage = () => {
|
|
208
|
-
const didShow = useDidShow(() => {
|
|
209
|
-
console.log('Page is shown')
|
|
210
|
-
// Fetch data, track analytics, etc.
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
return <div>Page is {didShow ? 'visible' : 'hidden'}</div>
|
|
214
|
-
}
|
|
215
|
-
`})}),`
|
|
216
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usedidshow--docs",children:"useDidShow Hook"})]}),`
|
|
217
|
-
`,n.jsx(e.hr,{}),`
|
|
218
|
-
`,n.jsx(e.h3,{id:"usedidhide",children:"useDidHide"}),`
|
|
219
|
-
`,n.jsx(e.p,{children:"Hook để xử lý khi page bị ẩn (hide)."}),`
|
|
220
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
221
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { useDidHide } from '@v-miniapp/ui-react'
|
|
222
|
-
`})}),`
|
|
223
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Parameters:"})}),`
|
|
224
|
-
`,n.jsxs(e.ul,{children:[`
|
|
225
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"func?: () => void"}),": Callback function được gọi khi page hide"]}),`
|
|
226
|
-
`]}),`
|
|
227
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
228
|
-
`,n.jsxs(e.ul,{children:[`
|
|
229
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"didHide"}),": Boolean cho biết page có đang bị ẩn không"]}),`
|
|
230
|
-
`]}),`
|
|
231
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
232
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { useDidHide } from '@v-miniapp/ui-react'
|
|
233
|
-
|
|
234
|
-
const MyPage = () => {
|
|
235
|
-
const didHide = useDidHide(() => {
|
|
236
|
-
console.log('Page is hidden')
|
|
237
|
-
// Cleanup, pause timers, etc.
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
return <div>Page is {didHide ? 'hidden' : 'visible'}</div>
|
|
241
|
-
}
|
|
242
|
-
`})}),`
|
|
243
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usedidhide--docs",children:"useDidHide Hook"})]}),`
|
|
244
|
-
`,n.jsx(e.hr,{}),`
|
|
245
|
-
`,n.jsx(e.h3,{id:"usepagescroll",children:"usePageScroll"}),`
|
|
246
|
-
`,n.jsx(e.p,{children:"Hook để lắng nghe sự kiện scroll của page."}),`
|
|
247
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
248
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { usePageScroll } from '@v-miniapp/ui-react'
|
|
249
|
-
`})}),`
|
|
250
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Parameters:"})}),`
|
|
251
|
-
`,n.jsxs(e.ul,{children:[`
|
|
252
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"callback: (target: HTMLDivElement, event: Event) => void"}),": Callback được gọi khi scroll"]}),`
|
|
253
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"options?: IUsePageScrollOptions"}),": Options cho throttle"]}),`
|
|
254
|
-
`]}),`
|
|
255
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
256
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { usePageScroll } from '@v-miniapp/ui-react'
|
|
257
|
-
|
|
258
|
-
const MyPage = () => {
|
|
259
|
-
usePageScroll((target, event) => {
|
|
260
|
-
console.log('Scroll position:', target.scrollTop)
|
|
261
|
-
// Handle scroll event
|
|
262
|
-
}, {
|
|
263
|
-
throttle: {
|
|
264
|
-
wait: 200, // Throttle 200ms
|
|
265
|
-
}
|
|
266
|
-
})
|
|
267
|
-
|
|
268
|
-
return <div>Scroll me</div>
|
|
269
|
-
}
|
|
270
|
-
`})}),`
|
|
271
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usepagescroll--docs",children:"usePageScroll Hook"})]}),`
|
|
272
|
-
`,n.jsx(e.hr,{}),`
|
|
273
|
-
`,n.jsx(e.h3,{id:"usepagestate",children:"usePageState"}),`
|
|
274
|
-
`,n.jsx(e.p,{children:"Hook để quản lý state của page hiện tại."}),`
|
|
275
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Import:"})}),`
|
|
276
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-typescript",children:`import { usePageState } from '@v-miniapp/ui-react'
|
|
277
|
-
`})}),`
|
|
278
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Returns:"})}),`
|
|
279
|
-
`,n.jsxs(e.ul,{children:[`
|
|
280
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"pageState"}),": ",n.jsx(e.code,{children:"IPageState"})," của page hiện tại hoặc ",n.jsx(e.code,{children:"undefined"})]}),`
|
|
281
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.code,{children:"setPageState"}),": ",n.jsx(e.code,{children:"Dispatch<SetStateAction<IPageState | undefined>>"})," - Function để update page state"]}),`
|
|
282
|
-
`]}),`
|
|
283
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Cách sử dụng:"})}),`
|
|
284
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`import { usePageState } from '@v-miniapp/ui-react'
|
|
285
|
-
|
|
286
|
-
const MyPage = () => {
|
|
287
|
-
const { pageState, setPageState } = usePageState()
|
|
288
|
-
|
|
289
|
-
const updateNavigationBar = () => {
|
|
290
|
-
setPageState({
|
|
291
|
-
navigationBar: {
|
|
292
|
-
title: 'New Title',
|
|
293
|
-
},
|
|
294
|
-
})
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return <button onClick={updateNavigationBar}>Update Title</button>
|
|
298
|
-
}
|
|
299
|
-
`})}),`
|
|
300
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Xem chi tiết:"})," ",n.jsx(e.a,{href:"?path=/docs/hooks-usepagestate--docs",children:"usePageState Hook"})]}),`
|
|
301
|
-
`,n.jsx(e.hr,{}),`
|
|
302
|
-
`,n.jsx(e.h2,{id:"navigate-options",children:"Navigate Options"}),`
|
|
303
|
-
`,n.jsxs(e.p,{children:["Khi sử dụng ",n.jsx(e.code,{children:"navigate(pathname, options)"}),", bạn có thể truyền các options sau:"]}),`
|
|
304
|
-
`,n.jsx(o,{children:"\n| Option | Type | Mô tả |\n| :--- | :--- | :--- |\n| `params` | `Record<string, string>` | Query parameters (sẽ được thêm vào URL) |\n| `state` | `any` | State object (không hiển thị trong URL, lưu trong history) |\n| `replace` | `boolean` | Nếu `true`, replace history entry thay vì push mới |\n| `animation` | `IAppAnimationState` | Override animation cho navigation này |\n| `navigationBar` | `IAppNavigationBarState` | Override navigation bar cho page này |\n| `bottomTabBar` | `IAppBottomTabBarState` | Override bottom tab bar cho page này |\n| `keepAlive` | `boolean | IAppKeepAliveState` | Override keep-alive cho page này |\n| `pageLayout` | `IAppPageLayoutState` | Override page layout cho page này |\n"}),`
|
|
305
|
-
`,n.jsxs(e.p,{children:[n.jsx(e.strong,{children:"Lưu ý:"})," ",n.jsx(e.code,{children:"INavigatePathnameOptions"})," extends ",n.jsx(e.code,{children:"IPageState"}),", nên bạn có thể truyền các page-level config trong navigate options để override config cho page mới."]}),`
|
|
306
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Ví dụ:"})}),`
|
|
307
|
-
`,n.jsx(e.pre,{children:n.jsx(e.code,{className:"language-tsx",children:`const navigate = useNavigate()
|
|
308
|
-
|
|
309
|
-
// Navigate với params và state
|
|
310
|
-
navigate('/detail', {
|
|
311
|
-
params: { id: '123' }, // ?id=123
|
|
312
|
-
state: { from: 'home' }, // Không hiển thị trong URL
|
|
313
|
-
replace: false, // Push vào history stack
|
|
314
|
-
})
|
|
315
|
-
|
|
316
|
-
// Navigate back
|
|
317
|
-
navigate(-1) // Quay lại 1 page
|
|
318
|
-
|
|
319
|
-
// Navigate forward
|
|
320
|
-
navigate(1) // Tiến tới 1 page
|
|
321
|
-
`})}),`
|
|
322
|
-
`,n.jsx(e.hr,{}),`
|
|
323
|
-
`,n.jsx(e.h2,{id:"lifecycle-events",children:"Lifecycle Events"}),`
|
|
324
|
-
`,n.jsx(e.p,{children:"Khi navigate giữa các pages, các lifecycle events được trigger:"}),`
|
|
325
|
-
`,n.jsxs(e.ol,{children:[`
|
|
326
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"beforeLocationChangeP1"}),": Trigger trước khi location thay đổi (phase 1)"]}),`
|
|
327
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"beforeLocationChangeP2"}),": Trigger trước khi location thay đổi (phase 2)"]}),`
|
|
328
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"useDidShow"}),": Trigger khi page được hiển thị"]}),`
|
|
329
|
-
`,n.jsxs(e.li,{children:[n.jsx(e.strong,{children:"useDidHide"}),": Trigger khi page bị ẩn"]}),`
|
|
330
|
-
`]}),`
|
|
331
|
-
`,n.jsx(e.p,{children:n.jsx(e.strong,{children:"Thứ tự:"})}),`
|
|
332
|
-
`,n.jsxs(e.ul,{children:[`
|
|
333
|
-
`,n.jsxs(e.li,{children:["Page A hide → ",n.jsx(e.code,{children:"useDidHide"})," của Page A"]}),`
|
|
334
|
-
`,n.jsxs(e.li,{children:["Page B show → ",n.jsx(e.code,{children:"useDidShow"})," của Page B"]}),`
|
|
335
|
-
`]})]})}function g(i={}){const{wrapper:e}={...c(),...i.components};return e?n.jsx(e,{...i,children:n.jsx(s,{...i})}):s(i)}export{g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as j}from"./iframe-CQAwSt4E.js";var D,se;function R(){if(se)return D;se=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return D=r,D}var G,oe;function Ht(){if(oe)return G;oe=1;var r=typeof j=="object"&&j&&j.Object===Object&&j;return G=r,G}var L,ce;function d(){if(ce)return L;ce=1;var r=Ht(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return L=t,L}var M,fe;function kt(){if(fe)return M;fe=1;var r=d(),e=r.Symbol;return M=e,M}var H,ve;function ta(){if(ve)return H;ve=1;var r=kt(),e=Object.prototype,t=e.hasOwnProperty,a=e.toString,n=r?r.toStringTag:void 0;function i(u){var s=t.call(u,n),o=u[n];try{u[n]=void 0;var c=!0}catch{}var v=a.call(u);return c&&(s?u[n]=o:delete u[n]),v}return H=i,H}var k,he;function aa(){if(he)return k;he=1;var r=Object.prototype,e=r.toString;function t(a){return e.call(a)}return k=t,k}var E,_e;function O(){if(_e)return E;_e=1;var r=kt(),e=ta(),t=aa(),a="[object Null]",n="[object Undefined]",i=r?r.toStringTag:void 0;function u(s){return s==null?s===void 0?n:a:i&&i in Object(s)?e(s):t(s)}return E=u,E}var U,le;function A(){if(le)return U;le=1;function r(e){return e!=null&&typeof e=="object"}return U=r,U}var F,pe;function na(){if(pe)return F;pe=1;function r(e,t){return function(a){return e(t(a))}}return F=r,F}var N,de;function Et(){if(de)return N;de=1;var r=na(),e=r(Object.getPrototypeOf,Object);return N=e,N}var K,ye;function nn(){if(ye)return K;ye=1;var r=O(),e=Et(),t=A(),a="[object Object]",n=Function.prototype,i=Object.prototype,u=n.toString,s=i.hasOwnProperty,o=u.call(Object);function c(v){if(!t(v)||r(v)!=a)return!1;var h=e(v);if(h===null)return!0;var _=s.call(h,"constructor")&&h.constructor;return typeof _=="function"&&_ instanceof _&&u.call(_)==o}return K=c,K}var B,be;function ia(){if(be)return B;be=1;function r(){this.__data__=[],this.size=0}return B=r,B}var z,ge;function Ut(){if(ge)return z;ge=1;function r(e,t){return e===t||e!==e&&t!==t}return z=r,z}var V,qe;function S(){if(qe)return V;qe=1;var r=Ut();function e(t,a){for(var n=t.length;n--;)if(r(t[n][0],a))return n;return-1}return V=e,V}var J,Ce;function ua(){if(Ce)return J;Ce=1;var r=S(),e=Array.prototype,t=e.splice;function a(n){var i=this.__data__,u=r(i,n);if(u<0)return!1;var s=i.length-1;return u==s?i.pop():t.call(i,u,1),--this.size,!0}return J=a,J}var X,Te;function sa(){if(Te)return X;Te=1;var r=S();function e(t){var a=this.__data__,n=r(a,t);return n<0?void 0:a[n][1]}return X=e,X}var W,je;function oa(){if(je)return W;je=1;var r=S();function e(t){return r(this.__data__,t)>-1}return W=e,W}var Y,Re;function ca(){if(Re)return Y;Re=1;var r=S();function e(t,a){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,a])):n[i][1]=a,this}return Y=e,Y}var Z,Oe;function I(){if(Oe)return Z;Oe=1;var r=ia(),e=ua(),t=sa(),a=oa(),n=ca();function i(u){var s=-1,o=u==null?0:u.length;for(this.clear();++s<o;){var c=u[s];this.set(c[0],c[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=a,i.prototype.set=n,Z=i,Z}var $,Ae;function fa(){if(Ae)return $;Ae=1;var r=I();function e(){this.__data__=new r,this.size=0}return $=e,$}var Q,Se;function va(){if(Se)return Q;Se=1;function r(e){var t=this.__data__,a=t.delete(e);return this.size=t.size,a}return Q=r,Q}var rr,Ie;function ha(){if(Ie)return rr;Ie=1;function r(e){return this.__data__.get(e)}return rr=r,rr}var er,me;function _a(){if(me)return er;me=1;function r(e){return this.__data__.has(e)}return er=r,er}var tr,Pe;function Ft(){if(Pe)return tr;Pe=1;var r=O(),e=R(),t="[object AsyncFunction]",a="[object Function]",n="[object GeneratorFunction]",i="[object Proxy]";function u(s){if(!e(s))return!1;var o=r(s);return o==a||o==n||o==t||o==i}return tr=u,tr}var ar,xe;function la(){if(xe)return ar;xe=1;var r=d(),e=r["__core-js_shared__"];return ar=e,ar}var nr,we;function pa(){if(we)return nr;we=1;var r=la(),e=(function(){var a=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function t(a){return!!e&&e in a}return nr=t,nr}var ir,De;function da(){if(De)return ir;De=1;var r=Function.prototype,e=r.toString;function t(a){if(a!=null){try{return e.call(a)}catch{}try{return a+""}catch{}}return""}return ir=t,ir}var ur,Ge;function ya(){if(Ge)return ur;Ge=1;var r=Ft(),e=pa(),t=R(),a=da(),n=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,u=Function.prototype,s=Object.prototype,o=u.toString,c=s.hasOwnProperty,v=RegExp("^"+o.call(c).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(_){if(!t(_)||e(_))return!1;var p=r(_)?v:i;return p.test(a(_))}return ur=h,ur}var sr,Le;function ba(){if(Le)return sr;Le=1;function r(e,t){return e?.[t]}return sr=r,sr}var or,Me;function ue(){if(Me)return or;Me=1;var r=ya(),e=ba();function t(a,n){var i=e(a,n);return r(i)?i:void 0}return or=t,or}var cr,He;function Nt(){if(He)return cr;He=1;var r=ue(),e=d(),t=r(e,"Map");return cr=t,cr}var fr,ke;function m(){if(ke)return fr;ke=1;var r=ue(),e=r(Object,"create");return fr=e,fr}var vr,Ee;function ga(){if(Ee)return vr;Ee=1;var r=m();function e(){this.__data__=r?r(null):{},this.size=0}return vr=e,vr}var hr,Ue;function qa(){if(Ue)return hr;Ue=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return hr=r,hr}var _r,Fe;function Ca(){if(Fe)return _r;Fe=1;var r=m(),e="__lodash_hash_undefined__",t=Object.prototype,a=t.hasOwnProperty;function n(i){var u=this.__data__;if(r){var s=u[i];return s===e?void 0:s}return a.call(u,i)?u[i]:void 0}return _r=n,_r}var lr,Ne;function Ta(){if(Ne)return lr;Ne=1;var r=m(),e=Object.prototype,t=e.hasOwnProperty;function a(n){var i=this.__data__;return r?i[n]!==void 0:t.call(i,n)}return lr=a,lr}var pr,Ke;function ja(){if(Ke)return pr;Ke=1;var r=m(),e="__lodash_hash_undefined__";function t(a,n){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=r&&n===void 0?e:n,this}return pr=t,pr}var dr,Be;function Ra(){if(Be)return dr;Be=1;var r=ga(),e=qa(),t=Ca(),a=Ta(),n=ja();function i(u){var s=-1,o=u==null?0:u.length;for(this.clear();++s<o;){var c=u[s];this.set(c[0],c[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=a,i.prototype.set=n,dr=i,dr}var yr,ze;function Oa(){if(ze)return yr;ze=1;var r=Ra(),e=I(),t=Nt();function a(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return yr=a,yr}var br,Ve;function Aa(){if(Ve)return br;Ve=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return br=r,br}var gr,Je;function P(){if(Je)return gr;Je=1;var r=Aa();function e(t,a){var n=t.__data__;return r(a)?n[typeof a=="string"?"string":"hash"]:n.map}return gr=e,gr}var qr,Xe;function Sa(){if(Xe)return qr;Xe=1;var r=P();function e(t){var a=r(this,t).delete(t);return this.size-=a?1:0,a}return qr=e,qr}var Cr,We;function Ia(){if(We)return Cr;We=1;var r=P();function e(t){return r(this,t).get(t)}return Cr=e,Cr}var Tr,Ye;function ma(){if(Ye)return Tr;Ye=1;var r=P();function e(t){return r(this,t).has(t)}return Tr=e,Tr}var jr,Ze;function Pa(){if(Ze)return jr;Ze=1;var r=P();function e(t,a){var n=r(this,t),i=n.size;return n.set(t,a),this.size+=n.size==i?0:1,this}return jr=e,jr}var Rr,$e;function xa(){if($e)return Rr;$e=1;var r=Oa(),e=Sa(),t=Ia(),a=ma(),n=Pa();function i(u){var s=-1,o=u==null?0:u.length;for(this.clear();++s<o;){var c=u[s];this.set(c[0],c[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=a,i.prototype.set=n,Rr=i,Rr}var Or,Qe;function wa(){if(Qe)return Or;Qe=1;var r=I(),e=Nt(),t=xa(),a=200;function n(i,u){var s=this.__data__;if(s instanceof r){var o=s.__data__;if(!e||o.length<a-1)return o.push([i,u]),this.size=++s.size,this;s=this.__data__=new t(o)}return s.set(i,u),this.size=s.size,this}return Or=n,Or}var Ar,rt;function un(){if(rt)return Ar;rt=1;var r=I(),e=fa(),t=va(),a=ha(),n=_a(),i=wa();function u(s){var o=this.__data__=new r(s);this.size=o.size}return u.prototype.clear=e,u.prototype.delete=t,u.prototype.get=a,u.prototype.has=n,u.prototype.set=i,Ar=u,Ar}var Sr,et;function Kt(){if(et)return Sr;et=1;var r=ue(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Sr=e,Sr}var Ir,tt;function Bt(){if(tt)return Ir;tt=1;var r=Kt();function e(t,a,n){a=="__proto__"&&r?r(t,a,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[a]=n}return Ir=e,Ir}var b={exports:{}};b.exports;var at;function sn(){return at||(at=1,(function(r,e){var t=d(),a=e&&!e.nodeType&&e,n=a&&!0&&r&&!r.nodeType&&r,i=n&&n.exports===a,u=i?t.Buffer:void 0,s=u?u.allocUnsafe:void 0;function o(c,v){if(v)return c.slice();var h=c.length,_=s?s(h):new c.constructor(h);return c.copy(_),_}r.exports=o})(b,b.exports)),b.exports}var mr,nt;function Da(){if(nt)return mr;nt=1;var r=d(),e=r.Uint8Array;return mr=e,mr}var Pr,it;function Ga(){if(it)return Pr;it=1;var r=Da();function e(t){var a=new t.constructor(t.byteLength);return new r(a).set(new r(t)),a}return Pr=e,Pr}var xr,ut;function on(){if(ut)return xr;ut=1;var r=Ga();function e(t,a){var n=a?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}return xr=e,xr}var wr,st;function cn(){if(st)return wr;st=1;function r(e,t){var a=-1,n=e.length;for(t||(t=Array(n));++a<n;)t[a]=e[a];return t}return wr=r,wr}var Dr,ot;function La(){if(ot)return Dr;ot=1;var r=R(),e=Object.create,t=(function(){function a(){}return function(n){if(!r(n))return{};if(e)return e(n);a.prototype=n;var i=new a;return a.prototype=void 0,i}})();return Dr=t,Dr}var Gr,ct;function zt(){if(ct)return Gr;ct=1;var r=Object.prototype;function e(t){var a=t&&t.constructor,n=typeof a=="function"&&a.prototype||r;return t===n}return Gr=e,Gr}var Lr,ft;function fn(){if(ft)return Lr;ft=1;var r=La(),e=Et(),t=zt();function a(n){return typeof n.constructor=="function"&&!t(n)?r(e(n)):{}}return Lr=a,Lr}var Mr,vt;function Ma(){if(vt)return Mr;vt=1;var r=O(),e=A(),t="[object Arguments]";function a(n){return e(n)&&r(n)==t}return Mr=a,Mr}var Hr,ht;function Ha(){if(ht)return Hr;ht=1;var r=Ma(),e=A(),t=Object.prototype,a=t.hasOwnProperty,n=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(u){return e(u)&&a.call(u,"callee")&&!n.call(u,"callee")};return Hr=i,Hr}var kr,_t;function ka(){if(_t)return kr;_t=1;var r=Array.isArray;return kr=r,kr}var Er,lt;function Vt(){if(lt)return Er;lt=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Er=e,Er}var Ur,pt;function Ea(){if(pt)return Ur;pt=1;var r=Ft(),e=Vt();function t(a){return a!=null&&e(a.length)&&!r(a)}return Ur=t,Ur}var g={exports:{}},Fr,dt;function Ua(){if(dt)return Fr;dt=1;function r(){return!1}return Fr=r,Fr}g.exports;var yt;function Fa(){return yt||(yt=1,(function(r,e){var t=d(),a=Ua(),n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,u=i&&i.exports===n,s=u?t.Buffer:void 0,o=s?s.isBuffer:void 0,c=o||a;r.exports=c})(g,g.exports)),g.exports}var Nr,bt;function Na(){if(bt)return Nr;bt=1;var r=O(),e=Vt(),t=A(),a="[object Arguments]",n="[object Array]",i="[object Boolean]",u="[object Date]",s="[object Error]",o="[object Function]",c="[object Map]",v="[object Number]",h="[object Object]",_="[object RegExp]",p="[object Set]",C="[object String]",T="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",l="[object Float32Array]",Jt="[object Float64Array]",Xt="[object Int8Array]",Wt="[object Int16Array]",Yt="[object Int32Array]",Zt="[object Uint8Array]",$t="[object Uint8ClampedArray]",Qt="[object Uint16Array]",ra="[object Uint32Array]",f={};f[l]=f[Jt]=f[Xt]=f[Wt]=f[Yt]=f[Zt]=f[$t]=f[Qt]=f[ra]=!0,f[a]=f[n]=f[y]=f[i]=f[x]=f[u]=f[s]=f[o]=f[c]=f[v]=f[h]=f[_]=f[p]=f[C]=f[T]=!1;function ea(w){return t(w)&&e(w.length)&&!!f[r(w)]}return Nr=ea,Nr}var Kr,gt;function Ka(){if(gt)return Kr;gt=1;function r(e){return function(t){return e(t)}}return Kr=r,Kr}var q={exports:{}};q.exports;var qt;function Ba(){return qt||(qt=1,(function(r,e){var t=Ht(),a=e&&!e.nodeType&&e,n=a&&!0&&r&&!r.nodeType&&r,i=n&&n.exports===a,u=i&&t.process,s=(function(){try{var o=n&&n.require&&n.require("util").types;return o||u&&u.binding&&u.binding("util")}catch{}})();r.exports=s})(q,q.exports)),q.exports}var Br,Ct;function za(){if(Ct)return Br;Ct=1;var r=Na(),e=Ka(),t=Ba(),a=t&&t.isTypedArray,n=a?e(a):r;return Br=n,Br}var zr,Tt;function Va(){if(Tt)return zr;Tt=1;var r=Bt(),e=Ut(),t=Object.prototype,a=t.hasOwnProperty;function n(i,u,s){var o=i[u];(!(a.call(i,u)&&e(o,s))||s===void 0&&!(u in i))&&r(i,u,s)}return zr=n,zr}var Vr,jt;function vn(){if(jt)return Vr;jt=1;var r=Va(),e=Bt();function t(a,n,i,u){var s=!i;i||(i={});for(var o=-1,c=n.length;++o<c;){var v=n[o],h=u?u(i[v],a[v],v,i,a):void 0;h===void 0&&(h=a[v]),s?e(i,v,h):r(i,v,h)}return i}return Vr=t,Vr}var Jr,Rt;function Ja(){if(Rt)return Jr;Rt=1;function r(e,t){for(var a=-1,n=Array(e);++a<e;)n[a]=t(a);return n}return Jr=r,Jr}var Xr,Ot;function Xa(){if(Ot)return Xr;Ot=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(a,n){var i=typeof a;return n=n??r,!!n&&(i=="number"||i!="symbol"&&e.test(a))&&a>-1&&a%1==0&&a<n}return Xr=t,Xr}var Wr,At;function Wa(){if(At)return Wr;At=1;var r=Ja(),e=Ha(),t=ka(),a=Fa(),n=Xa(),i=za(),u=Object.prototype,s=u.hasOwnProperty;function o(c,v){var h=t(c),_=!h&&e(c),p=!h&&!_&&a(c),C=!h&&!_&&!p&&i(c),T=h||_||p||C,y=T?r(c.length,String):[],x=y.length;for(var l in c)(v||s.call(c,l))&&!(T&&(l=="length"||p&&(l=="offset"||l=="parent")||C&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||n(l,x)))&&y.push(l);return y}return Wr=o,Wr}var Yr,St;function Ya(){if(St)return Yr;St=1;function r(e){var t=[];if(e!=null)for(var a in Object(e))t.push(a);return t}return Yr=r,Yr}var Zr,It;function Za(){if(It)return Zr;It=1;var r=R(),e=zt(),t=Ya(),a=Object.prototype,n=a.hasOwnProperty;function i(u){if(!r(u))return t(u);var s=e(u),o=[];for(var c in u)c=="constructor"&&(s||!n.call(u,c))||o.push(c);return o}return Zr=i,Zr}var $r,mt;function hn(){if(mt)return $r;mt=1;var r=Wa(),e=Za(),t=Ea();function a(n){return t(n)?r(n,!0):e(n)}return $r=a,$r}var Qr,Pt;function $a(){if(Pt)return Qr;Pt=1;function r(e){return e}return Qr=r,Qr}var re,xt;function Qa(){if(xt)return re;xt=1;function r(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}return re=r,re}var ee,wt;function _n(){if(wt)return ee;wt=1;var r=Qa(),e=Math.max;function t(a,n,i){return n=e(n===void 0?a.length-1:n,0),function(){for(var u=arguments,s=-1,o=e(u.length-n,0),c=Array(o);++s<o;)c[s]=u[n+s];s=-1;for(var v=Array(n+1);++s<n;)v[s]=u[s];return v[n]=i(c),r(a,this,v)}}return ee=t,ee}var te,Dt;function rn(){if(Dt)return te;Dt=1;function r(e){return function(){return e}}return te=r,te}var ae,Gt;function en(){if(Gt)return ae;Gt=1;var r=rn(),e=Kt(),t=$a(),a=e?function(n,i){return e(n,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return ae=a,ae}var ne,Lt;function tn(){if(Lt)return ne;Lt=1;var r=800,e=16,t=Date.now;function a(n){var i=0,u=0;return function(){var s=t(),o=e-(s-u);if(u=s,o>0){if(++i>=r)return arguments[0]}else i=0;return n.apply(void 0,arguments)}}return ne=a,ne}var ie,Mt;function ln(){if(Mt)return ie;Mt=1;var r=en(),e=tn(),t=e(r);return ie=t,ie}export{zt as A,Wa as B,Et as C,ue as D,d as E,Nt as F,da as G,Ga as H,kt as I,Ba as J,Ka as K,xa as L,R as a,Xa as b,Ha as c,ka as d,Vt as e,Bt as f,Ut as g,Ea as h,A as i,vn as j,hn as k,sn as l,on as m,cn as n,fn as o,Fa as p,Ft as q,Va as r,nn as s,za as t,un as u,$a as v,_n as w,ln as x,O as y,na as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./iframe-CQAwSt4E.js";import{I as a}from"./icon-DdQsMyRa.js";import{c as p,g as d}from"./classname-CUR_zgkh.js";import{T as t}from"./typography-DEpAJl_i.js";const s=d("alert"),f=({type:i="informative",title:r,message:l,closeable:c,action:o,className:n,...m})=>e.jsxs("div",{className:p(s,`${s}--${i}`,n),...m,children:[e.jsxs("div",{className:`${s}__icon`,children:[i==="informative"&&e.jsx(a,{name:"circle-info",type:"fill",size:20,color:"alias-object-secondary"}),i==="positive"&&e.jsx(a,{name:"circle-check",type:"fill",size:20,color:"alias-support-positive"}),i==="negative"&&e.jsx(a,{name:"triangle-warning",type:"fill",size:20,color:"alias-support-negative"})]}),e.jsxs("div",{className:`${s}__content`,children:[!!r&&e.jsx(t,{size:"small",weight:"bold",color:{informative:"alias-object-primary",positive:"alias-support-positive",negative:"alias-support-negative"}[i],children:r}),!!l&&e.jsx(t,{size:"small",children:l})]}),!!o&&e.jsx("div",{className:`${s}__action`,children:o}),c&&e.jsx("div",{className:`${s}__close`,children:e.jsx(a,{name:"xmark",size:20})})]});f.__docgenInfo={description:"",methods:[],displayName:"Alert",props:{type:{defaultValue:{value:"'informative'",computed:!1},required:!1}}};export{f as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as b,j as o}from"./iframe-CQAwSt4E.js";import{c as x,g as h}from"./classname-CUR_zgkh.js";import{T as v}from"./typography-DEpAJl_i.js";import{I as $}from"./image-C3EsNRhz.js";const r=h("avatar"),y=({size:e=40,shape:a="rounded",border:l,label:d,labelColor:c,labelSize:S,color:j,style:u,className:z,src:s,srcSet:m,...p})=>{const[g,n]=b.useState(!1),f=I(e),i=!g&&(!!s||!!m);return b.useEffect(()=>{n(!1)},[s,m]),o.jsxs("div",{className:x(r,`${r}--${a}`,{[`${r}--show-image`]:i},z),style:{...u,width:e,height:e},children:[!!l&&o.jsx("div",{className:`${r}__border ${r}__border--${f.borderSize} ${r}--${a}`}),i&&o.jsx($,{...p,onError:()=>n(!0),width:e,height:e,src:s}),!!d&&!i&&o.jsx(v,{size:S||f.labelSize,color:c||"global-dynamic-red-dynamic-red-60",weight:600,children:d})]})},t=[[112,{labelSize:"4x-large",borderSize:2}],[80,{labelSize:"2x-large",borderSize:2}],[56,{labelSize:"large",borderSize:2}],[48,{labelSize:"base",borderSize:1}],[40,{labelSize:"small",borderSize:1}],[32,{labelSize:"x-small",borderSize:1}],[24,{labelSize:"2x-small",borderSize:1}],[0,{labelSize:"3x-small",borderSize:1}]],I=e=>{for(const[a,l]of t)if(e>=a)return l;return t[t.length-1][1]};y.__docgenInfo={description:"",methods:[],displayName:"Avatar",props:{size:{defaultValue:{value:"40",computed:!1},required:!1},shape:{defaultValue:{value:"'rounded'",computed:!1},required:!1}}};export{y as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./iframe-CQAwSt4E.js";import{c as r,g as i}from"./classname-CUR_zgkh.js";import{T as m}from"./typography-DEpAJl_i.js";const a=i("badge"),d=({outline:e,children:s,className:o,...n})=>t.jsx(m,{...n,size:"2x-small",className:r(a,{[`${a}--outline`]:e,[`${a}--dot`]:!s},o),children:s}),p=({children:e,className:s,...o})=>t.jsx("div",{className:r(`${a}-container`,s),...o,children:e});d.__docgenInfo={description:"",methods:[],displayName:"Badge"};p.__docgenInfo={description:"",methods:[],displayName:"BadgeContainer"};export{d as B,p as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./iframe-CQAwSt4E.js";import{r as N}from"./icon-DdQsMyRa.js";import{c as f,g as b}from"./classname-CUR_zgkh.js";import{T as j}from"./typography-DEpAJl_i.js";const v={medium:"small",large:"base"},e=b("button"),g=({shape:p="rounded",size:m="medium",type:c="solid",theme:a="default",disabled:i,loading:s,children:r,className:$,leadingIcon:o,trailingIcon:l,htmlType:_,block:x,...d})=>{a=a==="default"?"brand":a;const n=(t,y)=>t?u.jsx("span",{className:f(`${e}__icon`,y),children:N(t)}):null;return u.jsxs("button",{...d,onClick:t=>{i||s||d.onClick?.(t)},disabled:i,type:_,className:f(e,{[`${e}--${p}`]:!0,[`${e}--${m}`]:!0,[`${e}--${c}`]:!0,[`${e}--block`]:x,[`${e}--theme-${a}`]:!0,[`${e}--icon-only`]:!r&&(o&&!l||!o&&l),[`${e}--loading`]:s},$),children:[u.jsx("span",{className:`${e}__overlay`}),!!s&&n({name:"loader",animation:"spin"},`${e}__icon--loading`),!s&&n(o,`${e}__icon--leading`),!!r&&u.jsx(j,{size:v[m],weight:"medium",children:r}),n(l,`${e}__icon--trailing`)]})};g.__docgenInfo={description:"",methods:[],displayName:"Button",props:{shape:{defaultValue:{value:"'rounded'",computed:!1},required:!1},size:{defaultValue:{value:"'medium'",computed:!1},required:!1},type:{defaultValue:{value:"'solid'",computed:!1},required:!1},theme:{defaultValue:{value:"'default'",computed:!1},required:!1}}};export{g as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as b,j as e}from"./iframe-CQAwSt4E.js";import{c as i,g as ye}from"./classname-CUR_zgkh.js";import{d as w}from"./date-Cg-Uk_pp.js";import{I as E}from"./icon-DdQsMyRa.js";import{B as A}from"./button-CL7GeC23.js";import{T as m}from"./typography-DEpAJl_i.js";import{u as ge}from"./index-BV0AJWP6.js";import{u as ee}from"./store-CPumdfcU.js";class we{getNumDaysInMonth(t,o){return new Date(o,t+1,0).getDate()}isSame(t,o){return w(t).isSame(w(o),"day")}isBefore(t,o){return w(t).isBefore(w(o),"day")}isAfter(t,o){return w(t).isAfter(w(o),"day")}isSameOrBefore(t,o){return w(t).isSameOrBefore(w(o),"day")}isSameOrAfter(t,o){return w(t).isSameOrAfter(w(o),"day")}}const x=new we,ce=(n,t,o)=>{const y=ee.getState().translate;return y(n,t,o)};function Ce(){const n=ee(y=>y.language),t=ee(y=>y.systemLanguage),o=ee(y=>y.setLanguage);return{language:n,systemLanguage:t,setLanguage:o}}const Se=n=>({date:t=>t.getDate(),headerLabel:(t,o)=>ce("calendar.headerLabel",{month:ce(`calendar.monthLabel[${t}]`,void 0,n),year:o},n),weekday:t=>ce(`calendar.weekdayLabel[${t}]`,void 0,n)}),xe=(n,t)=>({...t,...Se(n==="en"?"en":"vi")}),be=ye("calendar"),l=be+"-single-picker",pe=new Date(1900,0,1),ze=new Date(2099,11,31),Ie=n=>{const t={};return n.defaultValue!==void 0&&(t.defaultValue=n.defaultValue),n.value!==void 0&&(t.value=n.value),n.onChange!==void 0&&(t.onChange=n.onChange),t},$e=n=>{const{className:t,renderText:o,lang:y,navigationMode:C="month-year",defaultValue:Me,onChange:De,value:S,minDate:F=pe,maxDate:V=ze,...U}=n,[z,W]=ge(Ie(n)),te=xe(y,o),{date:N,dateSubText:h,headerLabel:$,weekday:R}=te,T=new Date,[d,I]=b.useState(()=>z?z.getMonth():T.getMonth()),[c,p]=b.useState(()=>z?z.getFullYear():T.getFullYear()),Y=(new Date(c,d,1).getDay()+6)%7,f=x.getNumDaysInMonth(d,c),K=Y+f,u=Math.ceil(K/7),L=V.getMonth(),M=V.getFullYear(),q=F.getMonth(),G=F.getFullYear(),Q=c<M||c===M&&d<L,H=c>G||c===G&&d>q,O=c<M||c+1===M&&d<=L,X=c>G||c-1===G&&d>=q,v=b.useMemo(()=>{if(!H)return null;let g=c,s=d-1;return s<0&&(g--,s=11),{month:s,year:g}},[d,H,c]),D=b.useMemo(()=>{if(!Q)return null;let g=c,s=d+1;return s>11&&(g++,s=0),{month:s,year:g}},[d,Q,c]),J=b.useMemo(()=>v?x.getNumDaysInMonth(v.month,v.year):null,[v]),ne=b.useMemo(()=>D?x.getNumDaysInMonth(D.month,D.year):null,[D]),ae=g=>{const s=new Date(c,d,g);return x.isSameOrAfter(s,F)&&x.isSameOrBefore(s,V)};return e.jsxs("div",{className:i(be,l,t),...U,children:[e.jsxs("div",{className:`${l}__header`,children:[C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!X,onClick:()=>{X&&p(c-1)},children:e.jsx(E,{size:20,name:"double-chevron-left"})}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!H,onClick:()=>{v&&(I(v.month),p(v.year))},children:e.jsx(E,{size:20,name:"chevron-left"})}),e.jsx(m,{className:`${l}__header-label`,children:typeof $=="function"?$?.(d,c):$}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!Q,onClick:()=>{D&&(I(D.month),p(D.year))},children:e.jsx(E,{size:20,name:"chevron-right"})}),C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!O,onClick:()=>{O&&p(c+1)},children:e.jsx(E,{size:20,name:"double-chevron-right"})})]}),e.jsx("div",{children:e.jsxs("div",{className:`${l}__grid`,children:[Array.from({length:7},(g,s)=>{const B=(s+1)%7;return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsx("div",{className:i(`${l}__cell`,`${l}__cell-week`),children:e.jsx(m,{color:"alias-object-secondary",children:typeof R=="function"?R(B):R})})})}),Array.from({length:u*7},(g,s)=>{if(s<Y){if(!J)return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:"null"})},s);const j=J-Y+s+1,r=new Date(c,d,j);return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:[typeof N=="function"?N(r):N,e.jsx(m,{size:"2x-small",className:`${l}__cell-day-sub-title`,children:typeof h=="function"?h(r):h})]})},s)}if(s>=Y+f){if(!ne)return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:"null"})},s);const j=s-(Y+f)+1,r=new Date(c,d,j);return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${l}__cell`,`${l}__cell-day`,`${l}__cell-day-filler`),children:[typeof N=="function"?N(r):N,e.jsx(m,{size:"2x-small",className:`${l}__cell-day-sub-title`,children:typeof h=="function"?h(r):h})]})},s)}const B=s-Y+1,P=new Date(c,d,B),le=!ae(B);return e.jsx("div",{className:i(`${l}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",onClick:()=>{!P||le||W(P)},className:i(`${l}__cell`,`${l}__cell-day`,{[`${l}__cell-day--disabled`]:le,[`${l}__cell-day--today`]:x.isSame(P,T),[`${l}__cell-day--selected`]:z&&x.isSame(P,z)}),children:[typeof N=="function"?N(P):N,e.jsx(m,{size:"2x-small",className:`${l}__cell-day-sub-title`,children:typeof h=="function"?h(P):h})]})},s)})]})})]})};$e.__docgenInfo={description:"",methods:[],displayName:"SinglePicker"};const je=ye("calendar"),a=je+"-range-picker",Ye=new Date(1900,0,1),Le=new Date(2099,11,31),Pe=n=>{const t={};return(n.defaultValue!==void 0||n.defaultValue===null)&&(t.defaultValue=n.defaultValue),(n.value!==void 0||n.value===null)&&(t.value=n.value),n.onChange!==void 0&&(t.onChange=n.onChange),t},me=n=>{const t=new Date;if(n){const[o,y]=n;return o?o.getMonth():y?y.getMonth():t.getMonth()}return t.getMonth()},he=n=>{const t=new Date;if(n){const[o,y]=n;return o?o.getFullYear():y?y.getFullYear():t.getFullYear()}return t.getFullYear()},fe=n=>{if(!n)return null;const[t]=n;return t},_e=n=>{if(!n)return null;const[,t]=n;return t},ve=n=>{const{className:t,renderText:o,lang:y,navigationMode:C="month-year",defaultValue:Me,onChange:De,value:S,minDate:F=Ye,maxDate:V=Le,onPick:U,...z}=n,[W,te]=ge(Pe(n)),N=xe(y,o),{date:h,dateSubText:$,headerLabel:R,weekday:T}=N,[d,I]=b.useState(fe(W)),[c,p]=b.useState(_e(W)),Y=new Date,[f,K]=b.useState(me(W)),[u,L]=b.useState(he(W)),M=(new Date(u,f,1).getDay()+6)%7,q=x.getNumDaysInMonth(f,u),G=M+q,Q=Math.ceil(G/7),H=V.getMonth(),O=V.getFullYear(),X=F.getMonth(),v=F.getFullYear(),D=u<O||u===O&&f<H,J=u>v||u===v&&f>X,ne=u<O||u+1===O&&f<=H,ae=u>v||u-1===v&&f>=X,g=b.useMemo(()=>{if(!J)return null;let j=u,r=f-1;return r<0&&(j--,r=11),{month:r,year:j}},[f,J,u]),s=b.useMemo(()=>{if(!D)return null;let j=u,r=f+1;return r>11&&(j++,r=0),{month:r,year:j}},[f,D,u]),B=b.useMemo(()=>g?x.getNumDaysInMonth(g.month,g.year):null,[g]),P=b.useMemo(()=>s?x.getNumDaysInMonth(s.month,s.year):null,[s]),le=j=>{const r=new Date(u,f,j);return x.isSameOrAfter(r,F)&&x.isSameOrBefore(r,V)};return b.useEffect(()=>{S!=null&&(K(me(S)),L(he(S)))},[S?.[0]?.getTime()]),b.useEffect(()=>{S!=null&&(I(fe(S)),p(_e(S)))},[S]),e.jsxs("div",{className:i(je,a,t),...z,children:[e.jsxs("div",{className:`${a}__header`,children:[C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!ae,onClick:()=>{ae&&L(u-1)},children:e.jsx(E,{size:20,name:"double-chevron-left"})}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!J,onClick:()=>{g&&(K(g.month),L(g.year))},children:e.jsx(E,{size:20,name:"chevron-left"})}),e.jsx(m,{className:`${a}__header-label`,children:typeof R=="function"?R?.(f,u):R}),C!=="time-only"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!D,onClick:()=>{s&&(K(s.month),L(s.year))},children:e.jsx(E,{size:20,name:"chevron-right"})}),C==="month-year"&&e.jsx(A,{type:"ghost",theme:"neutral",disabled:!ne,onClick:()=>{ne&&L(u+1)},children:e.jsx(E,{size:20,name:"double-chevron-right"})})]}),e.jsx("div",{children:e.jsxs("div",{className:`${a}__grid`,children:[Array.from({length:7},(j,r)=>{const se=(r+1)%7;return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsx("div",{className:i(`${a}__cell`,`${a}__cell-week`),children:e.jsx(m,{color:"alias-object-secondary",children:typeof T=="function"?T(se):T})})})}),Array.from({length:Q*7},(j,r)=>{if(r<M){if(!B)return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:"null"})},r);const k=B-M+r+1,Z=new Date(u,f,k);return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:[typeof h=="function"?h(Z):h,e.jsx(m,{size:"2x-small",className:`${a}__cell-day-sub-title`,children:typeof $=="function"?$(Z):$})]})},r)}if(r>=M+q){if(!P)return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsx(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:"null"})},r);const k=r-(M+q)+1,Z=new Date(u,f,k);return e.jsx("div",{className:i(`${a}__cell-container`),children:e.jsxs(m,{size:"base",role:"button",className:i(`${a}__cell`,`${a}__cell-day`,`${a}__cell-day-filler`),children:[typeof h=="function"?h(Z):h,e.jsx(m,{size:"2x-small",className:`${a}__cell-day-sub-title`,children:typeof $=="function"?$(Z):$})]})},r)}const se=r%7===6,ke=r%7===0,ie=r-M+1,_=new Date(u,f,ie),de=!le(ie),re=d&&x.isSame(_,d),oe=c&&x.isSame(_,c),ue=(function(){return d&&c?x.isSameOrAfter(_,d)&&x.isSameOrBefore(_,c):!1})();return e.jsxs("div",{className:i(`${a}__cell-container`),children:[ue&&e.jsx("div",{className:i(`${a}__cell-range-background`,{[`${a}__cell-range-background-start`]:re,[`${a}__cell-range-background-end`]:oe,[`${a}__cell-range-background-start-end-row`]:re&&se,[`${a}__cell-range-background-end-start-row`]:oe&&ke})}),e.jsxs(m,{size:"base",role:"button",onClick:()=>{if(de)return;if(d&&c){I(_),p(null),U?.([_,null]);return}if(!d&&!c){I(_),U?.([_,null]);return}const k=d||c;if(_<k){I(_),p(k),te?.([_,k]),U?.([_,k]);return}I(k),p(_),te?.([k,_]),U?.([k,_])},className:i(`${a}__cell`,`${a}__cell-day`,{[`${a}__cell-day--disabled`]:de,[`${a}__cell-day--today`]:x.isSame(_,Y),[`${a}__cell-day--in-range-picker`]:ue,[`${a}__cell-day--selected`]:re||oe}),children:[typeof h=="function"?h(_):h,e.jsx(m,{size:"2x-small",className:`${a}__cell-day-sub-title`,children:typeof $=="function"?$(_):$})]})]},r)})]})})]})};ve.__docgenInfo={description:"",methods:[],displayName:"RangePicker"};const Ee=()=>ee(t=>t.initialized),Ne=({type:n="single",...t})=>n==="single"?e.jsx($e,{...t}):e.jsx(ve,{...t}),Ae=({lang:n,...t})=>{const{language:o}=Ce();return e.jsx(Ne,{lang:n||o,...t})},Fe=n=>Ee()?e.jsx(Ne,{...n}):e.jsx(Ae,{...n});Fe.__docgenInfo={description:"",methods:[],displayName:"Calendar"};export{Fe as C};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{r as u,j as I}from"./iframe-CQAwSt4E.js";import{c as R,g as z}from"./classname-CUR_zgkh.js";import{u as B}from"./embla-carousel-react.esm-BYjpaHZ9.js";import{P as G}from"./pagination-DZHoBs_4.js";const J={active:!0,breakpoints:{},delay:4e3,jump:!1,playOnInit:!0,stopOnFocusIn:!0,stopOnInteraction:!0,stopOnMouseEnter:!1,stopOnLastSnap:!1,rootNode:null};function K(a,e){const n=a.scrollSnapList();return typeof e=="number"?n.map(()=>e):e(n,a)}function Q(a,e){const n=a.rootNode();return e&&e(n)||n}function H(a={}){let e,n,s,f,p=null,l=0,o=!1,g=!1,t=!1,i=!1;function y(r,x){n=r;const{mergeOptions:q,optionsAtMedia:D}=x,U=q(J,H.globalOptions),$=q(U,a);if(e=D($),n.scrollSnapList().length<=1)return;i=e.jump,s=!1,f=K(n,e.delay);const{eventStore:C,ownerDocument:W}=n.internalEngine(),_=!!n.internalEngine().options.watchDrag,L=Q(n,e.rootNode);C.add(W,"visibilitychange",j),_&&n.on("pointerDown",w),_&&!e.stopOnInteraction&&n.on("pointerUp",S),e.stopOnMouseEnter&&C.add(L,"mouseenter",E),e.stopOnMouseEnter&&!e.stopOnInteraction&&C.add(L,"mouseleave",T),e.stopOnFocusIn&&n.on("slideFocusStart",d),e.stopOnFocusIn&&!e.stopOnInteraction&&C.add(n.containerNode(),"focusout",m),e.playOnInit&&m()}function c(){n.off("pointerDown",w).off("pointerUp",S).off("slideFocusStart",d),d(),s=!0,o=!1}function O(){const{ownerWindow:r}=n.internalEngine();r.clearTimeout(l),l=r.setTimeout(F,f[n.selectedScrollSnap()]),p=new Date().getTime(),n.emit("autoplay:timerset")}function h(){const{ownerWindow:r}=n.internalEngine();r.clearTimeout(l),l=0,p=null,n.emit("autoplay:timerstopped")}function m(){if(!s){if(k()){t=!0;return}o||n.emit("autoplay:play"),O(),o=!0}}function d(){s||(o&&n.emit("autoplay:stop"),h(),o=!1)}function j(){if(k())return t=o,d();t&&m()}function k(){const{ownerDocument:r}=n.internalEngine();return r.visibilityState==="hidden"}function w(){g||d()}function S(){g||m()}function E(){g=!0,d()}function T(){g=!1,m()}function A(r){typeof r<"u"&&(i=r),m()}function b(){o&&d()}function v(){o&&m()}function P(){return o}function F(){const{index:r}=n.internalEngine(),x=r.clone().add(1).get(),q=n.scrollSnapList().length-1,D=e.stopOnLastSnap&&x===q;if(n.canScrollNext()?n.scrollNext(i):n.scrollTo(0,i),n.emit("autoplay:select"),D)return d();m()}function M(){if(!p)return null;const r=f[n.selectedScrollSnap()],x=new Date().getTime()-p;return r-x}return{name:"autoplay",options:a,init:y,destroy:c,play:A,stop:b,reset:v,isPlaying:P,timeUntilNext:M}}H.globalOptions=void 0;function V(a={}){let e,n=[];const s=["select","slideFocus"];function f(t){e=t;const{options:{axis:i},slideRects:y}=e.internalEngine();i!=="y"&&(n=y.map(c=>c.height),s.forEach(c=>e.on(c,o)),o())}function p(){s.forEach(i=>e.off(i,o));const t=e.containerNode();t.style.height="",t.getAttribute("style")||t.removeAttribute("style")}function l(){const{slideRegistry:t}=e.internalEngine(),i=t[e.selectedScrollSnap()];return i?i.map(y=>n[y]).reduce((y,c)=>Math.max(y,c),0):null}function o(){l()!==null&&(e.containerNode().style.height=`${l()}px`)}return{name:"autoHeight",options:a,init:f,destroy:p}}V.globalOptions=void 0;const X=(a={})=>{const{align:e="center",initialIndex:n=0,autoplay:s=!1,delay:f=3e3,duration:p=25,loop:l,autoHeight:o=!0}=a;console.log(e);const[g,t]=B({axis:"x",align:e,startIndex:n,duration:p,loop:l},[H({playOnInit:!0,delay:f,active:s}),V({active:o})]),i=t?.scrollNext,y=u.useCallback(v=>i?.(v.jump),[i]),c=t?.scrollPrev,O=u.useCallback(v=>c?.(v.jump),[c]),h=t?.scrollTo,m=u.useCallback((v,P)=>h?.(v,P.jump),[h]),[d,j]=u.useState(!1),[k,w]=u.useState(!1),[S,E]=u.useState(0),[T,A]=u.useState([]),b=u.useCallback(()=>{t&&(w(!!t?.canScrollPrev()),j(!!t?.canScrollNext()),A(t.scrollSnapList()),E(t.selectedScrollSnap()))},[t]);return u.useEffect(()=>{t&&(b(),t.on("reInit",b).on("select",b))},[t,b]),{ref:g,next:y,prev:O,toSlide:m,activeIndex:S,canNext:d,canPrev:k,snaps:T,options:a}},N=z("carousel"),Y=u.forwardRef(({className:a,carousel:e,options:n,pagination:s=!0,children:f},p)=>{const l=X(n);return e=e||l,u.useImperativeHandle(p,()=>e),I.jsxs("div",{className:R(N,a),style:{"--carousel-gap":typeof e.options.gap=="number"?e.options.gap+"px":"8px"},children:[I.jsx("div",{className:`${N}__viewport`,ref:e.ref,children:I.jsx("div",{className:`${N}__tracks`,children:f})}),!!s&&I.jsx(G,{total:e.snaps.length,activeIndex:e.activeIndex})]})}),Z=({children:a,className:e,...n})=>I.jsx("div",{className:R(`${N}__item`,e),...n,children:a});Y.__docgenInfo={description:"",methods:[],displayName:"Carousel",props:{className:{required:!1,tsType:{name:"string"},description:""},children:{required:!0,tsType:{name:"ReactNode"},description:""},carousel:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
2
|
-
ref: ICarouselViewPortRef
|
|
3
|
-
next: (options: ICarouselToOptions) => void
|
|
4
|
-
prev: (options: ICarouselToOptions) => void
|
|
5
|
-
toSlide: (index: number, options: ICarouselToOptions) => void
|
|
6
|
-
activeIndex: number
|
|
7
|
-
canNext: boolean
|
|
8
|
-
canPrev: boolean
|
|
9
|
-
snaps: number[]
|
|
10
|
-
options: ICarouselOptions
|
|
11
|
-
}`,signature:{properties:[{key:"ref",value:{name:"signature",type:"function",raw:`<ViewportElement extends HTMLElement>(
|
|
12
|
-
instance: ViewportElement | null,
|
|
13
|
-
) => void`,signature:{arguments:[{type:{name:"union",raw:"ViewportElement | null",elements:[{name:"ViewportElement"},{name:"null"}]},name:"instance"}],return:{name:"void"}},required:!0}},{key:"next",value:{name:"signature",type:"function",raw:"(options: ICarouselToOptions) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:`{
|
|
14
|
-
jump?: boolean
|
|
15
|
-
}`,signature:{properties:[{key:"jump",value:{name:"boolean",required:!1}}]}},name:"options"}],return:{name:"void"}},required:!0}},{key:"prev",value:{name:"signature",type:"function",raw:"(options: ICarouselToOptions) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:`{
|
|
16
|
-
jump?: boolean
|
|
17
|
-
}`,signature:{properties:[{key:"jump",value:{name:"boolean",required:!1}}]}},name:"options"}],return:{name:"void"}},required:!0}},{key:"toSlide",value:{name:"signature",type:"function",raw:"(index: number, options: ICarouselToOptions) => void",signature:{arguments:[{type:{name:"number"},name:"index"},{type:{name:"signature",type:"object",raw:`{
|
|
18
|
-
jump?: boolean
|
|
19
|
-
}`,signature:{properties:[{key:"jump",value:{name:"boolean",required:!1}}]}},name:"options"}],return:{name:"void"}},required:!0}},{key:"activeIndex",value:{name:"number",required:!0}},{key:"canNext",value:{name:"boolean",required:!0}},{key:"canPrev",value:{name:"boolean",required:!0}},{key:"snaps",value:{name:"Array",elements:[{name:"number"}],raw:"number[]",required:!0}},{key:"options",value:{name:"signature",type:"object",raw:`{
|
|
20
|
-
align?: ICarouselAlign
|
|
21
|
-
initialIndex?: number
|
|
22
|
-
loop?: boolean
|
|
23
|
-
duration?: number
|
|
24
|
-
autoplay?: boolean
|
|
25
|
-
delay?: number
|
|
26
|
-
autoHeight?: boolean
|
|
27
|
-
gap?: number
|
|
28
|
-
}`,signature:{properties:[{key:"align",value:{name:"union",raw:"'start' | 'center' | 'end'",elements:[{name:"literal",value:"'start'"},{name:"literal",value:"'center'"},{name:"literal",value:"'end'"}],required:!1}},{key:"initialIndex",value:{name:"number",required:!1}},{key:"loop",value:{name:"boolean",required:!1}},{key:"duration",value:{name:"number",required:!1}},{key:"autoplay",value:{name:"boolean",required:!1}},{key:"delay",value:{name:"number",required:!1}},{key:"autoHeight",value:{name:"boolean",required:!1}},{key:"gap",value:{name:"number",required:!1}}]},required:!0}}]}},description:""},options:{required:!1,tsType:{name:"signature",type:"object",raw:`{
|
|
29
|
-
align?: ICarouselAlign
|
|
30
|
-
initialIndex?: number
|
|
31
|
-
loop?: boolean
|
|
32
|
-
duration?: number
|
|
33
|
-
autoplay?: boolean
|
|
34
|
-
delay?: number
|
|
35
|
-
autoHeight?: boolean
|
|
36
|
-
gap?: number
|
|
37
|
-
}`,signature:{properties:[{key:"align",value:{name:"union",raw:"'start' | 'center' | 'end'",elements:[{name:"literal",value:"'start'"},{name:"literal",value:"'center'"},{name:"literal",value:"'end'"}],required:!1}},{key:"initialIndex",value:{name:"number",required:!1}},{key:"loop",value:{name:"boolean",required:!1}},{key:"duration",value:{name:"number",required:!1}},{key:"autoplay",value:{name:"boolean",required:!1}},{key:"delay",value:{name:"number",required:!1}},{key:"autoHeight",value:{name:"boolean",required:!1}},{key:"gap",value:{name:"number",required:!1}}]}},description:""},pagination:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}}}};Z.__docgenInfo={description:"",methods:[],displayName:"CarouselItem"};export{Y as C,Z as a,X as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,r as d}from"./iframe-CQAwSt4E.js";import{c as B,g as F}from"./classname-CUR_zgkh.js";import{u as p}from"./index-BV0AJWP6.js";import{T as b}from"./typography-DEpAJl_i.js";const g=({fill:n="white",...l})=>t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l,children:t.jsx("path",{d:"M5.11112 12.4445H5.10934C4.90756 12.4445 4.71645 12.352 4.59112 12.1947L1.03556 7.75026C0.805341 7.46226 0.851563 7.04359 1.13956 6.81337C1.42845 6.58315 1.84712 6.63026 2.07645 6.91737L5.11467 10.7147L12.1485 2.02492C12.3805 1.7387 12.7991 1.69337 13.0862 1.92626C13.3725 2.15826 13.4169 2.57781 13.1849 2.86403L5.62934 12.1974C5.50223 12.3538 5.31201 12.4445 5.11112 12.4445Z",fill:n})});g.__docgenInfo={description:"",methods:[],displayName:"CheckIcon",props:{fill:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'white'",computed:!1}}}};const x=({fill:n="white",...l})=>t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l,children:t.jsx("rect",{x:"2",y:"6.5",width:"11",height:"2",rx:"1",fill:n})});x.__docgenInfo={description:"",methods:[],displayName:"IndeterminateIcon",props:{fill:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'white'",computed:!1}}}};const a=F("checkbox"),S=d.forwardRef((n,l)=>{const{disabled:r=!1,theme:C="brand",variant:s="default",className:N,style:k,checked:V,defaultChecked:L,onChange:R,number:T,defaultNumber:q,onNumberChange:z,children:m,typography:_,...h}=n,v=C||"brand",u=d.useRef(null),[w,i]=d.useState(!1),[f,j]=p(n,{valuePropName:"checked",defaultValuePropName:"defaultChecked",trigger:"onChange"}),[o,y]=p(n,{valuePropName:"number",defaultValuePropName:"defaultNumber",trigger:"onNumberChange"}),c=o!==void 0?!0:f;d.useImperativeHandle(l,()=>({focus:()=>u.current?.focus?.(),blur:()=>u.current?.blur?.()}));const $=e=>{if(e.preventDefault(),r)return;const P=o===void 0?1:o+1;y(P)},I=()=>s==="number"?t.jsx("input",{...h,type:"text",inputMode:"numeric",value:o??"",disabled:r,readOnly:!0,ref:u,className:`${a}__input`,onClick:e=>e.stopPropagation(),onFocus:e=>{i(!0),n.onFocus?.(e)},onBlur:e=>{i(!1),n.onBlur?.(e)}}):t.jsx("input",{...h,type:"checkbox",checked:f,disabled:r,onChange:e=>j(e.target.checked),ref:u,className:`${a}__input`,onFocus:e=>{i(!0),n.onFocus?.(e)},onBlur:e=>{i(!1),n.onBlur?.(e)}});return t.jsxs("label",{className:B(a,{[`${a}--checked`]:c,[`${a}--unchecked`]:!c,[`${a}--disabled`]:r,[`${a}--focus`]:w,[`${a}--theme-${v}`]:!0,[`${a}--variant-${s}`]:s!=="default"},N),style:k,onClick:s==="number"?$:void 0,children:[t.jsxs("span",{className:`${a}__button`,children:[t.jsx("span",{className:`${a}__overlay`}),c&&s==="number"&&o!==void 0?t.jsx(b,{component:"span",size:"x-small",weight:700,color:r?"alias-border-disabled":"alias-object-on-brand",className:`${a}__number`,children:o}):c&&s==="indeterminate"?t.jsx(x,{fill:r?"var(--color-alias-border-disabled, rgba(10, 10, 10, 0.25))":"white"}):c?t.jsx(g,{fill:r?"var(--color-alias-border-disabled, rgba(10, 10, 10, 0.25))":"white"}):null,I()]}),m&&t.jsx(b,{component:"span",..._,size:"base",children:m})]})});S.__docgenInfo={description:"",methods:[{name:"focus",docblock:null,modifiers:[],params:[],returns:null},{name:"blur",docblock:null,modifiers:[],params:[],returns:null}],displayName:"Checkbox"};export{S as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as c}from"./iframe-CQAwSt4E.js";var o={exports:{}};var i;function p(){return i||(i=1,(function(n){(function(){var f={}.hasOwnProperty;function e(){for(var t="",r=0;r<arguments.length;r++){var s=arguments[r];s&&(t=a(t,u(s)))}return t}function u(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return e.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var s in t)f.call(t,s)&&t[s]&&(r=a(r,s));return r}function a(t,r){return r?t?t+" "+r:t+r:t}n.exports?(e.default=e,n.exports=e):window.classNames=e})()})(o)),o.exports}var l=p();const x=c(l),v=n=>`vsf-${n}`;export{x as c,v as g};
|