From d5a911b40645582a8b1f3b08fb0381695595d617 Mon Sep 17 00:00:00 2001 From: Warsono Date: Tue, 14 Sep 2021 13:24:50 +0700 Subject: [PATCH] feat(v-file-upload): added new file upload component --- .../VFileUpload/VFileUpload.stories.ts | 58 +++ src/components/VFileUpload/VFileUpload.vue | 367 ++++++++++++++++++ 2 files changed, 425 insertions(+) create mode 100644 src/components/VFileUpload/VFileUpload.stories.ts create mode 100644 src/components/VFileUpload/VFileUpload.vue diff --git a/src/components/VFileUpload/VFileUpload.stories.ts b/src/components/VFileUpload/VFileUpload.stories.ts new file mode 100644 index 000000000..24a46aa1e --- /dev/null +++ b/src/components/VFileUpload/VFileUpload.stories.ts @@ -0,0 +1,58 @@ +import MyFileUpload from './VFileUpload.vue'; + +export default { + title: 'Components/Form/FileUpload', + component: MyFileUpload, + argTypes: {}, + args: { + button: false, + full: false, + rounded: false, + image: false, + value: null, + modelValue: null, + accept: '', + inputProps: {}, + name: '', + error: false, + errorMessages: [], + placeholder: 'Browse file...', + id: '', + }, +}; + +const Template = (args) => ({ + // Components used in your story `template` are defined in the `components` object + components: { + 'my-component': MyFileUpload, + }, + // The story's `args` need to be mapped into the template through the `setup()` method + setup() { + return {args}; + }, + // And then the `args` are bound to your component with `v-bind="args"` + template: ``, +}); + +export const Default = Template.bind({}); +Default.args = {}; + +export const Button = Template.bind({}); +Button.args = { + button: true, +}; + +export const Full = Template.bind({}); +Full.args = { + full: true, +}; + +export const Rounded = Template.bind({}); +Rounded.args = { + rounded: true, +}; + +export const Image = Template.bind({}); +Image.args = { + image: true, +}; diff --git a/src/components/VFileUpload/VFileUpload.vue b/src/components/VFileUpload/VFileUpload.vue new file mode 100644 index 000000000..b4947086f --- /dev/null +++ b/src/components/VFileUpload/VFileUpload.vue @@ -0,0 +1,367 @@ + + + + + + +