Skip to content

Commit e819de8

Browse files
web-padawanclaude
andauthored
docs: extend @fires JSDoc descriptions for upload events (#11604)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 56bcd3c commit e819de8

4 files changed

Lines changed: 22 additions & 22 deletions

File tree

packages/upload/src/vaadin-upload-file.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ export interface UploadFileEventMap extends HTMLElementEventMap, UploadFileCusto
9797
*
9898
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
9999
*
100-
* @fires {CustomEvent} file-abort - Fired when the abort button is pressed.
101-
* @fires {CustomEvent} file-retry - Fired when the retry button is pressed.
102-
* @fires {CustomEvent} file-start - Fired when the start button is pressed.
100+
* @fires {CustomEvent} file-abort - Fired when the abort button is pressed. Listened by `vaadin-upload`, which aborts the upload in progress and removes the file from the list.
101+
* @fires {CustomEvent} file-retry - Fired when the retry button is pressed. Listened by `vaadin-upload`, which starts a new upload of this file.
102+
* @fires {CustomEvent} file-start - Fired when the start button is pressed. Listened by `vaadin-upload`, which starts a new upload of this file.
103103
*/
104104
declare class UploadFile extends UploadFileMixin(ThemableMixin(HTMLElement)) {
105105
addEventListener<K extends keyof UploadFileEventMap>(

packages/upload/src/vaadin-upload-file.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ import { UploadFileMixin } from './vaadin-upload-file-mixin.js';
7777
*
7878
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
7979
*
80-
* @fires {CustomEvent} file-abort - Fired when the abort button is pressed.
81-
* @fires {CustomEvent} file-retry - Fired when the retry button is pressed.
82-
* @fires {CustomEvent} file-start - Fired when the start button is pressed.
80+
* @fires {CustomEvent} file-abort - Fired when the abort button is pressed. Listened by `vaadin-upload`, which aborts the upload in progress and removes the file from the list.
81+
* @fires {CustomEvent} file-retry - Fired when the retry button is pressed. Listened by `vaadin-upload`, which starts a new upload of this file.
82+
* @fires {CustomEvent} file-start - Fired when the start button is pressed. Listened by `vaadin-upload`, which starts a new upload of this file.
8383
*
8484
* @customElement vaadin-upload-file
8585
* @extends HTMLElement

packages/upload/src/vaadin-upload.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,19 @@ export interface UploadEventMap extends HTMLElementEventMap, UploadCustomEventMa
197197
*
198198
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
199199
*
200-
* @fires {CustomEvent} file-reject - Fired when a file cannot be added to the queue due to a constrain.
200+
* @fires {CustomEvent} file-reject - Fired when a file cannot be added to the queue due to a constraint: file size, file type, or maxFiles.
201201
* @fires {CustomEvent} file-remove - Fired when a file is removed from the list.
202202
* @fires {CustomEvent} files-changed - Fired when the `files` property changes.
203203
* @fires {CustomEvent} max-files-reached-changed - Fired when the `maxFilesReached` property changes.
204-
* @fires {CustomEvent} upload-before - Fired before the XHR is opened.
204+
* @fires {CustomEvent} upload-before - Fired before the XHR is opened. Useful for changing the request URL. If the default is prevented, the XHR is not opened.
205205
* @fires {CustomEvent} upload-start - Fired when the XHR is sent.
206206
* @fires {CustomEvent} upload-progress - Fired as many times as the progress is updated.
207-
* @fires {CustomEvent} upload-success - Fired in case the upload process succeeded.
208-
* @fires {CustomEvent} upload-error - Fired in case the upload process failed.
209-
* @fires {CustomEvent} upload-request - Fired when the XHR has been opened but not sent yet.
210-
* @fires {CustomEvent} upload-response - Fired when on the server response before analyzing it.
211-
* @fires {CustomEvent} upload-retry - Fired when retry upload is requested.
212-
* @fires {CustomEvent} upload-abort - Fired when upload abort is requested.
207+
* @fires {CustomEvent} upload-success - Fired when the upload process succeeds.
208+
* @fires {CustomEvent} upload-error - Fired when the upload process fails.
209+
* @fires {CustomEvent} upload-request - Fired when the XHR has been opened but not sent yet. Useful for appending data to the FormData or modifying request parameters. If the default is prevented, the request is not sent.
210+
* @fires {CustomEvent} upload-response - Fired when the server response is received, before the component analyzes it. If the default is prevented, the component returns and the listener can handle `xhr` and `file` directly; otherwise the normal flow checks `xhr.status` and `file.error`, which can be modified to force a custom outcome.
211+
* @fires {CustomEvent} upload-retry - Fired when retry upload is requested. If the default is prevented, the retry is not performed.
212+
* @fires {CustomEvent} upload-abort - Fired when upload abort is requested. If the default is prevented, the upload is not aborted.
213213
*/
214214
declare class Upload extends UploadMixin(ThemableMixin(ElementMixin(HTMLElement))) {
215215
addEventListener<K extends keyof UploadEventMap>(

packages/upload/src/vaadin-upload.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ import { UploadMixin } from './vaadin-upload-mixin.js';
8888
*
8989
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
9090
*
91-
* @fires {CustomEvent} file-reject - Fired when a file cannot be added to the queue due to a constrain.
91+
* @fires {CustomEvent} file-reject - Fired when a file cannot be added to the queue due to a constraint: file size, file type, or maxFiles.
9292
* @fires {CustomEvent} file-remove - Fired when a file is removed from the list.
9393
* @fires {CustomEvent} files-changed - Fired when the `files` property changes.
9494
* @fires {CustomEvent} max-files-reached-changed - Fired when the `maxFilesReached` property changes.
95-
* @fires {CustomEvent} upload-before - Fired before the XHR is opened.
95+
* @fires {CustomEvent} upload-before - Fired before the XHR is opened. Useful for changing the request URL. If the default is prevented, the XHR is not opened.
9696
* @fires {CustomEvent} upload-start - Fired when the XHR is sent.
9797
* @fires {CustomEvent} upload-progress - Fired as many times as the progress is updated.
98-
* @fires {CustomEvent} upload-success - Fired in case the upload process succeeded.
99-
* @fires {CustomEvent} upload-error - Fired in case the upload process failed.
100-
* @fires {CustomEvent} upload-request - Fired when the XHR has been opened but not sent yet.
101-
* @fires {CustomEvent} upload-response - Fired when on the server response before analyzing it.
102-
* @fires {CustomEvent} upload-retry - Fired when retry upload is requested.
103-
* @fires {CustomEvent} upload-abort - Fired when upload abort is requested.
98+
* @fires {CustomEvent} upload-success - Fired when the upload process succeeds.
99+
* @fires {CustomEvent} upload-error - Fired when the upload process fails.
100+
* @fires {CustomEvent} upload-request - Fired when the XHR has been opened but not sent yet. Useful for appending data to the FormData or modifying request parameters. If the default is prevented, the request is not sent.
101+
* @fires {CustomEvent} upload-response - Fired when the server response is received, before the component analyzes it. If the default is prevented, the component returns and the listener can handle `xhr` and `file` directly; otherwise the normal flow checks `xhr.status` and `file.error`, which can be modified to force a custom outcome.
102+
* @fires {CustomEvent} upload-retry - Fired when retry upload is requested. If the default is prevented, the retry is not performed.
103+
* @fires {CustomEvent} upload-abort - Fired when upload abort is requested. If the default is prevented, the upload is not aborted.
104104
*
105105
* @customElement vaadin-upload
106106
* @extends HTMLElement

0 commit comments

Comments
 (0)