@afeefa/vue-app 0.0.209 → 0.0.211

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.209
1
+ 0.0.211
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.209",
3
+ "version": "0.0.211",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -40,7 +40,8 @@
40
40
  </v-btn>
41
41
 
42
42
  <edit-form-buttons
43
- :changed="changed || _changed"
43
+ :changed="changed"
44
+ :forceActive="forceActive"
44
45
  :valid="validFromOutside && valid"
45
46
  angular
46
47
  :has="{reset: reset && !!modelToEdit.id}"
@@ -61,15 +62,11 @@ import { Component, Vue, Watch } from '@a-vue'
61
62
  import { DialogEvent } from '@a-vue/events'
62
63
 
63
64
  @Component({
64
- props: ['model', 'createModelToEdit', 'show', {reset: true, valid: true, changed: false}]
65
+ props: ['model', 'createModelToEdit', 'show', {reset: true, valid: true, forceActive: false}]
65
66
  })
66
67
  export default class EditModal extends Vue {
67
68
  show_ = false
68
69
 
69
- get _changed () {
70
- return this.changed
71
- }
72
-
73
70
  created () {
74
71
  if (!this.model && !this.createModelToEdit) {
75
72
  console.warn('You need to pass either a model or a model factory to <edit-modal>.')
@@ -117,7 +114,7 @@ export default class EditModal extends Vue {
117
114
 
118
115
  async beforeClose () {
119
116
  // run only if show_ is true to prevent double checks with a-modal
120
- if (this.show_ && this.$refs.form.changed) {
117
+ if (this.show_ && (this.$refs.form.changed)) {
121
118
  const result = await this.$events.dispatch(new DialogEvent(DialogEvent.SHOW, {
122
119
  title: 'Änderungen verwerfen?',
123
120
  message: 'Im Formular sind nicht gespeicherte Änderungen. Sollen diese verworfen werden?',
@@ -64,7 +64,7 @@ import { mdiRotateLeft} from '@mdi/js'
64
64
  props: [
65
65
  'changed',
66
66
  'valid',
67
- {angular: false, small: false}
67
+ {angular: false, small: false, forceActive: false}
68
68
  ]
69
69
  })
70
70
  export default class EditFormButtons extends Vue {
@@ -73,7 +73,19 @@ export default class EditFormButtons extends Vue {
73
73
  undoIcon = mdiRotateLeft
74
74
 
75
75
  get disabled () {
76
- return (this.$has.reset && !this.changed) || !this.valid
76
+ if (!this.valid) {
77
+ return true
78
+ }
79
+
80
+ if (this.forceActive) {
81
+ return false
82
+ }
83
+
84
+ if (this.$has.reset) {
85
+ return !this.changed
86
+ }
87
+
88
+ return false
77
89
  }
78
90
  }
79
91
  </script>