@redneckz/wildless-cms-uni-blocks 0.14.617 → 0.14.619

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 (167) hide show
  1. package/bundle/bundle.umd.js +18 -27
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/ApplicationForm/ApplicationForm.js +3 -5
  4. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  5. package/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
  6. package/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  7. package/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  8. package/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  9. package/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  10. package/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  11. package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  12. package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  13. package/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  14. package/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  15. package/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  16. package/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  17. package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  18. package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  19. package/dist/ui-kit/FormField/Fields/InnField.js +2 -2
  20. package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
  21. package/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  22. package/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  23. package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  24. package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  25. package/dist/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
  26. package/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
  27. package/dist/ui-kit/Input/InputControl.js +4 -2
  28. package/dist/ui-kit/Input/InputControl.js.map +1 -1
  29. package/lib/components/ApplicationForm/ApplicationForm.js +3 -5
  30. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  31. package/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
  32. package/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  33. package/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  34. package/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  35. package/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  36. package/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  37. package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  38. package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  39. package/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  40. package/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  41. package/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  42. package/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  43. package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  44. package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  45. package/lib/ui-kit/FormField/Fields/InnField.js +2 -2
  46. package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
  47. package/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  48. package/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  49. package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  50. package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  51. package/lib/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
  52. package/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
  53. package/lib/ui-kit/Input/InputControl.js +4 -2
  54. package/lib/ui-kit/Input/InputControl.js.map +1 -1
  55. package/mobile/bundle/bundle.umd.js +18 -27
  56. package/mobile/bundle/bundle.umd.min.js +1 -1
  57. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +3 -5
  58. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  59. package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
  60. package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  61. package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  62. package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  63. package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  64. package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  65. package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  66. package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  67. package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  68. package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  69. package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  70. package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  71. package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  72. package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  73. package/mobile/dist/ui-kit/FormField/Fields/InnField.js +2 -2
  74. package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
  75. package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  76. package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  77. package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  78. package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  79. package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
  80. package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
  81. package/mobile/dist/ui-kit/Input/InputControl.js +4 -2
  82. package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
  83. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +3 -5
  84. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  85. package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
  86. package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
  87. package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
  88. package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
  89. package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
  90. package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
  91. package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
  92. package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
  93. package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
  94. package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
  95. package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
  96. package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
  97. package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
  98. package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
  99. package/mobile/lib/ui-kit/FormField/Fields/InnField.js +2 -2
  100. package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
  101. package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
  102. package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
  103. package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
  104. package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
  105. package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
  106. package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
  107. package/mobile/lib/ui-kit/Input/InputControl.js +4 -2
  108. package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
  109. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +4 -5
  110. package/mobile/src/ui-kit/FormField/Fields/DependentsField.tsx +2 -2
  111. package/mobile/src/ui-kit/FormField/Fields/DulNumberField.tsx +2 -2
  112. package/mobile/src/ui-kit/FormField/Fields/DulSerieField.tsx +2 -2
  113. package/mobile/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +2 -2
  114. package/mobile/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +2 -2
  115. package/mobile/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +2 -2
  116. package/mobile/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +2 -2
  117. package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +3 -2
  118. package/mobile/src/ui-kit/FormField/Fields/JobsNumberField.tsx +2 -2
  119. package/mobile/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +2 -2
  120. package/mobile/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +2 -2
  121. package/mobile/src/ui-kit/Input/InputControl.tsx +8 -1
  122. package/package.json +1 -1
  123. package/src/components/ApplicationForm/ApplicationForm.tsx +4 -5
  124. package/src/ui-kit/FormField/Fields/DependentsField.tsx +2 -2
  125. package/src/ui-kit/FormField/Fields/DulNumberField.tsx +2 -2
  126. package/src/ui-kit/FormField/Fields/DulSerieField.tsx +2 -2
  127. package/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +2 -2
  128. package/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +2 -2
  129. package/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +2 -2
  130. package/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +2 -2
  131. package/src/ui-kit/FormField/Fields/InnField.tsx +3 -2
  132. package/src/ui-kit/FormField/Fields/JobsNumberField.tsx +2 -2
  133. package/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +2 -2
  134. package/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +2 -2
  135. package/src/ui-kit/Input/InputControl.tsx +8 -1
  136. package/bundle/ui-kit/Input/InputNumberControl.d.ts +0 -2
  137. package/bundle/ui-kit/InputNumber/InputNumber.d.ts +0 -2
  138. package/dist/ui-kit/Input/InputNumberControl.d.ts +0 -2
  139. package/dist/ui-kit/Input/InputNumberControl.js +0 -10
  140. package/dist/ui-kit/Input/InputNumberControl.js.map +0 -1
  141. package/dist/ui-kit/InputNumber/InputNumber.d.ts +0 -2
  142. package/dist/ui-kit/InputNumber/InputNumber.js +0 -12
  143. package/dist/ui-kit/InputNumber/InputNumber.js.map +0 -1
  144. package/lib/ui-kit/Input/InputNumberControl.d.ts +0 -2
  145. package/lib/ui-kit/Input/InputNumberControl.js +0 -8
  146. package/lib/ui-kit/Input/InputNumberControl.js.map +0 -1
  147. package/lib/ui-kit/InputNumber/InputNumber.d.ts +0 -2
  148. package/lib/ui-kit/InputNumber/InputNumber.js +0 -10
  149. package/lib/ui-kit/InputNumber/InputNumber.js.map +0 -1
  150. package/mobile/bundle/ui-kit/Input/InputNumberControl.d.ts +0 -2
  151. package/mobile/bundle/ui-kit/InputNumber/InputNumber.d.ts +0 -2
  152. package/mobile/dist/ui-kit/Input/InputNumberControl.d.ts +0 -2
  153. package/mobile/dist/ui-kit/Input/InputNumberControl.js +0 -10
  154. package/mobile/dist/ui-kit/Input/InputNumberControl.js.map +0 -1
  155. package/mobile/dist/ui-kit/InputNumber/InputNumber.d.ts +0 -2
  156. package/mobile/dist/ui-kit/InputNumber/InputNumber.js +0 -12
  157. package/mobile/dist/ui-kit/InputNumber/InputNumber.js.map +0 -1
  158. package/mobile/lib/ui-kit/Input/InputNumberControl.d.ts +0 -2
  159. package/mobile/lib/ui-kit/Input/InputNumberControl.js +0 -8
  160. package/mobile/lib/ui-kit/Input/InputNumberControl.js.map +0 -1
  161. package/mobile/lib/ui-kit/InputNumber/InputNumber.d.ts +0 -2
  162. package/mobile/lib/ui-kit/InputNumber/InputNumber.js +0 -10
  163. package/mobile/lib/ui-kit/InputNumber/InputNumber.js.map +0 -1
  164. package/mobile/src/ui-kit/Input/InputNumberControl.tsx +0 -18
  165. package/mobile/src/ui-kit/InputNumber/InputNumber.tsx +0 -24
  166. package/src/ui-kit/Input/InputNumberControl.tsx +0 -18
  167. package/src/ui-kit/InputNumber/InputNumber.tsx +0 -24
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
- import { InputNumberControl } from '../../Input/InputNumberControl.js';
3
+ import { InputControl } from '../../Input/InputControl.js';
4
4
  import { validatorObj } from '../getObjectValidator.js';
