quasar-ui-danx 0.4.59 → 0.4.61
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/dist/danx.es.js +22 -14
- package/dist/danx.es.js.map +1 -1
- package/dist/danx.umd.js +2 -2
- package/dist/danx.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionTable/Form/ActionForm.vue +16 -3
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
</RenderedForm>
|
12
12
|
</template>
|
13
13
|
<script setup lang="ts">
|
14
|
-
import { Ref, ref, watch } from "vue";
|
14
|
+
import { computed, Ref, ref, watch } from "vue";
|
15
15
|
import { ActionTargetItem, AnyObject, Form, ResourceAction } from "../../../types";
|
16
16
|
import RenderedForm from "./RenderedForm.vue";
|
17
17
|
|
@@ -59,8 +59,21 @@ watch(() => props.target, (target: ActionTargetItem) => {
|
|
59
59
|
}
|
60
60
|
});
|
61
61
|
|
62
|
+
const isValid = computed(() => {
|
63
|
+
for (let field of props.form.fields) {
|
64
|
+
const value = input.value[field.name];
|
65
|
+
|
66
|
+
if (field.required && !value && value !== false && value !== 0) {
|
67
|
+
return false;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
return true;
|
71
|
+
});
|
72
|
+
|
62
73
|
async function onUpdate() {
|
63
|
-
|
64
|
-
|
74
|
+
if (isValid.value) {
|
75
|
+
await props.action.trigger(props.target, input.value);
|
76
|
+
emit("saved");
|
77
|
+
}
|
65
78
|
}
|
66
79
|
</script>
|