From 1304878a707651319d3df05ed06a26c1e4420470 Mon Sep 17 00:00:00 2001 From: Andy Bunce Date: Thu, 14 Jan 2021 23:24:01 +0000 Subject: [PATCH] [add] components --- doc/data.md | 7 + src/vue-poc/app.vue | 30 ++- src/vue-poc/components/vis-time-line.vue | 4 +- src/vue-poc/components/vue-ace.vue | 17 +- .../data/vue-poc/entities/basex/database.xml | 2 +- .../data/vue-poc/entities/basex/user.xml | 2 +- .../data/vue-poc/entities/dice/entity.xml | 5 +- .../data/vue-poc/entities/quodatum/cmpx.xml | 24 +++ .../features/collection/components.vue | 34 ++++ src/vue-poc/features/edit/tabs.vue | 3 +- src/vue-poc/features/eval/eval.vue | 16 +- src/vue-poc/features/history/taskhistory.vue | 2 +- src/vue-poc/features/model/entity.vue | 32 ++-- src/vue-poc/models.gen.xqm | 41 +++- src/vue-poc/router.js | 55 +++--- src/vue-poc/static/app-gen.js | 179 ++++++++++++------ 16 files changed, 340 insertions(+), 113 deletions(-) create mode 100644 src/vue-poc/data/vue-poc/entities/quodatum/cmpx.xml create mode 100644 src/vue-poc/features/collection/components.vue diff --git a/doc/data.md b/doc/data.md index 53fb2f5..2b37831 100644 --- a/doc/data.md +++ b/doc/data.md @@ -1,3 +1,10 @@ +# Data storage +`core.js` defines settings ## Vuex state.js + +## Localforage +localforage.config({ + name: 'vuepoc' +}); diff --git a/src/vue-poc/app.vue b/src/vue-poc/app.vue index d76d347..b0207f3 100644 --- a/src/vue-poc/app.vue +++ b/src/vue-poc/app.vue @@ -39,7 +39,7 @@ - @@ -104,7 +104,7 @@ - + @@ -115,7 +115,19 @@ - + + keyboard_arrow_up + @@ -134,6 +146,7 @@ drawer: true, showNotifications: false, mini: false, + fab: false, alert: {show:false,msg:"Hello"}, frmfav: false, @@ -167,6 +180,7 @@ children: [ {href: '/database', text: 'Databases',icon: 'developer_mode' }, {href: '/files', text: 'File system',icon: 'folder' }, + {href: '/components', text: 'Component library',icon: 'engineering' }, {href: '/documentation', text: 'Documentation',icon: 'library_books' }, {href: '/history/files',text: 'history',icon: 'history'} ]}, @@ -270,7 +284,15 @@ showAlert(msg){ this.alert.msg=format(new Date())+" "+ msg this.alert.show=true - } + }, + onScroll (e) { + if (typeof window === 'undefined') return + const top = window.pageYOffset || e.target.scrollTop || 0 + this.fab = top > 20 + }, + toTop () { + this.$vuetify.goTo(0) + } }, watch: { showNotifications: function (val) { diff --git a/src/vue-poc/components/vis-time-line.vue b/src/vue-poc/components/vis-time-line.vue index f7c4432..94af1de 100644 --- a/src/vue-poc/components/vis-time-line.vue +++ b/src/vue-poc/components/vis-time-line.vue @@ -10,6 +10,7 @@ for vis-time-line http://visjs.org/docs/graph2d/ data(){ return {timeline:Object} }, + methods:{ select(properties){ this.$emit('select',properties.items); @@ -21,6 +22,7 @@ for vis-time-line http://visjs.org/docs/graph2d/ this.timeline.fit(true) } }, + watch:{ items(newItems){ console.log("vis-time-line: new items:" + newItems.length) @@ -30,8 +32,8 @@ for vis-time-line http://visjs.org/docs/graph2d/ console.log("opts: ",newOpts) } }, + mounted: function () { - var options = this.options; var groups = this.groups; var items = new vis.DataSet(this.items); diff --git a/src/vue-poc/components/vue-ace.vue b/src/vue-poc/components/vue-ace.vue index e53561e..ab51e93 100644 --- a/src/vue-poc/components/vue-ace.vue +++ b/src/vue-poc/components/vue-ace.vue @@ -17,7 +17,8 @@ event fired cmd outline 'settings', 'minLines', 'completer', - 'snippets' + 'snippets', + 'placeholder' ], data () { return { @@ -28,9 +29,9 @@ event fired cmd outline themeDark: "chaos", keybinding: "ace", fontsize: 16, - enableSnippets:true, - enableBasicAutocompletion:true, - enableLiveAutocompletion:true + enableSnippets: true, + enableBasicAutocompletion: true, + enableLiveAutocompletion: true }, annots:{ @@ -98,10 +99,10 @@ event fired cmd outline }, applySettings(aceSettings){ - var theme=this.$vuetify.theme.dark?aceSettings.themeDark:aceSettings.theme; - this.editor.setTheme(`ace/theme/${theme}`) + this.editor.setTheme() //this.editor.setKeyboardHandler(`ace/keyboard//${aceSettings.keybinding}`) this.editor.setFontSize(parseInt(aceSettings.fontsize,10)) + this.editor.setOption("placeholder", this.placeholder) this.editor.setOptions({ enableSnippets : aceSettings.enableSnippets, enableBasicAutocompletion : aceSettings.enableBasicAutocompletion, @@ -110,6 +111,7 @@ event fired cmd outline useSoftTabs: true }); } + }, @@ -167,6 +169,9 @@ event fired cmd outline this.$emit('token', token); }); + //this.editor.on("input", this.update); + //setTimeout(this.update, 100); + if(this.events){ this.events.$on('eventFired', (cmd) => { if(cmd=="outline"){ diff --git a/src/vue-poc/data/vue-poc/entities/basex/database.xml b/src/vue-poc/data/vue-poc/entities/basex/database.xml index 9cd84ed..ca6bae5 100644 --- a/src/vue-poc/data/vue-poc/entities/basex/database.xml +++ b/src/vue-poc/data/vue-poc/entities/basex/database.xml @@ -1,5 +1,5 @@ - BaseX databases + A BaseX database of the running server. From db:list() diff --git a/src/vue-poc/data/vue-poc/entities/basex/user.xml b/src/vue-poc/data/vue-poc/entities/basex/user.xml index ba5bf95..8369d8d 100644 --- a/src/vue-poc/data/vue-poc/entities/basex/user.xml +++ b/src/vue-poc/data/vue-poc/entities/basex/user.xml @@ -1,5 +1,5 @@ - BaseX users + BaseX user listed on the running server. diff --git a/src/vue-poc/data/vue-poc/entities/dice/entity.xml b/src/vue-poc/data/vue-poc/entities/dice/entity.xml index 5cf9221..42df902 100644 --- a/src/vue-poc/data/vue-poc/entities/dice/entity.xml +++ b/src/vue-poc/data/vue-poc/entities/dice/entity.xml @@ -1,11 +1,12 @@ - List of Entities i.e. things described in this framework + List of Entities i.e. things described in this framework. + The name may be dot delimited to indicate the package structure. - name + Unique name of the entitty e.g."dice.entity" @name diff --git a/src/vue-poc/data/vue-poc/entities/quodatum/cmpx.xml b/src/vue-poc/data/vue-poc/entities/quodatum/cmpx.xml new file mode 100644 index 0000000..677fb81 --- /dev/null +++ b/src/vue-poc/data/vue-poc/entities/quodatum/cmpx.xml @@ -0,0 +1,24 @@ + + Cmpx library components + + + + name of component + @name + + + browser or ?? + cmpx:type + + + url for component + cmpx:home + + + description of component + cmpx:description + + + + collection('~qd-cmpx')/cmpx:cmp + \ No newline at end of file diff --git a/src/vue-poc/features/collection/components.vue b/src/vue-poc/features/collection/components.vue new file mode 100644 index 0000000..daf5757 --- /dev/null +++ b/src/vue-poc/features/collection/components.vue @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/src/vue-poc/features/edit/tabs.vue b/src/vue-poc/features/edit/tabs.vue index d38e01d..07c0592 100644 --- a/src/vue-poc/features/edit/tabs.vue +++ b/src/vue-poc/features/edit/tabs.vue @@ -157,7 +157,8 @@
+ :mode="item.mode" :wrap="wrap" :settings="aceSettings" v-on:annotation="annotation" + placeholder="Type..">
diff --git a/src/vue-poc/features/eval/eval.vue b/src/vue-poc/features/eval/eval.vue index 6bea75e..b9dd4a0 100644 --- a/src/vue-poc/features/eval/eval.vue +++ b/src/vue-poc/features/eval/eval.vue @@ -63,7 +63,7 @@ @@ -74,7 +74,8 @@ - @@ -90,7 +91,7 @@ data: function(){ return { - xq: '(: type your XQuery :)\n', + xq: null, result: '', done: false, elapsed: null, @@ -212,6 +213,7 @@ }, computed: { }, + beforeRouteEnter (to, from, next) { Settings.getItem('settings/ace') .then( v =>{ @@ -221,9 +223,15 @@ vm.aceSettings = v; })}) }, + + beforeRouteLeave (to, from, next) { + localforage.setItem('eval/xq',this.xq); + next() + }, + created:function(){ console.log("eval: creatd"); - localforage.getItem('eval/xq').then((value) => { this.xq=value || this.xq}); + localforage.getItem('eval/xq').then((value) => { this.xq= value || this.xq}); }, beforeDestroy:function(){ this.destroyed=true; diff --git a/src/vue-poc/features/history/taskhistory.vue b/src/vue-poc/features/history/taskhistory.vue index c1bd608..019b37b 100644 --- a/src/vue-poc/features/history/taskhistory.vue +++ b/src/vue-poc/features/history/taskhistory.vue @@ -64,8 +64,8 @@ q: null, headers: [ { text: 'Id', value: 'id' }, - { text: 'Task', value: 'task' }, { text: 'Created', value: 'created' }, + { text: 'Task', value: 'task' }, { text: 'Summary', value: 'summary' }, { text: 'Params', value: 'arity' } ] diff --git a/src/vue-poc/features/model/entity.vue b/src/vue-poc/features/model/entity.vue index ea6f3cf..a28e0ed 100644 --- a/src/vue-poc/features/model/entity.vue +++ b/src/vue-poc/features/model/entity.vue @@ -36,28 +36,30 @@