@tap-payments/os-micro-frontend-shared 0.1.331 → 0.1.333
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/TableCells/CustomCells/TextWithChipCell/TextWithChipCell.d.ts +21 -0
- package/build/components/TableCells/CustomCells/TextWithChipCell/TextWithChipCell.js +31 -0
- package/build/components/TableCells/CustomCells/TextWithChipCell/index.d.ts +2 -0
- package/build/components/TableCells/CustomCells/TextWithChipCell/index.js +2 -0
- package/build/components/TableCells/CustomCells/index.d.ts +1 -2
- package/build/components/TableCells/CustomCells/index.js +1 -2
- package/build/utils/merchantSource.d.ts +1 -1
- package/build/utils/merchantSource.js +3 -2
- package/package.json +1 -1
- package/build/components/TableCells/CustomCells/TerminalsBrandCell/TerminalsBrandCell.d.ts +0 -12
- package/build/components/TableCells/CustomCells/TerminalsBrandCell/TerminalsBrandCell.js +0 -21
- package/build/components/TableCells/CustomCells/TerminalsBrandCell/index.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TerminalsBrandCell/index.js +0 -1
- package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.d.ts +0 -13
- package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.js +0 -31
- package/build/components/TableCells/CustomCells/TerminalsPlatformCell/index.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TerminalsPlatformCell/index.js +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StackProps } from '@mui/material/Stack';
|
|
3
|
+
import { TypographyProps } from '@mui/material/Typography';
|
|
4
|
+
import { ChipProps, Tooltip } from '../../../index.js';
|
|
5
|
+
import { TextAndLang } from '../../../../types/index.js';
|
|
6
|
+
export type TextWithChipCell<T extends React.ElementType = 'div'> = StackProps<T> & {
|
|
7
|
+
name?: TextAndLang[];
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
namePlaceholder?: React.ReactNode;
|
|
10
|
+
showIcon?: boolean;
|
|
11
|
+
showLabel?: boolean;
|
|
12
|
+
slotsProps?: {
|
|
13
|
+
tooltip?: Partial<React.ComponentProps<typeof Tooltip>>;
|
|
14
|
+
chip?: Partial<ChipProps>;
|
|
15
|
+
chipsTooltip?: Partial<React.ComponentProps<typeof Tooltip>>;
|
|
16
|
+
label?: Partial<TypographyProps>;
|
|
17
|
+
labelTooltip?: Partial<React.ComponentProps<typeof Tooltip>>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
declare const _default: React.MemoExoticComponent<(props: TextWithChipCell<"div">) => import("react/jsx-runtime").JSX.Element | null>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import { memo, useMemo } from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import Stack from '@mui/material/Stack';
|
|
16
|
+
import Typography from '@mui/material/Typography';
|
|
17
|
+
import Box from '@mui/material/Box';
|
|
18
|
+
import { Chip, Tooltip } from '../../../index.js';
|
|
19
|
+
import { getNameText } from '../../../../utils/index.js';
|
|
20
|
+
const TextWithChipCell = (props) => {
|
|
21
|
+
const { name, icon, namePlaceholder = 'Unavailable', showIcon = true, showLabel = true, slotsProps } = props, restProps = __rest(props, ["name", "icon", "namePlaceholder", "showIcon", "showLabel", "slotsProps"]);
|
|
22
|
+
const { i18n } = useTranslation();
|
|
23
|
+
const formattedName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
|
|
24
|
+
const { tooltip = {}, chip = {}, chipsTooltip = {}, label = {}, labelTooltip = {} } = slotsProps || {};
|
|
25
|
+
const displayIcon = showIcon && !!icon;
|
|
26
|
+
const displayLabel = showLabel;
|
|
27
|
+
if (!displayIcon && !displayLabel)
|
|
28
|
+
return null;
|
|
29
|
+
return (_jsxs(Stack, Object.assign({ direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, restProps, { children: [displayIcon && (_jsx(Tooltip, Object.assign({ title: formattedName ? `Platform: ${formattedName}` : null }, tooltip, chipsTooltip, { children: _jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, chip, { children: icon })) }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: formattedName }, tooltip, labelTooltip, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, label, { children: formattedName || (_jsx(Box, Object.assign({ component: "span", sx: { opacity: 0.2 } }, { children: namePlaceholder }))) })) })))] })));
|
|
30
|
+
};
|
|
31
|
+
export default memo(TextWithChipCell);
|
|
@@ -43,8 +43,6 @@ export * from './MarketPlaceCell';
|
|
|
43
43
|
export * from './IndividualsCell';
|
|
44
44
|
export * from './BrandsCell';
|
|
45
45
|
export * from './SalesChannelCell';
|
|
46
|
-
export * from './TerminalsBrandCell';
|
|
47
|
-
export * from './TerminalsPlatformCell';
|
|
48
46
|
export * from './AppsCell';
|
|
49
47
|
export * from './type';
|
|
50
48
|
export * from './style';
|
|
@@ -53,3 +51,4 @@ export * from './PaymentAgreementCell';
|
|
|
53
51
|
export * from './ProviderCell';
|
|
54
52
|
export * from './PurposeCell';
|
|
55
53
|
export * from './LinkCell';
|
|
54
|
+
export * from './TextWithChipCell';
|
|
@@ -43,8 +43,6 @@ export * from './MarketPlaceCell';
|
|
|
43
43
|
export * from './IndividualsCell';
|
|
44
44
|
export * from './BrandsCell';
|
|
45
45
|
export * from './SalesChannelCell';
|
|
46
|
-
export * from './TerminalsBrandCell';
|
|
47
|
-
export * from './TerminalsPlatformCell';
|
|
48
46
|
export * from './AppsCell';
|
|
49
47
|
export * from './type';
|
|
50
48
|
export * from './style';
|
|
@@ -53,3 +51,4 @@ export * from './PaymentAgreementCell';
|
|
|
53
51
|
export * from './ProviderCell';
|
|
54
52
|
export * from './PurposeCell';
|
|
55
53
|
export * from './LinkCell';
|
|
54
|
+
export * from './TextWithChipCell';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import capitalize from 'lodash/capitalize';
|
|
2
|
+
import startCase from 'lodash/startCase';
|
|
2
3
|
import { PAYMENT_TYPES_ICONS } from '../constants/index.js';
|
|
3
4
|
import { getNameText } from './language';
|
|
4
5
|
export function transformPaymentMethodsData(data) {
|
|
@@ -8,7 +9,7 @@ export function transformPaymentMethodsData(data) {
|
|
|
8
9
|
options: data === null || data === void 0 ? void 0 : data.map((category) => {
|
|
9
10
|
var _a, _b;
|
|
10
11
|
return {
|
|
11
|
-
name: capitalize(getNameText(category === null || category === void 0 ? void 0 : category.name)),
|
|
12
|
+
name: capitalize(startCase(getNameText(category === null || category === void 0 ? void 0 : category.name))),
|
|
12
13
|
type: category === null || category === void 0 ? void 0 : category.code,
|
|
13
14
|
icon: (_a = PAYMENT_TYPES_ICONS[category.code]) !== null && _a !== void 0 ? _a : PAYMENT_TYPES_ICONS.CARD,
|
|
14
15
|
options: (_b = category.payment_methods) === null || _b === void 0 ? void 0 : _b.map((method) => ({
|
|
@@ -27,7 +28,7 @@ export function transformPaymentSchemesData(data = []) {
|
|
|
27
28
|
.filter((scheme) => scheme.code)
|
|
28
29
|
.map((scheme) => {
|
|
29
30
|
return {
|
|
30
|
-
name: getNameText(scheme === null || scheme === void 0 ? void 0 : scheme.name),
|
|
31
|
+
name: capitalize(startCase(getNameText(scheme === null || scheme === void 0 ? void 0 : scheme.name))),
|
|
31
32
|
type: scheme === null || scheme === void 0 ? void 0 : scheme.code,
|
|
32
33
|
};
|
|
33
34
|
}),
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TextAndLang } from '../../../../types/index.js';
|
|
3
|
-
type TerminalsBrandCellProps = {
|
|
4
|
-
name?: TextAndLang[];
|
|
5
|
-
icon?: React.ReactNode;
|
|
6
|
-
displayRules?: {
|
|
7
|
-
showIcon?: boolean;
|
|
8
|
-
showLabel?: boolean;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
declare const TerminalsBrandCell: (props: TerminalsBrandCellProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
export default TerminalsBrandCell;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import Stack from '@mui/material/Stack';
|
|
5
|
-
import Typography from '@mui/material/Typography';
|
|
6
|
-
import { Chip, Tooltip } from '../../../index.js';
|
|
7
|
-
import { getNameText } from '../../../../utils/index.js';
|
|
8
|
-
const TerminalsBrandCell = (props) => {
|
|
9
|
-
const { name, icon, displayRules } = props;
|
|
10
|
-
const { i18n } = useTranslation();
|
|
11
|
-
const brandName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
|
|
12
|
-
if (!name && !icon)
|
|
13
|
-
return null;
|
|
14
|
-
const { showIcon = true, showLabel = true } = displayRules || {};
|
|
15
|
-
const displayIcon = showIcon && !!icon;
|
|
16
|
-
const displayLabel = showLabel;
|
|
17
|
-
if (!displayIcon && !displayLabel)
|
|
18
|
-
return null;
|
|
19
|
-
return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsBrandCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, { children: [displayIcon && (_jsx(Tooltip, Object.assign({ title: brandName ? `Brand: ${brandName}` : null }, { children: _jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon })) }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: brandName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: brandName })) })))] })));
|
|
20
|
-
};
|
|
21
|
-
export default TerminalsBrandCell;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as TerminalsBrandCell } from './TerminalsBrandCell';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as TerminalsBrandCell } from './TerminalsBrandCell';
|
package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { StackProps } from '@mui/material/Stack';
|
|
3
|
-
import { TextAndLang } from '../../../../types/index.js';
|
|
4
|
-
type TerminalsPlatformCellProps = StackProps & {
|
|
5
|
-
name?: TextAndLang[];
|
|
6
|
-
icon?: React.ReactNode;
|
|
7
|
-
displayRules?: {
|
|
8
|
-
showIcon?: boolean;
|
|
9
|
-
showLabel?: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
declare const _default: import("react").MemoExoticComponent<({ name, icon, displayRules, ...props }: TerminalsPlatformCellProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
13
|
-
export default _default;
|
package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.js
DELETED
|
@@ -1,31 +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 } from "react/jsx-runtime";
|
|
13
|
-
import { memo, useMemo } from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import Stack from '@mui/material/Stack';
|
|
16
|
-
import Typography from '@mui/material/Typography';
|
|
17
|
-
import Box from '@mui/material/Box';
|
|
18
|
-
import { Chip, Tooltip } from '../../../index.js';
|
|
19
|
-
import { getNameText } from '../../../../utils/index.js';
|
|
20
|
-
const TerminalsPlatformCell = (_a) => {
|
|
21
|
-
var { name, icon, displayRules } = _a, props = __rest(_a, ["name", "icon", "displayRules"]);
|
|
22
|
-
const { i18n } = useTranslation();
|
|
23
|
-
const platformName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
|
|
24
|
-
const { showIcon = true, showLabel = true } = displayRules || {};
|
|
25
|
-
const displayIcon = showIcon && !!icon;
|
|
26
|
-
const displayLabel = showLabel;
|
|
27
|
-
if (!displayIcon && !displayLabel)
|
|
28
|
-
return null;
|
|
29
|
-
return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsPlatformCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, props, { children: [displayIcon && (_jsx(Tooltip, Object.assign({ title: platformName ? `Platform: ${platformName}` : null }, { children: _jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon })) }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: platformName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: platformName || (_jsx(Box, Object.assign({ component: "span", sx: { opacity: 0.2 } }, { children: "Unavailable" }))) })) })))] })));
|
|
30
|
-
};
|
|
31
|
-
export default memo(TerminalsPlatformCell);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';
|