@atls/tinkoff-payment-widget 0.1.6 → 0.2.1
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/CHANGELOG.md +1 -7
- package/README.md +5 -5
- package/dist/data/index.js +1 -1
- package/dist/enums/index.js +8 -8
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/use-fields-render.hook.js +9 -11
- package/dist/index.js +2 -2
- package/dist/interfaces/index.js +1 -1
- package/dist/locales/index.js +2 -2
- package/dist/ui/button/button.component.js +2 -2
- package/dist/ui/fields.component.js +2 -8
- package/dist/ui/form/form.component.js +2 -7
- package/dist/ui/form/form.provider.js +2 -2
- package/dist/ui/form/index.js +3 -3
- package/dist/ui/index.js +5 -5
- package/dist/ui/input/input.component.js +3 -7
- package/dist/ui/settings.component.d.ts +1 -1
- package/dist/ui/settings.component.js +2 -7
- package/dist/ui/theme/src/index.js +1 -1
- package/dist/ui/theme/src/theme/index.js +1 -1
- package/dist/ui/theme/src/theme.provider.js +2 -2
- package/dist/ui/widget.component.js +2 -6
- package/dist/ui/wrapper/button-wrapper.component.js +5 -5
- package/dist/ui/wrapper/index.js +2 -2
- package/dist/ui/wrapper/input-wrapper.component.js +8 -8
- package/dist/utils/index.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
## [0.1.6](https://github.com/atls/reactjs/compare/@atls/tinkoff-payment-widget@0.1.5...@atls/tinkoff-payment-widget@0.1.6) (2025-01-22)
|
|
4
2
|
|
|
5
|
-
|
|
6
3
|
### Bug Fixes
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
* **react:** lint and typecheck errors ([a090051](https://github.com/atls/reactjs/commit/a090051d1007e171df8066e85f15fcf8fd44c4ed))
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
- **react:** lint and typecheck errors ([a090051](https://github.com/atls/reactjs/commit/a090051d1007e171df8066e85f15fcf8fd44c4ed))
|
package/README.md
CHANGED
|
@@ -50,12 +50,12 @@ export const Form = () => (
|
|
|
50
50
|
|
|
51
51
|
## Экспортируемые компоненты
|
|
52
52
|
|
|
53
|
-
[**Widget**]() - главный компонент Виджета.
|
|
53
|
+
[**Widget**](<>) - главный компонент Виджета.
|
|
54
54
|
|
|
55
|
-
[**InputWrapper**]() - компонент обёртка для полей ввода.
|
|
55
|
+
[**InputWrapper**](<>) - компонент обёртка для полей ввода.
|
|
56
56
|
|
|
57
|
-
[**ButtonWrapper**]() - компонент обёртка для кнопки.
|
|
57
|
+
[**ButtonWrapper**](<>) - компонент обёртка для кнопки.
|
|
58
58
|
|
|
59
|
-
[**AdditionalFieldsType**]() - интерфейс дополнительных полей.
|
|
59
|
+
[**AdditionalFieldsType**](<>) - интерфейс дополнительных полей.
|
|
60
60
|
|
|
61
|
-
[**RequiredFieldsType**]() - интерфейс обязательных полей.
|
|
61
|
+
[**RequiredFieldsType**](<>) - интерфейс обязательных полей.
|
package/dist/data/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './fields.data.js';
|
package/dist/enums/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
1
|
+
export * from './fields.enum.js';
|
|
2
|
+
export * from './language.enum.js';
|
|
3
|
+
export * from './payment-method.enum.js';
|
|
4
|
+
export * from './payment-object.enum.js';
|
|
5
|
+
export * from './tax.enum.js';
|
|
6
|
+
export * from './taxation.enum.js';
|
|
7
|
+
export * from './button.enum.js';
|
|
8
|
+
export * from './wrapper.enum.js';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { useValidate } from
|
|
3
|
-
export { useFieldsState } from
|
|
4
|
-
export { useFieldsRenderer } from
|
|
5
|
-
export { useCustomFields } from
|
|
6
|
-
export { useCustomButton } from
|
|
1
|
+
export * from './use-init.hook.js';
|
|
2
|
+
export { useValidate } from './use-validate.hook.js';
|
|
3
|
+
export { useFieldsState } from './use-fields-state.hook.js';
|
|
4
|
+
export { useFieldsRenderer } from './use-fields-render.hook.js';
|
|
5
|
+
export { useCustomFields } from './use-custom-fields.hook.js';
|
|
6
|
+
export { useCustomButton } from './use-custom-button.hook.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Condition } from '@atls-ui-parts/condition';
|
|
2
3
|
import { Layout } from '@atls-ui-parts/layout';
|
|
3
4
|
import { useIntl } from 'react-intl';
|
|
@@ -7,15 +8,12 @@ import { ThemeProvider } from '../ui/theme/src/index.js';
|
|
|
7
8
|
import { translate } from '../utils/translate.util.js';
|
|
8
9
|
export const useFieldsRenderer = (fields, errors, fieldsState, handleChange, handleBlur, inputGaps) => {
|
|
9
10
|
const intl = useIntl();
|
|
10
|
-
return (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
React.createElement(Condition, { match: isNotLastField },
|
|
19
|
-
React.createElement(Layout, { flexBasis: inputGaps, flexShrink: 0 }))));
|
|
20
|
-
})));
|
|
11
|
+
return (_jsx(ThemeProvider, { children: fields.map((field, index, currentFields) => {
|
|
12
|
+
const translatePlaceholder = 'placeholder' in field && field.placeholder
|
|
13
|
+
? translate(intl, field.placeholder, field.placeholder)
|
|
14
|
+
: '';
|
|
15
|
+
const translateError = translate(intl, errors[field.name], errors[field.name]);
|
|
16
|
+
const isNotLastField = index !== currentFields.length - 1;
|
|
17
|
+
return (_jsxs(React.Fragment, { children: [_jsx(MemoizedInput, { type: 'type' in field ? field.type : 'text', name: field.name, placeholder: translatePlaceholder, required: 'required' in field ? field.required : false, value: fieldsState[field.name], errorText: translateError, onChangeNative: handleChange, onBlur: handleBlur }), _jsx(Condition, { match: isNotLastField, children: _jsx(Layout, { flexBasis: inputGaps, flexShrink: 0 }) })] }, field.name));
|
|
18
|
+
}) }));
|
|
21
19
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Widget, ButtonWrapper, InputWrapper, useForm } from
|
|
2
|
-
export * from
|
|
1
|
+
export { Widget, ButtonWrapper, InputWrapper, useForm } from './ui/index.js';
|
|
2
|
+
export * from './enums/index.js';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './styles.enum.js';
|
package/dist/locales/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './en.locale.js';
|
|
2
|
+
export * from './ru.locale.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import styled from '@emotion/styled';
|
|
2
3
|
import { useHover } from 'react-laag';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { appearanceStyles } from './button.styles.js';
|
|
5
5
|
import { contentStyles } from './button.styles.js';
|
|
6
6
|
import { baseStyles } from './button.styles.js';
|
|
@@ -8,5 +8,5 @@ import { shapeStyles } from './button.styles.js';
|
|
|
8
8
|
const ButtonElement = (styled.default ?? styled)('button')(baseStyles, contentStyles, appearanceStyles, shapeStyles);
|
|
9
9
|
export const Button = ({ children, ...props }) => {
|
|
10
10
|
const [hover, hoverProps] = useHover();
|
|
11
|
-
return (
|
|
11
|
+
return (_jsx(ButtonElement, { hover: hover, ...hoverProps, ...props, children: children }));
|
|
12
12
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Condition } from '@atls-ui-parts/condition';
|
|
2
3
|
import { HiddenInput } from '@atls-ui-parts/hidden-input';
|
|
3
4
|
import { Box } from '@atls-ui-parts/layout';
|
|
4
5
|
import { Column } from '@atls-ui-parts/layout';
|
|
5
6
|
import { Layout } from '@atls-ui-parts/layout';
|
|
6
7
|
import { Row } from '@atls-ui-parts/layout';
|
|
7
|
-
import React from 'react';
|
|
8
8
|
import { RequiredFieldsType } from '../enums/index.js';
|
|
9
9
|
import { DirectionFields } from '../interfaces/index.js';
|
|
10
10
|
import { useFieldsRenderer } from '../hooks/index.js';
|
|
@@ -14,11 +14,5 @@ export const Fields = ({ amount, direction = DirectionFields.Column, inputGaps =
|
|
|
14
14
|
const fieldsForRender = useCustomFields ? [] : fields;
|
|
15
15
|
const renderedFields = useFieldsRenderer(fieldsForRender, errors, fieldsState, handleChange, handleBlur, inputGaps);
|
|
16
16
|
const Direction = direction === DirectionFields.Column ? Column : Row;
|
|
17
|
-
return (
|
|
18
|
-
React.createElement(Layout, { flexBasis: inputGaps, flexShrink: 0 }),
|
|
19
|
-
React.createElement(Direction, null,
|
|
20
|
-
React.createElement(Condition, { match: Boolean(amount) },
|
|
21
|
-
React.createElement(HiddenInput, { disabled: true, readOnly: true, name: RequiredFieldsType.Amount, defaultValue: amount })),
|
|
22
|
-
renderedFields),
|
|
23
|
-
React.createElement(Layout, { flexBasis: inputGaps, flexShrink: 0 })));
|
|
17
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsx(Layout, { flexBasis: inputGaps, flexShrink: 0 }), _jsxs(Direction, { children: [_jsx(Condition, { match: Boolean(amount), children: _jsx(HiddenInput, { disabled: true, readOnly: true, name: RequiredFieldsType.Amount, defaultValue: amount }) }), renderedFields] }), _jsx(Layout, { flexBasis: inputGaps, flexShrink: 0 })] }));
|
|
24
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { FormattedMessage } from 'react-intl';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { Button } from '../button/button.component.js';
|
|
4
4
|
import { Fields } from '../fields.component.js';
|
|
5
5
|
import { Settings } from '../settings.component.js';
|
|
@@ -19,10 +19,5 @@ export const Form = ({ settings, amount, receipt, styles, useCustomButton, useCu
|
|
|
19
19
|
makePayment(event);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
return (
|
|
23
|
-
React.createElement(Settings, { ...settings, isGenerateReceipt: !!receipt }),
|
|
24
|
-
React.createElement(Fields, { amount: amount, direction: styles?.direction, inputGaps: styles?.inputGaps, useCustomFields: useCustomFields }),
|
|
25
|
-
children,
|
|
26
|
-
!useCustomButton && (React.createElement(Button, { type: 'submit', disabled: !isLoaded || disabled, ...styles?.button },
|
|
27
|
-
React.createElement(FormattedMessage, { id: 'payment_widget.pay', defaultMessage: '\u041E\u043F\u043B\u0430\u0442\u0438\u0442\u044C' })))));
|
|
22
|
+
return (_jsxs("form", { name: 'payform-tinkoff', onSubmit: payHandler, children: [_jsx(Settings, { ...settings, isGenerateReceipt: !!receipt }), _jsx(Fields, { amount: amount, direction: styles?.direction, inputGaps: styles?.inputGaps, useCustomFields: useCustomFields }), children, !useCustomButton && (_jsx(Button, { type: 'submit', disabled: !isLoaded || disabled, ...styles?.button, children: _jsx(FormattedMessage, { id: 'payment_widget.pay', defaultMessage: '\u041E\u043F\u043B\u0430\u0442\u0438\u0442\u044C' }) }))] }));
|
|
28
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { useMemo } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { Provider } from './form.context.js';
|
|
4
4
|
import { requiredFields } from '../../data/index.js';
|
|
5
5
|
import { useFieldsState } from '../../hooks/index.js';
|
|
@@ -37,5 +37,5 @@ export const FormProvider = ({ additionalFields, nameFields, isGenerateReceipt,
|
|
|
37
37
|
disabled,
|
|
38
38
|
isLoaded,
|
|
39
39
|
]);
|
|
40
|
-
return
|
|
40
|
+
return _jsx(Provider, { value: value, children: children });
|
|
41
41
|
};
|
package/dist/ui/form/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from './form.component.js';
|
|
2
|
+
export * from './use-form.hook.js';
|
|
3
|
+
export * from './form.provider.js';
|
package/dist/ui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export { Input } from
|
|
5
|
-
export { MemoizedInput } from
|
|
1
|
+
export * from './widget.component.js';
|
|
2
|
+
export * from './wrapper/index.js';
|
|
3
|
+
export * from './form/index.js';
|
|
4
|
+
export { Input } from './input/input.component.js';
|
|
5
|
+
export { MemoizedInput } from './input/input.component.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Condition } from '@atls-ui-parts/condition';
|
|
2
3
|
import { RawInput } from '@atls-ui-parts/input';
|
|
3
4
|
import { Layout } from '@atls-ui-parts/layout';
|
|
@@ -28,7 +29,7 @@ export const InputWithoutRef = ({ value, type, required, disabled, errorText = '
|
|
|
28
29
|
if (!ref) {
|
|
29
30
|
ref = useRef(null);
|
|
30
31
|
}
|
|
31
|
-
return (
|
|
32
|
+
return (_jsxs(Container, { type: type, onClick: () => {
|
|
32
33
|
;
|
|
33
34
|
ref.current?.focus();
|
|
34
35
|
}, onBlur: () => {
|
|
@@ -39,12 +40,7 @@ export const InputWithoutRef = ({ value, type, required, disabled, errorText = '
|
|
|
39
40
|
;
|
|
40
41
|
ref.current?.focus();
|
|
41
42
|
setFocus(true);
|
|
42
|
-
}, ...hoverProps },
|
|
43
|
-
React.createElement(InputElement, { ...props, error: errorText !== '' },
|
|
44
|
-
React.createElement(RawInput, { ref: ref, type: type, required: required, disabled: disabled, value: value, onChange: changeValue, placeholder: required ? `${placeholder}*` : placeholder, ...props })),
|
|
45
|
-
React.createElement(Condition, { match: !!errorText },
|
|
46
|
-
React.createElement(Layout, { flexBasis: 8, flexShrink: 0 }),
|
|
47
|
-
React.createElement(Text, { color: theme.colors.input.error.default.font }, errorText))));
|
|
43
|
+
}, ...hoverProps, children: [_jsx(InputElement, { ...props, error: errorText !== '', children: _jsx(RawInput, { ref: ref, type: type, required: required, disabled: disabled, value: value, onChange: changeValue, placeholder: required ? `${placeholder}*` : placeholder, ...props }) }), _jsxs(Condition, { match: !!errorText, children: [_jsx(Layout, { flexBasis: 8, flexShrink: 0 }), _jsx(Text, { color: theme.colors.input.error.default.font, children: errorText })] })] }));
|
|
48
44
|
};
|
|
49
45
|
export const Input = forwardRef(InputWithoutRef);
|
|
50
46
|
export const MemoizedInput = React.memo(Input);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SettingsProps } from '../interfaces/index.js';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const Settings: React.MemoExoticComponent<({ storeId, language, isNewWindow, isGenerateReceipt, }: SettingsProps) =>
|
|
3
|
+
export declare const Settings: React.MemoExoticComponent<({ storeId, language, isNewWindow, isGenerateReceipt, }: SettingsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Condition } from '@atls-ui-parts/condition';
|
|
2
3
|
import { HiddenInput } from '@atls-ui-parts/hidden-input';
|
|
3
4
|
import { memo } from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
import { LanguagesType } from '../enums/index.js';
|
|
6
|
-
export const Settings = memo(({ storeId, language = LanguagesType.RUSSIAN, isNewWindow = false, isGenerateReceipt = false, }) => (
|
|
7
|
-
React.createElement(HiddenInput, { disabled: true, readOnly: true, name: 'terminalkey', defaultValue: storeId }),
|
|
8
|
-
React.createElement(HiddenInput, { disabled: true, readOnly: true, name: 'frame', defaultValue: String(isNewWindow) }),
|
|
9
|
-
React.createElement(HiddenInput, { disabled: true, readOnly: true, name: 'language', defaultValue: language }),
|
|
10
|
-
React.createElement(Condition, { match: isGenerateReceipt },
|
|
11
|
-
React.createElement(HiddenInput, { disabled: true, readOnly: true, name: 'receipt', defaultValue: '' })))));
|
|
6
|
+
export const Settings = memo(({ storeId, language = LanguagesType.RUSSIAN, isNewWindow = false, isGenerateReceipt = false, }) => (_jsxs(_Fragment, { children: [_jsx(HiddenInput, { disabled: true, readOnly: true, name: 'terminalkey', defaultValue: storeId }), _jsx(HiddenInput, { disabled: true, readOnly: true, name: 'frame', defaultValue: String(isNewWindow) }), _jsx(HiddenInput, { disabled: true, readOnly: true, name: 'language', defaultValue: language }), _jsx(Condition, { match: isGenerateReceipt, children: _jsx(HiddenInput, { disabled: true, readOnly: true, name: 'receipt', defaultValue: '' }) })] })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './colors.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import * as theme from './theme/index.js';
|
|
4
|
-
export const ThemeProvider = ({ children }) => (
|
|
4
|
+
export const ThemeProvider = ({ children }) => (_jsx(EmotionThemeProvider, { theme: theme, children: children }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Children } from 'react';
|
|
2
3
|
import { IntlProvider } from 'react-intl';
|
|
3
4
|
import { useMemo } from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
import { LanguagesType } from '../enums/index.js';
|
|
6
6
|
import { EnLocale } from '../locales/index.js';
|
|
7
7
|
import { RuLocale } from '../locales/index.js';
|
|
@@ -26,9 +26,5 @@ export const Widget = ({ amount, settings, receipt, additionalFields, styles, ch
|
|
|
26
26
|
const { customFields, isGenerateReceiptField, isGenerateRequiredField } = useCustomFields(customFieldsProps);
|
|
27
27
|
const customButton = useCustomButton(childrenArray);
|
|
28
28
|
const nameFields = getNameFields(customFields);
|
|
29
|
-
return (
|
|
30
|
-
React.createElement(FormProvider, { additionalFields: additionalFields, nameFields: nameFields, isGenerateReceipt: isGenerateReceiptField, isGenerateRequiredField: isGenerateRequiredField, disabled: !!disabled },
|
|
31
|
-
React.createElement(Form, { amount: amount, settings: settings, receipt: receipt, styles: styles, useCustomButton: !!customButton, useCustomFields: !!customFields.length },
|
|
32
|
-
customFields,
|
|
33
|
-
customButton))));
|
|
29
|
+
return (_jsx(IntlProvider, { locale: locale, messages: messages[locale], defaultLocale: LanguagesType.RUSSIAN, children: _jsx(FormProvider, { additionalFields: additionalFields, nameFields: nameFields, isGenerateReceipt: isGenerateReceiptField, isGenerateRequiredField: isGenerateRequiredField, disabled: !!disabled, children: _jsxs(Form, { amount: amount, settings: settings, receipt: receipt, styles: styles, useCustomButton: !!customButton, useCustomFields: !!customFields.length, children: [customFields, customButton] }) }) }));
|
|
34
30
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Condition } from '@atls-ui-parts/condition';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { ButtonType } from '../../enums/index.js';
|
|
4
4
|
import { NameWrapperComponent } from '../../enums/index.js';
|
|
5
5
|
import { useForm } from '../form/index.js';
|
|
6
6
|
const ButtonWrapper = ({ children }) => {
|
|
7
7
|
const { disabled, isLoaded } = useForm();
|
|
8
|
-
return (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
return (_jsx(Condition, { match: typeof children === 'function', children: children({
|
|
9
|
+
type: ButtonType.Submit,
|
|
10
|
+
disabled: disabled || !isLoaded,
|
|
11
|
+
}) }));
|
|
12
12
|
};
|
|
13
13
|
ButtonWrapper.displayName = NameWrapperComponent.ButtonWrapper;
|
|
14
14
|
export { ButtonWrapper };
|
package/dist/ui/wrapper/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './input-wrapper.component.js';
|
|
2
|
+
export * from './button-wrapper.component.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Condition } from '@atls-ui-parts/condition';
|
|
2
3
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { NameWrapperComponent } from '../../enums/index.js';
|
|
5
5
|
import { translate } from '../../utils/translate.util.js';
|
|
6
6
|
import { useForm } from '../form/index.js';
|
|
@@ -8,13 +8,13 @@ const InputWrapper = ({ name, children }) => {
|
|
|
8
8
|
const { fieldsState, handleChange, handleBlur, errors } = useForm();
|
|
9
9
|
const intl = useIntl();
|
|
10
10
|
const translateError = translate(intl, errors[name], errors[name]);
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
return (_jsx(Condition, { match: typeof children === 'function', children: children({
|
|
12
|
+
name,
|
|
13
|
+
value: fieldsState[name],
|
|
14
|
+
onChangeNative: handleChange,
|
|
15
|
+
onBlur: handleBlur,
|
|
16
|
+
errorText: translateError,
|
|
17
|
+
}) }));
|
|
18
18
|
};
|
|
19
19
|
InputWrapper.displayName = NameWrapperComponent.InputWrapper;
|
|
20
20
|
export { InputWrapper };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './pay.util.js';
|
|
2
|
+
export * from './add-receipt-fields.util.js';
|
|
3
|
+
export * from './convert-to-penny.util.js';
|
|
4
|
+
export * from './is-custom-element.util.js';
|
|
5
|
+
export * from './get-name-fields.util.js';
|