Skip to content

Commit

Permalink
Merge branch 'next' into feat/picker
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangminggeek authored Dec 5, 2024
2 parents b8f79ae + 402e32f commit 31ccb51
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 88 deletions.
1 change: 1 addition & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"extends": [
"config:base", "schedule:weekly", "group:allNonMajor"
],
"baseBranches": ["feat_v3.x"],
"rangeStrategy": "bump",
"labels": ["dependencies"],
"ignorePaths": [
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-optimize-css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/postcss-css-variables": "^0.18.3",
"ts-node": "^10.9.2",
"unbuild": "^2.0.0",
"vitest": "^1.5.0"
"vitest": "^2.1.7"
},
"dependencies": {
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-replace-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@babel/preset-react": "^7.25.7",
"@types/babel__core": "^7.20.5",
"@types/babel__generator": "^7.6.8",
"vitest": "^1.5.0"
"vitest": "^2.1.7"
},
"devDependencies": {
"@types/lodash.kebabcase": "^4.1.9",
Expand Down
326 changes: 244 additions & 82 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/packages/uploader/uploader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: $uploader-image-width;
height: $uploader-image-height;
position: initial;
border-radius: $uploader-image-border-radius;
}
Expand Down
4 changes: 3 additions & 1 deletion src/packages/uploader/uploader.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ const InternalUploader: ForwardRefRenderFunction<
}

const readFile = <T extends TFileType>(files: T[]) => {
const results: FileItem[] = []
files.forEach((file: T, index: number) => {
let fileType = file.type
const filepath = (file.tempFilePath || file.path) as string
Expand Down Expand Up @@ -428,8 +429,9 @@ const InternalUploader: ForwardRefRenderFunction<
fileItem.url = fileType === 'video' ? file.thumbTempFilePath : filepath
}
executeUpload(fileItem, index)
setFileList([...fileList, fileItem])
results.push(fileItem)
})
setFileList([...fileList, ...results])
}

const filterFiles = <T extends TFileType>(files: T[]) => {
Expand Down
7 changes: 5 additions & 2 deletions src/packages/uploader/uploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ const InternalUploader: ForwardRefRenderFunction<
}

const readFile = (files: File[]) => {
const results: FileItem[] = []
files.forEach((file: File, index: number) => {
const formData = new FormData()
formData.append(name, file)
Expand All @@ -306,13 +307,15 @@ const InternalUploader: ForwardRefRenderFunction<
const reader = new FileReader()
reader.onload = (event: ProgressEvent<FileReader>) => {
fileItem.url = (event.target as FileReader).result as string
setFileList([...fileList, fileItem])
// setFileList([...fileList, fileItem])
results.push(fileItem)
}
reader.readAsDataURL(file)
} else {
setFileList([...fileList, fileItem])
results.push(fileItem)
}
})
setFileList([...fileList, ...results])
}

const filterFiles = (files: File[]) => {
Expand Down

0 comments on commit 31ccb51

Please sign in to comment.