@redneckz/wildless-cms-uni-blocks 0.14.594 → 0.14.595
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 -17
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/model/DefaultControlType.d.ts +7 -0
- package/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/bundle/ui-kit/Input/InputProps.d.ts +2 -6
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/bundle/ui-kit/Select/Select.d.ts +4 -7
- package/bundle/ui-kit/Select/SelectControl.d.ts +1 -8
- package/bundle/utils/getRequiredLabel.d.ts +2 -0
- package/dist/model/DefaultControlType.d.ts +7 -0
- package/dist/model/DefaultControlType.js +2 -0
- package/dist/model/DefaultControlType.js.map +1 -0
- package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/dist/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/SexField.js +5 -4
- package/dist/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/VedField.js +1 -1
- package/dist/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/dist/ui-kit/Input/InputControl.js +2 -2
- package/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/dist/ui-kit/Input/InputPhoneControl.js +2 -1
- package/dist/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/dist/ui-kit/Input/InputProps.d.ts +2 -6
- package/dist/ui-kit/Input/InputSnilsControl.js +2 -1
- package/dist/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +10 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/dist/ui-kit/Select/Select.d.ts +4 -7
- package/dist/ui-kit/Select/Select.js +3 -4
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/ui-kit/Select/SelectControl.d.ts +1 -8
- package/dist/ui-kit/Select/SelectControl.js +2 -1
- package/dist/ui-kit/Select/SelectControl.js.map +1 -1
- package/dist/utils/getRequiredLabel.d.ts +2 -0
- package/dist/utils/getRequiredLabel.js +5 -0
- package/dist/utils/getRequiredLabel.js.map +1 -0
- package/lib/model/DefaultControlType.d.ts +7 -0
- package/lib/model/DefaultControlType.js +2 -0
- package/lib/model/DefaultControlType.js.map +1 -0
- package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/lib/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/SexField.js +5 -4
- package/lib/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/VedField.js +1 -1
- package/lib/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/lib/ui-kit/Input/InputControl.js +2 -2
- package/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/lib/ui-kit/Input/InputPhoneControl.js +2 -1
- package/lib/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/lib/ui-kit/Input/InputProps.d.ts +2 -6
- package/lib/ui-kit/Input/InputSnilsControl.js +2 -1
- package/lib/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +8 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/lib/ui-kit/Select/Select.d.ts +4 -7
- package/lib/ui-kit/Select/Select.js +3 -4
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/ui-kit/Select/SelectControl.d.ts +1 -8
- package/lib/ui-kit/Select/SelectControl.js +2 -1
- package/lib/ui-kit/Select/SelectControl.js.map +1 -1
- package/lib/utils/getRequiredLabel.d.ts +2 -0
- package/lib/utils/getRequiredLabel.js +2 -0
- package/lib/utils/getRequiredLabel.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +18 -17
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/model/DefaultControlType.d.ts +7 -0
- package/mobile/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +2 -6
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/Select/Select.d.ts +4 -7
- package/mobile/bundle/ui-kit/Select/SelectControl.d.ts +1 -8
- package/mobile/bundle/utils/getRequiredLabel.d.ts +2 -0
- package/mobile/dist/model/DefaultControlType.d.ts +7 -0
- package/mobile/dist/model/DefaultControlType.js +2 -0
- package/mobile/dist/model/DefaultControlType.js.map +1 -0
- package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SexField.js +5 -4
- package/mobile/dist/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/VedField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputControl.js +2 -2
- package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputPhoneControl.js +2 -1
- package/mobile/dist/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +2 -6
- package/mobile/dist/ui-kit/Input/InputSnilsControl.js +2 -1
- package/mobile/dist/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +10 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.d.ts +4 -7
- package/mobile/dist/ui-kit/Select/Select.js +3 -4
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/ui-kit/Select/SelectControl.d.ts +1 -8
- package/mobile/dist/ui-kit/Select/SelectControl.js +2 -1
- package/mobile/dist/ui-kit/Select/SelectControl.js.map +1 -1
- package/mobile/dist/utils/getRequiredLabel.d.ts +2 -0
- package/mobile/dist/utils/getRequiredLabel.js +5 -0
- package/mobile/dist/utils/getRequiredLabel.js.map +1 -0
- package/mobile/lib/model/DefaultControlType.d.ts +7 -0
- package/mobile/lib/model/DefaultControlType.js +2 -0
- package/mobile/lib/model/DefaultControlType.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SexField.js +5 -4
- package/mobile/lib/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/VedField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputControl.js +2 -2
- package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputPhoneControl.js +2 -1
- package/mobile/lib/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +2 -6
- package/mobile/lib/ui-kit/Input/InputSnilsControl.js +2 -1
- package/mobile/lib/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +8 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.d.ts +4 -7
- package/mobile/lib/ui-kit/Select/Select.js +3 -4
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/ui-kit/Select/SelectControl.d.ts +1 -8
- package/mobile/lib/ui-kit/Select/SelectControl.js +2 -1
- package/mobile/lib/ui-kit/Select/SelectControl.js.map +1 -1
- package/mobile/lib/utils/getRequiredLabel.d.ts +2 -0
- package/mobile/lib/utils/getRequiredLabel.js +2 -0
- package/mobile/lib/utils/getRequiredLabel.js.map +1 -0
- package/mobile/src/model/DefaultControlType.ts +7 -0
- package/mobile/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +1 -1
- package/mobile/src/ui-kit/DatePicker/DatePickerControl.tsx +6 -14
- package/mobile/src/ui-kit/FormField/Fields/SexField.tsx +13 -11
- package/mobile/src/ui-kit/FormField/Fields/VedField.tsx +1 -1
- package/mobile/src/ui-kit/Input/InputControl.tsx +2 -3
- package/mobile/src/ui-kit/Input/InputPhoneControl.tsx +2 -1
- package/mobile/src/ui-kit/Input/InputProps.ts +2 -6
- package/mobile/src/ui-kit/Input/InputSnilsControl.tsx +2 -1
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -10
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroupControl.tsx +18 -0
- package/mobile/src/ui-kit/Select/Select.tsx +8 -10
- package/mobile/src/ui-kit/Select/SelectControl.tsx +4 -10
- package/mobile/src/utils/getRequiredLabel.ts +4 -0
- package/package.json +1 -1
- package/src/model/DefaultControlType.ts +7 -0
- package/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +1 -1
- package/src/ui-kit/DatePicker/DatePickerControl.tsx +6 -14
- package/src/ui-kit/FormField/Fields/SexField.tsx +13 -11
- package/src/ui-kit/FormField/Fields/VedField.tsx +1 -1
- package/src/ui-kit/Input/InputControl.tsx +2 -3
- package/src/ui-kit/Input/InputPhoneControl.tsx +2 -1
- package/src/ui-kit/Input/InputProps.ts +2 -6
- package/src/ui-kit/Input/InputSnilsControl.tsx +2 -1
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.fixture.tsx +2 -2
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -10
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroupControl.tsx +18 -0
- package/src/ui-kit/Select/Select.tsx +8 -10
- package/src/ui-kit/Select/SelectControl.tsx +4 -10
- package/src/utils/getRequiredLabel.ts +4 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -1162,6 +1162,8 @@
|
|
|
1162
1162
|
return targetRef;
|
|
1163
1163
|
}
|
|
1164
1164
|
|
|
1165
|
+
const getRequiredLabel = ({ label, errors }) => label && errors ? `${label}*` : label;
|
|
1166
|
+
|
|
1165
1167
|
const noop = () => {
|
|
1166
1168
|
// Do nothing
|
|
1167
1169
|
};
|
|
@@ -1333,9 +1335,8 @@
|
|
|
1333
1335
|
value,
|
|
1334
1336
|
onChange,
|
|
1335
1337
|
});
|
|
1336
|
-
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:
|
|
1338
|
+
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)] }));
|
|
1337
1339
|
});
|
|
1338
|
-
const getLabel = (errors, label) => (label && errors ? `${label}*` : label);
|
|
1339
1340
|
const getPlaceholder = (placeholder, errors, label) => errors && !label ? `${placeholder}*` : placeholder;
|
|
1340
1341
|
|
|
1341
1342
|
const formatOption = (_) => _?.text || _?.key || '';
|
|
@@ -1383,12 +1384,10 @@
|
|
|
1383
1384
|
return inputRef;
|
|
1384
1385
|
}
|
|
1385
1386
|
|
|
1386
|
-
const Select = JSX(
|
|
1387
|
-
// eslint-disable-next-line complexity
|
|
1388
|
-
({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, iconVersion = 'black', onChange, disabled, }) => {
|
|
1387
|
+
const Select = JSX(({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, iconVersion = 'black', onChange, disabled = false, }) => {
|
|
1389
1388
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1390
1389
|
const [query, setQuery] = useState('');
|
|
1391
|
-
const isDisabled = disabled
|
|
1390
|
+
const isDisabled = getDisabled(disabled, options.length);
|
|
1392
1391
|
const hasOpen = isOpen && !isDisabled;
|
|
1393
1392
|
const handleClose = useCallback(() => {
|
|
1394
1393
|
setQuery('');
|
|
@@ -1407,8 +1406,9 @@
|
|
|
1407
1406
|
});
|
|
1408
1407
|
const renderIcon$1 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-0 flex self-center', { 'rotate-180': !isOpen }), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
|
|
1409
1408
|
const getStyle = (isBorder, valid, disabled) => style(isBorder ? 'border rounded-md ' : '', isBorder && !disabled ? 'hover:border-primary-hover' : '', disabled ? 'bg-main-divider' : 'cursor-pointer ', valid ? 'border-gray' : 'border-error');
|
|
1409
|
+
const getDisabled = (disabled, length) => disabled || length === 0;
|
|
1410
1410
|
|
|
1411
|
-
const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label:
|
|
1411
|
+
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1412
1412
|
|
|
1413
1413
|
const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
|
|
1414
1414
|
|
|
@@ -1912,7 +1912,7 @@
|
|
|
1912
1912
|
});
|
|
1913
1913
|
const renderDatePickerForm = (handleChangeVisibleCalendar, value, valid) => (jsxs("div", { onClick: handleChangeVisibleCalendar, className: style(formStyle, valid ? 'border-gray' : 'border-error'), children: [jsx(Paragraph, { children: value && formatDate(value) }), jsx(Icon, { ...ICON_PROPS, name: "CalendarIcon" })] }));
|
|
1914
1914
|
|
|
1915
|
-
const DatePickerControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: label
|
|
1915
|
+
const DatePickerControl = JSX(({ className, label, error, errors, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: getRequiredLabel({ label, errors }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
|
|
1916
1916
|
|
|
1917
1917
|
const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...getValidation(field('beginDate'), validatorObj.beginDate, input?.required), ...input })));
|
|
1918
1918
|
|
|
@@ -2084,7 +2084,7 @@
|
|
|
2084
2084
|
return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
|
|
2085
2085
|
});
|
|
2086
2086
|
|
|
2087
|
-
const InputPhoneControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors
|
|
2087
|
+
const InputPhoneControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: getRequiredLabel({ label, errors: rest?.errors }), valid: Boolean(!error), placeholder: "+7 (___) ___-__-__", ...rest }), renderErrorText(error)] })));
|
|
2088
2088
|
|
|
2089
2089
|
const PhoneField = JSX(({ field, input }) => (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'), validatorObj.phone, input?.required), ...input })));
|
|
2090
2090
|
|
|
@@ -2127,15 +2127,16 @@
|
|
|
2127
2127
|
horizontal: '@lg:flex-row',
|
|
2128
2128
|
vertical: '',
|
|
2129
2129
|
};
|
|
2130
|
-
const RadioButtonGroup = JSX(({
|
|
2130
|
+
const RadioButtonGroup = JSX(({ label, items, value, className, onChange: onChangeCheckedItem, disabled = false, orientation = 'horizontal', }) => (jsxs("div", { className: "grid gap-xs whitespace-nowrap", children: [label ? (jsx("div", { role: "radiogroup", "aria-label": label, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: label }) })) : null, jsx("div", { className: style('flex flex-col gap-s', orientationStyleMap[orientation], className), role: "radiogroup", "aria-label": "\u0413\u0440\u0443\u043F\u043F\u0430 \u043A\u043D\u043E\u043F\u043E\u043A", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: value === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id), disabled: disabled }, String(id)))) })] })));
|
|
2131
|
+
|
|
2132
|
+
const RadioButtonGroupControl = JSX(({ className, label, onChange, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), onChange: (_) => onChange && onChange(_), ...rest }), renderErrorText(error)] })));
|
|
2131
2133
|
|
|
2132
2134
|
const SEX_TYPES = [
|
|
2133
2135
|
{ id: 'male', text: 'Мужской' },
|
|
2134
2136
|
{ id: 'female', text: 'Женский' },
|
|
2135
2137
|
];
|
|
2136
|
-
const SexField = JSX(({ field }) => {
|
|
2137
|
-
|
|
2138
|
-
return (jsx(RadioButtonGroup, { title: "\u041F\u043E\u043B", orientation: "horizontal", items: SEX_TYPES, checkedItem: value, onChange: (_) => onChange && onChange(_) }));
|
|
2138
|
+
const SexField = JSX(({ field, input }) => {
|
|
2139
|
+
return (jsx("div", { children: jsx(RadioButtonGroupControl, { label: "\u041F\u043E\u043B", orientation: "horizontal", items: SEX_TYPES, ...getValidation(field('sex'), validatorObj.sex, input?.required) }) }));
|
|
2139
2140
|
});
|
|
2140
2141
|
|
|
2141
2142
|
const isPlaceholder = (_) => _ === '_';
|
|
@@ -2168,7 +2169,7 @@
|
|
|
2168
2169
|
return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
|
|
2169
2170
|
});
|
|
2170
2171
|
|
|
2171
|
-
const InputSnilsControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(SnilsInput, { "aria-label": label, label: rest?.errors
|
|
2172
|
+
const InputSnilsControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(SnilsInput, { "aria-label": label, label: getRequiredLabel({ label, errors: rest?.errors }), valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "___-___-___ __" }), renderErrorText(error)] })));
|
|
2172
2173
|
|
|
2173
2174
|
const SnilsField = JSX(({ field, input }) => (jsx(InputSnilsControl, { label: "\u0421\u041D\u0418\u041B\u0421", ...getValidation(field('snils'), validatorObj.snils, input?.required), ...input })));
|
|
2174
2175
|
|
|
@@ -2197,7 +2198,7 @@
|
|
|
2197
2198
|
field?.('region')?.onChange?.('');
|
|
2198
2199
|
}
|
|
2199
2200
|
}, [value]);
|
|
2200
|
-
return (jsx("div", { className: "py-m gap-m grid @xl:flex @xl:items-center", children: jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: VED_TYPES,
|
|
2201
|
+
return (jsx("div", { className: "py-m gap-m grid @xl:flex @xl:items-center", children: jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: VED_TYPES, value: value, onChange: (_) => onChange && onChange(_) }) }));
|
|
2201
2202
|
});
|
|
2202
2203
|
|
|
2203
2204
|
function isRenderField({ input, field, }) {
|
|
@@ -3642,7 +3643,7 @@
|
|
|
3642
3643
|
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
3643
3644
|
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
3644
3645
|
|
|
3645
|
-
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items,
|
|
3646
|
+
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, value: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id), ...rest })] }));
|
|
3646
3647
|
|
|
3647
3648
|
const renderPayout = (props) => renderBinaryRadioButtonGroup({
|
|
3648
3649
|
...props,
|
|
@@ -7458,7 +7459,7 @@
|
|
|
7458
7459
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7459
7460
|
});
|
|
7460
7461
|
|
|
7461
|
-
const packageVersion = "0.14.
|
|
7462
|
+
const packageVersion = "0.14.594";
|
|
7462
7463
|
|
|
7463
7464
|
exports.Blocks = Blocks;
|
|
7464
7465
|
exports.ContentPage = ContentPage;
|