hl-core 0.0.7-beta.9 → 0.0.8-beta.1
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/.prettierrc +2 -1
- package/api/index.ts +94 -107
- package/api/interceptors.ts +4 -4
- package/components/Button/Btn.vue +7 -2
- package/components/Button/ScrollButtons.vue +6 -0
- package/components/Complex/ContentBlock.vue +5 -0
- package/components/{Layout → Dialog}/Dialog.vue +3 -27
- package/components/Dialog/FamilyDialog.vue +39 -0
- package/components/Form/FormBlock.vue +114 -0
- package/components/Form/FormSection.vue +18 -0
- package/components/Form/FormTextSection.vue +20 -0
- package/components/Form/FormToggle.vue +52 -0
- package/components/Form/ProductConditionsBlock.vue +68 -0
- package/components/Input/EmptyFormField.vue +5 -0
- package/components/Input/FileInput.vue +71 -0
- package/components/Input/FormInput.vue +171 -0
- package/components/Input/PanelInput.vue +133 -0
- package/components/Input/RoundedInput.vue +35 -36
- package/components/Layout/Drawer.vue +19 -16
- package/components/Layout/Header.vue +4 -18
- package/components/Layout/Loader.vue +1 -7
- package/components/Layout/SettingsPanel.vue +17 -37
- package/components/List/ListEmpty.vue +22 -0
- package/components/Menu/MenuNav.vue +22 -20
- package/components/Menu/MenuNavItem.vue +6 -6
- package/components/Pages/Anketa.vue +333 -0
- package/components/Pages/Auth.vue +91 -0
- package/components/Pages/Documents.vue +108 -0
- package/components/Pages/MemberForm.vue +1134 -0
- package/components/Pages/ProductAgreement.vue +18 -0
- package/components/Pages/ProductConditions.vue +360 -0
- package/components/Panel/PanelHandler.vue +231 -0
- package/components/Panel/PanelItem.vue +2 -4
- package/components/Panel/PanelSelectItem.vue +20 -0
- package/components/Transitions/FadeTransition.vue +5 -0
- package/components/Transitions/SlideTransition.vue +5 -0
- package/composables/classes.ts +301 -255
- package/composables/constants.ts +16 -9
- package/composables/index.ts +55 -60
- package/composables/styles.ts +33 -7
- package/layouts/default.vue +46 -26
- package/layouts/full.vue +2 -12
- package/nuxt.config.ts +3 -0
- package/package.json +13 -10
- package/pages/500.vue +40 -12
- package/plugins/helperFunctionsPlugins.ts +6 -2
- package/plugins/storePlugin.ts +6 -5
- package/store/data.store.js +865 -1942
- package/store/member.store.ts +291 -0
- package/store/messages.ts +70 -51
- package/store/rules.js +26 -28
- package/types/index.ts +303 -0
- package/composables/models.ts +0 -43
- /package/store/{form.store.js → form.store.ts} +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-3 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
|
|
3
|
+
<div class="ml-5">
|
|
4
|
+
<p :class="[$libStyles.textTitle, $libStyles.greenText]">{{ title }}</p>
|
|
5
|
+
<p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="ml-5 mt-6 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center">
|
|
8
|
+
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.fullName') }}</span>
|
|
9
|
+
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('form.iin') }}</span>
|
|
10
|
+
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('form.gender') }}</span>
|
|
11
|
+
<span :class="[$libStyles.textSimple]" class="font-medium"> {{ $t('form.birthDate') }} </span>
|
|
12
|
+
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('form.Country') }} </span>
|
|
13
|
+
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block"> {{ $t('code') }}</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div v-if="isMultiple" class="ml-5 flex flex-col">
|
|
16
|
+
<div v-for="(each, index) of member" :key="index" class="grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
|
|
17
|
+
<span :class="[getMemberInfo(each).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
|
|
18
|
+
<span :class="[getMemberInfo(each).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
|
|
19
|
+
<span :class="[getMemberInfo(each).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
|
|
20
|
+
<span :class="[getMemberInfo(each).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
|
|
21
|
+
<span :class="[getMemberInfo(each).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
|
|
22
|
+
<span :class="[getMemberInfo(each).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).sectorCode }} </span>
|
|
23
|
+
<div
|
|
24
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
|
|
25
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
|
|
26
|
+
@click="$emit('onMore', { whichForm, index })"
|
|
27
|
+
>
|
|
28
|
+
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-else class="ml-5 grid grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7 auto-rows-fr items-center relative">
|
|
33
|
+
<span :class="[getMemberInfo(member).fullName === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).fullName }}</span>
|
|
34
|
+
<span :class="[getMemberInfo(member).iin === null && $libStyles.emptyBlockCol]">{{ getMemberInfo(member).iin }}</span>
|
|
35
|
+
<span :class="[getMemberInfo(member).gender === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(member).gender }} </span>
|
|
36
|
+
<span :class="[getMemberInfo(member).birthDate === null && $libStyles.emptyBlockCol]"> {{ getMemberInfo(member).birthDate }} </span>
|
|
37
|
+
<span :class="[getMemberInfo(member).birthPlace === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).birthPlace }} </span>
|
|
38
|
+
<span :class="[getMemberInfo(member).sectorCode === null && $libStyles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(member).sectorCode }} </span>
|
|
39
|
+
<div
|
|
40
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] place-self-end cursor-pointer"
|
|
41
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
|
|
42
|
+
@click="$emit('onMore', { whichForm })"
|
|
43
|
+
>
|
|
44
|
+
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
v-if="isMultiple && more"
|
|
49
|
+
:class="[$libStyles.blueBg, $libStyles.whiteText, $libStyles.textSimple]"
|
|
50
|
+
class="cursor-pointer rounded-b-lg h-[36px] flex items-center font-medium justify-center"
|
|
51
|
+
@click="memberStore.addMember(whichForm)"
|
|
52
|
+
>
|
|
53
|
+
{{ $t('buttons.add') }}
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script lang="ts">
|
|
59
|
+
import { Member } from '@/composables/classes';
|
|
60
|
+
|
|
61
|
+
export default defineComponent({
|
|
62
|
+
props: {
|
|
63
|
+
title: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: '',
|
|
66
|
+
},
|
|
67
|
+
subtitle: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: '',
|
|
70
|
+
},
|
|
71
|
+
whichForm: {
|
|
72
|
+
type: String as PropType<MemberFormTypes>,
|
|
73
|
+
default: '',
|
|
74
|
+
},
|
|
75
|
+
more: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
emits: ['onMore', 'addMember'],
|
|
81
|
+
setup(props) {
|
|
82
|
+
const dataStore = useDataStore();
|
|
83
|
+
const formStore = useFormStore();
|
|
84
|
+
const memberStore = useMemberStore();
|
|
85
|
+
const multipleMembers = ['insuredForm', 'beneficiaryForm', 'beneficialOwnerForm'];
|
|
86
|
+
const isMultiple = ref(multipleMembers.includes(props.whichForm));
|
|
87
|
+
const member: Member = formStore[props.whichForm as MemberKeys];
|
|
88
|
+
|
|
89
|
+
const getMemberInfo = (memberData: Member) => {
|
|
90
|
+
return {
|
|
91
|
+
fullName: computed(() => (memberData && memberData.getFullNameShorted() ? memberData.getFullNameShorted() : null)).value,
|
|
92
|
+
iin: computed(() => (memberData && memberData.iin ? memberData.iin : null)).value,
|
|
93
|
+
gender: computed(() => (memberData && memberData.gender.nameRu ? (memberData.gender.nameRu as string).charAt(0) : null)).value,
|
|
94
|
+
birthDate: computed(() => (memberData && memberData.birthDate ? memberData.birthDate : null)).value,
|
|
95
|
+
birthPlace: computed(() => (memberData && memberData.birthPlace.nameRu ? (memberData.birthPlace.nameRu as string).substring(0, 3) : null)).value,
|
|
96
|
+
sectorCode: computed(() => (memberData && memberData.economySectorCode.ids ? (memberData.economySectorCode.ids as string).slice(-1) : null)).value,
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
// State
|
|
102
|
+
formStore,
|
|
103
|
+
memberStore,
|
|
104
|
+
member,
|
|
105
|
+
isMultiple,
|
|
106
|
+
|
|
107
|
+
// Computed
|
|
108
|
+
|
|
109
|
+
// Functions
|
|
110
|
+
getMemberInfo,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section :class="[$libStyles.blueBgLight, $libStyles.rounded]" class="mt-[14px] p-4 flex flex-col gap-[1px]">
|
|
3
|
+
<h2 :class="[$libStyles.textTitle]" class="font-medium text-center w-full mb-4">{{ title }}</h2>
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</section>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
props: {
|
|
11
|
+
title: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'Заголовок',
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col justify-between rounded-lg" :class="[$libStyles.whiteBg]">
|
|
3
|
+
<span v-if="title" class="p-4" :class="[$libStyles.textTitle]">{{ title }}</span>
|
|
4
|
+
<span v-if="subtitle" class="p-4 text-[#99A3B3] border-t-[1px]" :class="[$libStyles.textSimple]">{{ subtitle }}</span>
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
export default defineComponent({
|
|
11
|
+
props: {
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
},
|
|
15
|
+
subtitle: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="h-[74px] !pl-2 md:!pl-5 flex items-center justify-start gap-4"
|
|
4
|
+
:class="[$libStyles.whiteBg, hasBorder ? 'border-[1px] rounded-lg' : 'border-b-[1px] border-b-[#f3f6fc] rounded']"
|
|
5
|
+
>
|
|
6
|
+
<v-switch
|
|
7
|
+
class="base-toggle"
|
|
8
|
+
:model-value="modelValue"
|
|
9
|
+
@update:modelValue="
|
|
10
|
+
$emit('update:modelValue', $event);
|
|
11
|
+
$emit('clicked');
|
|
12
|
+
"
|
|
13
|
+
color="#009C73"
|
|
14
|
+
hide-details
|
|
15
|
+
:disabled="disabled"
|
|
16
|
+
>
|
|
17
|
+
</v-switch>
|
|
18
|
+
<p :class="[$libStyles.textSimple]">{{ `${title}` }}</p>
|
|
19
|
+
<p class="mr-3" :class="[modelValue ? $libStyles.greenText : '', $libStyles.textSimple]">{{ `${modelValue ? $t('confirm.yes') : $t('confirm.no')}` }}</p>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: '',
|
|
29
|
+
},
|
|
30
|
+
title: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: '',
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
hasBorder: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
emits: ['update:modelValue', 'clicked'],
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.v-input.base-toggle {
|
|
49
|
+
width: fit-content;
|
|
50
|
+
flex: unset !important;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-3 pl-5 rounded-lg border-[1px]" :class="[$libStyles.whiteBg]">
|
|
3
|
+
<div>
|
|
4
|
+
<p :class="[$libStyles.textTitle, $libStyles.greenText]">
|
|
5
|
+
{{ $t('productConditions') }}
|
|
6
|
+
</p>
|
|
7
|
+
<p v-if="!!subtitle" :class="[$libStyles.greyText, $libStyles.textSimple]">{{ subtitle }}</p>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="mt-6 grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
10
|
+
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.requestedSumInsured') }}</span>
|
|
11
|
+
<span :class="[$libStyles.textSimple]" class="font-medium">{{ $t('productConditionsForm.insurancePremiumPerMonth') }}</span>
|
|
12
|
+
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.coverPeriod') }}</span>
|
|
13
|
+
<span :class="[$libStyles.textSimple]" class="font-medium hidden lg:block">{{ $t('productConditionsForm.payPeriod') }}</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="grid grid-cols-3 lg:grid-cols-5 auto-rows-fr items-center">
|
|
16
|
+
<span :class="[amount === null && $libStyles.emptyBlockCol]">{{ amount }} </span>
|
|
17
|
+
<span :class="[premium === null && $libStyles.emptyBlockCol]"> {{ premium }}</span>
|
|
18
|
+
<span :class="[coverPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">{{ coverPeriod }} </span>
|
|
19
|
+
<span :class="[paymentPeriod === null && $libStyles.emptyBlockCol]" class="hidden lg:block">
|
|
20
|
+
{{ paymentPeriod }}
|
|
21
|
+
</span>
|
|
22
|
+
<div
|
|
23
|
+
class="rounded-br-lg transition-all h-[70px] w-[60px] relative place-self-end cursor-pointer"
|
|
24
|
+
:class="[$libStyles.blueBgLight, $libStyles.blueBgLightHover]"
|
|
25
|
+
@click="$emit('onMore', { whichForm: 'productConditions' })"
|
|
26
|
+
>
|
|
27
|
+
<i class="mdi mdi-dots-vertical text-xl absolute top-[20px] right-[20px]"> </i>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script lang="ts">
|
|
34
|
+
export default defineComponent({
|
|
35
|
+
props: {
|
|
36
|
+
subtitle: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
setup() {
|
|
42
|
+
const formStore = useFormStore();
|
|
43
|
+
|
|
44
|
+
const amount = computed(() =>
|
|
45
|
+
formStore.productConditionsForm && formStore.productConditionsForm.requestedSumInsured ? formStore.productConditionsForm.requestedSumInsured : null,
|
|
46
|
+
);
|
|
47
|
+
const premium = computed(() =>
|
|
48
|
+
formStore.productConditionsForm && formStore.productConditionsForm.insurancePremiumPerMonth ? formStore.productConditionsForm.insurancePremiumPerMonth : null,
|
|
49
|
+
);
|
|
50
|
+
const coverPeriod = computed(() => (formStore.productConditionsForm && formStore.productConditionsForm.coverPeriod ? formStore.productConditionsForm.coverPeriod : null));
|
|
51
|
+
const paymentPeriod = computed(() =>
|
|
52
|
+
formStore.productConditionsForm && formStore.productConditionsForm.paymentPeriod && !!formStore.productConditionsForm.paymentPeriod.nameRu
|
|
53
|
+
? formStore.productConditionsForm.paymentPeriod.nameRu
|
|
54
|
+
: null,
|
|
55
|
+
);
|
|
56
|
+
return {
|
|
57
|
+
// State
|
|
58
|
+
formStore,
|
|
59
|
+
|
|
60
|
+
// Computed
|
|
61
|
+
amount,
|
|
62
|
+
premium,
|
|
63
|
+
coverPeriod,
|
|
64
|
+
paymentPeriod,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-file-input
|
|
3
|
+
class="file-input"
|
|
4
|
+
:disabled="disabled"
|
|
5
|
+
prepend-icon=""
|
|
6
|
+
append-inner-icon="mdi mdi-file-document"
|
|
7
|
+
@click:append-inner="$emit('input', $event)"
|
|
8
|
+
@input="$emit('input', $event)"
|
|
9
|
+
variant="solo"
|
|
10
|
+
show-size
|
|
11
|
+
multiple
|
|
12
|
+
accept=".pdf,.doc,.jpeg,.jpg,.jpg"
|
|
13
|
+
truncate-length="15"
|
|
14
|
+
clear-icon="mdi mdi-close"
|
|
15
|
+
:label="$t('labels.chooseDoc')"
|
|
16
|
+
></v-file-input>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
export default defineComponent({
|
|
21
|
+
props: {
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
.file-input input:focus {
|
|
32
|
+
border: none !important;
|
|
33
|
+
outline: none !important;
|
|
34
|
+
}
|
|
35
|
+
.file-input input {
|
|
36
|
+
padding-top: 30px;
|
|
37
|
+
}
|
|
38
|
+
.file-input .v-field {
|
|
39
|
+
box-shadow: none;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
}
|
|
42
|
+
.file-input .v-label.v-field-label {
|
|
43
|
+
top: 20px;
|
|
44
|
+
}
|
|
45
|
+
.file-input .v-field__append-inner {
|
|
46
|
+
padding-top: 18px;
|
|
47
|
+
padding-right: 6px;
|
|
48
|
+
}
|
|
49
|
+
.file-input .v-field__append-inner i {
|
|
50
|
+
color: #a0b3d8 !important;
|
|
51
|
+
margin-left: 10px;
|
|
52
|
+
margin-right: 4px;
|
|
53
|
+
}
|
|
54
|
+
.file-input {
|
|
55
|
+
border-bottom: 1px solid #f3f6fc;
|
|
56
|
+
}
|
|
57
|
+
.file-input.v-input--error {
|
|
58
|
+
border-color: #ff5449;
|
|
59
|
+
}
|
|
60
|
+
.file-input.v-input--error .v-input__details {
|
|
61
|
+
display: block;
|
|
62
|
+
}
|
|
63
|
+
.file-input .v-input__details {
|
|
64
|
+
display: none;
|
|
65
|
+
background-color: white;
|
|
66
|
+
padding-top: 0 !important;
|
|
67
|
+
}
|
|
68
|
+
.file-input .v-field--error {
|
|
69
|
+
border-color: #ff5449;
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-text-field
|
|
3
|
+
class="form-input"
|
|
4
|
+
:model-value="modelValue"
|
|
5
|
+
v-maska="maska"
|
|
6
|
+
:rules="rules"
|
|
7
|
+
:loading="loading"
|
|
8
|
+
:placeholder="placeholder"
|
|
9
|
+
:label="label"
|
|
10
|
+
:messages="messages"
|
|
11
|
+
:type="type"
|
|
12
|
+
:variant="variant"
|
|
13
|
+
:clear-icon="clearIcon"
|
|
14
|
+
:color="color"
|
|
15
|
+
:hint="hint"
|
|
16
|
+
:clearable="props.readonly ? false : clearable"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
:readonly="props.readonly"
|
|
19
|
+
:prepend-icon="prependIcon ? prependIcon : ''"
|
|
20
|
+
:append-icon="appendIcon ? appendIcon : ''"
|
|
21
|
+
:prepend-inner-icon="prependInnerIcon ? prependInnerIcon : ''"
|
|
22
|
+
:append-inner-icon="appendInnerIcon ? appendInnerIcon : ''"
|
|
23
|
+
:bg-color="bgColor ? bgColor : ''"
|
|
24
|
+
@keyup.enter.prevent="submitted"
|
|
25
|
+
@click:append="!props.readonly && $emit('append-out')"
|
|
26
|
+
@click:prepend="!props.readonly && $emit('prepend-out')"
|
|
27
|
+
@click:append-inner="!props.readonly && $emit('append')"
|
|
28
|
+
@click:prepend-inner="!props.readonly && $emit('prepend')"
|
|
29
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
30
|
+
>
|
|
31
|
+
<template v-if="loading" #loader>
|
|
32
|
+
<v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
|
|
33
|
+
</template>
|
|
34
|
+
</v-text-field>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script lang="ts">
|
|
38
|
+
export default defineComponent({
|
|
39
|
+
name: 'BaseFormInput',
|
|
40
|
+
props: {
|
|
41
|
+
modelValue: {
|
|
42
|
+
required: false,
|
|
43
|
+
},
|
|
44
|
+
loading: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
clearable: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true,
|
|
51
|
+
},
|
|
52
|
+
disabled: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
readonly: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
placeholder: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '',
|
|
63
|
+
},
|
|
64
|
+
label: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
messages: {
|
|
69
|
+
type: [String, Array<string>],
|
|
70
|
+
},
|
|
71
|
+
maska: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: '',
|
|
74
|
+
},
|
|
75
|
+
hint: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: '',
|
|
78
|
+
},
|
|
79
|
+
rules: {
|
|
80
|
+
type: Array<any>,
|
|
81
|
+
default: [],
|
|
82
|
+
},
|
|
83
|
+
type: {
|
|
84
|
+
type: String as PropType<InputTypes>,
|
|
85
|
+
default: 'text',
|
|
86
|
+
},
|
|
87
|
+
variant: {
|
|
88
|
+
type: String as PropType<InputVariants>,
|
|
89
|
+
default: 'solo',
|
|
90
|
+
},
|
|
91
|
+
color: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: '#009c73',
|
|
94
|
+
},
|
|
95
|
+
clearIcon: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'mdi-close',
|
|
98
|
+
},
|
|
99
|
+
prependIcon: {
|
|
100
|
+
type: String,
|
|
101
|
+
},
|
|
102
|
+
appendIcon: {
|
|
103
|
+
type: String,
|
|
104
|
+
},
|
|
105
|
+
prependInnerIcon: {
|
|
106
|
+
type: String,
|
|
107
|
+
},
|
|
108
|
+
appendInnerIcon: {
|
|
109
|
+
type: String,
|
|
110
|
+
},
|
|
111
|
+
bgColor: {
|
|
112
|
+
type: String,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
emits: ['update:modelValue', 'submitted', 'prepend', 'append', 'prepend-out', 'append-out'],
|
|
116
|
+
|
|
117
|
+
setup(props, { emit }) {
|
|
118
|
+
const submitted = (event: any) => {
|
|
119
|
+
emit('submitted', event);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
submitted,
|
|
124
|
+
props,
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style>
|
|
131
|
+
.form-input input:focus {
|
|
132
|
+
border: none !important;
|
|
133
|
+
outline: none !important;
|
|
134
|
+
}
|
|
135
|
+
.form-input input {
|
|
136
|
+
padding-top: 30px;
|
|
137
|
+
}
|
|
138
|
+
.form-input .v-field {
|
|
139
|
+
box-shadow: none;
|
|
140
|
+
font-size: 14px;
|
|
141
|
+
}
|
|
142
|
+
.form-input .v-label.v-field-label {
|
|
143
|
+
top: 20px;
|
|
144
|
+
}
|
|
145
|
+
.form-input .v-field__append-inner {
|
|
146
|
+
padding-top: 18px;
|
|
147
|
+
padding-right: 6px;
|
|
148
|
+
}
|
|
149
|
+
.form-input .v-field__append-inner i {
|
|
150
|
+
color: #a0b3d8 !important;
|
|
151
|
+
margin-left: 10px;
|
|
152
|
+
margin-right: 4px;
|
|
153
|
+
}
|
|
154
|
+
.form-input {
|
|
155
|
+
border-bottom: 1px solid #f3f6fc;
|
|
156
|
+
}
|
|
157
|
+
.form-input.v-input--error {
|
|
158
|
+
border-color: #ff5449;
|
|
159
|
+
}
|
|
160
|
+
.form-input.v-input--error .v-input__details {
|
|
161
|
+
display: block;
|
|
162
|
+
}
|
|
163
|
+
.form-input .v-input__details {
|
|
164
|
+
display: none;
|
|
165
|
+
background-color: white;
|
|
166
|
+
padding-top: 0 !important;
|
|
167
|
+
}
|
|
168
|
+
.form-input .v-field--error {
|
|
169
|
+
border-color: #ff5449;
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-text-field
|
|
3
|
+
class="form-input"
|
|
4
|
+
:model-value="modelValue"
|
|
5
|
+
v-maska="maska"
|
|
6
|
+
:rules="rules"
|
|
7
|
+
:loading="loading"
|
|
8
|
+
:placeholder="placeholder"
|
|
9
|
+
:label="label"
|
|
10
|
+
:messages="messages"
|
|
11
|
+
:type="type"
|
|
12
|
+
:variant="variant"
|
|
13
|
+
:clear-icon="clearIcon"
|
|
14
|
+
:color="color"
|
|
15
|
+
:hint="hint"
|
|
16
|
+
:clearable="clearable"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
:readonly="true"
|
|
19
|
+
:prepend-icon="prependIcon ? prependIcon : ''"
|
|
20
|
+
:append-icon="appendIcon ? appendIcon : ''"
|
|
21
|
+
:prepend-inner-icon="prependInnerIcon ? prependInnerIcon : ''"
|
|
22
|
+
:append-inner-icon="appendInnerIcon ? appendInnerIcon : ''"
|
|
23
|
+
:bg-color="bgColor ? bgColor : ''"
|
|
24
|
+
@keyup.enter.prevent="submitted"
|
|
25
|
+
@click:control="!props.readonly && $emit('append')"
|
|
26
|
+
@click:clear="(props.readonly ? false : clearable) && $emit('update:modelValue', new Value())"
|
|
27
|
+
@click:append="!props.readonly && $emit('append-out')"
|
|
28
|
+
@click:prepend="!props.readonly && $emit('prepend-out')"
|
|
29
|
+
@click:append-inner="!props.readonly && $emit('append')"
|
|
30
|
+
@click:prepend-inner="!props.readonly && $emit('prepend')"
|
|
31
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
32
|
+
>
|
|
33
|
+
<template v-if="loading" #loader>
|
|
34
|
+
<v-progress-linear :active="loading" :color="color" absolute height="1" indeterminate></v-progress-linear>
|
|
35
|
+
</template>
|
|
36
|
+
</v-text-field>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script lang="ts">
|
|
40
|
+
import { Value } from '@/composables/classes';
|
|
41
|
+
|
|
42
|
+
export default defineComponent({
|
|
43
|
+
name: 'BasePanelInput',
|
|
44
|
+
props: {
|
|
45
|
+
modelValue: {
|
|
46
|
+
required: false,
|
|
47
|
+
},
|
|
48
|
+
loading: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
clearable: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true,
|
|
55
|
+
},
|
|
56
|
+
disabled: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
readonly: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
placeholder: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
label: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: '',
|
|
71
|
+
},
|
|
72
|
+
messages: {
|
|
73
|
+
type: [String, Array<string>],
|
|
74
|
+
},
|
|
75
|
+
maska: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: '',
|
|
78
|
+
},
|
|
79
|
+
hint: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: '',
|
|
82
|
+
},
|
|
83
|
+
rules: {
|
|
84
|
+
type: Array<any>,
|
|
85
|
+
default: [],
|
|
86
|
+
},
|
|
87
|
+
type: {
|
|
88
|
+
type: String as PropType<InputTypes>,
|
|
89
|
+
default: 'text',
|
|
90
|
+
},
|
|
91
|
+
variant: {
|
|
92
|
+
type: String as PropType<InputVariants>,
|
|
93
|
+
default: 'solo',
|
|
94
|
+
},
|
|
95
|
+
color: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: '#009c73',
|
|
98
|
+
},
|
|
99
|
+
clearIcon: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: 'mdi-close',
|
|
102
|
+
},
|
|
103
|
+
prependIcon: {
|
|
104
|
+
type: String,
|
|
105
|
+
},
|
|
106
|
+
appendIcon: {
|
|
107
|
+
type: String,
|
|
108
|
+
},
|
|
109
|
+
prependInnerIcon: {
|
|
110
|
+
type: String,
|
|
111
|
+
},
|
|
112
|
+
appendInnerIcon: {
|
|
113
|
+
type: String,
|
|
114
|
+
},
|
|
115
|
+
bgColor: {
|
|
116
|
+
type: String,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
emits: ['update:modelValue', 'submitted', 'prepend', 'append', 'prepend-out', 'append-out', 'clear'],
|
|
120
|
+
|
|
121
|
+
setup(props, { emit }) {
|
|
122
|
+
const submitted = (event: any) => {
|
|
123
|
+
emit('submitted', event);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
submitted,
|
|
128
|
+
Value,
|
|
129
|
+
props,
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
</script>
|