@afeefa/vue-app 0.0.95 → 0.0.97
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/api-resources/ApiAction.js +5 -0
- package/src/components/ADatePicker.vue +9 -4
- package/src/components/form/EditForm.vue +5 -0
- package/src/components/form/FormFieldMixin.js +1 -3
- package/src/components/form/fields/FormFieldDate.vue +5 -0
- package/src/components/form/fields/FormFieldText.vue +1 -0
- package/src-admin/components/FlyingContextContainer.vue +2 -0
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.97
|
package/package.json
CHANGED
@@ -16,6 +16,11 @@ export class ApiAction extends ApiResourcesApiAction {
|
|
16
16
|
return this
|
17
17
|
}
|
18
18
|
|
19
|
+
minDuration (duration) {
|
20
|
+
this._minDuration = duration
|
21
|
+
return this
|
22
|
+
}
|
23
|
+
|
19
24
|
dispatchGlobalLoadingEvents (dispatch = true) {
|
20
25
|
this._dispatchGlobalLoadingEvents = dispatch
|
21
26
|
return this
|
@@ -58,10 +58,7 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin) {
|
|
58
58
|
}
|
59
59
|
|
60
60
|
mounted () {
|
61
|
-
|
62
|
-
this.$refs.input.validate(true)
|
63
|
-
}
|
64
|
-
this.$refs.input.validate(true)
|
61
|
+
this.validate()
|
65
62
|
}
|
66
63
|
|
67
64
|
@Watch('value')
|
@@ -71,6 +68,10 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin) {
|
|
71
68
|
|
72
69
|
@Watch('value_')
|
73
70
|
value_Changed () { // validate on any change
|
71
|
+
this.validateDateValue()
|
72
|
+
}
|
73
|
+
|
74
|
+
validateDateValue () {
|
74
75
|
this.errorMessages = []
|
75
76
|
if (this.validator) {
|
76
77
|
const rules = this.validator.getRules(this.label)
|
@@ -130,6 +131,10 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin) {
|
|
130
131
|
return formatDate(new Date(date))
|
131
132
|
}
|
132
133
|
|
134
|
+
validate () {
|
135
|
+
this.validateDateValue()
|
136
|
+
}
|
137
|
+
|
133
138
|
get validationRules () {
|
134
139
|
if (this.type !== 'month') {
|
135
140
|
const dateFormat = v => {
|
@@ -32,10 +32,15 @@ export default class EditForm extends Vue {
|
|
32
32
|
lastJson = null
|
33
33
|
forcedUnchange = false
|
34
34
|
|
35
|
+
|
35
36
|
created () {
|
36
37
|
this.reset()
|
37
38
|
}
|
38
39
|
|
40
|
+
validate () {
|
41
|
+
this.$refs.form.validate()
|
42
|
+
}
|
43
|
+
|
39
44
|
getField = name => {
|
40
45
|
const modelType = this.$apiResources.getType(this.model.type)
|
41
46
|
const update = !!this.model.id
|
@@ -100,9 +100,7 @@ export class FormFieldMixin extends Vue {
|
|
100
100
|
get validator () {
|
101
101
|
const validator = this.field.getValidator()
|
102
102
|
if (this.additionalRules) {
|
103
|
-
this.additionalRules
|
104
|
-
validator.addRule(validate)
|
105
|
-
})
|
103
|
+
validator.setAdditionalRules(this.additionalRules)
|
106
104
|
}
|
107
105
|
return this.field.getValidator()
|
108
106
|
}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
<template>
|
2
2
|
<a-date-picker
|
3
|
+
ref="datePicker"
|
3
4
|
v-model="model[name]"
|
4
5
|
:label="label || name"
|
5
6
|
:validator="validator"
|
6
7
|
v-bind="$attrs"
|
8
|
+
v-on="$listeners"
|
7
9
|
/>
|
8
10
|
</template>
|
9
11
|
|
@@ -13,5 +15,8 @@ import { FormFieldMixin } from '../FormFieldMixin'
|
|
13
15
|
|
14
16
|
@Component
|
15
17
|
export default class FormFieldDate extends Mixins(FormFieldMixin) {
|
18
|
+
validate () {
|
19
|
+
this.$refs.datePicker.validate()
|
20
|
+
}
|
16
21
|
}
|
17
22
|
</script>
|