@tap-payments/os-micro-frontend-shared 0.1.193-test.3 → 0.1.194-test.3-test.4
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/build/components/InputBase/InputBase/InputBase.d.ts +2 -2
- package/build/components/InputBase/InputBase/InputBase.js +3 -3
- package/build/components/LanguageDropdown/LanguageDropdown.js +1 -1
- package/build/components/RFH/Inputs/FormInput/FormInput.d.ts +1 -5
- package/build/components/RFH/Inputs/FormInput/FormInput.js +7 -3
- package/build/constants/table/cell/merchantsTableCellWidth.d.ts +5 -0
- package/build/constants/table/cell/merchantsTableCellWidth.js +5 -0
- package/package.json +2 -2
|
@@ -5,5 +5,5 @@ export interface InputBaseProps extends Omit<InputProps, 'onChange'> {
|
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
hasError: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
8
|
+
declare const InputBase: React.ForwardRefExoticComponent<Omit<InputBaseProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export default InputBase;
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
15
|
import { StyledInput, StyledWrapper, StyledErrorMessage } from './style';
|
|
16
|
-
|
|
16
|
+
const InputBase = React.forwardRef((_a, ref) => {
|
|
17
17
|
var _b;
|
|
18
18
|
var { name, onChange, hasError, helperText, hideArrows } = _a, props = __rest(_a, ["name", "onChange", "hasError", "helperText", "hideArrows"]);
|
|
19
19
|
const handleChange = (e) => {
|
|
@@ -23,6 +23,6 @@ function InputBase(_a, ref) {
|
|
|
23
23
|
return (_jsxs(Box, { children: [_jsx(StyledWrapper, Object.assign({ "data-testid": "InputBase" }, { children: _jsx(StyledInput, Object.assign({ rows: 1, error: hasError, fullWidth: true, size: "small", variant: "standard", ref: ref, name: name, type: (_b = props.type) !== null && _b !== void 0 ? _b : 'text', label: props.placeholder || props.label, onChange: handleChange, InputProps: {
|
|
24
24
|
disableUnderline: true,
|
|
25
25
|
}, hideArrows: hideArrows }, props)) })), _jsx(StyledErrorMessage, { children: helperText })] }));
|
|
26
|
-
}
|
|
26
|
+
});
|
|
27
27
|
InputBase.displayName = 'InputBase';
|
|
28
|
-
export default
|
|
28
|
+
export default InputBase;
|
|
@@ -20,5 +20,5 @@ export default function LanguageDropdown({ defaultLanguage = 'EN', onChange }) {
|
|
|
20
20
|
onChange === null || onChange === void 0 ? void 0 : onChange(lang);
|
|
21
21
|
onCLose();
|
|
22
22
|
};
|
|
23
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onCLose }, { children: _jsxs(Box, { children: [_jsx(Button, Object.assign({ onClick: onOpen, open: open }, { children: _jsx(Box, Object.assign({ component: "span" }, { children: language })) })), _jsx(Menu, Object.assign({ open: open, anchorEl: anchorEl, sx: { marginTop: '8px', marginBottom: '8px', width: 31.8 } }, { children: languages.map((lang) => lang !== language && (_jsx(MenuItem, Object.assign({ onClick: () => onClick(lang) }, { children: lang }), lang))) }))] }) })));
|
|
23
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: onCLose }, { children: _jsxs(Box, { children: [_jsx(Button, Object.assign({ onClick: onOpen, open: open }, { children: _jsx(Box, Object.assign({ component: "span" }, { children: language })) })), _jsx(Menu, Object.assign({ open: open, anchorEl: anchorEl, sx: { marginTop: '8px', marginBottom: '8px', width: 31.8 } }, { children: languages.map((lang) => lang !== language && (_jsx(MenuItem, Object.assign({ onClick: () => onClick(lang), hideCheckbox: true }, { children: lang }), lang))) }))] }) })));
|
|
24
24
|
}
|
|
@@ -4,9 +4,5 @@ export interface FormInputProps extends Omit<InputBaseProps, 'name' | 'hasError'
|
|
|
4
4
|
name: string;
|
|
5
5
|
hideArrows?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare
|
|
8
|
-
declare namespace FormInput {
|
|
9
|
-
var displayName: string;
|
|
10
|
-
}
|
|
11
|
-
declare const _default: React.MemoExoticComponent<typeof FormInput>;
|
|
7
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<FormInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>>;
|
|
12
8
|
export default _default;
|
|
@@ -13,16 +13,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
15
15
|
import { InputBase } from '../../../InputBase';
|
|
16
|
-
|
|
16
|
+
const FormInput = React.forwardRef((_a, ref) => {
|
|
17
17
|
var { name, helperText, hideArrows } = _a, props = __rest(_a, ["name", "helperText", "hideArrows"]);
|
|
18
18
|
const { control } = useFormContext();
|
|
19
19
|
return (_jsx(Controller, { name: name, control: control, defaultValue: props.defaultValue, render: ({ field, fieldState }) => {
|
|
20
20
|
var _a;
|
|
21
|
-
return (_jsx(InputBase, Object.assign({}, props, field, { hasError: !!fieldState.error, helperText: helperText !== null && helperText !== void 0 ? helperText : (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message, hideArrows: hideArrows,
|
|
21
|
+
return (_jsx(InputBase, Object.assign({}, props, field, { ref: ref, hasError: !!fieldState.error, helperText: helperText !== null && helperText !== void 0 ? helperText : (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message, hideArrows: hideArrows, onChange: (value) => {
|
|
22
|
+
var _a;
|
|
23
|
+
field.onChange(value); // update react-hook-form
|
|
24
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, value); // optional external handler
|
|
25
|
+
}, onWheel: (e) => {
|
|
22
26
|
// eslint-disable-next-line
|
|
23
27
|
e.target instanceof HTMLElement && e.target.blur();
|
|
24
28
|
} })));
|
|
25
29
|
} }));
|
|
26
|
-
}
|
|
30
|
+
});
|
|
27
31
|
FormInput.displayName = 'RFHFormInput';
|
|
28
32
|
export default React.memo(FormInput);
|
|
@@ -34,6 +34,11 @@ export declare const merchantsTableCellWidth: {
|
|
|
34
34
|
readonly text: "180px";
|
|
35
35
|
readonly sheet: "140px";
|
|
36
36
|
};
|
|
37
|
+
readonly tax_number: {
|
|
38
|
+
readonly default: "180px";
|
|
39
|
+
readonly text: "180px";
|
|
40
|
+
readonly sheet: "140px";
|
|
41
|
+
};
|
|
37
42
|
readonly wallet_id: {
|
|
38
43
|
readonly default: "180px";
|
|
39
44
|
readonly text: "180px";
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.194-test.3-test.4",
|
|
5
|
+
"testVersion": 4,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|