hl-core 0.0.9-beta.4 → 0.0.9-beta.40

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 (61) hide show
  1. package/api/base.api.ts +904 -0
  2. package/api/index.ts +2 -620
  3. package/api/interceptors.ts +58 -14
  4. package/components/Button/Btn.vue +2 -2
  5. package/components/Complex/MessageBlock.vue +2 -2
  6. package/components/Complex/Page.vue +1 -1
  7. package/components/Dialog/Dialog.vue +60 -15
  8. package/components/Form/DynamicForm.vue +100 -0
  9. package/components/Form/FormBlock.vue +12 -3
  10. package/components/Form/FormData.vue +114 -0
  11. package/components/Form/FormToggle.vue +9 -3
  12. package/components/Form/ManagerAttachment.vue +150 -86
  13. package/components/Form/ProductConditionsBlock.vue +59 -6
  14. package/components/Input/Datepicker.vue +1 -8
  15. package/components/Input/DynamicInput.vue +23 -0
  16. package/components/Input/FileInput.vue +16 -4
  17. package/components/Input/FormInput.vue +1 -3
  18. package/components/Input/Monthpicker.vue +33 -0
  19. package/components/Input/PanelInput.vue +5 -1
  20. package/components/Input/RoundedEmptyField.vue +5 -0
  21. package/components/Input/RoundedSelect.vue +13 -0
  22. package/components/Input/SwitchInput.vue +64 -0
  23. package/components/Input/TextInput.vue +161 -0
  24. package/components/Layout/Drawer.vue +17 -4
  25. package/components/Layout/Header.vue +23 -2
  26. package/components/Layout/SettingsPanel.vue +13 -7
  27. package/components/Menu/InfoMenu.vue +35 -0
  28. package/components/Menu/MenuNav.vue +17 -2
  29. package/components/Pages/Anketa.vue +140 -52
  30. package/components/Pages/Auth.vue +12 -1
  31. package/components/Pages/ContragentForm.vue +129 -50
  32. package/components/Pages/Documents.vue +72 -7
  33. package/components/Pages/InvoiceInfo.vue +1 -1
  34. package/components/Pages/MemberForm.vue +269 -96
  35. package/components/Pages/ProductAgreement.vue +1 -8
  36. package/components/Pages/ProductConditions.vue +798 -168
  37. package/components/Panel/PanelHandler.vue +373 -45
  38. package/components/Panel/PanelSelectItem.vue +17 -2
  39. package/components/Panel/RightPanelCloser.vue +7 -0
  40. package/components/Transitions/Animation.vue +28 -0
  41. package/composables/axios.ts +2 -1
  42. package/composables/classes.ts +415 -8
  43. package/composables/constants.ts +65 -2
  44. package/composables/fields.ts +291 -0
  45. package/composables/index.ts +58 -5
  46. package/composables/styles.ts +22 -10
  47. package/layouts/default.vue +48 -3
  48. package/locales/ru.json +460 -12
  49. package/nuxt.config.ts +1 -1
  50. package/package.json +25 -22
  51. package/pages/Token.vue +1 -12
  52. package/plugins/helperFunctionsPlugins.ts +0 -3
  53. package/plugins/vuetifyPlugin.ts +2 -0
  54. package/store/data.store.ts +1031 -224
  55. package/store/extractStore.ts +17 -0
  56. package/store/form.store.ts +13 -1
  57. package/store/member.store.ts +1 -1
  58. package/store/rules.ts +53 -5
  59. package/types/enum.ts +37 -0
  60. package/types/form.ts +94 -0
  61. package/types/index.ts +216 -20
@@ -1,4 +1,4 @@
1
- import { AxiosInstance } from 'axios';
1
+ import { AxiosError, AxiosInstance } from 'axios';
2
2
 
