@afeefa/vue-app 0.0.302 → 0.0.304

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.302
1
+ 0.0.304
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.302",
3
+ "version": "0.0.304",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -94,6 +94,7 @@ export default class ARadioGroup extends Vue {
94
94
  <style lang="scss" scoped>
95
95
  .v-input {
96
96
  margin: 0;
97
+ padding: 0;
97
98
 
98
99
  &.alignTop .v-radio {
99
100
  align-items: flex-start;
@@ -1,56 +1,106 @@
1
1
  <template>
2
2
  <div class="listFilterBar">
3
3
  <a-row>
4
- <list-filter-search2
5
- label="Suche"
6
- maxWidth="220"
7
- focus
8
- :translateOption="title => {
9
- return title
10
- .replace('Sprint', $t('SPRINT'))
11
- .replace('Kunde', $t('KUNDE'))
12
- }"
13
- />
14
-
15
- <div
4
+ <v-btn
16
5
  class="filterToggle"
17
6
  @click="collapsed = !collapsed"
18
7
  >
19
8
  <a-row>
20
- <v-icon
21
- class="mr-2"
22
- color="#CCCCCC"
23
- >
9
+ <v-icon color="#BBBBBB">
24
10
  $filterIcon
25
11
  </v-icon>
26
12
 
27
- <div>Filter {{ countSelectedFilters }}/{{ countFilters }}</div>
13
+ <div>{{ countSelectedFilters }}/{{ countFilters }}</div>
28
14
 
29
15
  <v-icon
30
- class="contextButton"
16
+ class="contextButton ml-n1"
31
17
  size="2rem"
32
18
  >
33
19
  {{ collapsed ? '$caretRightIcon' : '$caretDownIcon' }}
34
20
  </v-icon>
35
21
  </a-row>
36
- </div>
22
+ </v-btn>
23
+
24
+ <list-filter-search2
25
+ label="Suche"
26
+ maxWidth="220"
27
+ focus
28
+ :translateOption="title => {
29
+ return title
30
+ .replace('Sprint', $t('SPRINT'))
31
+ .replace('Kunde', $t('KUNDE'))
32
+ }"
33
+ />
37
34
  </a-row>
38
35
 
39
36
  <collapse-transition>
40
37
  <div
41
38
  v-show="!collapsed"
42
- class="content"
39
+ class="mt-4"
43
40
  >
44
- <a-grid
45
- ref="filterGrid"
46
- gap="3"
47
- cols="3"
48
- even
49
- class="mt-4 pa-4"
41
+ <a-row
42
+ v-if="hasShortcuts"
43
+ gap="1"
44
+ class="shortcuts mb-2"
45
+ >
46
+ <slot name="shortcuts" />
47
+ </a-row>
48
+
49
+ <div
50
50
  style="background: #F4F4F4;"
51
+ class="pa-4"
51
52
  >
52
- <slot />
53
- </a-grid>
53
+ <a-grid
54
+ ref="filterGrid"
55
+ gap="3"
56
+ cols="3"
57
+ even
58
+ >
59
+ <slot />
60
+ </a-grid>
61
+
62
+ <a-row
63
+ gap="6"
64
+ class="mt-3"
65
+ >
66
+ <list-filter-page :has="{page: false}" />
67
+
68
+ <a-radio-group
69
+ v-model="dragMode"
70
+ row
71
+ hide-details
72
+ @input="updateList"
73
+ >
74
+ <template #default>
75
+ <v-radio value="grab">
76
+ <template #label>
77
+ <a-icon
78
+ :icon="{icon: grabIcon}"
79
+ class="ml-n1 mr-1"
80
+ /> Liste verschieben
81
+ </template>
82
+ </v-radio>
83
+ <v-radio value="select">
84
+ <template #label>
85
+ <a-icon
86
+ :icon="{icon: selectIcon}"
87
+ class="ml-n1 mr-1"
88
+ /> Text auswählen
89
+ </template>
90
+ </v-radio>
91
+ </template>
92
+ </a-radio-group>
93
+
94
+ <v-btn
95
+ v-if="countSelectedFilters"
96
+ small
97
+ class="ml-n4"
98
+ @click="resetFilters"
99
+ >
100
+ Alles zurücksetzen
101
+ </v-btn>
102
+ </a-row>
103
+ </div>
54
104
  </div>
55
105
  </collapse-transition>
56
106
 
@@ -70,7 +120,7 @@
70
120
  </v-chip>
71
121
  </div>
72
122
 
73
- <list-filter-page />
123
+ <list-filter-page :has="{page_size: false}" />
74
124
  </div>
75
125
  </template>
76
126
 
@@ -78,12 +128,17 @@
78
128
  <script>
79
129
  import { Component, Vue } from '@a-vue'
80
130
  import { ListFilterEvent } from '@a-vue/events'
131
+ import { mdiTextRecognition, mdiHandBackRight } from '@mdi/js'
81
132
 
82
133
  @Component
83
134
  export default class ListFilterBar extends Vue {
84
135
  collapsed = true
85
136
  selectedFilters = []
86
137
 
138
+ grabIcon = mdiHandBackRight
139
+ selectIcon = mdiTextRecognition
140
+ dragMode = 'grab'
141
+
87
142
  created () {
88
143
  this.$events.on(ListFilterEvent.CHANGE, this.listFilterChanged)
89
144
  }
@@ -112,7 +167,7 @@ export default class ListFilterBar extends Vue {
112
167
  }
113
168
 
114
169
  get countSelectedFilters () {
115
- const coreFilters = ['q', 'qfield', 'page', 'page_size']
170
+ const coreFilters = ['q', 'qfield', 'page']
116
171
  let minus = 0
117
172
  for (const name of coreFilters) {
118
173
  if (!this.filters[name].hasDefaultValueSet()) {
@@ -145,20 +200,36 @@ export default class ListFilterBar extends Vue {
145
200
  }
146
201
  }
147
202
 
203
+ resetFilters () {
204
+ this.listView.resetFilters()
205
+ }
206
+
148
207
  resetFilter (name) {
149
208
  this.listView.resetFilter(name)
150
209
  this.setSelectedFilter(name, null, null)
151
210
  }
211
+
212
+ get hasShortcuts () {
213
+ return this.$slots.shortcuts && !!this.$slots.shortcuts.length
214
+ }
215
+
216
+ updateList () {
217
+ this.listView.setDragMode(this.dragMode)
218
+ }
152
219
  }
153
220
  </script>
154
221
 
155
222
 
156
223
  <style lang="scss" scoped>
157
224
  .filterToggle {
158
- cursor: pointer;
159
- background: #F4F4F4;
160
- padding: 0 4px;
161
- margin-left: .5rem;
225
+ padding: 0 0 0 5px !important;
226
+ margin-right: 10px;
227
+ height: 2.5rem !important;
228
+
229
+ div {
230
+ font-size: .8rem;
231
+ color: #666666;
232
+ }
162
233
  }
163
234
 
164
235
  .chip-container {
@@ -170,9 +241,4 @@ export default class ListFilterBar extends Vue {
170
241
  ::v-deep(.aPagination) {
171
242
  margin-top: 14px;
172
243
  }
173
-
174
- ::v-deep(.pageSizeSelect) {
175
- margin-top: 15px;
176
- }
177
-
178
244
  </style>
@@ -84,9 +84,12 @@ export default class ListFilterSearch2 extends Mixins(ListFilterMixin) {
84
84
  max-width: unset;
85
85
  }
86
86
 
87
+ .v-input--radio-group__input {
88
+ gap: 8px;
89
+ }
90
+
87
91
  .v-radio {
88
- margin-right: 14px !important;
89
- margin-top: -4px;
92
+ margin-right: 6px !important;
90
93
  }
91
94
 
92
95
  .v-input--selection-controls__input {
@@ -7,6 +7,7 @@ import { eventBusPlugin } from '@a-vue/plugins/event-bus/EventBusPlugin'
7
7
  import { hasOptionsPlugin } from '@a-vue/plugins/has-options/HasOptionsPlugin'
8
8
  import { timeout } from '@a-vue/utils/timeout'
9
9
  import Vue from 'vue'
10
+ import VueShortKey from 'vue-shortkey'
10
11
 
11
12
  import { adminConfig } from './config/AdminConfig'
12
13
  import routeConfigPlugin from './config/routing'
@@ -100,6 +101,7 @@ export class AfeefaAdmin {
100
101
  // plugins
101
102
  Vue.use(hasOptionsPlugin)
102
103
  Vue.use(eventBusPlugin)
104
+ Vue.use(VueShortKey)
103
105
 
104
106
  // load auth resources
105
107
  if (this._authService) {
@@ -6,7 +6,29 @@
6
6
  @click="closeFloatingSidebars"
7
7
  />
8
8
 
9
- <div class="main-layout">
9
+ <v-overlay
10
+ v-if="HelpPage && shortcutInfoVisible"
11
+ :opacity=".8"
12
+ fixed
13
+ @click="shortcutInfoVisible = false"
14
+ >
15
+ <component
16
+ :is="HelpPage"
17
+ v-if="HelpPage"
18
+ v-shortkey="['esc']"
19
+ @shortkey.native="shortcutInfoVisible = false"
20
+ @close="shortcutInfoVisible = false"
21
+ />
22
+ </v-overlay>
23
+
24
+ <div
25
+ v-shortkey="{
26
+ help: ['ctrl', 'space'],
27
+ zen: ['ctrl', 'shift', 'z']
28
+ }"
29
+ class="main-layout"
30
+ @shortkey="handleShortkey"
31
+ >
10
32
  <navigation-bar
11
33
  :has="$has"
12
34
  :class="{showDevSkin}"
@@ -88,6 +110,9 @@ export default class App extends Vue {
88
110
  sidebarsFloating = false
89
111
  hasFloatingInformationBar = false
90
112
 
113
+ shortcutInfoVisible = false
114
+ HelpPage = adminConfig.app.components.HelpPage || null
115
+
91
116
  autoLogoutChannel = new BroadcastChannel('auth.autologout')
92
117
  autoLogoutStartSeconds = 0
93
118
  autoLogoutStartRemainingSeconds = 0
@@ -135,6 +160,14 @@ export default class App extends Vue {
135
160
  this.$emit('appLoaded')
136
161
  }
137
162
 
163
+ handleShortkey (event) {
164
+ if (event.srcKey === 'help') {
165
+ this.shortcutInfoVisible = !this.shortcutInfoVisible
166
+ } else {
167
+ sidebarService.toggleAll()
168
+ }
169
+ }
170
+
138
171
  get autoLogoutMessage () {
139
172
  return `Sie werden in ${this.autoLogoutRemainingSeconds} Sekunden abgemeldet.`
140
173
  }
@@ -391,7 +391,7 @@ export default class ListView extends Mixins(ListViewMixin) {
391
391
 
392
392
  .filters:not(:empty) {
393
393
  margin-left: 4px;
394
- margin-bottom: 2rem;
394
+ margin-bottom: 1rem;
395
395
  }
396
396
 
397
397
  filters-below:not(:empty) {
@@ -87,6 +87,19 @@ class SidebarService {
87
87
  this.setRailInformation(true)
88
88
  }
89
89
 
90
+ toggleAll () {
91
+ const visible = !this.navigation
92
+ this.setNavigation(visible)
93
+
94
+ if (this.information) {
95
+ if (this.mobile) {
96
+ this.setRailInformation(true)
97
+ } else {
98
+ this.setRailInformation(!visible)
99
+ }
100
+ }
101
+ }
102
+
90
103
  get hasFloatingOverlay () {
91
104
  if (!this.mobile) {
92
105
  return false
@@ -12,7 +12,8 @@ class AdminConfig {
12
12
 
13
13
  components: {
14
14
  Splash: null,
15
- SidebarMenu: null
15
+ SidebarMenu: null,
16
+ HelpPage: null
16
17
  },
17
18
 
18
19
  icons: {},
@@ -115,3 +115,13 @@ html {
115
115
  row-gap: 4px * $i;
116
116
  }
117
117
  }
118
+
119
+ @media print {
120
+ #navigation-bar {
121
+ display: none !important;
122
+ }
123
+
124
+ #information-bar {
125
+ display: none;
126
+ }
127
+ }