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,169 +0,0 @@
|
|
|
1
|
-
export const stepsStyles = {
|
|
2
|
-
steps: {
|
|
3
|
-
display: 'flex',
|
|
4
|
-
},
|
|
5
|
-
stepsHorizontal: {
|
|
6
|
-
flexDirection: 'row',
|
|
7
|
-
alignItems: 'flex-start',
|
|
8
|
-
},
|
|
9
|
-
stepsVertical: {
|
|
10
|
-
flexDirection: 'column',
|
|
11
|
-
},
|
|
12
|
-
step: {
|
|
13
|
-
flex: 1,
|
|
14
|
-
position: 'relative',
|
|
15
|
-
},
|
|
16
|
-
stepHorizontal: {
|
|
17
|
-
minWidth: 100,
|
|
18
|
-
},
|
|
19
|
-
stepVertical: {
|
|
20
|
-
marginBottom: 16,
|
|
21
|
-
},
|
|
22
|
-
stepLast: {
|
|
23
|
-
flex: 'none',
|
|
24
|
-
},
|
|
25
|
-
stepItem: {
|
|
26
|
-
display: 'flex',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
},
|
|
29
|
-
stepIcon: {
|
|
30
|
-
width: 32,
|
|
31
|
-
height: 32,
|
|
32
|
-
borderRadius: '50%',
|
|
33
|
-
backgroundColor: '#fff',
|
|
34
|
-
border: '1px solid #d9d9d9',
|
|
35
|
-
display: 'flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
justifyContent: 'center',
|
|
38
|
-
fontSize: 16,
|
|
39
|
-
color: '#666',
|
|
40
|
-
marginRight: 8,
|
|
41
|
-
},
|
|
42
|
-
stepIconProcess: {
|
|
43
|
-
backgroundColor: '#1890ff',
|
|
44
|
-
borderColor: '#1890ff',
|
|
45
|
-
color: '#fff',
|
|
46
|
-
},
|
|
47
|
-
stepIconFinish: {
|
|
48
|
-
backgroundColor: '#fff',
|
|
49
|
-
borderColor: '#1890ff',
|
|
50
|
-
color: '#1890ff',
|
|
51
|
-
},
|
|
52
|
-
stepIconError: {
|
|
53
|
-
backgroundColor: '#fff',
|
|
54
|
-
borderColor: '#ff4d4f',
|
|
55
|
-
color: '#ff4d4f',
|
|
56
|
-
},
|
|
57
|
-
stepIconSmall: {
|
|
58
|
-
width: 24,
|
|
59
|
-
height: 24,
|
|
60
|
-
fontSize: 12,
|
|
61
|
-
},
|
|
62
|
-
stepContent: {
|
|
63
|
-
flex: 1,
|
|
64
|
-
},
|
|
65
|
-
stepTitle: {
|
|
66
|
-
fontSize: 16,
|
|
67
|
-
color: '#000',
|
|
68
|
-
marginBottom: 4,
|
|
69
|
-
},
|
|
70
|
-
stepTitleProcess: {
|
|
71
|
-
color: '#1890ff',
|
|
72
|
-
},
|
|
73
|
-
stepTitleFinish: {
|
|
74
|
-
color: '#000',
|
|
75
|
-
},
|
|
76
|
-
stepTitleError: {
|
|
77
|
-
color: '#ff4d4f',
|
|
78
|
-
},
|
|
79
|
-
stepDescription: {
|
|
80
|
-
fontSize: 14,
|
|
81
|
-
color: '#666',
|
|
82
|
-
},
|
|
83
|
-
stepTail: {
|
|
84
|
-
position: 'absolute',
|
|
85
|
-
top: 16,
|
|
86
|
-
left: '50%',
|
|
87
|
-
width: '100%',
|
|
88
|
-
height: 1,
|
|
89
|
-
backgroundColor: '#f0f0f0',
|
|
90
|
-
},
|
|
91
|
-
stepTailFinish: {
|
|
92
|
-
backgroundColor: '#1890ff',
|
|
93
|
-
},
|
|
94
|
-
stepVerticalTail: {
|
|
95
|
-
top: 32,
|
|
96
|
-
left: 16,
|
|
97
|
-
width: 1,
|
|
98
|
-
height: '100%',
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const getStepsStyle = (direction?: 'horizontal' | 'vertical', customStyle?: React.CSSProperties) => ({
|
|
103
|
-
...stepsStyles.steps,
|
|
104
|
-
...(direction === 'horizontal' && stepsStyles.stepsHorizontal),
|
|
105
|
-
...(direction === 'vertical' && stepsStyles.stepsVertical),
|
|
106
|
-
...customStyle,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
export const getStepStyle = (
|
|
110
|
-
direction?: 'horizontal' | 'vertical',
|
|
111
|
-
isLast?: boolean,
|
|
112
|
-
customStyle?: React.CSSProperties,
|
|
113
|
-
) => ({
|
|
114
|
-
...stepsStyles.step,
|
|
115
|
-
...(direction === 'horizontal' && stepsStyles.stepHorizontal),
|
|
116
|
-
...(direction === 'vertical' && stepsStyles.stepVertical),
|
|
117
|
-
...(isLast && stepsStyles.stepLast),
|
|
118
|
-
...customStyle,
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export const getStepItemStyle = (customStyle?: React.CSSProperties) => ({
|
|
122
|
-
...stepsStyles.stepItem,
|
|
123
|
-
...customStyle,
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
export const getStepIconStyle = (
|
|
127
|
-
status?: 'wait' | 'process' | 'finish' | 'error',
|
|
128
|
-
size?: 'default' | 'small',
|
|
129
|
-
customStyle?: React.CSSProperties,
|
|
130
|
-
) => ({
|
|
131
|
-
...stepsStyles.stepIcon,
|
|
132
|
-
...(status === 'process' && stepsStyles.stepIconProcess),
|
|
133
|
-
...(status === 'finish' && stepsStyles.stepIconFinish),
|
|
134
|
-
...(status === 'error' && stepsStyles.stepIconError),
|
|
135
|
-
...(size === 'small' && stepsStyles.stepIconSmall),
|
|
136
|
-
...customStyle,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
export const getStepContentStyle = (customStyle?: React.CSSProperties) => ({
|
|
140
|
-
...stepsStyles.stepContent,
|
|
141
|
-
...customStyle,
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
export const getStepTitleStyle = (
|
|
145
|
-
status?: 'wait' | 'process' | 'finish' | 'error',
|
|
146
|
-
customStyle?: React.CSSProperties,
|
|
147
|
-
) => ({
|
|
148
|
-
...stepsStyles.stepTitle,
|
|
149
|
-
...(status === 'process' && stepsStyles.stepTitleProcess),
|
|
150
|
-
...(status === 'finish' && stepsStyles.stepTitleFinish),
|
|
151
|
-
...(status === 'error' && stepsStyles.stepTitleError),
|
|
152
|
-
...customStyle,
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
export const getStepDescriptionStyle = (customStyle?: React.CSSProperties) => ({
|
|
156
|
-
...stepsStyles.stepDescription,
|
|
157
|
-
...customStyle,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
export const getStepTailStyle = (
|
|
161
|
-
direction?: 'horizontal' | 'vertical',
|
|
162
|
-
isFinish?: boolean,
|
|
163
|
-
customStyle?: React.CSSProperties,
|
|
164
|
-
) => ({
|
|
165
|
-
...stepsStyles.stepTail,
|
|
166
|
-
...(isFinish && stepsStyles.stepTailFinish),
|
|
167
|
-
...(direction === 'vertical' && stepsStyles.stepVerticalTail),
|
|
168
|
-
...customStyle,
|
|
169
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Steps } from './Steps'
|
|
4
|
-
import { describe, it, expect } from 'vitest'
|
|
5
|
-
import '@testing-library/jest-dom'
|
|
6
|
-
|
|
7
|
-
describe('Steps', () => {
|
|
8
|
-
it('renders step items', () => {
|
|
9
|
-
render(<Steps current={1} items={[{ title: '步骤一' }, { title: '步骤二' }, { title: '步骤三' }]} />)
|
|
10
|
-
expect(screen.getByText('步骤一')).toBeInTheDocument()
|
|
11
|
-
expect(screen.getByText('步骤二')).toBeInTheDocument()
|
|
12
|
-
expect(screen.getByText('步骤三')).toBeInTheDocument()
|
|
13
|
-
})
|
|
14
|
-
})
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
2
|
-
import { View, Text } from '@tarojs/components';
|
|
3
|
-
import { StepsProps, StepsRef, Step } from './Steps.types';
|
|
4
|
-
import {
|
|
5
|
-
getStepsStyle,
|
|
6
|
-
getStepStyle,
|
|
7
|
-
getStepItemStyle,
|
|
8
|
-
getStepIconStyle,
|
|
9
|
-
getStepContentStyle,
|
|
10
|
-
getStepTitleStyle,
|
|
11
|
-
getStepDescriptionStyle,
|
|
12
|
-
getStepTailStyle,
|
|
13
|
-
} from './Steps.styles';
|
|
14
|
-
// import { Step } from './Step'
|
|
15
|
-
|
|
16
|
-
export const Steps = forwardRef<StepsRef, StepsProps>(
|
|
17
|
-
(
|
|
18
|
-
{
|
|
19
|
-
className,
|
|
20
|
-
style,
|
|
21
|
-
current = 0,
|
|
22
|
-
direction = 'horizontal',
|
|
23
|
-
labelPlacement: _labelPlacement = 'horizontal',
|
|
24
|
-
progressDot = false,
|
|
25
|
-
initial: _initial = 0,
|
|
26
|
-
status,
|
|
27
|
-
size = 'default',
|
|
28
|
-
items,
|
|
29
|
-
children: _children,
|
|
30
|
-
onChange,
|
|
31
|
-
...props
|
|
32
|
-
},
|
|
33
|
-
ref,
|
|
34
|
-
) => {
|
|
35
|
-
const stepsRef = React.useRef<HTMLDivElement>(null);
|
|
36
|
-
|
|
37
|
-
useImperativeHandle(ref, () => ({
|
|
38
|
-
getSteps: () => stepsRef.current,
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
const getStepStatus = (index: number): 'wait' | 'process' | 'finish' | 'error' => {
|
|
42
|
-
if (status) {
|
|
43
|
-
if (index === current && status !== 'finish') {
|
|
44
|
-
return status;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (index < current) {
|
|
49
|
-
return 'finish';
|
|
50
|
-
}
|
|
51
|
-
if (index === current) {
|
|
52
|
-
return 'process';
|
|
53
|
-
}
|
|
54
|
-
return 'wait';
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const handleStepClick = (index: number) => {
|
|
58
|
-
if (onChange) {
|
|
59
|
-
onChange(index);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const steps: Step[] = items || [];
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<View
|
|
67
|
-
ref={stepsRef}
|
|
68
|
-
className={className}
|
|
69
|
-
style={getStepsStyle(direction, style) as React.CSSProperties}
|
|
70
|
-
{...props}
|
|
71
|
-
>
|
|
72
|
-
{steps.map((step, index) => {
|
|
73
|
-
const stepStatus = step.status || getStepStatus(index);
|
|
74
|
-
const isLast = index === steps.length - 1;
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<View
|
|
78
|
-
key={index}
|
|
79
|
-
style={getStepStyle(direction, isLast) as React.CSSProperties}
|
|
80
|
-
onClick={() => !step.disabled && handleStepClick(index)}
|
|
81
|
-
>
|
|
82
|
-
<View style={getStepItemStyle() as React.CSSProperties}>
|
|
83
|
-
{progressDot ? (
|
|
84
|
-
typeof progressDot === 'function' ? (
|
|
85
|
-
progressDot(index, stepStatus, step.title, step.description)
|
|
86
|
-
) : (
|
|
87
|
-
<View style={getStepIconStyle(stepStatus, size) as React.CSSProperties}>•</View>
|
|
88
|
-
)
|
|
89
|
-
) : (
|
|
90
|
-
<View style={getStepIconStyle(stepStatus, size) as React.CSSProperties}>
|
|
91
|
-
{step.icon || index + 1}
|
|
92
|
-
</View>
|
|
93
|
-
)}
|
|
94
|
-
<View style={getStepContentStyle() as React.CSSProperties}>
|
|
95
|
-
<Text style={getStepTitleStyle(stepStatus) as React.CSSProperties}>{step.title}</Text>
|
|
96
|
-
{step.description && (
|
|
97
|
-
<Text style={getStepDescriptionStyle() as React.CSSProperties}>{step.description}</Text>
|
|
98
|
-
)}
|
|
99
|
-
</View>
|
|
100
|
-
</View>
|
|
101
|
-
{!isLast && <View style={getStepTailStyle(direction, stepStatus === 'finish') as React.CSSProperties} />}
|
|
102
|
-
</View>
|
|
103
|
-
);
|
|
104
|
-
})}
|
|
105
|
-
</View>
|
|
106
|
-
);
|
|
107
|
-
},
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
Steps.displayName = 'Steps';
|
|
111
|
-
|
|
112
|
-
export default Steps;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ViewProps } from '@tarojs/components';
|
|
3
|
-
|
|
4
|
-
export type StepStatus = 'wait' | 'process' | 'finish' | 'error';
|
|
5
|
-
export type StepDirection = 'horizontal' | 'vertical';
|
|
6
|
-
|
|
7
|
-
export interface Step {
|
|
8
|
-
title: ReactNode;
|
|
9
|
-
description?: ReactNode;
|
|
10
|
-
status?: 'wait' | 'process' | 'finish' | 'error';
|
|
11
|
-
icon?: ReactNode;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface StepsProps extends ViewProps {
|
|
16
|
-
className?: string;
|
|
17
|
-
style?: React.CSSProperties;
|
|
18
|
-
current?: number;
|
|
19
|
-
direction?: 'horizontal' | 'vertical';
|
|
20
|
-
labelPlacement?: 'horizontal' | 'vertical';
|
|
21
|
-
progressDot?: boolean | ((_index: number, status: string, title: ReactNode, description: ReactNode) => ReactNode);
|
|
22
|
-
initial?: number;
|
|
23
|
-
status?: 'wait' | 'process' | 'finish' | 'error';
|
|
24
|
-
size?: 'default' | 'small';
|
|
25
|
-
items?: Step[];
|
|
26
|
-
children?: ReactNode;
|
|
27
|
-
onChange?: (_current: number) => void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface StepsRef {
|
|
31
|
-
getSteps: () => HTMLDivElement | null;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface StepProps extends ViewProps {
|
|
35
|
-
className?: string;
|
|
36
|
-
style?: React.CSSProperties;
|
|
37
|
-
title: ReactNode;
|
|
38
|
-
description?: ReactNode;
|
|
39
|
-
status?: 'wait' | 'process' | 'finish' | 'error';
|
|
40
|
-
icon?: ReactNode;
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
stepNumber?: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface StepRef {
|
|
46
|
-
getStep: () => HTMLDivElement | null;
|
|
47
|
-
}
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
// import { Platform } from '@tarojs/taro';
|
|
2
|
-
import type { TabsProps, TabPosition, TabType, TabSize } from './Tabs.types';
|
|
3
|
-
|
|
4
|
-
/** Tabs组件样式管理器 */
|
|
5
|
-
export const tabsStyles = {
|
|
6
|
-
/** 尺寸映射表 */
|
|
7
|
-
SIZE_MAP: {
|
|
8
|
-
small: 32,
|
|
9
|
-
medium: 40,
|
|
10
|
-
large: 48,
|
|
11
|
-
default: 40,
|
|
12
|
-
} as const,
|
|
13
|
-
|
|
14
|
-
/** 位置映射表 */
|
|
15
|
-
POSITION_MAP: {
|
|
16
|
-
top: 'column',
|
|
17
|
-
right: 'row-reverse',
|
|
18
|
-
bottom: 'column-reverse',
|
|
19
|
-
left: 'row',
|
|
20
|
-
} as const,
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 获取基础样式
|
|
24
|
-
*/
|
|
25
|
-
getBaseStyle: (props: TabsProps): React.CSSProperties => {
|
|
26
|
-
const { position = 'top', centered = false, style = {} } = props;
|
|
27
|
-
|
|
28
|
-
// 计算方向
|
|
29
|
-
const flexDirection = tabsStyles['POSITION_MAP'][position];
|
|
30
|
-
|
|
31
|
-
// 计算对齐方式
|
|
32
|
-
const alignItems = centered ? 'center' : 'flex-start';
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
flexDirection,
|
|
37
|
-
alignItems,
|
|
38
|
-
width: '100%',
|
|
39
|
-
height: '100%',
|
|
40
|
-
boxSizing: 'border-box',
|
|
41
|
-
...style,
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 获取类名
|
|
47
|
-
*/
|
|
48
|
-
getClassName: (props: TabsProps): string => {
|
|
49
|
-
const { position = 'top', type = 'line', size = 'default', centered = false, className = '' } = props;
|
|
50
|
-
|
|
51
|
-
const baseClass = 'taro-uno-tabs';
|
|
52
|
-
const positionClass = `${baseClass}--${position}`;
|
|
53
|
-
const typeClass = `${baseClass}--${type}`;
|
|
54
|
-
const sizeClass = `${baseClass}--${size}`;
|
|
55
|
-
const centeredClass = centered ? `${baseClass}--centered` : '';
|
|
56
|
-
|
|
57
|
-
return [baseClass, positionClass, typeClass, sizeClass, centeredClass, className].filter(Boolean).join(' ');
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 获取Tab栏样式
|
|
62
|
-
*/
|
|
63
|
-
getTabBarStyle: (position: TabPosition, type: TabType): React.CSSProperties => {
|
|
64
|
-
const isVertical = position === 'left' || position === 'right';
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
display: 'flex',
|
|
68
|
-
flexDirection: isVertical ? 'column' : 'row',
|
|
69
|
-
flexShrink: 0,
|
|
70
|
-
borderBottom: type === 'line' && !isVertical ? '1px solid var(--border-color)' : 'none',
|
|
71
|
-
borderRight: type === 'line' && isVertical ? '1px solid var(--border-color)' : 'none',
|
|
72
|
-
borderTop: type === 'line' && position === 'bottom' ? '1px solid var(--border-color)' : 'none',
|
|
73
|
-
borderLeft: type === 'line' && position === 'right' ? '1px solid var(--border-color)' : 'none',
|
|
74
|
-
backgroundColor: 'var(--background-card)',
|
|
75
|
-
overflow: isVertical ? 'auto' : 'hidden',
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* 获取Tab项样式
|
|
81
|
-
*/
|
|
82
|
-
getTabItemStyle: (props: {
|
|
83
|
-
active: boolean;
|
|
84
|
-
disabled: boolean;
|
|
85
|
-
type: TabType;
|
|
86
|
-
size: TabSize;
|
|
87
|
-
position: TabPosition;
|
|
88
|
-
}): React.CSSProperties => {
|
|
89
|
-
const { active, disabled, type, size, position } = props;
|
|
90
|
-
const isVertical = position === 'left' || position === 'right';
|
|
91
|
-
|
|
92
|
-
const height = tabsStyles.SIZE_MAP[size as keyof typeof tabsStyles.SIZE_MAP];
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
display: 'flex',
|
|
96
|
-
alignItems: 'center',
|
|
97
|
-
justifyContent: 'center',
|
|
98
|
-
padding: '0 16px',
|
|
99
|
-
height: isVertical ? 'auto' : `${height}px`,
|
|
100
|
-
minWidth: isVertical ? '100px' : 'auto',
|
|
101
|
-
minHeight: isVertical ? `${height}px` : 'auto',
|
|
102
|
-
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
103
|
-
color: active ? 'var(--primary-color)' : disabled ? 'var(--text-color-disabled)' : 'var(--text-color)',
|
|
104
|
-
backgroundColor: active && type === 'card' ? 'var(--background-color)' : 'transparent',
|
|
105
|
-
border: type === 'card' ? '1px solid var(--border-color)' : 'none',
|
|
106
|
-
borderBottom: type === 'line' && active && !isVertical ? '2px solid var(--primary-color)' : 'none',
|
|
107
|
-
borderRight: type === 'line' && active && isVertical ? '2px solid var(--primary-color)' : 'none',
|
|
108
|
-
transition: 'all 0.3s ease',
|
|
109
|
-
opacity: disabled ? 0.5 : 1,
|
|
110
|
-
position: 'relative',
|
|
111
|
-
boxSizing: 'border-box',
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* 获取内容区域样式
|
|
117
|
-
*/
|
|
118
|
-
getContentStyle: (_position: TabPosition, animated: boolean): React.CSSProperties => {
|
|
119
|
-
// const isVertical = position === 'left' || position === 'right'; // Commented out - unused
|
|
120
|
-
|
|
121
|
-
return {
|
|
122
|
-
flex: 1,
|
|
123
|
-
overflow: 'hidden',
|
|
124
|
-
position: 'relative',
|
|
125
|
-
transition: animated ? 'all 0.3s ease' : 'none',
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* 获取Tab内容样式
|
|
131
|
-
*/
|
|
132
|
-
getTabContentStyle: (active: boolean, animated: boolean): React.CSSProperties => {
|
|
133
|
-
return {
|
|
134
|
-
position: 'absolute',
|
|
135
|
-
top: 0,
|
|
136
|
-
left: 0,
|
|
137
|
-
right: 0,
|
|
138
|
-
bottom: 0,
|
|
139
|
-
opacity: active ? 1 : 0,
|
|
140
|
-
visibility: active ? 'visible' : 'hidden',
|
|
141
|
-
transition: animated ? 'opacity 0.3s ease' : 'none',
|
|
142
|
-
overflow: 'auto',
|
|
143
|
-
};
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* 获取添加按钮样式
|
|
148
|
-
*/
|
|
149
|
-
getAddButtonStyle: (size: TabSize): React.CSSProperties => {
|
|
150
|
-
const height = tabsStyles.SIZE_MAP[size as keyof typeof tabsStyles.SIZE_MAP];
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
display: 'flex',
|
|
154
|
-
alignItems: 'center',
|
|
155
|
-
justifyContent: 'center',
|
|
156
|
-
width: `${height}px`,
|
|
157
|
-
height: `${height}px`,
|
|
158
|
-
border: '1px dashed var(--border-color)',
|
|
159
|
-
borderRadius: '4px',
|
|
160
|
-
cursor: 'pointer',
|
|
161
|
-
color: 'var(--text-color-secondary)',
|
|
162
|
-
transition: 'all 0.3s ease',
|
|
163
|
-
backgroundColor: 'transparent',
|
|
164
|
-
};
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 获取删除按钮样式
|
|
169
|
-
*/
|
|
170
|
-
getRemoveButtonStyle: (): React.CSSProperties => {
|
|
171
|
-
return {
|
|
172
|
-
display: 'flex',
|
|
173
|
-
alignItems: 'center',
|
|
174
|
-
justifyContent: 'center',
|
|
175
|
-
width: '16px',
|
|
176
|
-
height: '16px',
|
|
177
|
-
marginLeft: '8px',
|
|
178
|
-
borderRadius: '50%',
|
|
179
|
-
backgroundColor: 'var(--error-color)',
|
|
180
|
-
color: 'white',
|
|
181
|
-
fontSize: '12px',
|
|
182
|
-
cursor: 'pointer',
|
|
183
|
-
transition: 'all 0.3s ease',
|
|
184
|
-
};
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* 获取徽标样式
|
|
189
|
-
*/
|
|
190
|
-
getBadgeStyle: (): React.CSSProperties => {
|
|
191
|
-
return {
|
|
192
|
-
position: 'absolute',
|
|
193
|
-
top: '4px',
|
|
194
|
-
right: '4px',
|
|
195
|
-
transform: 'translate(50%, -50%)',
|
|
196
|
-
zIndex: 1,
|
|
197
|
-
};
|
|
198
|
-
},
|
|
199
|
-
};
|