Skip to content

Commit

Permalink
feat: add multiple and dropzone demo for file input
Browse files Browse the repository at this point in the history
  • Loading branch information
KabinKhandThakuri committed Jan 17, 2025
1 parent d6f59b3 commit 4297e73
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/demo/src/locales/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
"disableWeekDays": "Disable week days",
"disabledMultiSelect": "Disabled multiselect",
"disableSort": "Disable alphabetical sorting",
"dropzone": "Dropzone",
"dropzoneOptions": "Dropzone Options",
"editableContent": "Editable content",
"email": "Email",
"expiresAfter": "Expires after",
Expand All @@ -97,6 +99,7 @@
"monthPicker": "Month picker",
"multiCalendars": "Multicalendar",
"multiCheckbox": "Multiple checkbox input",
"multiple": "Multiple files",
"multiSelect": "Multiselect",
"next": "Next",
"number": "Number",
Expand Down
3 changes: 3 additions & 0 deletions apps/demo/src/locales/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"disabled": "Disabled[fr]",
"disableWeekDays": "Disable week days[fr]",
"disableSort": "Disable alphabetical sorting",
"dropzone": "Dropzone",
"dropzoneOptions": "Dropzone Options",
"editableContent": "Editable content",
"email": "Email[fr]",
"expiresAfter": "Expires after",
Expand All @@ -94,6 +96,7 @@
"monthPicker": "Month picker[fr]",
"multiCalendars": "Multicalendar[fr]",
"multiCheckbox": "Multiple checkbox input",
"multiple": "Multiple files",
"multiSelect": "Multiselect[fr]",
"next": "Next",
"number": "Number[fr]",
Expand Down
60 changes: 60 additions & 0 deletions apps/demo/src/views/Form/fileInput/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,66 @@
<!-- eslint-enable -->
</div>
</section>

<section>
<h2>{{ $t("form.label.dropzoneOptions") }}</h2>

<div class="section-content">
<FileInput
:dropzone-options="{
accept: ['image/jpeg', 'image/png'],
minSize: 1000,
maxSize: 1000000,
}"
enable-description
input-method="dropzone"
name="images"
show-error-message
/>

<!-- eslint-disable -->
<SshPre language="html-vue">
&lt;template&gt;
&lt;FileInput input-method="dropzone" /&gt;
&lt;/template&gt;

&lt;script setup lang="ts"&gt;
import { FileInput } from "@dzangolab/vue3-form";
&lt;/script&gt;
</SshPre>
<!-- eslint-enable -->
</div>
</section>

<section>
<h2>{{ $t("form.label.multiple") }}</h2>

<div class="section-content">
<FileInput
:dropzone-options="{
accept: ['image/jpeg', 'image/png'],
maxFiles: 5,
}"
enable-description
input-method="dropzone"
multiple
name="files"
show-error-message
/>

<!-- eslint-disable -->
<SshPre language="html-vue">
&lt;template&gt;
&lt;FileInput input-method="dropzone" /&gt;
&lt;/template&gt;

&lt;script setup lang="ts"&gt;
import { FileInput } from "@dzangolab/vue3-form";
&lt;/script&gt;
</SshPre>
<!-- eslint-enable -->
</div>
</section>
</FormPage>
</template>

Expand Down

0 comments on commit 4297e73

Please sign in to comment.