@gaozh1024/rn-kit 0.2.0 → 0.3.1
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 +116 -1
- package/dist/index.d.mts +90 -2
- package/dist/index.d.ts +90 -2
- package/dist/index.js +657 -405
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +534 -285
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -34,6 +34,8 @@ yarn add @gaozh1024/rn-kit
|
|
|
34
34
|
npm install react react-native
|
|
35
35
|
npm install react-native-screens react-native-safe-area-context
|
|
36
36
|
npm install react-native-gesture-handler react-native-reanimated
|
|
37
|
+
npx expo install @expo/vector-icons
|
|
38
|
+
npx expo install expo-linear-gradient
|
|
37
39
|
npm install react-native-svg
|
|
38
40
|
```
|
|
39
41
|
|
|
@@ -158,7 +160,9 @@ import {
|
|
|
158
160
|
Card,
|
|
159
161
|
Icon,
|
|
160
162
|
AppImage,
|
|
161
|
-
AppList,
|
|
163
|
+
AppList,
|
|
164
|
+
GradientView,
|
|
165
|
+
PageDrawer, // 数据展示 / 页面级抽屉
|
|
162
166
|
Checkbox,
|
|
163
167
|
Radio,
|
|
164
168
|
Switch,
|
|
@@ -173,6 +177,7 @@ import {
|
|
|
173
177
|
import {
|
|
174
178
|
// UI Hooks
|
|
175
179
|
useToggle,
|
|
180
|
+
usePageDrawer,
|
|
176
181
|
useDebounce,
|
|
177
182
|
useThrottle,
|
|
178
183
|
useKeyboard,
|
|
@@ -225,6 +230,116 @@ import {
|
|
|
225
230
|
</TabNavigator>
|
|
226
231
|
```
|
|
227
232
|
|
|
233
|
+
### 🧲 抽屉
|
|
234
|
+
|
|
235
|
+
框架同时提供两类抽屉能力:
|
|
236
|
+
|
|
237
|
+
- **导航级抽屉**:`DrawerNavigator` / `DrawerContent`
|
|
238
|
+
- **页面级抽屉**:`PageDrawer`
|
|
239
|
+
|
|
240
|
+
#### 1. 页面级抽屉
|
|
241
|
+
|
|
242
|
+
适合当前页面内的筛选面板、操作栏、详情侧栏。
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import React from 'react';
|
|
246
|
+
import { AppButton, AppText, AppView, PageDrawer } from '@gaozh1024/rn-kit';
|
|
247
|
+
|
|
248
|
+
function FilterPanel() {
|
|
249
|
+
const [visible, setVisible] = React.useState(false);
|
|
250
|
+
|
|
251
|
+
return (
|
|
252
|
+
<>
|
|
253
|
+
<AppButton onPress={() => setVisible(true)}>打开筛选</AppButton>
|
|
254
|
+
|
|
255
|
+
<PageDrawer
|
|
256
|
+
visible={visible}
|
|
257
|
+
onClose={() => setVisible(false)}
|
|
258
|
+
title="筛选条件"
|
|
259
|
+
placement="right"
|
|
260
|
+
width={320}
|
|
261
|
+
>
|
|
262
|
+
<AppView gap={3}>
|
|
263
|
+
<AppText>这里放筛选项</AppText>
|
|
264
|
+
</AppView>
|
|
265
|
+
</PageDrawer>
|
|
266
|
+
</>
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
`PageDrawer` 支持:
|
|
272
|
+
|
|
273
|
+
- 左 / 右侧抽屉
|
|
274
|
+
- 点击遮罩关闭
|
|
275
|
+
- 自定义 `header` / `footer`
|
|
276
|
+
- 手势滑动关闭
|
|
277
|
+
- Android 返回键优先关闭抽屉
|
|
278
|
+
|
|
279
|
+
常用参数:
|
|
280
|
+
|
|
281
|
+
- `placement`: `'left' | 'right'`
|
|
282
|
+
- `width`: 抽屉宽度,默认 `320`
|
|
283
|
+
- `swipeEnabled`: 是否启用手势关闭,默认 `true`
|
|
284
|
+
- `swipeThreshold`: 触发关闭阈值,默认 `80`
|
|
285
|
+
- `closeOnBackdropPress`: 点击遮罩关闭,默认 `true`
|
|
286
|
+
|
|
287
|
+
### 🌈 渐变背景
|
|
288
|
+
|
|
289
|
+
框架提供 `GradientView` 作为渐变背景容器,底层封装 `expo-linear-gradient`。
|
|
290
|
+
|
|
291
|
+
```tsx
|
|
292
|
+
import { GradientView, AppText } from '@gaozh1024/rn-kit';
|
|
293
|
+
|
|
294
|
+
<GradientView
|
|
295
|
+
colors={['#f38b32', '#fb923c']}
|
|
296
|
+
style={{ padding: 24, borderRadius: 16 }}
|
|
297
|
+
>
|
|
298
|
+
<AppText color="white" weight="bold">
|
|
299
|
+
渐变卡片
|
|
300
|
+
</AppText>
|
|
301
|
+
</GradientView>;
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
如果你的应用是手动集成 `@gaozh1024/rn-kit`,请同时安装:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
npx expo install expo-linear-gradient
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
如果你不想在页面里重复写 `useState(false)`,也可以直接使用:
|
|
311
|
+
|
|
312
|
+
```tsx
|
|
313
|
+
import { AppButton, PageDrawer, usePageDrawer } from '@gaozh1024/rn-kit';
|
|
314
|
+
|
|
315
|
+
const drawer = usePageDrawer();
|
|
316
|
+
|
|
317
|
+
<AppButton onPress={drawer.open}>打开</AppButton>;
|
|
318
|
+
<PageDrawer visible={drawer.visible} onClose={drawer.close} />;
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
#### 2. 导航级抽屉
|
|
322
|
+
|
|
323
|
+
适合整个导航结构都交给抽屉接管的场景:
|
|
324
|
+
|
|
325
|
+
```tsx
|
|
326
|
+
import { DrawerContent, DrawerNavigator } from '@gaozh1024/rn-kit';
|
|
327
|
+
|
|
328
|
+
<DrawerNavigator
|
|
329
|
+
drawerContent={props => (
|
|
330
|
+
<DrawerContent
|
|
331
|
+
{...props}
|
|
332
|
+
items={[
|
|
333
|
+
{ name: 'Home', label: '首页', icon: 'home' },
|
|
334
|
+
{ name: 'Settings', label: '设置', icon: 'settings' },
|
|
335
|
+
]}
|
|
336
|
+
/>
|
|
337
|
+
)}
|
|
338
|
+
>
|
|
339
|
+
{/* screens */}
|
|
340
|
+
</DrawerNavigator>;
|
|
341
|
+
```
|
|
342
|
+
|
|
228
343
|
### 🔌 API 工厂
|
|
229
344
|
|
|
230
345
|
```tsx
|
package/dist/index.d.mts
CHANGED
|
@@ -7,6 +7,7 @@ import * as React$1 from 'react';
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
export { useMutation, useQuery } from '@tanstack/react-query';
|
|
9
9
|
import { ViewProps, ScrollViewProps, TextProps, PressableProps, StyleProp, TextStyle, ImageSourcePropType, ImageStyle, ListRenderItem, ViewStyle, TextInputProps, TextInput, StatusBarProps, StatusBarStyle } from 'react-native';
|
|
10
|
+
import { LinearGradientProps } from 'expo-linear-gradient';
|
|
10
11
|
import * as _react_navigation_native from '@react-navigation/native';
|
|
11
12
|
import { LinkingOptions, Theme as Theme$1, NavigationProp, ParamListBase as ParamListBase$1, RouteProp, NavigationState } from '@react-navigation/native';
|
|
12
13
|
export { NavigationContainer, NavigationContainerRef, NavigationProp, NavigationState, RouteProp, useFocusEffect, useIsFocused, useScrollToTop } from '@react-navigation/native';
|
|
@@ -1649,7 +1650,7 @@ interface LoadingProps {
|
|
|
1649
1650
|
* );
|
|
1650
1651
|
* ```
|
|
1651
1652
|
*/
|
|
1652
|
-
declare function Loading({ text, color, overlay, visible, testID
|
|
1653
|
+
declare function Loading({ text, color, overlay, visible, testID }: LoadingProps): react_jsx_runtime.JSX.Element | null;
|
|
1653
1654
|
|
|
1654
1655
|
/**
|
|
1655
1656
|
* Progress 组件属性接口
|
|
@@ -1933,6 +1934,65 @@ interface AppListProps<T = any> {
|
|
|
1933
1934
|
}
|
|
1934
1935
|
declare function AppList<T = any>({ data, renderItem, keyExtractor, loading, refreshing, onRefresh, hasMore, onEndReached, onEndReachedThreshold, error, onRetry, emptyTitle, emptyDescription, emptyIcon, EmptyComponent, divider, dividerStyle, skeletonCount, skeletonRender, ListHeaderComponent, ListFooterComponent, contentContainerStyle, style, numColumns, columnWrapperStyle, horizontal, showsVerticalScrollIndicator, showsHorizontalScrollIndicator, }: AppListProps<T>): react_jsx_runtime.JSX.Element;
|
|
1935
1936
|
|
|
1937
|
+
interface PageDrawerProps {
|
|
1938
|
+
/** 是否显示 */
|
|
1939
|
+
visible: boolean;
|
|
1940
|
+
/** 关闭回调 */
|
|
1941
|
+
onClose?: () => void;
|
|
1942
|
+
/** 标题 */
|
|
1943
|
+
title?: string;
|
|
1944
|
+
/** 自定义头部 */
|
|
1945
|
+
header?: React__default.ReactNode;
|
|
1946
|
+
/** 自定义底部 */
|
|
1947
|
+
footer?: React__default.ReactNode;
|
|
1948
|
+
/** 抽屉位置 */
|
|
1949
|
+
placement?: 'left' | 'right';
|
|
1950
|
+
/** 抽屉宽度 */
|
|
1951
|
+
width?: number;
|
|
1952
|
+
/** 是否启用手势关闭 */
|
|
1953
|
+
swipeEnabled?: boolean;
|
|
1954
|
+
/** 关闭阈值 */
|
|
1955
|
+
swipeThreshold?: number;
|
|
1956
|
+
/** 点击遮罩是否关闭 */
|
|
1957
|
+
closeOnBackdropPress?: boolean;
|
|
1958
|
+
/** 是否显示关闭按钮 */
|
|
1959
|
+
showCloseButton?: boolean;
|
|
1960
|
+
/** 内容 */
|
|
1961
|
+
children?: React__default.ReactNode;
|
|
1962
|
+
/** 测试 ID */
|
|
1963
|
+
testID?: string;
|
|
1964
|
+
/** 内容测试 ID */
|
|
1965
|
+
contentTestID?: string;
|
|
1966
|
+
/** 遮罩测试 ID */
|
|
1967
|
+
backdropTestID?: string;
|
|
1968
|
+
}
|
|
1969
|
+
declare function PageDrawer({ visible, onClose, title, header, footer, placement, width, swipeEnabled, swipeThreshold, closeOnBackdropPress, showCloseButton, children, testID, contentTestID, backdropTestID, }: PageDrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
1970
|
+
|
|
1971
|
+
interface GradientViewProps extends Omit<LinearGradientProps, 'colors' | 'style' | 'children'> {
|
|
1972
|
+
/** 渐变色列表,至少两个颜色 */
|
|
1973
|
+
colors: readonly [string, string, ...string[]];
|
|
1974
|
+
/** 子元素 */
|
|
1975
|
+
children?: React__default.ReactNode;
|
|
1976
|
+
/** 自定义容器样式 */
|
|
1977
|
+
style?: StyleProp<ViewStyle>;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* GradientView - 渐变背景容器
|
|
1981
|
+
*
|
|
1982
|
+
* 对 expo-linear-gradient 的轻量封装,用于页面级/卡片级渐变背景。
|
|
1983
|
+
*
|
|
1984
|
+
* @example
|
|
1985
|
+
* ```tsx
|
|
1986
|
+
* <GradientView
|
|
1987
|
+
* colors={['#f38b32', '#fb923c']}
|
|
1988
|
+
* style={{ padding: 24, borderRadius: 16 }}
|
|
1989
|
+
* >
|
|
1990
|
+
* <AppText color="white">渐变标题</AppText>
|
|
1991
|
+
* </GradientView>
|
|
1992
|
+
* ```
|
|
1993
|
+
*/
|
|
1994
|
+
declare function GradientView({ colors, start, end, children, style, ...props }: GradientViewProps): react_jsx_runtime.JSX.Element;
|
|
1995
|
+
|
|
1936
1996
|
/**
|
|
1937
1997
|
* AppInput 组件属性接口
|
|
1938
1998
|
*/
|
|
@@ -2170,6 +2230,34 @@ interface UseToggleActions {
|
|
|
2170
2230
|
*/
|
|
2171
2231
|
declare function useToggle(defaultValue?: boolean): [boolean, UseToggleActions];
|
|
2172
2232
|
|
|
2233
|
+
interface UsePageDrawerReturn {
|
|
2234
|
+
/** 当前是否打开 */
|
|
2235
|
+
visible: boolean;
|
|
2236
|
+
/** 打开抽屉 */
|
|
2237
|
+
open: () => void;
|
|
2238
|
+
/** 关闭抽屉 */
|
|
2239
|
+
close: () => void;
|
|
2240
|
+
/** 切换抽屉开关状态 */
|
|
2241
|
+
toggle: () => void;
|
|
2242
|
+
/** 直接设置抽屉可见状态 */
|
|
2243
|
+
setVisible: (visible: boolean) => void;
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* 页面级抽屉状态管理 Hook
|
|
2247
|
+
*
|
|
2248
|
+
* @param defaultVisible - 默认是否打开
|
|
2249
|
+
* @returns 抽屉可见状态和控制方法
|
|
2250
|
+
*
|
|
2251
|
+
* @example
|
|
2252
|
+
* ```tsx
|
|
2253
|
+
* const drawer = usePageDrawer();
|
|
2254
|
+
*
|
|
2255
|
+
* <AppButton onPress={drawer.open}>打开筛选</AppButton>
|
|
2256
|
+
* <PageDrawer visible={drawer.visible} onClose={drawer.close} />
|
|
2257
|
+
* ```
|
|
2258
|
+
*/
|
|
2259
|
+
declare function usePageDrawer(defaultVisible?: boolean): UsePageDrawerReturn;
|
|
2260
|
+
|
|
2173
2261
|
/**
|
|
2174
2262
|
* 防抖 Hook
|
|
2175
2263
|
* @param value - 需要防抖的值
|
|
@@ -3460,4 +3548,4 @@ interface AlertContextType {
|
|
|
3460
3548
|
*/
|
|
3461
3549
|
declare function useAlert(): AlertContextType;
|
|
3462
3550
|
|
|
3463
|
-
export { ActionIcons, Alert, type AlertContextType, type AlertOptions, type AlertProps, type ApiBusinessErrorParser, type ApiConfig, type ApiEndpointConfig, type ApiErrorContext, type ApiErrorHandler, type ApiMethod, AppButton, type AppButtonProps, type AppError, AppHeader, type AppHeaderProps, AppImage, type AppImageProps, AppInput, type AppInputProps, AppList, type AppListProps, type AppNavigation, AppPressable, type AppPressableProps, AppProvider, type AppProviderProps, AppScrollView, type AppScrollViewProps, AppStatusBar, type AppStatusBarProps, AppText, type AppTextProps, AppView, type AppViewProps, BottomTabBar, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Col, type ColProps, type ColorPalette$1 as ColorPalette, type ColorToken, type CustomBottomTabBarProps, DatePicker, type DatePickerProps, DrawerContent, type DrawerContentProps, type DrawerItem, type DrawerNavigation, DrawerNavigator, type DrawerNavigatorProps, type DrawerOptions, type DrawerParamList, type DrawerRouteConfig, type DrawerScreenOptions, type DrawerScreenProps, ErrorCode, FileIcons, type FormErrors, type FormGroupOption, FormItem, type FormItemProps, Icon, type IconProps, type IconSize, type InfiniteFetchParams, type InfiniteFetchResult, type LinkingConfig, Loading, type LoadingContextType, type LoadingProps, type LoadingState, MemoryStorage, NavigationIcons, NavigationProvider, type NavigationProviderProps, type Orientation, OverlayProvider, type OverlayProviderProps, Page, type PaginationParams, type PaginationResult, type ParamListBase, type PathConfig, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RgbObject, type RouteConfig, Row, type RowProps, SafeBottom, SafeScreen, type SafeScreenProps, Select, type SelectOption, type SelectProps, Slider, type SliderProps, type StackNavigation, StackNavigator, type StackNavigatorProps, type StackParamList, type StackRouteConfig, type StackScreenOptions, type StackScreenProps, StatusIcons, Switch, type SwitchProps, type TabBarOptions, type TabNavigation, TabNavigator, type TabNavigatorProps, type TabParamList, type TabRouteConfig, type TabScreenOptions, type TabScreenProps, type Theme, type ColorPalette as ThemeColorPalette, type ThemeConfig, ThemeProvider, Toast, type ToastContextType, type ToastItem, type ToastProps, type ToastType, type UseAsyncState, type UseDimensionsReturn, type UseFormOptions, type UseInfiniteOptions, type UseInfiniteReturn, type UseKeyboardReturn, type UseOrientationReturn, type UsePaginationOptions, type UsePaginationReturn, type UseRefreshReturn, type UseToggleActions, adjustBrightness, capitalize, clamp, cn, createAPI, createDrawerScreens, createNavigationTheme, createStackScreens, createTabScreens, createTheme, deepMerge, enhanceError, formatCurrency, formatDate, formatNumber, formatPercent, formatRelativeTime, generateColorPalette, getThemeColors, getValidationErrors, hexToRgb, isDevelopment, isValidEmail, isValidPhone, mapHttpStatus, omit, pick, rgbToHex, slugify, storage, truncate, useAlert, useAsyncState, useBackHandler, useDebounce, useDimensions, useDrawerNavigation, useForm, useInfinite, useKeyboard, useLoading, useMemoizedFn, useNavigation, useNavigationState, useOrientation, usePagination, usePrevious, useRefresh, useRequest, useRoute, useSetState, useStackNavigation, useStorage, useTabNavigation, useTheme, useThemeColors, useThrottle, useToast, useToggle, useUpdateEffect };
|
|
3551
|
+
export { ActionIcons, Alert, type AlertContextType, type AlertOptions, type AlertProps, type ApiBusinessErrorParser, type ApiConfig, type ApiEndpointConfig, type ApiErrorContext, type ApiErrorHandler, type ApiMethod, AppButton, type AppButtonProps, type AppError, AppHeader, type AppHeaderProps, AppImage, type AppImageProps, AppInput, type AppInputProps, AppList, type AppListProps, type AppNavigation, AppPressable, type AppPressableProps, AppProvider, type AppProviderProps, AppScrollView, type AppScrollViewProps, AppStatusBar, type AppStatusBarProps, AppText, type AppTextProps, AppView, type AppViewProps, BottomTabBar, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Col, type ColProps, type ColorPalette$1 as ColorPalette, type ColorToken, type CustomBottomTabBarProps, DatePicker, type DatePickerProps, DrawerContent, type DrawerContentProps, type DrawerItem, type DrawerNavigation, DrawerNavigator, type DrawerNavigatorProps, type DrawerOptions, type DrawerParamList, type DrawerRouteConfig, type DrawerScreenOptions, type DrawerScreenProps, ErrorCode, FileIcons, type FormErrors, type FormGroupOption, FormItem, type FormItemProps, GradientView, type GradientViewProps, Icon, type IconProps, type IconSize, type InfiniteFetchParams, type InfiniteFetchResult, type LinkingConfig, Loading, type LoadingContextType, type LoadingProps, type LoadingState, MemoryStorage, NavigationIcons, NavigationProvider, type NavigationProviderProps, type Orientation, OverlayProvider, type OverlayProviderProps, Page, PageDrawer, type PageDrawerProps, type PaginationParams, type PaginationResult, type ParamListBase, type PathConfig, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RgbObject, type RouteConfig, Row, type RowProps, SafeBottom, SafeScreen, type SafeScreenProps, Select, type SelectOption, type SelectProps, Slider, type SliderProps, type StackNavigation, StackNavigator, type StackNavigatorProps, type StackParamList, type StackRouteConfig, type StackScreenOptions, type StackScreenProps, StatusIcons, Switch, type SwitchProps, type TabBarOptions, type TabNavigation, TabNavigator, type TabNavigatorProps, type TabParamList, type TabRouteConfig, type TabScreenOptions, type TabScreenProps, type Theme, type ColorPalette as ThemeColorPalette, type ThemeConfig, ThemeProvider, Toast, type ToastContextType, type ToastItem, type ToastProps, type ToastType, type UseAsyncState, type UseDimensionsReturn, type UseFormOptions, type UseInfiniteOptions, type UseInfiniteReturn, type UseKeyboardReturn, type UseOrientationReturn, type UsePageDrawerReturn, type UsePaginationOptions, type UsePaginationReturn, type UseRefreshReturn, type UseToggleActions, adjustBrightness, capitalize, clamp, cn, createAPI, createDrawerScreens, createNavigationTheme, createStackScreens, createTabScreens, createTheme, deepMerge, enhanceError, formatCurrency, formatDate, formatNumber, formatPercent, formatRelativeTime, generateColorPalette, getThemeColors, getValidationErrors, hexToRgb, isDevelopment, isValidEmail, isValidPhone, mapHttpStatus, omit, pick, rgbToHex, slugify, storage, truncate, useAlert, useAsyncState, useBackHandler, useDebounce, useDimensions, useDrawerNavigation, useForm, useInfinite, useKeyboard, useLoading, useMemoizedFn, useNavigation, useNavigationState, useOrientation, usePageDrawer, usePagination, usePrevious, useRefresh, useRequest, useRoute, useSetState, useStackNavigation, useStorage, useTabNavigation, useTheme, useThemeColors, useThrottle, useToast, useToggle, useUpdateEffect };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as React$1 from 'react';
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
export { useMutation, useQuery } from '@tanstack/react-query';
|
|
9
9
|
import { ViewProps, ScrollViewProps, TextProps, PressableProps, StyleProp, TextStyle, ImageSourcePropType, ImageStyle, ListRenderItem, ViewStyle, TextInputProps, TextInput, StatusBarProps, StatusBarStyle } from 'react-native';
|
|
10
|
+
import { LinearGradientProps } from 'expo-linear-gradient';
|
|
10
11
|
import * as _react_navigation_native from '@react-navigation/native';
|
|
11
12
|
import { LinkingOptions, Theme as Theme$1, NavigationProp, ParamListBase as ParamListBase$1, RouteProp, NavigationState } from '@react-navigation/native';
|
|
12
13
|
export { NavigationContainer, NavigationContainerRef, NavigationProp, NavigationState, RouteProp, useFocusEffect, useIsFocused, useScrollToTop } from '@react-navigation/native';
|
|
@@ -1649,7 +1650,7 @@ interface LoadingProps {
|
|
|
1649
1650
|
* );
|
|
1650
1651
|
* ```
|
|
1651
1652
|
*/
|
|
1652
|
-
declare function Loading({ text, color, overlay, visible, testID
|
|
1653
|
+
declare function Loading({ text, color, overlay, visible, testID }: LoadingProps): react_jsx_runtime.JSX.Element | null;
|
|
1653
1654
|
|
|
1654
1655
|
/**
|
|
1655
1656
|
* Progress 组件属性接口
|
|
@@ -1933,6 +1934,65 @@ interface AppListProps<T = any> {
|
|
|
1933
1934
|
}
|
|
1934
1935
|
declare function AppList<T = any>({ data, renderItem, keyExtractor, loading, refreshing, onRefresh, hasMore, onEndReached, onEndReachedThreshold, error, onRetry, emptyTitle, emptyDescription, emptyIcon, EmptyComponent, divider, dividerStyle, skeletonCount, skeletonRender, ListHeaderComponent, ListFooterComponent, contentContainerStyle, style, numColumns, columnWrapperStyle, horizontal, showsVerticalScrollIndicator, showsHorizontalScrollIndicator, }: AppListProps<T>): react_jsx_runtime.JSX.Element;
|
|
1935
1936
|
|
|
1937
|
+
interface PageDrawerProps {
|
|
1938
|
+
/** 是否显示 */
|
|
1939
|
+
visible: boolean;
|
|
1940
|
+
/** 关闭回调 */
|
|
1941
|
+
onClose?: () => void;
|
|
1942
|
+
/** 标题 */
|
|
1943
|
+
title?: string;
|
|
1944
|
+
/** 自定义头部 */
|
|
1945
|
+
header?: React__default.ReactNode;
|
|
1946
|
+
/** 自定义底部 */
|
|
1947
|
+
footer?: React__default.ReactNode;
|
|
1948
|
+
/** 抽屉位置 */
|
|
1949
|
+
placement?: 'left' | 'right';
|
|
1950
|
+
/** 抽屉宽度 */
|
|
1951
|
+
width?: number;
|
|
1952
|
+
/** 是否启用手势关闭 */
|
|
1953
|
+
swipeEnabled?: boolean;
|
|
1954
|
+
/** 关闭阈值 */
|
|
1955
|
+
swipeThreshold?: number;
|
|
1956
|
+
/** 点击遮罩是否关闭 */
|
|
1957
|
+
closeOnBackdropPress?: boolean;
|
|
1958
|
+
/** 是否显示关闭按钮 */
|
|
1959
|
+
showCloseButton?: boolean;
|
|
1960
|
+
/** 内容 */
|
|
1961
|
+
children?: React__default.ReactNode;
|
|
1962
|
+
/** 测试 ID */
|
|
1963
|
+
testID?: string;
|
|
1964
|
+
/** 内容测试 ID */
|
|
1965
|
+
contentTestID?: string;
|
|
1966
|
+
/** 遮罩测试 ID */
|
|
1967
|
+
backdropTestID?: string;
|
|
1968
|
+
}
|
|
1969
|
+
declare function PageDrawer({ visible, onClose, title, header, footer, placement, width, swipeEnabled, swipeThreshold, closeOnBackdropPress, showCloseButton, children, testID, contentTestID, backdropTestID, }: PageDrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
1970
|
+
|
|
1971
|
+
interface GradientViewProps extends Omit<LinearGradientProps, 'colors' | 'style' | 'children'> {
|
|
1972
|
+
/** 渐变色列表,至少两个颜色 */
|
|
1973
|
+
colors: readonly [string, string, ...string[]];
|
|
1974
|
+
/** 子元素 */
|
|
1975
|
+
children?: React__default.ReactNode;
|
|
1976
|
+
/** 自定义容器样式 */
|
|
1977
|
+
style?: StyleProp<ViewStyle>;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* GradientView - 渐变背景容器
|
|
1981
|
+
*
|
|
1982
|
+
* 对 expo-linear-gradient 的轻量封装,用于页面级/卡片级渐变背景。
|
|
1983
|
+
*
|
|
1984
|
+
* @example
|
|
1985
|
+
* ```tsx
|
|
1986
|
+
* <GradientView
|
|
1987
|
+
* colors={['#f38b32', '#fb923c']}
|
|
1988
|
+
* style={{ padding: 24, borderRadius: 16 }}
|
|
1989
|
+
* >
|
|
1990
|
+
* <AppText color="white">渐变标题</AppText>
|
|
1991
|
+
* </GradientView>
|
|
1992
|
+
* ```
|
|
1993
|
+
*/
|
|
1994
|
+
declare function GradientView({ colors, start, end, children, style, ...props }: GradientViewProps): react_jsx_runtime.JSX.Element;
|
|
1995
|
+
|
|
1936
1996
|
/**
|
|
1937
1997
|
* AppInput 组件属性接口
|
|
1938
1998
|
*/
|
|
@@ -2170,6 +2230,34 @@ interface UseToggleActions {
|
|
|
2170
2230
|
*/
|
|
2171
2231
|
declare function useToggle(defaultValue?: boolean): [boolean, UseToggleActions];
|
|
2172
2232
|
|
|
2233
|
+
interface UsePageDrawerReturn {
|
|
2234
|
+
/** 当前是否打开 */
|
|
2235
|
+
visible: boolean;
|
|
2236
|
+
/** 打开抽屉 */
|
|
2237
|
+
open: () => void;
|
|
2238
|
+
/** 关闭抽屉 */
|
|
2239
|
+
close: () => void;
|
|
2240
|
+
/** 切换抽屉开关状态 */
|
|
2241
|
+
toggle: () => void;
|
|
2242
|
+
/** 直接设置抽屉可见状态 */
|
|
2243
|
+
setVisible: (visible: boolean) => void;
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* 页面级抽屉状态管理 Hook
|
|
2247
|
+
*
|
|
2248
|
+
* @param defaultVisible - 默认是否打开
|
|
2249
|
+
* @returns 抽屉可见状态和控制方法
|
|
2250
|
+
*
|
|
2251
|
+
* @example
|
|
2252
|
+
* ```tsx
|
|
2253
|
+
* const drawer = usePageDrawer();
|
|
2254
|
+
*
|
|
2255
|
+
* <AppButton onPress={drawer.open}>打开筛选</AppButton>
|
|
2256
|
+
* <PageDrawer visible={drawer.visible} onClose={drawer.close} />
|
|
2257
|
+
* ```
|
|
2258
|
+
*/
|
|
2259
|
+
declare function usePageDrawer(defaultVisible?: boolean): UsePageDrawerReturn;
|
|
2260
|
+
|
|
2173
2261
|
/**
|
|
2174
2262
|
* 防抖 Hook
|
|
2175
2263
|
* @param value - 需要防抖的值
|
|
@@ -3460,4 +3548,4 @@ interface AlertContextType {
|
|
|
3460
3548
|
*/
|
|
3461
3549
|
declare function useAlert(): AlertContextType;
|
|
3462
3550
|
|
|
3463
|
-
export { ActionIcons, Alert, type AlertContextType, type AlertOptions, type AlertProps, type ApiBusinessErrorParser, type ApiConfig, type ApiEndpointConfig, type ApiErrorContext, type ApiErrorHandler, type ApiMethod, AppButton, type AppButtonProps, type AppError, AppHeader, type AppHeaderProps, AppImage, type AppImageProps, AppInput, type AppInputProps, AppList, type AppListProps, type AppNavigation, AppPressable, type AppPressableProps, AppProvider, type AppProviderProps, AppScrollView, type AppScrollViewProps, AppStatusBar, type AppStatusBarProps, AppText, type AppTextProps, AppView, type AppViewProps, BottomTabBar, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Col, type ColProps, type ColorPalette$1 as ColorPalette, type ColorToken, type CustomBottomTabBarProps, DatePicker, type DatePickerProps, DrawerContent, type DrawerContentProps, type DrawerItem, type DrawerNavigation, DrawerNavigator, type DrawerNavigatorProps, type DrawerOptions, type DrawerParamList, type DrawerRouteConfig, type DrawerScreenOptions, type DrawerScreenProps, ErrorCode, FileIcons, type FormErrors, type FormGroupOption, FormItem, type FormItemProps, Icon, type IconProps, type IconSize, type InfiniteFetchParams, type InfiniteFetchResult, type LinkingConfig, Loading, type LoadingContextType, type LoadingProps, type LoadingState, MemoryStorage, NavigationIcons, NavigationProvider, type NavigationProviderProps, type Orientation, OverlayProvider, type OverlayProviderProps, Page, type PaginationParams, type PaginationResult, type ParamListBase, type PathConfig, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RgbObject, type RouteConfig, Row, type RowProps, SafeBottom, SafeScreen, type SafeScreenProps, Select, type SelectOption, type SelectProps, Slider, type SliderProps, type StackNavigation, StackNavigator, type StackNavigatorProps, type StackParamList, type StackRouteConfig, type StackScreenOptions, type StackScreenProps, StatusIcons, Switch, type SwitchProps, type TabBarOptions, type TabNavigation, TabNavigator, type TabNavigatorProps, type TabParamList, type TabRouteConfig, type TabScreenOptions, type TabScreenProps, type Theme, type ColorPalette as ThemeColorPalette, type ThemeConfig, ThemeProvider, Toast, type ToastContextType, type ToastItem, type ToastProps, type ToastType, type UseAsyncState, type UseDimensionsReturn, type UseFormOptions, type UseInfiniteOptions, type UseInfiniteReturn, type UseKeyboardReturn, type UseOrientationReturn, type UsePaginationOptions, type UsePaginationReturn, type UseRefreshReturn, type UseToggleActions, adjustBrightness, capitalize, clamp, cn, createAPI, createDrawerScreens, createNavigationTheme, createStackScreens, createTabScreens, createTheme, deepMerge, enhanceError, formatCurrency, formatDate, formatNumber, formatPercent, formatRelativeTime, generateColorPalette, getThemeColors, getValidationErrors, hexToRgb, isDevelopment, isValidEmail, isValidPhone, mapHttpStatus, omit, pick, rgbToHex, slugify, storage, truncate, useAlert, useAsyncState, useBackHandler, useDebounce, useDimensions, useDrawerNavigation, useForm, useInfinite, useKeyboard, useLoading, useMemoizedFn, useNavigation, useNavigationState, useOrientation, usePagination, usePrevious, useRefresh, useRequest, useRoute, useSetState, useStackNavigation, useStorage, useTabNavigation, useTheme, useThemeColors, useThrottle, useToast, useToggle, useUpdateEffect };
|
|
3551
|
+
export { ActionIcons, Alert, type AlertContextType, type AlertOptions, type AlertProps, type ApiBusinessErrorParser, type ApiConfig, type ApiEndpointConfig, type ApiErrorContext, type ApiErrorHandler, type ApiMethod, AppButton, type AppButtonProps, type AppError, AppHeader, type AppHeaderProps, AppImage, type AppImageProps, AppInput, type AppInputProps, AppList, type AppListProps, type AppNavigation, AppPressable, type AppPressableProps, AppProvider, type AppProviderProps, AppScrollView, type AppScrollViewProps, AppStatusBar, type AppStatusBarProps, AppText, type AppTextProps, AppView, type AppViewProps, BottomTabBar, Card, type CardProps, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Col, type ColProps, type ColorPalette$1 as ColorPalette, type ColorToken, type CustomBottomTabBarProps, DatePicker, type DatePickerProps, DrawerContent, type DrawerContentProps, type DrawerItem, type DrawerNavigation, DrawerNavigator, type DrawerNavigatorProps, type DrawerOptions, type DrawerParamList, type DrawerRouteConfig, type DrawerScreenOptions, type DrawerScreenProps, ErrorCode, FileIcons, type FormErrors, type FormGroupOption, FormItem, type FormItemProps, GradientView, type GradientViewProps, Icon, type IconProps, type IconSize, type InfiniteFetchParams, type InfiniteFetchResult, type LinkingConfig, Loading, type LoadingContextType, type LoadingProps, type LoadingState, MemoryStorage, NavigationIcons, NavigationProvider, type NavigationProviderProps, type Orientation, OverlayProvider, type OverlayProviderProps, Page, PageDrawer, type PageDrawerProps, type PaginationParams, type PaginationResult, type ParamListBase, type PathConfig, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RgbObject, type RouteConfig, Row, type RowProps, SafeBottom, SafeScreen, type SafeScreenProps, Select, type SelectOption, type SelectProps, Slider, type SliderProps, type StackNavigation, StackNavigator, type StackNavigatorProps, type StackParamList, type StackRouteConfig, type StackScreenOptions, type StackScreenProps, StatusIcons, Switch, type SwitchProps, type TabBarOptions, type TabNavigation, TabNavigator, type TabNavigatorProps, type TabParamList, type TabRouteConfig, type TabScreenOptions, type TabScreenProps, type Theme, type ColorPalette as ThemeColorPalette, type ThemeConfig, ThemeProvider, Toast, type ToastContextType, type ToastItem, type ToastProps, type ToastType, type UseAsyncState, type UseDimensionsReturn, type UseFormOptions, type UseInfiniteOptions, type UseInfiniteReturn, type UseKeyboardReturn, type UseOrientationReturn, type UsePageDrawerReturn, type UsePaginationOptions, type UsePaginationReturn, type UseRefreshReturn, type UseToggleActions, adjustBrightness, capitalize, clamp, cn, createAPI, createDrawerScreens, createNavigationTheme, createStackScreens, createTabScreens, createTheme, deepMerge, enhanceError, formatCurrency, formatDate, formatNumber, formatPercent, formatRelativeTime, generateColorPalette, getThemeColors, getValidationErrors, hexToRgb, isDevelopment, isValidEmail, isValidPhone, mapHttpStatus, omit, pick, rgbToHex, slugify, storage, truncate, useAlert, useAsyncState, useBackHandler, useDebounce, useDimensions, useDrawerNavigation, useForm, useInfinite, useKeyboard, useLoading, useMemoizedFn, useNavigation, useNavigationState, useOrientation, usePageDrawer, usePagination, usePrevious, useRefresh, useRequest, useRoute, useSetState, useStackNavigation, useStorage, useTabNavigation, useTheme, useThemeColors, useThrottle, useToast, useToggle, useUpdateEffect };
|