From 76b76e6f874ef37785167e0179f14e846f4986f9 Mon Sep 17 00:00:00 2001 From: Cretu Eusebiu Date: Fri, 30 Apr 2021 00:44:32 +0300 Subject: [PATCH] Handle files by default --- CHANGELOG.md | 5 +++++ docs.md | 22 ++++++++------------- package.json | 2 +- src/Form.ts | 51 +++++++++++++++++++++++++++++++++++++++++++------ src/util.ts | 10 ++++++++++ types/Form.d.ts | 13 +++++++++++++ types/util.d.ts | 4 ++++ 7 files changed, 86 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d87720..2291afb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2.0.3 - 2021-04-30 + +- Handle files with `FormData` by default. +- Added upload `progress` property to `Form`. + ## 2.0.2 - 2021-04-29 - Fixed missing `Method` type for old axios versions. diff --git a/docs.md b/docs.md index 83a94ee..031a6d4 100644 --- a/docs.md +++ b/docs.md @@ -101,6 +101,11 @@ form.successful: boolean * The validation errors from the server. */ form.errors: Errors + +/** + * The upload progress object. + */ +form.progress: { total: number, loaded: number, percentage: number } | undefined ``` #### Instance methods @@ -403,12 +408,6 @@ export default { ### File Upload -To handle file uploads we need to install a npm pacakge: - -```bash -npm install object-to-formdata -``` - ```html