Fix all TypeScript errors and remove Storybook
All checks were successful
Build Docker Image / build (push) Successful in 5m8s
All checks were successful
Build Docker Image / build (push) Successful in 5m8s
- Remove all Storybook files and configuration - Add type declarations for @vueuse/core, @formkit/core, vue3-apexcharts - Fix TypeScript configuration (typeRoots, include paths) - Fix Sentry config - move settings to plugin - Fix nullable prop assignments with ?? operator - Fix type narrowing issues with explicit type assertions - Fix Card component linkable computed properties - Update codegen with operationResultSuffix - Fix GraphQL operation type definitions
This commit is contained in:
@@ -48,13 +48,24 @@ interface CompanyData {
|
||||
address: string
|
||||
}
|
||||
|
||||
interface CompanySuggestion {
|
||||
value: string
|
||||
unrestricted_value: string
|
||||
data: {
|
||||
inn: string
|
||||
kpp?: string
|
||||
ogrn?: string
|
||||
address?: { value: string }
|
||||
}
|
||||
}
|
||||
|
||||
interface Props {
|
||||
modelValue?: CompanyData
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: CompanyData): void
|
||||
(e: 'select', company: any): void
|
||||
(e: 'select', company: CompanySuggestion): void
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -71,14 +82,14 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
const query = ref('')
|
||||
const suggestions = ref([])
|
||||
const suggestions = ref<CompanySuggestion[]>([])
|
||||
const loading = ref(false)
|
||||
const showDropdown = ref(false)
|
||||
|
||||
// Hide dropdown when clicking outside
|
||||
onMounted(() => {
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!e.target?.closest('.relative')) {
|
||||
document.addEventListener('click', (e: MouseEvent) => {
|
||||
if (!(e.target as HTMLElement)?.closest('.relative')) {
|
||||
showDropdown.value = false
|
||||
}
|
||||
})
|
||||
@@ -118,10 +129,10 @@ const onInput = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const selectCompany = (company: any) => {
|
||||
const selectCompany = (company: CompanySuggestion) => {
|
||||
query.value = company.value
|
||||
showDropdown.value = false
|
||||
|
||||
|
||||
const companyData: CompanyData = {
|
||||
companyName: company.value,
|
||||
companyFullName: company.unrestricted_value,
|
||||
@@ -130,7 +141,7 @@ const selectCompany = (company: any) => {
|
||||
ogrn: company.data.ogrn || '',
|
||||
address: company.data.address?.value || ''
|
||||
}
|
||||
|
||||
|
||||
emit('update:modelValue', companyData)
|
||||
emit('select', company)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user