@afeefa/vue-app 0.0.318 → 0.0.319
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.
- package/.afeefa/package/release/version.txt +1 -1
- package/package.json +1 -1
- package/src/components/ARow.vue +4 -0
- package/src/components/ASearchSelect.vue +4 -4
- package/src/components/ASelect.vue +4 -1
- package/src/components/ATextField.vue +5 -0
- package/src/components/form/fields/FormFieldSearchSelect.vue +3 -4
- package/src/components/list/ListFilterBar.vue +1 -1
- package/src/components/list/ListFilterMixin.js +0 -1
- package/src/components/list/filters/ListFilterSearch.vue +0 -2
- package/src/components/list/filters/ListFilterSearch2.vue +0 -2
- package/src/components/list/filters/ListFilterSearchSelect.vue +3 -5
- package/src/components/mixins/ComponentWidthMixin.js +23 -28
- package/src-admin/components/app/AppBarNavigation.vue +27 -16
- package/src-admin/components/controls/SearchSelectNavigator.vue +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.319
|
package/package.json
CHANGED
package/src/components/ARow.vue
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<div
|
|
30
30
|
v-if="isOpen"
|
|
31
31
|
class="controls"
|
|
32
|
-
:style="
|
|
32
|
+
:style="cwm_popupWidthStyle"
|
|
33
33
|
>
|
|
34
34
|
<div class="background elevation-6" />
|
|
35
35
|
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
:filters.sync="filters"
|
|
75
75
|
:count.sync="count"
|
|
76
76
|
:isLoading.sync="isLoading"
|
|
77
|
-
:style="
|
|
77
|
+
:style="cwm_popupWidthStyle"
|
|
78
78
|
@onLoad="onLoad"
|
|
79
79
|
@enter="selectItem"
|
|
80
80
|
@backtab="setFocusToSearchInput"
|
|
@@ -361,8 +361,8 @@ export default class ASearchSelect extends Mixins(ComponentWidthMixin, UsesPosit
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
|
|
365
|
-
this.
|
|
364
|
+
setPopupWidth (width) {
|
|
365
|
+
this.cwm_popupWidth_ = width
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
searchFilterKeyDown (event) {
|
|
@@ -121,10 +121,13 @@ export default class ASelect extends Mixins(ComponentWidthMixin) {
|
|
|
121
121
|
margin: 0;
|
|
122
122
|
margin-right: .5rem;
|
|
123
123
|
}
|
|
124
|
-
|
|
125
124
|
</style>
|
|
126
125
|
|
|
127
126
|
<style lang="scss" scoped>
|
|
127
|
+
.v-select {
|
|
128
|
+
flex: unset;
|
|
129
|
+
}
|
|
130
|
+
|
|
128
131
|
.v-text-field :deep(.v-input__icon--clear) { // always show clear icon, https://github.com/vuetifyjs/vuetify/pull/15876
|
|
129
132
|
opacity: 1;
|
|
130
133
|
}
|
|
@@ -248,4 +248,9 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
|
|
|
248
248
|
.v-text-field :deep(.v-input__icon--clear) { // always show clear icon, https://github.com/vuetifyjs/vuetify/pull/15876
|
|
249
249
|
opacity: 1;
|
|
250
250
|
}
|
|
251
|
+
|
|
252
|
+
.v-text-field {
|
|
253
|
+
flex: unset;
|
|
254
|
+
max-width: unset;
|
|
255
|
+
}
|
|
251
256
|
</style>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
:listAction="listAction"
|
|
5
5
|
:selectedItems="selectedItems"
|
|
6
6
|
:getSearchInput="() => $refs.searchInput"
|
|
7
|
-
diffXControls="
|
|
8
|
-
diffYControls="
|
|
7
|
+
diffXControls="1rem"
|
|
8
|
+
diffYControls="1rem"
|
|
9
9
|
v-bind="$attrs"
|
|
10
10
|
@select="itemSelected"
|
|
11
11
|
@close="focusInput"
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
ref="searchInput"
|
|
39
39
|
:focus="true"
|
|
40
40
|
tabindex="1"
|
|
41
|
-
maxWidth="100%"
|
|
42
41
|
:label="'Suche ' + label"
|
|
43
42
|
v-on="onSearchInputKey"
|
|
44
43
|
/>
|
|
@@ -116,7 +115,7 @@ export default class FormFieldSearchSelect extends Mixins(FormFieldMixin) {
|
|
|
116
115
|
const input = this.$refs.input?.$el
|
|
117
116
|
if (input) {
|
|
118
117
|
const inputWidth = input.offsetWidth
|
|
119
|
-
this.$refs.select.
|
|
118
|
+
this.$refs.select.setPopupWidth(`calc(${inputWidth}px - 2rem)`)
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
<a-text-field
|
|
4
4
|
ref="input"
|
|
5
5
|
v-model="filter.value"
|
|
6
|
-
:maxWidth="$attrs.maxWidth || maxWidth_"
|
|
7
6
|
:label="label_"
|
|
8
7
|
:debounce="500"
|
|
9
8
|
v-bind="$attrs"
|
|
@@ -52,7 +51,6 @@ import { ListFilterMixin } from '../ListFilterMixin'
|
|
|
52
51
|
@Component
|
|
53
52
|
export default class ListFilterSearch extends Mixins(ListFilterMixin) {
|
|
54
53
|
name_ = 'q'
|
|
55
|
-
maxWidth_ = 200
|
|
56
54
|
|
|
57
55
|
clearValue (e) {
|
|
58
56
|
if (this.filter.value) {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
<a-text-field
|
|
4
4
|
ref="input"
|
|
5
5
|
v-model="filter.value"
|
|
6
|
-
:maxWidth="$attrs.maxWidth || maxWidth_"
|
|
7
6
|
:label="label_"
|
|
8
7
|
:debounce="500"
|
|
9
8
|
v-bind="$attrs"
|
|
@@ -36,7 +35,6 @@ import { ListFilterMixin } from '../ListFilterMixin'
|
|
|
36
35
|
})
|
|
37
36
|
export default class ListFilterSearch2 extends Mixins(ListFilterMixin) {
|
|
38
37
|
name_ = 'q'
|
|
39
|
-
maxWidth_ = 200
|
|
40
38
|
|
|
41
39
|
clearValue (e) {
|
|
42
40
|
if (this.filter.value) {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
:specialItems="specialItems"
|
|
6
6
|
:selectedItems="selectedItems"
|
|
7
7
|
:getSearchInput="() => $refs.searchInput"
|
|
8
|
-
diffXControls="
|
|
9
|
-
diffYControls="
|
|
8
|
+
diffXControls="1rem"
|
|
9
|
+
diffYControls="1rem"
|
|
10
10
|
v-bind="$attrs"
|
|
11
11
|
@select="itemSelected"
|
|
12
12
|
@close="focusInput"
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
:clearable="!!selectedItems.length"
|
|
24
24
|
appendIcon="$dropdown"
|
|
25
25
|
hide-details
|
|
26
|
-
:maxWidth="$attrs.maxWidth"
|
|
27
26
|
@keydown.space.prevent="open"
|
|
28
27
|
@keydown.down.prevent="open"
|
|
29
28
|
@keydown.enter.prevent="open"
|
|
@@ -37,7 +36,6 @@
|
|
|
37
36
|
ref="searchInput"
|
|
38
37
|
:focus="true"
|
|
39
38
|
tabindex="1"
|
|
40
|
-
maxWidth="100%"
|
|
41
39
|
:label="'Suche ' + label"
|
|
42
40
|
v-on="onSearchInputKey"
|
|
43
41
|
/>
|
|
@@ -149,7 +147,7 @@ export default class ListFilterSearchSelect extends Mixins(ListFilterMixin) {
|
|
|
149
147
|
calculateSelectorSize () {
|
|
150
148
|
const input = this.$refs.input.$el
|
|
151
149
|
const inputWidth = input.offsetWidth
|
|
152
|
-
this.$refs.select.
|
|
150
|
+
this.$refs.select.setPopupWidth(`calc(${inputWidth}px - 2rem)`)
|
|
153
151
|
}
|
|
154
152
|
|
|
155
153
|
get selectedItems () {
|
|
@@ -1,53 +1,48 @@
|
|
|
1
1
|
import { Component, Vue } from '@a-vue'
|
|
2
2
|
|
|
3
3
|
@Component({
|
|
4
|
-
props: ['maxWidth', 'width']
|
|
4
|
+
props: ['maxWidth', 'width', 'popupWidth']
|
|
5
5
|
})
|
|
6
6
|
export class ComponentWidthMixin extends Vue {
|
|
7
7
|
cwm_maxWidth_ = null
|
|
8
8
|
cwm_width_ = null
|
|
9
|
+
cwm_popupWidth_ = null
|
|
9
10
|
|
|
10
11
|
get cwm_width () {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (width) {
|
|
14
|
-
if (!isNaN(width)) {
|
|
15
|
-
width = width + 'px'
|
|
16
|
-
}
|
|
17
|
-
return width
|
|
18
|
-
}
|
|
12
|
+
return this.cwm_toPixel_(this.width || this.cwm_width_)
|
|
19
13
|
}
|
|
20
14
|
|
|
21
15
|
get cwm_maxWidth () {
|
|
22
|
-
|
|
16
|
+
return this.cwm_toPixel_(this.maxWidth || this.cwm_maxWidth_)
|
|
17
|
+
}
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
get cwm_widthStyle () {
|
|
20
|
+
return this.cwm_getWidthStyle_(
|
|
21
|
+
this.width || this.cwm_width_,
|
|
22
|
+
this.maxWidth || this.cwm_maxWidth_
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
get cwm_popupWidthStyle () {
|
|
27
|
+
return this.cwm_getWidthStyle_(this.popupWidth || this.cwm_popupWidth_ || this.width || this.cwm_width_)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
cwm_toPixel_ (value) {
|
|
31
|
+
if (value && !isNaN(value)) {
|
|
32
|
+
return value + 'px'
|
|
29
33
|
}
|
|
34
|
+
return value
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
cwm_getWidthStyle_ (width, maxWidth) {
|
|
33
38
|
const styles = []
|
|
34
39
|
|
|
35
|
-
let width = this.width || this.cwm_width_
|
|
36
|
-
|
|
37
40
|
if (width) {
|
|
38
|
-
|
|
39
|
-
width = width + 'px'
|
|
40
|
-
}
|
|
41
|
-
styles.push(`width: ${width};`)
|
|
41
|
+
styles.push(`width: ${this.cwm_toPixel_(width)};`)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
let maxWidth = this.maxWidth || this.cwm_maxWidth_
|
|
45
|
-
|
|
46
44
|
if (maxWidth) {
|
|
47
|
-
|
|
48
|
-
maxWidth = maxWidth + 'px'
|
|
49
|
-
}
|
|
50
|
-
styles.push(`max-width: ${maxWidth};`)
|
|
45
|
+
styles.push(`max-width: ${this.cwm_toPixel_(maxWidth)}; background: yellow`)
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
return styles.join(' ')
|
|
@@ -57,22 +57,33 @@ export default class AppBarNavigation extends Vue {
|
|
|
57
57
|
|
|
58
58
|
initLinks () {
|
|
59
59
|
const sections = document.querySelectorAll('.collapsible-section')
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
label
|
|
73
|
-
slug
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
const seenLabels = new Set()
|
|
61
|
+
|
|
62
|
+
this.links = Array.from(sections)
|
|
63
|
+
.filter(s => { // wenn aus versehen mehrere sections mit gleichem label bestehen, z.b. in popups
|
|
64
|
+
const label = s.getAttribute('label')
|
|
65
|
+
if (seenLabels.has(label)) {
|
|
66
|
+
return false
|
|
67
|
+
}
|
|
68
|
+
seenLabels.add(label)
|
|
69
|
+
return true
|
|
70
|
+
})
|
|
71
|
+
.map(s => {
|
|
72
|
+
const label = s.getAttribute('label')
|
|
73
|
+
const slug = label
|
|
74
|
+
.toLowerCase()
|
|
75
|
+
.replace(/[^\w]+/g, '-') // Sonderzeichen -> Bindestriche
|
|
76
|
+
.replace(/^-+|-+$/g, '') // führende/trailing -
|
|
77
|
+
.substring(0, 50) // Sicherheitslimit
|
|
78
|
+
|
|
79
|
+
s.id = slug
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
id: s.id,
|
|
83
|
+
label,
|
|
84
|
+
slug
|
|
85
|
+
}
|
|
86
|
+
})
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
scrollToSection (id) {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
ref="select"
|
|
4
4
|
:listAction="listAction"
|
|
5
5
|
:getSearchInput="() => $refs.searchInput"
|
|
6
|
-
diffXControls="
|
|
7
|
-
diffYControls="
|
|
6
|
+
diffXControls="1rem"
|
|
7
|
+
diffYControls="1rem"
|
|
8
8
|
v-bind="$attrs"
|
|
9
9
|
@select="itemSelected"
|
|
10
10
|
@close="focusInput"
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
ref="searchInput"
|
|
32
32
|
:focus="true"
|
|
33
33
|
tabindex="1"
|
|
34
|
-
maxWidth="100%"
|
|
35
34
|
:label="'Suche ' + label"
|
|
36
35
|
v-on="onSearchInputKey"
|
|
37
36
|
/>
|
|
@@ -93,7 +92,7 @@ export default class SearchSelectNavigator extends Vue {
|
|
|
93
92
|
calculateSelectorSize () {
|
|
94
93
|
const input = this.$refs.input.$el
|
|
95
94
|
const inputWidth = input.offsetWidth
|
|
96
|
-
this.$refs.select.
|
|
95
|
+
this.$refs.select.setPopupWidth(`calc(${inputWidth}px - 2rem)`)
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
get listAction () {
|