@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.
- package/bundle/bundle.umd.js +18 -27
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +3 -5
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/InnField.js +2 -2
- package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/dist/ui-kit/Input/InputControl.js +4 -2
- package/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js +3 -5
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/InnField.js +2 -2
- package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/lib/ui-kit/Input/InputControl.js +4 -2
- package/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +18 -27
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +3 -5
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputControl.js +4 -2
- package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +3 -5
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DependentsField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulNumberField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulSerieField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/Experience5YearsField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/FamilyMembersField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/GeneralSeniorityField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/JobsNumberField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/LastJobExperienceField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputControl.js +4 -2
- package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +4 -5
- package/mobile/src/ui-kit/FormField/Fields/DependentsField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/DulNumberField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/DulSerieField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +3 -2
- package/mobile/src/ui-kit/FormField/Fields/JobsNumberField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +2 -2
- package/mobile/src/ui-kit/Input/InputControl.tsx +8 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.tsx +4 -5
- package/src/ui-kit/FormField/Fields/DependentsField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/DulNumberField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/DulSerieField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/Experience5YearsField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/FamilyMembersField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/GeneralSeniorityField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/InnField.tsx +3 -2
- package/src/ui-kit/FormField/Fields/JobsNumberField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/LastJobExperienceField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +2 -2
- package/src/ui-kit/Input/InputControl.tsx +8 -1
- package/bundle/ui-kit/Input/InputNumberControl.d.ts +0 -2
- package/bundle/ui-kit/InputNumber/InputNumber.d.ts +0 -2
- package/dist/ui-kit/Input/InputNumberControl.d.ts +0 -2
- package/dist/ui-kit/Input/InputNumberControl.js +0 -10
- package/dist/ui-kit/Input/InputNumberControl.js.map +0 -1
- package/dist/ui-kit/InputNumber/InputNumber.d.ts +0 -2
- package/dist/ui-kit/InputNumber/InputNumber.js +0 -12
- package/dist/ui-kit/InputNumber/InputNumber.js.map +0 -1
- package/lib/ui-kit/Input/InputNumberControl.d.ts +0 -2
- package/lib/ui-kit/Input/InputNumberControl.js +0 -8
- package/lib/ui-kit/Input/InputNumberControl.js.map +0 -1
- package/lib/ui-kit/InputNumber/InputNumber.d.ts +0 -2
- package/lib/ui-kit/InputNumber/InputNumber.js +0 -10
- package/lib/ui-kit/InputNumber/InputNumber.js.map +0 -1
- package/mobile/bundle/ui-kit/Input/InputNumberControl.d.ts +0 -2
- package/mobile/bundle/ui-kit/InputNumber/InputNumber.d.ts +0 -2
- package/mobile/dist/ui-kit/Input/InputNumberControl.d.ts +0 -2
- package/mobile/dist/ui-kit/Input/InputNumberControl.js +0 -10
- package/mobile/dist/ui-kit/Input/InputNumberControl.js.map +0 -1
- package/mobile/dist/ui-kit/InputNumber/InputNumber.d.ts +0 -2
- package/mobile/dist/ui-kit/InputNumber/InputNumber.js +0 -12
- package/mobile/dist/ui-kit/InputNumber/InputNumber.js.map +0 -1
- package/mobile/lib/ui-kit/Input/InputNumberControl.d.ts +0 -2
- package/mobile/lib/ui-kit/Input/InputNumberControl.js +0 -8
- package/mobile/lib/ui-kit/Input/InputNumberControl.js.map +0 -1
- package/mobile/lib/ui-kit/InputNumber/InputNumber.d.ts +0 -2
- package/mobile/lib/ui-kit/InputNumber/InputNumber.js +0 -10
- package/mobile/lib/ui-kit/InputNumber/InputNumber.js.map +0 -1
- package/mobile/src/ui-kit/Input/InputNumberControl.tsx +0 -18
- package/mobile/src/ui-kit/InputNumber/InputNumber.tsx +0 -24
- package/src/ui-kit/Input/InputNumberControl.tsx +0 -18
- 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 {
|
|
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(
|
|
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,
|
|
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 {
|
|
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(
|
|
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,
|
|
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:
|
|
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,
|
|
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 '
|
|
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
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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={
|
|
62
|
+
onChange={handleChange}
|
|
56
63
|
onBlur={onBlur}
|
|
57
64
|
isTextarea={isTextarea}
|
|
58
65
|
placeholder={getPlaceholder(placeholder, errors, label)}
|
package/package.json
CHANGED
|
@@ -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 '
|
|
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
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
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={
|
|
62
|
+
onChange={handleChange}
|
|
56
63
|
onBlur={onBlur}
|
|
57
64
|
isTextarea={isTextarea}
|
|
58
65
|
placeholder={getPlaceholder(placeholder, errors, label)}
|
|
@@ -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"}
|