Skip to content

Commit

Permalink
fix: build, lint, test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang committed Oct 30, 2024
1 parent aba2e6b commit ea956e3
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 174 deletions.
1 change: 0 additions & 1 deletion src/packages/avatar/avatar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const Avatar: FunctionComponent<
background,
color,
src,
alt,
icon,
fit,
avatarIndex,
Expand Down
8 changes: 4 additions & 4 deletions src/packages/avatarcropper/avatarcropper.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
} from 'react'
import Taro, { useReady, createSelectorQuery } from '@tarojs/taro'
import classNames from 'classnames'
import { Canvas, View } from '@tarojs/components'
import { Canvas, CommonEventFunction, View } from '@tarojs/components'
import { Button } from '@/packages/button/button.taro'
import { useConfig } from '@/packages/configprovider/configprovider.taro'

Expand Down Expand Up @@ -449,7 +449,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
})
const { startMoveX, startMoveY, startScale, startDistance } = startMove

const onTouchStart = (event: React.TouchEvent<HTMLDivElement>) => {
const onTouchStart: CommonEventFunction = (event: any) => {
const { touches } = event
const { offsetX } = touch

Expand All @@ -472,7 +472,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
}
}

const onTouchMove = (event: React.TouchEvent<HTMLDivElement>) => {
const onTouchMove: CommonEventFunction = (event: any) => {
const { touches } = event

touch.move(event)
Expand Down Expand Up @@ -500,7 +500,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
}
}

