@redneckz/wildless-cms-uni-blocks 0.14.590 → 0.14.591
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 +63 -61
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/ui-kit/FormField/validators.d.ts +9 -9
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js +3 -1
- package/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +46 -45
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +9 -9
- package/dist/ui-kit/FormField/validators.js +17 -9
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/Input/Input.js +3 -2
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js +3 -1
- package/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +46 -45
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +9 -9
- package/lib/ui-kit/FormField/validators.js +9 -9
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/Input/Input.js +3 -2
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +63 -61
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +9 -9
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js +3 -1
- package/mobile/dist/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +46 -45
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +9 -9
- package/mobile/dist/ui-kit/FormField/validators.js +17 -9
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +3 -2
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js +3 -1
- package/mobile/lib/ui-kit/FormField/Fields/MiddleNameField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +46 -45
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +9 -9
- package/mobile/lib/ui-kit/FormField/validators.js +9 -9
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +3 -2
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/src/ui-kit/FormField/Fields/MiddleNameField.tsx +7 -1
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +46 -45
- package/mobile/src/ui-kit/FormField/validators.ts +19 -18
- package/mobile/src/ui-kit/Input/Input.tsx +6 -2
- package/package.json +1 -1
- package/src/ui-kit/FormField/Fields/MiddleNameField.tsx +7 -1
- package/src/ui-kit/FormField/getObjectValidator.tsx +46 -45
- package/src/ui-kit/FormField/validators.ts +19 -18
- package/src/ui-kit/Input/Input.tsx +6 -2
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
154
154
|
|
|
155
155
|
const DEFAULT_ANCESTORS = [];
|
|
156
|
-
const defaultStyle$
|
|
156
|
+
const defaultStyle$2 = 'col-span-12';
|
|
157
157
|
function renderBlock$1(block, options, { className, ...extraProps } = {}) {
|
|
158
158
|
const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
|
|
159
159
|
const { type } = block;
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
}
|
|
163
163
|
const BlockComponent = type && blocksRegistry[type];
|
|
164
164
|
return blockDecorator({
|
|
165
|
-
blockClassName: style(block.style?.length ? block.style : defaultStyle$
|
|
165
|
+
blockClassName: style(block.style?.length ? block.style : defaultStyle$2, className),
|
|
166
166
|
block,
|
|
167
167
|
ancestors,
|
|
168
168
|
// Adjusted by decorator block and blockClassName
|
|
@@ -1181,19 +1181,20 @@
|
|
|
1181
1181
|
const Input = JSX(({ key, className = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, isTextarea = false, }) => {
|
|
1182
1182
|
const inputRef = useRef(null);
|
|
1183
1183
|
const handleChange = useCallback((e) => {
|
|
1184
|
-
|
|
1184
|
+
const valueWithoutSpace = (e.target?.value || '').trimStart();
|
|
1185
|
+
onChange && onChange(valueWithoutSpace);
|
|
1185
1186
|
}, [onChange]);
|
|
1186
1187
|
useEffect(() => {
|
|
1187
1188
|
if (autoFocus) {
|
|
1188
1189
|
inputRef.current?.focus();
|
|
1189
1190
|
}
|
|
1190
1191
|
}, [autoFocus, inputRef]);
|
|
1191
|
-
const defaultStyle = 'w-full border rounded-md text-primary-text outline-none p-m';
|
|
1192
1192
|
const paddingStyle = children ? 'pr-3xl' : '';
|
|
1193
1193
|
const validStyle = getValidStyle(valid);
|
|
1194
|
-
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { className: "space-y-xs", children: [renderLabel(label), isTextarea ? (jsx("textarea", { className: style('block resize-y min-h-24', defaultStyle, validStyle), id: style('textarea', id), name: name || id, placeholder: placeholder, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }, key)) : (jsx("input", { type: type, className: style('h-14', defaultStyle, paddingStyle, validStyle), ref: inputRef, id: id, name: name || id, placeholder: placeholder, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key))] }), children] }));
|
|
1194
|
+
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { className: "space-y-xs", children: [renderLabel(label), isTextarea ? (jsx("textarea", { className: style('block resize-y min-h-24', defaultStyle$1, validStyle), id: style('textarea', id), name: name || id, placeholder: placeholder, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur }, key)) : (jsx("input", { type: type, className: style('h-14', defaultStyle$1, paddingStyle, validStyle), ref: inputRef, id: id, name: name || id, placeholder: placeholder, value: value, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key))] }), children] }));
|
|
1195
1195
|
});
|
|
1196
1196
|
const getValidStyle = (valid) => (valid ? inputValidStyle : 'border-error');
|
|
1197
|
+
const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
|
|
1197
1198
|
|
|
1198
1199
|
const DEFAULT_HINTS_COUNT = 10;
|
|
1199
1200
|
const getResponseHandler = (response) => {
|
|
@@ -1425,14 +1426,14 @@
|
|
|
1425
1426
|
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
1426
1427
|
|
|
1427
1428
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
1428
|
-
const defaultValidator = required(ERROR_MESSAGE);
|
|
1429
|
+
const defaultValidator = (errorMsg) => required(errorMsg ? errorMsg : ERROR_MESSAGE);
|
|
1429
1430
|
const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
|
|
1430
|
-
const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
|
|
1431
|
-
const lengthStringValidator = (maxLength) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= maxLength)(ERROR_MESSAGE);
|
|
1432
|
-
const serieValidator = validator((_) => typeof _ === 'string' && _.length === 4)(
|
|
1433
|
-
const numberValidator = validator((_) => typeof _ === 'string' && _.length === 6)(
|
|
1434
|
-
const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(
|
|
1435
|
-
const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(
|
|
1431
|
+
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1)(errorMsg ? errorMsg : ERROR_MESSAGE);
|
|
1432
|
+
const lengthStringValidator = (maxLength, errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 1 && _.length <= maxLength)(errorMsg ? errorMsg : ERROR_MESSAGE);
|
|
1433
|
+
const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
|
|
1434
|
+
const numberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 6)(errorMsg);
|
|
1435
|
+
const innValidator = (errorMsg) => validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(errorMsg);
|
|
1436
|
+
const phoneValidator = (errorMsg) => pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(errorMsg);
|
|
1436
1437
|
const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
|
|
1437
1438
|
const snilsValidate = (snils) => {
|
|
1438
1439
|
const snl = String(snils).replace(/[^0-9]+/g, '');
|
|
@@ -1451,55 +1452,56 @@
|
|
|
1451
1452
|
}
|
|
1452
1453
|
return false;
|
|
1453
1454
|
};
|
|
1454
|
-
const snilsValidator = validator(snilsValidate)(
|
|
1455
|
+
const snilsValidator = (errorMsg) => validator(snilsValidate)(errorMsg);
|
|
1455
1456
|
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2}$/.test(email);
|
|
1456
|
-
const emailValidator = validator((_) => emailValidate(_))(
|
|
1457
|
+
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
1457
1458
|
|
|
1458
1459
|
const validatorObj = {
|
|
1459
|
-
typeForm: defaultValidator,
|
|
1460
|
-
surname: nameValidator,
|
|
1461
|
-
name: nameValidator,
|
|
1460
|
+
typeForm: defaultValidator(),
|
|
1461
|
+
surname: nameValidator('Укажите свою фамилию'),
|
|
1462
|
+
name: nameValidator('Укажите своё имя'),
|
|
1463
|
+
middleName: nameValidator('Укажите своё отчество'),
|
|
1462
1464
|
region: defaultSelectValidator,
|
|
1463
1465
|
addressBranch: defaultSelectValidator,
|
|
1464
|
-
phone: phoneValidator,
|
|
1465
|
-
secondaryPhone: phoneValidator,
|
|
1466
|
-
birthday: defaultValidator,
|
|
1467
|
-
education: defaultValidator,
|
|
1468
|
-
housing: defaultValidator,
|
|
1469
|
-
employment: defaultValidator,
|
|
1470
|
-
organization: defaultValidator,
|
|
1471
|
-
amountWorkers: defaultValidator,
|
|
1472
|
-
employerActivities: defaultValidator,
|
|
1473
|
-
employerOrganization: defaultValidator,
|
|
1474
|
-
positionOrganization: defaultValidator,
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
fullName: nameValidator,
|
|
1482
|
-
inn: innValidator,
|
|
1483
|
-
legalForm: defaultValidator,
|
|
1484
|
-
organizationName: defaultValidator,
|
|
1485
|
-
generalSeniority: defaultValidator,
|
|
1486
|
-
lastJobExperience: defaultValidator,
|
|
1487
|
-
experience5Years: defaultValidator,
|
|
1488
|
-
jobsNumber: defaultValidator,
|
|
1489
|
-
beginDate: defaultValidator,
|
|
1490
|
-
fullAddress: defaultValidator,
|
|
1491
|
-
partnerComments: defaultValidator,
|
|
1492
|
-
collectionCount: defaultValidator,
|
|
1493
|
-
comment: defaultValidator,
|
|
1466
|
+
phone: phoneValidator('Укажите номер телефона'),
|
|
1467
|
+
secondaryPhone: phoneValidator('Укажите номер телефона'),
|
|
1468
|
+
birthday: defaultValidator('Укажите дату рождения'),
|
|
1469
|
+
education: defaultValidator('Выберите ваше образование'),
|
|
1470
|
+
housing: defaultValidator('Выберите тип жилья'),
|
|
1471
|
+
employment: defaultValidator('Выберите информацию о трудоустройстве'),
|
|
1472
|
+
organization: defaultValidator('Выберите тип организации'),
|
|
1473
|
+
amountWorkers: defaultValidator('Выберите информацию о количестве сотрудников'),
|
|
1474
|
+
employerActivities: defaultValidator('Выберите вид деятельности организации'),
|
|
1475
|
+
employerOrganization: defaultValidator('Выберите вид организации'),
|
|
1476
|
+
positionOrganization: defaultValidator('Выберите вашу должность'),
|
|
1477
|
+
dulSerie: serieValidator('Укажите серию паспорта'),
|
|
1478
|
+
dulNumber: numberValidator('Укажите номер паспорта'),
|
|
1479
|
+
dulIssueDateField: defaultValidator('Укажите дату выдачи паспорта'),
|
|
1480
|
+
dulSubdivisionCode: numberValidator('Укажите код подразделения'),
|
|
1481
|
+
dulIssuedBy: defaultValidator('Укажите организацию, выдавшую паспорт'),
|
|
1482
|
+
email: emailValidator('Укажите электронную почту'),
|
|
1483
|
+
fullName: nameValidator(),
|
|
1484
|
+
inn: innValidator('Укажите ИНН'),
|
|
1485
|
+
legalForm: defaultValidator('Укажите ОПФ'),
|
|
1486
|
+
organizationName: defaultValidator('Укажите наименование организации'),
|
|
1487
|
+
generalSeniority: defaultValidator(),
|
|
1488
|
+
lastJobExperience: defaultValidator('Укажите стаж на последнем месте работы'),
|
|
1489
|
+
experience5Years: defaultValidator('Укажите общий стаж за последние 5 лет'),
|
|
1490
|
+
jobsNumber: defaultValidator('Укажите количество лет стажа'),
|
|
1491
|
+
beginDate: defaultValidator('Укажите дату заключения трудового договора'),
|
|
1492
|
+
fullAddress: defaultValidator(),
|
|
1493
|
+
partnerComments: defaultValidator(),
|
|
1494
|
+
collectionCount: defaultValidator(),
|
|
1495
|
+
comment: defaultValidator(),
|
|
1494
1496
|
acquiringType: defaultSelectValidator,
|
|
1495
1497
|
feedbackMethod: defaultSelectValidator,
|
|
1496
1498
|
serviceType: defaultSelectValidator,
|
|
1497
1499
|
serviceDirection: defaultSelectValidator,
|
|
1498
|
-
meetingDay: defaultValidator,
|
|
1499
|
-
product: defaultValidator,
|
|
1500
|
-
localities: defaultValidator,
|
|
1500
|
+
meetingDay: defaultValidator(),
|
|
1501
|
+
product: defaultValidator(),
|
|
1502
|
+
localities: defaultValidator(),
|
|
1501
1503
|
consentDataProcessing: agreementValidator,
|
|
1502
|
-
annualRevenue: defaultValidator,
|
|
1504
|
+
annualRevenue: defaultValidator(),
|
|
1503
1505
|
consentToReceiveMaterials: agreementValidator,
|
|
1504
1506
|
processPersonalDataLeadFlg: agreementValidator,
|
|
1505
1507
|
consentProviderFlg: agreementValidator,
|
|
@@ -1508,14 +1510,14 @@
|
|
|
1508
1510
|
consentAssignmentClaimsFlg: agreementValidator,
|
|
1509
1511
|
consentCollectionFlg: agreementValidator,
|
|
1510
1512
|
consentInformFlg: agreementValidator,
|
|
1511
|
-
familyStatus: defaultValidator,
|
|
1512
|
-
children: lengthStringValidator(2),
|
|
1513
|
-
familyMembers: lengthStringValidator(2),
|
|
1514
|
-
dependents: lengthStringValidator(2),
|
|
1515
|
-
totalIncome: lengthStringValidator(19),
|
|
1516
|
-
expenses: lengthStringValidator(10),
|
|
1517
|
-
snils: snilsValidator,
|
|
1518
|
-
conscription: defaultValidator,
|
|
1513
|
+
familyStatus: defaultValidator('Выберите семейное положение'),
|
|
1514
|
+
children: lengthStringValidator(2, 'Укажите количество детей'),
|
|
1515
|
+
familyMembers: lengthStringValidator(2, 'Укажите количество членов семьи'),
|
|
1516
|
+
dependents: lengthStringValidator(2, 'Укажите количество иждивенцев'),
|
|
1517
|
+
totalIncome: lengthStringValidator(19, 'Укажите среднемесячный доход от основной зарплаты'),
|
|
1518
|
+
expenses: lengthStringValidator(10, 'Укажите сумму обязательных выплат'),
|
|
1519
|
+
snils: snilsValidator('Некорректный номер СНИЛС'),
|
|
1520
|
+
conscription: defaultValidator(),
|
|
1519
1521
|
armyIdFlg: agreementValidator,
|
|
1520
1522
|
};
|
|
1521
1523
|
const getObjectValidator = (inputs) => {
|
|
@@ -2034,7 +2036,7 @@
|
|
|
2034
2036
|
return (jsx(SelectControl, { label: "\u041D\u0430\u0441\u0435\u043B\u0435\u043D\u043D\u044B\u0439 \u043F\u0443\u043D\u043A\u0442", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0433\u043E\u0440\u043E\u0434, \u0433\u0434\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0441\u0435\u0440\u0432\u0438\u0441", options: localities, ...getValidation(field('localities'), validatorObj.localities, input?.required), isSearch: true }));
|
|
2035
2037
|
});
|
|
2036
2038
|
|
|
2037
|
-
const MiddleNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName'), ...input })));
|
|
2039
|
+
const MiddleNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...getValidation(field('middleName'), validatorObj.middleName), ...input })));
|
|
2038
2040
|
|
|
2039
2041
|
const NameField = JSX(({ field, input }) => {
|
|
2040
2042
|
const { required, ...rest } = input;
|
|
@@ -7058,7 +7060,7 @@
|
|
|
7058
7060
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7059
7061
|
});
|
|
7060
7062
|
|
|
7061
|
-
const packageVersion = "0.14.
|
|
7063
|
+
const packageVersion = "0.14.590";
|
|
7062
7064
|
|
|
7063
7065
|
exports.Blocks = Blocks;
|
|
7064
7066
|
exports.ContentPage = ContentPage;
|