@afeefa/vue-app 0.0.124 → 0.0.126
Sign up to get free protection for your applications and to get access to all the features.
- package/.afeefa/package/release/version.txt +1 -1
- package/package.json +1 -1
- package/src/components/ASearchSelect.vue +5 -1
- package/src/components/ATableRow.vue +7 -2
- package/src/components/ATextField.vue +2 -1
- package/src/components/form/fields/FormFieldSearchSelect.vue +9 -2
- package/src/components/search-select/SearchSelectList.vue +2 -2
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.126
|
package/package.json
CHANGED
@@ -62,6 +62,7 @@
|
|
62
62
|
:listAction="listAction"
|
63
63
|
:q="q"
|
64
64
|
:selectedItems="selectedItems"
|
65
|
+
:isDisabled="isDisabled"
|
65
66
|
:events="false"
|
66
67
|
:history="false"
|
67
68
|
:filterSource="filterSource"
|
@@ -122,7 +123,10 @@ import { ComponentWidthMixin } from './mixins/ComponentWidthMixin'
|
|
122
123
|
loadOnlyIfKeyword: false,
|
123
124
|
autoOpen: false,
|
124
125
|
closeOnSelect: true,
|
125
|
-
selectedItems: []
|
126
|
+
selectedItems: [],
|
127
|
+
isDisabled: {
|
128
|
+
default: () => () => false
|
129
|
+
}
|
126
130
|
}
|
127
131
|
],
|
128
132
|
components: {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<div
|
3
|
-
:class="['a-table-row', getFontSizeCssClass, {border: hasBorder, selected}]"
|
3
|
+
:class="['a-table-row', getFontSizeCssClass, {border: hasBorder, selected, disabled}]"
|
4
4
|
@click="$emit('click')"
|
5
5
|
>
|
6
6
|
<slot />
|
@@ -12,7 +12,7 @@
|
|
12
12
|
import { Component, Vue } from '@a-vue'
|
13
13
|
|
14
14
|
@Component({
|
15
|
-
props: ['small', 'selected']
|
15
|
+
props: ['small', 'selected', 'disabled']
|
16
16
|
})
|
17
17
|
export default class ATableRow extends Vue {
|
18
18
|
$hasOptions = ['border']
|
@@ -73,6 +73,11 @@ export default class ATableRow extends Vue {
|
|
73
73
|
background: #F4F4F4;
|
74
74
|
}
|
75
75
|
|
76
|
+
&.disabled {
|
77
|
+
pointer-events: none;
|
78
|
+
opacity: .5;
|
79
|
+
}
|
80
|
+
|
76
81
|
&.active {
|
77
82
|
background: #EEEEFF;
|
78
83
|
}
|
@@ -81,6 +81,7 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
|
|
81
81
|
this.setInternalValue('')
|
82
82
|
this.$emit('input', this.emptyValue)
|
83
83
|
this.validate()
|
84
|
+
this.$emit('clear')
|
84
85
|
}
|
85
86
|
}
|
86
87
|
|
@@ -118,7 +119,7 @@ export default class ATextField extends Mixins(ComponentWidthMixin) {
|
|
118
119
|
if (!value) {
|
119
120
|
value = null
|
120
121
|
} else {
|
121
|
-
value = this.internalValue.match(
|
122
|
+
value = this.internalValue.match(/^-?\d*(\.\d+)?$/) ? parseFloat(this.internalValue) : NaN
|
122
123
|
}
|
123
124
|
}
|
124
125
|
return value
|
@@ -6,6 +6,7 @@
|
|
6
6
|
:getSearchInput="() => $refs.searchInput"
|
7
7
|
diffXControls="-.5rem"
|
8
8
|
diffYControls="-.5rem"
|
9
|
+
v-bind="$attrs"
|
9
10
|
@select="itemSelected"
|
10
11
|
@close="focusInput"
|
11
12
|
@beforeOpen="calculateSelectorSize"
|
@@ -13,14 +14,16 @@
|
|
13
14
|
<template #activator="{open}">
|
14
15
|
<a-text-field
|
15
16
|
ref="input"
|
16
|
-
|
17
|
+
:value="inputModel"
|
17
18
|
readonly
|
18
19
|
:label="label"
|
19
20
|
:rules="validationRules"
|
20
|
-
placeholder="Mausklick oder Space
|
21
|
+
placeholder="Mausklick oder Space/↓-Taste zum Auswählen"
|
22
|
+
:clearable="!!selectedItems.length"
|
21
23
|
@keydown.space.prevent="open"
|
22
24
|
@keydown.down.prevent="open"
|
23
25
|
@keydown.enter.prevent="open"
|
26
|
+
@clear="clear"
|
24
27
|
/>
|
25
28
|
</template>
|
26
29
|
|
@@ -102,6 +105,10 @@ export default class FormFieldSearchSelect extends Mixins(FormFieldMixin) {
|
|
102
105
|
focusInput () {
|
103
106
|
this.$refs.input.setFocus(true)
|
104
107
|
}
|
108
|
+
|
109
|
+
clear () {
|
110
|
+
this.itemSelected(null)
|
111
|
+
}
|
105
112
|
}
|
106
113
|
</script>
|
107
114
|
|
@@ -22,7 +22,7 @@
|
|
22
22
|
v-for="(model, index) in models_"
|
23
23
|
:key="model.id"
|
24
24
|
small
|
25
|
-
:class="['row-' + index, {selected: isSelected(model), active: activeModelIndex === index}]"
|
25
|
+
:class="['row-' + index, {selected: isSelected(model), disabled: isDisabled(model), active: activeModelIndex === index}]"
|
26
26
|
>
|
27
27
|
<slot
|
28
28
|
name="row"
|
@@ -52,7 +52,7 @@ import { Component, Mixins } from '@a-vue'
|
|
52
52
|
import { ListViewMixin } from '@a-vue/components/list/ListViewMixin'
|
53
53
|
|
54
54
|
@Component({
|
55
|
-
props: ['q', 'selectedItems']
|
55
|
+
props: ['q', 'selectedItems', 'isDisabled']
|
56
56
|
})
|
57
57
|
export default class SearchSelectList extends Mixins(ListViewMixin) {
|
58
58
|
activeModelIndex = -1
|