@tap-payments/os-micro-frontend-shared 0.0.161 → 0.0.162
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.
|
@@ -35,11 +35,11 @@ function StatusButton(_a) {
|
|
|
35
35
|
const dropdownIcon = hasDropdown ? _jsx(ChevronIcon, { isActive: variant === 'active' }) : null;
|
|
36
36
|
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ "data-testid": "StatusButton" }, props, { ref: buttonRef, onClick: (e) => {
|
|
37
37
|
var _a, _b, _c;
|
|
38
|
-
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
39
|
-
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status) || 'all');
|
|
40
38
|
if (hasDropdown) {
|
|
41
|
-
setAnchorEl((
|
|
39
|
+
setAnchorEl((_a = e.currentTarget) !== null && _a !== void 0 ? _a : buttonRef.current);
|
|
42
40
|
}
|
|
41
|
+
(_b = props === null || props === void 0 ? void 0 : props.onClick) === null || _b === void 0 ? void 0 : _b.call(props, e);
|
|
42
|
+
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_c = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _c === void 0 ? void 0 : _c.status) || 'all');
|
|
43
43
|
}, sx: Object.assign({}, (hasDropdown && {
|
|
44
44
|
paddingInlineEnd: '27px',
|
|
45
45
|
})) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] }) })), open && !showDropdownIcon && (_jsx(StyledDropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: (_c = (dropdownOptions || [])) === null || _c === void 0 ? void 0 : _c.map((item) => (Object.assign(Object.assign({}, item), { onClick: (e) => {
|
|
@@ -35,11 +35,11 @@ export const StatusButton = memo((props) => {
|
|
|
35
35
|
const dropdownIcon = hasDropdown ? _jsx(ChevronIcon, { isActive: variant === 'active' }) : null;
|
|
36
36
|
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: (e) => {
|
|
37
37
|
var _a, _b, _c;
|
|
38
|
-
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
39
|
-
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status) || 'all');
|
|
40
38
|
if (hasDropdown) {
|
|
41
|
-
setAnchorEl((
|
|
39
|
+
setAnchorEl((_a = e.currentTarget) !== null && _a !== void 0 ? _a : buttonRef.current);
|
|
42
40
|
}
|
|
41
|
+
(_b = props === null || props === void 0 ? void 0 : props.onClick) === null || _b === void 0 ? void 0 : _b.call(props, e);
|
|
42
|
+
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_c = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _c === void 0 ? void 0 : _c.status) || 'all');
|
|
43
43
|
}, sx: Object.assign({}, (hasDropdown && {
|
|
44
44
|
paddingInlineEnd: '27px',
|
|
45
45
|
})) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] }) })), open && (_jsx(StyledDropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: (_b = (dropdownOptions || [])) === null || _b === void 0 ? void 0 : _b.map((item) => (Object.assign(Object.assign({}, item), { onClick: (e) => {
|
package/package.json
CHANGED