hl-core 0.0.7-beta.2 → 0.0.7-beta.20

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.
Files changed (53) hide show
  1. package/.prettierrc +2 -1
  2. package/api/index.ts +295 -20
  3. package/api/interceptors.ts +10 -1
  4. package/components/Button/Btn.vue +7 -2
  5. package/components/Button/BtnIcon.vue +47 -0
  6. package/components/Complex/Content.vue +1 -1
  7. package/components/Complex/ContentBlock.vue +5 -0
  8. package/components/Complex/Page.vue +13 -2
  9. package/components/{Layout → Dialog}/Dialog.vue +7 -11
  10. package/components/Dialog/FamilyDialog.vue +39 -0
  11. package/components/Form/Documents.vue +107 -0
  12. package/components/Form/FormBlock.vue +114 -0
  13. package/components/Form/FormSection.vue +18 -0
  14. package/components/Form/FormTextSection.vue +20 -0
  15. package/components/Form/FormToggle.vue +41 -0
  16. package/components/Form/MemberForm.vue +1132 -0
  17. package/components/Form/ProductConditions.vue +343 -0
  18. package/components/Form/ProductConditionsBlock.vue +68 -0
  19. package/components/Input/EmptyFormField.vue +5 -0
  20. package/components/Input/FileInput.vue +71 -0
  21. package/components/Input/FormInput.vue +170 -0
  22. package/components/Input/PanelInput.vue +132 -0
  23. package/components/Input/RoundedInput.vue +39 -36
  24. package/components/Layout/Drawer.vue +42 -0
  25. package/components/Layout/Header.vue +25 -11
  26. package/components/Layout/Loader.vue +9 -6
  27. package/components/Layout/SettingsPanel.vue +48 -0
  28. package/components/List/ListEmpty.vue +22 -0
  29. package/components/Menu/MenuNav.vue +70 -30
  30. package/components/Menu/MenuNavItem.vue +8 -1
  31. package/components/Panel/PanelItem.vue +5 -0
  32. package/components/Panel/PanelSelectItem.vue +20 -0
  33. package/components/Transitions/FadeTransition.vue +5 -0
  34. package/composables/classes.ts +401 -201
  35. package/composables/constants.ts +27 -12
  36. package/composables/index.ts +72 -35
  37. package/composables/styles.ts +31 -7
  38. package/layouts/clear.vue +1 -1
  39. package/layouts/default.vue +72 -6
  40. package/layouts/full.vue +6 -0
  41. package/nuxt.config.ts +5 -2
  42. package/package.json +17 -11
  43. package/pages/500.vue +85 -0
  44. package/plugins/helperFunctionsPlugins.ts +10 -2
  45. package/plugins/storePlugin.ts +6 -5
  46. package/store/data.store.js +1871 -526
  47. package/store/member.store.ts +291 -0
  48. package/store/messages.ts +152 -34
  49. package/store/rules.js +26 -28
  50. package/tailwind.config.js +10 -0
  51. package/types/index.ts +120 -0
  52. package/models/index.ts +0 -23
  53. /package/store/{form.store.js → form.store.ts} +0 -0
