@v-miniapp/ui-react 1.0.40 → 1.0.45
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/README.md +1 -1
- package/dist/components/icon/icon-mapping.d.ts +4 -0
- package/dist/components/navigation-bar/navigation-bar.d.ts +3 -1
- package/dist/external/index.js +2009 -2012
- package/dist/external/styles.css +1 -1
- package/dist/index.js +1029 -1032
- package/dist/styles.css +1 -1
- package/dist-storybook/assets/ANIMATION-CUdn1GTK.js +99 -0
- package/dist-storybook/assets/APP_FRAMEWORK-ljbIOHYd.js +197 -0
- package/dist-storybook/assets/BOTTOM_TAB_BAR-DxCwCfBK.js +175 -0
- package/dist-storybook/assets/CUSTOM_ERROR_BOUNDARY-B4wTQNZc.js +250 -0
- package/dist-storybook/assets/Color-AVL7NMMY-1_8XTICv.js +1 -0
- package/dist-storybook/assets/DARK_MODE-CoHseCDO.js +57 -0
- package/dist-storybook/assets/DocsRenderer-PQXLIZUC-BO86igwd.js +2 -0
- package/dist-storybook/assets/GETTING_STARTED-H_vVi5cv.js +77 -0
- package/dist-storybook/assets/INFINITE_SCROLL-BtM3uoX0.js +111 -0
- package/dist-storybook/assets/KEEP_ALIVE-CL2au0al.js +126 -0
- package/dist-storybook/assets/LOCALE-XTCey55y.js +465 -0
- package/dist-storybook/assets/MIGRATION_GUIDE-2LONslE4.js +449 -0
- package/dist-storybook/assets/MOBILE_BEHAVIOURS-DZ6alKTX.js +177 -0
- package/dist-storybook/assets/PAGE_LAYOUT-BuOpN-1Y.js +192 -0
- package/dist-storybook/assets/ROUTING_NAVIGATION-BCPHXNto.js +335 -0
- package/dist-storybook/assets/TAILWIND_INTEGRATION-_T-VfvkM.js +87 -0
- package/dist-storybook/assets/_setToString-CbM921C9.js +1 -0
- package/dist-storybook/assets/alert-DLW8CoyB.js +1 -0
- package/dist-storybook/assets/alert.stories-B-vuojPh.js +110 -0
- package/dist-storybook/assets/avatar-GxcYPA1p.js +1 -0
- package/dist-storybook/assets/avatar.stories-KYFztAc8.js +136 -0
- package/dist-storybook/assets/axe-CmvD4WV5.js +20 -0
- package/dist-storybook/assets/badge-D_LzMVtw.js +1 -0
- package/dist-storybook/assets/badge.stories-Be2ItCmQ.js +262 -0
- package/dist-storybook/assets/blocks-BuaOUtiH.js +1243 -0
- package/dist-storybook/assets/bottom-tab-bar-CtcTAxuI.js +115 -0
- package/dist-storybook/assets/bottom-tab-bar.stories-CDmEve6z.js +186 -0
- package/dist-storybook/assets/button-CL7GeC23.js +1 -0
- package/dist-storybook/assets/button.stories-CaqLWQiY.js +287 -0
- package/dist-storybook/assets/calendar-dOCsjhVU.js +1 -0
- package/dist-storybook/assets/calendar.stories-DLWZldet.js +189 -0
- package/dist-storybook/assets/carousel-1Kww3hIz.js +37 -0
- package/dist-storybook/assets/carousel.stories-B8YbGOOr.js +217 -0
- package/dist-storybook/assets/checkbox-MGytNNRt.js +1 -0
- package/dist-storybook/assets/checkbox.stories-CLvfZPiw.js +201 -0
- package/dist-storybook/assets/chip-kG4p82WT.js +247 -0
- package/dist-storybook/assets/chip.stories-BbwJb5eD.js +442 -0
- package/dist-storybook/assets/classname-CUR_zgkh.js +1 -0
- package/dist-storybook/assets/colors-_6nFGM3e.js +1 -0
- package/dist-storybook/assets/date-Cg-Uk_pp.js +1 -0
- package/dist-storybook/assets/date-field.stories-Diptwqfv.js +129 -0
- package/dist-storybook/assets/date-picker-Dnq_-0Md.js +1 -0
- package/dist-storybook/assets/date-picker.stories-BuGWvzFL.js +123 -0
- package/dist-storybook/assets/default-error-BcnD8fFO.png +0 -0
- package/dist-storybook/assets/dialog.stories-DJ0WsSkA.js +212 -0
- package/dist-storybook/assets/dropdown.stories-D6JUYP73.js +200 -0
- package/dist-storybook/assets/embla-carousel-react.esm-BYjpaHZ9.js +1 -0
- package/dist-storybook/assets/en-Cs9O0XWn.js +15 -0
- package/dist-storybook/assets/icon-DdQsMyRa.js +1 -0
- package/dist-storybook/assets/icon.stories-B-ZvRzFf.js +365 -0
- package/dist-storybook/assets/iframe-CQAwSt4E.js +1071 -0
- package/dist-storybook/assets/iframe-yMKl6hJA.css +1 -0
- package/dist-storybook/assets/image-C3EsNRhz.js +9 -0
- package/dist-storybook/assets/image.stories-C4l8D3ju.js +255 -0
- package/dist-storybook/assets/index-B-Ksafg0.js +1 -0
- package/dist-storybook/assets/index-BV0AJWP6.js +1 -0
- package/dist-storybook/assets/index-CgMRTj-o.js +1 -0
- package/dist-storybook/assets/index-DHiZ-gXR.js +1 -0
- package/dist-storybook/assets/input-wrapper-BKHgnPy6.js +1 -0
- package/dist-storybook/assets/label-DV2iCDmN.js +27 -0
- package/dist-storybook/assets/label.stories-BwTIPFXX.js +138 -0
- package/dist-storybook/assets/matchers-7Z3WT2CE-Dw4MQV_s.js +14 -0
- package/dist-storybook/assets/navigation-bar-vI-FPasP.js +79 -0
- package/dist-storybook/assets/navigation-bar.stories-DYuFaJFD.js +73 -0
- package/dist-storybook/assets/number-field-CXKmnfKe.js +1 -0
- package/dist-storybook/assets/number-field.stories--fn26TJu.js +167 -0
- package/dist-storybook/assets/omit-Bsx5nTI0.js +1 -0
- package/dist-storybook/assets/option-item-LRh_OyV4.js +1 -0
- package/dist-storybook/assets/option-item.stories-snjAvgay.js +66 -0
- package/dist-storybook/assets/pagination-DZHoBs_4.js +1 -0
- package/dist-storybook/assets/pagination.stories-BoEs0jzS.js +91 -0
- package/dist-storybook/assets/pick-BhmhLmLe.js +1 -0
- package/dist-storybook/assets/preload-helper-PPVm8Dsz.js +1 -0
- package/dist-storybook/assets/radio-B5NJxG_l.js +1 -0
- package/dist-storybook/assets/radio.stories-DuN-Awi_.js +183 -0
- package/dist-storybook/assets/rating-BdXViYBv.js +1 -0
- package/dist-storybook/assets/rating.stories-BCcQjMEx.js +117 -0
- package/dist-storybook/assets/react-18-CNyWQ7je.js +9 -0
- package/dist-storybook/assets/react-hufnxGVs.js +1 -0
- package/dist-storybook/assets/search-field-CQqgFbfg.js +1 -0
- package/dist-storybook/assets/search-field.stories-DiCZbhng.js +79 -0
- package/dist-storybook/assets/section-content-DGNB4eLN.js +1 -0
- package/dist-storybook/assets/section.stories-C2I_kKhu.js +69 -0
- package/dist-storybook/assets/sheet.stories-wk1JaKU5.js +152 -0
- package/dist-storybook/assets/skeleton-C91JgehG.js +1 -0
- package/dist-storybook/assets/skeleton.stories-BCmX-VNr.js +139 -0
- package/dist-storybook/assets/store-CPumdfcU.js +1 -0
- package/dist-storybook/assets/store-D2RudmNr.js +18 -0
- package/dist-storybook/assets/switch-p-aXI-ev.js +1 -0
- package/dist-storybook/assets/switch.stories-BqPLNKB9.js +250 -0
- package/dist-storybook/assets/tab-bar-CSeCmtIZ.js +31 -0
- package/dist-storybook/assets/tab-bar.stories-Cb6v8H2w.js +136 -0
- package/dist-storybook/assets/text-area-DwSXyqOe.js +1 -0
- package/dist-storybook/assets/text-area.stories-By8bCfgc.js +87 -0
- package/dist-storybook/assets/text-field-jK6rpOo2.js +1 -0
- package/dist-storybook/assets/text-field.stories-CrWBAhvI.js +92 -0
- package/dist-storybook/assets/toast-provider-DurnMJhd.js +9 -0
- package/dist-storybook/assets/toast.stories-iWAToAZA.js +201 -0
- package/dist-storybook/assets/tooltip-QDdel5My.js +1 -0
- package/dist-storybook/assets/tooltip.stories-RC6SuPPD.js +153 -0
- package/dist-storybook/assets/typography-DEpAJl_i.js +1 -0
- package/dist-storybook/assets/typography.stories-Bu8qFugR.js +202 -0
- package/dist-storybook/assets/uploader.stories-B2wW9qVy.js +65 -0
- package/dist-storybook/assets/use-app-pause-B_tWHKJK.js +29 -0
- package/dist-storybook/assets/use-app-resume--900G-dV.js +29 -0
- package/dist-storybook/assets/use-custom-icon-event-3VExRzvC.js +29 -0
- package/dist-storybook/assets/use-did-hide-BUsL73ab.js +48 -0
- package/dist-storybook/assets/use-did-show-C1-VLDxi.js +49 -0
- package/dist-storybook/assets/use-histories-E4E2jJEY.js +50 -0
- package/dist-storybook/assets/use-history-o1im8IDj.js +67 -0
- package/dist-storybook/assets/use-location-CUEaBO4P.js +56 -0
- package/dist-storybook/assets/use-navigate-C4CTuFSZ.js +84 -0
- package/dist-storybook/assets/use-navigation-type-Dcz4hgKo.js +44 -0
- package/dist-storybook/assets/use-page-config-DSJBVQbq.js +48 -0
- package/dist-storybook/assets/use-page-scroll-dY-U1Vv4.js +69 -0
- package/dist-storybook/assets/use-page-state-CtNpwGPN.js +79 -0
- package/dist-storybook/assets/use-settings-changed-BBJwIHTE.js +29 -0
- package/dist-storybook/assets/v-mini-icon-Dn1BmJzb.woff2 +0 -0
- package/dist-storybook/assets/visibility-sensor-CwrzJO06.js +1 -0
- package/dist-storybook/iframe.html +670 -0
- package/dist-storybook/index.html +132 -0
- package/dist-storybook/index.json +1 -0
- package/dist-storybook/project.json +1 -0
- package/dist-storybook/sb-addons/a11y-2/manager-bundle.js +5 -0
- package/dist-storybook/sb-addons/docs-1/manager-bundle.js +151 -0
- package/dist-storybook/sb-addons/storybook-build-3/manager-bundle.js +3 -0
- package/dist-storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +971 -0
- package/dist-storybook/sb-manager/globals-module-info.js +799 -0
- package/dist-storybook/sb-manager/globals-runtime.js +69791 -0
- package/dist-storybook/sb-manager/globals.js +34 -0
- package/dist-storybook/sb-manager/runtime.js +13198 -0
- package/dist-storybook/stories-data.json +374 -0
- package/dist-storybook/vite-inject-mocker-entry.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,374 @@
|
|
|
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-dark-mode--docs",
|
|
16
|
+
"title": "App Framework/Dark Mode",
|
|
17
|
+
"subtitle": "Cấu hình dark mode cho ứng dụng Mini App.",
|
|
18
|
+
"content": "Dark Mode Config cho phép cấu hình dark mode mặc định cho ứng dụng. IDarkModeConfig có defaultEnabled để bật/tắt dark mode mặc định."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "app-framework-general--docs",
|
|
22
|
+
"title": "App Framework/General",
|
|
23
|
+
"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.",
|
|
24
|
+
"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."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "app-framework-keep-alive--docs",
|
|
28
|
+
"title": "App Framework/Keep Alive",
|
|
29
|
+
"subtitle": "Keep Alive cho phép giữ các pages trong DOM thay vì unmount khi navigate, giúp giữ state và scroll position.",
|
|
30
|
+
"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."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "app-framework-locale--docs",
|
|
34
|
+
"title": "App Framework/Locale",
|
|
35
|
+
"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.",
|
|
36
|
+
"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."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "app-framework-mobile-behaviours--docs",
|
|
40
|
+
"title": "App Framework/Mobile Behaviours",
|
|
41
|
+
"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.",
|
|
42
|
+
"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."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "app-framework-page-layout--docs",
|
|
46
|
+
"title": "App Framework/Page Layout",
|
|
47
|
+
"subtitle": "Cấu hình page layout cho các pages trong ứng dụng Mini App.",
|
|
48
|
+
"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."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "app-framework-routing-navigation--docs",
|
|
52
|
+
"title": "App Framework/Routing & Navigation",
|
|
53
|
+
"subtitle": "Hệ thống routing và navigation cung cấp các hooks và utilities để quản lý navigation và lifecycle events.",
|
|
54
|
+
"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."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "components-alert--docs",
|
|
58
|
+
"title": "Components/Alert",
|
|
59
|
+
"subtitle": "Component Alert hiển thị thông báo phản hồi theo ngữ cảnh cho người dùng. Hỗ trợ nhiều loại (thông tin, tích cực, tiêu cực) và có thể bao gồm tiêu đề, nội dung thông báo, nút hành động và chức năng đóng tùy chọn.",
|
|
60
|
+
"content": "Component Alert hiển thị các thông báo, cảnh báo hoặc thông tin quan trọng. Có thể được tùy chỉnh với các props type, title, message, closeable và action. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: type: Có thể là 'informative', 'positive' hoặc 'negative'. title: Tiêu đề của alert. message: Nội dung của alert. closeable: Có hiển thị icon close không. action: Nút action của alert."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "components-avatar--docs",
|
|
64
|
+
"title": "Components/Avatar",
|
|
65
|
+
"subtitle": "Component Avatar hiển thị ảnh đại diện hoặc label với nhiều kích thước và hình dạng khác nhau.",
|
|
66
|
+
"content": "Component Avatar hiển thị avatar với ảnh hoặc label. Có thể được tùy chỉnh với các props size, shape, border, label, labelColor, labelSize, color, src, srcSet 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: size: number - Kích thước của avatar. shape: circle hoặc rounded - Hình dạng của avatar. border: boolean - Hiển thị border. label: string - Text hiển thị khi không có ảnh. labelColor: IColor - Màu của label. labelSize: ITypographySize - Kích thước text của label. color: IColor - Màu nền của avatar. src: string - URL ảnh. srcSet: string - Set các nguồn ảnh responsive. className: string - Class name tùy chỉnh. props: ComponentProps img - Các props HTML img chuẩn."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "components-badge--docs",
|
|
70
|
+
"title": "Components/Badge",
|
|
71
|
+
"subtitle": "Component Badge hiển thị badge với các variant outline và có thể chứa số, text hoặc dot badge.",
|
|
72
|
+
"content": "Component Badge hiển thị badge với các variant khác nhau. Có thể được tùy chỉnh với các props outline, children 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: outline: boolean - Hiển thị badge với style outline. children: ReactNode - Nội dung của badge, có thể là số, text hoặc để trống để hiển thị dot badge. className: string - Class name tùy chỉnh. props: ComponentProps div - Các props HTML div chuẩn."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "components-bottomtabbar--docs",
|
|
76
|
+
"title": "Components/BottomTabBar",
|
|
77
|
+
"subtitle": "Component BottomTabBar hiển thị thanh điều hướng ở cuối màn hình với các tab items.",
|
|
78
|
+
"content": "Component BottomTabBar là thanh điều hướng dưới cùng với các tab items. Có thể được tùy chỉnh với các props items, activeId, indicator, setCssVariable, safeAreaBottomOffset, className và onItemClick. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: items: IBottomTabBarItem[] - Danh sách các tab items. activeId: string - ID của tab đang active. indicator: boolean - Hiển thị indicator. setCssVariable: boolean - Set CSS variable. safeAreaBottomOffset: boolean - Offset cho safe area bottom. className: string - Class name tùy chỉnh. onItemClick: (item: IBottomTabBarItem, index: number) => void - Callback khi click vào item. props: ComponentProps div - Các props HTML div chuẩn."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "components-button--docs",
|
|
82
|
+
"title": "Components/Button",
|
|
83
|
+
"subtitle": "Component Button cung cấp button với nhiều variant và theme khác nhau, hỗ trợ icon, loading state và các kiểu hiển thị khác nhau.",
|
|
84
|
+
"content": "Component Button là component button chính với nhiều tùy chọn. Có thể được tùy chỉnh với các props shape, size, type, theme, disabled, loading, leadingIcon, trailingIcon, htmlType, block, children 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: shape: rounded hoặc pill - Hình dạng của button. size: large hoặc medium - Kích thước của button. type: solid, solid-subtle, outline hoặc ghost - Kiểu hiển thị của button. theme: default, brand, neutral hoặc neutral-inverse - Theme màu sắc. disabled: boolean - Trạng thái disabled. loading: boolean - Trạng thái loading. leadingIcon: IIconProps hoặc ReactNode - Icon ở đầu button. trailingIcon: IIconProps hoặc ReactNode - Icon ở cuối button. htmlType: button, submit hoặc reset - Type của button HTML. block: boolean - Hiển thị full width. children: ReactNode - Nội dung của button. className: string - Class name tùy chỉnh. props: ComponentPropsWithRef button - Các props HTML button chuẩn."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "components-calendar--docs",
|
|
88
|
+
"title": "Components/Calendar",
|
|
89
|
+
"subtitle": "Component Calendar hiển thị lịch để chọn ngày đơn hoặc khoảng ngày với nhiều tùy chọn điều hướng.",
|
|
90
|
+
"content": "Component Calendar là component lịch với nhiều chế độ và tùy chọn. Có thể được tùy chỉnh với các props type, navigationMode, lang, value, defaultValue, minDate, maxDate, onChange và các props khác. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: type: single hoặc range - Kiểu chọn ngày. navigationMode: month, month-year hoặc time-only - Chế độ điều hướng. lang: vi hoặc en - Ngôn ngữ. value: Date hoặc [Date, Date] - Giá trị ngày được chọn. defaultValue: Date hoặc [Date, Date] - Giá trị mặc định. minDate: Date - Ngày tối thiểu. maxDate: Date - Ngày tối đa. onChange: (date: Date | [Date, Date]) => void - Callback khi ngày thay đổi."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "components-carousel--docs",
|
|
94
|
+
"title": "Components/Carousel",
|
|
95
|
+
"subtitle": "Component Carousel hiển thị các items trong một slider có thể cuộn với nhiều tùy chọn điều khiển.",
|
|
96
|
+
"content": "Component Carousel là component slider với nhiều tùy chọn. Có thể được tùy chỉnh với các props children, carousel, options, pagination 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: children: ReactNode - Các carousel items. carousel: ICarouselInstance - Instance của carousel. options: ICarouselOptions - Các tùy chọn carousel bao gồm align, initialIndex, loop, duration, autoplay, delay, autoHeight, gap. pagination: boolean - Hiển thị pagination. className: string - Class name tùy chỉnh."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "components-checkbox--docs",
|
|
100
|
+
"title": "Components/Checkbox",
|
|
101
|
+
"subtitle": "Component Checkbox cho phép người dùng chọn một hoặc nhiều tùy chọn từ một tập hợp các tùy chọn.",
|
|
102
|
+
"content": "Component Checkbox là component checkbox với nhiều variant và theme. Có thể được tùy chỉnh với các props checked, defaultChecked, disabled, theme, variant, number, defaultNumber, onChange, onNumberChange, children, typography 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: checked: boolean - Trạng thái checked. defaultChecked: boolean - Trạng thái checked mặc định. disabled: boolean - Trạng thái disabled. theme: brand hoặc inverse - Theme màu sắc. variant: default, number hoặc indeterminate - Kiểu hiển thị. number: number - Số lượng khi variant là number. defaultNumber: number - Số lượng mặc định. onChange: (checked: boolean) => void - Callback khi checked thay đổi. onNumberChange: (number: number | undefined) => void - Callback khi number thay đổi. children: ReactNode - Label của checkbox. typography: Omit ITypographyProps span - Props typography cho label. className: string - Class name tùy chỉnh. props: ComponentProps input - Các props HTML input chuẩn."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "components-chip--docs",
|
|
106
|
+
"title": "Components/Chip",
|
|
107
|
+
"subtitle": "Component Chip hiển thị các tag hoặc label nhỏ gọn với nhiều kiểu và chức năng khác nhau.",
|
|
108
|
+
"content": "Component Chip là component tag nhỏ gọn với nhiều type và theme. Có thể được tùy chỉnh với các props theme, type, disabled, selected, label, leadingIcon, trailingIcon, count, children 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: theme: default, brand hoặc neutral - Theme màu sắc. type: selection, dropdown, action hoặc input - Kiểu chip. disabled: boolean - Trạng thái disabled. selected: boolean - Trạng thái selected. label: ReactNode - Label của chip. leadingIcon: IIconProps hoặc ReactNode - Icon ở đầu chip. trailingIcon: IIconProps hoặc ReactNode - Icon ở cuối chip. count: number - Số lượng hiển thị trên chip. children: ReactNode - Nội dung của chip. className: string - Class name tùy chỉnh. props: ComponentPropsWithRef div - Các props HTML div chuẩn."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "components-datefield--docs",
|
|
112
|
+
"title": "Components/DateField",
|
|
113
|
+
"subtitle": "Component DateField là input field để chọn ngày với date picker tích hợp.",
|
|
114
|
+
"content": "Component DateField là input field để chọn ngày. Có thể được tùy chỉnh với các props value, onChange, picker, loading, label, placeholder, shape, disabled, error, errorMessage, success, successMessage 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: Date hoặc null - Giá trị ngày được chọn. onChange: (value: Date | null) => void - Callback khi ngày thay đổi. picker: boolean hoặc IDatePickerSheetProps - Cấu hình date picker. loading: boolean - Trạng thái loading. label: ILabelProps - Label của field. placeholder: string - Placeholder text. shape: rounded hoặc pill - Hình dạng của field. disabled: boolean - Trạng thái disabled. error: boolean - Trạng thái error. errorMessage: ReactNode - Thông báo lỗi. success: boolean - Trạng thái success. successMessage: ReactNode - Thông báo thành công. className: string - Class name tùy chỉnh. props: ComponentPropsWithRef div - Các props HTML div chuẩn."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "components-datepicker--docs",
|
|
118
|
+
"title": "Components/DatePicker",
|
|
119
|
+
"subtitle": "Component DatePicker hiển thị picker để chọn ngày, tháng, năm và giờ.",
|
|
120
|
+
"content": "Component DatePicker là component picker để chọn ngày. Có thể được tùy chỉnh với các props value, onChange, year, month, day, hour, min, max 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: Date - Giá trị ngày được chọn. onChange: (value: Date) => void - Callback khi ngày thay đổi. year: boolean - Hiển thị picker năm. month: boolean - Hiển thị picker tháng. day: boolean - Hiển thị picker ngày. hour: boolean - Hiển thị picker giờ. min: Date hoặc null - Ngày tối thiểu. max: Date hoặc null - Ngày tối đa. className: string - Class name tùy chỉnh. props: ComponentPropsWithRef div - Các props HTML div chuẩn."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "components-dialog--docs",
|
|
124
|
+
"title": "Components/Dialog",
|
|
125
|
+
"subtitle": "Component Dialog hiển thị modal dialog với nhiều tùy chọn tùy chỉnh.",
|
|
126
|
+
"content": "Component Dialog là component modal dialog. Có thể được tùy chỉnh với các props open, onBackdropClick, onCloseClick, title, description, topImageUrl, top, children, footer, closeAction, portal, overlay 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: open: boolean - Trạng thái mở đóng dialog. onBackdropClick: (e: React.MouseEvent) => void - Callback khi click backdrop. onCloseClick: (e: React.MouseEvent) => void - Callback khi click nút close. title: ReactNode - Tiêu đề của dialog. description: ReactNode - Mô tả của dialog. topImageUrl: string - URL ảnh ở đầu dialog. top: ReactNode - Nội dung ở đầu dialog. children: ReactNode - Nội dung chính của dialog. footer: ReactNode - Footer của dialog. closeAction: boolean - Hiển thị nút close. portal: boolean - Mở trong portal. overlay: default hoặc blur - Kiểu overlay. className: string - Class name tùy chỉnh."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "components-dropdown--docs",
|
|
130
|
+
"title": "Components/Dropdown",
|
|
131
|
+
"subtitle": "Component Dropdown hiển thị danh sách tùy chọn có thể chọn với khả năng tìm kiếm.",
|
|
132
|
+
"content": "Component Dropdown là component dropdown với danh sách tùy chọn. Có thể được tùy chỉnh với các props options, value, onChange, placeholder, shape, disabled, allowSearch, loading 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: options: IDropdownOption[] - Danh sách các tùy chọn. value: Value - Giá trị được chọn. onChange: (value: Value) => void - Callback khi giá trị thay đổi. placeholder: string - Placeholder text. shape: rounded hoặc pill - Hình dạng của dropdown. disabled: boolean - Trạng thái disabled. allowSearch: boolean - Cho phép tìm kiếm. loading: boolean - Trạng thái loading. className: string - Class name tùy chỉnh. props: ComponentPropsWithRef div - Các props HTML div chuẩn."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"id": "components-icon--docs",
|
|
136
|
+
"title": "Components/Icon",
|
|
137
|
+
"subtitle": "Component Icon hiển thị các icon với nhiều kích thước, màu sắc và animation khác nhau.",
|
|
138
|
+
"content": "Component Icon là component icon với nhiều tùy chọn. Có thể được tùy chỉnh với các props name, type, size, color, animation, children, className và style. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: name: IIconName - Tên của icon. type: outline hoặc fill - Kiểu icon. size: number hoặc string - Kích thước icon. color: IColor - Màu sắc icon. animation: spin, ping, pulse hoặc bounce - Animation của icon. children: ReactNode - Nội dung tùy chỉnh. className: string - Class name tùy chỉnh. style: React.CSSProperties - Style tùy chỉnh. props: Omit ComponentProps svg - Các props SVG chuẩn."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "components-image--docs",
|
|
142
|
+
"title": "Components/Image",
|
|
143
|
+
"subtitle": "Component Image hiển thị ảnh với nhiều tùy chọn fit, lazy loading và fallback.",
|
|
144
|
+
"content": "Component Image là component ảnh với nhiều tùy chọn. Có thể được tùy chỉnh với các props src, srcSet, fit, lazy, placeholder, fallback, width, height, alt 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: src: string - URL ảnh. srcSet: string - Set các nguồn ảnh responsive. fit: contain, cover, fill, none hoặc scale-down - Cách ảnh fit vào container. lazy: boolean - Lazy loading. placeholder: ReactNode - Placeholder khi đang load. fallback: ReactNode - Fallback khi lỗi. width: number hoặc string - Chiều rộng. height: number hoặc string - Chiều cao. alt: string - Alt text. className: string - Class name tùy chỉnh. props: ComponentPropsWithRef img - Các props HTML img chuẩn."
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "components-label--docs",
|
|
148
|
+
"title": "Components/Label",
|
|
149
|
+
"subtitle": "Component Label hiển thị label cho các form field với hỗ trợ icon, helper text và các trạng thái khác nhau.",
|
|
150
|
+
"content": "Component Label là component label cho form. Có thể được tùy chỉnh với các props text, required, icon, helperText, disabled, loading, htmlFor, children 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: text: ReactNode - Text của label. required: boolean - Hiển thị dấu required. icon: IIconProps hoặc ReactNode - Icon của label. helperText: ReactNode - Helper text. disabled: boolean - Trạng thái disabled. loading: boolean - Trạng thái loading. htmlFor: string - ID của field liên kết. children: ReactNode - Nội dung của label. className: string - Class name tùy chỉnh. props: ComponentPropsWithRef label - Các props HTML label chuẩn."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"id": "components-navigationbar--docs",
|
|
154
|
+
"title": "Components/NavigationBar",
|
|
155
|
+
"subtitle": "Component NavigationBar hiển thị thanh điều hướng ở đầu màn hình với title, back button và các icon tùy chỉnh.",
|
|
156
|
+
"content": "Component NavigationBar là thanh điều hướng trên cùng. Có thể được tùy chỉnh với các props title, backIcon, onBackClick, theme, transparent, leftIcon, onLeftIconClick, rightIcon, onRightIconClick 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: title: string hoặc ReactNode - Tiêu đề của navigation bar. backIcon: boolean, IIconProps hoặc ReactNode - Icon back. onBackClick: () => void - Callback khi click back. theme: default hoặc inverse - Theme màu sắc. transparent: boolean hoặc auto - Trạng thái transparent. leftIcon: IIconProps hoặc ReactNode - Icon bên trái. onLeftIconClick: () => void - Callback khi click left icon. rightIcon: IIconProps hoặc ReactNode - Icon bên phải. onRightIconClick: () => void - Callback khi click right icon. className: string - Class name tùy chỉnh. props: ComponentPropsWithoutRef div - Các props HTML div chuẩn."
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "components-numberfield--docs",
|
|
160
|
+
"title": "Components/NumberField",
|
|
161
|
+
"subtitle": "Component NumberField là input field để nhập số với hỗ trợ mask và validation.",
|
|
162
|
+
"content": "Component NumberField là input field để nhập số. Có thể được tùy chỉnh với các props value, defaultValue, onChange, length, masked, label, errorMessage, shape, disabled, loading 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: string - Giá trị số. defaultValue: string - Giá trị mặc định. onChange: (value: string) => void - Callback khi giá trị thay đổi. length: number - Độ dài tối đa. masked: boolean - Ẩn số. label: string - Label của field. errorMessage: string - Thông báo lỗi. shape: rounded hoặc pill - Hình dạng của field. disabled: boolean - Trạng thái disabled. loading: boolean - Trạng thái loading. className: string - Class name tùy chỉnh. props: ComponentProps div - Các props HTML div chuẩn."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "components-optionitem--docs",
|
|
166
|
+
"title": "Components/OptionItem",
|
|
167
|
+
"subtitle": "Component OptionItem hiển thị một item trong danh sách tùy chọn với theme và trạng thái selected.",
|
|
168
|
+
"content": "Component OptionItem là item trong danh sách tùy chọn. Có thể được tùy chỉnh với các props theme, selected, divider 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: theme: brand hoặc neutral - Theme màu sắc. selected: boolean - Trạng thái selected. divider: boolean - Hiển thị divider. className: string - Class name tùy chỉnh. props: ComponentProps div - Các props HTML div chuẩn."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "components-pagination--docs",
|
|
172
|
+
"title": "Components/Pagination",
|
|
173
|
+
"subtitle": "Component Pagination hiển thị các dots để chỉ thị trang hiện tại trong một tập hợp các trang.",
|
|
174
|
+
"content": "Component Pagination là component pagination với dots. Có thể được tùy chỉnh với các props total, activeIndex 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: total: number - Tổng số trang. activeIndex: number - Chỉ số trang hiện tại. className: string - Class name tùy chỉnh. props: ComponentProps div - Các props HTML div chuẩn."
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"id": "components-radio--docs",
|
|
178
|
+
"title": "Components/Radio",
|
|
179
|
+
"subtitle": "Component Radio cho phép người dùng chọn một tùy chọn từ một tập hợp các tùy chọn.",
|
|
180
|
+
"content": "Component Radio là component radio button. Có thể được tùy chỉnh với các props checked, onChange, disabled, theme, type, name, value, children 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: checked: boolean - Trạng thái checked. onChange: (checked: boolean) => void - Callback khi checked thay đổi. disabled: boolean - Trạng thái disabled. theme: default, brand hoặc neutral - Theme màu sắc. type: checkbox hoặc radio - Kiểu input. name: string - Tên của radio group. value: string - Giá trị của radio. children: ReactNode - Label của radio. className: string - Class name tùy chỉnh. props: ComponentProps input - Các props HTML input chuẩn."
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "components-rating--docs",
|
|
184
|
+
"title": "Components/Rating",
|
|
185
|
+
"subtitle": "Component Rating hiển thị đánh giá sao với khả năng chọn giá trị và hiển thị tooltip.",
|
|
186
|
+
"content": "Component Rating là component đánh giá sao. Có thể được tùy chỉnh với các props value, defaultValue, onChange, max, size, readonly, allowHalf, className, count, character, characterRender, tooltips và onHoverChange. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: value: number - Giá trị đánh giá. defaultValue: number - Giá trị mặc định. onChange: (value: number) => void - Callback khi giá trị thay đổi. max: number - Giá trị tối đa. size: medium, large hoặc x-large - Kích thước. readonly: boolean - Chế độ chỉ đọc. allowHalf: boolean - Cho phép chọn nửa sao. className: string - Class name tùy chỉnh. count: number - Số lượng đánh giá. character: ReactNode - Ký tự hiển thị. characterRender: (index: number) => ReactNode - Render ký tự tùy chỉnh. tooltips: string[] - Danh sách tooltip. onHoverChange: (value: number) => void - Callback khi hover."
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"id": "components-searchfield--docs",
|
|
190
|
+
"title": "Components/SearchField",
|
|
191
|
+
"subtitle": "Component SearchField là input field để tìm kiếm với icon search và khả năng clear.",
|
|
192
|
+
"content": "Component SearchField là input field để tìm kiếm. Có thể được tùy chỉnh với các props value, onChange, placeholder, shape, disabled, loading, className, label, clearable và onClear. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: value: string - Giá trị tìm kiếm. onChange: (value: string) => void - Callback khi giá trị thay đổi. placeholder: string - Placeholder text. shape: rounded hoặc pill - Hình dạng của field. disabled: boolean - Trạng thái disabled. loading: boolean - Trạng thái loading. className: string - Class name tùy chỉnh. label: { text: string, required?: boolean } - Label của field. clearable: boolean - Cho phép clear. onClear: () => void - Callback khi clear."
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "components-section--docs",
|
|
196
|
+
"title": "Components/Section",
|
|
197
|
+
"subtitle": "Component Section là container để nhóm các nội dung với spacing và shape tùy chỉnh.",
|
|
198
|
+
"content": "Component Section là container để nhóm nội dung. Có thể được tùy chỉnh với các props space, shape, children 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: space: boolean - Thêm spacing. shape: rounded hoặc square - Hình dạng của section. children: ReactNode - Nội dung của section. className: string - Class name tùy chỉnh."
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"id": "components-sheet--docs",
|
|
202
|
+
"title": "Components/Sheet",
|
|
203
|
+
"subtitle": "Component Sheet hiển thị bottom sheet modal với header, body và footer.",
|
|
204
|
+
"content": "Component Sheet là bottom sheet modal. Có thể được tùy chỉnh với các props open, onBackdropClick, portal, overlay, children và className. SheetHeader có props title, backIcon, closeIcon, onBackClick, onCloseClick. SheetBody chứa nội dung chính với horizontalSpace. SheetFooter chứa footer. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: open: boolean - Trạng thái mở đóng sheet. onBackdropClick: (e: React.MouseEvent) => void - Callback khi click backdrop. portal: boolean - Mở trong portal. overlay: default hoặc blur - Kiểu overlay. children: ReactNode - Nội dung của sheet. className: string - Class name tùy chỉnh."
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"id": "components-skeleton--docs",
|
|
208
|
+
"title": "Components/Skeleton",
|
|
209
|
+
"subtitle": "Component Skeleton hiển thị placeholder loading với nhiều shape và animation.",
|
|
210
|
+
"content": "Component Skeleton là placeholder loading. Skeleton có props width, height, shape, animated và className. SkeletonTitle và SkeletonParagraph có props lineCount, paragraphProps, title và paragraph. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: width: number hoặc string - Chiều rộng. height: number hoặc string - Chiều cao. shape: rounded, rounded-8, rounded-4, pill hoặc none - Hình dạng. animated: boolean - Animation. className: string - Class name tùy chỉnh. lineCount: number - Số dòng cho title hoặc paragraph. paragraphProps: object - Props cho paragraph. title: boolean - Hiển thị title skeleton. paragraph: boolean - Hiển thị paragraph skeleton."
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"id": "components-switch--docs",
|
|
214
|
+
"title": "Components/Switch",
|
|
215
|
+
"subtitle": "Component Switch là toggle switch để bật tắt một tùy chọn.",
|
|
216
|
+
"content": "Component Switch là toggle switch. Có thể được tùy chỉnh với các props checked, onChange, disabled, theme 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: checked: boolean - Trạng thái checked. onChange: (checked: boolean) => void - Callback khi checked thay đổi. disabled: boolean - Trạng thái disabled. theme: brand hoặc inverse - Theme màu sắc. className: string - Class name tùy chỉnh. props: ComponentProps input - Các props HTML input chuẩn."
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "components-tabbar--docs",
|
|
220
|
+
"title": "Components/TabBar",
|
|
221
|
+
"subtitle": "Component TabBar hiển thị thanh tab với các items có thể click.",
|
|
222
|
+
"content": "Component TabBar là thanh tab. Có thể được tùy chỉnh với các props items, activeId, defaultActiveId, theme, onItemClick 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: items: ITabBarItem[] - Danh sách các tab items. activeId: string - ID của tab đang active. defaultActiveId: string - ID mặc định của tab active. theme: default, brand hoặc neutral - Theme màu sắc. onItemClick: (item: ITabBarItem, index: number) => void - Callback khi click vào item. className: string - Class name tùy chỉnh."
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "components-textarea--docs",
|
|
226
|
+
"title": "Components/TextArea",
|
|
227
|
+
"subtitle": "Component TextArea là textarea input để nhập nhiều dòng text với validation và auto height.",
|
|
228
|
+
"content": "Component TextArea là textarea input. Có thể được tùy chỉnh với các props value, onChange, placeholder, label, shape, disabled, error, errorMessage, maxLength, autoHeight, loading 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: string - Giá trị text. onChange: (value: string) => void - Callback khi giá trị thay đổi. placeholder: string - Placeholder text. label: ILabelProps - Label của field. shape: rounded hoặc pill - Hình dạng của field. disabled: boolean - Trạng thái disabled. error: boolean - Trạng thái error. errorMessage: ReactNode - Thông báo lỗi. maxLength: number - Độ dài tối đa. autoHeight: boolean - Tự động điều chỉnh chiều cao. loading: boolean - Trạng thái loading. className: string - Class name tùy chỉnh."
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"id": "components-textfield--docs",
|
|
232
|
+
"title": "Components/TextField",
|
|
233
|
+
"subtitle": "Component TextField là input field để nhập text với validation và các trạng thái khác nhau.",
|
|
234
|
+
"content": "Component TextField là input field. Có thể được tùy chỉnh với các props value, onChange, placeholder, label, shape, disabled, error, errorMessage, maxLength, loading 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: string - Giá trị text. onChange: (value: string) => void - Callback khi giá trị thay đổi. placeholder: string - Placeholder text. label: ILabelProps - Label của field. shape: rounded hoặc pill - Hình dạng của field. disabled: boolean - Trạng thái disabled. error: boolean - Trạng thái error. errorMessage: ReactNode - Thông báo lỗi. maxLength: number - Độ dài tối đa. loading: boolean - Trạng thái loading. className: string - Class name tùy chỉnh."
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"id": "components-toast--docs",
|
|
238
|
+
"title": "Components/Toast",
|
|
239
|
+
"subtitle": "Component Toast hiển thị thông báo tạm thời với nhiều loại và có thể có action button.",
|
|
240
|
+
"content": "Component Toast là thông báo tạm thời. Có thể được tùy chỉnh với các props type, message, closeAction, onCloseActionClick, action, onActionClick, icon 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: type: neutral, informative, positive hoặc negative - Loại toast. message: ReactNode - Nội dung thông báo. closeAction: boolean - Hiển thị nút close. onCloseActionClick: () => void - Callback khi click close. action: string - Text của action button. onActionClick: () => void - Callback khi click action. icon: IIconProps hoặc ReactNode - Icon của toast. className: string - Class name tùy chỉnh. props: ComponentProps div - Các props HTML div chuẩn."
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"id": "components-tooltip--docs",
|
|
244
|
+
"title": "Components/Tooltip",
|
|
245
|
+
"subtitle": "Component Tooltip hiển thị tooltip với nhiều vị trí và kiểu khác nhau.",
|
|
246
|
+
"content": "Component Tooltip là component tooltip. Có thể được tùy chỉnh với các props type, position, closeable, children 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: type: default hoặc reverse - Kiểu tooltip. position: ITooltipPosition - Vị trí của tooltip. closeable: boolean - Cho phép đóng. children: ReactNode - Nội dung của tooltip. className: string - Class name tùy chỉnh."
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"id": "components-typography--docs",
|
|
250
|
+
"title": "Components/Typography",
|
|
251
|
+
"subtitle": "Component Typography hiển thị text với nhiều kích thước, weight và màu sắc khác nhau.",
|
|
252
|
+
"content": "Component Typography là component text. Có thể được tùy chỉnh với các props component, size, weight, color, className và children. ITypographySize có các giá trị inherit, 3x-small, 2x-small, x-small, small, base, large, x-large, 2x-large, 3x-large, 4x-large, 5x-large. ITypographyWeight có các giá trị inherit, 100, 200, 300, 400, 500, 600, 700, 800, 900. Thuộc tính Tên thuộc tính Kiểu dữ liệu Bắt buộc Mô tả \\ API Properties: component: ElementType - Component HTML được sử dụng. size: ITypographySize - Kích thước text. weight: ITypographyWeight - Độ đậm của text. color: IColor - Màu sắc text. className: string - Class name tùy chỉnh. children: ReactNode - Nội dung text."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"id": "components-uploader--docs",
|
|
256
|
+
"title": "Components/Uploader",
|
|
257
|
+
"subtitle": "Component Uploader cho phép người dùng upload nhiều file với preview và validation.",
|
|
258
|
+
"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
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"id": "getting-started--docs",
|
|
262
|
+
"title": "Getting Started",
|
|
263
|
+
"subtitle": "Hướng dẫn bắt đầu sử dụng @v-miniapp/ui-react để phát triển V-MiniApp.",
|
|
264
|
+
"content": "Getting Started với @v-miniapp/ui-react. Hướng dẫn cài đặt, import styles, và ví dụ bắt đầu sử dụng. Thư viện cung cấp đầy đủ các component UI, routing, theme management và các tính năng native app như pull-to-refresh, swipe navigation, page stacking với keep-alive. Có thể tích hợp với Tailwind CSS hoặc sử dụng CSS chuẩn."
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"id": "hooks-useapppause--docs",
|
|
268
|
+
"title": "Hooks/useAppPause",
|
|
269
|
+
"subtitle": "Hook để xử lý khi app bị pause (background).",
|
|
270
|
+
"content": "useAppPause hook xử lý khi app bị pause. Nhận callback function được gọi khi app pause. Có thể sử dụng để pause timers, animations hoặc các tác vụ đang chạy khi app vào background."
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"id": "hooks-useappresume--docs",
|
|
274
|
+
"title": "Hooks/useAppResume",
|
|
275
|
+
"subtitle": "Hook để xử lý khi app được resume (foreground).",
|
|
276
|
+
"content": "useAppResume hook xử lý khi app được resume. Nhận callback function được gọi khi app resume. Có thể sử dụng để resume timers, animations hoặc các tác vụ khi app quay lại foreground."
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"id": "hooks-usecustomiconevent--docs",
|
|
280
|
+
"title": "Hooks/useCustomIconEvent",
|
|
281
|
+
"subtitle": "Hook để xử lý custom icon event từ navigation bar.",
|
|
282
|
+
"content": "useCustomIconEvent hook xử lý custom icon event từ navigation bar. Nhận callback function được gọi khi custom icon được click. Có thể sử dụng để xử lý các action tùy chỉnh từ navigation bar."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"id": "hooks-usedidhide--docs",
|
|
286
|
+
"title": "Hooks/useDidHide",
|
|
287
|
+
"subtitle": "Hook để xử lý khi page bị ẩn (hide).",
|
|
288
|
+
"content": "useDidHide hook xử lý khi page bị ẩn. Nhận callback function được gọi khi page hide. Có thể sử dụng để pause animations, timers hoặc các tác vụ khi page không còn hiển thị."
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"id": "hooks-usedidshow--docs",
|
|
292
|
+
"title": "Hooks/useDidShow",
|
|
293
|
+
"subtitle": "Hook để xử lý khi page được hiển thị (show).",
|
|
294
|
+
"content": "useDidShow hook xử lý khi page được hiển thị. Nhận callback function được gọi khi page show. Có thể sử dụng để resume animations, timers hoặc các tác vụ khi page được hiển thị."
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"id": "hooks-usehistories--docs",
|
|
298
|
+
"title": "Hooks/useHistories",
|
|
299
|
+
"subtitle": "Hook để lấy toàn bộ history stack.",
|
|
300
|
+
"content": "useHistories hook trả về mảng các history entries trong navigation stack. Mỗi history entry có action, location với key, pathname, params, state và timestamp. Có thể sử dụng để hiển thị breadcrumb hoặc navigation history."
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"id": "hooks-usehistory--docs",
|
|
304
|
+
"title": "Hooks/useHistory",
|
|
305
|
+
"subtitle": "Hook để lấy history entry hiện tại của page.",
|
|
306
|
+
"content": "useHistory hook trả về history entry hiện tại với action PUSH, REPLACE hoặc POP, location object chứa key, pathname, params và state, cùng với timestamp. Có thể sử dụng để truy cập thông tin navigation hiện tại."
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"id": "hooks-uselocation--docs",
|
|
310
|
+
"title": "Hooks/useLocation",
|
|
311
|
+
"subtitle": "Hook để lấy location object hiện tại (pathname, params, state, key).",
|
|
312
|
+
"content": "useLocation hook trả về location object hiện tại với key, pathname, params và state. Có thể sử dụng để truy cập pathname, query parameters và state được truyền qua navigation. Location object được cập nhật khi navigate."
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"id": "hooks-usenavigate--docs",
|
|
316
|
+
"title": "Hooks/useNavigate",
|
|
317
|
+
"subtitle": "Hook để lấy function navigate để điều hướng giữa các pages.",
|
|
318
|
+
"content": "useNavigate hook trả về function navigate với type INavigate. Có thể navigate bằng pathname với options INavigatePathnameOptions hoặc bằng delta với options INavigateDeltaOptions. INavigatePathnameOptions có replace và state. INavigateDeltaOptions có replace."
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"id": "hooks-usenavigationtype--docs",
|
|
322
|
+
"title": "Hooks/useNavigationType",
|
|
323
|
+
"subtitle": "Hook để lấy navigation action type (PUSH, REPLACE, POP).",
|
|
324
|
+
"content": "useNavigationType hook trả về navigation action type là PUSH, REPLACE hoặc POP. Có thể sử dụng để xác định cách page được navigate đến, ví dụ để xử lý khác nhau giữa push và replace navigation."
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"id": "hooks-usepageconfig--docs",
|
|
328
|
+
"title": "Hooks/usePageConfig",
|
|
329
|
+
"subtitle": "Hook để lấy config của page hiện tại.",
|
|
330
|
+
"content": "usePageConfig hook trả về IPageConfig của page hiện tại. IPageConfig chứa các cấu hình như pathname, Component, navigationBar, layouts và các config khác. Có thể sử dụng để truy cập cấu hình page hiện tại."
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"id": "hooks-usepagescroll--docs",
|
|
334
|
+
"title": "Hooks/usePageScroll",
|
|
335
|
+
"subtitle": "Hook để lắng nghe sự kiện scroll của page.",
|
|
336
|
+
"content": "usePageScroll hook lắng nghe sự kiện scroll của page. Nhận callback function và options cho throttle. Callback nhận target HTMLDivElement và event. Có thể sử dụng để xử lý scroll events với throttle để tối ưu performance."
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"id": "hooks-usepagestate--docs",
|
|
340
|
+
"title": "Hooks/usePageState",
|
|
341
|
+
"subtitle": "Hook để quản lý state của page hiện tại.",
|
|
342
|
+
"content": "usePageState hook trả về pageState IPageState và setPageState function. IPageState chứa các state như keepAlive, freeze, freezeDelay. Có thể sử dụng để quản lý và cập nhật state của page hiện tại."
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"id": "hooks-usesettingschanged--docs",
|
|
346
|
+
"title": "Hooks/useSettingsChanged",
|
|
347
|
+
"subtitle": "Hook để xử lý khi settings của app thay đổi.",
|
|
348
|
+
"content": "useSettingsChanged hook xử lý khi settings của app thay đổi. Nhận callback function được gọi khi settings thay đổi. Có thể sử dụng để phản ứng với các thay đổi settings như theme, language hoặc các cài đặt khác."
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"id": "migration-guide--docs",
|
|
352
|
+
"title": "Migration Guide",
|
|
353
|
+
"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.",
|
|
354
|
+
"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."
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"id": "use-cases-custom-error-boundary--docs",
|
|
358
|
+
"title": "Use Cases/Custom Error Boundary",
|
|
359
|
+
"subtitle": "Hướng dẫn thêm ErrorBoundary riêng cho từng page để bắt lỗi trước và xử lý chi tiết hơn.",
|
|
360
|
+
"content": "Custom Error Boundary cho phép thêm ErrorBoundary riêng cho từng page thông qua Layouts trong IPageConfig. ErrorBoundary ở page-level sẽ bắt lỗi trước ErrorBoundary global, cho phép xử lý chi tiết và isolate errors. App component đã có ErrorBoundary global sẵn để catch tất cả lỗi không được handle."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"id": "use-cases-infinite-scroll--docs",
|
|
364
|
+
"title": "Use Cases/Infinite Scroll",
|
|
365
|
+
"subtitle": "Hướng dẫn implement infinite scroll để tự động load thêm data khi user scroll đến cuối danh sách.",
|
|
366
|
+
"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
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"id": "use-cases-tailwind-integration--docs",
|
|
370
|
+
"title": "Use Cases/Tailwind Integration",
|
|
371
|
+
"subtitle": "Hướng dẫn tích hợp @v-miniapp/ui-react với Tailwind CSS để tránh conflict và sử dụng chung design tokens.",
|
|
372
|
+
"content": "Tailwind Integration cho phép tích hợp với Tailwind CSS. Import @v-miniapp/ui-react/tailwind vào file CSS chính. Khi sử dụng Tailwind integration không cần import styles.css nữa. Có thể sử dụng các design tokens như colors, spacing, typography từ @v-miniapp/ui-react trong Tailwind."
|
|
373
|
+
}
|
|
374
|
+
]
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as me}from"./assets/preload-helper-PPVm8Dsz.js";class se{registryByUrl=new Map;registryById=new Map;clear(){this.registryByUrl.clear(),this.registryById.clear()}keys(){return this.registryByUrl.keys()}add(e){this.registryByUrl.set(e.url,e),this.registryById.set(e.id,e)}register(e,t,r,i,s){const a=typeof e=="object"?e.type:e;if(typeof e=="object"){const o=e;if(o instanceof q||o instanceof O||o instanceof F||o instanceof C)throw new TypeError(`[vitest] Cannot register a mock that is already defined. Expected a JSON representation from \`MockedModule.toJSON\`, instead got "${o.type}". Use "registry.add()" to update a mock instead.`);if(o.type==="automock"){const l=q.fromJSON(o);return this.add(l),l}else if(o.type==="autospy"){const l=O.fromJSON(o);return this.add(l),l}else if(o.type==="redirect"){const l=C.fromJSON(o);return this.add(l),l}else throw o.type==="manual"?new Error("Cannot set serialized manual mock. Define a factory function manually with `ManualMockedModule.fromJSON()`."):new Error(`Unknown mock type: ${o.type}`)}if(typeof t!="string")throw new TypeError("[vitest] Mocks require a raw string.");if(typeof i!="string")throw new TypeError("[vitest] Mocks require a url string.");if(typeof r!="string")throw new TypeError("[vitest] Mocks require an id string.");if(a==="manual"){if(typeof s!="function")throw new TypeError("[vitest] Manual mocks require a factory function.");const o=new F(t,r,i,s);return this.add(o),o}else if(a==="automock"||a==="autospy"){const o=a==="automock"?new q(t,r,i):new O(t,r,i);return this.add(o),o}else if(a==="redirect"){if(typeof s!="string")throw new TypeError("[vitest] Redirect mocks require a redirect string.");const o=new C(t,r,i,s);return this.add(o),o}else throw new Error(`[vitest] Unknown mock type: ${a}`)}delete(e){this.registryByUrl.delete(e)}get(e){return this.registryByUrl.get(e)}getById(e){return this.registryById.get(e)}has(e){return this.registryByUrl.has(e)}}class q{type="automock";constructor(e,t,r){this.raw=e,this.id=t,this.url=r}static fromJSON(e){return new O(e.raw,e.id,e.url)}toJSON(){return{type:this.type,url:this.url,raw:this.raw,id:this.id}}}class O{type="autospy";constructor(e,t,r){this.raw=e,this.id=t,this.url=r}static fromJSON(e){return new O(e.raw,e.id,e.url)}toJSON(){return{type:this.type,url:this.url,id:this.id,raw:this.raw}}}class C{type="redirect";constructor(e,t,r,i){this.raw=e,this.id=t,this.url=r,this.redirect=i}static fromJSON(e){return new C(e.raw,e.id,e.url,e.redirect)}toJSON(){return{type:this.type,url:this.url,raw:this.raw,id:this.id,redirect:this.redirect}}}class F{cache;type="manual";constructor(e,t,r,i){this.raw=e,this.id=t,this.url=r,this.factory=i}async resolve(){if(this.cache)return this.cache;let e;try{e=await this.factory()}catch(t){const r=new Error('[vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock');throw r.cause=t,r}if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`[vitest] vi.mock("${this.raw}", factory?: () => unknown) is not returning an object. Did you mean to return an object with a "default" key?`);return this.cache=e}static fromJSON(e,t){return new F(e.raw,e.id,e.url,t)}toJSON(){return{type:this.type,url:this.url,id:this.id,raw:this.raw}}}function ye(n,e,t={}){const r=new Array,i=new ge,s=(l,d,h)=>{try{return l[d]=h,!0}catch{return!1}},a=(l,d)=>{const h=D(l),g=h==="Module"||!!l.__esModule;for(const{key:w,descriptor:b}of K(l,g,n.globalConstructors)){if(!g&&b.get){try{Object.defineProperty(d,w,b)}catch{}continue}if(ve(w,h))continue;const y=l[w],c=i.getId(y);if(c!==void 0){r.push(()=>s(d,w,i.getMockedValue(c)));continue}const u=D(y);if(Array.isArray(y)){s(d,w,[]);continue}const x=u.includes("Function")&&typeof y=="function";if((!x||y._isMockFunction)&&u!=="Object"&&u!=="Module"){s(d,w,y);continue}if(s(d,w,x?y:{})){if(x){let _=function(){if(this instanceof d[w])for(const{key:I,descriptor:R}of K(this,!1,n.globalConstructors)){if(R.get)continue;const N=this[I];if(D(N).includes("Function")&&typeof N=="function"){const L=this[I],f=M(this,I).mockImplementation(L),$=f.mockReset;f.mockRestore=f.mockReset=()=>($.call(f),f.mockImplementation(L),f)}}};if(!n.spyOn)throw new Error("[@vitest/mocker] `spyOn` is not defined. This is a Vitest error. Please open a new issue with reproduction.");const M=n.spyOn,P=M(d,w);if(n.type==="automock"){P.mockImplementation(_);const I=P.mockReset;P.mockRestore=P.mockReset=()=>(I.call(P),P.mockImplementation(_),P)}Object.defineProperty(d[w],"length",{value:0})}i.track(y,d[w]),a(y,d[w])}}},o=t;a(e,o);for(const l of r)l();return o}class ge{idMap=new Map;mockedValueMap=new Map;getId(e){return this.idMap.get(e)}getMockedValue(e){return this.mockedValueMap.get(e)}track(e,t){const r=this.idMap.size;return this.idMap.set(e,r),this.mockedValueMap.set(r,t),r}}function D(n){return Object.prototype.toString.apply(n).slice(8,-1)}function ve(n,e){return e.includes("Function")&&typeof n=="string"&&["arguments","callee","caller","length","name"].includes(n)}function K(n,e,t){const{Map:r,Object:i,Function:s,RegExp:a,Array:o}=t,l=new r;let d=n;do{if(d===i.prototype||d===s.prototype||d===a.prototype)break;we(d,h=>{const g=i.getOwnPropertyDescriptor(d,h);g&&l.set(h,{key:h,descriptor:g})})}while(d=i.getPrototypeOf(d));if(e&&!l.has("default")&&"default"in n){const h=i.getOwnPropertyDescriptor(n,"default");h&&l.set("default",{key:"default",descriptor:h})}return o.from(l.values())}function we(n,e){const t=typeof e=="function"?e:r=>e.add(r);Object.getOwnPropertyNames(n).forEach(t),Object.getOwnPropertySymbols(n).forEach(t)}const ke=/^[A-Za-z]:\//;function ce(n=""){return n&&n.replace(/\\/g,"/").replace(ke,e=>e.toUpperCase())}const Se=/^[/\\]{2}/,_e=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Ee=/^[A-Za-z]:$/,be=/.(\.[^./]+|\.)$/,Ie=function(n){if(n.length===0)return".";n=ce(n);const e=n.match(Se),t=H(n),r=n[n.length-1]==="/";return n=Te(n,!t),n.length===0?t?"/":r?"./":".":(r&&(n+="/"),Ee.test(n)&&(n+="/"),e?t?`//${n}`:`//./${n}`:t&&!H(n)?`/${n}`:n)},xe=function(...n){let e="";for(const t of n)if(t)if(e.length>0){const r=e[e.length-1]==="/",i=t[0]==="/";r&&i?e+=t.slice(1):e+=r||i?t:`/${t}`}else e+=t;return Ie(e)};function Te(n,e){let t="",r=0,i=-1,s=0,a=null;for(let o=0;o<=n.length;++o){if(o<n.length)a=n[o];else{if(a==="/")break;a="/"}if(a==="/"){if(!(i===o-1||s===1))if(s===2){if(t.length<2||r!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){const l=t.lastIndexOf("/");l===-1?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),i=o,s=0;continue}else if(t.length>0){t="",r=0,i=o,s=0;continue}}e&&(t+=t.length>0?"/..":"..",r=2)}else t.length>0?t+=`/${n.slice(i+1,o)}`:t=n.slice(i+1,o),r=o-i-1;i=o,s=0}else a==="."&&s!==-1?++s:s=-1}return t}const H=function(n){return _e.test(n)},$e=function(n){if(n==="..")return"";const e=be.exec(ce(n));return e&&e[1]||""};var Pe={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},Me=Object.entries(Pe);function j(n){return String(n)}j.open="";j.close="";function Re(n=!1){let e=typeof process<"u"?process:void 0,t=e?.env||{},r=e?.argv||[];return!("NO_COLOR"in t||r.includes("--no-color"))&&("FORCE_COLOR"in t||r.includes("--color")||e?.platform==="win32"||n&&t.TERM!=="dumb"||"CI"in t)||typeof window<"u"&&!!window.chrome}function Ae(n=!1){let e=Re(n),t=(a,o,l,d)=>{let h="",g=0;do h+=a.substring(g,d)+l,g=d+o.length,d=a.indexOf(o,g);while(~d);return h+a.substring(g)},r=(a,o,l=a)=>{let d=h=>{let g=String(h),w=g.indexOf(o,a.length);return~w?a+t(g,o,l,w)+o:a+g+o};return d.open=a,d.close=o,d},i={isColorSupported:e},s=a=>`\x1B[${a}m`;for(let[a,o]of Me)i[a]=e?r(s(o[0]),s(o[1]),o[2]):j;return i}Ae();function ae(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(n)}function le(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var U={exports:{}},k={};var Z;function Oe(){if(Z)return k;Z=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),w=Symbol.for("react.view_transition"),b=Symbol.for("react.client.reference");function y(c){if(typeof c=="object"&&c!==null){var u=c.$$typeof;switch(u){case n:switch(c=c.type,c){case t:case i:case r:case l:case d:case w:return c;default:switch(c=c&&c.$$typeof,c){case a:case o:case g:case h:return c;case s:return c;default:return u}}case e:return u}}}return k.ContextConsumer=s,k.ContextProvider=a,k.Element=n,k.ForwardRef=o,k.Fragment=t,k.Lazy=g,k.Memo=h,k.Portal=e,k.Profiler=i,k.StrictMode=r,k.Suspense=l,k.SuspenseList=d,k.isContextConsumer=function(c){return y(c)===s},k.isContextProvider=function(c){return y(c)===a},k.isElement=function(c){return typeof c=="object"&&c!==null&&c.$$typeof===n},k.isForwardRef=function(c){return y(c)===o},k.isFragment=function(c){return y(c)===t},k.isLazy=function(c){return y(c)===g},k.isMemo=function(c){return y(c)===h},k.isPortal=function(c){return y(c)===e},k.isProfiler=function(c){return y(c)===i},k.isStrictMode=function(c){return y(c)===r},k.isSuspense=function(c){return y(c)===l},k.isSuspenseList=function(c){return y(c)===d},k.isValidElementType=function(c){return typeof c=="string"||typeof c=="function"||c===t||c===i||c===r||c===l||c===d||typeof c=="object"&&c!==null&&(c.$$typeof===g||c.$$typeof===h||c.$$typeof===a||c.$$typeof===s||c.$$typeof===o||c.$$typeof===b||c.getModuleId!==void 0)},k.typeOf=y,k}var G;function Ce(){return G||(G=1,U.exports=Oe()),U.exports}var ue=Ce(),Ne=le(ue),Le=ae({__proto__:null,default:Ne},[ue]),z={exports:{}},v={};var Q;function Je(){if(Q)return v;Q=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),y;y=Symbol.for("react.module.reference");function c(u){if(typeof u=="object"&&u!==null){var x=u.$$typeof;switch(x){case n:switch(u=u.type,u){case t:case i:case r:case d:case h:return u;default:switch(u=u&&u.$$typeof,u){case o:case a:case l:case w:case g:case s:return u;default:return x}}case e:return x}}}return v.ContextConsumer=a,v.ContextProvider=s,v.Element=n,v.ForwardRef=l,v.Fragment=t,v.Lazy=w,v.Memo=g,v.Portal=e,v.Profiler=i,v.StrictMode=r,v.Suspense=d,v.SuspenseList=h,v.isAsyncMode=function(){return!1},v.isConcurrentMode=function(){return!1},v.isContextConsumer=function(u){return c(u)===a},v.isContextProvider=function(u){return c(u)===s},v.isElement=function(u){return typeof u=="object"&&u!==null&&u.$$typeof===n},v.isForwardRef=function(u){return c(u)===l},v.isFragment=function(u){return c(u)===t},v.isLazy=function(u){return c(u)===w},v.isMemo=function(u){return c(u)===g},v.isPortal=function(u){return c(u)===e},v.isProfiler=function(u){return c(u)===i},v.isStrictMode=function(u){return c(u)===r},v.isSuspense=function(u){return c(u)===d},v.isSuspenseList=function(u){return c(u)===h},v.isValidElementType=function(u){return typeof u=="string"||typeof u=="function"||u===t||u===i||u===r||u===d||u===h||u===b||typeof u=="object"&&u!==null&&(u.$$typeof===w||u.$$typeof===g||u.$$typeof===s||u.$$typeof===a||u.$$typeof===l||u.$$typeof===y||u.getModuleId!==void 0)},v.typeOf=c,v}var ee;function Be(){return ee||(ee=1,z.exports=Je()),z.exports}var fe=Be(),Xe=le(fe),qe=ae({__proto__:null,default:Xe},[fe]);const Fe=["isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","isSuspenseList","isValidElementType"];Object.fromEntries(Fe.map(n=>[n,e=>qe[n](e)||Le[n](e)]));let De=()=>"Promise{…}";try{const{getPromiseDetails:n,kPending:e,kRejected:t}=process.binding("util");Array.isArray(n(Promise.resolve()))&&(De=(r,i)=>{const[s,a]=n(r);return s===e?"Promise{<pending>}":`Promise${s===t?"!":""}{${i.inspect(a,i)}}`})}catch{}function Ue(n){const{message:e="$$stack trace error",stackTraceLimit:t=1}=n||{},r=Error.stackTraceLimit,i=Error.prepareStackTrace;Error.stackTraceLimit=t,Error.prepareStackTrace=o=>o.stack;const a=new Error(e).stack||"";return Error.prepareStackTrace=i,Error.stackTraceLimit=r,a}var V,te;function ze(){if(te)return V;te=1;var n,e,t,r,i,s,a,o,l,d,h,g,w,b,y,c,u,x,M;return w=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy,g=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,n=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy,y=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,h=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,c=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,M=/[\t\v\f\ufeff\p{Zs}]+/uy,o=/\r?\n|[\r\u2028\u2029]/y,l=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,b=/\/\/.*/y,t=/[<>.:={}]|\/(?![\/*])/y,e=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy,r=/(['"])(?:(?!\1)[^])*(\1)?/y,i=/[^<>{}]+/y,x=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,u=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,s=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,a=/^(?:return|throw|yield)$/,d=RegExp(o.source),V=function*(_,{jsx:P=!1}={}){var I,R,N,p,m,L,f,$,Y,T,J,S,B,E;for({length:L}=_,p=0,m="",E=[{tag:"JS"}],I=[],J=0,S=!1;p<L;){switch($=E[E.length-1],$.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(_[p]==="/"&&(x.test(m)||s.test(m))&&(w.lastIndex=p,f=w.exec(_))){p=w.lastIndex,m=f[0],S=!0,yield{type:"RegularExpressionLiteral",value:f[0],closed:f[1]!==void 0&&f[1]!=="\\"};continue}if(g.lastIndex=p,f=g.exec(_)){switch(B=f[0],Y=g.lastIndex,T=B,B){case"(":m==="?NonExpressionParenKeyword"&&E.push({tag:"JSNonExpressionParen",nesting:J}),J++,S=!1;break;case")":J--,S=!0,$.tag==="JSNonExpressionParen"&&J===$.nesting&&(E.pop(),T="?NonExpressionParenEnd",S=!1);break;case"{":g.lastIndex=0,N=!u.test(m)&&(x.test(m)||s.test(m)),I.push(N),S=!1;break;case"}":switch($.tag){case"InterpolationInTemplate":if(I.length===$.nesting){c.lastIndex=p,f=c.exec(_),p=c.lastIndex,m=f[0],f[1]==="${"?(m="?InterpolationInTemplate",S=!1,yield{type:"TemplateMiddle",value:f[0]}):(E.pop(),S=!0,yield{type:"TemplateTail",value:f[0],closed:f[1]==="`"});continue}break;case"InterpolationInJSX":if(I.length===$.nesting){E.pop(),p+=1,m="}",yield{type:"JSXPunctuator",value:"}"};continue}}S=I.pop(),T=S?"?ExpressionBraceEnd":"}";break;case"]":S=!0;break;case"++":case"--":T=S?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(P&&(x.test(m)||s.test(m))){E.push({tag:"JSXTag"}),p+=1,m="<",yield{type:"JSXPunctuator",value:B};continue}S=!1;break;default:S=!1}p=Y,m=T,yield{type:"Punctuator",value:B};continue}if(n.lastIndex=p,f=n.exec(_)){switch(p=n.lastIndex,T=f[0],f[0]){case"for":case"if":case"while":case"with":m!=="."&&m!=="?."&&(T="?NonExpressionParenKeyword")}m=T,S=!s.test(f[0]),yield{type:f[1]==="#"?"PrivateIdentifier":"IdentifierName",value:f[0]};continue}if(y.lastIndex=p,f=y.exec(_)){p=y.lastIndex,m=f[0],S=!0,yield{type:"StringLiteral",value:f[0],closed:f[2]!==void 0};continue}if(h.lastIndex=p,f=h.exec(_)){p=h.lastIndex,m=f[0],S=!0,yield{type:"NumericLiteral",value:f[0]};continue}if(c.lastIndex=p,f=c.exec(_)){p=c.lastIndex,m=f[0],f[1]==="${"?(m="?InterpolationInTemplate",E.push({tag:"InterpolationInTemplate",nesting:I.length}),S=!1,yield{type:"TemplateHead",value:f[0]}):(S=!0,yield{type:"NoSubstitutionTemplate",value:f[0],closed:f[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(t.lastIndex=p,f=t.exec(_)){switch(p=t.lastIndex,T=f[0],f[0]){case"<":E.push({tag:"JSXTag"});break;case">":E.pop(),m==="/"||$.tag==="JSXTagEnd"?(T="?JSX",S=!0):E.push({tag:"JSXChildren"});break;case"{":E.push({tag:"InterpolationInJSX",nesting:I.length}),T="?InterpolationInJSX",S=!1;break;case"/":m==="<"&&(E.pop(),E[E.length-1].tag==="JSXChildren"&&E.pop(),E.push({tag:"JSXTagEnd"}))}m=T,yield{type:"JSXPunctuator",value:f[0]};continue}if(e.lastIndex=p,f=e.exec(_)){p=e.lastIndex,m=f[0],yield{type:"JSXIdentifier",value:f[0]};continue}if(r.lastIndex=p,f=r.exec(_)){p=r.lastIndex,m=f[0],yield{type:"JSXString",value:f[0],closed:f[2]!==void 0};continue}break;case"JSXChildren":if(i.lastIndex=p,f=i.exec(_)){p=i.lastIndex,m=f[0],yield{type:"JSXText",value:f[0]};continue}switch(_[p]){case"<":E.push({tag:"JSXTag"}),p++,m="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":E.push({tag:"InterpolationInJSX",nesting:I.length}),p++,m="?InterpolationInJSX",S=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(M.lastIndex=p,f=M.exec(_)){p=M.lastIndex,yield{type:"WhiteSpace",value:f[0]};continue}if(o.lastIndex=p,f=o.exec(_)){p=o.lastIndex,S=!1,a.test(m)&&(m="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:f[0]};continue}if(l.lastIndex=p,f=l.exec(_)){p=l.lastIndex,d.test(f[0])&&(S=!1,a.test(m)&&(m="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:f[0],closed:f[1]!==void 0};continue}if(b.lastIndex=p,f=b.exec(_)){p=b.lastIndex,S=!1,yield{type:"SingleLineComment",value:f[0]};continue}R=String.fromCodePoint(_.codePointAt(p)),p+=R.length,m=R,S=!1,yield{type:$.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:R}}},V}ze();var de={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(de.keyword);new Set(de.strict);const re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ve=new Uint8Array(64),We=new Uint8Array(128);for(let n=0;n<re.length;n++){const e=re.charCodeAt(n);Ve[n]=e,We[e]=n}var ne;(function(n){n[n.Empty=1]="Empty",n[n.Hash=2]="Hash",n[n.Query=3]="Query",n[n.RelativePath=4]="RelativePath",n[n.AbsolutePath=5]="AbsolutePath",n[n.SchemeRelative=6]="SchemeRelative",n[n.Absolute=7]="Absolute"})(ne||(ne={}));const je=/^[A-Za-z]:\//;function Ye(n=""){return n&&n.replace(/\\/g,"/").replace(je,e=>e.toUpperCase())}const Ke=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;function He(){return typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}const Ze=function(...n){n=n.map(r=>Ye(r));let e="",t=!1;for(let r=n.length-1;r>=-1&&!t;r--){const i=r>=0?n[r]:He();!i||i.length===0||(e=`${i}/${e}`,t=ie(i))}return e=Ge(e,!t),t&&!ie(e)?`/${e}`:e.length>0?e:"."};function Ge(n,e){let t="",r=0,i=-1,s=0,a=null;for(let o=0;o<=n.length;++o){if(o<n.length)a=n[o];else{if(a==="/")break;a="/"}if(a==="/"){if(!(i===o-1||s===1))if(s===2){if(t.length<2||r!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){const l=t.lastIndexOf("/");l===-1?(t="",r=0):(t=t.slice(0,l),r=t.length-1-t.lastIndexOf("/")),i=o,s=0;continue}else if(t.length>0){t="",r=0,i=o,s=0;continue}}e&&(t+=t.length>0?"/..":"..",r=2)}else t.length>0?t+=`/${n.slice(i+1,o)}`:t=n.slice(i+1,o),r=o-i-1;i=o,s=0}else a==="."&&s!==-1?++s:s=-1}return t}const ie=function(n){return Ke.test(n)},pe=/^\s*at .*(?:\S:\d+|\(native\))/m,Qe=/^(?:eval@)?(?:\[native code\])?$/;function he(n){if(!n.includes(":"))return[n];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(n.replace(/^\(|\)$/g,""));if(!t)return[n];let r=t[1];if(r.startsWith("async ")&&(r=r.slice(6)),r.startsWith("http:")||r.startsWith("https:")){const i=new URL(r);i.searchParams.delete("import"),i.searchParams.delete("browserv"),r=i.pathname+i.hash+i.search}if(r.startsWith("/@fs/")){const i=/^\/@fs\/[a-zA-Z]:\//.test(r);r=r.slice(i?5:4)}return[r,t[2]||void 0,t[3]||void 0]}function et(n){let e=n.trim();if(Qe.test(e)||(e.includes(" > eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!e.includes("@")&&!e.includes(":")))return null;const t=/((.*".+"[^@]*)?[^@]*)(@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,[s,a,o]=he(e.replace(t,""));return!s||!a||!o?null:{file:s,method:i||"",line:Number.parseInt(a),column:Number.parseInt(o)}}function tt(n){const e=n.trim();return pe.test(e)?rt(e):et(e)}function rt(n){let e=n.trim();if(!pe.test(e))return null;e.includes("(eval ")&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const r=t.match(/ (\(.+\)$)/);t=r?t.replace(r[0],""):t;const[i,s,a]=he(r?r[1]:t);let o=r&&t||"",l=i&&["eval","<anonymous>"].includes(i)?void 0:i;return!l||!s||!a?null:(o.startsWith("async ")&&(o=o.slice(6)),l.startsWith("file://")&&(l=l.slice(7)),l=l.startsWith("node:")||l.startsWith("internal:")?l:Ze(l),o&&(o=o.replace(/__vite_ssr_import_\d+__\./g,"")),{method:o,file:l,line:Number.parseInt(s),column:Number.parseInt(a)})}function nt(n){const e=n?.globalThisKey||"__vitest_mocker__";function t(){return typeof globalThis[e]<"u"?globalThis[e]:new Proxy({},{get(r,i){throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(i)}() is forbidden.`)}})}return{hoisted(r){if(typeof r!="function")throw new TypeError(`vi.hoisted() expects a function, but received a ${typeof r}`);return r()},mock(r,i){if(typeof r!="string")throw new TypeError(`vi.mock() expects a string path, but received a ${typeof r}`);const s=A("mock");t().queueMock(r,s,typeof i=="function"?()=>i(()=>t().importActual(r,s)):i)},unmock(r){if(typeof r!="string")throw new TypeError(`vi.unmock() expects a string path, but received a ${typeof r}`);t().queueUnmock(r,A("unmock"))},doMock(r,i){if(typeof r!="string")throw new TypeError(`vi.doMock() expects a string path, but received a ${typeof r}`);const s=A("doMock");t().queueMock(r,s,typeof i=="function"?()=>i(()=>t().importActual(r,s)):i)},doUnmock(r){if(typeof r!="string")throw new TypeError(`vi.doUnmock() expects a string path, but received a ${typeof r}`);t().queueUnmock(r,A("doUnmock"))},async importActual(r){return t().importActual(r,A("importActual"))},async importMock(r){return t().importMock(r,A("importMock"))}}}function A(n){const t=Ue({stackTraceLimit:5}).split(`
|
|
2
|
+
`),r=t.findIndex(s=>s.includes(` at Object.${n}`)||s.includes(`${n}@`)),i=tt(t[r+1]);return i?.file||""}const{now:oe}=Date;class it{registry=new se;queue=new Set;mockedIds=new Set;constructor(e,t,r,i){this.interceptor=e,this.rpc=t,this.spyOn=r,this.config=i}async prepare(){this.queue.size&&await Promise.all([...this.queue.values()])}async resolveFactoryModule(e){const t=this.registry.get(e);if(!t||t.type!=="manual")throw new Error(`Mock ${e} wasn't registered. This is probably a Vitest error. Please, open a new issue with reproduction.`);return await t.resolve()}getFactoryModule(e){const t=this.registry.get(e);if(!t||t.type!=="manual")throw new Error(`Mock ${e} wasn't registered. This is probably a Vitest error. Please, open a new issue with reproduction.`);if(!t.cache)throw new Error(`Mock ${e} wasn't resolved. This is probably a Vitest error. Please, open a new issue with reproduction.`);return t.cache}async invalidate(){const e=Array.from(this.mockedIds);e.length&&(await this.rpc.invalidate(e),await this.interceptor.invalidate(),this.registry.clear())}async importActual(e,t){const r=await this.rpc.resolveId(e,t);if(r==null)throw new Error(`[vitest] Cannot resolve "${e}" imported from "${t}"`);const i=$e(r.id),s=new URL(r.url,location.href),a=`_vitest_original&ext${i}`,o=`${s.pathname}${s.search?`${s.search}&${a}`:`?${a}`}${s.hash}`;return this.wrapDynamicImport(()=>import(o)).then(l=>{if(!r.optimized||typeof l.default>"u")return l;const d=l.default;return d?.__esModule?d:{...typeof d=="object"&&!Array.isArray(d)||typeof d=="function"?d:{},default:d}})}async importMock(e,t){await this.prepare();const{resolvedId:r,resolvedUrl:i,redirectUrl:s}=await this.rpc.resolveMock(e,t,{mock:"auto"}),a=this.resolveMockPath(X(i));let o=this.registry.get(a);if(!o)if(s){const l=new URL(this.resolveMockPath(X(s)),location.href).toString();o=new C(e,r,a,l)}else o=new q(e,r,a);if(o.type==="manual")return await o.resolve();if(o.type==="automock"||o.type==="autospy"){const l=new URL(`/@id/${r}`,location.href),d=l.search?`${l.search}&t=${oe()}`:`?t=${oe()}`,h=await me(()=>import(`${l.pathname}${d}&mock=${o.type}${l.hash}`),[],import.meta.url);return this.mockObject(h,o.type)}return import(o.redirect)}mockObject(e,t="automock"){return ye({globalConstructors:{Object,Function,Array,Map,RegExp},spyOn:this.spyOn,type:t},e)}queueMock(e,t,r){const i=this.rpc.resolveMock(e,t,{mock:typeof r=="function"?"factory":r?.spy?"spy":"auto"}).then(async({redirectUrl:s,resolvedId:a,resolvedUrl:o,needsInterop:l,mockType:d})=>{const h=this.resolveMockPath(X(o));this.mockedIds.add(a);const g=typeof r=="function"?async()=>{const y=await r();return l?{default:y}:y}:void 0,w=typeof s=="string"?new URL(this.resolveMockPath(X(s)),location.href).toString():null;let b;d==="manual"?b=this.registry.register("manual",e,a,h,g):d==="autospy"?b=this.registry.register("autospy",e,a,h):d==="redirect"?b=this.registry.register("redirect",e,a,h,w):b=this.registry.register("automock",e,a,h),await this.interceptor.register(b)}).finally(()=>{this.queue.delete(i)});this.queue.add(i)}queueUnmock(e,t){const r=this.rpc.resolveId(e,t).then(async i=>{if(!i)return;const s=this.resolveMockPath(X(i.url));this.mockedIds.add(i.id),this.registry.delete(s),await this.interceptor.delete(s)}).finally(()=>{this.queue.delete(r)});this.queue.add(r)}wrapDynamicImport(e){return typeof e=="function"?new Promise((r,i)=>{this.prepare().finally(()=>{e().then(r,i)})}):e}resolveMockPath(e){const t=this.config,r=xe("/@fs/",t.root);return e.startsWith(t.root)?e.slice(t.root.length):e.startsWith(r)?e.slice(r.length):e}}const ot=/(\?|&)v=\w{8}/;function X(n){return n.replace(ot,"")}class st{mocks=new se;constructor(){}async register(e){this.mocks.add(e)}async delete(e){this.mocks.delete(e)}async invalidate(){this.mocks.clear()}}const W=n=>{switch(n){case"resolveId":return Promise.resolve({id:"",url:"",optimized:!1});case"resolveMock":return Promise.resolve({mockType:"dummy",resolvedId:"",resolvedUrl:"",redirectUrl:"",needsInterop:!1});case"invalidate":return Promise.resolve()}};class ct extends it{queueMock(){}}function at(n){const e=new ct(n("__vitest_mocker__"),{resolveId(t,r){return W("resolveId")},resolveMock(t,r,i){return W("resolveMock")},async invalidate(t){return W("invalidate")}},(...t)=>globalThis.__STORYBOOK_MODULE_TEST__.spyOn(...t),{root:""});return globalThis.__vitest_mocker__=e,nt({globalThisKey:"__vitest_mocker__"})}globalThis.__STORYBOOK_MOCKER__=at(()=>new st);
|