hl-core 0.0.9-beta.8 → 0.0.10-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/api/base.api.ts +1109 -0
- package/api/index.ts +2 -620
- package/api/interceptors.ts +38 -1
- package/components/Button/Btn.vue +1 -6
- package/components/Complex/MessageBlock.vue +1 -1
- package/components/Complex/Page.vue +1 -1
- package/components/Complex/TextBlock.vue +23 -0
- package/components/Dialog/Dialog.vue +70 -16
- package/components/Dialog/FamilyDialog.vue +1 -1
- package/components/Form/DynamicForm.vue +100 -0
- package/components/Form/FormBlock.vue +12 -3
- package/components/Form/FormData.vue +110 -0
- package/components/Form/FormSection.vue +3 -3
- package/components/Form/FormTextSection.vue +11 -3
- package/components/Form/FormToggle.vue +25 -5
- package/components/Form/ManagerAttachment.vue +177 -89
- package/components/Form/ProductConditionsBlock.vue +59 -6
- package/components/Input/Datepicker.vue +43 -7
- package/components/Input/DynamicInput.vue +23 -0
- package/components/Input/FileInput.vue +25 -5
- package/components/Input/FormInput.vue +7 -4
- package/components/Input/Monthpicker.vue +34 -0
- package/components/Input/PanelInput.vue +5 -1
- package/components/Input/RoundedSelect.vue +7 -2
- package/components/Input/SwitchInput.vue +64 -0
- package/components/Input/TextInput.vue +160 -0
- package/components/Layout/Drawer.vue +17 -4
- package/components/Layout/Header.vue +23 -2
- package/components/Layout/Loader.vue +2 -1
- package/components/Layout/SettingsPanel.vue +24 -11
- package/components/Menu/InfoMenu.vue +35 -0
- package/components/Menu/MenuNav.vue +25 -3
- package/components/Pages/Anketa.vue +254 -65
- package/components/Pages/Auth.vue +56 -9
- package/components/Pages/ContragentForm.vue +9 -9
- package/components/Pages/Documents.vue +266 -30
- package/components/Pages/InvoiceInfo.vue +1 -1
- package/components/Pages/MemberForm.vue +774 -102
- package/components/Pages/ProductAgreement.vue +1 -8
- package/components/Pages/ProductConditions.vue +1132 -180
- package/components/Panel/PanelHandler.vue +632 -50
- package/components/Panel/PanelSelectItem.vue +17 -2
- package/components/Panel/RightPanelCloser.vue +7 -0
- package/components/Transitions/Animation.vue +28 -0
- package/components/Utilities/JsonViewer.vue +3 -2
- package/components/Utilities/Qr.vue +44 -0
- package/composables/axios.ts +1 -0
- package/composables/classes.ts +501 -14
- package/composables/constants.ts +126 -6
- package/composables/fields.ts +328 -0
- package/composables/index.ts +355 -20
- package/composables/styles.ts +23 -6
- package/configs/pwa.ts +63 -0
- package/layouts/clear.vue +21 -0
- package/layouts/default.vue +62 -3
- package/layouts/full.vue +21 -0
- package/locales/ru.json +559 -16
- package/nuxt.config.ts +11 -15
- package/package.json +36 -39
- package/pages/Token.vue +0 -13
- package/plugins/head.ts +26 -0
- package/plugins/vuetifyPlugin.ts +1 -5
- package/store/data.store.ts +1610 -321
- package/store/extractStore.ts +17 -0
- package/store/form.store.ts +13 -1
- package/store/member.store.ts +1 -1
- package/store/rules.ts +97 -3
- package/store/toast.ts +1 -1
- package/types/enum.ts +81 -0
- package/types/env.d.ts +2 -0
- package/types/form.ts +94 -0
- package/types/index.ts +419 -24
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PiniaCustomStateProperties, StoreActions, StoreGeneric, StoreGetters, StoreState } from 'pinia';
|
|
2
|
+
import type { ToRefs } from 'vue';
|
|
3
|
+
import { isReactive, isRef, toRaw, toRef } from 'vue';
|
|
4
|
+
type Extracted<SS> = ToRefs<StoreState<SS> & StoreGetters<SS> & PiniaCustomStateProperties<StoreState<SS>>> & StoreActions<SS>;
|
|
5
|
+
export function extractStore<SS extends StoreGeneric>(store: SS): Extracted<SS> {
|
|
6
|
+
const rawStore = toRaw(store);
|
|
7
|
+
const refs: Record<string, unknown> = {};
|
|
8
|
+
|
|
9
|
+
for (const [key, value] of Object.entries(rawStore)) {
|
|
10
|
+
if (isRef(value) || isReactive(value)) {
|
|
11
|
+
refs[key] = toRef(store, key);
|
|
12
|
+
} else if (typeof value === 'function') {
|
|
13
|
+
refs[key] = value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return refs as Extracted<SS>;
|
|
17
|
+
}
|
package/store/form.store.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { defineStore } from 'pinia';
|
|
2
|
-
import { FormStoreClass } from '../composables/classes';
|
|
2
|
+
import { BeneficialOwner, FormStoreClass, PolicyholderActivity } from '../composables/classes';
|
|
3
3
|
|
|
4
4
|
export const useFormStore = defineStore('forms', {
|
|
5
5
|
state: () => ({
|
|
6
6
|
...new FormStoreClass(),
|
|
7
7
|
}),
|
|
8
|
+
actions: {
|
|
9
|
+
addMember(whichMember: 'policyholder' | 'beneficialOwner') {
|
|
10
|
+
if (whichMember === 'policyholder') {
|
|
11
|
+
this.lfb.policyholderActivities.push(new PolicyholderActivity());
|
|
12
|
+
}
|
|
13
|
+
if (whichMember === 'beneficialOwner') {
|
|
14
|
+
if (this.lfb.beneficialOwners.length !== 3) {
|
|
15
|
+
this.lfb.beneficialOwners.push(new BeneficialOwner());
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
},
|
|
8
20
|
});
|
package/store/member.store.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const useMemberStore = defineStore('members', {
|
|
|
13
13
|
formStore: useFormStore(),
|
|
14
14
|
}),
|
|
15
15
|
actions: {
|
|
16
|
-
isStatementEditible(whichForm: keyof typeof StoreMembers | 'productConditionsForm', showToaster: boolean = false) {
|
|
16
|
+
isStatementEditible(whichForm: keyof typeof StoreMembers | 'productConditionsForm' | 'calculatorForm', showToaster: boolean = false) {
|
|
17
17
|
if (!this.validateInitiator(false)) return false;
|
|
18
18
|
if (this.formStore.isDisabled[whichForm as keyof typeof this.formStore.isDisabled] === true) {
|
|
19
19
|
if (showToaster) this.dataStore.showToaster('error', this.dataStore.t('toaster.viewErrorText'), 2000);
|
package/store/rules.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { i18n } from '../configs/i18n';
|
|
2
|
-
import { formatDate } from '../composables';
|
|
2
|
+
import { formatDate, useMask } from '../composables';
|
|
3
3
|
|
|
4
4
|
const t = i18n.t;
|
|
5
5
|
|
|
6
6
|
export const rules = {
|
|
7
7
|
recalculationMultiply: [(v: any) => (v !== null && v !== '' && v >= 100) || t('toaster.valueShouldBeHigher', { text: '100' })],
|
|
8
|
+
recalculationMultiplyBetween: [(v: any) => (v !== null && v !== '' && v >= 100 && v <= 200) || t('toaster.recalculationMultiplyBetween', { floor: '100', ceil: '200' })],
|
|
8
9
|
recalculationAdditive: [(v: any) => (v !== null && v !== '' && v <= 100 && v >= 0) || t('toaster.valueShouldBeBetween', { floor: '0', ceil: '100' })],
|
|
9
10
|
required: [(v: any) => !!v || t('rules.required')],
|
|
11
|
+
notZero: [(v: any) => Number(v) !== 0 || 'Не может быть равно нулю'],
|
|
12
|
+
iik: [(v: any) => v.length === 20 || t('rules.iik')],
|
|
13
|
+
agentCommission: [(v: any) => v <= 50 || t('rules.agentCommission')],
|
|
10
14
|
objectRequired: [
|
|
11
15
|
(v: any) => {
|
|
12
16
|
if (!!v && 'nameRu' in v && v.nameRu != null) {
|
|
@@ -15,6 +19,7 @@ export const rules = {
|
|
|
15
19
|
return t('rules.required');
|
|
16
20
|
},
|
|
17
21
|
],
|
|
22
|
+
arrayRequired: [(v: any) => (v && v.length > 0) || t('rules.required')],
|
|
18
23
|
agentDataRequired: [
|
|
19
24
|
(v: any) => {
|
|
20
25
|
if (!!v && 'fullName' in v && v.fullName != null) {
|
|
@@ -34,12 +39,25 @@ export const rules = {
|
|
|
34
39
|
return t('rules.required');
|
|
35
40
|
},
|
|
36
41
|
],
|
|
37
|
-
|
|
42
|
+
noResidentOffline: [
|
|
43
|
+
(v: any) => {
|
|
44
|
+
if (!!v && 'nameRu' in v && v.nameRu === 'Нерезидент') {
|
|
45
|
+
return t('rules.noResidentOffline');
|
|
46
|
+
}
|
|
47
|
+
if (!!v && 'nameRu' in v && !!v.nameRu) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
return t('rules.required');
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
cyrillic: [(v: any) => v === null || /^[\u0400-\u04FF -]+$/.test(v) || t('rules.cyrillic')],
|
|
54
|
+
latin: [(v: any) => v === null || /^[a-zA-Z]+$/.test(v) || t('rules.latin')],
|
|
55
|
+
latinAndNumber: [(v: any) => v === null || /^[0-9a-zA-Z]+$/.test(v) || t('rules.latinAndNumber')],
|
|
38
56
|
cyrillicNonRequired: [
|
|
39
57
|
(v: any) => {
|
|
40
58
|
if (!v) return true;
|
|
41
59
|
else {
|
|
42
|
-
return /^[\u0400-\u04FF ]+$/.test(v) || t('rules.cyrillic');
|
|
60
|
+
return /^[\u0400-\u04FF -]+$/.test(v) || t('rules.cyrillic');
|
|
43
61
|
}
|
|
44
62
|
},
|
|
45
63
|
],
|
|
@@ -63,6 +81,8 @@ export const rules = {
|
|
|
63
81
|
numbers: [(v: any) => /^[0-9]+$/.test(v) || t('rules.numbers')],
|
|
64
82
|
numbersSymbols: [(v: any) => /^([0-9])|(\W|_)+$/.test(v) || t('rules.numbersSymbols')],
|
|
65
83
|
ageExceeds: [(v: any) => v < 50 || t('rules.ageExceeds')],
|
|
84
|
+
ageExceeds80: [(v: any) => v <= 80 || t('rules.ageExceeds80')],
|
|
85
|
+
ageExceeds80ByDate: [(v: any) => Math.abs(new Date(Date.now() - new Date(formatDate(v)!).getTime()).getUTCFullYear() - 1970) <= 80 || t('rules.ageExceeds80')],
|
|
66
86
|
sums: [
|
|
67
87
|
(v: any) => {
|
|
68
88
|
let str = v.replace(/\s/g, '');
|
|
@@ -72,6 +92,16 @@ export const rules = {
|
|
|
72
92
|
return t('rules.sums');
|
|
73
93
|
},
|
|
74
94
|
],
|
|
95
|
+
planDate: [
|
|
96
|
+
(v: any) => {
|
|
97
|
+
if (new Date(formatDate(v)!) < new Date(Date.now())) return t('rules.planDate');
|
|
98
|
+
if (/^(0[1-9]|1[0-9]|2[0-9]|3[0-1])(-|\.)(0[1-9]|1[0-2])(-|\.)(19[0-9]{2}|20[0-9][0-9])$/.test(v)) {
|
|
99
|
+
return true;
|
|
100
|
+
} else {
|
|
101
|
+
return t('rules.date');
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
],
|
|
75
105
|
iinRight: [
|
|
76
106
|
(v: any) => {
|
|
77
107
|
if (v.length !== useMask().iin.length) {
|
|
@@ -161,6 +191,18 @@ export const rules = {
|
|
|
161
191
|
}
|
|
162
192
|
},
|
|
163
193
|
],
|
|
194
|
+
coverPeriodFrom1or5to15: [
|
|
195
|
+
(v: any) => {
|
|
196
|
+
if (v !== null) {
|
|
197
|
+
if (v == 1 || (v >= 5 && v <= 15)) {
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
return t('productConditionsForm.coverPeriodFrom1or5to15');
|
|
201
|
+
} else {
|
|
202
|
+
return t('productConditionsForm.coverPeriodFrom1or5to15');
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
],
|
|
164
206
|
requestedSumInsuredMycar: [
|
|
165
207
|
(v: any) => {
|
|
166
208
|
if (v !== null) {
|
|
@@ -184,10 +226,62 @@ export const rules = {
|
|
|
184
226
|
],
|
|
185
227
|
policyholderAgeLimit: [(v: any) => v >= 18 || t('rules.policyholderAgeLimit')],
|
|
186
228
|
beneficiaryAgeLimit: [(v: any) => v <= 15 || t('rules.beneficiaryAgeLimit')],
|
|
229
|
+
dateInPast: [
|
|
230
|
+
(v: any) => {
|
|
231
|
+
const givenDate = new Date(formatDate(v)!);
|
|
232
|
+
const currentDate = new Date();
|
|
233
|
+
if (givenDate.getTime() < currentDate.getTime()) {
|
|
234
|
+
return t('rules.dataInPast');
|
|
235
|
+
} else {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
checkDate: [
|
|
241
|
+
(v: any) => {
|
|
242
|
+
const today = new Date();
|
|
243
|
+
const yourDate = new Date(formatDate(v)!);
|
|
244
|
+
if (yourDate.toDateString() === today.toDateString()) {
|
|
245
|
+
return true;
|
|
246
|
+
} else {
|
|
247
|
+
return t('rules.checkDate');
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
twoDayBeforeTodayDate: [
|
|
252
|
+
(v: any) => {
|
|
253
|
+
const now = new Date();
|
|
254
|
+
const today = new Date();
|
|
255
|
+
const yesterday = new Date(now.setDate(now.getDate() - 1));
|
|
256
|
+
const beforeYesterday = new Date(now.setDate(now.getDate() - 1));
|
|
257
|
+
const threeDaysAgo = new Date(now.setDate(now.getDate() - 1));
|
|
258
|
+
const fourDaysAgo = new Date(now.setDate(now.getDate() - 1));
|
|
259
|
+
const yourDate = new Date(formatDate(v)!);
|
|
260
|
+
|
|
261
|
+
if (
|
|
262
|
+
yourDate.toDateString() === today.toDateString() ||
|
|
263
|
+
yourDate.toDateString() === yesterday.toDateString() ||
|
|
264
|
+
yourDate.toDateString() === beforeYesterday.toDateString() ||
|
|
265
|
+
yourDate.toDateString() === threeDaysAgo.toDateString() ||
|
|
266
|
+
yourDate.toDateString() === fourDaysAgo.toDateString()
|
|
267
|
+
) {
|
|
268
|
+
return true;
|
|
269
|
+
} else {
|
|
270
|
+
return t('rules.checkDate');
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
fileRequired: [(v: any) => !!v || t('rules.fileRequired'), (v: any) => (v && v.length > 0) || t('rules.fileRequired')],
|
|
187
275
|
guaranteedPeriodLimit(v: any, termAnnuityPayments: any) {
|
|
188
276
|
if (Number(v) > Number(termAnnuityPayments)) {
|
|
189
277
|
return t('rules.guaranteedPeriodLimit');
|
|
190
278
|
}
|
|
191
279
|
return true;
|
|
192
280
|
},
|
|
281
|
+
fixInsSumLimit(v: any, sum: any) {
|
|
282
|
+
if (Number(v) > Number(sum)) {
|
|
283
|
+
return t('rules.fixInsSumLimit', { sum }) as any;
|
|
284
|
+
}
|
|
285
|
+
return true;
|
|
286
|
+
},
|
|
193
287
|
};
|
package/store/toast.ts
CHANGED
package/types/enum.ts
CHANGED
|
@@ -8,15 +8,49 @@ export enum StoreMembers {
|
|
|
8
8
|
|
|
9
9
|
export enum Actions {
|
|
10
10
|
accept = 'accept',
|
|
11
|
+
acceptCustom = 'acceptCustom',
|
|
12
|
+
|
|
11
13
|
rejectclient = 'rejectclient',
|
|
14
|
+
rejectclientCustom = 'rejectclientCustom',
|
|
15
|
+
|
|
16
|
+
cancel = 'cancel',
|
|
17
|
+
cancelCustom = 'cancelCustom',
|
|
18
|
+
|
|
12
19
|
reject = 'reject',
|
|
20
|
+
rejectCustom = 'rejectCustom',
|
|
21
|
+
|
|
13
22
|
return = 'return',
|
|
23
|
+
returnCustom = 'returnCustom',
|
|
24
|
+
|
|
14
25
|
claim = 'claim',
|
|
26
|
+
claimCustom = 'claimCustom',
|
|
27
|
+
|
|
15
28
|
sign = 'sign',
|
|
29
|
+
signCustom = 'signCustom',
|
|
30
|
+
|
|
31
|
+
signed = 'signed',
|
|
32
|
+
signedCustom = 'signedCustom',
|
|
33
|
+
|
|
16
34
|
pay = 'pay',
|
|
35
|
+
payCustom = 'payCustom',
|
|
36
|
+
|
|
17
37
|
register = 'register',
|
|
38
|
+
registerCustom = 'registerCustom',
|
|
39
|
+
|
|
18
40
|
send = 'send',
|
|
41
|
+
sendCustom = 'sendCustom',
|
|
42
|
+
|
|
19
43
|
affiliate = 'affiliate',
|
|
44
|
+
affiliateCustom = 'affiliateCustom',
|
|
45
|
+
|
|
46
|
+
chooseSign = 'chooseSign',
|
|
47
|
+
chooseSignCustom = 'chooseSignCustom',
|
|
48
|
+
|
|
49
|
+
choosePay = 'choosePay',
|
|
50
|
+
choosePayCustom = 'choosePayCustom',
|
|
51
|
+
|
|
52
|
+
payed = 'payed',
|
|
53
|
+
payedCustom = 'payedCustom',
|
|
20
54
|
}
|
|
21
55
|
|
|
22
56
|
export enum PostActions {
|
|
@@ -32,23 +66,37 @@ export enum PostActions {
|
|
|
32
66
|
Error401 = 'Error401',
|
|
33
67
|
Error500 = 'Error500',
|
|
34
68
|
iframeLoaded = 'iframeLoaded',
|
|
69
|
+
goToProject = 'goToProject',
|
|
35
70
|
}
|
|
36
71
|
|
|
37
72
|
export enum Roles {
|
|
38
73
|
Manager = 'Manager',
|
|
39
74
|
Admin = 'Admin',
|
|
75
|
+
Jurist = 'Jurist',
|
|
40
76
|
Underwriter = 'Underwriter',
|
|
77
|
+
Actuary = 'Actuary',
|
|
41
78
|
Agent = 'Agent',
|
|
42
79
|
Compliance = 'Compliance',
|
|
43
80
|
AgentMycar = 'AgentMycar',
|
|
44
81
|
Analyst = 'Analyst',
|
|
45
82
|
UPK = 'UPK',
|
|
83
|
+
URP = 'URP',
|
|
46
84
|
FinCenter = 'FinCenter',
|
|
47
85
|
Supervisor = 'Supervisor',
|
|
48
86
|
Support = 'Support',
|
|
49
87
|
ManagerHalykBank = 'ManagerHalykBank',
|
|
50
88
|
ServiceManager = 'ServiceManager',
|
|
51
89
|
DRNSJ = 'DRNSJ',
|
|
90
|
+
HeadManager = 'HeadManager',
|
|
91
|
+
AgentAuletti = 'AgentAuletti',
|
|
92
|
+
USNS = 'USNS',
|
|
93
|
+
Accountant = 'Accountant',
|
|
94
|
+
BranchDirector = 'BranchDirector',
|
|
95
|
+
USNSACCINS = 'USNSACCINS',
|
|
96
|
+
Dsuio = 'Dsuio',
|
|
97
|
+
Adjuster = 'Adjuster',
|
|
98
|
+
DsoDirector = 'DsoDirector',
|
|
99
|
+
AccountantDirector = 'AccountantDirector',
|
|
52
100
|
}
|
|
53
101
|
|
|
54
102
|
export enum Statuses {
|
|
@@ -56,6 +104,7 @@ export enum Statuses {
|
|
|
56
104
|
EditForm = 'EditForm',
|
|
57
105
|
EditBeneficiaryForm = 'EditBeneficiaryForm',
|
|
58
106
|
DocumentsSignedFrom = 'DocumentsSignedFrom',
|
|
107
|
+
PreparationDossierForm = 'PreparationDossierForm',
|
|
59
108
|
UnderwriterForm = 'UnderwriterForm',
|
|
60
109
|
AffilationResolutionForm = 'AffilationResolutionForm',
|
|
61
110
|
Completed = 'Completed',
|
|
@@ -64,6 +113,15 @@ export enum Statuses {
|
|
|
64
113
|
WaitingInsurancePremiumForm = 'WaitingInsurancePremiumForm',
|
|
65
114
|
CheckFinCenterForm = 'CheckFinCenterForm',
|
|
66
115
|
RegistryFinCenterForm = 'RegistryFinCenterForm',
|
|
116
|
+
DocumentsSignedClientFrom = 'DocumentsSignedClientFrom',
|
|
117
|
+
InputDataForm = 'InputDataForm',
|
|
118
|
+
ApproveForm = 'ApproveForm',
|
|
119
|
+
AttachAppContractForm = 'AttachAppContractForm',
|
|
120
|
+
ControllerDpForm = 'ControllerDpForm',
|
|
121
|
+
ActuaryForm = 'ActuaryForm',
|
|
122
|
+
DsoUsnsForm = 'DsoUsnsForm',
|
|
123
|
+
AccountantForm = 'AccountantForm',
|
|
124
|
+
HeadManagerForm = 'HeadManagerForm',
|
|
67
125
|
}
|
|
68
126
|
|
|
69
127
|
export enum MemberCodes {
|
|
@@ -81,3 +139,26 @@ export enum MemberAppCodes {
|
|
|
81
139
|
beneficialOwnerApp = 'beneficialOwnerApp',
|
|
82
140
|
spokesmanApp = 'spokesmanApp',
|
|
83
141
|
}
|
|
142
|
+
|
|
143
|
+
export enum Methods {
|
|
144
|
+
GET = 'GET',
|
|
145
|
+
POST = 'POST',
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export namespace Enums {
|
|
149
|
+
export namespace GBD {
|
|
150
|
+
export enum DocTypes {
|
|
151
|
+
'PS' = '001',
|
|
152
|
+
'1UDL' = '002',
|
|
153
|
+
'VNZ' = '003',
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export namespace Insis {
|
|
157
|
+
export enum DocTypes {
|
|
158
|
+
'PS' = 'PS',
|
|
159
|
+
'1UDL' = '1UDL',
|
|
160
|
+
'VNZ' = 'VNZ',
|
|
161
|
+
'SBI' = 'SBI',
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
package/types/env.d.ts
CHANGED
package/types/form.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
export enum FieldTypes {
|
|
4
|
+
TEXT = 'text',
|
|
5
|
+
NUMBER = 'number',
|
|
6
|
+
SWITCH = 'switch',
|
|
7
|
+
EMAIL = 'email',
|
|
8
|
+
PASSWORD = 'password',
|
|
9
|
+
FILE = 'file',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare global {
|
|
13
|
+
type InputType = TextInput | NumberInput | FileInput | SwitchInput;
|
|
14
|
+
type FormMasks = 'numbers' | 'iin' | 'otp' | 'phone' | 'date' | 'post' | 'threeDigit' | 'iik';
|
|
15
|
+
type FormIcons = 'arrowRight' | 'search' | 'sms' | null;
|
|
16
|
+
type Suffix = 'kzt' | 'usd' | 'percent' | null;
|
|
17
|
+
|
|
18
|
+
type FetchFunctions =
|
|
19
|
+
| 'getResidents'
|
|
20
|
+
| 'getFamilyStatuses'
|
|
21
|
+
| 'getRelationTypes'
|
|
22
|
+
| 'getCountries'
|
|
23
|
+
| 'getStates'
|
|
24
|
+
| 'getLocalityTypes'
|
|
25
|
+
| 'getRegions'
|
|
26
|
+
| 'getCities'
|
|
27
|
+
| 'getDocumentTypes'
|
|
28
|
+
| 'getTaxCountries'
|
|
29
|
+
| 'getCitizenshipCountries'
|
|
30
|
+
| 'getSectorCodeList'
|
|
31
|
+
| 'getInsurancePay'
|
|
32
|
+
| 'getEconomicActivityType'
|
|
33
|
+
| 'getBanks'
|
|
34
|
+
| 'getDocumentIssuers'
|
|
35
|
+
| 'getGenderList';
|
|
36
|
+
|
|
37
|
+
export interface DynamicForm {
|
|
38
|
+
formRef: any;
|
|
39
|
+
sections: SectionType[];
|
|
40
|
+
fieldOrder?: string[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type InputBase = {
|
|
44
|
+
key?: any;
|
|
45
|
+
modelValue?: any;
|
|
46
|
+
clearable?: boolean;
|
|
47
|
+
label?: string;
|
|
48
|
+
placeholder?: string;
|
|
49
|
+
readonly?: boolean;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
arrowRight?: boolean;
|
|
52
|
+
maxLength?: number | null;
|
|
53
|
+
rules?: ValidationRule[];
|
|
54
|
+
iconName?: FormIcons;
|
|
55
|
+
value?: number;
|
|
56
|
+
suffix?: Suffix | null;
|
|
57
|
+
hint?: string | undefined;
|
|
58
|
+
maska?: FormMasks | null;
|
|
59
|
+
fetchFrom?: FetchFunctions | null;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type FormControl<T extends InputType> = T & {
|
|
63
|
+
valid: boolean;
|
|
64
|
+
dirty: boolean;
|
|
65
|
+
touched: boolean;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type FileInput = InputBase & {
|
|
69
|
+
type: FieldTypes.FILE;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type TextInput = InputBase & {
|
|
73
|
+
type: FieldTypes.TEXT;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type SwitchInput = InputBase & {
|
|
77
|
+
type: FieldTypes.SWITCH;
|
|
78
|
+
labeling: boolean | null;
|
|
79
|
+
direction: 'horizontal' | 'vertical';
|
|
80
|
+
falseValue: boolean | string | null;
|
|
81
|
+
trueValue: boolean | string | null;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
type NumberInput = InputBase & {
|
|
85
|
+
type: FieldTypes.NUMBER;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
type ValidationRule = (value: string) => boolean | string;
|
|
89
|
+
|
|
90
|
+
type SectionType = {
|
|
91
|
+
title?: string;
|
|
92
|
+
fields: InputType[];
|
|
93
|
+
};
|
|
94
|
+
}
|