@redneckz/wildless-cms-uni-blocks 0.14.674 → 0.14.675
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 +9 -5
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/dist/ui-kit/FormField/validators.js +3 -2
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/Input/InputControl.js +4 -1
- package/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/lib/ui-kit/FormField/validators.js +3 -2
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/Input/InputControl.js +4 -1
- package/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +9 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.js +3 -2
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputControl.js +4 -1
- package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.js +3 -2
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputControl.js +4 -1
- package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/src/ui-kit/FormField/Fields/AddressFactField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/validators.ts +4 -3
- package/mobile/src/ui-kit/Input/InputControl.tsx +5 -2
- package/package.json +1 -1
- package/src/ui-kit/FormField/Fields/AddressFactField.tsx +1 -1
- package/src/ui-kit/FormField/validators.ts +4 -3
- package/src/ui-kit/Input/InputControl.tsx +5 -2
package/bundle/bundle.umd.js
CHANGED
|
@@ -1332,7 +1332,10 @@
|
|
|
1332
1332
|
const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, maxLength, dadata = false, disabled = false, }) => {
|
|
1333
1333
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1334
1334
|
const popupRef = useOutsideClick(close);
|
|
1335
|
-
const handleChange = useCallback((v) =>
|
|
1335
|
+
const handleChange = useCallback((v) => {
|
|
1336
|
+
dadata && !isOpen && open();
|
|
1337
|
+
maxLength ? v.length <= maxLength && onChange(v) : onChange(v);
|
|
1338
|
+
}, [dadata, isOpen, onChange]);
|
|
1336
1339
|
const inputRef = useInputPopup({
|
|
1337
1340
|
isOpen: isOpen && dadata,
|
|
1338
1341
|
name,
|
|
@@ -1426,6 +1429,7 @@
|
|
|
1426
1429
|
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
1427
1430
|
|
|
1428
1431
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
1432
|
+
const ADDRESS_ERROR_MESSAGE = 'Укажите регион, город/населенный пункт, улицу, дом';
|
|
1429
1433
|
const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE);
|
|
1430
1434
|
const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE);
|
|
1431
1435
|
const jobNumberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 0 && _.length <= 2)(errorMsg ?? ERROR_MESSAGE);
|
|
@@ -1457,8 +1461,8 @@
|
|
|
1457
1461
|
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(email);
|
|
1458
1462
|
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
1459
1463
|
const addressDaDataValidate = (address) => Boolean(address.region && address.city && address.house);
|
|
1460
|
-
const addressDaDataValidator = () => validator(addressDaDataValidate)(
|
|
1461
|
-
const addressOrganizationValidator = () => validator((address) => Boolean(address.fiasCode && address.city && address.house))(
|
|
1464
|
+
const addressDaDataValidator = () => validator(addressDaDataValidate)(ADDRESS_ERROR_MESSAGE);
|
|
1465
|
+
const addressOrganizationValidator = () => validator((address) => Boolean(address.fiasCode && address.city && address.house))(ADDRESS_ERROR_MESSAGE);
|
|
1462
1466
|
const codeWordValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length >= 3 && _.length <= 21 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE);
|
|
1463
1467
|
const cyrillicPattern = /^[\u0400-\u04FF\d]+$/u;
|
|
1464
1468
|
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
@@ -1696,7 +1700,7 @@
|
|
|
1696
1700
|
if (value) {
|
|
1697
1701
|
field('addressFact')?.onChange?.(field('addressRegistration').value);
|
|
1698
1702
|
}
|
|
1699
|
-
}, [value]);
|
|
1703
|
+
}, [value, field('addressRegistration').value]);
|
|
1700
1704
|
const onDaDataChange = useCallback((item) => {
|
|
1701
1705
|
field?.(fieldName)?.onChange?.({
|
|
1702
1706
|
apartment: item?.data?.flat,
|
|
@@ -10025,7 +10029,7 @@
|
|
|
10025
10029
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10026
10030
|
});
|
|
10027
10031
|
|
|
10028
|
-
const packageVersion = "0.14.
|
|
10032
|
+
const packageVersion = "0.14.674";
|
|
10029
10033
|
|
|
10030
10034
|
exports.Blocks = Blocks;
|
|
10031
10035
|
exports.ContentPage = ContentPage;
|