taro-uno-ui 1.0.1 → 1.0.2
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 +67 -30
- package/dist/js/{index-CDFsvu80.js → index-QpKiGsEQ.js} +39026 -28023
- package/dist/js/index-QpKiGsEQ.js.map +1 -0
- package/dist/js/{index-JffnTUrv.js → index-nnTHNhwl.js} +38743 -27720
- package/dist/js/index-nnTHNhwl.js.map +1 -0
- package/package.json +4 -4
- package/dist/js/index-CDFsvu80.js.map +0 -1
- package/dist/js/index-DFdcksbe.js +0 -1165
- package/dist/js/index-DFdcksbe.js.map +0 -1
- package/dist/js/index-DXRIkWX1.js +0 -1148
- package/dist/js/index-DXRIkWX1.js.map +0 -1
- package/dist/js/index-JffnTUrv.js.map +0 -1
- package/dist/utils/http/request.d.ts +0 -280
- package/src/app.config.ts +0 -55
- package/src/app.scss +0 -508
- package/src/app.tsx +0 -44
- package/src/components/basic/Button/Button.styles.ts +0 -130
- package/src/components/basic/Button/Button.test.tsx +0 -154
- package/src/components/basic/Button/Button.tsx +0 -133
- package/src/components/basic/Button/Button.types.ts +0 -81
- package/src/components/basic/Button/index.tsx +0 -6
- package/src/components/basic/Divider/Divider.styles.ts +0 -488
- package/src/components/basic/Divider/Divider.test.tsx +0 -551
- package/src/components/basic/Divider/Divider.tsx +0 -392
- package/src/components/basic/Divider/Divider.types.ts +0 -261
- package/src/components/basic/Divider/index.tsx +0 -25
- package/src/components/basic/Icon/Icon.data.ts +0 -474
- package/src/components/basic/Icon/Icon.styles.ts +0 -359
- package/src/components/basic/Icon/Icon.test.tsx +0 -357
- package/src/components/basic/Icon/Icon.tsx +0 -167
- package/src/components/basic/Icon/Icon.types.ts +0 -210
- package/src/components/basic/Icon/IconManager.ts +0 -229
- package/src/components/basic/Icon/index.tsx +0 -22
- package/src/components/basic/Text/Text.styles.ts +0 -500
- package/src/components/basic/Text/Text.test.tsx +0 -299
- package/src/components/basic/Text/Text.tsx +0 -340
- package/src/components/basic/Text/Text.types.ts +0 -329
- package/src/components/basic/Text/index.tsx +0 -27
- package/src/components/basic/Typography/Typography.styles.ts +0 -347
- package/src/components/basic/Typography/Typography.tsx +0 -207
- package/src/components/basic/Typography/Typography.types.ts +0 -296
- package/src/components/basic/Typography/index.tsx +0 -14
- package/src/components/basic/Video/Video.styles.ts +0 -777
- package/src/components/basic/Video/Video.test.tsx +0 -490
- package/src/components/basic/Video/Video.tsx +0 -1468
- package/src/components/basic/Video/Video.types.ts +0 -500
- package/src/components/basic/Video/index.tsx +0 -26
- package/src/components/basic/index.tsx +0 -300
- package/src/components/common/ErrorBoundary.tsx +0 -87
- package/src/components/common/LazyComponent.tsx +0 -247
- package/src/components/common/ResponsiveContainer.tsx +0 -93
- package/src/components/common/ResponsiveGrid.tsx +0 -183
- package/src/components/common/SecurityProvider.tsx +0 -98
- package/src/components/common/ThemeProvider.tsx +0 -115
- package/src/components/common/VirtualList.tsx +0 -350
- package/src/components/common/__tests__/ErrorBoundary.test.tsx +0 -249
- package/src/components/common/index.tsx +0 -32
- package/src/components/display/Avatar/Avatar.styles.ts +0 -62
- package/src/components/display/Avatar/Avatar.test.tsx +0 -390
- package/src/components/display/Avatar/Avatar.tsx +0 -66
- package/src/components/display/Avatar/Avatar.types.ts +0 -40
- package/src/components/display/Avatar/index.ts +0 -3
- package/src/components/display/Badge/Badge.tsx +0 -29
- package/src/components/display/Badge/Badge.types.ts +0 -29
- package/src/components/display/Badge/index.ts +0 -2
- package/src/components/display/Calendar/Calendar.styles.ts +0 -255
- package/src/components/display/Calendar/Calendar.test.tsx +0 -42
- package/src/components/display/Calendar/Calendar.tsx +0 -358
- package/src/components/display/Calendar/Calendar.types.ts +0 -91
- package/src/components/display/Calendar/index.ts +0 -3
- package/src/components/display/Card/Card.styles.ts +0 -89
- package/src/components/display/Card/Card.test.tsx +0 -182
- package/src/components/display/Card/Card.tsx +0 -135
- package/src/components/display/Card/Card.types.ts +0 -55
- package/src/components/display/Card/index.ts +0 -3
- package/src/components/display/Carousel/Carousel.styles.ts +0 -206
- package/src/components/display/Carousel/Carousel.tsx +0 -290
- package/src/components/display/Carousel/Carousel.types.ts +0 -57
- package/src/components/display/Carousel/index.ts +0 -3
- package/src/components/display/List/List.styles.ts +0 -79
- package/src/components/display/List/List.tsx +0 -114
- package/src/components/display/List/List.types.ts +0 -68
- package/src/components/display/List/index.ts +0 -3
- package/src/components/display/Rate/Rate.styles.ts +0 -254
- package/src/components/display/Rate/Rate.tsx +0 -324
- package/src/components/display/Rate/Rate.types.ts +0 -112
- package/src/components/display/Rate/index.ts +0 -20
- package/src/components/display/Table/Table.styles.ts +0 -269
- package/src/components/display/Table/Table.test.tsx +0 -345
- package/src/components/display/Table/Table.tsx +0 -426
- package/src/components/display/Table/Table.types.ts +0 -256
- package/src/components/display/Table/index.tsx +0 -16
- package/src/components/display/Tag/Tag.styles.ts +0 -197
- package/src/components/display/Tag/Tag.test.tsx +0 -541
- package/src/components/display/Tag/Tag.tsx +0 -139
- package/src/components/display/Tag/Tag.types.ts +0 -49
- package/src/components/display/Tag/index.ts +0 -3
- package/src/components/display/Timeline/Timeline.styles.ts +0 -211
- package/src/components/display/Timeline/Timeline.tsx +0 -220
- package/src/components/display/Timeline/Timeline.types.ts +0 -56
- package/src/components/display/Timeline/index.ts +0 -3
- package/src/components/display/index.tsx +0 -147
- package/src/components/feedback/Loading/Loading.styles.ts +0 -117
- package/src/components/feedback/Loading/Loading.test.tsx +0 -534
- package/src/components/feedback/Loading/Loading.tsx +0 -132
- package/src/components/feedback/Loading/Loading.types.ts +0 -33
- package/src/components/feedback/Loading/index.ts +0 -6
- package/src/components/feedback/Message/Message.styles.ts +0 -41
- package/src/components/feedback/Message/Message.test.tsx +0 -234
- package/src/components/feedback/Message/Message.tsx +0 -96
- package/src/components/feedback/Message/Message.types.ts +0 -37
- package/src/components/feedback/Message/index.ts +0 -6
- package/src/components/feedback/Modal/Modal.styles.ts +0 -21
- package/src/components/feedback/Modal/Modal.test.tsx +0 -11
- package/src/components/feedback/Modal/Modal.tsx +0 -269
- package/src/components/feedback/Modal/Modal.types.ts +0 -151
- package/src/components/feedback/Modal/index.tsx +0 -11
- package/src/components/feedback/Notification/Notification.styles.ts +0 -453
- package/src/components/feedback/Notification/Notification.test.tsx +0 -401
- package/src/components/feedback/Notification/Notification.tsx +0 -347
- package/src/components/feedback/Notification/Notification.types.ts +0 -339
- package/src/components/feedback/Notification/NotificationManager.tsx +0 -405
- package/src/components/feedback/Notification/index.ts +0 -40
- package/src/components/feedback/Notification/index.tsx +0 -154
- package/src/components/feedback/Progress/Progress.styles.ts +0 -469
- package/src/components/feedback/Progress/Progress.test.simple.tsx +0 -14
- package/src/components/feedback/Progress/Progress.test.tsx +0 -312
- package/src/components/feedback/Progress/Progress.tsx +0 -488
- package/src/components/feedback/Progress/Progress.types.ts +0 -163
- package/src/components/feedback/Progress/index.ts +0 -3
- package/src/components/feedback/Progress/index.tsx +0 -38
- package/src/components/feedback/Progress/utils/animation.ts +0 -193
- package/src/components/feedback/Progress/utils/index.ts +0 -26
- package/src/components/feedback/Progress/utils/progress-calculator.ts +0 -199
- package/src/components/feedback/Result/Result.styles.ts +0 -139
- package/src/components/feedback/Result/Result.tsx +0 -221
- package/src/components/feedback/Result/Result.types.ts +0 -128
- package/src/components/feedback/Result/index.tsx +0 -3
- package/src/components/feedback/Toast/Toast.styles.ts +0 -17
- package/src/components/feedback/Toast/Toast.test.tsx +0 -10
- package/src/components/feedback/Toast/Toast.tsx +0 -384
- package/src/components/feedback/Toast/Toast.types.ts +0 -86
- package/src/components/feedback/Toast/index.tsx +0 -3
- package/src/components/feedback/Tooltip/Tooltip.examples.tsx +0 -435
- package/src/components/feedback/Tooltip/Tooltip.styles.ts +0 -340
- package/src/components/feedback/Tooltip/Tooltip.test.tsx +0 -446
- package/src/components/feedback/Tooltip/Tooltip.tsx +0 -302
- package/src/components/feedback/Tooltip/Tooltip.types.ts +0 -166
- package/src/components/feedback/Tooltip/index.ts +0 -3
- package/src/components/feedback/Tooltip/index.tsx +0 -246
- package/src/components/feedback/index.tsx +0 -176
- package/src/components/form/Cascader/Cascader.styles.ts +0 -526
- package/src/components/form/Cascader/Cascader.test.tsx +0 -77
- package/src/components/form/Cascader/Cascader.tsx +0 -581
- package/src/components/form/Cascader/Cascader.types.ts +0 -581
- package/src/components/form/Cascader/hooks/index.ts +0 -3
- package/src/components/form/Cascader/hooks/useCascaderFieldNames.ts +0 -19
- package/src/components/form/Cascader/hooks/useCascaderOptions.ts +0 -127
- package/src/components/form/Cascader/hooks/useCascaderState.ts +0 -139
- package/src/components/form/Cascader/index.ts +0 -25
- package/src/components/form/Cascader/utils/formatDisplayValue.ts +0 -19
- package/src/components/form/Cascader/utils/index.ts +0 -1
- package/src/components/form/Checkbox/Checkbox.styles.ts +0 -607
- package/src/components/form/Checkbox/Checkbox.test.tsx +0 -1140
- package/src/components/form/Checkbox/Checkbox.tsx +0 -489
- package/src/components/form/Checkbox/Checkbox.types.ts +0 -472
- package/src/components/form/Checkbox/CheckboxGroup.tsx +0 -444
- package/src/components/form/Checkbox/index.tsx +0 -27
- package/src/components/form/DatePicker/DatePicker.styles.ts +0 -393
- package/src/components/form/DatePicker/DatePicker.test.tsx +0 -407
- package/src/components/form/DatePicker/DatePicker.tsx +0 -376
- package/src/components/form/DatePicker/DatePicker.types.ts +0 -250
- package/src/components/form/DatePicker/index.tsx +0 -15
- package/src/components/form/Form/Form.styles.ts +0 -357
- package/src/components/form/Form/Form.test.tsx +0 -122
- package/src/components/form/Form/Form.tsx +0 -257
- package/src/components/form/Form/Form.types.ts +0 -422
- package/src/components/form/Form/index.tsx +0 -31
- package/src/components/form/Form/useFormLogic.ts +0 -497
- package/src/components/form/Input/Input.styles.ts +0 -445
- package/src/components/form/Input/Input.test.tsx +0 -494
- package/src/components/form/Input/Input.tsx +0 -305
- package/src/components/form/Input/Input.types.ts +0 -297
- package/src/components/form/Input/index.tsx +0 -26
- package/src/components/form/Input/useInputLogic.test.ts +0 -82
- package/src/components/form/Input/useInputLogic.ts +0 -260
- package/src/components/form/InputNumber/InputNumber.styles.ts +0 -716
- package/src/components/form/InputNumber/InputNumber.tsx +0 -402
- package/src/components/form/InputNumber/InputNumber.types.ts +0 -336
- package/src/components/form/InputNumber/components/InputNumberClearButton.tsx +0 -24
- package/src/components/form/InputNumber/components/InputNumberControls.tsx +0 -33
- package/src/components/form/InputNumber/components/index.ts +0 -2
- package/src/components/form/InputNumber/hooks/index.ts +0 -4
- package/src/components/form/InputNumber/hooks/useInputNumberState.ts +0 -313
- package/src/components/form/InputNumber/hooks/useInputNumberValidation.ts +0 -148
- package/src/components/form/InputNumber/index.ts +0 -25
- package/src/components/form/Radio/Radio.styles.ts +0 -451
- package/src/components/form/Radio/Radio.test.tsx +0 -547
- package/src/components/form/Radio/Radio.tsx +0 -277
- package/src/components/form/Radio/Radio.types.ts +0 -414
- package/src/components/form/Radio/index.tsx +0 -21
- package/src/components/form/Select/Select.styles.ts +0 -518
- package/src/components/form/Select/Select.test.tsx +0 -648
- package/src/components/form/Select/Select.tsx +0 -474
- package/src/components/form/Select/Select.types.ts +0 -429
- package/src/components/form/Select/index.tsx +0 -30
- package/src/components/form/Slider/Slider.styles.ts +0 -139
- package/src/components/form/Slider/Slider.test.tsx +0 -553
- package/src/components/form/Slider/Slider.tsx +0 -312
- package/src/components/form/Slider/Slider.types.ts +0 -110
- package/src/components/form/Slider/index.tsx +0 -3
- package/src/components/form/Switch/Switch.styles.ts +0 -534
- package/src/components/form/Switch/Switch.test.tsx +0 -345
- package/src/components/form/Switch/Switch.tsx +0 -458
- package/src/components/form/Switch/Switch.types.ts +0 -386
- package/src/components/form/Switch/index.tsx +0 -26
- package/src/components/form/Textarea/Textarea.styles.ts +0 -592
- package/src/components/form/Textarea/Textarea.test.tsx +0 -1075
- package/src/components/form/Textarea/Textarea.tsx +0 -608
- package/src/components/form/Textarea/Textarea.types.ts +0 -374
- package/src/components/form/Textarea/index.tsx +0 -26
- package/src/components/form/TimePicker/TimePicker.styles.ts +0 -434
- package/src/components/form/TimePicker/TimePicker.test.tsx +0 -306
- package/src/components/form/TimePicker/TimePicker.tsx +0 -250
- package/src/components/form/TimePicker/TimePicker.types.ts +0 -385
- package/src/components/form/TimePicker/index.ts +0 -21
- package/src/components/form/Transfer/Transfer.styles.ts +0 -490
- package/src/components/form/Transfer/Transfer.test.tsx +0 -316
- package/src/components/form/Transfer/Transfer.tsx +0 -414
- package/src/components/form/Transfer/Transfer.types.ts +0 -565
- package/src/components/form/Transfer/components/TransferItem.tsx +0 -94
- package/src/components/form/Transfer/components/TransferList.tsx +0 -298
- package/src/components/form/Transfer/components/TransferOperations.tsx +0 -81
- package/src/components/form/Transfer/components/TransferPagination.tsx +0 -139
- package/src/components/form/Transfer/components/TransferSearch.tsx +0 -85
- package/src/components/form/Transfer/components/index.ts +0 -6
- package/src/components/form/Transfer/hooks/index.ts +0 -3
- package/src/components/form/Transfer/hooks/useTransferData.ts +0 -202
- package/src/components/form/Transfer/hooks/useTransferState.ts +0 -120
- package/src/components/form/Transfer/index.ts +0 -27
- package/src/components/form/Upload/Upload.styles.ts +0 -145
- package/src/components/form/Upload/Upload.test.tsx +0 -10
- package/src/components/form/Upload/Upload.tsx +0 -498
- package/src/components/form/Upload/Upload.types.ts +0 -200
- package/src/components/form/Upload/index.tsx +0 -12
- package/src/components/form/index.tsx +0 -152
- package/src/components/index.tsx +0 -145
- package/src/components/layout/Affix/Affix.styles.ts +0 -42
- package/src/components/layout/Affix/Affix.test.tsx +0 -10
- package/src/components/layout/Affix/Affix.tsx +0 -83
- package/src/components/layout/Affix/Affix.types.ts +0 -29
- package/src/components/layout/Affix/index.tsx +0 -3
- package/src/components/layout/Col/Col.styles.ts +0 -185
- package/src/components/layout/Col/Col.test.tsx +0 -537
- package/src/components/layout/Col/Col.tsx +0 -97
- package/src/components/layout/Col/Col.types.ts +0 -59
- package/src/components/layout/Col/index.tsx +0 -3
- package/src/components/layout/Container/Container.styles.ts +0 -163
- package/src/components/layout/Container/Container.test.tsx +0 -380
- package/src/components/layout/Container/Container.tsx +0 -123
- package/src/components/layout/Container/Container.types.ts +0 -63
- package/src/components/layout/Container/index.tsx +0 -3
- package/src/components/layout/Grid/Grid.styles.ts +0 -183
- package/src/components/layout/Grid/Grid.test.tsx +0 -637
- package/src/components/layout/Grid/Grid.tsx +0 -123
- package/src/components/layout/Grid/Grid.types.ts +0 -78
- package/src/components/layout/Grid/index.tsx +0 -3
- package/src/components/layout/Layout/Content.tsx +0 -30
- package/src/components/layout/Layout/Footer.tsx +0 -30
- package/src/components/layout/Layout/Header.tsx +0 -30
- package/src/components/layout/Layout/Layout.styles.ts +0 -84
- package/src/components/layout/Layout/Layout.test.tsx +0 -10
- package/src/components/layout/Layout/Layout.tsx +0 -28
- package/src/components/layout/Layout/Layout.types.ts +0 -58
- package/src/components/layout/Layout/Sider.tsx +0 -44
- package/src/components/layout/Layout/index.tsx +0 -22
- package/src/components/layout/Row/Row.styles.ts +0 -159
- package/src/components/layout/Row/Row.test.tsx +0 -467
- package/src/components/layout/Row/Row.tsx +0 -111
- package/src/components/layout/Row/Row.types.ts +0 -60
- package/src/components/layout/Row/index.tsx +0 -3
- package/src/components/layout/Space/Space.styles.ts +0 -255
- package/src/components/layout/Space/Space.test.tsx +0 -682
- package/src/components/layout/Space/Space.tsx +0 -203
- package/src/components/layout/Space/Space.types.ts +0 -92
- package/src/components/layout/Space/index.tsx +0 -12
- package/src/components/layout/index.tsx +0 -78
- package/src/components/navigation/Menu/Menu.constants.ts +0 -69
- package/src/components/navigation/Menu/Menu.stories.tsx +0 -107
- package/src/components/navigation/Menu/Menu.styles.ts +0 -767
- package/src/components/navigation/Menu/Menu.tsx +0 -352
- package/src/components/navigation/Menu/Menu.types.ts +0 -231
- package/src/components/navigation/Menu/Menu.utils.ts +0 -187
- package/src/components/navigation/Menu/MenuItem.tsx +0 -124
- package/src/components/navigation/Menu/SubMenu.tsx +0 -150
- package/src/components/navigation/Menu/index.tsx +0 -59
- package/src/components/navigation/NavBar/NavBar.styles.ts +0 -129
- package/src/components/navigation/NavBar/NavBar.test.tsx +0 -287
- package/src/components/navigation/NavBar/NavBar.tsx +0 -228
- package/src/components/navigation/NavBar/NavBar.types.ts +0 -54
- package/src/components/navigation/NavBar/index.tsx +0 -3
- package/src/components/navigation/Pagination/Pagination.styles.ts +0 -187
- package/src/components/navigation/Pagination/Pagination.test.tsx +0 -672
- package/src/components/navigation/Pagination/Pagination.tsx +0 -395
- package/src/components/navigation/Pagination/Pagination.types.ts +0 -87
- package/src/components/navigation/Pagination/index.ts +0 -24
- package/src/components/navigation/Pagination/index.tsx +0 -9
- package/src/components/navigation/Steps/Step.tsx +0 -36
- package/src/components/navigation/Steps/Steps.styles.ts +0 -169
- package/src/components/navigation/Steps/Steps.test.tsx +0 -14
- package/src/components/navigation/Steps/Steps.tsx +0 -112
- package/src/components/navigation/Steps/Steps.types.ts +0 -47
- package/src/components/navigation/Steps/index.tsx +0 -3
- package/src/components/navigation/Tabs/Tabs.styles.ts +0 -199
- package/src/components/navigation/Tabs/Tabs.test.tsx +0 -662
- package/src/components/navigation/Tabs/Tabs.tsx +0 -253
- package/src/components/navigation/Tabs/Tabs.types.ts +0 -115
- package/src/components/navigation/Tabs/index.tsx +0 -3
- package/src/components/navigation/index.tsx +0 -88
- package/src/constants/index.ts +0 -785
- package/src/hooks/index.ts +0 -60
- package/src/hooks/types.ts +0 -9
- package/src/hooks/useAsync.ts +0 -64
- package/src/hooks/useClickOutside.ts +0 -52
- package/src/hooks/useCounter.ts +0 -87
- package/src/hooks/useDebounce.ts +0 -150
- package/src/hooks/useDeepCompareEffect.ts +0 -88
- package/src/hooks/useEventHandling.ts +0 -444
- package/src/hooks/useEventListener.ts +0 -77
- package/src/hooks/useLifecycle.ts +0 -399
- package/src/hooks/useMediaQuery.ts +0 -75
- package/src/hooks/useMutation.ts +0 -233
- package/src/hooks/usePerformance.ts +0 -378
- package/src/hooks/usePerformanceMonitor.ts +0 -348
- package/src/hooks/usePlatform.ts +0 -64
- package/src/hooks/usePrevious.ts +0 -25
- package/src/hooks/useRequest.test.ts +0 -11
- package/src/hooks/useRequest.ts +0 -140
- package/src/hooks/useStateManagement.ts +0 -300
- package/src/hooks/useStorage.ts +0 -169
- package/src/hooks/useStyle.ts +0 -543
- package/src/hooks/useTheme.ts +0 -347
- package/src/hooks/useToggle.ts +0 -54
- package/src/hooks/useVirtualScroll.ts +0 -331
- package/src/index.ts +0 -323
- package/src/platform/index.ts +0 -1188
- package/src/providers/AppProvider.test.tsx +0 -63
- package/src/providers/AppProvider.tsx +0 -155
- package/src/providers/index.ts +0 -1
- package/src/theme/ThemeProvider.tsx +0 -279
- package/src/theme/ThemeProvider.types.ts +0 -26
- package/src/theme/animations.tsx +0 -660
- package/src/theme/defaults.ts +0 -188
- package/src/theme/design-system.ts +0 -562
- package/src/theme/design-tokens.ts +0 -1122
- package/src/theme/generated/dark-theme.scss +0 -120
- package/src/theme/generated/tokens.css +0 -441
- package/src/theme/generated/tokens.scss +0 -384
- package/src/theme/index.ts +0 -99
- package/src/theme/responsive.tsx +0 -195
- package/src/theme/styles/mixins.scss +0 -612
- package/src/theme/styles/variables.scss +0 -295
- package/src/theme/styles.ts +0 -403
- package/src/theme/tokens/colors.ts +0 -256
- package/src/theme/tokens/effects.ts +0 -260
- package/src/theme/tokens/index.ts +0 -217
- package/src/theme/tokens/spacing.ts +0 -137
- package/src/theme/tokens/typography.ts +0 -186
- package/src/theme/types.ts +0 -188
- package/src/theme/useThemeUtils.ts +0 -313
- package/src/theme/utils.ts +0 -501
- package/src/theme/variables.ts +0 -602
- package/src/types/accessibility.ts +0 -50
- package/src/types/button.ts +0 -560
- package/src/types/component-props.ts +0 -322
- package/src/types/env.d.ts +0 -20
- package/src/types/glob.d.ts +0 -4
- package/src/types/index.ts +0 -427
- package/src/types/modules.d.ts +0 -40
- package/src/types/standardized-components.ts +0 -550
- package/src/types/taro-adapter.d.ts +0 -174
- package/src/types/taro-components.d.ts +0 -73
- package/src/types/utils.ts +0 -400
- package/src/utils/__tests__/inputValidator.test.ts +0 -338
- package/src/utils/__tests__/responsiveUtils.test.ts +0 -311
- package/src/utils/__tests__/xssProtection.test.ts +0 -268
- package/src/utils/abort-controller.ts +0 -48
- package/src/utils/cache.ts +0 -79
- package/src/utils/createNamespace.ts +0 -24
- package/src/utils/environment.ts +0 -115
- package/src/utils/error-handler.ts +0 -88
- package/src/utils/errorLogger.ts +0 -193
- package/src/utils/formatUtils.ts +0 -412
- package/src/utils/http/error-codes.ts +0 -314
- package/src/utils/http/http-client.test.ts +0 -63
- package/src/utils/http/http-client.ts +0 -161
- package/src/utils/http/request-cache.ts +0 -127
- package/src/utils/http/request.ts +0 -954
- package/src/utils/http/taro-adapter.test.ts +0 -74
- package/src/utils/http/taro-adapter.ts +0 -24
- package/src/utils/http/types.ts +0 -414
- package/src/utils/http/web-adapter.ts +0 -33
- package/src/utils/index.ts +0 -112
- package/src/utils/inputValidator.ts +0 -264
- package/src/utils/performance/performance.ts +0 -839
- package/src/utils/responsiveUtils.ts +0 -348
- package/src/utils/rtl-support.ts +0 -354
- package/src/utils/security/api-security.ts +0 -394
- package/src/utils/security/xss-protection.ts +0 -69
- package/src/utils/securityHeaders.ts +0 -308
- package/src/utils/typeHelpers.ts +0 -16
- package/src/utils/types/dataProcessing.ts +0 -544
- package/src/utils/types/typeHelpers.ts +0 -197
- package/src/utils/xssProtection.ts +0 -468
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { View, Text } from '@tarojs/components';
|
|
3
|
-
import { rateStyles } from './Rate.styles';
|
|
4
|
-
import type { RateProps, RateRef, StarState, StarProps, RateCharacter } from './Rate.types';
|
|
5
|
-
|
|
6
|
-
/** 默认星星字符 */
|
|
7
|
-
const DEFAULT_CHARACTER = '★';
|
|
8
|
-
|
|
9
|
-
/** 单个星星组件 */
|
|
10
|
-
const Star: React.FC<StarProps> = ({
|
|
11
|
-
index,
|
|
12
|
-
state,
|
|
13
|
-
disabled = false,
|
|
14
|
-
readonly = false,
|
|
15
|
-
size,
|
|
16
|
-
character = DEFAULT_CHARACTER,
|
|
17
|
-
color,
|
|
18
|
-
unselectedColor,
|
|
19
|
-
onClick,
|
|
20
|
-
// onHover and onLeave not supported in Taro.js
|
|
21
|
-
}) => {
|
|
22
|
-
// isHovering removed as mouse events are not supported in Taro.js
|
|
23
|
-
|
|
24
|
-
const handleClick = useCallback(
|
|
25
|
-
(e: any) => {
|
|
26
|
-
if (disabled || readonly) return;
|
|
27
|
-
|
|
28
|
-
const rect = e.currentTarget.getBoundingClientRect?.();
|
|
29
|
-
if (rect) {
|
|
30
|
-
const clickX = e.clientX || e.touches?.[0]?.clientX;
|
|
31
|
-
const position = clickX - rect.left < rect.width / 2 ? 0.5 : 1;
|
|
32
|
-
onClick?.(index, position);
|
|
33
|
-
} else {
|
|
34
|
-
onClick?.(index, 1);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
[disabled, readonly, index, onClick],
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
// Taro.js doesn't support mouse events, but we can keep touch events
|
|
41
|
-
// Mouse event handlers are removed as they're not supported in Taro
|
|
42
|
-
|
|
43
|
-
const starStyle = rateStyles['getStarStyle']({
|
|
44
|
-
size,
|
|
45
|
-
state,
|
|
46
|
-
disabled,
|
|
47
|
-
readonly,
|
|
48
|
-
color,
|
|
49
|
-
unselectedColor,
|
|
50
|
-
// isHovering removed as mouse events are not supported in Taro.js
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const starClassName = rateStyles['getStarClassName']({
|
|
54
|
-
state,
|
|
55
|
-
// isHovering removed as mouse events are not supported in Taro.js
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const renderCharacter = () => {
|
|
59
|
-
if (typeof character === 'function') {
|
|
60
|
-
try {
|
|
61
|
-
const result = (character as (index: number) => RateCharacter)(index);
|
|
62
|
-
return result || <Text>{DEFAULT_CHARACTER}</Text>;
|
|
63
|
-
} catch (error) {
|
|
64
|
-
return <Text>{DEFAULT_CHARACTER}</Text>;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (typeof character === 'string') {
|
|
68
|
-
return <Text>{character}</Text>;
|
|
69
|
-
}
|
|
70
|
-
if (character) {
|
|
71
|
-
return character;
|
|
72
|
-
}
|
|
73
|
-
return <Text>{DEFAULT_CHARACTER}</Text>;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const renderHalfStar = () => {
|
|
77
|
-
if (state !== 'half') return null;
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<View style={rateStyles['getHalfStarMaskStyle']({ color, unselectedColor })} className="taro-uno-rate__star-half">
|
|
81
|
-
{renderCharacter()}
|
|
82
|
-
</View>
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<View className={starClassName} style={starStyle} onClick={handleClick} onTouchStart={handleClick}>
|
|
88
|
-
{renderCharacter()}
|
|
89
|
-
{renderHalfStar()}
|
|
90
|
-
</View>
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/** Rate评分组件 */
|
|
95
|
-
export const RateComponent = forwardRef<RateRef, RateProps>((props, ref) => {
|
|
96
|
-
const {
|
|
97
|
-
value: controlledValue,
|
|
98
|
-
defaultValue = 0,
|
|
99
|
-
count = 5,
|
|
100
|
-
allowHalf = false,
|
|
101
|
-
allowClear = true,
|
|
102
|
-
disabled = false,
|
|
103
|
-
readonly = false,
|
|
104
|
-
size = 'default',
|
|
105
|
-
character = DEFAULT_CHARACTER,
|
|
106
|
-
tooltips = [],
|
|
107
|
-
showTooltips = false,
|
|
108
|
-
color,
|
|
109
|
-
unselectedColor,
|
|
110
|
-
autoFocus = false,
|
|
111
|
-
keyboard = true,
|
|
112
|
-
onChange,
|
|
113
|
-
onHoverChange,
|
|
114
|
-
onFocus,
|
|
115
|
-
onBlur,
|
|
116
|
-
onKeyDown,
|
|
117
|
-
className,
|
|
118
|
-
style,
|
|
119
|
-
...restProps
|
|
120
|
-
} = props;
|
|
121
|
-
|
|
122
|
-
const rateRef = useRef<any>(null);
|
|
123
|
-
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
124
|
-
const [hoverValue, setHoverValue] = useState<number | null>(null);
|
|
125
|
-
const [focused, setFocused] = useState(false);
|
|
126
|
-
const [showTooltip, setShowTooltip] = useState<number | null>(null);
|
|
127
|
-
|
|
128
|
-
// 处理受控模式
|
|
129
|
-
const currentValue = controlledValue !== undefined ? controlledValue : internalValue;
|
|
130
|
-
|
|
131
|
-
useEffect(() => {
|
|
132
|
-
if (controlledValue !== undefined) {
|
|
133
|
-
setInternalValue(controlledValue);
|
|
134
|
-
}
|
|
135
|
-
}, [controlledValue]);
|
|
136
|
-
|
|
137
|
-
// 自动聚焦
|
|
138
|
-
useEffect(() => {
|
|
139
|
-
if (autoFocus && !disabled && rateRef.current) {
|
|
140
|
-
// 在Taro中,可能需要特殊处理聚焦
|
|
141
|
-
setFocused(true);
|
|
142
|
-
onFocus?.();
|
|
143
|
-
}
|
|
144
|
-
}, [autoFocus, disabled, onFocus]);
|
|
145
|
-
|
|
146
|
-
// 计算星星状态
|
|
147
|
-
const getStarState = useCallback(
|
|
148
|
-
(index: number): StarState => {
|
|
149
|
-
const displayValue = hoverValue !== null ? hoverValue : currentValue;
|
|
150
|
-
const starValue = index + 1;
|
|
151
|
-
|
|
152
|
-
if (displayValue >= starValue) {
|
|
153
|
-
return 'full';
|
|
154
|
-
}
|
|
155
|
-
if (allowHalf && displayValue >= starValue - 0.5) {
|
|
156
|
-
return 'half';
|
|
157
|
-
}
|
|
158
|
-
return 'empty';
|
|
159
|
-
},
|
|
160
|
-
[currentValue, hoverValue, allowHalf],
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
// 处理值变化
|
|
164
|
-
const handleValueChange = useCallback(
|
|
165
|
-
(newValue: number) => {
|
|
166
|
-
// 如果允许清除且点击相同值,则清除
|
|
167
|
-
if (allowClear && newValue === currentValue) {
|
|
168
|
-
newValue = 0;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (controlledValue === undefined) {
|
|
172
|
-
setInternalValue(newValue);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
onChange?.(newValue);
|
|
176
|
-
},
|
|
177
|
-
[allowClear, currentValue, controlledValue, onChange],
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
// 处理星星点击
|
|
181
|
-
const handleStarClick = useCallback(
|
|
182
|
-
(index: number, position: number) => {
|
|
183
|
-
if (disabled || readonly) return;
|
|
184
|
-
|
|
185
|
-
const newValue = allowHalf && position < 1 ? index + 0.5 : index + 1;
|
|
186
|
-
handleValueChange(newValue);
|
|
187
|
-
},
|
|
188
|
-
[disabled, readonly, allowHalf, handleValueChange],
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
// 处理星星悬停
|
|
192
|
-
const handleStarHover = useCallback(
|
|
193
|
-
(index: number, position: number) => {
|
|
194
|
-
if (disabled || readonly) return;
|
|
195
|
-
|
|
196
|
-
const newHoverValue = allowHalf && position < 1 ? index + 0.5 : index + 1;
|
|
197
|
-
setHoverValue(newHoverValue);
|
|
198
|
-
onHoverChange?.(newHoverValue);
|
|
199
|
-
|
|
200
|
-
// 显示工具提示
|
|
201
|
-
if (showTooltips && tooltips[index]) {
|
|
202
|
-
setShowTooltip(index);
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
[disabled, readonly, allowHalf, showTooltips, tooltips, onHoverChange],
|
|
206
|
-
);
|
|
207
|
-
|
|
208
|
-
// 处理鼠标离开
|
|
209
|
-
const handleMouseLeave = useCallback(() => {
|
|
210
|
-
if (disabled || readonly) return;
|
|
211
|
-
|
|
212
|
-
setHoverValue(null);
|
|
213
|
-
setShowTooltip(null);
|
|
214
|
-
onHoverChange?.(currentValue);
|
|
215
|
-
}, [disabled, readonly, currentValue, onHoverChange]);
|
|
216
|
-
|
|
217
|
-
// 键盘事件处理移除,因为 Taro.js 不支持 onKeyDown 事件
|
|
218
|
-
|
|
219
|
-
// 处理聚焦
|
|
220
|
-
const handleFocus = useCallback(() => {
|
|
221
|
-
if (disabled) return;
|
|
222
|
-
setFocused(true);
|
|
223
|
-
onFocus?.();
|
|
224
|
-
}, [disabled, onFocus]);
|
|
225
|
-
|
|
226
|
-
// 处理失焦
|
|
227
|
-
|
|
228
|
-
// 渲染工具提示
|
|
229
|
-
const renderTooltip = (index: number) => {
|
|
230
|
-
if (!showTooltips || !tooltips[index] || showTooltip !== index) return null;
|
|
231
|
-
|
|
232
|
-
return (
|
|
233
|
-
<View className="taro-uno-rate__tooltip" style={rateStyles['getTooltipStyle']()}>
|
|
234
|
-
<Text>{tooltips[index]}</Text>
|
|
235
|
-
</View>
|
|
236
|
-
);
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
// 计算样式
|
|
240
|
-
const containerStyle = rateStyles['getContainerStyle']({
|
|
241
|
-
size,
|
|
242
|
-
disabled,
|
|
243
|
-
readonly,
|
|
244
|
-
style: {
|
|
245
|
-
...rateStyles['getAccessibilityStyle'](focused),
|
|
246
|
-
...style,
|
|
247
|
-
},
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
const containerClassName = rateStyles['getClassName']({
|
|
251
|
-
size,
|
|
252
|
-
disabled,
|
|
253
|
-
readonly,
|
|
254
|
-
className,
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
// 暴露给外部的引用方法
|
|
258
|
-
React.useImperativeHandle(
|
|
259
|
-
ref,
|
|
260
|
-
() => ({
|
|
261
|
-
element: rateRef.current,
|
|
262
|
-
getValue: () => currentValue,
|
|
263
|
-
setValue: (value: number) => {
|
|
264
|
-
if (value >= 0 && value <= count) {
|
|
265
|
-
handleValueChange(value);
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
reset: () => handleValueChange(0),
|
|
269
|
-
focus: () => {
|
|
270
|
-
setFocused(true);
|
|
271
|
-
onFocus?.();
|
|
272
|
-
},
|
|
273
|
-
blur: () => {
|
|
274
|
-
setFocused(false);
|
|
275
|
-
onBlur?.();
|
|
276
|
-
},
|
|
277
|
-
}),
|
|
278
|
-
[currentValue, count, handleValueChange, onFocus, onBlur],
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
return (
|
|
282
|
-
<View
|
|
283
|
-
ref={rateRef}
|
|
284
|
-
className={containerClassName}
|
|
285
|
-
style={containerStyle}
|
|
286
|
-
onClick={keyboard ? handleFocus : undefined}
|
|
287
|
-
// tabIndex, onBlur and onKeyDown not supported in Taro.js
|
|
288
|
-
role="slider"
|
|
289
|
-
aria-valuemin={0}
|
|
290
|
-
aria-valuemax={count}
|
|
291
|
-
aria-valuenow={currentValue}
|
|
292
|
-
aria-valuetext={`${currentValue} out of ${count} stars`}
|
|
293
|
-
aria-label={`Rating: ${currentValue} out of ${count} stars`}
|
|
294
|
-
aria-disabled={disabled}
|
|
295
|
-
aria-readonly={readonly}
|
|
296
|
-
{...restProps}
|
|
297
|
-
>
|
|
298
|
-
{Array.from({ length: count }, (_, index) => (
|
|
299
|
-
<View key={index} style={{ position: 'relative' }}>
|
|
300
|
-
<Star
|
|
301
|
-
index={index}
|
|
302
|
-
state={getStarState(index)}
|
|
303
|
-
disabled={disabled}
|
|
304
|
-
readonly={readonly}
|
|
305
|
-
size={size}
|
|
306
|
-
character={character as RateCharacter}
|
|
307
|
-
color={color}
|
|
308
|
-
unselectedColor={unselectedColor}
|
|
309
|
-
onClick={handleStarClick}
|
|
310
|
-
onHover={handleStarHover}
|
|
311
|
-
onLeave={handleMouseLeave}
|
|
312
|
-
/>
|
|
313
|
-
{renderTooltip(index)}
|
|
314
|
-
</View>
|
|
315
|
-
))}
|
|
316
|
-
</View>
|
|
317
|
-
);
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
/** Rate组件显示名称 */
|
|
321
|
-
RateComponent.displayName = 'Rate';
|
|
322
|
-
|
|
323
|
-
/** 导出Rate组件 */
|
|
324
|
-
export const Rate = RateComponent;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { Size } from '../../../types';
|
|
3
|
-
import { BaseComponentProps as StandardBaseComponentProps } from '../../../types/component-props';
|
|
4
|
-
|
|
5
|
-
/** 评分尺寸 */
|
|
6
|
-
export type RateSize = Size | 'small' | 'medium' | 'large';
|
|
7
|
-
|
|
8
|
-
/** 评分字符 */
|
|
9
|
-
export type RateCharacter = ReactNode | string;
|
|
10
|
-
|
|
11
|
-
/** 评分引用 */
|
|
12
|
-
export interface RateRef {
|
|
13
|
-
/** 获取元素引用 */
|
|
14
|
-
element: any | null;
|
|
15
|
-
/** 获取当前评分值 */
|
|
16
|
-
getValue: () => number;
|
|
17
|
-
/** 设置评分值 */
|
|
18
|
-
setValue: (_value: number) => void;
|
|
19
|
-
/** 重置评分 */
|
|
20
|
-
reset: () => void;
|
|
21
|
-
/** 聚焦到组件 */
|
|
22
|
-
focus: () => void;
|
|
23
|
-
/** 失焦 */
|
|
24
|
-
blur: () => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** 评分组件属性 */
|
|
28
|
-
export interface RateProps extends StandardBaseComponentProps {
|
|
29
|
-
/** 当前评分值 */
|
|
30
|
-
value?: number;
|
|
31
|
-
/** 默认评分值 */
|
|
32
|
-
defaultValue?: number;
|
|
33
|
-
/** 星星总数 */
|
|
34
|
-
count?: number;
|
|
35
|
-
/** 是否允许半星 */
|
|
36
|
-
allowHalf?: boolean;
|
|
37
|
-
/** 是否允许清除 */
|
|
38
|
-
allowClear?: boolean;
|
|
39
|
-
/** 是否禁用 */
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
/** 是否只读 */
|
|
42
|
-
readonly?: boolean;
|
|
43
|
-
/** 评分尺寸 */
|
|
44
|
-
size?: RateSize;
|
|
45
|
-
/** 自定义字符 */
|
|
46
|
-
character?: RateCharacter | ((_index: number) => RateCharacter);
|
|
47
|
-
/** 提示文案数组 */
|
|
48
|
-
tooltips?: string[];
|
|
49
|
-
/** 是否显示提示文案 */
|
|
50
|
-
showTooltips?: boolean;
|
|
51
|
-
/** 自定义颜色 */
|
|
52
|
-
color?: string;
|
|
53
|
-
/** 自定义未选中颜色 */
|
|
54
|
-
unselectedColor?: string;
|
|
55
|
-
/** 是否自动聚焦 */
|
|
56
|
-
autoFocus?: boolean;
|
|
57
|
-
/** 键盘导航 */
|
|
58
|
-
keyboard?: boolean;
|
|
59
|
-
/** 评分改变时的回调 */
|
|
60
|
-
onChange?: (_value: number) => void;
|
|
61
|
-
/** hover时的回调 */
|
|
62
|
-
onHoverChange?: (_value: number) => void;
|
|
63
|
-
/** 聚焦时的回调 */
|
|
64
|
-
onFocus?: () => void;
|
|
65
|
-
/** 失焦时的回调 */
|
|
66
|
-
onBlur?: () => void;
|
|
67
|
-
/** 键盘事件回调 */
|
|
68
|
-
onKeyDown?: (_event: any) => void;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** 评分工具函数接口 */
|
|
72
|
-
export interface RateUtils {
|
|
73
|
-
/** 计算评分值 */
|
|
74
|
-
calculateValue: (_index: number, position: number, allowHalf: boolean) => number;
|
|
75
|
-
/** 获取星星状态 */
|
|
76
|
-
getStarState: (_index: number, value: number, hoverValue: number, allowHalf: boolean) => 'full' | 'half' | 'empty';
|
|
77
|
-
/** 格式化评分显示 */
|
|
78
|
-
formatValue: (_value: number, precision?: number) => string;
|
|
79
|
-
/** 验证评分值 */
|
|
80
|
-
validateValue: (_value: number, count: number) => boolean;
|
|
81
|
-
/** 获取可访问性属性 */
|
|
82
|
-
getAccessibilityProps: (_value: number, count: number, disabled: boolean) => Record<string, any>;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/** 星星状态 */
|
|
86
|
-
export type StarState = 'full' | 'half' | 'empty';
|
|
87
|
-
|
|
88
|
-
/** 星星属性 */
|
|
89
|
-
export interface StarProps {
|
|
90
|
-
/** 星星索引 */
|
|
91
|
-
index: number;
|
|
92
|
-
/** 星星状态 */
|
|
93
|
-
state: StarState;
|
|
94
|
-
/** 是否禁用 */
|
|
95
|
-
disabled?: boolean;
|
|
96
|
-
/** 是否只读 */
|
|
97
|
-
readonly?: boolean;
|
|
98
|
-
/** 尺寸 */
|
|
99
|
-
size: RateSize;
|
|
100
|
-
/** 自定义字符 */
|
|
101
|
-
character?: RateCharacter;
|
|
102
|
-
/** 颜色 */
|
|
103
|
-
color?: string;
|
|
104
|
-
/** 未选中颜色 */
|
|
105
|
-
unselectedColor?: string;
|
|
106
|
-
/** 点击回调 */
|
|
107
|
-
onClick?: (_index: number, position: number) => void;
|
|
108
|
-
/** hover回调 - not supported in Taro.js */
|
|
109
|
-
onHover?: (_index: number, position: number) => void;
|
|
110
|
-
/** 离开回调 - not supported in Taro.js */
|
|
111
|
-
onLeave?: () => void;
|
|
112
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rate 评分组件
|
|
3
|
-
*
|
|
4
|
-
* 企业级评分组件,支持:
|
|
5
|
-
* - 完整和半星评分
|
|
6
|
-
* - 自定义字符和颜色
|
|
7
|
-
* - 键盘导航支持
|
|
8
|
-
* - 工具提示显示
|
|
9
|
-
* - 无障碍访问优化
|
|
10
|
-
* - 只读和禁用状态
|
|
11
|
-
* - 多种尺寸配置
|
|
12
|
-
* - 响应式设计
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export { Rate, RateComponent } from './Rate';
|
|
16
|
-
export type { RateProps, RateRef, RateSize, RateCharacter, RateUtils, StarState, StarProps } from './Rate.types';
|
|
17
|
-
export { rateStyles } from './Rate.styles';
|
|
18
|
-
|
|
19
|
-
// 默认导出
|
|
20
|
-
export { Rate as default } from './Rate';
|