@tap-payments/auth-jsconnect 2.5.3-test → 2.5.4-test

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.
@@ -28,6 +28,7 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
28
28
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
29
29
  ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
30
30
  }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
31
+ export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
31
32
  interface ActivityListProps {
32
33
  onListOpen?: () => void;
33
34
  onListClose?: () => void;
@@ -85,6 +85,10 @@ var DivisionListStyled = styled((SimpleList))(function () { return ({
85
85
  var ActivityListStyled = styled((SimpleList))(function () { return ({
86
86
  height: 'fit-content'
87
87
  }); });
88
+ export var MandatoryStyled = styled('span')(function (_a) {
89
+ var theme = _a.theme;
90
+ return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
91
+ });
88
92
  var ActivityList = function (_a) {
89
93
  var onListClose = _a.onListClose, onListOpen = _a.onListOpen, readOnly = _a.readOnly;
90
94
  var _b = React.useState([]), activities = _b[0], setActivities = _b[1];
@@ -248,7 +252,7 @@ var ActivityList = function (_a) {
248
252
  if (item)
249
253
  setSubIndex(item.id);
250
254
  }, [anchorEl, controlValue]);
251
- return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('activities') }), _jsx(InputStyled, { readOnly: readOnly, value: getSelectedActivities() || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_activities'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsxs(Collapse, __assign({ in: !!(controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) }, { children: [_jsx(SelectedInputStyled, { readOnly: readOnly, anchorEl: activityAnchorEl, value: t('selected_activities'), onClick: !!activityAnchorEl ? handleCloseActivityMenu : handleOpenActivityMenu, placeholder: t('choose_activities'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!activityAnchorEl }) }), _jsx(Collapse, __assign({ in: !!activityAnchorEl }, { children: _jsx(ActivityListStyled, { sx: { pt: 0, pb: 0 }, list: controlValue || [], onSelectItem: function (activity, e) {
255
+ return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('activities'), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: getSelectedActivities() || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_activities'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsxs(Collapse, __assign({ in: !!(controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) }, { children: [_jsx(SelectedInputStyled, { readOnly: readOnly, anchorEl: activityAnchorEl, value: t('selected_activities'), onClick: !!activityAnchorEl ? handleCloseActivityMenu : handleOpenActivityMenu, placeholder: t('choose_activities'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!activityAnchorEl }) }), _jsx(Collapse, __assign({ in: !!activityAnchorEl }, { children: _jsx(ActivityListStyled, { sx: { pt: 0, pb: 0 }, list: controlValue || [], onSelectItem: function (activity, e) {
252
256
  e.stopPropagation();
253
257
  onSelectItem(activity);
254
258
  }, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (activity, idx) {
@@ -40,6 +40,6 @@ var CapitalPaid = function (_a) {
40
40
  var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
41
41
  return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
42
42
  currency: t(findCurrencyByIso2(countryCode))
43
- }), onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
43
+ }), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
44
44
  };
45
45
  export default React.memo(CapitalPaid);
@@ -35,6 +35,6 @@ var CapitalShareCount = function (_a) {
35
35
  var capitalShareCountControl = useController({ control: control, name: 'capitalShareCount' });
36
36
  var capitalShareCountValue = capitalShareCountControl.field.value;
37
37
  var error = (_b = capitalShareCountControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
38
- return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_count_label'), onChange: handleChange, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareCountValue, isVerified: isVerified }) }) })));
38
+ return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { required: true, readOnly: readOnly, label: t('capital_share_count_label'), onChange: handleChange, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareCountValue, isVerified: isVerified }) }) })));
39
39
  };
40
40
  export default React.memo(CapitalShareCount);
@@ -40,6 +40,6 @@ var CapitalShareValue = function (_a) {
40
40
  var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
41
41
  return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
42
42
  currency: t(findCurrencyByIso2(countryCode))
43
- }), onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
43
+ }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
44
44
  };
45
45
  export default React.memo(CapitalShareValue);
@@ -63,6 +63,7 @@ export declare const NameContainer: import("@emotion/styled").StyledComponent<im
63
63
  }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
64
64
  isSelected: boolean;
65
65
  }, {}, {}>;
66
+ export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
66
67
  export interface EntityTypeListProps {
67
68
  onListOpen?: () => void;
68
69
  onListClose?: () => void;
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
@@ -70,6 +70,10 @@ export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { r
70
70
  var theme = _a.theme, isSelected = _a.isSelected;
71
71
  return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
72
72
  });
