@infermedica/component-library
Advanced tools
Comparing version 1.6.4 to 1.6.5
{ | ||
"name": "@infermedica/component-library", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"description": "Vue 3 UI library for healthcare and not only.", | ||
@@ -118,2 +118,2 @@ "license": "MIT", | ||
} | ||
} | ||
} |
@@ -9,5 +9,7 @@ import UiMultipleChoices from '@/components/organisms/UiMultipleChoices/UiMultipleChoices.vue'; | ||
computed, | ||
nextTick, | ||
} from 'vue'; | ||
import { actions } from '@storybook/addon-actions'; | ||
import { modifiers } from '@sb/helpers/argTypes'; | ||
import focusOnInvalidChoice from '@/utilities/helpers/focus-on-first-invalid-choice'; | ||
@@ -129,2 +131,16 @@ const events = actions({ | ||
const invalid = ref(args.initInvalid); | ||
const invalidChoices = ref(null); | ||
const handleSubmit = async () => { | ||
await focusOnInvalidChoice(invalidChoices); | ||
const { focusInvalidInput } = focusOnInvalidChoice(invalidChoices); | ||
// Note: Two nextTick functions are required to focus on the first invalid input after page load. | ||
await nextTick(); | ||
await nextTick(); | ||
focusInvalidInput(); | ||
}; | ||
handleSubmit(); | ||
return { | ||
@@ -135,5 +151,7 @@ ...args, | ||
invalid, | ||
invalidChoices, | ||
}; | ||
}, | ||
template: `<UiMultipleChoices | ||
ref="invalidChoices" | ||
v-model="modelValue" | ||
@@ -160,2 +178,15 @@ v-model:invalid="invalid" | ||
const invalid = ref(args.initInvalid); | ||
const invalidChoices = ref(null); | ||
const handleSubmit = async () => { | ||
const { focusInvalidInput } = focusOnInvalidChoice(invalidChoices); | ||
// Note: Two nextTick functions are required to focus on the first invalid input after page load. | ||
await nextTick(); | ||
await nextTick(); | ||
focusInvalidInput(); | ||
}; | ||
handleSubmit(); | ||
return { | ||
@@ -166,5 +197,7 @@ ...args, | ||
invalid, | ||
invalidChoices, | ||
}; | ||
}, | ||
template: `<UiMultipleChoices | ||
ref="invalidChoices" | ||
v-model="modelValue" | ||
@@ -471,2 +504,15 @@ v-model:invalid="invalid" | ||
const invalid = ref(args.initInvalid); | ||
const invalidChoices = ref(null); | ||
const handleSubmit = async () => { | ||
const { focusInvalidInput } = focusOnInvalidChoice(invalidChoices); | ||
// Note: Two nextTick functions are required to focus on the first invalid input after page load. | ||
await nextTick(); | ||
await nextTick(); | ||
focusInvalidInput(); | ||
}; | ||
handleSubmit(); | ||
return { | ||
@@ -477,5 +523,7 @@ ...args, | ||
invalid, | ||
invalidChoices, | ||
}; | ||
}, | ||
template: `<UiMultipleChoices | ||
ref="invalidChoices" | ||
v-model="modelValue" | ||
@@ -482,0 +530,0 @@ v-model:invalid="invalid" |
@@ -5,1 +5,2 @@ export * from './capitalize-first/index'; | ||
export * from './equal/index'; | ||
export * from './focus-on-first-invalid-choice/index'; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2240644
418
25184