3
3
  export default function (axios: AxiosInstance) {
4
4
  axios.interceptors.request.use(
@@ -7,9 +7,51 @@ export default function (axios: AxiosInstance) {
7
7
  if (dataStore.accessToken) {
8
8
  request.headers.Authorization = `Bearer ${dataStore.accessToken}`;
9
9
  }
10
+ if (request.url && request.baseURL) {
11
+ const host = window.location.hostname;
12
+ if (host.startsWith('bpmsrv02')) {
13
+ if (request.baseURL === 'https://products.halyklife.kz/api/v1/insis') {
14
+ request.baseURL = 'http://bpmsrv02.halyklife.nb';
15
+ }
16
+ if (request.baseURL === 'https://products.halyklife.kz/efo/api') {
17
+ request.baseURL = 'http://efo-prod.halyklife.nb/api';
18
+ }
19
+ if (request.baseURL === 'https://products.halyklife.kz/aml/api') {
20
+ request.baseURL = 'http://aml-prod.halyklife.nb/api';
21
+ }
22
+ }
23
+ if (host.startsWith('vega')) {
24
+ if (request.baseURL === 'https://products.halyklife.kz/api/v1/test/insis') {
25
+ request.baseURL = 'http://vega:84';
26
+ }
27
+ if (request.baseURL === 'https://products.halyklife.kz/test/efo/api') {
28
+ request.baseURL = 'http://efo-dev.halyklife.nb/api';
29
+ }
30
+ if (request.baseURL === 'https://products.halyklife.kz/test/aml/api') {
31
+ request.baseURL = 'http://aml-dev.halyklife.nb/api';
32
+ }
33
+ }
34
+ if (import.meta.env.VITE_ON_NEW_API === 'true') {
35
+ if (request.url.includes('api/Application')) {
36
+ if (request.baseURL === 'http://vega:84') {
37
+ request.baseURL = 'http://efo-dev.halyklife.nb/api';
38
+ }
39
+ if (request.baseURL === 'http://bpmsrv02.halyklife.nb') {
40
+ request.baseURL = 'http://efo-prod.halyklife.nb/api';
41
+ }
42
+ request.url = request.url.replace('/api/Application', '');
43
+ if (request.baseURL.includes('api/v1/insis')) {
44
+ request.baseURL = request.baseURL.replace('api/v1/insis', 'efo/api');
45
+ }
46
+ if (request.baseURL.includes('api/v1/test/insis')) {
47
+ request.baseURL = request.baseURL.replace('api/v1/test/insis', 'test/efo/api');
48
+ }
49
+ }
50
+ }
51
+ }
10
52
  return request;
11
53
  },
12
- error => {
54
+ (error: AxiosError) => {
13
55
  return Promise.reject(error);
14
56
  },
15
57
  );
@@ -17,22 +59,24 @@ export default function (axios: AxiosInstance) {
17
59
  response => {
18
60
  return response;
19
61
  },
20
- error => {
62
+ (error: AxiosError) => {
21
63
  const dataStore = useDataStore();
22
64
  if (!dataStore.isCalculator) {
23
65
  const router = useRouter();
24
- if (error.response.status === 401) {
25
- dataStore.$reset();
26
- localStorage.clear();
27
- if (dataStore.isBridge) {
28
- router.push({ name: 'Auth', query: { error: 401 } });
29
- } else {
30
- dataStore.sendToParent(constants.postActions.Error401, 401);
66
+ if (error && error.response && error.response.status) {
67
+ if (error.response.status === 401) {
68
+ dataStore.$reset();
69
+ localStorage.clear();
70
+ if (dataStore.isBridge) {
71
+ router.push({ name: 'Auth', query: { error: 401 } });
72
+ } else {
73
+ dataStore.sendToParent(constants.postActions.Error401, 401);
74
+ }
31
75
  }
32
- }
33
- if (error.response.status >= 500) {
34
- if (router.currentRoute.value.name !== 'Auth') {
35
- dataStore.showToaster('error', error.stack, 5000);
76
+ if (error.response.status >= 500) {
77
+ if (router.currentRoute.value.name !== 'Auth') {
78
+ dataStore.showToaster('error', error.stack ?? dataStore.t('toaster.error'), 5000);
79
+ }
36
80
  }
37
81
  }
38
82
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <button
3
3
  type="button"
4
- class="transition-all"
4
+ class="transition-all border-solid"
5
5
  @click="$emit('clicked')"
6
6
  :disabled="disabled || loading"
7
7
  :class="[
@@ -12,7 +12,7 @@
12
12
  ]"
13
13
  >
14
14
  <base-loader v-if="loading" :size="24" color="#FFF" bg-color="" :width="2" />
15
- <span v-if="!loading">{{ text }}</span>
15
+ <span class="!text-inherit" v-if="!loading">{{ text }}</span>
16
16
  </button>
17
17
  </template>
18
18
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div class="text-left p-6 mb-4" :class="[color, $styles.rounded, $styles.textTitle]">
3
- <v-icon :icon="icon" class="mr-4"></v-icon>
2
+ <div class="text-left p-6" :class="[color, $styles.rounded, $styles.textTitle]">
3
+ <v-icon :icon="icon" class="mr-4" />
4
4
  {{ text }}
5
5
  </div>
6
6
  </template>
@@ -33,7 +33,7 @@ export default defineComponent({
33
33
  },
34
34
  moreIcon: {
35
35
  type: String,
36
- default: 'mdi-cog-outline',
36
+ default: 'mdi-dots-vertical',
37
37
  },
38
38
  title: {
39
39
  type: String,
@@ -1,18 +1,25 @@
1
1
  <template>
2
- <v-dialog :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :persistent="true">
3
- <v-card class="self-center w-full sm:w-3/4 md:w-2/3 lg:w-2/4 xl:w-[600px] rounded-lg !p-2">
4
- <v-card-title>
5
- <slot v-if="!title" name="title"></slot>
6
- {{ title }}
7
- <v-btn class="!absolute top-2 right-3" icon="mdi mdi-window-close" variant="plain" @click="$emit('update:modelValue', null)" />
8
- </v-card-title>
9
- <v-card-subtitle>
10
- <slot v-if="!subtitle" name="subtitle"></slot>
11
- {{ subtitle }}
12
- </v-card-subtitle>
13
- <v-card-actions class="gap-[16px] m-2">
14
- <base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$dataStore.t('confirm.yes')" :btn="$styles.blueBtn" @click="$emit('yes')" />
15
- <base-btn v-if="actions === 'default'" class="!w-fit px-6" size="sm" :text="$dataStore.t('confirm.no')" :btn="$styles.blueBtn" @click="$emit('no')" />
2
+ <v-dialog class="base-dialog" :model-value="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :persistent="true">
3
+ <v-card class="self-center w-full sm:w-4/4 md:w-2/3 lg:w-[35%] xl:w-[500px] rounded-lg !p-[36px]">
4
+ <div class="flex sm:flex-row flex-col place-items-center sm:place-items-start">
5
+ <div class="h-20 w-20 place-items-start pt-1">
6
+ <div class="bg-[#F7F7F7] h-24 w-24 sm:h-16 sm:w-16 rounded grid place-items-center invisible sm:visible">
7
+ <i :class="'mdi-' + icon.mdi" class="mdi text-[100px] sm:text-[30px] color-blue visible !ml-[-10px] sm:!ml-[0px] mt-[-50px] sm:mt-0" :style="{ color: icon.color }"></i>
8
+ </div>
9
+ </div>
10
+ <v-card-title class="!text-center sm:!text-start text-[34px]">
11
+ <slot v-if="!title" name="title"></slot>
12
+ <div></div>
13
+ {{ title }}
14
+ <v-card-subtitle class="!p-0">
15
+ <slot v-if="!subtitle" name="subtitle"></slot>
16
+ {{ subtitle }}
17
+ </v-card-subtitle>
18
+ </v-card-title>
19
+ </div>
20
+ <v-card-actions class="!p-0 pt-5 gap-[16px] sm:flex-row flex-col place-items-stretch sm:place-items-center">
21
+ <base-btn v-if="actions === 'default'" class="px-6" size="sm" :text="confirm" :btn="$styles.whiteBorderBtn" :classes="$styles.blueText" @click="$emit('yes')" />
22
+ <base-btn v-if="actions === 'default'" class="px-6" size="sm" :text="$dataStore.t('confirm.cancel')" :btn="$styles.blueBtn" @click="$emit('no')" />
16
23
  <slot v-if="actions !== 'default'" name="actions"></slot>
17
24
  </v-card-actions>
18
25
  </v-card>
@@ -29,7 +36,7 @@ export default defineComponent({
29
36
  title: {
30
37
  type: String,
31
38
  default() {
32
- return useDataStore().t('dialog.title');
39
+ return useDataStore().t('dialog.confirmDo');
33
40
  },
34
41
  },
35
42
  subtitle: {
@@ -40,7 +47,45 @@ export default defineComponent({
40
47
  type: String,
41
48
  default: 'default',
42
49
  },
50
+ confirm: {
51
+ type: String,
52
+ default() {
53
+ return useDataStore().t('confirm.yes');
54
+ },
55
+ },
56
+ icon: {
57
+ type: Object as PropType<{ mdi?: string; color?: string; bg?: string }>,
58
+ default: {
59
+ mdi: 'information',
60
+ color: '#FAB31C',
61
+ },
62
+ },
43
63
  },
44
64
  emits: ['update:modelValue', 'yes', 'no'],
45
65
  });
46
66
  </script>
67
+ <style>
68
+ .base-dialog .v-card-title {
69
+ font-size: 18px;
70
+ }
71
+ .base-dialog .v-card-subtitle {
72
+ font-size: 14px;
73
+ }
74
+ @media (max-width: 640px) {
75
+ .base-dialog .v-card-title {
76
+ margin-top: 10px;
77
+ font-size: 20px;
78
+ }
79
+ .base-dialog .v-card-subtitle {
80
+ font-size: 14px;
81
+ }
82
+ }
83
+ .base-dialog .v-card-title,
84
+ .base-dialog .v-card-subtitle {
85
+ padding-top: 0;
86
+ flex: 1;
87
+ overflow-wrap: normal;
88
+ overflow: visible;
89
+ white-space: normal;
90
+ }
91
+ </style>
@@ -0,0 +1,100 @@
1
+ <template>
2
+ <v-form class="dynamic-form">
3
+ <base-form-section v-for="(section, sectionIndex) in form.sections" :key="sectionIndex" class="rounded-lg" :title="section.title">
4
+ <base-dynamic-input :fields="section.fields" @onClickField="onClickField" />
5
+ </base-form-section>
6
+ <Teleport v-if="isPanelOpen" to="#right-panel-actions">
7
+ <div :class="[$styles.scrollPage]" class="flex flex-col items-center">
8
+ <base-rounded-input v-model="searchQuery" :label="$dataStore.t('labels.search')" class="w-full p-2" :hide-details="true" />
9
+ <div v-if="panelList && isPanelLoading === false" class="w-full flex flex-col gap-2 p-2">
10
+ <base-panel-select-item :text="$dataStore.t('form.notChosen')" :selected="panelValue.nameRu === null" @click="pickPanelValue(new Value())" />
11
+ <base-panel-select-item
12
+ v-for="(item, index) of panelList.filter(i => i.nameRu && (i.nameRu as string).match(new RegExp(searchQuery, 'i')))"
13
+ :key="index"
14
+ :text="(item.nameRu as string)"
15
+ :selected="item.nameRu === panelValue"
16
+ @click="pickPanelValue(item)"
17
+ />
18
+ </div>
19
+ <base-loader v-if="isPanelLoading" class="absolute mt-10" :size="50" />
20
+ </div>
21
+ </Teleport>
22
+ </v-form>
23
+ </template>
24
+
25
+ <script lang="ts">
26
+ import { Value } from '#imports';
27
+
28
+ export default defineComponent({
29
+ props: {
30
+ form: {
31
+ type: Object as PropType<DynamicForm>,
32
+ required: true,
33
+ },
34
+ },
35
+ setup() {
36
+ const dataStore = useDataStore();
37
+ const isPanelOpen = ref<boolean>(false);
38
+ const panelValue = ref<any>(new Value());
39
+ const panelList = ref<Value[]>([]);
40
+ const isPanelLoading = ref<boolean>(false);
41
+ const searchQuery = ref<string>('');
42
+ const listOfPanelTitles: {
43
+ [key in FetchFunctions]: string;
44
+ } = {
45
+ getResidents: 'form.signOfResidency',
46
+ getFamilyStatuses: 'form.familyStatus',
47
+ getRelationTypes: 'form.relations',
48
+ getCountries: 'form.Country',
49
+ getLocalityTypes: 'form.RegionType',
50
+ getStates: 'form.Province',
51
+ getCities: 'form.City',
52
+ getRegions: 'form.Region',
53
+ getDocumentTypes: 'form.documentType',
54
+ getTaxCountries: 'form.countryOfTaxResidency',
55
+ getCitizenshipCountries: 'form.countryOfCitizenship',
56
+ getSectorCodeList: 'form.economySectorCode',
57
+ getInsurancePay: 'form.insurancePay',
58
+ getEconomicActivityType: 'form.typeEconomicActivity',
59
+ getBanks: 'form.bankName',
60
+ getDocumentIssuers: 'form.documentIssuers',
61
+ getGenderList: 'form.gender',
62
+ };
63
+
64
+ const currentField = ref<InputType | null>(null);
65
+
66
+ const pickPanelValue = (item: Value) => {
67
+ if (currentField.value) {
68
+ currentField.value.modelValue = item;
69
+ dataStore.rightPanel.open = false;
70
+ searchQuery.value = '';
71
+ currentField.value = null;
72
+ }
73
+ isPanelOpen.value = false;
74
+ };
75
+
76
+ const onClickField = async (field: InputType) => {
77
+ currentField.value = field;
78
+ if (field.fetchFrom) {
79
+ isPanelLoading.value = true;
80
+ isPanelOpen.value = true;
81
+ dataStore.rightPanel.open = true;
82
+ dataStore.rightPanel.title = dataStore.t(listOfPanelTitles[field.fetchFrom]);
83
+ panelValue.value = field.modelValue;
84
+ panelList.value = (await dataStore[field.fetchFrom]()) as Value[];
85
+ isPanelLoading.value = false;
86
+ }
87
+ };
88
+
89
+ return {
90
+ panelValue,
91
+ panelList,
92
+ isPanelOpen,
93
+ isPanelLoading,
94
+ searchQuery,
95
+ pickPanelValue,
96
+ onClickField,
97
+ };
98
+ },
99
+ });
100
+ </script>
@@ -6,7 +6,7 @@
6
6
  <div
7
7
  v-if="isMultiple && more && !isShort && isActionsAvailable"
8
8
  :class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, disabled ? $styles.disabled : 'cursor-pointer']"
9
- class="lg:flex transition-all rounded-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
9
+ class="hidden lg:flex transition-all rounded-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
10
10
  @click="!disabled && memberStore.addMember(whichForm)"
11
11
  >
12
12
  {{ $dataStore.t('buttons.add') }}
@@ -33,7 +33,7 @@
33
33
  :class="[isShort ? 'grid-cols-2 md:gap-5 md:grid-cols-2 lg:grid-cols-2' : 'grid-cols-4 md:gap-5 md:grid-cols-4 lg:grid-cols-7']"
34
34
  >
35
35
  <span :class="[getMemberInfo(each).fullName === null && $styles.emptyBlockCol]">{{ getMemberInfo(each).fullName }}</span>
36
- <span :class="[getMemberInfo(each).iin === null && $styles.emptyBlockCol]">{{ getMemberInfo(each).iin }}</span>
36
+ <span :class="[getMemberInfo(each).iin === null && $styles.emptyBlockCol]">{{ getMemberIIN(each) }}</span>
37
37
  <span v-if="!isShort" :class="[getMemberInfo(each).gender === null && $styles.emptyBlockCol]" class="hidden lg:block">{{ getMemberInfo(each).gender }} </span>
38
38
  <span v-if="!isShort" :class="[getMemberInfo(each).birthDate === null && $styles.emptyBlockCol]"> {{ getMemberInfo(each).birthDate }} </span>
39
39
  <span v-if="!isShort" :class="[getMemberInfo(each).birthPlace === null && $styles.emptyBlockCol]" class="hidden lg:block"> {{ getMemberInfo(each).birthPlace }} </span>
@@ -75,7 +75,7 @@
75
75
  <div
76
76
  v-if="isMultiple && more && !isShort && isActionsAvailable"
77
77
  :class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, disabled ? $styles.disabled : 'cursor-pointer']"
78
- class="lg:hidden transition-all rounded-b-lg h-[36px] flex items-center font-medium justify-center opacity-50 hover:opacity-90"
78
+ class="flex lg:hidden transition-all rounded-b-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90"
79
79
  @click="!disabled && memberStore.addMember(whichForm)"
80
80
  >
81
81
  {{ $dataStore.t('buttons.add') }}
@@ -116,6 +116,7 @@ export default defineComponent({
116
116
  },
117
117
  emits: ['onMore', 'addMember'],
118
118
  setup(props) {
119
+ const dataStore = useDataStore();
119
120
  const formStore = useFormStore();
120
121
  const memberStore = useMemberStore();
121
122
  const isMultiple = computed(() => [StoreMembers.insuredForm, StoreMembers.beneficiaryForm, StoreMembers.beneficialOwnerForm].includes(props.whichForm as StoreMembers));
@@ -128,6 +129,13 @@ export default defineComponent({
128
129
 
129
130
  const isShort = computed(() => props.type === 'short');
130
131
  const isActionsAvailable = computed(() => memberStore.isStatementEditible(props.whichForm));
132
+ const getMemberIIN = (each: Member) => {
133
+ const iin = getMemberInfo(each).iin;
134
+ if (dataStore.isFinCenter() && iin) {
135
+ return iin.replaceAll('-', '');
136
+ }
137
+ return iin;
138
+ };
131
139
 
132
140
  const getMemberInfo = (memberData: Member) => {
133
141
  return {
@@ -153,6 +161,7 @@ export default defineComponent({
153
161
  isActionsAvailable,
154
162
 
155
163
  // Functions
164
+ getMemberIIN,
156
165
  getMemberInfo,
157
166
  };
158
167
  },
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <base-animation :type="animation">
3
+ <div
4
+ v-if="block && !!block.show === true"
5
+ class="form-data-block rounded-lg border-[1px] relative transition-all"
6
+ :class="[$styles.whiteBg, block.disabled && $styles.disabled]"
7
+ >
8
+ <div class="py-3 px-6">
9
+ <div class="flex items-center justify-between">
10
+ <p :class="[$styles.textTitle, $styles.greenText]">{{ block.title }}</p>
11
+ <div
12
+ v-if="typeof block.headerBtn === 'object'"
13
+ :class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, block.disabled ? $styles.disabled : 'cursor-pointer']"
14
+ class="hidden lg:flex transition-all rounded-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90 w-[120px]"
15
+ @click="!block.disabled && block.headerBtn.action()"
16
+ >
17
+ {{ block.headerBtn.text }}
18
+ </div>
19
+ </div>
20
+ <p v-if="block.subtitle" :class="[$styles.greyText, $styles.textSimple]">{{ block.subtitle }}</p>
21
+ <v-row class="mt-1 max-w-[97%]">
22
+ <v-col v-for="(label, index) in visibleLabels" :key="index" :cols="block.shrinkLabels === true ? false : label.size">
23
+ <p :class="[$styles.textSimple]" class="font-medium">
24
+ {{ label.text }}
25
+ </p>
26
+ </v-col>
27
+ </v-row>
28
+ <div v-if="hasBlockData(block.data)">
29
+ <v-row v-for="(row, index) in getBlockDataValue(block.data)" :key="index" class="min-h-[65px] max-w-[97%]">
30
+ <v-col
31
+ v-if="row.every((i: any) => !!i)"
32
+ v-for="each of row.filter((_: any, i: number) => $display().lgAndUp.value ? true : block.labels[i].hideOnMobile === false)"
33
+ :key="each"
34
+ >
35
+ <p :class="[$styles.textSimple]">
36
+ {{ each }}
37
+ </p>
38
+ </v-col>
39
+ <v-col v-else :class="[$styles.textSimple, $styles.blueText]">{{ block.noValueText ?? $dataStore.t('clients.necessaryFillForm') }}</v-col>
40
+ <base-animation type="fade">
41
+ <div
42
+ v-if="block.btn && !!block.btn.showBtn === true"
43
+ class="absolute right-0 rounded-br-lg transition-all h-[70px] w-[60px] place-self-end flex items-center justify-center"
44
+ :class="[$styles.blueBgLight, $styles.blueBgLightHover, block.disabled ? $styles.disabled : 'cursor-pointer']"
45
+ @click="!block.disabled && block.btn.action({ value: row, index: index })"
46
+ >
47
+ <i class="mdi text-xl" :class="[block.btn.icon]"></i>
48
+ </div>
49
+ </base-animation>
50
+ </v-row>
51
+ </div>
52
+ </div>
53
+ <div
54
+ v-if="typeof block.headerBtn === 'object'"
55
+ :class="[$styles.blueBg, $styles.whiteText, $styles.textSimple, block.disabled ? $styles.disabled : 'cursor-pointer']"
56
+ class="flex lg:hidden transition-all rounded-b-lg h-[36px] items-center font-medium justify-center opacity-50 hover:opacity-90"
57
+ @click="!block.disabled && block.headerBtn.action()"
58
+ >
59
+ {{ block.headerBtn.text }}
60
+ </div>
61
+ </div>
62
+ </base-animation>
63
+ </template>
64
+
65
+ <script lang="ts">
66
+ import { ComputedRefWithControl } from '@vueuse/core';
67
+ import { FormBlock } from '../../composables/fields';
68
+
69
+ export default defineComponent({
70
+ props: {
71
+ block: {
72
+ type: Object as PropType<FormBlock>,
73
+ required: true,
74
+ },
75
+ animation: {
76
+ type: String as PropType<VuetifyAnimations>,
77
+ required: false,
78
+ },
79
+ },
80
+ setup(props) {
81
+ const display = useDisplayInfo();
82
+ const visibleLabels = computed(() => (display.lgAndUp.value ? props.block.labels : props.block.labels.filter(i => i.hideOnMobile === false)));
83
+
84
+ const hasBlockData = (data: ComputedRefWithControl<any> | string[][]) => {
85
+ if (data) {
86
+ if ('value' in data && data.value && data.value.length) {
87
+ return true;
88
+ }
89
+ if ('value' in data === false && Array.isArray(data) && data.length) {
90
+ return true;
91
+ }
92
+ }
93
+ return false;
94
+ };
95
+ const getBlockDataValue = (data: ComputedRefWithControl<any> | string[][]) => ('value' in data ? data.value : data);
96
+
97
+ return {
98
+ // Computed
99
+ visibleLabels,
100
+
101
+ // Functions
102
+ hasBlockData,
103
+ getBlockDataValue,
104
+ };
105
+ },
106
+ });
107
+ </script>
108
+
109
+ <style>
110
+ .form-data-block .v-col {
111
+ display: flex;
112
+ align-items: center;
113
+ }
114
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="h-[74px] !pl-2 md:!pl-5 flex items-center justify-start gap-4"
3
+ class="min-h-[74px] !pl-2 md:!pl-5 flex items-center justify-start gap-5"
4
4
  :class="[$styles.whiteBg, hasBorder ? 'border-[1px] rounded-lg' : 'border-b-[1px] border-b-[#f3f6fc] rounded']"
5
5
  >
6
6
  <v-switch
@@ -14,8 +14,10 @@
14
14
  hide-details
15
15
  :disabled="disabled"
16
16
  />
17
- <p :class="[$styles.textSimple]">{{ `${title}` }}</p>
18
- <p class="mr-3" :class="[modelValue ? $styles.greenText : '', $styles.textSimple]">{{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}</p>
17
+ <p class="p-2" :class="[$styles.textSimple]">{{ `${title}` }}</p>
18
+ <p v-if="showValue" class="mr-3" :class="[modelValue ? $styles.greenText : '', $styles.textSimple]">
19
+ {{ `${modelValue ? $dataStore.t('confirm.yes') : $dataStore.t('confirm.no')}` }}
20
+ </p>
19
21
  </div>
20
22
  </template>
21
23
 
@@ -38,6 +40,10 @@ export default defineComponent({
38
40
  type: Boolean,
39
41
  default: true,
40
42
  },
43
+ showValue: {
44
+ type: Boolean,
45
+ default: true,
46
+ },
41
47
  },
42
48
  emits: ['update:modelValue', 'clicked'],
43
49
  });