@tap-payments/os-micro-frontend-shared 0.0.184 → 0.0.185
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/SearchButton/styles.d.ts +1 -1
- package/build/components/StatusButtons/StatusButtons.d.ts +11 -0
- package/build/components/StatusButtons/StatusButtons.js +38 -0
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/SourceMergedCell/style.d.ts +1 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -1
- package/build/components/VirtualTable/style.d.ts +1 -1
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/package.json +1 -1
|
@@ -554,9 +554,9 @@ export declare const Icon: import("@emotion/styled").StyledComponent<{
|
|
|
554
554
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
555
555
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
556
556
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
557
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
557
558
|
src?: string | undefined;
|
|
558
559
|
alt?: string | undefined;
|
|
559
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
560
560
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
561
561
|
useMap?: string | undefined;
|
|
562
562
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AvailableStatus } from '../StatusBar/type';
|
|
3
|
+
import { TableHeaderStatus } from '../../types/index.js';
|
|
4
|
+
export type StatusButtonsProps = {
|
|
5
|
+
availableStatuses: AvailableStatus[];
|
|
6
|
+
status: TableHeaderStatus;
|
|
7
|
+
onStatusChange?: (status: TableHeaderStatus) => void;
|
|
8
|
+
isFilteredIdsShown?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<(props: StatusButtonsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import StatusButton from '../StatusButton/StatusButton';
|
|
4
|
+
import { memo, useMemo } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
const StatusButtonItem = memo((props) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const { availableStatus, getButtonStatus, onStatusChange, status } = props;
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
if (!Array.isArray(availableStatus.status)) {
|
|
11
|
+
return (_createElement(StatusButton, Object.assign({}, availableStatus, { key: `status-button-array-${availableStatus.status}`, variant: getButtonStatus(availableStatus.status), onClick: () => {
|
|
12
|
+
if (!Array.isArray(availableStatus.status)) {
|
|
13
|
+
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(availableStatus.status);
|
|
14
|
+
}
|
|
15
|
+
} })));
|
|
16
|
+
}
|
|
17
|
+
const isCurrentStatusDropdown = (_a = availableStatus.status) === null || _a === void 0 ? void 0 : _a.includes(status || '');
|
|
18
|
+
const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
|
|
19
|
+
const statusLabel = isCurrentStatusDropdown ? status : availableStatus.status[0];
|
|
20
|
+
return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, availableStatus, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
|
|
21
|
+
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(buttonStatus);
|
|
22
|
+
}, dropdownOptions: availableStatus.status.map((stat) => ({
|
|
23
|
+
label: t(stat || ''),
|
|
24
|
+
onClick: () => {
|
|
25
|
+
onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(stat);
|
|
26
|
+
},
|
|
27
|
+
status: stat,
|
|
28
|
+
})) })) }));
|
|
29
|
+
});
|
|
30
|
+
const StatusButtons = (props) => {
|
|
31
|
+
const { availableStatuses, status, onStatusChange, isFilteredIdsShown } = props;
|
|
32
|
+
const getButtonStatus = useMemo(() => (buttonStatus) => buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive', [status, isFilteredIdsShown]);
|
|
33
|
+
return (_jsx(_Fragment, { children: availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((availableStatus) => {
|
|
34
|
+
var _a;
|
|
35
|
+
return (_jsx(StatusButtonItem, { availableStatus: availableStatus, getButtonStatus: getButtonStatus, onStatusChange: onStatusChange, status: status }, Array.isArray(availableStatus.status) ? (_a = availableStatus === null || availableStatus === void 0 ? void 0 : availableStatus.status) === null || _a === void 0 ? void 0 : _a[0] : `status-button-array-${availableStatus.status}`));
|
|
36
|
+
}) }));
|
|
37
|
+
};
|
|
38
|
+
export default memo(StatusButtons);
|
|
@@ -272,9 +272,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
|
|
|
272
272
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
273
273
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
274
274
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
275
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
275
276
|
src?: string | undefined;
|
|
276
277
|
alt?: string | undefined;
|
|
277
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
278
278
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
279
279
|
useMap?: string | undefined;
|
|
280
280
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -273,9 +273,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
|
|
|
273
273
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
274
274
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
275
275
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
276
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
276
277
|
src?: string | undefined;
|
|
277
278
|
alt?: string | undefined;
|
|
278
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
279
279
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
280
280
|
useMap?: string | undefined;
|
|
281
281
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -262,9 +262,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
|
|
|
262
262
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
263
263
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
264
264
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
265
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
265
266
|
src?: string | undefined;
|
|
266
267
|
alt?: string | undefined;
|
|
267
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
268
268
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
269
269
|
useMap?: string | undefined;
|
|
270
270
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -306,9 +306,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
|
|
|
306
306
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
|
|
307
307
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
308
308
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
|
|
309
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
309
310
|
src?: string | undefined;
|
|
310
311
|
alt?: string | undefined;
|
|
311
|
-
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
312
312
|
crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
313
313
|
useMap?: string | undefined;
|
|
314
314
|
loading?: "eager" | "lazy" | undefined;
|
|
@@ -12,7 +12,7 @@ export { default as Checkbox } from './Checkbox';
|
|
|
12
12
|
export { default as Dialog, DialogToolbar } from './Dialog';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
|
14
14
|
export * from './RFH';
|
|
15
|
-
export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
15
|
+
export { default as VirtualTable, TableRowLoading, TableHeader as VirtualTableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
16
16
|
export { default as SheetViewVirtualTable } from './VirtualTable/SheetView/SheetViewVirtualTable';
|
|
17
17
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
18
18
|
export { default as TapLogo } from './TapLogo';
|
|
@@ -12,7 +12,7 @@ export { default as Checkbox } from './Checkbox';
|
|
|
12
12
|
export { default as Dialog, DialogToolbar } from './Dialog';
|
|
13
13
|
export { default as Tooltip } from './Tooltip';
|
|
14
14
|
export * from './RFH';
|
|
15
|
-
export { default as VirtualTable, TableRowLoading, TableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
15
|
+
export { default as VirtualTable, TableRowLoading, TableHeader as VirtualTableHeader, TableLastItem, TableLoading, TableLoadingWithCard, TableNoData, TableNoDataWithCard, LastRowContent, ListItemWrapperWithCard, RowErrorState, StyledItemWrapper, TableRow, TableRowLoadingWithCard, TableRowWithCard, VirtualScrollInner, VirtualScrollList, VirtualScrollOuter, VirtualTableWithCard, Inputs, List, ColumnFilter, StyledCell, } from './VirtualTable';
|
|
16
16
|
export { default as SheetViewVirtualTable } from './VirtualTable/SheetView/SheetViewVirtualTable';
|
|
17
17
|
export { default as Widget, ListItem, WidgetHeader, WidgetList } from './Widget';
|
|
18
18
|
export { default as TapLogo } from './TapLogo';
|
package/package.json
CHANGED