const onTouchEnd = (event: React.TouchEvent<HTMLDivElement>) => {
const onTouchEnd: CommonEventFunction = (event: any) => {
let stopPropagation = false

if (moving || zooming) {
Expand Down
90 changes: 48 additions & 42 deletions src/packages/configprovider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type NutCSSVariables =
| 'nutuiColorPrimaryStop2'
| 'nutuiColorPrimaryPressed'
| 'nutuiColorPrimaryDisabled'
| 'nutuiColorPrimaryLight'
| 'nutuiColorPrimaryDisabledSpecial'
| 'nutuiColorPrimaryLightPressed'
| 'nutuiColorDefault'
| 'nutuiColorDefaultPressed'
Expand All @@ -30,51 +30,51 @@ export type NutCSSVariables =
| 'nutuiColorDangerDisabled'
| 'nutuiColorDangerLight'
| 'nutuiColorDangerBackground'
| 'nutuiGray12'
| 'nutuiGray0'
| 'nutuiGray1'
| 'nutuiWhite12'
| 'nutuiBlack8'
| 'nutuiBlack3'
| 'nutuiGray4'
| 'nutuiGray7'
| 'nutuiGray6'
| 'nutuiGray5'
| 'nutuiColorBackground'
| 'nutuiColorBackgroundOverlay'
| 'nutuiColorBackgroundSunken'
| 'nutuiColorMask'
| 'nutuiColorMaskPart'
| 'nutuiColorMaskFaultToleran'
| 'nutuiColorBorder'
| 'nutuiColorBorderDisabled'
| 'nutuiColorTitle'
| 'nutuiColorText'
| 'nutuiColorTextHelp'
| 'nutuiColorTextDisabled'
| 'nutuiWhite12'
| 'nutuiColorPrimaryText'
| 'nutuiFontSizeXxs'
| 'nutuiFontSizeXs'
| 'nutuiFontSizeS'
| 'nutuiFontSizeBase'
| 'nutuiFontSizeL'
| 'nutuiFontSizeXl'
| 'nutuiFontSizeXxl'
| 'nutuiFontSize10'
| 'nutuiFontSize11'
| 'nutuiFontWeightLight'
| 'nutuiFontWeight'
| 'nutuiFontWeightBold'
| 'nutuiLineHeightBase'
| 'nutuiSpacing2'
| 'nutuiSpacing4'
| 'nutuiSpacing6'
| 'nutuiSpacing8'
| 'nutuiSpacing10'
| 'nutuiSpacing12'
| 'nutuiSpacing14'
| 'nutuiSpacing16'
| 'nutuiRadius3'
| 'nutuiRadius4'
| 'nutuiRadius6'
| 'nutuiRadius8'
| 'nutuiRadius12'
| 'nutuiRadius16'
| 'nutuiRadius20'
| 'nutuiRadius24'
| 'nutuiGray3'
| 'nutuiGray2'
| 'nutuiBlack10'
| 'nutuiBlack2'
| 'nutuiFontSize1'
| 'nutuiFontSize2'
| 'nutuiFontSize3'
| 'nutuiFontSize4'
| 'nutuiFontSize6'
| 'nutuiFontSize8'
| 'nutuiFontSize10'
| 'nutuiFontSize11'
| 'nutuiColorPrimaryText'
| 'nutuiColorTextLink'
| 'nutuiPaddingXs'
| 'nutuiSpacingXxxs'
| 'nutuiSpacingXxs'
| 'nutuiSpacingXs'
| 'nutuiSpacingS'
| 'nutuiSpacingBase'
| 'nutuiSpacingL'
| 'nutuiSpacingXl'
| 'nutuiSpacingXxl'
| 'nutuiSpacingXxxl'
| 'nutuiRadiusXxxs'
| 'nutuiRadiusXxs'
| 'nutuiRadiusXs'
| 'nutuiRadiusS'
| 'nutuiRadiusBase'
| 'nutuiRadiusL'
| 'nutuiRadiusXl'
| 'nutuiRadiusXxl'
| 'nutuiRadiusXxxl'
| 'nutuiButtonSquareBorderRadius'
| 'nutuiButtonBorderRadius'
| 'nutuiButtonBorderWidth'
Expand Down Expand Up @@ -332,13 +332,19 @@ export type NutCSSVariables =
| 'nutuiCalendarDayFontWeight'
| 'nutuiCalendarDayActiveBorderRadius'
| 'nutuiHoverbuttonSpacing'
| 'nutuiSpacing16'
| 'nutuiHoverbuttonPositionBottom'
| 'nutuiHoverbuttonPositionRight'
| 'nutuiHoverbuttonItemBorderColor'
| 'nutuiBlack3'
| 'nutuiHoverbuttonItemBackground'
| 'nutuiGray1'
| 'nutuiHoverbuttonItemBackgroundActive'
| 'nutuiGray3'
| 'nutuiHoverbuttonItemIconColor'
| 'nutuiGray7'
| 'nutuiHoverbuttonItemIconColorActive'
| 'nutuiGray6'
| 'nutuiOverlayBgColor'
| 'nutuiOverlayZIndex'
| 'nutuiOverlayContentBgColor'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,116 +116,6 @@ exports[`emit click event 1`] = `
</div>
`;

exports[`prop 1`] = `
<div>
<div
class="nut-cell"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
URL 跳转
</div>
</div>
<div
class="nut-cell-extra"
>
https://m.jd.com/
</div>
</div>
</div>
`;

exports[`prop title extra description test 1`] = `
<div>
<div
class="nut-cell"
data-testid="prop"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
我是标题
</div>
<div
class="nut-cell-description"
>
我是描述
</div>
</div>
<div
class="nut-cell-extra"
>
描述文字
</div>
</div>
</div>
`;

exports[`slot default test 1`] = `
<div>
<div
class="nut-cell"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
<div>
自定义内容
</div>
</div>
</div>
<div
class="nut-cell-extra"
>
描述文字
</div>
</div>
</div>
`;

exports[`slot extra 1`] = `
<div>
<div
class="nut-cell"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
Switch
</div>
</div>
<div
class="nut-cell-extra"
>
<div
class="nut-switch"
>
<div
class="nut-switch-button nut-switch-button-open"
/>
</div>
</div>
</div>
</div>
`;

exports[`tabbar height 1`] = `
<div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ exports[`infiniteloading base 01 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand Down Expand Up @@ -127,7 +131,11 @@ exports[`pull base 01 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -152,7 +160,11 @@ exports[`pull base 03 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -177,7 +189,11 @@ exports[`pull base 03 2`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -202,7 +218,11 @@ exports[`pull base 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -227,7 +247,11 @@ exports[`pull base 2`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
4 changes: 2 additions & 2 deletions src/packages/popup/popup.rn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export const Popup: FunctionComponent<
animationType="none" // 使用 slide 动画
transparent // 使背景透明
visible={innerVisible}
onRequestClose={onHandleClickOverlay} // 处理 Android 设备的返回按钮
// onRequestClose={onHandleClickOverlay} // 处理 Android 设备的返回按钮
>
{overlay ? (
<TouchableOpacity
Expand All @@ -293,7 +293,7 @@ export const Popup: FunctionComponent<
// closeOnOverlayClick={closeOnOverlayClick}
// lockScroll={lockScroll}
// duration={duration}
onPress={onHandleClickOverlay}
// onPress={onHandleClickOverlay}
>
<View className={overlayClassName} style={overlayStyles} />
</TouchableOpacity>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/range/range.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const Range: FunctionComponent<
[vertical]
)
const [buttonIndex, setButtonIndex] = useState(0)
const [dragStatus, setDragStatus] = useState('start' || 'draging' || '')
const [dragStatus, setDragStatus] = useState('start')
const touch = useTouch()
const root = useRef<HTMLDivElement>(null)
const [marksList, setMarksList] = useState<number[]>([])
Expand Down
2 changes: 1 addition & 1 deletion src/packages/range/range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const Range: FunctionComponent<
[vertical]
)
const [buttonIndex, setButtonIndex] = useState(0)
const [dragStatus, setDragStatus] = useState('start' || 'draging' || '')
const [dragStatus, setDragStatus] = useState('start')
const touch = useTouch()
const root = useRef<HTMLDivElement>(null)
const [marksList, setMarksList] = useState<number[]>([])
Expand Down
Loading

0 comments on commit ea956e3

Please sign in to comment.