taro-uno-ui 1.0.0 → 1.0.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 +1 -1
- package/dist/js/index-CDFsvu80.js.map +1 -1
- package/dist/js/index-JffnTUrv.js.map +1 -1
- package/dist/utils/http/request.d.ts +1 -1
- package/package.json +2 -2
- package/src/utils/http/request.ts +1 -1
- package/dist/app.config.d.ts +0 -38
- package/dist/app.d.ts +0 -6
- package/dist/components/basic/Button/Button.d.ts +0 -6
- package/dist/components/basic/Button/Button.styles.d.ts +0 -2
- package/dist/components/basic/Button/Button.types.d.ts +0 -74
- package/dist/components/basic/Button/index.d.ts +0 -4
- package/dist/components/basic/Divider/Divider.d.ts +0 -6
- package/dist/components/basic/Divider/Divider.styles.d.ts +0 -87
- package/dist/components/basic/Divider/Divider.types.d.ts +0 -242
- package/dist/components/basic/Divider/index.d.ts +0 -6
- package/dist/components/basic/Icon/Icon.d.ts +0 -5
- package/dist/components/basic/Icon/Icon.data.d.ts +0 -29
- package/dist/components/basic/Icon/Icon.styles.d.ts +0 -61
- package/dist/components/basic/Icon/Icon.types.d.ts +0 -199
- package/dist/components/basic/Icon/IconManager.d.ts +0 -120
- package/dist/components/basic/Icon/index.d.ts +0 -6
- package/dist/components/basic/Text/Text.d.ts +0 -7
- package/dist/components/basic/Text/Text.styles.d.ts +0 -67
- package/dist/components/basic/Text/Text.types.d.ts +0 -274
- package/dist/components/basic/Text/index.d.ts +0 -5
- package/dist/components/basic/Typography/Typography.d.ts +0 -8
- package/dist/components/basic/Typography/Typography.styles.d.ts +0 -83
- package/dist/components/basic/Typography/Typography.types.d.ts +0 -245
- package/dist/components/basic/Typography/index.d.ts +0 -3
- package/dist/components/basic/Video/Video.d.ts +0 -7
- package/dist/components/basic/Video/Video.styles.d.ts +0 -212
- package/dist/components/basic/Video/Video.types.d.ts +0 -447
- package/dist/components/basic/Video/index.d.ts +0 -10
- package/dist/components/basic/index.d.ts +0 -217
- package/dist/components/common/ErrorBoundary.d.ts +0 -19
- package/dist/components/common/LazyComponent.d.ts +0 -78
- package/dist/components/common/ResponsiveContainer.d.ts +0 -23
- package/dist/components/common/ResponsiveGrid.d.ts +0 -44
- package/dist/components/common/SecurityProvider.d.ts +0 -15
- package/dist/components/common/ThemeProvider.d.ts +0 -17
- package/dist/components/common/VirtualList.d.ts +0 -89
- package/dist/components/common/index.d.ts +0 -17
- package/dist/components/display/Avatar/Avatar.d.ts +0 -3
- package/dist/components/display/Avatar/Avatar.styles.d.ts +0 -2
- package/dist/components/display/Avatar/Avatar.types.d.ts +0 -37
- package/dist/components/display/Avatar/index.d.ts +0 -3
- package/dist/components/display/Badge/Badge.d.ts +0 -3
- package/dist/components/display/Badge/Badge.types.d.ts +0 -27
- package/dist/components/display/Badge/index.d.ts +0 -2
- package/dist/components/display/Calendar/Calendar.d.ts +0 -5
- package/dist/components/display/Calendar/Calendar.styles.d.ts +0 -2
- package/dist/components/display/Calendar/Calendar.types.d.ts +0 -87
- package/dist/components/display/Calendar/index.d.ts +0 -3
- package/dist/components/display/Card/Card.d.ts +0 -3
- package/dist/components/display/Card/Card.styles.d.ts +0 -1
- package/dist/components/display/Card/Card.types.d.ts +0 -52
- package/dist/components/display/Card/index.d.ts +0 -3
- package/dist/components/display/Carousel/Carousel.d.ts +0 -5
- package/dist/components/display/Carousel/Carousel.styles.d.ts +0 -2
- package/dist/components/display/Carousel/Carousel.types.d.ts +0 -55
- package/dist/components/display/Carousel/index.d.ts +0 -3
- package/dist/components/display/List/List.d.ts +0 -4
- package/dist/components/display/List/List.styles.d.ts +0 -1
- package/dist/components/display/List/List.types.d.ts +0 -64
- package/dist/components/display/List/index.d.ts +0 -3
- package/dist/components/display/Rate/Rate.d.ts +0 -6
- package/dist/components/display/Rate/Rate.styles.d.ts +0 -100
- package/dist/components/display/Rate/Rate.types.d.ts +0 -105
- package/dist/components/display/Rate/index.d.ts +0 -17
- package/dist/components/display/Table/Table.d.ts +0 -7
- package/dist/components/display/Table/Table.styles.d.ts +0 -84
- package/dist/components/display/Table/Table.types.d.ts +0 -251
- package/dist/components/display/Table/index.d.ts +0 -4
- package/dist/components/display/Tag/Tag.d.ts +0 -5
- package/dist/components/display/Tag/Tag.styles.d.ts +0 -2
- package/dist/components/display/Tag/Tag.types.d.ts +0 -47
- package/dist/components/display/Tag/index.d.ts +0 -3
- package/dist/components/display/Timeline/Timeline.d.ts +0 -16
- package/dist/components/display/Timeline/Timeline.styles.d.ts +0 -2
- package/dist/components/display/Timeline/Timeline.types.d.ts +0 -53
- package/dist/components/display/Timeline/index.d.ts +0 -3
- package/dist/components/display/index.d.ts +0 -67
- package/dist/components/feedback/Loading/Loading.d.ts +0 -4
- package/dist/components/feedback/Loading/Loading.styles.d.ts +0 -2
- package/dist/components/feedback/Loading/Loading.types.d.ts +0 -29
- package/dist/components/feedback/Loading/index.d.ts +0 -4
- package/dist/components/feedback/Message/Message.d.ts +0 -4
- package/dist/components/feedback/Message/Message.styles.d.ts +0 -34
- package/dist/components/feedback/Message/Message.types.d.ts +0 -33
- package/dist/components/feedback/Message/index.d.ts +0 -4
- package/dist/components/feedback/Modal/Modal.d.ts +0 -8
- package/dist/components/feedback/Modal/Modal.styles.d.ts +0 -18
- package/dist/components/feedback/Modal/Modal.types.d.ts +0 -143
- package/dist/components/feedback/Modal/index.d.ts +0 -3
- package/dist/components/feedback/Notification/Notification.d.ts +0 -4
- package/dist/components/feedback/Notification/Notification.styles.d.ts +0 -88
- package/dist/components/feedback/Notification/Notification.types.d.ts +0 -279
- package/dist/components/feedback/Notification/NotificationManager.d.ts +0 -4
- package/dist/components/feedback/Notification/index.d.ts +0 -25
- package/dist/components/feedback/Progress/Progress.d.ts +0 -4
- package/dist/components/feedback/Progress/Progress.styles.d.ts +0 -261
- package/dist/components/feedback/Progress/Progress.test.simple.d.ts +0 -2
- package/dist/components/feedback/Progress/Progress.types.d.ts +0 -147
- package/dist/components/feedback/Progress/index.d.ts +0 -3
- package/dist/components/feedback/Progress/utils/animation.d.ts +0 -55
- package/dist/components/feedback/Progress/utils/index.d.ts +0 -2
- package/dist/components/feedback/Progress/utils/progress-calculator.d.ts +0 -75
- package/dist/components/feedback/Result/Result.d.ts +0 -7
- package/dist/components/feedback/Result/Result.styles.d.ts +0 -2
- package/dist/components/feedback/Result/Result.types.d.ts +0 -66
- package/dist/components/feedback/Result/index.d.ts +0 -3
- package/dist/components/feedback/Toast/Toast.d.ts +0 -7
- package/dist/components/feedback/Toast/Toast.styles.d.ts +0 -14
- package/dist/components/feedback/Toast/Toast.types.d.ts +0 -81
- package/dist/components/feedback/Toast/index.d.ts +0 -3
- package/dist/components/feedback/Tooltip/Tooltip.d.ts +0 -4
- package/dist/components/feedback/Tooltip/Tooltip.examples.d.ts +0 -6
- package/dist/components/feedback/Tooltip/Tooltip.styles.d.ts +0 -78
- package/dist/components/feedback/Tooltip/Tooltip.types.d.ts +0 -130
- package/dist/components/feedback/Tooltip/index.d.ts +0 -3
- package/dist/components/feedback/index.d.ts +0 -71
- package/dist/components/form/Cascader/Cascader.d.ts +0 -7
- package/dist/components/form/Cascader/Cascader.styles.d.ts +0 -107
- package/dist/components/form/Cascader/Cascader.types.d.ts +0 -418
- package/dist/components/form/Cascader/hooks/index.d.ts +0 -3
- package/dist/components/form/Cascader/hooks/useCascaderFieldNames.d.ts +0 -12
- package/dist/components/form/Cascader/hooks/useCascaderOptions.d.ts +0 -15
- package/dist/components/form/Cascader/hooks/useCascaderState.d.ts +0 -23
- package/dist/components/form/Cascader/index.d.ts +0 -6
- package/dist/components/form/Cascader/utils/formatDisplayValue.d.ts +0 -9
- package/dist/components/form/Cascader/utils/index.d.ts +0 -1
- package/dist/components/form/Checkbox/Checkbox.d.ts +0 -6
- package/dist/components/form/Checkbox/Checkbox.styles.d.ts +0 -111
- package/dist/components/form/Checkbox/Checkbox.types.d.ts +0 -473
- package/dist/components/form/Checkbox/CheckboxGroup.d.ts +0 -6
- package/dist/components/form/Checkbox/index.d.ts +0 -8
- package/dist/components/form/DatePicker/DatePicker.d.ts +0 -6
- package/dist/components/form/DatePicker/DatePicker.styles.d.ts +0 -99
- package/dist/components/form/DatePicker/DatePicker.types.d.ts +0 -236
- package/dist/components/form/DatePicker/index.d.ts +0 -3
- package/dist/components/form/Form/Form.d.ts +0 -8
- package/dist/components/form/Form/Form.styles.d.ts +0 -84
- package/dist/components/form/Form/Form.types.d.ts +0 -416
- package/dist/components/form/Form/index.d.ts +0 -9
- package/dist/components/form/Form/useFormLogic.d.ts +0 -22
- package/dist/components/form/Input/Input.d.ts +0 -6
- package/dist/components/form/Input/Input.styles.d.ts +0 -61
- package/dist/components/form/Input/Input.types.d.ts +0 -294
- package/dist/components/form/Input/index.d.ts +0 -8
- package/dist/components/form/Input/useInputLogic.d.ts +0 -35
- package/dist/components/form/InputNumber/InputNumber.d.ts +0 -6
- package/dist/components/form/InputNumber/InputNumber.styles.d.ts +0 -120
- package/dist/components/form/InputNumber/InputNumber.types.d.ts +0 -303
- package/dist/components/form/InputNumber/components/InputNumberClearButton.d.ts +0 -10
- package/dist/components/form/InputNumber/components/InputNumberControls.d.ts +0 -11
- package/dist/components/form/InputNumber/components/index.d.ts +0 -2
- package/dist/components/form/InputNumber/hooks/index.d.ts +0 -4
- package/dist/components/form/InputNumber/hooks/useInputNumberState.d.ts +0 -38
- package/dist/components/form/InputNumber/hooks/useInputNumberValidation.d.ts +0 -12
- package/dist/components/form/InputNumber/index.d.ts +0 -5
- package/dist/components/form/Radio/Radio.d.ts +0 -6
- package/dist/components/form/Radio/Radio.styles.d.ts +0 -80
- package/dist/components/form/Radio/Radio.types.d.ts +0 -415
- package/dist/components/form/Radio/index.d.ts +0 -8
- package/dist/components/form/Select/Select.d.ts +0 -6
- package/dist/components/form/Select/Select.styles.d.ts +0 -71
- package/dist/components/form/Select/Select.types.d.ts +0 -418
- package/dist/components/form/Select/index.d.ts +0 -8
- package/dist/components/form/Slider/Slider.d.ts +0 -7
- package/dist/components/form/Slider/Slider.styles.d.ts +0 -2
- package/dist/components/form/Slider/Slider.types.d.ts +0 -85
- package/dist/components/form/Slider/index.d.ts +0 -3
- package/dist/components/form/Switch/Switch.d.ts +0 -10
- package/dist/components/form/Switch/Switch.styles.d.ts +0 -154
- package/dist/components/form/Switch/Switch.types.d.ts +0 -351
- package/dist/components/form/Switch/index.d.ts +0 -7
- package/dist/components/form/Textarea/Textarea.d.ts +0 -6
- package/dist/components/form/Textarea/Textarea.styles.d.ts +0 -66
- package/dist/components/form/Textarea/Textarea.types.d.ts +0 -348
- package/dist/components/form/Textarea/index.d.ts +0 -7
- package/dist/components/form/TimePicker/TimePicker.d.ts +0 -6
- package/dist/components/form/TimePicker/TimePicker.styles.d.ts +0 -104
- package/dist/components/form/TimePicker/TimePicker.types.d.ts +0 -385
- package/dist/components/form/TimePicker/index.d.ts +0 -4
- package/dist/components/form/Transfer/Transfer.d.ts +0 -7
- package/dist/components/form/Transfer/Transfer.styles.d.ts +0 -106
- package/dist/components/form/Transfer/Transfer.types.d.ts +0 -384
- package/dist/components/form/Transfer/components/TransferItem.d.ts +0 -23
- package/dist/components/form/Transfer/components/TransferList.d.ts +0 -55
- package/dist/components/form/Transfer/components/TransferOperations.d.ts +0 -21
- package/dist/components/form/Transfer/components/TransferPagination.d.ts +0 -19
- package/dist/components/form/Transfer/components/TransferSearch.d.ts +0 -21
- package/dist/components/form/Transfer/components/index.d.ts +0 -6
- package/dist/components/form/Transfer/hooks/index.d.ts +0 -3
- package/dist/components/form/Transfer/hooks/useTransferData.d.ts +0 -41
- package/dist/components/form/Transfer/hooks/useTransferState.d.ts +0 -21
- package/dist/components/form/Transfer/index.d.ts +0 -9
- package/dist/components/form/Upload/Upload.d.ts +0 -7
- package/dist/components/form/Upload/Upload.styles.d.ts +0 -2
- package/dist/components/form/Upload/Upload.types.d.ts +0 -143
- package/dist/components/form/Upload/index.d.ts +0 -3
- package/dist/components/form/index.d.ts +0 -126
- package/dist/components/index.d.ts +0 -122
- package/dist/components/layout/Affix/Affix.d.ts +0 -4
- package/dist/components/layout/Affix/Affix.styles.d.ts +0 -1669
- package/dist/components/layout/Affix/Affix.types.d.ts +0 -25
- package/dist/components/layout/Affix/index.d.ts +0 -3
- package/dist/components/layout/Col/Col.d.ts +0 -6
- package/dist/components/layout/Col/Col.styles.d.ts +0 -52
- package/dist/components/layout/Col/Col.types.d.ts +0 -54
- package/dist/components/layout/Col/index.d.ts +0 -3
- package/dist/components/layout/Container/Container.d.ts +0 -6
- package/dist/components/layout/Container/Container.styles.d.ts +0 -41
- package/dist/components/layout/Container/Container.types.d.ts +0 -59
- package/dist/components/layout/Container/index.d.ts +0 -3
- package/dist/components/layout/Grid/Grid.d.ts +0 -6
- package/dist/components/layout/Grid/Grid.styles.d.ts +0 -60
- package/dist/components/layout/Grid/Grid.types.d.ts +0 -68
- package/dist/components/layout/Grid/index.d.ts +0 -3
- package/dist/components/layout/Layout/Content.d.ts +0 -4
- package/dist/components/layout/Layout/Footer.d.ts +0 -4
- package/dist/components/layout/Layout/Header.d.ts +0 -4
- package/dist/components/layout/Layout/Layout.d.ts +0 -4
- package/dist/components/layout/Layout/Layout.styles.d.ts +0 -3366
- package/dist/components/layout/Layout/Layout.types.d.ts +0 -48
- package/dist/components/layout/Layout/Sider.d.ts +0 -4
- package/dist/components/layout/Layout/index.d.ts +0 -8
- package/dist/components/layout/Row/Row.d.ts +0 -6
- package/dist/components/layout/Row/Row.styles.d.ts +0 -55
- package/dist/components/layout/Row/Row.types.d.ts +0 -51
- package/dist/components/layout/Row/index.d.ts +0 -3
- package/dist/components/layout/Space/Space.d.ts +0 -6
- package/dist/components/layout/Space/Space.styles.d.ts +0 -69
- package/dist/components/layout/Space/Space.types.d.ts +0 -84
- package/dist/components/layout/Space/index.d.ts +0 -3
- package/dist/components/layout/index.d.ts +0 -39
- package/dist/components/navigation/Menu/Menu.constants.d.ts +0 -59
- package/dist/components/navigation/Menu/Menu.d.ts +0 -10
- package/dist/components/navigation/Menu/Menu.stories.d.ts +0 -157
- package/dist/components/navigation/Menu/Menu.styles.d.ts +0 -143
- package/dist/components/navigation/Menu/Menu.types.d.ts +0 -210
- package/dist/components/navigation/Menu/Menu.utils.d.ts +0 -54
- package/dist/components/navigation/Menu/MenuItem.d.ts +0 -32
- package/dist/components/navigation/Menu/SubMenu.d.ts +0 -41
- package/dist/components/navigation/Menu/index.d.ts +0 -54
- package/dist/components/navigation/NavBar/NavBar.d.ts +0 -7
- package/dist/components/navigation/NavBar/NavBar.styles.d.ts +0 -114
- package/dist/components/navigation/NavBar/NavBar.types.d.ts +0 -50
- package/dist/components/navigation/NavBar/index.d.ts +0 -3
- package/dist/components/navigation/Pagination/Pagination.d.ts +0 -6
- package/dist/components/navigation/Pagination/Pagination.styles.d.ts +0 -55
- package/dist/components/navigation/Pagination/Pagination.types.d.ts +0 -77
- package/dist/components/navigation/Pagination/index.d.ts +0 -15
- package/dist/components/navigation/Steps/Step.d.ts +0 -4
- package/dist/components/navigation/Steps/Steps.d.ts +0 -4
- package/dist/components/navigation/Steps/Steps.styles.d.ts +0 -6716
- package/dist/components/navigation/Steps/Steps.types.d.ts +0 -41
- package/dist/components/navigation/Steps/index.d.ts +0 -3
- package/dist/components/navigation/Tabs/Tabs.d.ts +0 -6
- package/dist/components/navigation/Tabs/Tabs.styles.d.ts +0 -60
- package/dist/components/navigation/Tabs/Tabs.types.d.ts +0 -107
- package/dist/components/navigation/Tabs/index.d.ts +0 -3
- package/dist/components/navigation/index.d.ts +0 -35
- package/dist/constants/index.d.ts +0 -624
- package/dist/hooks/index.d.ts +0 -28
- package/dist/hooks/types.d.ts +0 -7
- package/dist/hooks/useAsync.d.ts +0 -17
- package/dist/hooks/useClickOutside.d.ts +0 -19
- package/dist/hooks/useCounter.d.ts +0 -36
- package/dist/hooks/useDebounce.d.ts +0 -31
- package/dist/hooks/useDeepCompareEffect.d.ts +0 -22
- package/dist/hooks/useEventHandling.d.ts +0 -81
- package/dist/hooks/useEventListener.d.ts +0 -19
- package/dist/hooks/useLifecycle.d.ts +0 -66
- package/dist/hooks/useMediaQuery.d.ts +0 -22
- package/dist/hooks/useMutation.d.ts +0 -47
- package/dist/hooks/usePerformance.d.ts +0 -73
- package/dist/hooks/usePerformanceMonitor.d.ts +0 -66
- package/dist/hooks/usePlatform.d.ts +0 -20
- package/dist/hooks/usePrevious.d.ts +0 -14
- package/dist/hooks/useRequest.d.ts +0 -32
- package/dist/hooks/useStateManagement.d.ts +0 -62
- package/dist/hooks/useStorage.d.ts +0 -27
- package/dist/hooks/useStyle.d.ts +0 -127
- package/dist/hooks/useTheme.d.ts +0 -58
- package/dist/hooks/useToggle.d.ts +0 -28
- package/dist/hooks/useVirtualScroll.d.ts +0 -42
- package/dist/index.d.ts +0 -271
- package/dist/platform/index.d.ts +0 -172
- package/dist/providers/AppProvider.d.ts +0 -34
- package/dist/providers/index.d.ts +0 -1
- package/dist/theme/ThemeProvider.d.ts +0 -34
- package/dist/theme/ThemeProvider.types.d.ts +0 -21
- package/dist/theme/animations.d.ts +0 -96
- package/dist/theme/defaults.d.ts +0 -6
- package/dist/theme/design-system.d.ts +0 -400
- package/dist/theme/design-tokens.d.ts +0 -459
- package/dist/theme/index.d.ts +0 -187
- package/dist/theme/responsive.d.ts +0 -63
- package/dist/theme/styles.d.ts +0 -65
- package/dist/theme/tokens/colors.d.ts +0 -72
- package/dist/theme/tokens/effects.d.ts +0 -122
- package/dist/theme/tokens/index.d.ts +0 -94
- package/dist/theme/tokens/spacing.d.ts +0 -65
- package/dist/theme/tokens/typography.d.ts +0 -73
- package/dist/theme/types.d.ts +0 -153
- package/dist/theme/useThemeUtils.d.ts +0 -21
- package/dist/theme/utils.d.ts +0 -255
- package/dist/theme/variables.d.ts +0 -170
- package/dist/types/accessibility.d.ts +0 -46
- package/dist/types/button.d.ts +0 -285
- package/dist/types/component-props.d.ts +0 -109
- package/dist/types/index.d.ts +0 -343
- package/dist/types/standardized-components.d.ts +0 -263
- package/dist/types/utils.d.ts +0 -190
- package/dist/utils/abort-controller.d.ts +0 -19
- package/dist/utils/cache.d.ts +0 -28
- package/dist/utils/createNamespace.d.ts +0 -9
- package/dist/utils/environment.d.ts +0 -26
- package/dist/utils/error-handler.d.ts +0 -37
- package/dist/utils/errorLogger.d.ts +0 -72
- package/dist/utils/formatUtils.d.ts +0 -93
- package/dist/utils/http/error-codes.d.ts +0 -131
- package/dist/utils/http/http-client.d.ts +0 -53
- package/dist/utils/http/request-cache.d.ts +0 -65
- package/dist/utils/http/taro-adapter.d.ts +0 -4
- package/dist/utils/http/types.d.ts +0 -351
- package/dist/utils/http/web-adapter.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -46
- package/dist/utils/inputValidator.d.ts +0 -74
- package/dist/utils/performance/performance.d.ts +0 -167
- package/dist/utils/responsiveUtils.d.ts +0 -148
- package/dist/utils/rtl-support.d.ts +0 -78
- package/dist/utils/security/api-security.d.ts +0 -82
- package/dist/utils/security/xss-protection.d.ts +0 -20
- package/dist/utils/securityHeaders.d.ts +0 -74
- package/dist/utils/typeHelpers.d.ts +0 -1
- package/dist/utils/types/dataProcessing.d.ts +0 -111
- package/dist/utils/types/typeHelpers.d.ts +0 -50
- package/dist/utils/xssProtection.d.ts +0 -90
package/dist/types/index.d.ts
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Taro-Uno UI 组件库核心类型定义
|
|
3
|
-
* 支持多端开发:微信小程序、支付宝小程序、H5、React Native等
|
|
4
|
-
* 提供严格的TypeScript类型安全保障
|
|
5
|
-
*/
|
|
6
|
-
import { ReactNode } from 'react';
|
|
7
|
-
import * as Taro from '@tarojs/taro';
|
|
8
|
-
export * from './utils';
|
|
9
|
-
export * from './button';
|
|
10
|
-
export * from './standardized-components';
|
|
11
|
-
/** 支持的平台类型 */
|
|
12
|
-
export type Platform = 'weapp' | 'alipay' | 'swan' | 'tt' | 'qq' | 'h5' | 'rn' | 'jd';
|
|
13
|
-
/** 平台信息接口 */
|
|
14
|
-
export interface PlatformInfo {
|
|
15
|
-
/** 平台类型 */
|
|
16
|
-
platform: Platform;
|
|
17
|
-
/** 是否为小程序环境 */
|
|
18
|
-
isMiniProgram: boolean;
|
|
19
|
-
/** 是否为H5环境 */
|
|
20
|
-
isH5: boolean;
|
|
21
|
-
/** 是否为React Native环境 */
|
|
22
|
-
isRN: boolean;
|
|
23
|
-
/** 系统信息 */
|
|
24
|
-
system: Taro.getSystemInfoSync.Result;
|
|
25
|
-
/** SDK版本 */
|
|
26
|
-
SDKVersion?: string;
|
|
27
|
-
/** 小程序版本 */
|
|
28
|
-
version?: string;
|
|
29
|
-
}
|
|
30
|
-
/** 组件尺寸类型 */
|
|
31
|
-
export type Size = 'small' | 'medium' | 'large' | 'default';
|
|
32
|
-
/** 组件变体类型 */
|
|
33
|
-
export type Variant = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
|
|
34
|
-
/** 组件状态类型 */
|
|
35
|
-
export type Status = 'default' | 'loading' | 'disabled' | 'error' | 'success';
|
|
36
|
-
/** 通用组件属性接口 */
|
|
37
|
-
export interface BaseComponentProps extends Partial<Omit<React.HTMLAttributes<HTMLElement>, 'className' | 'style' | 'children' | 'onClick'>> {
|
|
38
|
-
/** 自定义类名 */
|
|
39
|
-
className?: string;
|
|
40
|
-
/** 自定义样式 */
|
|
41
|
-
style?: React.CSSProperties;
|
|
42
|
-
/** 测试ID */
|
|
43
|
-
testID?: string;
|
|
44
|
-
/** 是否禁用 */
|
|
45
|
-
disabled?: boolean;
|
|
46
|
-
/** 加载状态 */
|
|
47
|
-
loading?: boolean;
|
|
48
|
-
/** 子元素 */
|
|
49
|
-
children?: ReactNode;
|
|
50
|
-
}
|
|
51
|
-
/** 带有尺寸属性的组件接口 */
|
|
52
|
-
export interface SizeableComponentProps extends BaseComponentProps {
|
|
53
|
-
/** 组件尺寸 */
|
|
54
|
-
size?: Size;
|
|
55
|
-
}
|
|
56
|
-
/** 带有变体属性的组件接口 */
|
|
57
|
-
export interface VariantComponentProps extends BaseComponentProps {
|
|
58
|
-
/** 组件变体 */
|
|
59
|
-
variant?: Variant;
|
|
60
|
-
}
|
|
61
|
-
/** 带有状态属性的组件接口 */
|
|
62
|
-
export interface StatusComponentProps extends BaseComponentProps {
|
|
63
|
-
/** 组件状态 */
|
|
64
|
-
status?: Status;
|
|
65
|
-
}
|
|
66
|
-
/** 主题模式 */
|
|
67
|
-
export type ThemeMode = 'light' | 'dark' | 'auto';
|
|
68
|
-
/** 主题颜色配置 */
|
|
69
|
-
export interface ThemeColors {
|
|
70
|
-
/** 主色调 */
|
|
71
|
-
primary: string;
|
|
72
|
-
/** 次要色调 */
|
|
73
|
-
secondary: string;
|
|
74
|
-
/** 成功色 */
|
|
75
|
-
success: string;
|
|
76
|
-
/** 警告色 */
|
|
77
|
-
warning: string;
|
|
78
|
-
/** 错误色 */
|
|
79
|
-
error: string;
|
|
80
|
-
/** 信息色 */
|
|
81
|
-
info: string;
|
|
82
|
-
/** 背景色 */
|
|
83
|
-
background: string;
|
|
84
|
-
/** 表面色 */
|
|
85
|
-
surface: string;
|
|
86
|
-
/** 文字主色 */
|
|
87
|
-
text: string;
|
|
88
|
-
/** 文字次要色 */
|
|
89
|
-
textSecondary: string;
|
|
90
|
-
/** 边框色 */
|
|
91
|
-
border: string;
|
|
92
|
-
/** 分割线色 */
|
|
93
|
-
divider: string;
|
|
94
|
-
}
|
|
95
|
-
/** 主题间距配置 */
|
|
96
|
-
export interface ThemeSpacing {
|
|
97
|
-
/** 极小间距 */
|
|
98
|
-
xs: number;
|
|
99
|
-
/** 小间距 */
|
|
100
|
-
sm: number;
|
|
101
|
-
/** 中等间距 */
|
|
102
|
-
md: number;
|
|
103
|
-
/** 大间距 */
|
|
104
|
-
lg: number;
|
|
105
|
-
/** 极大间距 */
|
|
106
|
-
xl: number;
|
|
107
|
-
/** 超大间距 */
|
|
108
|
-
xxl: number;
|
|
109
|
-
}
|
|
110
|
-
/** 主题字体配置 */
|
|
111
|
-
export interface ThemeTypography {
|
|
112
|
-
/** 字体族 */
|
|
113
|
-
fontFamily: string;
|
|
114
|
-
/** 字体大小 */
|
|
115
|
-
fontSize: {
|
|
116
|
-
xs: number;
|
|
117
|
-
sm: number;
|
|
118
|
-
base: number;
|
|
119
|
-
lg: number;
|
|
120
|
-
xl: number;
|
|
121
|
-
'2xl': number;
|
|
122
|
-
'3xl': number;
|
|
123
|
-
'4xl': number;
|
|
124
|
-
};
|
|
125
|
-
/** 字重 */
|
|
126
|
-
fontWeight: {
|
|
127
|
-
normal: number;
|
|
128
|
-
medium: number;
|
|
129
|
-
bold: number;
|
|
130
|
-
};
|
|
131
|
-
/** 行高 */
|
|
132
|
-
lineHeight: {
|
|
133
|
-
tight: number;
|
|
134
|
-
normal: number;
|
|
135
|
-
relaxed: number;
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
/** 主题圆角配置 */
|
|
139
|
-
export interface ThemeRadius {
|
|
140
|
-
/** 无圆角 */
|
|
141
|
-
none: number;
|
|
142
|
-
/** 小圆角 */
|
|
143
|
-
sm: number;
|
|
144
|
-
/** 中等圆角 */
|
|
145
|
-
md: number;
|
|
146
|
-
/** 大圆角 */
|
|
147
|
-
lg: number;
|
|
148
|
-
/** 完全圆角 */
|
|
149
|
-
full: number;
|
|
150
|
-
}
|
|
151
|
-
/** 主题配置接口 */
|
|
152
|
-
export interface ThemeConfig {
|
|
153
|
-
/** 主题模式 */
|
|
154
|
-
mode: ThemeMode;
|
|
155
|
-
/** 主题颜色 */
|
|
156
|
-
colors: ThemeColors;
|
|
157
|
-
/** 主题间距 */
|
|
158
|
-
spacing: ThemeSpacing;
|
|
159
|
-
/** 主题字体 */
|
|
160
|
-
typography: ThemeTypography;
|
|
161
|
-
/** 主题圆角 */
|
|
162
|
-
radius: ThemeRadius;
|
|
163
|
-
/** 自定义CSS变量 */
|
|
164
|
-
cssVars?: Record<string, string>;
|
|
165
|
-
}
|
|
166
|
-
/** 通用事件处理器类型 */
|
|
167
|
-
export type EventHandler<T = any> = (event: T) => void;
|
|
168
|
-
/** 点击事件处理器 */
|
|
169
|
-
export type ClickHandler = EventHandler<any>;
|
|
170
|
-
/** 输入事件处理器 */
|
|
171
|
-
export type InputHandler = EventHandler<any>;
|
|
172
|
-
/** 变更事件处理器 */
|
|
173
|
-
export type ChangeHandler<T = any> = EventHandler<T>;
|
|
174
|
-
/** 焦点事件处理器 */
|
|
175
|
-
export type FocusHandler = EventHandler<any>;
|
|
176
|
-
/** 滚动事件处理器 */
|
|
177
|
-
export type ScrollHandler = EventHandler<any>;
|
|
178
|
-
/** 触摸事件处理器 */
|
|
179
|
-
export type TouchHandler = EventHandler<any>;
|
|
180
|
-
/** 生命周期事件处理器 */
|
|
181
|
-
export type LifecycleHandler = EventHandler<void>;
|
|
182
|
-
/** 防抖函数类型 */
|
|
183
|
-
export type DebouncedFunction<T extends (...args: any[]) => any> = {
|
|
184
|
-
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
185
|
-
cancel: () => void;
|
|
186
|
-
flush: () => ReturnType<T> | undefined;
|
|
187
|
-
};
|
|
188
|
-
/** 节流函数类型 */
|
|
189
|
-
export type ThrottledFunction<T extends (...args: any[]) => any> = {
|
|
190
|
-
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
191
|
-
cancel: () => void;
|
|
192
|
-
};
|
|
193
|
-
/** 格式化函数类型 */
|
|
194
|
-
export type FormatFunction<T = any, R = string> = (value: T) => R;
|
|
195
|
-
/** 验证函数类型 */
|
|
196
|
-
export type ValidateFunction<T = any> = (value: T) => boolean | string;
|
|
197
|
-
/** 转换函数类型 */
|
|
198
|
-
export type TransformFunction<T = any, R = any> = (value: T) => R;
|
|
199
|
-
/** 过滤函数类型 */
|
|
200
|
-
export type FilterFunction<T = any> = (value: T, index: number, array: T[]) => boolean;
|
|
201
|
-
/** 比较函数类型 */
|
|
202
|
-
export type CompareFunction<T = any> = (a: T, b: T) => number;
|
|
203
|
-
/** CSS单位类型 */
|
|
204
|
-
export type CSSUnit = 'px' | 'rem' | 'em' | 'vw' | 'vh' | '%' | 'rpx';
|
|
205
|
-
/** 尺寸值类型 */
|
|
206
|
-
export type SizeValue = number | `${number}${CSSUnit}`;
|
|
207
|
-
/** 颜色值类型 */
|
|
208
|
-
export type ColorValue = string;
|
|
209
|
-
/** 间距值类型 */
|
|
210
|
-
export type SpacingValue = SizeValue;
|
|
211
|
-
/** 动画类型 */
|
|
212
|
-
export type AnimationType = 'fade' | 'slide' | 'scale' | 'rotate' | 'bounce';
|
|
213
|
-
/** 动画方向 */
|
|
214
|
-
export type AnimationDirection = 'up' | 'down' | 'left' | 'right' | 'in' | 'out';
|
|
215
|
-
/** 过渡配置 */
|
|
216
|
-
export interface TransitionConfig {
|
|
217
|
-
/** 过渡属性 */
|
|
218
|
-
property?: string;
|
|
219
|
-
/** 过渡时间 */
|
|
220
|
-
duration?: number;
|
|
221
|
-
/** 过渡函数 */
|
|
222
|
-
timing?: string;
|
|
223
|
-
/** 过渡延迟 */
|
|
224
|
-
delay?: number;
|
|
225
|
-
}
|
|
226
|
-
/** 表单字段状态 */
|
|
227
|
-
export interface FormFieldState {
|
|
228
|
-
/** 字段值 */
|
|
229
|
-
value: any;
|
|
230
|
-
/** 是否已修改 */
|
|
231
|
-
dirty: boolean;
|
|
232
|
-
/** 是否已触摸 */
|
|
233
|
-
touched: boolean;
|
|
234
|
-
/** 是否有效 */
|
|
235
|
-
valid: boolean;
|
|
236
|
-
/** 错误信息 */
|
|
237
|
-
error?: string;
|
|
238
|
-
}
|
|
239
|
-
/** 表单验证规则 */
|
|
240
|
-
export interface ValidationRule {
|
|
241
|
-
/** 必填验证 */
|
|
242
|
-
required?: boolean;
|
|
243
|
-
/** 最小长度 */
|
|
244
|
-
minLength?: number;
|
|
245
|
-
/** 最大长度 */
|
|
246
|
-
maxLength?: number;
|
|
247
|
-
/** 最小值 */
|
|
248
|
-
min?: number;
|
|
249
|
-
/** 最大值 */
|
|
250
|
-
max?: number;
|
|
251
|
-
/** 正则验证 */
|
|
252
|
-
pattern?: RegExp;
|
|
253
|
-
/** 自定义验证器 */
|
|
254
|
-
validator?: ValidateFunction;
|
|
255
|
-
/** 错误消息 */
|
|
256
|
-
message?: string;
|
|
257
|
-
}
|
|
258
|
-
/** 表单配置 */
|
|
259
|
-
export interface FormConfig {
|
|
260
|
-
/** 初始值 */
|
|
261
|
-
initialValues: Record<string, any>;
|
|
262
|
-
/** 验证规则 */
|
|
263
|
-
validationRules?: Record<string, ValidationRule[]>;
|
|
264
|
-
/** 提交处理器 */
|
|
265
|
-
onSubmit: (values: Record<string, any>) => void | Promise<void>;
|
|
266
|
-
/** 重置处理器 */
|
|
267
|
-
onReset?: () => void;
|
|
268
|
-
/** 变更处理器 */
|
|
269
|
-
onChange?: (values: Record<string, any>) => void;
|
|
270
|
-
}
|
|
271
|
-
/** 请求配置 */
|
|
272
|
-
export interface RequestConfig {
|
|
273
|
-
/** 请求URL */
|
|
274
|
-
url: string;
|
|
275
|
-
/** 请求方法 */
|
|
276
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
277
|
-
/** 请求头 */
|
|
278
|
-
header?: Record<string, string>;
|
|
279
|
-
/** 请求数据 */
|
|
280
|
-
data?: any;
|
|
281
|
-
/** 请求参数 */
|
|
282
|
-
params?: Record<string, any>;
|
|
283
|
-
/** 超时时间 */
|
|
284
|
-
timeout?: number;
|
|
285
|
-
/** 是否显示加载状态 */
|
|
286
|
-
showLoading?: boolean;
|
|
287
|
-
/** 加载提示文字 */
|
|
288
|
-
loadingText?: string;
|
|
289
|
-
/** 是否显示错误提示 */
|
|
290
|
-
showError?: boolean;
|
|
291
|
-
/** 错误提示文字 */
|
|
292
|
-
errorText?: string;
|
|
293
|
-
}
|
|
294
|
-
/** 请求响应 */
|
|
295
|
-
export interface RequestResponse<T = any> {
|
|
296
|
-
/** 数据 */
|
|
297
|
-
data: T;
|
|
298
|
-
/** 状态码 */
|
|
299
|
-
statusCode: number;
|
|
300
|
-
/** 状态消息 */
|
|
301
|
-
statusMessage?: string;
|
|
302
|
-
/** 响应头 */
|
|
303
|
-
header?: Record<string, string>;
|
|
304
|
-
}
|
|
305
|
-
/** 请求错误 */
|
|
306
|
-
export interface RequestError {
|
|
307
|
-
/** 错误消息 */
|
|
308
|
-
message: string;
|
|
309
|
-
/** 错误码 */
|
|
310
|
-
code?: number | string;
|
|
311
|
-
/** 错误详情 */
|
|
312
|
-
detail?: any;
|
|
313
|
-
}
|
|
314
|
-
/** 通用回调函数类型 */
|
|
315
|
-
export type Callback<T = any> = (data: T) => void;
|
|
316
|
-
/** 异步函数类型 */
|
|
317
|
-
export type AsyncFunction<T = any> = () => Promise<T>;
|
|
318
|
-
/** 条件类型 */
|
|
319
|
-
export type Conditional<T, Condition, TrueType, FalseType> = T extends Condition ? TrueType : FalseType;
|
|
320
|
-
/** 深度部分类型 */
|
|
321
|
-
export type DeepPartial<T> = {
|
|
322
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
323
|
-
};
|
|
324
|
-
/** 深度只读类型 */
|
|
325
|
-
export type DeepReadonly<T> = {
|
|
326
|
-
readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];
|
|
327
|
-
};
|
|
328
|
-
/** 深度可写类型 */
|
|
329
|
-
export type DeepWriteable<T> = {
|
|
330
|
-
-readonly [P in keyof T]: T[P] extends object ? DeepWriteable<T[P]> : T[P];
|
|
331
|
-
};
|
|
332
|
-
/** 深度必选类型 */
|
|
333
|
-
export type DeepRequired<T> = {
|
|
334
|
-
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : T[P];
|
|
335
|
-
};
|
|
336
|
-
/** 递归排除类型 */
|
|
337
|
-
export type RecursiveExclude<T, E> = T extends object ? {
|
|
338
|
-
[P in keyof T as T[P] extends E ? never : P]: RecursiveExclude<T[P], E>;
|
|
339
|
-
} : T;
|
|
340
|
-
/** 递归选择类型 */
|
|
341
|
-
export type RecursivePick<T, K extends string> = T extends object ? {
|
|
342
|
-
[P in keyof T as P extends K ? P : never]: RecursivePick<T[P], K>;
|
|
343
|
-
} : T;
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 标准化组件类型定义
|
|
3
|
-
* 统一所有组件的属性接口,确保类型安全和API一致性
|
|
4
|
-
*/
|
|
5
|
-
import { ReactNode } from 'react';
|
|
6
|
-
import type { ITouchEvent } from '@tarojs/components';
|
|
7
|
-
/** 组件尺寸类型 - 统一标准 */
|
|
8
|
-
export type ComponentSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
-
/** 组件变体类型 - 统一标准 */
|
|
10
|
-
export type ComponentVariant = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
|
|
11
|
-
/** 组件状态类型 - 统一标准 */
|
|
12
|
-
export type ComponentStatus = 'normal' | 'loading' | 'disabled' | 'error' | 'success' | 'warning';
|
|
13
|
-
/** 组件形状类型 - 统一标准 */
|
|
14
|
-
export type ComponentShape = 'default' | 'round' | 'circle' | 'square';
|
|
15
|
-
/** 组件方向类型 */
|
|
16
|
-
export type ComponentDirection = 'horizontal' | 'vertical';
|
|
17
|
-
/** 组件对齐类型 */
|
|
18
|
-
export type ComponentAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
19
|
-
/** 组件位置类型 */
|
|
20
|
-
export type ComponentPosition = 'top' | 'right' | 'bottom' | 'left';
|
|
21
|
-
/** 基础组件属性接口 */
|
|
22
|
-
export interface BaseComponentProps {
|
|
23
|
-
/** 自定义类名 */
|
|
24
|
-
className?: string;
|
|
25
|
-
/** 自定义样式 */
|
|
26
|
-
style?: React.CSSProperties;
|
|
27
|
-
/** 测试ID */
|
|
28
|
-
testID?: string;
|
|
29
|
-
/** 子元素 */
|
|
30
|
-
children?: ReactNode;
|
|
31
|
-
}
|
|
32
|
-
/** 可设置尺寸的组件属性 */
|
|
33
|
-
export interface SizeableProps extends BaseComponentProps {
|
|
34
|
-
/** 组件尺寸 */
|
|
35
|
-
size?: ComponentSize;
|
|
36
|
-
}
|
|
37
|
-
/** 可设置变体的组件属性 */
|
|
38
|
-
export interface VariantProps extends BaseComponentProps {
|
|
39
|
-
/** 组件变体 */
|
|
40
|
-
variant?: ComponentVariant;
|
|
41
|
-
}
|
|
42
|
-
/** 可设置状态的组件属性 */
|
|
43
|
-
export interface StatusProps extends BaseComponentProps {
|
|
44
|
-
/** 组件状态 */
|
|
45
|
-
status?: ComponentStatus;
|
|
46
|
-
}
|
|
47
|
-
/** 可设置形状的组件属性 */
|
|
48
|
-
export interface ShapeProps extends BaseComponentProps {
|
|
49
|
-
/** 组件形状 */
|
|
50
|
-
shape?: ComponentShape;
|
|
51
|
-
}
|
|
52
|
-
/** 可禁用的组件属性 */
|
|
53
|
-
export interface DisabledProps extends BaseComponentProps {
|
|
54
|
-
/** 是否禁用 */
|
|
55
|
-
disabled?: boolean;
|
|
56
|
-
}
|
|
57
|
-
/** 可只读的组件属性 */
|
|
58
|
-
export interface ReadonlyProps extends BaseComponentProps {
|
|
59
|
-
/** 是否只读 */
|
|
60
|
-
readonly?: boolean;
|
|
61
|
-
}
|
|
62
|
-
/** 可加载的组件属性 */
|
|
63
|
-
export interface LoadingProps extends BaseComponentProps {
|
|
64
|
-
/** 加载状态 */
|
|
65
|
-
loading?: boolean;
|
|
66
|
-
}
|
|
67
|
-
/** 可点击的组件属性 */
|
|
68
|
-
export interface ClickableProps extends BaseComponentProps {
|
|
69
|
-
/** 点击事件处理 */
|
|
70
|
-
onClick?: (event: ITouchEvent) => void;
|
|
71
|
-
/** 是否可点击 */
|
|
72
|
-
clickable?: boolean;
|
|
73
|
-
}
|
|
74
|
-
/** 标准组件属性 - 组合所有常用属性 */
|
|
75
|
-
export interface StandardComponentProps extends SizeableProps, VariantProps, StatusProps, ShapeProps, DisabledProps, ReadonlyProps, LoadingProps, ClickableProps {
|
|
76
|
-
/** 组件唯一标识 */
|
|
77
|
-
id?: string;
|
|
78
|
-
/** 数据属性 */
|
|
79
|
-
data?: Record<string, any>;
|
|
80
|
-
}
|
|
81
|
-
/** 表单组件属性接口 */
|
|
82
|
-
export interface FormComponentProps extends StandardComponentProps {
|
|
83
|
-
/** 表单字段名称 */
|
|
84
|
-
name?: string;
|
|
85
|
-
/** 表单字段值 */
|
|
86
|
-
value?: any;
|
|
87
|
-
/** 默认值 */
|
|
88
|
-
defaultValue?: any;
|
|
89
|
-
/** 占位符 */
|
|
90
|
-
placeholder?: string;
|
|
91
|
-
/** 是否必填 */
|
|
92
|
-
required?: boolean;
|
|
93
|
-
/** 变更事件处理 */
|
|
94
|
-
onChange?: (value: any, event?: ITouchEvent) => void;
|
|
95
|
-
/** 焦点事件处理 */
|
|
96
|
-
onFocus?: (event: ITouchEvent) => void;
|
|
97
|
-
/** 失焦事件处理 */
|
|
98
|
-
onBlur?: (event: ITouchEvent) => void;
|
|
99
|
-
/** 输入事件处理 */
|
|
100
|
-
onInput?: (value: any, event?: ITouchEvent) => void;
|
|
101
|
-
/** 确认事件处理 */
|
|
102
|
-
onConfirm?: (value: any, event?: ITouchEvent) => void;
|
|
103
|
-
}
|
|
104
|
-
/** 布局组件属性接口 */
|
|
105
|
-
export interface LayoutComponentProps extends StandardComponentProps {
|
|
106
|
-
/** 布局方向 */
|
|
107
|
-
direction?: ComponentDirection;
|
|
108
|
-
/** 对齐方式 */
|
|
109
|
-
align?: ComponentAlign;
|
|
110
|
-
/** 间距 */
|
|
111
|
-
spacing?: number | string;
|
|
112
|
-
/** 自动换行 */
|
|
113
|
-
wrap?: boolean;
|
|
114
|
-
/** 占据宽度 */
|
|
115
|
-
span?: number;
|
|
116
|
-
/** 偏移量 */
|
|
117
|
-
offset?: number;
|
|
118
|
-
}
|
|
119
|
-
/** 显示组件属性接口 */
|
|
120
|
-
export interface DisplayComponentProps extends StandardComponentProps {
|
|
121
|
-
/** 显示/隐藏 */
|
|
122
|
-
visible?: boolean;
|
|
123
|
-
/** 显示模式 */
|
|
124
|
-
mode?: 'default' | 'card' | 'list' | 'grid';
|
|
125
|
-
/** 标题 */
|
|
126
|
-
title?: string;
|
|
127
|
-
/** 描述 */
|
|
128
|
-
description?: string;
|
|
129
|
-
/** 副标题 */
|
|
130
|
-
subtitle?: string;
|
|
131
|
-
/** 额外内容 */
|
|
132
|
-
extra?: ReactNode;
|
|
133
|
-
}
|
|
134
|
-
/** 通用事件处理器类型 */
|
|
135
|
-
export type EventHandler<T = any> = (event: T) => void;
|
|
136
|
-
/** 点击事件处理器 */
|
|
137
|
-
export type ClickHandler = EventHandler<ITouchEvent>;
|
|
138
|
-
/** 输入事件处理器 */
|
|
139
|
-
export type InputHandler<T = any> = (value: T, event?: ITouchEvent) => void;
|
|
140
|
-
/** 变更事件处理器 */
|
|
141
|
-
export type ChangeHandler<T = any> = (value: T, event?: ITouchEvent) => void;
|
|
142
|
-
/** 焦点事件处理器 */
|
|
143
|
-
export type FocusHandler = EventHandler<ITouchEvent>;
|
|
144
|
-
/** 选择事件处理器 */
|
|
145
|
-
export type SelectHandler<T = any> = (selected: T, event?: ITouchEvent) => void;
|
|
146
|
-
/** 滚动事件处理器 */
|
|
147
|
-
export type ScrollHandler = EventHandler<any>;
|
|
148
|
-
/** 自定义事件处理器 */
|
|
149
|
-
export type CustomEventHandler<T = any> = (data: T, event?: ITouchEvent) => void;
|
|
150
|
-
/** 基础组件引用接口 */
|
|
151
|
-
export interface BaseComponentRef {
|
|
152
|
-
/** DOM元素 */
|
|
153
|
-
element: any;
|
|
154
|
-
/** 获取组件尺寸 */
|
|
155
|
-
getSize: () => ComponentSize | undefined;
|
|
156
|
-
/** 获取组件变体 */
|
|
157
|
-
getVariant: () => ComponentVariant | undefined;
|
|
158
|
-
/** 获取组件状态 */
|
|
159
|
-
getStatus: () => ComponentStatus | undefined;
|
|
160
|
-
/** 检查是否禁用 */
|
|
161
|
-
isDisabled: () => boolean;
|
|
162
|
-
/** 检查是否只读 */
|
|
163
|
-
isReadonly: () => boolean;
|
|
164
|
-
/** 检查是否加载中 */
|
|
165
|
-
isLoading: () => boolean;
|
|
166
|
-
/** 禁用组件 */
|
|
167
|
-
disable: () => void;
|
|
168
|
-
/** 启用组件 */
|
|
169
|
-
enable: () => void;
|
|
170
|
-
/** 设置只读状态 */
|
|
171
|
-
setReadonly: (readonly: boolean) => void;
|
|
172
|
-
/** 设置加载状态 */
|
|
173
|
-
setLoading: (loading: boolean) => void;
|
|
174
|
-
/** 设置状态 */
|
|
175
|
-
setStatus: (status: ComponentStatus) => void;
|
|
176
|
-
/** 聚焦组件 */
|
|
177
|
-
focus: () => void;
|
|
178
|
-
/** 失焦组件 */
|
|
179
|
-
blur: () => void;
|
|
180
|
-
}
|
|
181
|
-
/** 表单组件引用接口 */
|
|
182
|
-
export interface FormComponentRef extends BaseComponentRef {
|
|
183
|
-
/** 获取值 */
|
|
184
|
-
getValue: () => any;
|
|
185
|
-
/** 设置值 */
|
|
186
|
-
setValue: (value: any) => void;
|
|
187
|
-
/** 重置值 */
|
|
188
|
-
reset: () => void;
|
|
189
|
-
/** 清除值 */
|
|
190
|
-
clear: () => void;
|
|
191
|
-
/** 验证值 */
|
|
192
|
-
validate: () => boolean | Promise<boolean>;
|
|
193
|
-
/** 获取验证错误 */
|
|
194
|
-
getValidationError: () => string | undefined;
|
|
195
|
-
}
|
|
196
|
-
/** 布局组件引用接口 */
|
|
197
|
-
export interface LayoutComponentRef extends BaseComponentRef {
|
|
198
|
-
/** 获取布局方向 */
|
|
199
|
-
getDirection: () => ComponentDirection | undefined;
|
|
200
|
-
/** 获取对齐方式 */
|
|
201
|
-
getAlign: () => ComponentAlign | undefined;
|
|
202
|
-
/** 获取间距 */
|
|
203
|
-
getSpacing: () => number | string | undefined;
|
|
204
|
-
/** 设置布局方向 */
|
|
205
|
-
setDirection: (direction: ComponentDirection) => void;
|
|
206
|
-
/** 设置对齐方式 */
|
|
207
|
-
setAlign: (align: ComponentAlign) => void;
|
|
208
|
-
/** 设置间距 */
|
|
209
|
-
setSpacing: (spacing: number | string) => void;
|
|
210
|
-
}
|
|
211
|
-
/** 尺寸配置接口 */
|
|
212
|
-
export interface SizeConfig {
|
|
213
|
-
fontSize: number;
|
|
214
|
-
padding: string;
|
|
215
|
-
height: number;
|
|
216
|
-
borderRadius: number;
|
|
217
|
-
iconSize?: number;
|
|
218
|
-
borderWidth?: number;
|
|
219
|
-
}
|
|
220
|
-
/** 标准尺寸映射 */
|
|
221
|
-
export declare const STANDARD_SIZE_MAP: Record<ComponentSize, SizeConfig>;
|
|
222
|
-
/** 变体颜色配置接口 */
|
|
223
|
-
export interface VariantColorConfig {
|
|
224
|
-
background: string;
|
|
225
|
-
color: string;
|
|
226
|
-
border: string;
|
|
227
|
-
hover?: {
|
|
228
|
-
background: string;
|
|
229
|
-
color: string;
|
|
230
|
-
border: string;
|
|
231
|
-
};
|
|
232
|
-
active?: {
|
|
233
|
-
background: string;
|
|
234
|
-
color: string;
|
|
235
|
-
border: string;
|
|
236
|
-
};
|
|
237
|
-
disabled?: {
|
|
238
|
-
background: string;
|
|
239
|
-
color: string;
|
|
240
|
-
border: string;
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
/** 标准变体颜色映射 */
|
|
244
|
-
export declare const STANDARD_VARIANT_COLORS: Record<ComponentVariant, VariantColorConfig>;
|
|
245
|
-
/** 状态颜色配置接口 */
|
|
246
|
-
export interface StatusColorConfig {
|
|
247
|
-
color: string;
|
|
248
|
-
backgroundColor?: string;
|
|
249
|
-
borderColor?: string;
|
|
250
|
-
icon?: string;
|
|
251
|
-
}
|
|
252
|
-
/** 标准状态颜色映射 */
|
|
253
|
-
export declare const STANDARD_STATUS_COLORS: Record<ComponentStatus, StatusColorConfig>;
|
|
254
|
-
/** 组件属性合并类型 */
|
|
255
|
-
export type MergeComponentProps<T, U> = T & U;
|
|
256
|
-
/** 可选组件属性类型 */
|
|
257
|
-
export type OptionalComponentProps<T> = Partial<T>;
|
|
258
|
-
/** 必需组件属性类型 */
|
|
259
|
-
export type RequiredComponentProps<T> = Required<T>;
|
|
260
|
-
/** 组件属性提取类型 */
|
|
261
|
-
export type ExtractComponentProps<T> = T extends React.ComponentType<infer P> ? P : never;
|
|
262
|
-
/** 组件引用提取类型 */
|
|
263
|
-
export type ExtractComponentRef<T> = T extends React.RefObject<infer R> ? R : never;
|