@redneckz/wildless-cms-uni-blocks 0.14.1016 → 0.14.1018

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 (170) hide show
  1. package/bundle/bundle.umd.js +45 -30
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/DebitForm/DebitFormStatus.d.ts +1 -0
  4. package/bundle/ui-kit/FormField/Fields/NumbersField.d.ts +2 -0
  5. package/bundle/ui-kit/FormField/InputsMap.d.ts +1 -1
  6. package/bundle/ui-kit/FormField/validators.d.ts +4 -1
  7. package/bundle/ui-kit/Input/InputProps.d.ts +1 -0
  8. package/bundle/utils/isCyrillicWithNumbers.d.ts +1 -0
  9. package/dist/components/ApplicationForm/getInitialFormState.js +2 -0
  10. package/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
  11. package/dist/components/DebitForm/DebitFormStatus.d.ts +1 -0
  12. package/dist/components/DebitForm/DebitFormStatus.js +3 -2
  13. package/dist/components/DebitForm/DebitFormStatus.js.map +1 -1
  14. package/dist/components/DebitForm/SuccessStatusContent.js +2 -2
  15. package/dist/components/DebitForm/SuccessStatusContent.js.map +1 -1
  16. package/dist/ui-kit/FormField/Fields/FileUpload.js +3 -2
  17. package/dist/ui-kit/FormField/Fields/FileUpload.js.map +1 -1
  18. package/dist/ui-kit/FormField/Fields/InternshipStartDateField.js +2 -1
  19. package/dist/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -1
  20. package/dist/ui-kit/FormField/Fields/NumbersField.d.ts +2 -0
  21. package/dist/ui-kit/FormField/Fields/NumbersField.js +7 -0
  22. package/dist/ui-kit/FormField/Fields/NumbersField.js.map +1 -0
  23. package/dist/ui-kit/FormField/InputsMap.d.ts +1 -1
  24. package/dist/ui-kit/FormField/InputsMap.js +4 -4
  25. package/dist/ui-kit/FormField/InputsMap.js.map +1 -1
  26. package/dist/ui-kit/FormField/getObjectValidator.js +10 -10
  27. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  28. package/dist/ui-kit/FormField/validators.d.ts +4 -1
  29. package/dist/ui-kit/FormField/validators.js +14 -6
  30. package/dist/ui-kit/FormField/validators.js.map +1 -1
  31. package/dist/ui-kit/Input/InputFile.js +6 -1
  32. package/dist/ui-kit/Input/InputFile.js.map +1 -1
  33. package/dist/ui-kit/Input/InputProps.d.ts +1 -0
  34. package/dist/utils/isCyrillicWithNumbers.d.ts +1 -0
  35. package/dist/utils/isCyrillicWithNumbers.js +6 -0
  36. package/dist/utils/isCyrillicWithNumbers.js.map +1 -0
  37. package/lib/components/ApplicationForm/getInitialFormState.js +2 -0
  38. package/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
  39. package/lib/components/DebitForm/DebitFormStatus.d.ts +1 -0
  40. package/lib/components/DebitForm/DebitFormStatus.js +3 -2
  41. package/lib/components/DebitForm/DebitFormStatus.js.map +1 -1
  42. package/lib/components/DebitForm/SuccessStatusContent.js +2 -2
  43. package/lib/components/DebitForm/SuccessStatusContent.js.map +1 -1
  44. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  45. package/lib/ui-kit/FormField/Fields/FileUpload.js +3 -2
  46. package/lib/ui-kit/FormField/Fields/FileUpload.js.map +1 -1
  47. package/lib/ui-kit/FormField/Fields/InternshipStartDateField.js +2 -1
  48. package/lib/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -1
  49. package/lib/ui-kit/FormField/Fields/NumbersField.d.ts +2 -0
  50. package/lib/ui-kit/FormField/Fields/NumbersField.js +5 -0
  51. package/lib/ui-kit/FormField/Fields/NumbersField.js.map +1 -0
  52. package/lib/ui-kit/FormField/InputsMap.d.ts +1 -1
  53. package/lib/ui-kit/FormField/InputsMap.js +4 -4
  54. package/lib/ui-kit/FormField/InputsMap.js.map +1 -1
  55. package/lib/ui-kit/FormField/getObjectValidator.js +11 -11
  56. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  57. package/lib/ui-kit/FormField/validators.d.ts +4 -1
  58. package/lib/ui-kit/FormField/validators.js +9 -4
  59. package/lib/ui-kit/FormField/validators.js.map +1 -1
  60. package/lib/ui-kit/Input/InputFile.js +6 -1
  61. package/lib/ui-kit/Input/InputFile.js.map +1 -1
  62. package/lib/ui-kit/Input/InputProps.d.ts +1 -0
  63. package/lib/utils/isCyrillicWithNumbers.d.ts +1 -0
  64. package/lib/utils/isCyrillicWithNumbers.js +3 -0
  65. package/lib/utils/isCyrillicWithNumbers.js.map +1 -0
  66. package/mobile/bundle/bundle.umd.js +45 -30
  67. package/mobile/bundle/bundle.umd.min.js +1 -1
  68. package/mobile/bundle/components/DebitForm/DebitFormStatus.d.ts +1 -0
  69. package/mobile/bundle/ui-kit/FormField/Fields/NumbersField.d.ts +2 -0
  70. package/mobile/bundle/ui-kit/FormField/InputsMap.d.ts +1 -1
  71. package/mobile/bundle/ui-kit/FormField/validators.d.ts +4 -1
  72. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +1 -0
  73. package/mobile/bundle/utils/isCyrillicWithNumbers.d.ts +1 -0
  74. package/mobile/dist/components/ApplicationForm/getInitialFormState.js +2 -0
  75. package/mobile/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
  76. package/mobile/dist/components/DebitForm/DebitFormStatus.d.ts +1 -0
  77. package/mobile/dist/components/DebitForm/DebitFormStatus.js +3 -2
  78. package/mobile/dist/components/DebitForm/DebitFormStatus.js.map +1 -1
  79. package/mobile/dist/components/DebitForm/SuccessStatusContent.js +2 -2
  80. package/mobile/dist/components/DebitForm/SuccessStatusContent.js.map +1 -1
  81. package/mobile/dist/ui-kit/FormField/Fields/FileUpload.js +3 -2
  82. package/mobile/dist/ui-kit/FormField/Fields/FileUpload.js.map +1 -1
  83. package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.js +2 -1
  84. package/mobile/dist/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -1
  85. package/mobile/dist/ui-kit/FormField/Fields/NumbersField.d.ts +2 -0
  86. package/mobile/dist/ui-kit/FormField/Fields/NumbersField.js +7 -0
  87. package/mobile/dist/ui-kit/FormField/Fields/NumbersField.js.map +1 -0
  88. package/mobile/dist/ui-kit/FormField/InputsMap.d.ts +1 -1
  89. package/mobile/dist/ui-kit/FormField/InputsMap.js +4 -4
  90. package/mobile/dist/ui-kit/FormField/InputsMap.js.map +1 -1
  91. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +10 -10
  92. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  93. package/mobile/dist/ui-kit/FormField/validators.d.ts +4 -1
  94. package/mobile/dist/ui-kit/FormField/validators.js +14 -6
  95. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  96. package/mobile/dist/ui-kit/Input/InputFile.js +6 -1
  97. package/mobile/dist/ui-kit/Input/InputFile.js.map +1 -1
  98. package/mobile/dist/ui-kit/Input/InputProps.d.ts +1 -0
  99. package/mobile/dist/utils/isCyrillicWithNumbers.d.ts +1 -0
  100. package/mobile/dist/utils/isCyrillicWithNumbers.js +6 -0
  101. package/mobile/dist/utils/isCyrillicWithNumbers.js.map +1 -0
  102. package/mobile/lib/components/ApplicationForm/getInitialFormState.js +2 -0
  103. package/mobile/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
  104. package/mobile/lib/components/DebitForm/DebitFormStatus.d.ts +1 -0
  105. package/mobile/lib/components/DebitForm/DebitFormStatus.js +3 -2
  106. package/mobile/lib/components/DebitForm/DebitFormStatus.js.map +1 -1
  107. package/mobile/lib/components/DebitForm/SuccessStatusContent.js +2 -2
  108. package/mobile/lib/components/DebitForm/SuccessStatusContent.js.map +1 -1
  109. package/mobile/lib/ui-kit/FormField/Fields/FileUpload.js +3 -2
  110. package/mobile/lib/ui-kit/FormField/Fields/FileUpload.js.map +1 -1
  111. package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.js +2 -1
  112. package/mobile/lib/ui-kit/FormField/Fields/InternshipStartDateField.js.map +1 -1
  113. package/mobile/lib/ui-kit/FormField/Fields/NumbersField.d.ts +2 -0
  114. package/mobile/lib/ui-kit/FormField/Fields/NumbersField.js +5 -0
  115. package/mobile/lib/ui-kit/FormField/Fields/NumbersField.js.map +1 -0
  116. package/mobile/lib/ui-kit/FormField/InputsMap.d.ts +1 -1
  117. package/mobile/lib/ui-kit/FormField/InputsMap.js +4 -4
  118. package/mobile/lib/ui-kit/FormField/InputsMap.js.map +1 -1
  119. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +11 -11
  120. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  121. package/mobile/lib/ui-kit/FormField/validators.d.ts +4 -1
  122. package/mobile/lib/ui-kit/FormField/validators.js +9 -4
  123. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  124. package/mobile/lib/ui-kit/Input/InputFile.js +6 -1
  125. package/mobile/lib/ui-kit/Input/InputFile.js.map +1 -1
  126. package/mobile/lib/ui-kit/Input/InputProps.d.ts +1 -0
  127. package/mobile/lib/utils/isCyrillicWithNumbers.d.ts +1 -0
  128. package/mobile/lib/utils/isCyrillicWithNumbers.js +3 -0
  129. package/mobile/lib/utils/isCyrillicWithNumbers.js.map +1 -0
  130. package/mobile/src/components/ApplicationForm/getInitialFormState.tsx +2 -0
  131. package/mobile/src/components/DebitForm/DebitFormStatus.tsx +20 -2
  132. package/mobile/src/components/DebitForm/SuccessStatusContent.tsx +2 -1
  133. package/mobile/src/ui-kit/FormField/Fields/FileUpload.tsx +3 -1
  134. package/mobile/src/ui-kit/FormField/Fields/InternshipStartDateField.tsx +3 -0
  135. package/mobile/src/ui-kit/FormField/Fields/NumbersField.tsx +7 -0
  136. package/mobile/src/ui-kit/FormField/InputsMap.tsx +6 -4
  137. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +12 -10
  138. package/mobile/src/ui-kit/FormField/validators.ts +22 -7
  139. package/mobile/src/ui-kit/Input/InputFile.tsx +7 -0
  140. package/mobile/src/ui-kit/Input/InputProps.ts +1 -0
  141. package/mobile/src/utils/isCyrillicWithNumbers.ts +3 -0
  142. package/package.json +2 -2
  143. package/src/components/ApplicationForm/getInitialFormState.tsx +2 -0
  144. package/src/components/DebitForm/DebitFormStatus.tsx +20 -2
  145. package/src/components/DebitForm/SuccessStatusContent.tsx +2 -1
  146. package/src/ui-kit/FormField/Fields/FileUpload.tsx +3 -1
  147. package/src/ui-kit/FormField/Fields/InternshipStartDateField.tsx +3 -0
  148. package/src/ui-kit/FormField/Fields/NumbersField.tsx +7 -0
  149. package/src/ui-kit/FormField/InputsMap.tsx +6 -4
  150. package/src/ui-kit/FormField/getObjectValidator.tsx +12 -10
  151. package/src/ui-kit/FormField/validators.ts +22 -7
  152. package/src/ui-kit/Input/InputFile.tsx +7 -0
  153. package/src/ui-kit/Input/InputProps.ts +1 -0
  154. package/src/utils/isCyrillicWithNumbers.ts +3 -0
  155. package/bundle/ui-kit/FormField/Fields/AverageGradeField.d.ts +0 -2
  156. package/dist/ui-kit/FormField/Fields/AverageGradeField.d.ts +0 -2
  157. package/dist/ui-kit/FormField/Fields/AverageGradeField.js +0 -9
  158. package/dist/ui-kit/FormField/Fields/AverageGradeField.js.map +0 -1
  159. package/lib/ui-kit/FormField/Fields/AverageGradeField.d.ts +0 -2
  160. package/lib/ui-kit/FormField/Fields/AverageGradeField.js +0 -7
  161. package/lib/ui-kit/FormField/Fields/AverageGradeField.js.map +0 -1
  162. package/mobile/bundle/ui-kit/FormField/Fields/AverageGradeField.d.ts +0 -2
  163. package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.d.ts +0 -2
  164. package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.js +0 -9
  165. package/mobile/dist/ui-kit/FormField/Fields/AverageGradeField.js.map +0 -1
  166. package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.d.ts +0 -2
  167. package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.js +0 -7
  168. package/mobile/lib/ui-kit/FormField/Fields/AverageGradeField.js.map +0 -1
  169. package/mobile/src/ui-kit/FormField/Fields/AverageGradeField.tsx +0 -14
  170. package/src/ui-kit/FormField/Fields/AverageGradeField.tsx +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.1016",
