Skip to content
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

[refactor] Upload: 上传组件重写 #1298

Merged
merged 9 commits into from Dec 30, 2019
Merged

[refactor] Upload: 上传组件重写 #1298

merged 9 commits into from Dec 30, 2019

Conversation

kainstar
Copy link
Collaborator

@kainstar kainstar commented Dec 16, 2019

  • 根据新设计规范重写 Upload 上传组件

next:

  • 文档、Demo 补充
  • 设计验收

Copy link
Collaborator

@cpylua cpylua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

老代码记得拷一份到 https://github.com/zent-contrib/zent-compat

packages/zent/src/upload/components/icons/Audio.tsx Outdated Show resolved Hide resolved
packages/zent/src/upload/components/icons/File.tsx Outdated Show resolved Hide resolved
Comment on lines 1 to 3
export default function isInteger(value: string | number): boolean {
return /^[\-+]?\d*$/.test(value.toString());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

去掉,跟产品确认保留几位小数

packages/zent/src/i18n/I18nReceiver.ts Outdated Show resolved Hide resolved
packages/zent/src/i18n/locale.ts Outdated Show resolved Hide resolved
fileList: files,
});

if (detail && detail.type === 'retry') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detail?.type

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

markdown 没有配置 optional chaining 语法的解析,无法使用

packages/zent/src/upload/components/AbstractUpload.tsx Outdated Show resolved Hide resolved
packages/zent/src/upload/utils/wrap-promise.ts Outdated Show resolved Hide resolved
}

return `${
isInteger(formattedSize) ? formattedSize : formattedSize.toFixed(toFixed)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

统一保留 n 位小数,跟产品确认

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先不做格式化处理,直接显示除后的数字,如果需要格式化使用者可以用 tips 处理

packages/zent/src/upload/components/image/List.tsx Outdated Show resolved Hide resolved
@cpylua
Copy link
Collaborator

cpylua commented Dec 26, 2019 via email

@kainstar
Copy link
Collaborator Author

除不尽的情况总要考虑吧,默认留2位小数吧

On Thu, Dec 26, 2019, 15:45 KainStar @.> wrote: @.* commented on this pull request. ------------------------------ In packages/zent/src/utils/isInteger.ts <#1298 (comment)>: > +export default function isInteger(value: string | number): boolean { + return /^[-+]?\d*$/.test(value.toString()); +} 先不做格式化处理,直接显示除后的数字,如果需要格式化使用者可以用 tips 处理 — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1298?email_source=notifications&email_token=AAFROECVJ2EGSEAOWNW4URLQ2ROLFA5CNFSM4J3JQBLKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCQG325Y#discussion_r361391783>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFROEFH4ZYHPTN3TIMFEXLQ2ROLFANCNFSM4J3JQBLA .

外部主动设置成除不尽小数的情况感觉也不多,一般都会设置成一个经过计算的正常数字吧

@cpylua cpylua merged commit 450df8a into master Dec 30, 2019
@cpylua cpylua deleted the refactor/upload branch December 30, 2019 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants