@afeefa/vue-app 0.0.125 → 0.0.127

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.125
1
+ 0.0.127
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.125",
3
+ "version": "0.0.127",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -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
 
@@ -73,6 +73,8 @@ export default class EditForm extends Vue {
73
73
  * as a date field, which could turn a null to a default date.
74
74
  * Using the created() method would result in already having set
75
75
  * the default date, hence not detecting a valid "change" anymore.
76
+ *
77
+ * comment 14.12. -> this should not be necessary if components do not alter models
76
78
  */
77
79
  // @Watch('modelToEdit', {immediate: true})
78
80
  // @Watch('modelToEdit')
@@ -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
- v-model="inputModel"
17
+ :value="inputModel"
17
18
  readonly
18
19
  :label="label"
19
20
  :rules="validationRules"
20
- placeholder="Mausklick oder Space-Taste zum Auswählen"
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