From 3b2c4dee49c1b744e0571bc942b3ab8fccc58075 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Tue, 12 Feb 2019 16:51:28 +0300 Subject: [PATCH] Initiated Advanced FileUploader --- public/upload.php | 1 + src/AppMenu.vue | 2 +- src/assets/styles/app.scss | 5 + src/assets/styles/primevue.css | 1 + src/components/fileupload/FileUpload.css | 93 ++++++++ src/components/fileupload/FileUpload.vue | 282 +++++++++++++++++++++++ src/main.js | 6 +- src/router.js | 5 + src/views/fileupload/FileUploadDemo.vue | 25 ++ src/views/toast/ToastDemo.vue | 5 - 10 files changed, 417 insertions(+), 8 deletions(-) create mode 100644 public/upload.php create mode 100644 src/components/fileupload/FileUpload.css create mode 100644 src/components/fileupload/FileUpload.vue create mode 100644 src/views/fileupload/FileUploadDemo.vue diff --git a/public/upload.php b/public/upload.php new file mode 100644 index 000000000..c3d453155 --- /dev/null +++ b/public/upload.php @@ -0,0 +1 @@ +Fake Upload Process

'; ?> \ No newline at end of file diff --git a/src/AppMenu.vue b/src/AppMenu.vue index aa184f3a1..dcc468f7a 100644 --- a/src/AppMenu.vue +++ b/src/AppMenu.vue @@ -89,7 +89,7 @@
- ● Link + ● Upload
diff --git a/src/assets/styles/app.scss b/src/assets/styles/app.scss index d1afcd931..94da5c418 100644 --- a/src/assets/styles/app.scss +++ b/src/assets/styles/app.scss @@ -1077,4 +1077,9 @@ pre[class*="language-"] { } } } +} + +.p-toast.p-toast-topright, +.p-toast.p-toast-topleft { + top: 100px; } \ No newline at end of file diff --git a/src/assets/styles/primevue.css b/src/assets/styles/primevue.css index 70ad57e5b..49ec75581 100644 --- a/src/assets/styles/primevue.css +++ b/src/assets/styles/primevue.css @@ -8,6 +8,7 @@ @import '../../components/dialog/Dialog.css'; @import '../../components/dropdown/Dropdown.css'; @import '../../components/fieldset/Fieldset.css'; +@import '../../components/fileupload/FileUpload.css'; @import '../../components/inputtext/InputText.css'; @import '../../components/inputswitch/InputSwitch.css'; @import '../../components/listbox/Listbox.css'; diff --git a/src/components/fileupload/FileUpload.css b/src/components/fileupload/FileUpload.css new file mode 100644 index 000000000..441fc46b0 --- /dev/null +++ b/src/components/fileupload/FileUpload.css @@ -0,0 +1,93 @@ +/* + * FileUpload + */ + .p-fileupload-buttonbar .p-fileupload-choose.p-disabled input { + cursor: default; +} + +.p-fileupload-buttonbar { + padding: .5em; + border-bottom: 0 none; +} + +.p-fileupload-buttonbar .p-button { + vertical-align: middle; + margin-right: .25em; +} + +.p-fileupload-content { + padding: 1em; + position: relative; + transition: border-color .3s; +} + +.p-fileupload-content.p-fileupload-highlight { + border-color: #156090; +} + +.p-fileupload-files img { + border: none; +} + +.p-fileupload-files { + display: table; +} + +.p-fileupload-row { + display: table-row; +} + +.p-fileupload-row > div { + display: table-cell; + padding: .5em 1em; + vertical-align: middle; +} + +.p-fileupload-content .p-progressbar { + width: 100%; + position: absolute; + top: 1px; + left: 0; + height: .25em; + border: 0 none; +} + +.p-fileupload-content .p-progressbar-value { + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + border: 0 none; +} + +/* Simple */ +.p-fileupload-choose { + position: relative; + overflow: hidden; +} + +.p-fileupload-choose input[type=file] { + position: absolute; + top: 0; + right: 0; + margin: 0; + opacity: 0; + min-height: 100%; + font-size: 100px; + text-align: right; + filter: alpha(opacity=0); + direction: ltr; + cursor: pointer; +} + +.p-fileupload-choose.p-fileupload-choose-selected input[type=file] { + display: none; +} + +/* p-fluid */ +.p-fluid .p-fileupload .p-button { + width: auto; +} + +.p-fluid .p-fileupload-content .p-button-icon-only { + width: 2em; +} \ No newline at end of file diff --git a/src/components/fileupload/FileUpload.vue b/src/components/fileupload/FileUpload.vue new file mode 100644 index 000000000..dc40feac8 --- /dev/null +++ b/src/components/fileupload/FileUpload.vue @@ -0,0 +1,282 @@ + + + + + diff --git a/src/main.js b/src/main.js index 1573fd03d..eb6740c46 100644 --- a/src/main.js +++ b/src/main.js @@ -12,10 +12,11 @@ import Chips from './components/chips/Chips'; import Dialog from './components/dialog/Dialog'; import Dropdown from './components/dropdown/Dropdown'; import Editor from './components/editor/Editor'; +import Fieldset from './components/fieldset/Fieldset'; +import FileUpload from './components/fileupload/FileUpload'; import FullCalendar from './components/fullcalendar/FullCalendar'; import InputSwitch from './components/inputswitch/InputSwitch'; import InputText from './components/inputtext/InputText'; -import Fieldset from './components/fieldset/Fieldset'; import Listbox from './components/listbox/Listbox'; import Message from './components/message/Message'; import MultiSelect from './components/multiselect/MultiSelect'; @@ -58,11 +59,12 @@ Vue.component('Chips', Chips); Vue.component('Dialog', Dialog); Vue.component('Dropdown', Dropdown); Vue.component('Editor', Editor); +Vue.component('Fieldset', Fieldset); +Vue.component('FileUpload', FileUpload); Vue.component('FullCalendar', FullCalendar); Vue.component('InputSwitch', InputSwitch); Vue.component('InputText', InputText); Vue.component('Listbox', Listbox); -Vue.component('Fieldset', Fieldset); Vue.component('Message', Message); Vue.component('MultiSelect', MultiSelect); Vue.component('OverlayPanel', OverlayPanel); diff --git a/src/router.js b/src/router.js index 781469419..273c09626 100644 --- a/src/router.js +++ b/src/router.js @@ -101,6 +101,11 @@ export default new Router({ name: 'fieldset', component: () => import('./views/fieldset/FieldsetDemo.vue') }, + { + path: '/fileupload', + name: 'fileupload', + component: () => import('./views/fileupload/FileUploadDemo.vue') + }, { path: '/flexgrid', name: 'flexgrid', diff --git a/src/views/fileupload/FileUploadDemo.vue b/src/views/fileupload/FileUploadDemo.vue new file mode 100644 index 000000000..598572be2 --- /dev/null +++ b/src/views/fileupload/FileUploadDemo.vue @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/src/views/toast/ToastDemo.vue b/src/views/toast/ToastDemo.vue index 534b99a15..83f7a0810 100644 --- a/src/views/toast/ToastDemo.vue +++ b/src/views/toast/ToastDemo.vue @@ -101,9 +101,4 @@ export default { button.p-button { margin-right: .5em; } - -.p-toast.p-toast-topright, -.p-toast.p-toast-topleft { - top: 100px; -}