@afeefa/vue-app 0.0.321 → 0.0.322

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 0.0.321
1
+ 0.0.322
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.321",
3
+ "version": "0.0.322",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -32,24 +32,43 @@
32
32
  v-on="$listeners"
33
33
  @input="columnSelected"
34
34
  />
35
+
36
+ <v-btn
37
+ v-if="drag"
38
+ x-small
39
+ text
40
+ class="mt-2 reset-button"
41
+ @click="resetColumnOrder"
42
+ >
43
+ <v-icon
44
+ small
45
+ class="mr-1"
46
+ >
47
+ {{ mdiRestore }}
48
+ </v-icon>
49
+ Reihenfolge zurücksetzen
50
+ </v-btn>
35
51
  </a-context-menu>
36
52
  </div>
37
53
  </template>
38
54
 
39
55
  <script>
40
56
  import { Component, Vue } from '@a-vue'
41
- import { mdiViewColumn } from '@mdi/js'
57
+ import { mdiRestore, mdiViewColumn } from '@mdi/js'
42
58
 
43
59
  @Component({
44
60
  props: ['columns', 'storageKey', {drag: false}]
45
61
  })
46
62
  export default class ListColumnSelector extends Vue {
47
63
  mdiViewColumn = mdiViewColumn
64
+ mdiRestore = mdiRestore
48
65
 
49
66
  columns_ = {}
67
+ defaultColumns = {}
50
68
  selectedColumns = []
51
69
 
52
70
  created () {
71
+ this.defaultColumns = JSON.parse(JSON.stringify(this.columns))
53
72
  this.loadColumnConfiguration()
54
73
  this.saveColumnConfiguration()
55
74
  }
@@ -72,6 +91,14 @@ export default class ListColumnSelector extends Vue {
72
91
  this.saveColumnConfiguration()
73
92
  }
74
93
 
94
+ resetColumnOrder () {
95
+ this.columns_ = JSON.parse(JSON.stringify(this.defaultColumns))
96
+ this.selectedColumns = Object.keys(this.columns_)
97
+ .filter(k => this.columns_[k].visible)
98
+ this.$emit('update:columns', this.columns_)
99
+ this.saveColumnConfiguration()
100
+ }
101
+
75
102
  columnOrderChanged (options) {
76
103
  const columns = {}
77
104
  for (const option of options) {
@@ -147,4 +174,10 @@ export default class ListColumnSelector extends Vue {
147
174
  color: #666666;
148
175
  }
149
176
  }
177
+
178
+ .reset-button {
179
+ font-size: .75rem;
180
+ text-transform: none;
181
+ letter-spacing: normal;
182
+ }
150
183
  </style>