updates to match fmg

This commit is contained in:
Bill Richardson 2023-08-08 14:42:01 -04:00
parent 7ed827baeb
commit 2bc4899573
3 changed files with 22 additions and 29 deletions

10
package-lock.json generated
View file

@ -14,7 +14,7 @@
"maska": "^1.5.0",
"pinia": "^2.1.4",
"pinia-plugin-persistedstate": "^2.2.0",
"vee-validate": "^4.7.0",
"vee-validate": "^4.5.7",
"vue": "^3.3.4",
"vue-plugin-load-script": "^2.1.0",
"vue-router": "4.2.4"
@ -17395,11 +17395,11 @@
}
},
"node_modules/vee-validate": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/vee-validate/-/vee-validate-4.7.0.tgz",
"integrity": "sha512-7HW2RE8mWaT57Jn+JU7jwczFqtlc1rIAwSbp8kD1L2sO0plhT9YeDNKW5iaI9baosc4h+iyb6itMlXtqAAqAfw==",
"version": "4.5.7",
"resolved": "https://registry.npmjs.org/vee-validate/-/vee-validate-4.5.7.tgz",
"integrity": "sha512-EcpvOikBP5LlRIKwULfwRDeyIaERuOJztZUPWRmSIeWpeQWD6hs9qQ8A3CmVVteqEohbUM07gV/ea8lPXCfCJQ==",
"dependencies": {
"@vue/devtools-api": "^6.1.4"
"@vue/devtools-api": "^6.0.0-beta.15"
},
"peerDependencies": {
"vue": "^3.0.0"

View file

@ -21,7 +21,7 @@
"maska": "^1.5.0",
"pinia": "^2.1.4",
"pinia-plugin-persistedstate": "^2.2.0",
"vee-validate": "^4.7.0",
"vee-validate": "^4.5.7",
"vue": "^3.3.4",
"vue-plugin-load-script": "^2.1.0",
"vue-router": "4.2.4"

View file

@ -1,7 +1,5 @@
<template>
<div
class="textbox-question"
:class="(errors && errors.length) || hasError ? 'has-error' : ''">
<div class="textbox-question" :class="(errors && errors.length) || hasError ? 'has-error' : ''">
<label
v-if="displayQuestionText"
:for="inputId"
@ -40,15 +38,12 @@
:maxlength="maxLength ? maxLength : '999'"
:data-bs-toggle="includeSelectIcon ? 'modal' : ''"
:data-bs-target="'#' + cmsWidgetName"
@change="validationRules ? handleChange : () => {}"
@blur="validationRules ? handleChange : () => {}"
@change="handleChange"
@blur="handleChange"
@focus="$emit('focus', $event.target.value)"
@paste="trimOnPaste"
@drop="trimOnPaste" />
<button
v-if="includeSearchIcon"
type="submit"
aria-label="Search button" />
<button v-if="includeSearchIcon" type="submit" aria-label="Search button" />
<button
v-if="includeSelectIcon"
type="submit"
@ -56,12 +51,8 @@
:data-bs-target="'#' + cmsWidgetName"
aria-label="Select button" />
</div>
<div
v-show="errorMessage"
class="row my-1 form-test-error">
<span
class="d-inline-flex mt-0"
role="alert">{{ errorMessage }}</span>
<div v-show="errorMessage" class="row my-1 form-test-error">
<span class="d-inline-flex mt-0" role="alert">{{ errorMessage }}</span>
</div>
</div>
</template>
@ -116,12 +107,12 @@ export default {
let initialValue;
switch (typeof modelValue) {
case 'number':
initialValue = modelValue;
break;
default:
initialValue = modelValue && modelValue.length > 0 ? modelValue : '';
break;
case 'number':
initialValue = modelValue;
break;
default:
initialValue = modelValue && modelValue.length > 0 ? modelValue : '';
break;
}
const fieldOptions = {
@ -131,9 +122,11 @@ export default {
};
// eslint-disable-next-line no-shadow
const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField(props.inputId,
const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField(
props.inputId,
props.validationRules,
fieldOptions);
fieldOptions
);
return {
errorMessage,