5
5
  import { getValidation } from '../getValidation.js';
6
- export const LastJobExperienceField = JSX(({ field, input }) => (_jsx(InputNumberControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('lastJobExperience'), validatorObj.lastJobExperience, input?.required), ...input })));
6
+ export const LastJobExperienceField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", inputLength: 2, ...getValidation(field('lastJobExperience'), validatorObj.lastJobExperience, input?.required), ...input })));
7
7
  //# sourceMappingURL=LastJobExperienceField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LastJobExperienceField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/LastJobExperienceField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAChF,KAAC,kBAAkB,IACjB,KAAK,EAAC,wKAAiC,EACvC,WAAW,EAAC,iFAAgB,EAC5B,WAAW,EAAE,CAAC,KACV,aAAa,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,YAAY,CAAC,iBAAiB,EAAE,KAAK,EAAE,QAAQ,CAAC,KAC1F,KAAK,GACT,CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"LastJobExperienceField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/LastJobExperienceField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAChF,KAAC,YAAY,IACX,KAAK,EAAC,wKAAiC,EACvC,WAAW,EAAC,iFAAgB,EAC5B,WAAW,EAAE,CAAC,KACV,aAAa,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,YAAY,CAAC,iBAAiB,EAAE,KAAK,EAAE,QAAQ,CAAC,KAC1F,KAAK,GACT,CACH,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
