@tap-payments/os-micro-frontend-shared 0.0.217-test.4 → 0.0.217-test.4-test.5
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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/MenuItem/MenuItem.js +1 -1
- package/build/components/MenuItem/style.js +5 -0
- package/build/components/TableCells/CustomCells/ActionCell/index.d.ts +0 -2
- package/build/components/TableCells/CustomCells/ActionCell/index.js +0 -2
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +0 -10
- package/build/constants/table/cell/chargeTableCellWidth.js +0 -10
- package/package.json +2 -2
- package/build/components/TableCells/CustomCells/ActionCell/ActionIconColumn.d.ts +0 -6
- package/build/components/TableCells/CustomCells/ActionCell/ActionIconColumn.js +0 -48
- package/build/components/TableCells/CustomCells/ActionCell/ActionsColumn.d.ts +0 -10
- package/build/components/TableCells/CustomCells/ActionCell/ActionsColumn.js +0 -78
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -14,6 +14,6 @@ import { memo } from 'react';
|
|
|
14
14
|
import { CheckboxStyled, MenuItemStyled } from './style';
|
|
15
15
|
function MenuItem(_a) {
|
|
16
16
|
var { isSelected, isDisabled, isIndeterminate, onClick, children } = _a, props = __rest(_a, ["isSelected", "isDisabled", "isIndeterminate", "onClick", "children"]);
|
|
17
|
-
return (_jsxs(MenuItemStyled, Object.assign({ className: isDisabled ? 'disabled menu-item' : 'menu-item', onClick: onClick, disabled: isDisabled }, props, { children: [isSelected !== undefined && _jsx(CheckboxStyled, { size: "small", checked: isSelected,
|
|
17
|
+
return (_jsxs(MenuItemStyled, Object.assign({ className: isDisabled ? 'disabled menu-item' : 'menu-item', onClick: onClick, disabled: isDisabled }, props, { children: [isSelected !== undefined && _jsx(CheckboxStyled, { size: "small", checked: isSelected, indeterminate: isIndeterminate, disabled: isDisabled }), children] })));
|
|
18
18
|
}
|
|
19
19
|
export default memo(MenuItem);
|
|
@@ -159,14 +159,4 @@ export declare const chargeTableCellWidth: {
|
|
|
159
159
|
readonly text: "52px";
|
|
160
160
|
readonly sheet: "52px";
|
|
161
161
|
};
|
|
162
|
-
readonly actionIcon: {
|
|
163
|
-
readonly default: "30px";
|
|
164
|
-
readonly text: "30px";
|
|
165
|
-
readonly sheet: "30px";
|
|
166
|
-
};
|
|
167
|
-
readonly actionIconSheet: {
|
|
168
|
-
readonly default: "100px";
|
|
169
|
-
readonly text: "100px";
|
|
170
|
-
readonly sheet: "300px";
|
|
171
|
-
};
|
|
172
162
|
};
|
|
@@ -159,14 +159,4 @@ export const chargeTableCellWidth = {
|
|
|
159
159
|
text: '52px',
|
|
160
160
|
sheet: '52px',
|
|
161
161
|
},
|
|
162
|
-
actionIcon: {
|
|
163
|
-
default: '30px',
|
|
164
|
-
text: '30px',
|
|
165
|
-
sheet: '30px',
|
|
166
|
-
},
|
|
167
|
-
actionIconSheet: {
|
|
168
|
-
default: '100px',
|
|
169
|
-
text: '100px',
|
|
170
|
-
sheet: '300px',
|
|
171
|
-
},
|
|
172
162
|
};
|
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.0.217-test.4",
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.0.217-test.4-test.5",
|
|
5
|
+
"testVersion": 5,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ActionCellProps } from '../type';
|
|
3
|
-
type ActionIconColumnProps = Readonly<Pick<ActionCellProps, 'actions' | 'dropdownAction' | 'onCloseDropdown' | 'isDropdownShown' | 'renderDropdown'>>;
|
|
4
|
-
declare function ActionIconColumn({ actions, dropdownAction, onCloseDropdown, isDropdownShown, renderDropdown, ...props }: ActionIconColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare const _default: React.MemoExoticComponent<typeof ActionIconColumn>;
|
|
6
|
-
export default _default;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { memo } from 'react';
|
|
14
|
-
import { AnimatePresence } from 'framer-motion';
|
|
15
|
-
import Dropdown from '../../../DropdownMenu';
|
|
16
|
-
import { TableCell } from '../../../TableCells';
|
|
17
|
-
import ActionIconsVariants from './components/ActionIconsVariants';
|
|
18
|
-
import { actionIcons } from './constant';
|
|
19
|
-
import { useActionCell } from './hooks/useActionCell';
|
|
20
|
-
import { ActionIcon, ActionsIconContainer } from './style';
|
|
21
|
-
import { TransparentButton } from '../style';
|
|
22
|
-
function ActionIconColumn(_a) {
|
|
23
|
-
var { actions, dropdownAction, onCloseDropdown, isDropdownShown = true, renderDropdown } = _a, props = __rest(_a, ["actions", "dropdownAction", "onCloseDropdown", "isDropdownShown", "renderDropdown"]);
|
|
24
|
-
const { open, anchorEl, filteredActions, isAnyActionLoading, isAnyActionHasError, isAnyActionSuccessful, areThereAnyShownActions, handleClick, handleClose, setAnchorEl, } = useActionCell({ actions, isDropdownShown, onCloseDropdown, renderDropdown });
|
|
25
|
-
return (_jsx(TableCell, Object.assign({}, props, { sx: {
|
|
26
|
-
overflow: 'visible',
|
|
27
|
-
} }, { children: _jsx("div", Object.assign({ "data-testid": "ActionIconColumn_Container", style: {
|
|
28
|
-
display: 'flex',
|
|
29
|
-
alignItems: 'center',
|
|
30
|
-
justifyContent: 'center',
|
|
31
|
-
gap: '5px',
|
|
32
|
-
} }, { children: _jsxs(ActionsIconContainer, Object.assign({ id: "styled-popover", selected: !!dropdownAction || open, "data-testid": "ActionIconColumn_ActionsIconContainer", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
|
|
33
|
-
pointerEvents: 'none',
|
|
34
|
-
})) }, { children: [_jsx(TransparentButton, Object.assign({ onClick: handleClick, "data-testid": "ActionIconColumn_ActionsIconContainer_TransparentButton", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
|
|
35
|
-
pointerEvents: 'none',
|
|
36
|
-
})) }, { children: _jsx(AnimatePresence, Object.assign({ mode: "wait" }, { children: _jsx(ActionIconsVariants, { isAnyActionLoading: isAnyActionLoading, isAnyActionHasError: isAnyActionHasError, isAnyActionSuccessful: isAnyActionSuccessful, areThereAnyShownActions: areThereAnyShownActions }) })) })), renderDropdown ? (renderDropdown(anchorEl, setAnchorEl)) : (_jsxs(_Fragment, { children: [dropdownAction, areThereAnyShownActions && (_jsx(Dropdown, { style: { zIndex: 2000 }, open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: filteredActions.map((action) => (Object.assign(Object.assign({}, action), { onClick: (e) => {
|
|
37
|
-
var _a;
|
|
38
|
-
(_a = action === null || action === void 0 ? void 0 : action.onClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
|
|
39
|
-
if (!action.hasActionMenu) {
|
|
40
|
-
handleClose();
|
|
41
|
-
}
|
|
42
|
-
}, onRightClick: (e) => {
|
|
43
|
-
var _a;
|
|
44
|
-
(_a = action === null || action === void 0 ? void 0 : action.onRightClick) === null || _a === void 0 ? void 0 : _a.call(action, e);
|
|
45
|
-
handleClose();
|
|
46
|
-
}, icon: (_jsx(ActionIcon, { icon: action.icon, src: actionIcons[action.icon], initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }, `action.label-${action.label.trim()}`)) }))) }))] }))] })) })) })));
|
|
47
|
-
}
|
|
48
|
-
export default memo(ActionIconColumn);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ActionCellProps } from '../type';
|
|
3
|
-
import { TableMode } from '../../../../types/index.js';
|
|
4
|
-
type ActionsColumnProps = Readonly<Pick<ActionCellProps, 'flag' | 'flagTooltip' | 'flagsCount' | 'row' | 'showJsonViewer' | 'isTextShown' | 'showIdButton' | 'rowId'>> & {
|
|
5
|
-
onJsonViewClick?: () => void;
|
|
6
|
-
tableMode?: TableMode;
|
|
7
|
-
};
|
|
8
|
-
declare function ActionsColumn({ flag, flagTooltip, flagsCount, row, showJsonViewer, isTextShown, showIdButton, rowId, onJsonViewClick, tableMode, ...props }: ActionsColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare const _default: React.MemoExoticComponent<typeof ActionsColumn>;
|
|
10
|
-
export default _default;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import { memo } from 'react';
|
|
14
|
-
import { motion } from 'framer-motion';
|
|
15
|
-
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import Tooltip from '../../../Tooltip';
|
|
17
|
-
import { TableCell } from '../../../TableCells';
|
|
18
|
-
import StyledBadge, { BadgeVariants } from '../../../CountBadge';
|
|
19
|
-
import { jsonBlackIcon } from '../../../../constants/index.js';
|
|
20
|
-
import { colorToVariant, flags } from './constant';
|
|
21
|
-
import { ActionCellContainer, ActionIcon } from './style';
|
|
22
|
-
import { IDButton } from '../IDButton';
|
|
23
|
-
import { BadgeWrapper, IdButtonContainer, TextLabel, TransparentButton } from '../style';
|
|
24
|
-
import SheetViewIDButton from '../SheetViewIDButton/SheetViewIDButton';
|
|
25
|
-
function ActionsColumn(_a) {
|
|
26
|
-
var _b, _c;
|
|
27
|
-
var { flag, flagTooltip, flagsCount, row, showJsonViewer = true, isTextShown, showIdButton = true, rowId, onJsonViewClick, tableMode } = _a, props = __rest(_a, ["flag", "flagTooltip", "flagsCount", "row", "showJsonViewer", "isTextShown", "showIdButton", "rowId", "onJsonViewClick", "tableMode"]);
|
|
28
|
-
const { t } = useTranslation();
|
|
29
|
-
return (_jsx(TableCell, Object.assign({}, props, { sx: {
|
|
30
|
-
overflow: 'visible',
|
|
31
|
-
} }, { children: _jsxs(ActionCellContainer, Object.assign({ "data-testid": "ActionsColumn_ActionCellContainer", tableMode: tableMode }, { children: [flag && (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: flagTooltip }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "ActionsColumn_FlagLabel", sx: {
|
|
32
|
-
textAlign: 'left',
|
|
33
|
-
justifyContent: 'flex-start',
|
|
34
|
-
} }, { children: flagTooltip })) }))) : (_jsx(Tooltip, Object.assign({ title: flagTooltip }, { children: _jsxs(BadgeWrapper, Object.assign({ "data-testid": "ActionsColumn_FlagBadge", sx: {
|
|
35
|
-
paddingInline: '12px',
|
|
36
|
-
width: 'auto',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
position: 'relative',
|
|
39
|
-
zIndex: 21,
|
|
40
|
-
gap: '0px',
|
|
41
|
-
}, whileHover: ['animate', 'fadeIn'], variants: {
|
|
42
|
-
animate: {
|
|
43
|
-
gap: '4px',
|
|
44
|
-
},
|
|
45
|
-
} }, { children: [_jsx(ActionIcon, { "data-testid": "ActionsColumn_FlagIcon", sx: {
|
|
46
|
-
width: '12px',
|
|
47
|
-
height: '11px',
|
|
48
|
-
}, src: (_b = flags[flag]) === null || _b === void 0 ? void 0 : _b.icon, alt: "flag-icon" }), (flagsCount !== null && flagsCount !== void 0 ? flagsCount : 0) > 1 && (_jsx(motion.div, Object.assign({ "data-testid": "ActionsColumn_StyledBadge_Container", style: {
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
justifyContent: 'center',
|
|
51
|
-
gap: '4px',
|
|
52
|
-
display: 'flex',
|
|
53
|
-
zIndex: 10,
|
|
54
|
-
}, initial: { width: 0, opacity: 0 }, transition: {
|
|
55
|
-
animate: {
|
|
56
|
-
duration: 0.5,
|
|
57
|
-
},
|
|
58
|
-
fadeIn: {
|
|
59
|
-
duration: 0.2,
|
|
60
|
-
},
|
|
61
|
-
}, variants: {
|
|
62
|
-
animate: {
|
|
63
|
-
width: 'auto',
|
|
64
|
-
},
|
|
65
|
-
fadeIn: {
|
|
66
|
-
transition: {
|
|
67
|
-
delay: 0.5,
|
|
68
|
-
},
|
|
69
|
-
opacity: 1,
|
|
70
|
-
},
|
|
71
|
-
} }, { children: _jsxs(StyledBadge, Object.assign({ compact: true, variant: colorToVariant[(_c = flags[flag]) === null || _c === void 0 ? void 0 : _c.color] || BadgeVariants.ORANGE, "data-testid": "ActionsColumn_StyledBadge" }, { children: [flagsCount, "x"] })) })))] })) }))) })), showIdButton ? (tableMode === 'sheet' ? (_jsx(SheetViewIDButton, { rowId: rowId || row.id })) : (_jsx(IDButton, { rowId: rowId || row.id }))) : null, _jsx("div", Object.assign({ "data-testid": "ActionsColumn_IconsContainer", style: {
|
|
72
|
-
display: 'flex',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
justifyContent: 'center',
|
|
75
|
-
gap: '5px',
|
|
76
|
-
} }, { children: showJsonViewer && (_jsx(TransparentButton, Object.assign({ onClick: onJsonViewClick, type: "button", "data-testid": "ActionsColumn_TransparentButton" }, { children: _jsx(Tooltip, Object.assign({ title: t('jsonViewer') }, { children: _jsx(IdButtonContainer, Object.assign({ tableMode: tableMode, "data-testid": "ActionsColumn_IdButtonContainer" }, { children: tableMode === 'sheet' ? (_jsx("span", Object.assign({ style: { fontSize: '11px', fontWeight: 400 } }, { children: "View API" }))) : (_jsx(motion.img, { src: jsonBlackIcon, alt: "icon" }, "id-icon")) })) })) }))) }))] })) })));
|
|
77
|
-
}
|
|
78
|
-
export default memo(ActionsColumn);
|