3
+ "version": "0.14.1018",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -205,7 +205,7 @@
205
205
  "path": "lib/common.css"
206
206
  },
207
207
  {
208
- "limit": "115 kB",
208
+ "limit": "120 kB",
209
209
  "path": "bundle/bundle.umd.min.js"
210
210
  }
211
211
  ],
@@ -65,6 +65,8 @@ const initialFormState = {
65
65
  consentToReceiveMaterials: false,
66
66
  consentDataProcessing: false,
67
67
  addressRetail: { key: '', text: '' },
68
+ fileUpload: '',
69
+ fileId: '',
68
70
  };
69
71
 
70
72
  export const getInitialFormState = (inputs: FieldDef[], typeForm = ''): FormState => {
@@ -13,12 +13,14 @@ type DebitFormStatusProps = UniBlockProps &
13
13
  sectionInfo?: (LabelProps & DescriptionProps)[];
14
14
  buttonText?: string;
15
15
  isDboClient?: boolean;
16
+ isOffice?: boolean;
16
17
  };
17
18
 
18
19
  const INTERNET_BANK_LINK = 'https://online.rshb.ru/d?l=dcNqSvOE';
20
+ const PRELOGIN_LINK = 'https://online.rshb.ru/rshb-mbfl/webmodules/prelogin-zone';
19
21
 