- import { InputNumberControl } from '../../Input/InputNumberControl.js';
3
+ import { InputControl } from '../../Input/InputControl.js';
4
4
  import { validatorObj } from '../getObjectValidator.js';
5
5
  import { getValidation } from '../getValidation.js';
6
- export const PartInBusinessField = JSX(({ field, input }) => (_jsx(InputNumberControl, { label: "\u0414\u043E\u043B\u044F \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0432 \u0431\u0438\u0437\u043D\u0435\u0441\u0435", placeholder: "\u0432 %", inputLength: 2, ...getValidation(field('partInBusiness'), validatorObj.partInBusiness, input?.required), ...input })));
6
+ export const PartInBusinessField = JSX(({ field, input }) => (_jsx(InputControl, { label: "\u0414\u043E\u043B\u044F \u0443\u0447\u0430\u0441\u0442\u0438\u044F \u0432 \u0431\u0438\u0437\u043D\u0435\u0441\u0435", placeholder: "\u0432 %", inputLength: 2, ...getValidation(field('partInBusiness'), validatorObj.partInBusiness, input?.required), ...input })));
7
7
  //# sourceMappingURL=PartInBusinessField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PartInBusinessField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/PartInBusinessField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC7E,KAAC,kBAAkB,IACjB,KAAK,EAAC,uHAAwB,EAC9B,WAAW,EAAC,UAAK,EACjB,WAAW,EAAE,CAAC,KACV,aAAa,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,YAAY,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,KACpF,KAAK,GACT,CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"PartInBusinessField.js","sourceRoot":"","sources":["../../../../src/ui-kit/FormField/Fields/PartInBusinessField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC7E,KAAC,YAAY,IACX,KAAK,EAAC,uHAAwB,EAC9B,WAAW,EAAC,UAAK,EACjB,WAAW,EAAE,CAAC,KACV,aAAa,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,YAAY,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,KACpF,KAAK,GACT,CACH,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
4
  import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
4
5
  import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
5
6
  import { getRequiredLabel } from '../../utils/getRequiredLabel.js';
@@ -8,9 +9,10 @@ import { style } from '../../utils/style.js';
8
9
  import { Input } from './Input.js';
9
10
  import { renderErrorText } from './renderErrorText.js';
10
11
  import { useInputPopup } from './useInputPopup.js';