@@ -0,0 +1,343 @@
1
+ <template>
2
+ <section class="flex flex-col gap-4 px-[10px]">
3
+ <v-form ref="vForm" @submit="submitForm" class="max-h-[82svh] overflow-y-scroll">
4
+ <base-form-section v-if="$dataStore.isGons" :title="$t('productConditionsForm.requestedProductConditions')" :class="[$libStyles.textSimple]">
5
+ <base-form-text-section
6
+ class="mb-4"
7
+ title="Инвалидность I или II группы по причине несчастного случая, начиная с третьего года по любой причине, с освобождением от уплаты страховых взносов"
8
+ subtitle="Равна страховой сумме по основному покрытию"
9
+ ></base-form-text-section>
10
+ <base-form-text-section
11
+ title="Если лицо, назначенное Выгодоприобретателем, на дату осуществления Страховщиком страховой выплаты не достигло совершеннолетия (восемнадцатилетнего возраста), страховая
12
+ выплата подлежит осуществлению:"
13
+ subtitle="Если несовершеннолетний не достиг возраста 14 лет - законному представителю в соответствии с законодательством Республики Казахстан"
14
+ ></base-form-text-section>
15
+ </base-form-section>
16
+ <base-form-section :title="$t('generalConditions')">
17
+ <div v-if="isRecalculation && $route.params.taskId === '0'">
18
+ <base-form-input
19
+ v-model="formStore.productConditionsForm.signDate"
20
+ :maska="$maska.date"
21
+ :clearable="false"
22
+ :readonly="true"
23
+ :label="$t('form.signDate')"
24
+ append-inner-icon="mdi mdi-calendar-blank-outline"
25
+ ></base-form-input>
26
+ <base-form-input
27
+ v-model="formStore.productConditionsForm.birthDate"
28
+ :maska="$maska.date"
29
+ :readonly="isDisabled"
30
+ :clearable="!isDisabled"
31
+ :label="$t('form.birthDate')"
32
+ :rules="$rules.required.concat($rules.birthDate)"
33
+ append-inner-icon="mdi mdi-calendar-blank-outline"
34
+ ></base-form-input>
35
+ <base-panel-input
36
+ v-model="formStore.productConditionsForm.gender"
37
+ :value="formStore.productConditionsForm.gender.nameRu"
38
+ :readonly="isDisabled"
39
+ :clearable="!isDisabled"
40
+ :label="$t('form.gender')"
41
+ :rules="$rules.objectRequired"
42
+ append-inner-icon="mdi mdi-chevron-right"
43
+ @append="openPanel($t('form.gender'), $dataStore.gender, 'gender')"
44
+ ></base-panel-input>
45
+ </div>
46
+ <base-form-input
47
+ v-model="formStore.productConditionsForm.coverPeriod"
48
+ :maska="$maska.numbers"
49
+ :readonly="isDisabled"
50
+ :clearable="!isDisabled"
51
+ :rules="$rules.required.concat($rules.numbers, $rules.coverPeriodFrom3to20)"
52
+ :label="$t('productConditionsForm.coverPeriodFrom3to20')"
53
+ ></base-form-input>
54
+ <base-panel-input
55
+ v-model="formStore.productConditionsForm.paymentPeriod"
56
+ :value="formStore.productConditionsForm.paymentPeriod.nameRu"
57
+ :readonly="isDisabled"
58
+ :clearable="!isDisabled"
59
+ :rules="$rules.objectRequired"
60
+ :label="$t('productConditionsForm.processPaymentPeriod')"
61
+ append-inner-icon="mdi mdi-chevron-right"
62
+ @append="openPanel($t('productConditionsForm.processPaymentPeriod'), $dataStore.processPaymentPeriod, 'paymentPeriod', $dataStore.getProcessPaymentPeriod)"
63
+ ></base-panel-input>
64
+ <base-form-input
65
+ v-model="formStore.productConditionsForm.requestedSumInsured"
66
+ :readonly="isDisabled"
67
+ :clearable="!isDisabled"
68
+ :rules="requestedSumInsured"
69
+ :label="$t('productConditionsForm.requestedSumInsured')"
70
+ ></base-form-input>
71
+ <base-form-input
72
+ v-model="formStore.productConditionsForm.insurancePremiumPerMonth"
73
+ :readonly="isDisabled"
74
+ :clearable="!isDisabled"
75
+ :rules="insurancePremiumPerMonth"
76
+ :label="$t('productConditionsForm.insurancePremiumAmount')"
77
+ ></base-form-input>
78
+ </base-form-section>
79
+ </v-form>
80
+ <base-btn
81
+ v-if="!isDisabled && isTask && ($dataStore.isInitiator() || $dataStore.isUnderwriter())"
82
+ :loading="isCalculating"
83
+ :text="$t('buttons.calculate')"
84
+ @click="submitForm"
85
+ ></base-btn>
86
+ <Teleport v-if="isPanelOpen" to="#panel-actions">
87
+ <div :class="[$libStyles.scrollPage]" class="flex flex-col items-center">
88
+ <base-rounded-input v-model="searchQuery" :label="$t('labels.search')" class="w-full p-2" :hide-details="true"></base-rounded-input>
89
+ <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
90
+ <base-panel-select-item :text="$t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())"></base-panel-select-item>
91
+ <base-panel-select-item
92
+ v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
93
+ :key="index"
94
+ :text="item.nameRu as string"
95
+ :selected="item.nameRu === panelValue.nameRu"
96
+ @click="pickPanelValue(item)"
97
+ ></base-panel-select-item>
98
+ </div>
99
+ <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50"></base-loader>
100
+ </div>
101
+ </Teleport>
102
+ </section>
103
+ </template>
104
+
105
+ <script lang="ts">
106
+ import { Value } from '@/composables/classes';
107
+
108
+ export default defineComponent({
109
+ props: {
110
+ isRecalculation: {
111
+ type: Boolean,
112
+ default: false,
113
+ },
114
+ },
115
+ setup(props) {
116
+ const vForm = ref<any>();
117
+ const route = useRoute();
118
+ const router = useRouter();
119
+ const formStore = useFormStore();
120
+ const dataStore = useDataStore();
121
+ const memberStore = useMemberStore();
122
+
123
+ const isCalculating = ref<boolean>(false);
124
+ const isPanelLoading = ref<boolean>(false);
125
+ const isPanelOpen = ref<boolean>(false);
126
+ const panelValue = ref<Value>(new Value());
127
+ const panelList = ref<Value[]>([]);
128
+ const currentPanel = ref<keyof typeof formStore.productConditionsForm>();
129
+ const searchQuery = ref<string>('');
130
+ const whichSum = ref<'insurancePremiumPerMonth' | 'requestedSumInsured' | ''>('');
131
+
132
+ const isUnderwriterForm = computed(() => {
133
+ if (route.params.taskId === '0 ' || props.isRecalculation === true) {
134
+ return false;
135
+ } else {
136
+ return formStore.applicationData.statusCode === 'UnderwriterForm';
137
+ }
138
+ });
139
+ const isDisabled = computed(() => !memberStore.isStatementEditible(formStore.productConditionsFormKey));
140
+ const isTask = computed(() => (route.params.taskId === '0' && props.isRecalculation === true) || dataStore.isTask());
141
+ const insurancePremiumPerMonth = computed(() => (!!formStore.productConditionsForm.insurancePremiumPerMonth ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
142
+ const requestedSumInsured = computed(() => (!!formStore.productConditionsForm.requestedSumInsured ? dataStore.rules.required.concat(dataStore.rules.sums) : []));
143
+
144
+ const pickPanelValue = (item: Value) => {
145
+ if (!isDisabled.value) {
146
+ dataStore.panel.open = false;
147
+ isPanelOpen.value = false;
148
+ // @ts-ignore
149
+ formStore.productConditionsForm[currentPanel.value] = item.nameRu === null ? new Value() : item;
150
+ } else {
151
+ dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
152
+ }
153
+ };
154
+
155
+ const openPanel = async (title: string, list: Value[], key: string, asyncFunction?: Function, filterKey?: string) => {
156
+ if (!isDisabled.value) {
157
+ searchQuery.value = '';
158
+ currentPanel.value = key as keyof typeof formStore.productConditionsForm;
159
+ isPanelOpen.value = true;
160
+ dataStore.panelAction = null;
161
+ dataStore.panel.open = true;
162
+ dataStore.panel.title = title;
163
+
164
+ let newList = list;
165
+ if (asyncFunction) {
166
+ isPanelLoading.value = true;
167
+ newList = await asyncFunction(filterKey, formStore.productConditionsFormKey);
168
+ }
169
+ panelList.value = newList;
170
+ // @ts-ignore
171
+ panelValue.value = formStore.productConditionsForm[currentPanel.value];
172
+ isPanelLoading.value = false;
173
+ } else {
174
+ dataStore.showToaster('error', dataStore.t('toaster.viewErrorText'));
175
+ }
176
+ };
177
+
178
+ const pickCalculation = async (type: 'insurancePremiumPerMonth' | 'requestedSumInsured') => {
179
+ if (!type) return false;
180
+ whichSum.value = type;
181
+ await submitForm();
182
+ };
183
+
184
+ const submitForm = async () => {
185
+ vForm.value.validate().then(async (v: { valid: Boolean; errors: any }) => {
186
+ if (v.valid) {
187
+ if (whichSum.value === 'requestedSumInsured') {
188
+ formStore.productConditionsForm.insurancePremiumPerMonth = null;
189
+ }
190
+ if (whichSum.value === 'insurancePremiumPerMonth') {
191
+ formStore.productConditionsForm.requestedSumInsured = null;
192
+ }
193
+ if (formStore.productConditionsForm.requestedSumInsured !== '' && formStore.productConditionsForm.requestedSumInsured != null) {
194
+ formStore.productConditionsForm.insurancePremiumPerMonth = null;
195
+ if (props.isRecalculation) whichSum.value = 'requestedSumInsured';
196
+ }
197
+ if (formStore.productConditionsForm.insurancePremiumPerMonth !== '' && formStore.productConditionsForm.insurancePremiumPerMonth != null) {
198
+ formStore.productConditionsForm.requestedSumInsured = null;
199
+ if (props.isRecalculation) whichSum.value = 'insurancePremiumPerMonth';
200
+ }
201
+
202
+ if (!whichSum.value && isUnderwriterForm.value === false) {
203
+ dataStore.showToaster('error', dataStore.t('toaster.emptyProductConditions'));
204
+ return;
205
+ }
206
+
207
+ if (isUnderwriterForm.value) {
208
+ type recalculationInfo = {
209
+ lifeMultiply: string | null;
210
+ lifeAdditive: string | null;
211
+ adbMultiply: string | null;
212
+ adbAdditive: string | null;
213
+ disabilityMultiply: string | null;
214
+ disabilityAdditive: string | null;
215
+ amount?: number | null;
216
+ premium?: number | null;
217
+ riskGroup?: string | number | null;
218
+ };
219
+ const recalculationData: recalculationInfo = (({ lifeMultiply, lifeAdditive, adbMultiply, adbAdditive, disabilityMultiply, disabilityAdditive }) => ({
220
+ lifeMultiply,
221
+ lifeAdditive,
222
+ adbMultiply,
223
+ adbAdditive,
224
+ disabilityMultiply,
225
+ disabilityAdditive,
226
+ }))(formStore.productConditionsForm);
227
+ Object.keys(recalculationData).forEach(key => {
228
+ // @ts-ignore
229
+ recalculationData[key] = formatProcents(recalculationData[key]);
230
+ });
231
+ recalculationData.amount = Number(formStore.productConditionsForm.requestedSumInsured?.replace(/\s/g, ''));
232
+ recalculationData.premium = Number(formStore.productConditionsForm.insurancePremiumPerMonth?.replace(/\s/g, ''));
233
+ recalculationData.riskGroup = formStore.productConditionsForm.riskGroup?.id ? formStore.productConditionsForm.riskGroup.id : 1;
234
+ isCalculating.value = true;
235
+ await dataStore.reCalculate(formStore.applicationData.processInstanceId, recalculationData, route.params.taskId, whichSum.value);
236
+ }
237
+ isCalculating.value = true;
238
+ if (props.isRecalculation) {
239
+ await dataStore.calculateWithoutApplication(true);
240
+ } else {
241
+ if (dataStore.isProcessEditable(formStore.applicationData.statusCode)) {
242
+ await dataStore.calculate(route.params.taskId);
243
+ }
244
+ }
245
+ isCalculating.value = false;
246
+ } else {
247
+ const errors = document.querySelector('.v-input--error');
248
+ if (errors) {
249
+ const errorText = errors.querySelector('.v-label.v-field-label');
250
+ if (errorText) {
251
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorText.innerHTML?.replace(/[-<>!//.]/g, '')));
252
+ } else {
253
+ const errorFieldText = errors.querySelector('.v-input__control');
254
+ if (errorFieldText) {
255
+ dataStore.showToaster('error', dataStore.t('toaster.errorFormField').replace('{text}', errorFieldText.innerHTML?.replace(/[-<>!//.]/g, '')));
256
+ }
257
+ }
258
+ errors.scrollIntoView({
259
+ behavior: 'smooth',
260
+ block: 'center',
261
+ inline: 'nearest',
262
+ });
263
+ }
264
+ }
265
+ });
266
+ };
267
+
268
+ onMounted(async () => {
269
+ if (props.isRecalculation === true) {
270
+ if (route.params.taskId === '0') {
271
+ const defaultData = await dataStore.getDefaultCalculationData(true);
272
+ dataStore.additionalInsuranceTermsWithout = defaultData.addCovers;
273
+ formStore.productConditionsForm.requestedSumInsured = defaultData.amount;
274
+ formStore.productConditionsForm.insurancePremiumPerMonth = defaultData.premium;
275
+ formStore.productConditionsForm.processIndexRate = dataStore.processIndexRate.find(i => i.id === defaultData.indexRateId);
276
+ formStore.productConditionsForm.paymentPeriod = dataStore.processPaymentPeriod.find(i => i.id == defaultData.paymentPeriodId);
277
+ formStore.productConditionsForm.signDate = reformatDate(defaultData.signDate);
278
+ }
279
+ }
280
+ if (!!formStore.productConditionsForm.insurancePremiumPerMonth) {
281
+ whichSum.value = 'insurancePremiumPerMonth';
282
+ }
283
+ if (!!formStore.productConditionsForm.requestedSumInsured) {
284
+ whichSum.value = 'requestedSumInsured';
285
+ }
286
+ });
287
+
288
+ watch(
289
+ () => formStore.productConditionsForm.requestedSumInsured,
290
+ val => {
291
+ if (!val && whichSum.value == 'requestedSumInsured') whichSum.value = '';
292
+ if (val && whichSum.value != 'insurancePremiumPerMonth') {
293
+ whichSum.value = 'requestedSumInsured';
294
+ formStore.productConditionsForm.requestedSumInsured = dataStore.getNumberWithSpaces(val);
295
+ }
296
+ },
297
+ );
298
+ watch(
299
+ () => formStore.productConditionsForm.insurancePremiumPerMonth,
300
+ val => {
301
+ if (!val && whichSum.value == 'insurancePremiumPerMonth') whichSum.value = '';
302
+ if (val && whichSum.value != 'requestedSumInsured') {
303
+ whichSum.value = 'insurancePremiumPerMonth';
304
+ formStore.productConditionsForm.insurancePremiumPerMonth = dataStore.getNumberWithSpaces(val);
305
+ }
306
+ },
307
+ );
308
+ watch(
309
+ () => formStore.productConditionsForm.amountOfInsurancePremium,
310
+ val => {
311
+ if (val) formStore.productConditionsForm.amountOfInsurancePremium = dataStore.getNumberWithSpaces(val);
312
+ },
313
+ );
314
+
315
+ return {
316
+ // State
317
+ formStore,
318
+ vForm,
319
+ isCalculating,
320
+ isPanelLoading,
321
+ isPanelOpen,
322
+ panelValue,
323
+ panelList,
324
+ searchQuery,
325
+ whichSum,
326
+ Value,
327
+
328
+ // Computed
329
+ isTask,
330
+ isDisabled,
331
+ isUnderwriterForm,
332
+ insurancePremiumPerMonth,
333
+ requestedSumInsured,
334
+
335
+ // Functions
336
+ submitForm,
337
+ pickPanelValue,
338
+ openPanel,
339
+ pickCalculation,
340
+ };
341
+ },
342
+ });
343
+ </script>
@@ -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,5 @@
1
+ <template>
2
+ <div class="h-[60px] bg-white rounded border-b-[1px] border-b-[#f3f6fc] flex items-center pl-4" :class="[$libStyles.textTitle]">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
@@ -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,170 @@
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="readonly ? false : clearable"
17
+ :disabled="disabled"
18
+ :readonly="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="!readonly && $emit('append-out')"
26
+ @click:prepend="!readonly && $emit('prepend-out')"
27
+ @click:append-inner="!readonly && $emit('append')"
28
+ @click:prepend-inner="!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
+ };
125
+ },
126
+ });
127
+ </script>
128
+
129
+ <style>
130
+ .form-input input:focus {
131
+ border: none !important;
132
+ outline: none !important;
133
+ }
134
+ .form-input input {
135
+ padding-top: 30px;
136
+ }
137
+ .form-input .v-field {
138
+ box-shadow: none;
139
+ font-size: 14px;
140
+ }
141
+ .form-input .v-label.v-field-label {
142
+ top: 20px;
143
+ }
144
+ .form-input .v-field__append-inner {
145
+ padding-top: 18px;
146
+ padding-right: 6px;
147
+ }
148
+ .form-input .v-field__append-inner i {
149
+ color: #a0b3d8 !important;
150
+ margin-left: 10px;
151
+ margin-right: 4px;
152
+ }
153
+ .form-input {
154
+ border-bottom: 1px solid #f3f6fc;
155
+ }
156
+ .form-input.v-input--error {
157
+ border-color: #ff5449;
158
+ }
159
+ .form-input.v-input--error .v-input__details {
160
+ display: block;
161
+ }
162
+ .form-input .v-input__details {
163
+ display: none;
164
+ background-color: white;
165
+ padding-top: 0 !important;
166
+ }
167
+ .form-input .v-field--error {
168
+ border-color: #ff5449;
169
+ }
170
+ </style>