20
22
  export const DebitFormStatus = JSX<DebitFormStatusProps>(
21
- ({ title, description: dsc, sectionInfo, buttonText, isDboClient, ...props }) => {
23
+ ({ title, description: dsc, sectionInfo, buttonText, isDboClient, isOffice, ...props }) => {
22
24
  return (
23
25
  <BlockWrapper {...props}>
24
26
  <div className="flex flex-col md:flex-row items-center">
@@ -32,7 +34,23 @@ export const DebitFormStatus = JSX<DebitFormStatusProps>(
32
34
  />
33
35
  </div>
34
36
  <SectionInfo items={sectionInfo} />
35
- {buttonText ? (
37
+ {isOffice ? (
38
+ <div className="flex flex-col md:flex-row md:gap-lg">
39
+ <LinkButton
40
+ href={PRELOGIN_LINK}
41
+ text="Узнать статус заявки"
42
+ version="primary"
43
+ className="w-full mt-lg"
44
+ />
45
+ <LinkButton
46
+ href="/natural"
47
+ text="Вернуться на главную"
48
+ version="primary"
49
+ className="w-full mt-lg"
50
+ />
51
+ </div>
52
+ ) : null}
53
+ {!isOffice && buttonText ? (
36
54
  <LinkButton
37
55
  href="/natural"
38
56
  text={buttonText}
@@ -10,9 +10,10 @@ export const SuccessStatusContent = JSX<SuccessStatusContentProps>(({ isOffice }
10
10
  title="Заявка принята"
11
11
  description={
12
12
  isOffice
13
- ? 'Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис'
13
+ ? 'Ваша заявка принята. Ожидайте СМС и EMAIL с статусом заявки'
14
14
  : 'Вам позвонит сотрудник Банка для уточнения времени и даты доставки'
15
15
  }
16
16
  buttonText="Вернуться на главную"
17
+ isOffice={isOffice}
17
18
  />
18
19
  ));
@@ -5,9 +5,10 @@ import { type CustomFieldProps } from '../CustomFieldProps';
5
5
 
6
6
  export const FileUploadField = JSX<CustomFieldProps>(({ field, input }) => {
7
7
  const [fileId, setFileId] = useState<string>('');
8
+ const fileIdField = field('fileId');
8
9
 
9
10
  useEffect(() => {
10
- field('fileId')?.onChange?.(fileId);
11
+ fileIdField?.onChange?.(fileId);
11
12
  }, [fileId]);
12
13
 
13
14
  return (
@@ -17,6 +18,7 @@ export const FileUploadField = JSX<CustomFieldProps>(({ field, input }) => {
17
18
  {...field(input?.name ?? '')}
18
19
  {...input}
19
20
  onFileChanged={setFileId}
21
+ isReset={!fileIdField?.value}
20
22
  />
21
23
  );
22
24
  });
@@ -11,6 +11,8 @@ export const InternshipStartDateField = JSX<CustomFieldProps>(({ field, input })
11
11
  const [internshipStartDateError, setInternshipStartDateError] = useState('');
12
12
  const [internshipStartDateValue, setInternshipStartDateValue] = useState<Date>();
13
13
 
14
+ const today = new Date();
15
+
14
16
  useEffect(() => {
15
17
  setEndDate(field('internshipEndDate').value as Date);
16
18
  }, [field('internshipEndDate').value]);
@@ -32,6 +34,7 @@ export const InternshipStartDateField = JSX<CustomFieldProps>(({ field, input })
32
34
  error={internshipStartDateError || field(input?.name ?? '')?.error}
33
35
  errors={[internshipStartDateError ?? field(input?.name ?? '')?.error]}
34
36
  onChange={handleInputChange}
37
+ minDate={today}
35
38
  maxDate={endDate}
36
39
  />
37
40
  );
@@ -0,0 +1,7 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { InputControl } from '../../Input/InputControl';
3
+ import { type CustomFieldProps } from '../CustomFieldProps';
4
+
5
+ export const NumbersField = JSX<CustomFieldProps>(({ field, input, label }) => (
6
+ <InputControl label={label} type="number" {...field(input?.name ?? '')} {...input} />
7
+ ));
@@ -7,7 +7,6 @@ import { AmountField } from './Fields/AmountField';
7
7
  import { AnnualRevenueField } from './Fields/AnnualRevenueField';
8
8
  import { ApplicationDateField } from './Fields/ApplicationDateField';
9
9
  import { ApplierTypeField } from './Fields/ApplierTypeField';
10
- import { AverageGradeField } from './Fields/AverageGradeField';
11
10
  import { BankEmpoleeField } from './Fields/BankEmpoleeField';
12
11
  import { BirthdayField } from './Fields/BirthdayField';
13
12
  import { CallbackTimeField } from './Fields/CallbackTimeField';
@@ -27,6 +26,7 @@ import { IsClientField } from './Fields/IsClientField';
27
26
  import { LocalitiesField } from './Fields/LocalitiesField';
28
27
  import { MiddleNameField } from './Fields/MiddleNameField';
29
28
  import { NameField } from './Fields/NameField';
29
+ import { NumbersField } from './Fields/NumbersField';
30
30
  import { OnlineCheckoutField } from './Fields/OnlineCheckoutField';
31
31
  import { PartnerCommentsField } from './Fields/PartnerCommentsField';
32
32
  import { PartnerNameField } from './Fields/PartnerNameField';
@@ -113,13 +113,15 @@ export const InputsMap = {
113
113
  internshipStartDate: InternshipStartDateField,
114
114
  internshipEndDate: InternshipEndDateField,
115
115
  university: (props: CustomFieldProps) => <TextField {...props} label="ВУЗ" />,
116
- courseYear: (props: CustomFieldProps) => <TextField {...props} label="Курс" />,
117
- graduationYear: (props: CustomFieldProps) => <TextField {...props} label="Год окончания" />,
116
+ courseYear: (props: CustomFieldProps) => <NumbersField {...props} label="Курс" />,
117
+ graduationYear: (props: CustomFieldProps) => <NumbersField {...props} label="Год окончания" />,
118
118
  fieldOfStudy: (props: CustomFieldProps) => <TextField {...props} label="Направление обучения" />,
119
119
  educationLevel: (props: SelectFieldProps) => (
120
120
  <SelectField {...props} label="Ступень обучения" options={EDUCATION_LEVEL} />
121
121
  ),
122
- averageGrade: AverageGradeField,
122
+ averageGrade: (props: CustomFieldProps) => (
123
+ <NumbersField {...props} label="Средний балл обучения" />
124
+ ),
123
125
  skillsAndKnowledge: CommentField,
124
126
  workExperience: CommentField,
125
127
  motivationForInternship: CommentField,
@@ -4,9 +4,11 @@ import { type BaseFieldDef } from './BaseFieldDef';
4
4
  import {
5
5
  agreementValidator,
6
6
  birthdayValidator,
7
+ cyrillicWithNumbersValidator,
7
8
  defaultSelectValidator,
8
9
  defaultValidator,
9
10
  emailValidator,
11
+ fullNameValidator,
10
12
  innDadataValidator,
11
13
  innValidator,
12
14
  nameValidator,
@@ -15,7 +17,7 @@ import {
15
17
  } from './validators';
16
18
 
17
19
  export const validatorObj: Record<string, Validator> = {
18
- fullName: defaultValidator(),
20
+ fullName: fullNameValidator('Укажите полное ФИО на кириллице (без сокращений)'),
19
21
  addressBranch: defaultSelectValidator(),
20
22
  desiredMeetingDate: defaultValidator(),
21
23
  product: defaultValidator(),
@@ -49,20 +51,20 @@ export const validatorObj: Record<string, Validator> = {
49
51
  callbackTime: defaultValidator(),
50
52
  questionProduct: defaultValidator(),
51
53
  russianPhone: russianPhoneValidator('Укажите номер телефона'),
52
- cityOfResidence: defaultValidator(),
54
+ cityOfResidence: cyrillicWithNumbersValidator('Укажите город проживания на кириллице'),
53
55
  internshipStartDate: defaultValidator(),
54
56
  internshipEndDate: defaultValidator(),
55
- university: defaultValidator(),
56
- fieldOfStudy: defaultValidator(),
57
- courseYear: defaultValidator(),
58
- graduationYear: defaultValidator(),
57
+ university: defaultValidator('Укажите ВУЗ'),
58
+ fieldOfStudy: defaultValidator('Укажите направление обучения'),
59
+ courseYear: defaultValidator('Укажите курс'),
60
+ graduationYear: defaultValidator('Укажите год окончания'),
59
61
  averageGrade: defaultValidator(),
60
- skillsAndKnowledge: defaultValidator(),
62
+ skillsAndKnowledge: defaultValidator(''),
61
63
  educationLevel: defaultSelectValidator(),
62
- motivationForInternship: defaultValidator(),
63
- workExperience: defaultValidator(),
64
+ motivationForInternship: defaultValidator(''),
65
+ workExperience: defaultValidator(''),
64
66
  internshipDirection: defaultValidator(),
65
- workingHours: defaultValidator(),
67
+ workingHours: defaultSelectValidator(),
66
68
  };
67
69
 
68
70
  export const getFormValidator = <FormState extends Record<string, any>, F extends BaseFieldDef>(
@@ -1,4 +1,5 @@
1
1
  import { isCyrillic } from '../../utils/isCyrilic';
2
+ import { isCyrillicWithNumbers } from '../../utils/isCyrillicWithNumbers';
2
3
  import { isDateValid } from '../../utils/isDateValid';
3
4
  import { required } from '../../validation/required';
4
5
  import { validator } from '../../validation/validator';
@@ -10,28 +11,34 @@ interface DadataItem {
10
11
  }
11
12
 
12
13
  const ERROR_MESSAGE = 'Некорректно заполненное поле';
14
+ const ERROR_SELECT_MESSAGE = 'Выберите вариант ответа';
13
15
 
14
16
  export const defaultValidator = (errorMsg?: string) => required(errorMsg ?? ERROR_MESSAGE);
15
17
 
16
18
  export const defaultSelectValidator = (errorMsg?: string) =>
17
- validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE);
19
+ validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_SELECT_MESSAGE);
18
20
 
19
21
  export const nameValidator = (errorMsg?: string) =>
20
22
  validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(
21
23
  errorMsg ?? ERROR_MESSAGE,
22
24
  );
23
25
 
26
+ export const fullNameValidator = (errorMsg?: string) =>
27
+ validator((_) => typeof _ === 'string' && _.length > 1 && isFullName(_))(
28
+ errorMsg ?? ERROR_MESSAGE,
29
+ );
30
+
24
31
  export const innValidator = (errorMsg: string) =>
25
32
  validator((_: string) => isValidInnLength(_))(errorMsg);
26
33
 
27
34
  export const innDadataValidator = (errorMsg: string) =>
28
35
  validator((_: DadataItem) => Boolean(_?.text) && isValidInnLength(_.text))(errorMsg);
29
36
 
30
- const phoneValidate = (email: string) =>
31
- /^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
37
+ const phoneValidate = (phone: string) =>
38
+ /^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(phone);
32
39
 
33
- const russianPhoneValidate = (email: string) =>
34
- /^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
40
+ const russianPhoneValidate = (phone: string) =>
41
+ /^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(phone);
35
42
 
36
43
  export const phoneValidator = (errorMsg: string) => validator(phoneValidate)(errorMsg);
37
44
 
@@ -50,8 +57,16 @@ const emailValidate = (email: string) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test
50
57
  export const emailValidator = (errorMsg: string) =>
51
58
  validator((_: string) => emailValidate(_))(errorMsg);
52
59
 
60
+ export const birthdayValidator = (errorMsg: string) =>
61
+ validator((_: Date) => isDateValid(_, { maxLimit: new Date() }))(errorMsg);
62
+
63
+ export const cyrillicWithNumbersValidator = (errorMsg?: string) =>
64
+ validator((_) => typeof _ === 'string' && _.length > 0 && isCyrillicWithNumbers(_))(
65
+ errorMsg ?? ERROR_MESSAGE,
66
+ );
67
+
53
68
  export const isValidInnLength = (value: string | undefined): boolean =>
54
69
  typeof value === 'string' && (value.length === 10 || value.length === 12);
55
70
 
56
- export const birthdayValidator = (errorMsg: string) =>
57
- validator((_: Date) => isDateValid(_, { maxLimit: new Date() }))(errorMsg);
71
+ export const isFullName = (value: string): boolean =>
72
+ /^[а-яА-ЯёЁ]+(?:-[а-яА-ЯёЁ]+)*(?:\s+[а-яА-ЯёЁ]+(?:-[а-яА-ЯёЁ]+)*)+$/.test(value);
@@ -32,6 +32,7 @@ export const InputFile = JSX<InputProps>(
32
32
  onBlur,
33
33
  maxSizeMB,
34
34
  error,
35
+ isReset,
35
36
  onFileChanged = noop,
36
37
  }) => {
37
38
  const inputRef = useRef<HTMLInputElement | null>(null);
@@ -53,6 +54,12 @@ export const InputFile = JSX<InputProps>(
53
54
  }
54
55
  }, [autoFocus, inputRef]);
55
56
 
57
+ useEffect(() => {
58
+ if (isReset) {
59
+ handleResetFile();
60
+ }
61
+ }, [isReset]);
62
+
56
63
  const handleFileChange = async (file?: File) => {
57
64
  handleResetFile();
58
65
  if (file) {
@@ -7,6 +7,7 @@ export type FileInputProps = {
7
7
  extensions?: string[];
8
8
  maxSizeMB?: number;
9
9
  onFileChanged?: (value: string) => void;
10
+ isReset?: boolean;
10
11
  };
11
12
 
12
13
  export interface InputProps<V = string>
@@ -0,0 +1,3 @@
1
+ const cyrillicWithNumbersPattern = /^(?!\s*$)(?:[\p{Script=Cyrillic}]|\P{L})*$/u;
2
+
3
+ export const isCyrillicWithNumbers = (_ = '') => cyrillicWithNumbersPattern.test(_);
@@ -1,2 +0,0 @@
1
- import { type CustomFieldProps } from '../CustomFieldProps';
2
- export declare const AverageGradeField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
@@ -1,2 +0,0 @@
1
- import { type CustomFieldProps } from '../CustomFieldProps';
2
- export declare const AverageGradeField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
@@ -1,9 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.AverageGradeField = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const InputControl_1 = require("../../Input/InputControl");
6
- exports.AverageGradeField = (0, uni_jsx_1.JSX)(({ field, input }) => {
7
- return ((0, jsx_runtime_1.jsx)(InputControl_1.InputControl, { label: "\u0421\u0440\u0435\u0434\u043D\u0438\u0439 \u0431\u0430\u043B\u043B \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u044F", type: "number", ...field(input?.name ?? ''), ...input }));
8
- });
9
- //# sourceMappingURL=AverageGradeField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AverageGradeField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/AverageGradeField.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,2DAAwD;AAG3C,QAAA,iBAAiB,GAAG,IAAA,aAAG,EAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,OAAO,CACL,uBAAC,2BAAY,IACX,KAAK,EAAC,sHAAuB,EAC7B,IAAI,EAAC,QAAQ,KACT,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,KACxB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type CustomFieldProps } from '../CustomFieldProps';
2
- export declare const AverageGradeField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { InputControl } from '../../Input/InputControl.js';
4
- export const AverageGradeField = JSX(({ field, input }) => {
5
- return (_jsx(InputControl, { label: "\u0421\u0440\u0435\u0434\u043D\u0438\u0439 \u0431\u0430\u043B\u043B \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u044F", type: "number", ...field(input?.name ?? ''), ...input }));
6
- });
7
- //# sourceMappingURL=AverageGradeField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AverageGradeField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/AverageGradeField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,OAAO,CACL,KAAC,YAAY,IACX,KAAK,EAAC,sHAAuB,EAC7B,IAAI,EAAC,QAAQ,KACT,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,KACxB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type CustomFieldProps } from '../CustomFieldProps';
2
- export declare const AverageGradeField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
@@ -1,2 +0,0 @@
1
- import { type CustomFieldProps } from '../CustomFieldProps';
2
- export declare const AverageGradeField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
@@ -1,9 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.AverageGradeField = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const InputControl_1 = require("../../Input/InputControl");
6
- exports.AverageGradeField = (0, uni_jsx_1.JSX)(({ field, input }) => {
7
- return ((0, jsx_runtime_1.jsx)(InputControl_1.InputControl, { label: "\u0421\u0440\u0435\u0434\u043D\u0438\u0439 \u0431\u0430\u043B\u043B \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u044F", type: "number", ...field(input?.name ?? ''), ...input }));
8
- });
9
- //# sourceMappingURL=AverageGradeField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AverageGradeField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/AverageGradeField.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,2DAAwD;AAG3C,QAAA,iBAAiB,GAAG,IAAA,aAAG,EAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,OAAO,CACL,uBAAC,2BAAY,IACX,KAAK,EAAC,sHAAuB,EAC7B,IAAI,EAAC,QAAQ,KACT,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,KACxB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type CustomFieldProps } from '../CustomFieldProps';
2
- export declare const AverageGradeField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
- import { JSX } from '@redneckz/uni-jsx';
3
- import { InputControl } from '../../Input/InputControl.js';
4
- export const AverageGradeField = JSX(({ field, input }) => {
5
- return (_jsx(InputControl, { label: "\u0421\u0440\u0435\u0434\u043D\u0438\u0439 \u0431\u0430\u043B\u043B \u043E\u0431\u0443\u0447\u0435\u043D\u0438\u044F", type: "number", ...field(input?.name ?? ''), ...input }));
6
- });
7
- //# sourceMappingURL=AverageGradeField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AverageGradeField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/AverageGradeField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,OAAO,CACL,KAAC,YAAY,IACX,KAAK,EAAC,sHAAuB,EAC7B,IAAI,EAAC,QAAQ,KACT,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,KACxB,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { InputControl } from '../../Input/InputControl';
3
- import { type CustomFieldProps } from '../CustomFieldProps';
4
-
5
- export const AverageGradeField = JSX<CustomFieldProps>(({ field, input }) => {
6
- return (
7
- <InputControl
8
- label="Средний балл обучения"
9
- type="number"
10
- {...field(input?.name ?? '')}
11
- {...input}
12
- />
13
- );
14
- });
@@ -1,14 +0,0 @@
1
- import { JSX } from '@redneckz/uni-jsx';
2
- import { InputControl } from '../../Input/InputControl';
3
- import { type CustomFieldProps } from '../CustomFieldProps';
4
-
5
- export const AverageGradeField = JSX<CustomFieldProps>(({ field, input }) => {
6
- return (
7
- <InputControl
8
- label="Средний балл обучения"
9
- type="number"
10
- {...field(input?.name ?? '')}
11
- {...input}
12
- />
13
- );
14
- });