11
- export const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, dadata = false, }) => {
12
+ export const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, inputLength, dadata = false, }) => {
12
13
  const [isOpen, { setFalse: close, setTrue: open }] = useBool();
13
14
  const popupRef = useOutsideClick(close);
15
+ const handleChange = useCallback((v) => (inputLength ? v.length <= inputLength && onChange(v) : onChange(v)), [onChange]);
14
16
  const inputRef = useInputPopup({
15
17
  isOpen: isOpen && dadata,
16
18
  name,
@@ -19,7 +21,7 @@ export const InputControl = JSX(({ className, label, value = '', placeholder, er
19
21
  onChange,
20
22
  onDaDataChange,
21
23
  });
22
- return (_jsxs("div", { className: style('shrink-0 w-full', className), ref: popupRef, onBlur: close, onFocus: open, children: [_jsx("div", { ref: inputRef, children: _jsx(Input, { type: type || 'text', "aria-label": label, label: getRequiredLabel({ label, errors }), valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: getPlaceholder(placeholder, errors, label) }) }), renderErrorText(error)] }));
24
+ return (_jsxs("div", { className: style('shrink-0 w-full', className), ref: popupRef, onBlur: close, onFocus: open, children: [_jsx("div", { ref: inputRef, children: _jsx(Input, { type: type || 'text', "aria-label": label, label: getRequiredLabel({ label, errors }), valid: Boolean(!error), value: value, onChange: handleChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: getPlaceholder(placeholder, errors, label) }) }), renderErrorText(error)] }));
23
25
  });
24
26
  const getPlaceholder = (placeholder, errors, label) => errors && !label ? `${placeholder}*` : placeholder;
25
27
  //# sourceMappingURL=InputControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputControl.js","sourceRoot":"","sources":["../../../src/ui-kit/Input/InputControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EACC,SAAS,EACT,KAAK,EACL,KAAK,GAAG,EAAE,EACV,WAAW,EACX,KAAK,EACL,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,cAAc,EACd,MAAM,EACN,UAAU,EACV,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,iBAAiB,EACjB,MAAM,GAAG,KAAK,GACf,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC;IAC/D,MAAM,QAAQ,GAAG,eAAe,CAAiB,KAAK,CAAC,CAAC;IAExD,MAAM,QAAQ,GAAG,aAAa,CAAC;QAC7B,MAAM,EAAE,MAAM,IAAI,MAAM;QACxB,IAAI;QACJ,KAAK;QACL,iBAAiB;QACjB,QAAQ;QACR,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,eACE,SAAS,EAAE,KAAK,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAC9C,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,IAAI,aAEb,cAAK,GAAG,EAAE,QAAQ,YAChB,KAAC,KAAK,IACJ,IAAI,EAAE,IAAI,IAAI,MAAM,gBACR,KAAK,EACjB,KAAK,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAC1C,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,GACvD,GACE,EACL,eAAe,CAAC,KAAK,CAAC,IACnB,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,WAAoB,EAAE,MAAiB,EAAE,KAAc,EAAE,EAAE,CACjF,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC"}
1
+ {"version":3,"file":"InputControl.js","sourceRoot":"","sources":["../../../src/ui-kit/Input/InputControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAC7B,CAAC,EACC,SAAS,EACT,KAAK,EACL,KAAK,GAAG,EAAE,EACV,WAAW,EACX,KAAK,EACL,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,cAAc,EACd,MAAM,EACN,UAAU,EACV,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,iBAAiB,EACjB,WAAW,EACX,MAAM,GAAG,KAAK,GACf,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC;IAC/D,MAAM,QAAQ,GAAG,eAAe,CAAiB,KAAK,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,WAAW,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACnF,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,MAAM,QAAQ,GAAG,aAAa,CAAC;QAC7B,MAAM,EAAE,MAAM,IAAI,MAAM;QACxB,IAAI;QACJ,KAAK;QACL,iBAAiB;QACjB,QAAQ;QACR,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,eACE,SAAS,EAAE,KAAK,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAC9C,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,IAAI,aAEb,cAAK,GAAG,EAAE,QAAQ,YAChB,KAAC,KAAK,IACJ,IAAI,EAAE,IAAI,IAAI,MAAM,gBACR,KAAK,EACjB,KAAK,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAC1C,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,EACtB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,GACvD,GACE,EACL,eAAe,CAAC,KAAK,CAAC,IACnB,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,WAAoB,EAAE,MAAiB,EAAE,KAAc,EAAE,EAAE,CACjF,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC"}
@@ -23,6 +23,7 @@ import { renderAgreementSubmit } from './renderAgreementSubmit';
23
23
  import { renderContacts } from './renderContacts';
24
24
 
25
25
  interface ApplicationFormProps extends ApplicationFormContent, UniBlockProps {}
26
+
26
27
  const API = LeadServiceAPI();
27
28
 
28
29
  export const ApplicationForm = JSX<ApplicationFormProps>(
@@ -48,7 +49,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
48
49
  const inputsFiltered = getFilteredInputs(inputs, formData);
49
50
  const feedbackValidator = objectValidator(getObjectValidator(inputsFiltered));
50
51
  if (!isValidationSuccess(feedbackValidator(formData))) {
51
- return 'Fail';
52
+ return console.warn('validation fail');
52
53
  }
53
54
  const formatData = getFormatData({ ...formData, ...additionalParams });
54
55
  const status = (await API.send(formatData, endpoint === 'lead')) ? 'OK' : 'Fail';
@@ -108,15 +109,13 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
108
109
 
109
110
  const getFilteredInputs = (inputs: FieldDef[], data: FormState) =>
110
111
  inputs
111
- .filter((_) => _)
112
+ .filter((_) => (_?.name === 'secondaryPhone' ? Boolean(data.secondaryPhone) : _))
112
113
  .filter(
113
114
  (input) =>
114
115
  !input?.condition ||
115
116
  input?.condition.values.find((_) => {
116
117
  const dataValue = data?.[input?.condition?.name ?? ''];
117
118
 
118
- return input.name === 'secondaryPhone'
119
- ? Boolean(data.secondaryPhone)
120
- : _ === (dataValue?.key ?? dataValue);
119
+ return _ === (dataValue?.key ?? dataValue);
121
120
  }),
122
121
  );
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const DependentsField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Количество иждивенцев"
10
10
  placeholder="За исключение детей до 18 лет"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const DulNumberField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Номер документа"
10
10
  inputLength={6}
11
11
  {...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required)}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const DulSerieField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Серия документа"
10
10
  inputLength={4}
11
11
  {...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required)}
@@ -1,7 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
4
- import { InputNumberControl } from '../../Input/InputNumberControl';
4
+ import { InputControl } from '../../Input/InputControl';
5
5
  import { type CustomFieldProps } from '../CustomFieldProps';
6
6
  import { validatorObj } from '../getObjectValidator';
7
7
  import { getValidation } from '../getValidation';
@@ -12,7 +12,7 @@ export const DulSubdivisionCodeField = JSX<CustomFieldProps>(({ field, input })
12
12
  }, []);
13
13
 
14
14
  return (
15
- <InputNumberControl
15
+ <InputControl
16
16
  label="Код подразделения"
17
17
  {...input}
18
18
  inputLength={6}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Стаж"
10
10
  placeholder="За последние 5 лет"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const FamilyMembersField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Количество членов семьи"
10
10
  placeholder="Введите значение"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Общий стаж"
10
10
  inputLength={2}
11
11
  placeholder="Количество лет"
@@ -1,7 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
4
- import { InputNumberControl } from '../../Input/InputNumberControl';
4
+ import { InputControl } from '../../Input/InputControl';
5
5
  import { type CustomFieldProps } from '../CustomFieldProps';
6
6
  import { validatorObj } from '../getObjectValidator';
7
7
  import { getValidation } from '../getValidation';
@@ -13,8 +13,9 @@ export const InnField = JSX<CustomFieldProps>(({ field, input }) => {
13
13
  }, []);
14
14
 
15
15
  return (
16
- <InputNumberControl
16
+ <InputControl
17
17
  label="ИНН"
18
+ type="number"
18
19
  inputLength={12}
19
20
  {...input}
20
21
  {...getValidation(field('inn'), validatorObj.inn, input?.required)}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Количество мест работы за последние 5 лет"
10
10
  placeholder="Количество мест"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Стаж на последнем рабочем месте"
10
10
  placeholder="Количество лет"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const PartInBusinessField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Доля участия в бизнесе"
10
10
  placeholder="в %"
11
11
  inputLength={2}
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
3
4
  import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
4
5
  import { getRequiredLabel } from '../../utils/getRequiredLabel';
@@ -24,11 +25,17 @@ export const InputControl = JSX<InputProps>(
24
25
  type,
25
26
  name = '',
26
27
  daDataQueryPrefix,
28
+ inputLength,
27
29
  dadata = false,
28
30
  }) => {
29
31
  const [isOpen, { setFalse: close, setTrue: open }] = useBool();
30
32
  const popupRef = useOutsideClick<HTMLDivElement>(close);
31
33
 
34
+ const handleChange = useCallback(
35
+ (v: string) => (inputLength ? v.length <= inputLength && onChange(v) : onChange(v)),
36
+ [onChange],
37
+ );
38
+
32
39
  const inputRef = useInputPopup({
33
40
  isOpen: isOpen && dadata,
34
41
  name,
@@ -52,7 +59,7 @@ export const InputControl = JSX<InputProps>(
52
59
  label={getRequiredLabel({ label, errors })}
53
60
  valid={Boolean(!error)}
54
61
  value={value}
55
- onChange={onChange}
62
+ onChange={handleChange}
56
63
  onBlur={onBlur}
57
64
  isTextarea={isTextarea}
58
65
  placeholder={getPlaceholder(placeholder, errors, label)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.617",
3
+ "version": "0.14.619",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -23,6 +23,7 @@ import { renderAgreementSubmit } from './renderAgreementSubmit';
23
23
  import { renderContacts } from './renderContacts';
24
24
 
25
25
  interface ApplicationFormProps extends ApplicationFormContent, UniBlockProps {}
26
+
26
27
  const API = LeadServiceAPI();
27
28
 
28
29
  export const ApplicationForm = JSX<ApplicationFormProps>(
@@ -48,7 +49,7 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
48
49
  const inputsFiltered = getFilteredInputs(inputs, formData);
49
50
  const feedbackValidator = objectValidator(getObjectValidator(inputsFiltered));
50
51
  if (!isValidationSuccess(feedbackValidator(formData))) {
51
- return 'Fail';
52
+ return console.warn('validation fail');
52
53
  }
53
54
  const formatData = getFormatData({ ...formData, ...additionalParams });
54
55
  const status = (await API.send(formatData, endpoint === 'lead')) ? 'OK' : 'Fail';
@@ -108,15 +109,13 @@ export const ApplicationForm = JSX<ApplicationFormProps>(
108
109
 
109
110
  const getFilteredInputs = (inputs: FieldDef[], data: FormState) =>
110
111
  inputs
111
- .filter((_) => _)
112
+ .filter((_) => (_?.name === 'secondaryPhone' ? Boolean(data.secondaryPhone) : _))
112
113
  .filter(
113
114
  (input) =>
114
115
  !input?.condition ||
115
116
  input?.condition.values.find((_) => {
116
117
  const dataValue = data?.[input?.condition?.name ?? ''];
117
118
 
118
- return input.name === 'secondaryPhone'
119
- ? Boolean(data.secondaryPhone)
120
- : _ === (dataValue?.key ?? dataValue);
119
+ return _ === (dataValue?.key ?? dataValue);
121
120
  }),
122
121
  );
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const DependentsField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Количество иждивенцев"
10
10
  placeholder="За исключение детей до 18 лет"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const DulNumberField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Номер документа"
10
10
  inputLength={6}
11
11
  {...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required)}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const DulSerieField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Серия документа"
10
10
  inputLength={4}
11
11
  {...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required)}
@@ -1,7 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
4
- import { InputNumberControl } from '../../Input/InputNumberControl';
4
+ import { InputControl } from '../../Input/InputControl';
5
5
  import { type CustomFieldProps } from '../CustomFieldProps';
6
6
  import { validatorObj } from '../getObjectValidator';
7
7
  import { getValidation } from '../getValidation';
@@ -12,7 +12,7 @@ export const DulSubdivisionCodeField = JSX<CustomFieldProps>(({ field, input })
12
12
  }, []);
13
13
 
14
14
  return (
15
- <InputNumberControl
15
+ <InputControl
16
16
  label="Код подразделения"
17
17
  {...input}
18
18
  inputLength={6}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const Experience5YearsField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Стаж"
10
10
  placeholder="За последние 5 лет"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const FamilyMembersField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Количество членов семьи"
10
10
  placeholder="Введите значение"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const GeneralSeniorityField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Общий стаж"
10
10
  inputLength={2}
11
11
  placeholder="Количество лет"
@@ -1,7 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { type DaDataSuggestion } from '../../../api/dadataHints/dadataHintsType';
4
- import { InputNumberControl } from '../../Input/InputNumberControl';
4
+ import { InputControl } from '../../Input/InputControl';
5
5
  import { type CustomFieldProps } from '../CustomFieldProps';
6
6
  import { validatorObj } from '../getObjectValidator';
7
7
  import { getValidation } from '../getValidation';
@@ -13,8 +13,9 @@ export const InnField = JSX<CustomFieldProps>(({ field, input }) => {
13
13
  }, []);
14
14
 
15
15
  return (
16
- <InputNumberControl
16
+ <InputControl
17
17
  label="ИНН"
18
+ type="number"
18
19
  inputLength={12}
19
20
  {...input}
20
21
  {...getValidation(field('inn'), validatorObj.inn, input?.required)}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const JobsNumberField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Количество мест работы за последние 5 лет"
10
10
  placeholder="Количество мест"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const LastJobExperienceField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Стаж на последнем рабочем месте"
10
10
  placeholder="Количество лет"
11
11
  inputLength={2}
@@ -1,11 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { InputNumberControl } from '../../Input/InputNumberControl';
2
+ import { InputControl } from '../../Input/InputControl';
3
3
  import { type CustomFieldProps } from '../CustomFieldProps';
4
4
  import { validatorObj } from '../getObjectValidator';
5
5
  import { getValidation } from '../getValidation';
6
6
 
7
7
  export const PartInBusinessField = JSX<CustomFieldProps>(({ field, input }) => (
8
- <InputNumberControl
8
+ <InputControl
9
9
  label="Доля участия в бизнесе"
10
10
  placeholder="в %"
11
11
  inputLength={2}
@@ -1,4 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
2
3
  import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
3
4
  import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
4
5
  import { getRequiredLabel } from '../../utils/getRequiredLabel';
@@ -24,11 +25,17 @@ export const InputControl = JSX<InputProps>(
24
25
  type,
25
26
  name = '',
26
27
  daDataQueryPrefix,
28
+ inputLength,
27
29
  dadata = false,
28
30
  }) => {
29
31
  const [isOpen, { setFalse: close, setTrue: open }] = useBool();
30
32
  const popupRef = useOutsideClick<HTMLDivElement>(close);
31
33
 
34
+ const handleChange = useCallback(
35
+ (v: string) => (inputLength ? v.length <= inputLength && onChange(v) : onChange(v)),
36
+ [onChange],
37
+ );
38
+
32
39
  const inputRef = useInputPopup({
33
40
  isOpen: isOpen && dadata,
34
41
  name,
@@ -52,7 +59,7 @@ export const InputControl = JSX<InputProps>(
52
59
  label={getRequiredLabel({ label, errors })}
53
60
  valid={Boolean(!error)}
54
61
  value={value}
55
- onChange={onChange}
62
+ onChange={handleChange}
56
63
  onBlur={onBlur}
57
64
  isTextarea={isTextarea}
58
65
  placeholder={getPlaceholder(placeholder, errors, label)}
@@ -1,2 +0,0 @@
1
- import { type InputProps } from './InputProps';
2
- export declare const InputNumberControl: import("@redneckz/uni-jsx").UNIComponent<InputProps<string>, any, any>;
@@ -1,2 +0,0 @@
1
- import { type InputProps } from '../Input/InputProps';
2
- export declare const InputNumber: import("@redneckz/uni-jsx").UNIComponent<InputProps<string>, any, any>;
@@ -1,2 +0,0 @@
1
- import { type InputProps } from './InputProps';
2
- export declare const InputNumberControl: import("@redneckz/uni-jsx").UNIComponent<InputProps<string>, any, any>;
@@ -1,10 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.InputNumberControl = void 0;
3
- const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
- const uni_jsx_1 = require("@redneckz/uni-jsx");
5
- const getRequiredLabel_1 = require("../../utils/getRequiredLabel");
6
- const style_1 = require("../../utils/style");
7
- const InputNumber_1 = require("../InputNumber/InputNumber");
8
- const renderErrorText_1 = require("./renderErrorText");
9
- exports.InputNumberControl = (0, uni_jsx_1.JSX)(({ className, label, error, ...rest }) => ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.style)('shrink-0 w-full', className), children: [(0, jsx_runtime_1.jsx)(InputNumber_1.InputNumber, { "aria-label": label, label: (0, getRequiredLabel_1.getRequiredLabel)({ label, errors: rest?.errors }), valid: Boolean(!error), ...rest }), (0, renderErrorText_1.renderErrorText)(error)] })));
10
- //# sourceMappingURL=InputNumberControl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputNumberControl.js","sourceRoot":"","sources":["../../../src/ui-kit/Input/InputNumberControl.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,mEAAgE;AAChE,6CAA0C;AAC1C,4DAAyD;AAEzD,uDAAoD;AAEvC,QAAA,kBAAkB,GAAG,IAAA,aAAG,EAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAC1F,iCAAK,SAAS,EAAE,IAAA,aAAK,EAAC,iBAAiB,EAAE,SAAS,CAAC,aACjD,uBAAC,yBAAW,kBACE,KAAK,EACjB,KAAK,EAAE,IAAA,mCAAgB,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EACxD,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,KAClB,IAAI,GACR,EACD,IAAA,iCAAe,EAAC,KAAK,CAAC,IACnB,CACP,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type InputProps } from '../Input/InputProps';
2
- export declare const InputNumber: import("@redneckz/uni-jsx").UNIComponent<InputProps<string>, any, any>;