diff --git a/quasar.conf.js b/quasar.conf.js index 1f2fb69..8183b7e 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -118,11 +118,13 @@ module.exports = function (ctx) { 'QToolbar', 'QToolbarTitle', 'QBtn', + 'QBtnDropdown', 'QIcon', 'QList', 'QListHeader', 'QItem', 'QItemMain', + 'QItemTile', 'QItemSide', 'QCard', 'QCardTitle', diff --git a/src/components/categories/SingleCat/SingleCat.ts b/src/components/categories/SingleCat/SingleCat.ts index 900000c..5d61c5a 100644 --- a/src/components/categories/SingleCat/SingleCat.ts +++ b/src/components/categories/SingleCat/SingleCat.ts @@ -1,8 +1,6 @@ import Vue from 'vue' import { Component, Prop } from 'vue-property-decorator' -require('./SingleCat.scss') - import { ICategory } from '../../../model/index' @Component({ diff --git a/src/components/categories/SingleCat/SingleCat.vue b/src/components/categories/SingleCat/SingleCat.vue index fbcc2ed..2ea4518 100644 --- a/src/components/categories/SingleCat/SingleCat.vue +++ b/src/components/categories/SingleCat/SingleCat.vue @@ -17,3 +17,7 @@ + + diff --git a/src/components/categories/category/category.ts b/src/components/categories/category/category.ts index 0388af8..fa2f45e 100644 --- a/src/components/categories/category/category.ts +++ b/src/components/categories/category/category.ts @@ -4,8 +4,6 @@ import { Component, Watch } from 'vue-property-decorator' import { SingleCat } from '@components' import { ICategory } from '@src/model' -require('./category.scss') - @Component({ components: { SingleCat } diff --git a/src/components/categories/category/category.vue b/src/components/categories/category/category.vue index 8f17f61..1d9eff6 100644 --- a/src/components/categories/category/category.vue +++ b/src/components/categories/category/category.vue @@ -61,3 +61,7 @@ + + diff --git a/src/components/categories/tabledata/tabledata.ts b/src/components/categories/tabledata/tabledata.ts index 636df34..7bb46c1 100644 --- a/src/components/categories/tabledata/tabledata.ts +++ b/src/components/categories/tabledata/tabledata.ts @@ -3,9 +3,6 @@ import { Component, Watch } from 'vue-property-decorator' import { ICategory } from '@src/model' -require('./tabledata.scss') - - @Component({ }) export default class Tabledata extends Vue { diff --git a/src/components/categories/tabledata/tabledata.vue b/src/components/categories/tabledata/tabledata.vue index 6275a06..3ed1aac 100644 --- a/src/components/categories/tabledata/tabledata.vue +++ b/src/components/categories/tabledata/tabledata.vue @@ -59,3 +59,7 @@ + + diff --git a/src/components/logo/logo.ts b/src/components/logo/logo.ts index 4e45a17..17f7d8c 100644 --- a/src/components/logo/logo.ts +++ b/src/components/logo/logo.ts @@ -1,8 +1,6 @@ import Vue from 'vue' import { Component } from 'vue-property-decorator' -require('./logo.scss') - import { TimelineLite, Back } from 'gsap' import $ from 'jquery' diff --git a/src/components/logo/logo.vue b/src/components/logo/logo.vue index 931df7d..65c27c7 100644 --- a/src/components/logo/logo.vue +++ b/src/components/logo/logo.vue @@ -5,3 +5,7 @@ + + diff --git a/src/components/todos/SingleTodo/SingleTodo.scss b/src/components/todos/SingleTodo/SingleTodo.scss index 0e30137..01852da 100644 --- a/src/components/todos/SingleTodo/SingleTodo.scss +++ b/src/components/todos/SingleTodo/SingleTodo.scss @@ -1,37 +1,115 @@ -.flex-container { - padding: 0; - margin: 0; - list-style: none; +.flex-item{ + background-color: #d5e2eb; + padding: 1px; + margin: 1px; + color: #000; + font-size: 0.85rem; + flex: 1 1 auto; +} - -ms-box-orient: horizontal; - display: -webkit-box; - display: -moz-box; - display: -ms-flexbox; - display: -moz-flex; - display: -webkit-flex; - display: flex; +.flex-container2 { + flex-flow: row nowrap; + justify-content: space-between; +} + +.btn-item { + max-width: 24px; } -#appsingletodo { - color: white; - font-size: 1.1rem; - display: flex; - margin: 2px; - padding: 3px; - border: 2px; - background-color: #9db6ff; +.pos-item { + max-width: 24px; + min-width: 24px; + margin: 0 auto; + height: 36px; + line-height: 36px; + text-align: center; +} + +.priority-item-popover { + max-width: 24px; + min-width: 24px; + padding: 0px; +} + +.priority-item { + max-width: 24px; + min-width: 24px; +} + +.completed-item { + max-width: 24px; + min-width: 24px; +} + +.myexpired { + padding-top: 0px; + padding-bottom: 0px; + font-size: 12px; +} + +.data-item { + max-width: 100px; + min-width: 100px; + display: block; + visibility: initial; +} + +@media screen and (max-width: 600px) { + .data-item { + display: none; + visibility: hidden; + content: ""; + } +} + + +.div_descr { + // background-color: green; + flex: 2 1 auto; +} + + +.appsingletodo { + color: black; + font-size: 1.0rem; + // display: flex; + margin: 1px; + padding: 2px; + border: 1px; + background-color: #e1ebed; } .mycols{ - padding: 2px; margin: 1px; - border-color: #8a8484; - border-style: outset; - /* background-color: green; */ + padding: 2px; + //width: 40px; + // border-color: #8a8484; + // border-style: outset; + margin: auto; + // flex-grow: 1; +} + + + +.mycols:hover{ + } .mybtn{ width: 18px; height: 18px; } + +.icon_completed { + position: relative; + transform: translateY(0%); +} + +.mydescr{ +} + + +.icon_completed:hover { + color: darkgreen; +} diff --git a/src/components/todos/SingleTodo/SingleTodo.ts b/src/components/todos/SingleTodo/SingleTodo.ts index a3390e6..3d118c3 100644 --- a/src/components/todos/SingleTodo/SingleTodo.ts +++ b/src/components/todos/SingleTodo/SingleTodo.ts @@ -1,8 +1,6 @@ import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' -require('./SingleTodo.scss') - import { rescodes } from '../../../store/Modules/rescodes' import { UserStore } from '@modules' @@ -12,7 +10,12 @@ import { ITodo } from '../../../model/index' name: 'SingleTodo' }) export default class SingleTodo extends Vue { - public selectPriority: [] + public selectPriority: [] = [] + public iconCompleted: string = '' + public iconPriority: string = '' + public popover: boolean = false + $q: any + @Prop({required: true}) itemtodo: ITodo @Watch('itemtodo.completed') valueChanged() { @@ -25,12 +28,52 @@ export default class SingleTodo extends Vue { this.$emit('eventupdate', this.itemtodo) } + setCompleted () { + // console.log('setCompleted') + this.itemtodo.completed = !this.itemtodo.completed + + this.updateicon() + + this.updatedata() + } + + updatedata() { + this.$emit('eventupdate', this.itemtodo) + } + + updateicon () { + if (this.itemtodo.completed) + this.iconCompleted = 'check_circle' + else + this.iconCompleted = 'check_circle_outline' + + + if (this.itemtodo.priority === rescodes.Todos.PRIORITY_HIGH) + this.iconPriority = 'expand_less' // expand_less + else if (this.itemtodo.priority === rescodes.Todos.PRIORITY_NORMAL) + this.iconPriority = 'remove' + else if (this.itemtodo.priority === rescodes.Todos.PRIORITY_LOW) + this.iconPriority = 'expand_more' // expand_more + + } + created() { + this.updateicon() + this.selectPriority = rescodes.selectPriority[UserStore.state.lang] + } remove(id) { this.$emit('event', id) } + setPriority (newpriority) { + + this.itemtodo.priority = newpriority + + this.updatedata() + + // this.$q.notify('setPriority: ' + elem) + } } diff --git a/src/components/todos/SingleTodo/SingleTodo.vue b/src/components/todos/SingleTodo/SingleTodo.vue index 049af84..fef32df 100644 --- a/src/components/todos/SingleTodo/SingleTodo.vue +++ b/src/components/todos/SingleTodo/SingleTodo.vue @@ -1,30 +1,55 @@ + + diff --git a/src/components/todos/todo/todo.scss b/src/components/todos/todo/todo.scss index 6580a26..a706668 100644 --- a/src/components/todos/todo/todo.scss +++ b/src/components/todos/todo/todo.scss @@ -1,3 +1,13 @@ +.flex-container{ + background-color: #ccc; + padding: 5px; + display: flex; + flex-flow: row nowrap; + justify-content: space-between; +} + + + .mycard { visibility: hidden; } diff --git a/src/components/todos/todo/todo.ts b/src/components/todos/todo/todo.ts index fbf2013..08b55f2 100644 --- a/src/components/todos/todo/todo.ts +++ b/src/components/todos/todo/todo.ts @@ -4,16 +4,16 @@ import { Component, Watch } from 'vue-property-decorator' import { SingleTodo } from '@components' import { ITodo } from '@src/model' -require('./todo.scss') - import { rescodes } from '../../../store/Modules/rescodes' import { UserStore } from '@modules' import _ from 'lodash' +import draggable from 'vuedraggable' + @Component({ - components: { SingleTodo } + components: { SingleTodo, draggable } }) export default class Todo extends Vue { $q: any @@ -22,6 +22,50 @@ export default class Todo extends Vue { title: string = '' todo: string = '' todos_arr: any[] = [{}] + drag: boolean = true + startpos: number = 0 + endpos: number = 0 + + @Watch('drag') changedrag() { + console.log('drag = ' + this.drag) + } + + change(param) { + console.log('Change... ' + param) + } + + onStart() { + this.startpos = 0 + } + + getpos(indelem) { + return this.todos_arr[indelem].pos + } + + onEnd(myvar) { + let oldpos = this.getpos(myvar.oldIndex) + let newpos = this.getpos(myvar.newIndex) + + console.log('onEnd old = ' + oldpos + ' new = ' + newpos) + if (myvar.oldIndex < myvar.newIndex) { + // c'è spazio + newpos = oldpos - 1 + if (newpos <= 0) + newpos = 1 + } else { + newpos = newpos + 1 + } + + console.log('newpos = ' + newpos) + + if (newpos >= 0) { + let myobj = this.todos_arr[myvar.oldIndex] + console.log('posprec = ' + myobj.pos) + myobj.pos = newpos + this.modify(myobj) + + } + } created() { @@ -85,24 +129,25 @@ export default class Todo extends Vue { console.log('Errore: ' + err.message) }) - // objtodo.id = myid - - // Add into the memory - // this.todos_loc.push(objtodo) - // empty the field this.todo = '' } - deleteitem(id) { - // console.log('deleteitem: KEY = ', id) - + getobjbyid(id) { let myobjtrov = null this.todos_arr.forEach(myobj => { if (myobj.id === id) myobjtrov = myobj }) + return myobjtrov + } + + deleteitem(id) { + // console.log('deleteitem: KEY = ', id) + + let myobjtrov = this.getobjbyid(id) + if (myobjtrov !== null) { // Delete item this.$db.todos @@ -133,38 +178,22 @@ export default class Todo extends Vue { }) } else { - // this.$db.dispatch('todosSetSort', { sort: 'pos' } ) - - let coll = this.$db.todos - await this.$db.todos .where('userId').equals(UserStore.state.userId) - // .sortBy('descr') .toArray().then(ristodos => { this.todos_arr = ristodos }) - - let reverse = [] - reverse['completed'] = true - reverse['priority'] = true - reverse['pos'] = true - console.log(reverse) - this.todos_arr = _.orderBy(this.todos_arr, ['completed', 'priority', 'pos'], ['asc', 'desc', 'asc']) } + + this.todos_arr.map((item, index) => { + item.pos = (index * 2) + 1 + }) return [] } - /* - await db.transaction('rw', [db.friends], async () => { - const friend = await db.friends.get(1); - ++friend.age; - await db.friends.put(friend); - }); - */ - updateitem(myobj) { console.log('updateitem') this.modify(myobj) @@ -179,6 +208,7 @@ export default class Todo extends Vue { miorec.completed = myobj.completed miorec.expiring_at = myobj.expiring_at miorec.priority = myobj.priority + miorec.pos = myobj.pos await this.$db.todos.put(miorec) diff --git a/src/components/todos/todo/todo.vue b/src/components/todos/todo/todo.vue index 47f0860..1ef1da6 100644 --- a/src/components/todos/todo/todo.vue +++ b/src/components/todos/todo/todo.vue @@ -7,9 +7,18 @@ :after="[{icon: 'arrow_forward', content: true, handler () {}}]" v-on:keyup.enter="insertTodo"/> - - +
+ + + + + + +
+ + @@ -18,3 +27,6 @@ + diff --git a/src/root/home/home.ts b/src/root/home/home.ts index 5c8e453..7655392 100644 --- a/src/root/home/home.ts +++ b/src/root/home/home.ts @@ -4,8 +4,6 @@ import { GlobalStore } from '@store' import { Logo } from '@components' -require('./home.scss') - @Component({ components: { Logo } }) diff --git a/src/root/home/home.vue b/src/root/home/home.vue index 5d0d6c2..e86d14a 100644 --- a/src/root/home/home.vue +++ b/src/root/home/home.vue @@ -8,3 +8,6 @@ + diff --git a/src/store/Modules/rescodes.ts b/src/store/Modules/rescodes.ts index fca782a..1c90661 100644 --- a/src/store/Modules/rescodes.ts +++ b/src/store/Modules/rescodes.ts @@ -17,37 +17,49 @@ export const rescodes = { Todos: { PRIORITY_NORMAL: 0, - PRIORITY_HIGH: 10, - PRIORITY_LOW: -10 + PRIORITY_HIGH: 1, + PRIORITY_LOW: -1 }, selectPriority: { 'it': [ { + id: 1, label: 'Alta', - value: 1 + value: 1, + icon: 'expand_less' }, { + id: 2, label: 'Normale', - value: 0 + value: 0, + icon: 'remove' }, { + id: 3, label: 'Bassa', - value: -1 + value: -1, + icon: 'expand_more' }], 'enUk': [ { + id: 1, label: 'High', - value: 1 + value: 1, + icon: 'expand_less' }, { + id: 2, label: 'Normal', - value: 0 + value: 0, + icon: 'remove' }, { + id: 3, label: 'Low', - value: -1 + value: -1, + icon: 'expand_more' }] } diff --git a/src/typings/libs/ambient.d.ts b/src/typings/libs/ambient.d.ts new file mode 100644 index 0000000..1b94f64 --- /dev/null +++ b/src/typings/libs/ambient.d.ts @@ -0,0 +1 @@ +declare module 'vuedraggable' diff --git a/src/views/login/signin/signin.ts b/src/views/login/signin/signin.ts index 83ebc50..429bc02 100644 --- a/src/views/login/signin/signin.ts +++ b/src/views/login/signin/signin.ts @@ -12,7 +12,6 @@ import { validationMixin } from 'vuelidate' import { Logo } from '@components' -import './signin.scss' import router from '@router' // import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar' diff --git a/src/views/login/signin/signin.vue b/src/views/login/signin/signin.vue index 37c6700..8a12220 100644 --- a/src/views/login/signin/signin.vue +++ b/src/views/login/signin/signin.vue @@ -60,3 +60,7 @@ + + diff --git a/src/views/login/signup/signup.ts b/src/views/login/signup/signup.ts index 52423ce..407bb21 100644 --- a/src/views/login/signup/signup.ts +++ b/src/views/login/signup/signup.ts @@ -10,8 +10,6 @@ import { validationMixin } from 'vuelidate' import { Logo } from '@components' -import './signup.scss' - // import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar' @Component({ diff --git a/src/views/login/signup/signup.vue b/src/views/login/signup/signup.vue index 5f57917..14bd03e 100644 --- a/src/views/login/signup/signup.vue +++ b/src/views/login/signup/signup.vue @@ -97,3 +97,6 @@ +