Skip to content

chore: merge branch 'next' into 'dev-harmony' #2577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# v2.6.18

`2024-09-06`

- 🏡 chore: remove deprecated (#2573)
- 🏡 chore(deps): update dependency marked to v14 (#2532)
- :sparkles: feat: demos for popup & dialog (#2574)
- :sparkles: feat: beforeupload (#2567)
- :bug: fix: remove icons defaultprops (#2571)
- :bug: fix(input): type props didnot work when equals number|digit (#2563)
- :bug: fix: dialog
- :bug: fix(sticky): should rerender when zIndex changes (#2572)
- :bug: fix(sticky): rerender sticky when threshold change (#2564)
- :bug: fix(deps): update dependency jscodeshift to v17 (#2534)

# v2.6.17

`2024-08-30`

- 🏡 chore(form): form demo (#2528)
- 📖 docs(readme): fix pnpm run dev weapp jd dir (#2514)
- :sparkles: feat(cell): add clickable prop to support click style feedback (#2527)
- :sparkles: feat(image-preview): 增加索引字段,用于预览内容排序 (#2519)
- :bug: fix(tabs.taro.tsx): 解决在不需要滚动的时候,切换tab产生tab位置错乱的问题 (#2554)
- :bug: fix(uploader): beforeUpload should trigger every time before uploading (#2553)
- :bug: fix(PullToRefresh): 修复PullToRefresh组件disabled属性在taro中无效的问题 (#2538)
- :bug: fix(uploader): ios 下无法回显的问题修复 (#2550)
- :bug: fix(uploader): sizeType prop didnot work when weapp || jd (#2526)

# v2.6.16

`2024-08-03`
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@
"*.{ts,tsx,js,md}": "eslint"
},
"dependencies": {
"@nutui/icons-react": "^1.0.4",
"@nutui/icons-react-taro": "^1.0.4",
"@babel/runtime": "^7.23.9",
"@nutui/icons-react": "^1.0.5",
"@nutui/icons-react-taro": "^1.0.5",
"@nutui/touch-emulator": "^1.0.0",
"@react-spring/web": "~9.6.1",
"@swc/helpers": "^0.5.7",
Expand Down Expand Up @@ -173,13 +174,13 @@
"highlight.js": "^11.9.0",
"husky": "^9.0.11",
"inquirer": "^10.1.4",
"jscodeshift": "^0.15.1",
"jscodeshift": "^17.0.0",
"linguist-languages": "^7.27.0",
"lint-staged": "^15.2.2",
"lzutf8": "0.6.3",
"map-stream": "0.0.7",
"markdown-it": "^14.0.0",
"marked": "^13.0.3",
"marked": "^14.1.1",
"mobx": "^6.12.0",
"mobx-react-lite": "^4.0.5",
"postcss": "^8.4.35",
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"chalk": "^5.3.0",
"is-git-clean": "^1.1.0",
"jscodeshift": "^0.15.1"
"jscodeshift": "^17.0.0"
},
"devDependencies": {
"jest": "^29.7.0",
Expand Down
142 changes: 68 additions & 74 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions scripts/generate-local-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ shell.exec(
{ silent: true },
(code, stdout, stderr) => {
shell.exec(
`git log --since="${stdout.replace('\n', '')}" --pretty=format:"%s @%an" next`,
`git log --since="${stdout.replace('\n', '')}" --pretty=format:"%s" next`,
{ silent: true },
(code, stdout, stderr) => {
const logs = stdout.split('\n')
Expand Down Expand Up @@ -43,21 +43,19 @@ shell.exec(
}
const logSymbol = {
build: '* 📦 ',
chore: '*🏡 ',
chore: '* 🏡 ',
ci: '* 🤖 ',
docs: '* 📖 ',
feat: '* :sparkles: ',
fix: '* :bug: ',
perf: '* zap: ',
refactor: '* 🪵 ',
revert: '* 🚦 ',
style: ':art: ',
style: '* :art: ',
test: '* 💡 ',
others: '* 🔔 ',
}
logs.forEach((log, index) => {
// const groups = log.match(/#(?<pr>[0-9]+)/)?.groups
// if (groups && groups.pr) {
if (log.indexOf(beforeTag) === -1) {
const a = rules.filter((rule) => {
return log.toLowerCase().startsWith(rule)
Expand Down
20 changes: 20 additions & 0 deletions src/packages/cell/cell.harmony.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@
font-size: 14px;
color: #505259;
}
.nut-cell:active {
opacity: 0.7;
}
.nut-cell-clickable {
cursor: pointer;
}
.nut-cell-clickable::before {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
background-color: #1a1a1a;
border: inherit;
border-color: #1a1a1a;
border-radius: inherit;
transform: translate(-50%, -50%);
opacity: 0;
content: " ";
}
.nut-cell-divider {
display: flex;
min-height: 1px;
Expand Down
20 changes: 20 additions & 0 deletions src/packages/cell/cell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,26 @@
font-size: $cell-extra-font-size;
color: $cell-extra-color;
}
&-clickable:active {
opacity: 0.7;
}
&-clickable {
cursor: pointer;
&::before {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
background-color: $black;
border: inherit;
border-color: $black;
border-radius: inherit;
transform: translate(-50%, -50%);
opacity: 0;
content: ' ';
}
}

&-divider {
display: flex;
Expand Down
21 changes: 14 additions & 7 deletions src/packages/cell/cell.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface CellProps extends BasicComponent {
extra: ReactNode
radius: string | number
align: 'flex-start' | 'center' | 'flex-end'
clickable: boolean
isLast: boolean
onClick: (
event: React.MouseEvent<HTMLDivElement, MouseEvent> | ITouchEvent
Expand All @@ -26,6 +27,7 @@ const defaultProps = {
extra: null,
radius: '6px',
align: 'flex-start',
clickable: false,
isLast: false,
onClick: (
event: React.MouseEvent<HTMLDivElement, MouseEvent> | ITouchEvent
Expand All @@ -49,6 +51,7 @@ export const Cell: FunctionComponent<
isLast,
className,
style,
clickable,
} = {
...defaultProps,
...props,
Expand All @@ -73,13 +76,17 @@ export const Cell: FunctionComponent<
return (
<>
<View
className={classNames([
classPrefix,
className,
{
[`${classPrefix}-group-item`]: ctx?.group,
},
])}
hoverStyle={{ opacity: clickable ? 0.7 : 1 }}
className={`${classNames(
[
classPrefix,
className,
{
[`${classPrefix}-group-item`]: ctx?.group,
},
],
clickable ? `${classPrefix}-clickable` : ''
)}`}
onClick={(event) => handleClick(event)}
style={baseStyle}
>
Expand Down
21 changes: 13 additions & 8 deletions src/packages/cell/cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface CellProps extends BasicComponent {
extra: ReactNode
radius: string | number
align: 'flex-start' | 'center' | 'flex-end'
isLast: boolean
clickable: boolean
onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void
}

Expand All @@ -22,6 +22,7 @@ const defaultProps = {
extra: null,
radius: '6px',
align: 'flex-start',
clickable: false,
isLast: false,
onClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {},
} as CellProps
Expand All @@ -34,6 +35,7 @@ export const Cell: FunctionComponent<
const ctx = useContext(CellGroupContext)
const {
children,
clickable,
onClick,
title,
description,
Expand Down Expand Up @@ -63,13 +65,16 @@ export const Cell: FunctionComponent<
return (
<>
<div
className={classNames([
classPrefix,
className,
{
[`${classPrefix}-group-item`]: ctx?.group,
},
])}
className={`${classNames(
[
classPrefix,
className,
{
[`${classPrefix}-group-item`]: ctx?.group,
},
],
clickable ? `${classPrefix}-clickable` : ''
)}`}
onClick={(event) => handleClick(event)}
style={baseStyle}
{...rest}
Expand Down
1 change: 1 addition & 0 deletions src/packages/cell/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const Demo1 = () => {
<Cell title="我是标题" extra="描述文字" />
<Cell title="我是标题" description="我是描述" extra="描述文字" />
<Cell
clickable
title="点击测试"
onClick={(
event: React.MouseEvent<HTMLDivElement, globalThis.MouseEvent>
Expand Down
8 changes: 7 additions & 1 deletion src/packages/cell/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ const Demo1 = () => {
<>
<Cell title="我是标题" extra="描述文字" />
<Cell title="我是标题" description="我是描述" extra="描述文字" />
<Cell title="点击测试" onClick={(event) => testClick(event)} />
<Cell
title="点击测试"
clickable
onClick={(
event: React.MouseEvent<HTMLDivElement, globalThis.MouseEvent>
) => testClick(event)}
/>
<Cell title="圆角设置0" radius={0} />
</>
)
Expand Down
1 change: 1 addition & 0 deletions src/packages/cell/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ The 'divider' property allows you to keep the lower edge from being displayed be
| extra | Extra | `ReactNode` | `-` |
| radius | Corner radius | `string` | `6px` |
| align | Alignment in the vertical direction | `flex-start` \| `center` \| `flex-end` | `flex-start` |
| clickable | click style feedback | `boolean` | `false` |
| onClick | Emitted when cell is clicked | `onClick: (event: React.MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => void` | `false` |

## Theming
Expand Down
1 change: 1 addition & 0 deletions src/packages/cell/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ import { Cell } from '@nutui/nutui-react'
| extra | 右侧描述 | `ReactNode` | `-` |
| radius | 圆角半径 | `string` | `6px` |
| align | 纵轴方向上的对齐方式 | `flex-start` \| `center` \| `flex-end` | `flex-start` |
| clickable | 点击的样式反馈 | `boolean` | `false` |
| onClick | 点击事件 | `onClick: (event: React.MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => void` | `false` |

## 主题定制
Expand Down
1 change: 1 addition & 0 deletions src/packages/cell/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import { Cell } from '@nutui/nutui-react-taro'
| extra | 右侧描述 | `ReactNode` | `-` |
| radius | 圆角半径 | `string` | `6px` |
| align | 纵轴方向上的对齐方式 | `flex-start` \| `center` \| `flex-end` | `flex-start` |
| clickable | 点击的样式反馈 | `boolean` | `false` |
| onClick | 点击事件 | `onClick: (event: React.MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => void` | `false` |

## 主题定制
Expand Down
1 change: 1 addition & 0 deletions src/packages/cell/doc.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ import { Cell } from '@nutui/nutui-react'
| extra | 右側描述 | `ReactNode` | `-` |
| radius | 圓角半徑 | `string` | `6px` |
| align | 縱軸方向上的對齊方式 | `flex-start` \| `center` \| `flex-end` | `flex-start` |
| clickable | 點擊的樣式反饋 | `boolean` | `false` |
| onClick | 點擊事件 | `onClick: (event: React.MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => void` | `false` |

## 主題定製
Expand Down
12 changes: 5 additions & 7 deletions src/packages/input/input.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,11 @@ export const Input = forwardRef(
trigger: InputFormatTrigger = 'onChange'
) => {
let val = value
if (getEnv() === ENV_TYPE.WEB) {
if (type === 'number') {
val = formatNumber(val, false, true)
}
if (type === 'digit') {
val = formatNumber(val, true, true)
}
if (type === 'number') {
val = formatNumber(val, false, true)
}
if (type === 'digit') {
val = formatNumber(val, true, true)
}
if (formatter && trigger === formatTrigger) {
val = formatter(val)
Expand Down
4 changes: 2 additions & 2 deletions src/packages/popup/demos/h5/demo5.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { Popup, Cell } from '@nutui/nutui-react'

const Demo4 = () => {
const Demo5 = () => {
const [showBottomRound, setShowBottomRound] = useState(false)

return (
Expand All @@ -24,4 +24,4 @@ const Demo4 = () => {
</>
)
}
export default Demo4
export default Demo5
4 changes: 2 additions & 2 deletions src/packages/popup/demos/h5/demo6.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { Popup, Cell } from '@nutui/nutui-react'

const Demo5 = () => {
const Demo6 = () => {
const [showMountNode, setShowMountNode] = useState(false)

return (
Expand All @@ -25,4 +25,4 @@ const Demo5 = () => {
</>
)
}
export default Demo5
export default Demo6
Loading