-
Notifications
You must be signed in to change notification settings - Fork 79
[4.1.] DropZone and drop support docs #1347
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
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a754a4b
docs(dropzone):draft docs
ntacheva 445b808
docs(dropzone): add more information and samples
ntacheva 56c9599
docs(dropzone): DropZone and drop support docs
ntacheva 5f0f1d4
add minor changes
0ba27d8
Update components/dropzone/overview.md
ntacheva ed80082
Update components/dropzone/overview.md
ntacheva ad922f8
Update components/dropzone/overview.md
ntacheva 58f94ac
docs(dropzone):address feedback
ntacheva 0fb0026
docs(dropzone):address feedback
ntacheva 04ad6d0
docs(upload,fileselect): fixes
ntacheva 9bf1c6f
Merge branch 'master' into dropzone-docs
ntacheva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| --- | ||
| title: Overview | ||
| page_title: DropZone Overview and Key Features | ||
| description: Discover the Telerik UI for Blazor DropZone, learn how to create the component, integrate it with the Upload and FileSelect controls, use its templaes, parameters, style its appearance, and explore its examples. | ||
| slug: dropzone-overview | ||
| tags: telerik,blazor,dropzone,external,drag,drop,file,overview | ||
| published: True | ||
| position: 0 | ||
| --- | ||
|
|
||
| # Blazor DropZone Overview | ||
|
|
||
| The <a href="https://www.telerik.com/blazor-ui/dropzone" target="_blank">Telerik UI for Blazor DropZone component</a> allows you to declare an external drop zone for an existing [FileSelect]({%slug fileselect-overview%}) or [Upload]({%slug upload-overview%}) component. | ||
|
|
||
| This integration enables the users to drag and drop one or multiple files to a designated space in their viewport. Dropping the files in the connected DropZone area will automatically select or upload them respectively. | ||
|
|
||
| ## Creating Blazor DropZone | ||
|
|
||
| 1. Add the DropZone to your Razor page by using the `TelerikDropZone` tag. | ||
| 1. Set the `Id` parameter of the component. | ||
| 1. Set the `DropZoneId` of the [FileSelect]({%slug fileselect-overview%}#fileselect-parameters) or [Upload]({%slug upload-overview%}#upload-parameters) component to match the `Id` of the DropZone. | ||
| 1. (Optional) Add a note to the DropZone by using the `NoteText` setting. | ||
|
|
||
| >caption Basic configuration of the DropZone with the FileSelect component. | ||
| ````CSHTML | ||
| <TelerikDropZone Id="@DropZoneId" NoteText="@NoteText" /> | ||
|
|
||
| <TelerikFileSelect DropZoneId="@DropZoneId" AllowedExtensions="@AllowedExtensions" /> | ||
|
|
||
| @code { | ||
| private string DropZoneId => "my-dropzone"; | ||
|
|
||
| private string NoteText => "Allowed file types: DOCX and PDF"; | ||
|
|
||
| private List<string> AllowedExtensions { get; set; } = new List<string>() { ".docx", ".pdf" }; | ||
| } | ||
| ```` | ||
|
|
||
| ## Integration with the Upload and FileSelect | ||
|
|
||
| You can integrate the DropZone with both the [FileSelect]({%slug fileselect-overview%}) or [Upload]({%slug upload-overview%}) components. This will allow users to drop files and automatically select or upload them. | ||
|
|
||
| The connection is achieved by simply matching the value of the DropZone `Id` parameter with the `DropZoneId` parameter of the FileSelect or the Upload component. | ||
|
|
||
| Once the user drops a file in the external DropZone, the file is automatically sent to the connected FileSelect/Upload. This action effectively raises the `OnSelect` event of the [FileSelect]({%slug fileselect-events%}#onselect) or [Upload]({%slug upload-events%}#onselect). You can handle that to perform further actions with the dropped file(s). | ||
|
|
||
| ## Template | ||
|
|
||
| The DropZone allows you to customize its rendering and appearance through a `Template` configuration. [Read more about using the DropZone template...]({%slug dropzone-template%}) | ||
|
|
||
| ## Parameters | ||
|
|
||
| The following table lists DropZone parameters. Check the [DropZone API Reference](/blazor-ui/api/Telerik.Blazor.Components.TelerikDropZone) for a full list of properties, methods and events. | ||
|
|
||
| @[template](/_contentTemplates/common/parameters-table-styles.md#table-layout) | ||
|
|
||
| | Parameter | Type and Default Value | Description | | ||
| | --- | --- | --- | | ||
| | `Id` | `string` | The id of the DropZone. Assign the same value of the corresponding Upload or FileSelect component to the `DropZoneId`. | | ||
| | `Enabled` | `bool` <br /> (`true`) | Specifies whether the DropZone is enabled. | | ||
| | `HintText` | `string` | The text for the hint of the DropZone. If not provided, the DropZone will render a default value ("Drag and drop files here to upload"). The label text is also [localizable]({%slug globalization-localization%}).| | ||
| | `NoteText` | `string` | Optional content inside the DropZone. Use it to render any additional information below the hint. The label text is also [localizable]({%slug globalization-localization%}). | | ||
|
|
||
| ### Styling and Appearance | ||
|
|
||
| The following parameters enable you to customize the appearance of the Blazor DropZone: | ||
|
|
||
| | Parameter | Type | Description | | ||
| | ----------- | ----------- | ----------- | | ||
| | `Class` | `string` | The CSS class that will be rendered on the main wrapping element of the DropZone (`<div class="k-external-dropzone">`). Use it for [overriding the theme or applying custom styles]({%slug themes-override%}). | | ||
| | `DragOverClass` | `string` | The CSS class that will be rendered on the main wrapping element of the DropZone when a file is dragged over it. Use it for [conditionally styling the component during a dragover action](https://demos.telerik.com/blazor-ui/dropzone/overview). | | ||
| | `Width` | `string` | The width of the DropZone. Accepts a valid CSS value (see the [Dimensions article]({%slug common-features/dimensions%})). | | ||
| | `Height` | `string` | The height of the DropZone. Accepts a valid CSS value (see the [Dimensions article]({%slug common-features/dimensions%})). | | ||
|
|
||
| ## Next Steps | ||
|
|
||
| * [Using the DropZone Template for custom content]({%slug dropzone-template%}) | ||
|
|
||
| ## See Also | ||
|
|
||
| * [Live Demo: Blazor DropZone Overview and Key Features](https://demos.telerik.com/blazor-ui/dropzone/overview) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| title: Template | ||
| page_title: DropZone Content Template | ||
| description: Learn more about how to modify the default content of the Telerik UI for Blazor DropZone by using its template and defining a custom layout. | ||
| slug: dropzone-template | ||
| tags: telerik,blazor,dropzone,external,drag,drop,file,template,custom,content | ||
| published: True | ||
| position: 5 | ||
| --- | ||
|
|
||
| # DropZone Template | ||
|
|
||
| The DropZone allows you to customize the default rendering of its content by using a `Template`. | ||
|
|
||
| The `Template` is a `RenderFragment` and allows you to add whatever custom content is required such as simple text, HTML elements, or other components. | ||
|
|
||
| >caption Use Template to add custom content in the DropZone | ||
|
|
||
| ````CSHTML | ||
| <TelerikDropZone Id="@DropZoneId"> | ||
| <Template> | ||
| <TelerikFontIcon Icon="@FontIcon.FileAdd" /> | ||
| <span>Drop files here</span> | ||
| </Template> | ||
| </TelerikDropZone> | ||
|
|
||
| <TelerikFileSelect DropZoneId="@DropZoneId" /> | ||
|
|
||
| @code { | ||
| private string DropZoneId => "my-dropzone"; | ||
| } | ||
| ```` | ||
|
|
||
| ## See Also | ||
|
|
||
| * [Live Demo: Implementing the Blazor DropZone Template](https://demos.telerik.com/blazor-ui/dropzone/template) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.