73
+ export var MandatoryStyled = styled('span')(function (_a) {
74
+ var theme = _a.theme;
75
+ return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
76
+ });
73
77
  var EntityTypeList = function (props) {
74
78
  var theme = useTheme();
75
79
  var _a = React.useState([]), entityTypesMenuList = _a[0], setEntityTypesMenuList = _a[1];
@@ -127,7 +131,7 @@ var EntityTypeList = function (props) {
127
131
  var filteredList = entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes.filter(function (i) { return i === null || i === void 0 ? void 0 : i.toLowerCase().includes(val); });
128
132
  setEntityTypesMenuList(filteredList);
129
133
  };
130
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { paddingTop: theme.spacing(2.5) } }, { children: [_jsx(Collapse, __assign({ in: !isListAvailable }, { children: _jsx(SharedInput, { readOnly: props.readOnly, onChange: handleChange, value: t(getSelectedValue()), label: t('entity_type'), placeholder: t('entity_type_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, endAdornment: _jsx(EndAdornment, { value: getSelectedValue(), isVerified: props.isVerified }) }) })), _jsxs(Collapse, __assign({ in: isListAvailable }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('entity_type') }) }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: props.readOnly, value: t(getSelectedValue()), placeholder: t('choose_entity_type'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(EndAdornmentExpanded, { isVerified: props.isVerified, anchorEl: anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { list: entityTypesMenuList, onSelectItem: onSelectItem, renderItem: function (i) {
134
+ return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { paddingTop: theme.spacing(2.5) } }, { children: [_jsx(Collapse, __assign({ in: !isListAvailable }, { children: _jsx(SharedInput, { readOnly: props.readOnly, required: true, onChange: handleChange, value: t(getSelectedValue()), label: t('entity_type'), placeholder: t('entity_type_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, endAdornment: _jsx(EndAdornment, { value: getSelectedValue(), isVerified: props.isVerified }) }) })), _jsxs(Collapse, __assign({ in: isListAvailable }, { children: [_jsx(LabelContainerStyled, { children: _jsxs(InputLabelStyled, { children: [t('entity_type'), " ", _jsx(MandatoryStyled, { children: "*" })] }) }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: props.readOnly, value: t(getSelectedValue()), placeholder: t('choose_entity_type'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(EndAdornmentExpanded, { isVerified: props.isVerified, anchorEl: anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { list: entityTypesMenuList, onSelectItem: onSelectItem, renderItem: function (i) {
131
135
  return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: getSelectedTypeFlag(i) }, { children: i })) })), getSelectedTypeFlag(i) && _jsx(CheckIcon, { isVerified: props.isVerified })] }));
132
136
  } })] }))] })] }))] })) })));
133
137
  };
@@ -19,6 +19,7 @@ import Text from '../../../../components/Text';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import { entitySelector, clearError } from '../../../app/entity/entityStore';
21
21
  import Calender from '../../../shared/Calender';
22
+ import { MandatoryStyled } from './EntityTypeList';
22
23
  export var InputLabelStyled = styled(Text)(function (_a) {
23
24
  var theme = _a.theme;
24
25
  return (__assign({ margin: theme.spacing(0, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.6) }, theme.typography.caption));
@@ -39,6 +40,6 @@ var ExpiryDate = function (_a) {
39
40
  dispatch(clearError());
40
41
  oDateControl.field.onChange(data);
41
42
  };
42
- return (_jsx(Collapse, __assign({ in: !!expiryDate }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('business_expiry_date') }), _jsx(Calender, { isVerified: isVerified, disabled: readOnly, maxDate: getFutureDate(), defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleExpiryDateChange })] })) })));
43
+ return (_jsx(Collapse, __assign({ in: !!expiryDate }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(InputLabelStyled, { children: [t('business_expiry_date'), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Calender, { isVerified: isVerified, disabled: readOnly, maxDate: getFutureDate(), defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleExpiryDateChange })] })) })));
43
44
  };
44
45
  export default ExpiryDate;
@@ -18,6 +18,7 @@ import Text from '../../../../components/Text';
18
18
  import Calender from '../../../shared/Calender';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import { entitySelector, clearError } from '../../../app/entity/entityStore';
21
+ import { MandatoryStyled } from './EntityTypeList';
21
22
  export var InputLabelStyled = styled(Text)(function (_a) {
22
23
  var theme = _a.theme;
23
24
  return (__assign({ margin: theme.spacing(0, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.6) }, theme.typography.caption));
@@ -38,6 +39,6 @@ var IssuingDate = function (_a) {
38
39
  dispatch(clearError());
39
40
  oDateControl.field.onChange(data);
40
41
  };
41
- return (_jsx(Collapse, __assign({ in: !!issueDate }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('issue_date') }), _jsx(Calender, { disabled: readOnly, isVerified: isVerified, defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleIssuingDateChange })] })) })));
42
+ return (_jsx(Collapse, __assign({ in: !!issueDate }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(InputLabelStyled, { children: [t('issue_date'), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Calender, { disabled: readOnly, isVerified: isVerified, defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleIssuingDateChange })] })) })));
42
43
  };
43
44
  export default IssuingDate;
@@ -44,6 +44,6 @@ var LegalName = function (_a) {
44
44
  var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
45
45
  legalNameControl.field.onChange(value);
46
46
  };
47
- return (_jsx(Collapse, __assign({ in: !!legalName }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, onChange: handleChange, value: legalNameValue, label: t('license_name_label'), placeholder: t('license_name_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, endAdornment: _jsx(EndAdornment, { value: legalNameValue, isVerified: isVerified }) }) }) })));
47
+ return (_jsx(Collapse, __assign({ in: !!legalName }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { required: true, readOnly: readOnly, onChange: handleChange, value: legalNameValue, label: t('license_name_label'), placeholder: t('license_name_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, endAdornment: _jsx(EndAdornment, { value: legalNameValue, isVerified: isVerified }) }) }) })));
48
48
  };
49
49
  export default React.memo(LegalName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.5.3-test",
3
+ "version": "2.5.4-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",