@tap-payments/os-micro-frontend-shared 0.1.246-test.3 → 0.1.247

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.
Files changed (75) hide show
  1. package/build/components/Chip/style.d.ts +1 -0
  2. package/build/components/CountBadge/style.d.ts +1 -0
  3. package/build/components/Dialog/style.d.ts +1 -0
  4. package/build/components/FlippingCard/style.d.ts +1 -0
  5. package/build/components/ImageWrapper/ImageWrapper.d.ts +1 -0
  6. package/build/components/JSONViewer/style.d.ts +1 -0
  7. package/build/components/LeftPeekRightExpandingChip/style.d.ts +1 -0
  8. package/build/components/RightLeftExpandingCenterChip/style.d.ts +1 -0
  9. package/build/components/SearchButton/styles.d.ts +1 -0
  10. package/build/components/StatusIcons/AuthIcons/style.d.ts +1 -0
  11. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +1 -0
  12. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +1 -0
  13. package/build/components/StatusIcons/SourceIcons/style.d.ts +1 -0
  14. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -0
  15. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +1 -0
  16. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +1 -0
  17. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +1 -0
  18. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +1 -0
  19. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +1 -0
  20. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +1 -0
  21. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +1 -0
  22. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +1 -0
  23. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +1 -0
  24. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +1 -0
  25. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +1 -0
  26. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +1 -0
  27. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +1 -0
  28. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +1 -0
  29. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -0
  30. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +1 -0
  31. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -0
  32. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +1 -0
  33. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -0
  34. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +1 -0
  35. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -0
  36. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +1 -0
  37. package/build/components/TableCells/CustomCells/style.d.ts +1 -0
  38. package/build/components/VirtualTables/components/style.d.ts +1 -0
  39. package/build/components/index.d.ts +0 -1
  40. package/build/components/index.js +0 -1
  41. package/build/constants/assets.d.ts +2 -0
  42. package/build/constants/assets.js +2 -0
  43. package/build/constants/index.d.ts +0 -1
  44. package/build/constants/index.js +0 -1
  45. package/build/types/index.d.ts +0 -1
  46. package/build/types/index.js +0 -1
  47. package/build/types/invoice.d.ts +6 -1
  48. package/build/types/invoice.js +6 -0
  49. package/package.json +3 -3
  50. package/build/components/Discount/DiscountDropdown/DiscountDropdown.d.ts +0 -13
  51. package/build/components/Discount/DiscountDropdown/DiscountDropdown.js +0 -67
  52. package/build/components/Discount/DiscountDropdown/index.d.ts +0 -2
  53. package/build/components/Discount/DiscountDropdown/index.js +0 -2
  54. package/build/components/Discount/DiscountDropdown/style.d.ts +0 -12
  55. package/build/components/Discount/DiscountDropdown/style.js +0 -40
  56. package/build/components/Discount/DiscountRateDropdown/DiscountRateDropdown.d.ts +0 -12
  57. package/build/components/Discount/DiscountRateDropdown/DiscountRateDropdown.js +0 -53
  58. package/build/components/Discount/DiscountRateDropdown/index.d.ts +0 -2
  59. package/build/components/Discount/DiscountRateDropdown/index.js +0 -2
  60. package/build/components/Discount/DiscountRateDropdown/style.d.ts +0 -7
  61. package/build/components/Discount/DiscountRateDropdown/style.js +0 -33
  62. package/build/components/Discount/TotalDiscount/TotalDiscount.d.ts +0 -12
  63. package/build/components/Discount/TotalDiscount/TotalDiscount.js +0 -29
  64. package/build/components/Discount/TotalDiscount/index.d.ts +0 -1
  65. package/build/components/Discount/TotalDiscount/index.js +0 -1
  66. package/build/components/Discount/TotalDiscount/style.d.ts +0 -12
  67. package/build/components/Discount/TotalDiscount/style.js +0 -5
  68. package/build/components/Discount/index.d.ts +0 -4
  69. package/build/components/Discount/index.js +0 -4
  70. package/build/components/Discount/utils.d.ts +0 -8
  71. package/build/components/Discount/utils.js +0 -12
  72. package/build/constants/rate.d.ts +0 -6
  73. package/build/constants/rate.js +0 -6
  74. package/build/types/discount.d.ts +0 -5
  75. package/build/types/discount.js +0 -6
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import { GetSourceAnimationFunction } from './type';
3
4
  export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
4
5
  variant?: import("./type").ChipVariant | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const AgreementImageWrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DialogWrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  declare const ImageWrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const FOOTER_HEIGHT = 37;
3
4
  export declare const TITLE_BAR_HEIGHT = "32px";
4
5
  export declare const VIEWER_HEIGHT = 545;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import type { SxProps, Theme } from '@mui/material/styles';
3
4
  export declare const CHIP_GAP = 3;
4
5
  export declare const DEFAULT_CHIP_MIN_WIDTH = 24;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import type { SxProps, Theme } from '@mui/material/styles';
3
4
  export declare const CHIP_GAP = 3;
4
5
  export declare const CenterIconWrapper: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledInput: import("@emotion/styled").StyledComponent<{
3
4
  width?: string | number | undefined;
4
5
  height?: string | number | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const ErrorCodeLabel: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import { TableMode } from '../../../../types/index.js';
3
4
  export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
5
  tableMode?: TableMode | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
3
4
  export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const Button: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const ProductCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const RefundChargeCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const RefundCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<{
3
4
  width?: string | number | undefined;
4
5
  height?: string | number | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
3
4
  variant?: "Global" | "Regional" | "Local" | undefined;
4
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  interface TableWrapperProps {
3
4
  showNoDataView?: boolean;
4
5
  }
@@ -122,4 +122,3 @@ export * from './ListLayout';
122
122
  export { default as MFWidgetLoader } from './MFWidgetLoader';
123
123
  export { default as BetaBanner } from './BetaBanner';
124
124
  export * from './Autocomplete';
125
- export * from './Discount';
@@ -122,4 +122,3 @@ export * from './ListLayout';
122
122
  export { default as MFWidgetLoader } from './MFWidgetLoader';
123
123
  export { default as BetaBanner } from './BetaBanner';
124
124
  export * from './Autocomplete';
125
- export * from './Discount';
@@ -354,6 +354,8 @@ export declare const authenticationSchemeIcon: string;
354
354
  export declare const pinIcon: string;
355
355
  export declare const unpinIcon: string;
356
356
  export declare const switcherIcon: string;
357
+ export declare const verticalLineIcon: string;
358
+ export declare const previewModeIcon: string;
357
359
  export declare const tokenSavedStatusIcon: string;
358
360
  export declare const tokenTransactedStatusIcon: string;
359
361
  export declare const tokenExpiredStatusIcon: string;
@@ -360,6 +360,8 @@ export const authenticationSchemeIcon = `${lightUrl}/status/authenticationScheme
360
360
  export const pinIcon = `${lightUrl}/pin.svg`;
361
361
  export const unpinIcon = `${lightUrl}/unpin.svg`;
362
362
  export const switcherIcon = `${appBaseUrl}/switcher.svg`;
363
+ export const verticalLineIcon = `${lightUrl}/verticalLine.svg`;
364
+ export const previewModeIcon = `${lightUrl}/previewModeIcon.svg`;
363
365
  export const tokenSavedStatusIcon = `${lightUrl}/status/table/tokensSaved.svg`;
364
366
  export const tokenTransactedStatusIcon = `${lightUrl}/status/table/tokensTransacted.svg`;
365
367
  export const tokenExpiredStatusIcon = `${lightUrl}/status/table/tokensExpired.svg`;
@@ -13,4 +13,3 @@ export * from './toggleOptions';
13
13
  export * from './payment';
14
14
  export * from './segment';
15
15
  export * from './chips';
16
- export * from './rate';
@@ -13,4 +13,3 @@ export * from './toggleOptions';
13
13
  export * from './payment';
14
14
  export * from './segment';
15
15
  export * from './chips';
16
- export * from './rate';
@@ -26,4 +26,3 @@ export * from './day';
26
26
  export * from './tsUtils';
27
27
  export * from './appEvents';
28
28
  export * from './common';
29
- export * from './discount';
@@ -26,4 +26,3 @@ export * from './day';
26
26
  export * from './tsUtils';
27
27
  export * from './appEvents';
28
28
  export * from './common';
29
- export * from './discount';
@@ -1,4 +1,9 @@
1
- import { Country, Currency, DISCOUNT_TYPE } from './index.js';
1
+ import { Country, Currency } from './index.js';
2
+ export declare enum DISCOUNT_TYPE {
3
+ NO_DISCOUNT = "noDiscount",
4
+ PERCENT = "percent",
5
+ FLAT = "flat"
6
+ }
2
7
  export declare enum RECURRENCE_TYPE {
3
8
  ONE_TIME = "oneTime",
4
9
  DAILY = "daily",
@@ -1,3 +1,9 @@
1
+ export var DISCOUNT_TYPE;
2
+ (function (DISCOUNT_TYPE) {
3
+ DISCOUNT_TYPE["NO_DISCOUNT"] = "noDiscount";
4
+ DISCOUNT_TYPE["PERCENT"] = "percent";
5
+ DISCOUNT_TYPE["FLAT"] = "flat";
6
+ })(DISCOUNT_TYPE || (DISCOUNT_TYPE = {}));
1
7
  export var RECURRENCE_TYPE;
2
8
  (function (RECURRENCE_TYPE) {
3
9
  RECURRENCE_TYPE["ONE_TIME"] = "oneTime";
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.1.246-test.3",
5
- "testVersion": 3,
4
+ "version": "0.1.247",
5
+ "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -163,4 +163,4 @@
163
163
  "publishConfig": {
164
164
  "registry": "https://registry.npmjs.org/"
165
165
  }
166
- }
166
+ }
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { BoxProps } from '@mui/material/Box';
3
- import { Currency, Discount } from '../../../types/index.js';
4
- interface DiscountDropdownProps extends BoxProps {
5
- discount: Discount;
6
- maxDiscount?: number;
7
- selectedCurrency: Currency;
8
- setDiscount: (value: Discount) => void;
9
- setIsOpen: (value: boolean) => void;
10
- }
11
- declare function DiscountDropdown({ discount, maxDiscount, setDiscount, setIsOpen, selectedCurrency, ...props }: Readonly<DiscountDropdownProps>): import("react/jsx-runtime").JSX.Element;
12
- declare const _default: import("react").MemoExoticComponent<typeof DiscountDropdown>;
13
- export default _default;
@@ -1,67 +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, useState } from 'react';
14
- import { useTranslation } from 'react-i18next';
15
- import Box from '@mui/material/Box';
16
- import { DISCOUNT_TYPE } from '../../../types/index.js';
17
- import { checkIcon, rightArrow } from '../../../constants/index.js';
18
- import { AmountInput } from '../../index.js';
19
- import { Wrapper, Option, Dropdown } from './style';
20
- import DiscountRateDropdown from '../DiscountRateDropdown';
21
- function DiscountDropdown(_a) {
22
- var { discount, maxDiscount, setDiscount, setIsOpen, selectedCurrency } = _a, props = __rest(_a, ["discount", "maxDiscount", "setDiscount", "setIsOpen", "selectedCurrency"]);
23
- const [isRatDropdownOpen, setIsRatDropdownOpen] = useState(false);
24
- const [isFlatDropdownOpen, setIsFlatDropdownOpen] = useState(false);
25
- const { t } = useTranslation();
26
- const isNoDiscount = discount.type === DISCOUNT_TYPE.NO_DISCOUNT;
27
- const isPercent = discount.type === DISCOUNT_TYPE.PERCENT;
28
- const handleSelectDiscount = (newDiscount) => {
29
- setDiscount(newDiscount);
30
- };
31
- const onClickNoneDiscount = (e) => {
32
- e.stopPropagation();
33
- setIsOpen(false);
34
- handleSelectDiscount({
35
- type: DISCOUNT_TYPE.NO_DISCOUNT,
36
- value: 0,
37
- percentage: 0,
38
- flat: 0,
39
- });
40
- if (isRatDropdownOpen)
41
- setIsRatDropdownOpen(false);
42
- if (isFlatDropdownOpen)
43
- setIsFlatDropdownOpen(false);
44
- };
45
- const openRatDropdown = (e) => {
46
- e.stopPropagation();
47
- setIsRatDropdownOpen(true);
48
- if (isFlatDropdownOpen)
49
- setIsFlatDropdownOpen(false);
50
- };
51
- const openFLatDropdown = (e) => {
52
- e.stopPropagation();
53
- setIsFlatDropdownOpen(true);
54
- if (isRatDropdownOpen)
55
- setIsRatDropdownOpen(false);
56
- };
57
- return (_jsxs(Wrapper, Object.assign({ sx: Object.assign(Object.assign({}, props.sx), (isFlatDropdownOpen && { borderBottomRightRadius: 0 })) }, { children: [_jsxs(Option, Object.assign({ className: "option", onClick: onClickNoneDiscount, sx: { justifyContent: 'flex-start' } }, { children: [isNoDiscount ? _jsx("img", { src: checkIcon, alt: "c" }) : _jsx(Box, { width: "12px" }), _jsx("span", { children: t('none') })] })), _jsxs(Option, Object.assign({ className: "option", onClick: openRatDropdown, sx: (theme) => (Object.assign({ justifyContent: 'space-between', position: 'relative' }, (isRatDropdownOpen && { boxShadow: theme.shadows[3] }))) }, { children: [_jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: '6px' } }, { children: [isPercent ? _jsx("img", { src: checkIcon, alt: "check" }) : _jsx(Box, { width: "12px" }), _jsx("span", { children: "%" })] })), _jsx("img", { src: rightArrow, alt: "r" }), _jsx(DiscountRateDropdown, { sx: {
58
- position: 'absolute',
59
- left: '100%',
60
- top: 0,
61
- display: isRatDropdownOpen ? 'block' : 'none',
62
- borderTopLeftRadius: 0,
63
- }, setIsOpen: setIsOpen, discount: discount, setDiscount: setDiscount })] })), _jsxs(Option, Object.assign({ className: "option", onClick: openFLatDropdown, sx: (theme) => (Object.assign({ justifyContent: 'space-between', position: 'relative' }, (isFlatDropdownOpen && { boxShadow: theme.shadows[3] }))) }, { children: [_jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: '6px' } }, { children: [discount.type === DISCOUNT_TYPE.FLAT ? _jsx("img", { src: checkIcon, alt: "c" }) : _jsx(Box, { width: "12px" }), _jsx("span", { children: t('flat') })] })), _jsx("img", { src: rightArrow, alt: "r" }), _jsx(Dropdown, Object.assign({ isOpen: isFlatDropdownOpen }, { children: _jsx(AmountInput, { selectedCurrency: selectedCurrency, sx: { height: 24, width: '100%', input: { height: 20, width: '100%', textAlign: 'right', flexGrow: 1 } }, amount: discount.type === DISCOUNT_TYPE.FLAT ? Number(discount.flat) : '', setAmount: (value) => {
64
- handleSelectDiscount(Object.assign(Object.assign({}, discount), { type: DISCOUNT_TYPE.FLAT, flat: Number(value) }));
65
- }, maxAmount: maxDiscount }) }))] }))] })));
66
- }
67
- export default memo(DiscountDropdown);
@@ -1,2 +0,0 @@
1
- export { default } from './DiscountDropdown';
2
- export * from './DiscountDropdown';
@@ -1,2 +0,0 @@
1
- export { default } from './DiscountDropdown';
2
- export * from './DiscountDropdown';
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const Wrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
5
- export declare const Option: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
8
- export declare const Dropdown: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
10
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
11
- isOpen: boolean;
12
- }, {}, {}>;
@@ -1,40 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import { styled } from '@mui/material/styles';
3
- export const Wrapper = styled(Box)(({ theme }) => ({
4
- width: 106,
5
- boxShadow: theme.shadows[16],
6
- borderRadius: 4,
7
- backgroundColor: theme.palette.common.white,
8
- '.option + .option': {
9
- borderTop: `1px solid ${theme.palette.divider}`,
10
- },
11
- zIndex: 3,
12
- }));
13
- export const Option = styled(Box)(({ theme }) => ({
14
- fontSize: '11px',
15
- padding: theme.spacing(1),
16
- display: 'flex',
17
- justifyContent: 'flex-end',
18
- alignItems: 'center',
19
- gap: theme.spacing(1),
20
- cursor: 'pointer',
21
- height: 40,
22
- input: {
23
- height: 24,
24
- width: 47,
25
- textAlign: 'right',
26
- },
27
- }));
28
- export const Dropdown = styled(Box, { shouldForwardProp: (props) => props !== 'isOpen' })(({ isOpen, theme }) => ({
29
- display: isOpen ? 'block' : 'none',
30
- position: 'absolute',
31
- left: '100%',
32
- top: 0,
33
- background: theme.palette.common.white,
34
- padding: '8px',
35
- borderTopRightRadius: '4px',
36
- borderBottomRightRadius: '4px',
37
- overflow: 'hidden',
38
- minWidth: 112,
39
- height: 39,
40
- }));
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { BoxProps } from '@mui/material/Box';
3
- import { Discount } from '../../../types/index.js';
4
- interface DiscountRateDropdownProps extends BoxProps {
5
- discount: Discount;
6
- setDiscount: (value: Discount) => void;
7
- setIsDropdownOpen?: (value: boolean) => void;
8
- setIsOpen: (value: boolean) => void;
9
- }
10
- declare function DiscountRateDropdown({ discount, setDiscount, setIsDropdownOpen, setIsOpen, ...props }: Readonly<DiscountRateDropdownProps>): import("react/jsx-runtime").JSX.Element;
11
- declare const _default: import("react").MemoExoticComponent<typeof DiscountRateDropdown>;
12
- export default _default;
@@ -1,53 +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 } from 'react';
14
- import { DISCOUNT_TYPE } from '../../../types/index.js';
15
- import { Input } from '../../index.js';
16
- import { checkIcon, RATES } from '../../../constants/index.js';
17
- import { removeAllCharsFromNumber } from '../../../utils/index.js';
18
- import { Wrapper, Option } from './style';
19
- function DiscountRateDropdown(_a) {
20
- var { discount, setDiscount, setIsDropdownOpen, setIsOpen } = _a, props = __rest(_a, ["discount", "setDiscount", "setIsDropdownOpen", "setIsOpen"]);
21
- const { percentage, value } = discount;
22
- const isFivePercent = percentage === RATES.FIVE;
23
- const isTenPercent = percentage === RATES.TEN;
24
- const isFifteenPercent = percentage === RATES.FIFTEEN;
25
- const isCustomPercent = percentage !== RATES.FIVE && percentage !== RATES.TEN && percentage !== RATES.FIFTEEN && percentage !== RATES.ZERO && value !== RATES.ZERO;
26
- const discountRATES = [
27
- { label: '5%', value: RATES.FIVE, selected: isFivePercent },
28
- { label: '10%', value: RATES.TEN, selected: isTenPercent },
29
- { label: '15%', value: RATES.FIFTEEN, selected: isFifteenPercent },
30
- ];
31
- const selectRat = (percentageValue) => {
32
- setDiscount({ value, percentage: percentageValue, type: DISCOUNT_TYPE.PERCENT });
33
- setIsOpen(false);
34
- };
35
- const handleCustomRat = (e) => {
36
- if (Number(e.target.value || !Number(e.target.value)) > 100)
37
- return false;
38
- setDiscount({
39
- value: Number(e.target.value),
40
- percentage: Number(removeAllCharsFromNumber(e.target.value)),
41
- type: DISCOUNT_TYPE.PERCENT,
42
- });
43
- };
44
- const renderSelectedIcon = (selected) => {
45
- return selected ? _jsx("img", { src: checkIcon, alt: "c" }) : _jsx("span", {});
46
- };
47
- return (_jsxs(Wrapper, Object.assign({ sx: props.sx }, { children: [discountRATES.map((discountI) => (_jsxs(Option, Object.assign({ className: "option", onClick: () => {
48
- selectRat(discountI.value);
49
- if (setIsDropdownOpen)
50
- setIsDropdownOpen(false);
51
- } }, { children: [renderSelectedIcon(discountI.selected), _jsx("span", { children: discountI.label })] }), discountI.value))), _jsxs(Option, Object.assign({ className: "option" }, { children: [renderSelectedIcon(isCustomPercent), _jsx(Input, { placeholder: "%", sx: { input: { width: '100% !important' } }, value: isCustomPercent ? percentage : '', onChange: handleCustomRat })] }))] })));
52
- }
53
- export default memo(DiscountRateDropdown);
@@ -1,2 +0,0 @@
1
- export { default } from './DiscountRateDropdown';
2
- export * from './DiscountRateDropdown';
@@ -1,2 +0,0 @@
1
- export { default } from './DiscountRateDropdown';
2
- export * from './DiscountRateDropdown';
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const Wrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
5
- export declare const Option: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -1,33 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import { styled } from '@mui/material/styles';
3
- export const Wrapper = styled(Box)(({ theme }) => ({
4
- width: 112,
5
- boxShadow: theme.shadows[16],
6
- borderRadius: 4,
7
- backgroundColor: theme.palette.common.white,
8
- '.option + .option': {
9
- borderTop: `1px solid ${theme.palette.divider}`,
10
- },
11
- zIndex: 3,
12
- }));
13
- export const Option = styled(Box)(({ theme }) => ({
14
- fontSize: '11px',
15
- paddingInlineStart: theme.spacing(2),
16
- paddingInlineEnd: theme.spacing(1),
17
- paddingTop: theme.spacing(1.5),
18
- paddingBottom: theme.spacing(1.5),
19
- display: 'flex',
20
- justifyContent: 'space-between',
21
- alignItems: 'center',
22
- gap: theme.spacing(1),
23
- cursor: 'pointer',
24
- height: 40,
25
- input: {
26
- height: 24,
27
- width: 47,
28
- textAlign: 'right',
29
- },
30
- '&:hover': {
31
- boxShadow: theme.shadows[3],
32
- },
33
- }));
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { Currency, Discount } from '../../../types/index.js';
3
- interface TotalDiscountProps {
4
- selectedCurrency: Currency;
5
- totalGrossAmount: number;
6
- totalDiscount: Discount;
7
- isDisabled: boolean;
8
- onChangeTotalDiscount: (newDiscount: Discount) => void;
9
- }
10
- declare function TotalDiscount({ selectedCurrency, totalGrossAmount, totalDiscount, onChangeTotalDiscount, isDisabled }: Readonly<TotalDiscountProps>): import("react/jsx-runtime").JSX.Element;
11
- declare const _default: import("react").MemoExoticComponent<typeof TotalDiscount>;
12
- export default _default;
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo, useRef, useState } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import Box from '@mui/material/Box';
5
- import Popper from '@mui/material/Popper';
6
- import { CustomBackdrop, DisplayAmount } from '../../index.js';
7
- import { actionsIcon, activeActionIcon, discountIcon } from '../../../constants/index.js';
8
- import { LabelWrapper, Label } from './style';
9
- import DiscountDropdown from '../DiscountDropdown';
10
- import { getDiscountValue } from '../utils';
11
- function TotalDiscount({ selectedCurrency, totalGrossAmount, totalDiscount, onChangeTotalDiscount, isDisabled }) {
12
- const [isOpen, setIsOpen] = useState(false);
13
- const discountButtonRef = useRef();
14
- const { t } = useTranslation();
15
- const toggleDropdown = () => {
16
- if (!isDisabled)
17
- setIsOpen(!isOpen);
18
- };
19
- const handleDiscount = (newDiscount) => {
20
- onChangeTotalDiscount(Object.assign(Object.assign({}, newDiscount), { value: getDiscountValue(totalGrossAmount, newDiscount) }));
21
- };
22
- const getLabel = () => {
23
- if (totalDiscount.value === 0)
24
- return t('noDiscount');
25
- return (_jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '2px' } }, { children: [_jsx("span", { children: "-" }), _jsx(DisplayAmount, { amount: totalDiscount.value, selectedCurrency: selectedCurrency })] })));
26
- };
27
- return (_jsxs(LabelWrapper, Object.assign({ isOpen: isOpen, isDisabled: isDisabled, onClick: toggleDropdown, ref: discountButtonRef, sx: Object.assign({}, (isDisabled && { pointerEvents: 'none', opacity: 0.7 })) }, { children: [_jsx("img", { src: discountIcon, alt: "p" }), _jsx(Label, Object.assign({ isDisabled: isDisabled }, { children: getLabel() })), _jsx(Box, { component: "img", src: isOpen ? activeActionIcon : actionsIcon, alt: "a" }), isOpen && _jsx(CustomBackdrop, { onClick: toggleDropdown }), _jsx(Popper, Object.assign({ open: Boolean(isOpen), anchorEl: discountButtonRef.current, placement: "bottom-start" }, { children: _jsx(DiscountDropdown, { sx: { position: 'absolute', top: 8, left: 0, display: isOpen ? 'block' : 'none' }, selectedCurrency: selectedCurrency, discount: totalDiscount, setDiscount: handleDiscount, setIsOpen: setIsOpen, maxDiscount: Number(totalGrossAmount) }) }))] })));
28
- }
29
- export default memo(TotalDiscount);
@@ -1 +0,0 @@
1
- export { default } from './TotalDiscount';
@@ -1 +0,0 @@
1
- export { default } from './TotalDiscount';
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const LabelWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
5
- isDisabled?: boolean | undefined;
6
- isOpen?: boolean | undefined;
7
- }, {}, {}>;
8
- export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
10
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
11
- isDisabled: boolean;
12
- }, {}, {}>;
@@ -1,5 +0,0 @@
1
- import { Box, styled } from '@mui/material';
2
- export const LabelWrapper = styled(Box, {
3
- shouldForwardProp: (props) => props !== 'isDisabled' && props !== 'isOpen',
4
- })(({ theme, isOpen, isDisabled }) => (Object.assign(Object.assign({ display: 'flex', gap: theme.spacing(1), alignItems: 'center', justifyContent: 'space-between', fontSize: '11px', border: `1px solid ${theme.palette.divider}`, height: 32, padding: theme.spacing(1), borderRadius: '4px' }, (isOpen && { borderColor: theme.palette.info.dark, position: 'relative' })), (isDisabled ? { color: theme.palette.grey[700], cursor: 'not-allowed' } : { cursor: 'pointer' }))));
5
- export const Label = styled(Box, { shouldForwardProp: (props) => props !== 'isDisabled' })(({ theme, isDisabled }) => (Object.assign({ fontSize: '11px', fontWeight: 600, color: theme.palette.text.primary }, (isDisabled && { color: theme.palette.grey[700] }))));
@@ -1,4 +0,0 @@
1
- export * from './utils';
2
- export { default as DiscountDropdown } from './DiscountDropdown';
3
- export { default as DiscountRateDropdown } from './DiscountRateDropdown';
4
- export { default as TotalDiscount } from './TotalDiscount';
@@ -1,4 +0,0 @@
1
- export * from './utils';
2
- export { default as DiscountDropdown } from './DiscountDropdown';
3
- export { default as DiscountRateDropdown } from './DiscountRateDropdown';
4
- export { default as TotalDiscount } from './TotalDiscount';
@@ -1,8 +0,0 @@
1
- import { Discount, DISCOUNT_TYPE } from '../../types/index.js';
2
- export declare const getDiscountValue: (amount: number, totalDiscount: Discount) => number;
3
- export declare const getItemDiscount: (discount: Discount, itemPrice: number, quantity: number) => {
4
- value: number;
5
- type: DISCOUNT_TYPE;
6
- percentage?: number | undefined;
7
- flat?: number | undefined;
8
- };
@@ -1,12 +0,0 @@
1
- import { DISCOUNT_TYPE } from '../../types/index.js';
2
- export const getDiscountValue = (amount, totalDiscount) => {
3
- let newDiscountValue = 0;
4
- if (totalDiscount.type === DISCOUNT_TYPE.FLAT && !!totalDiscount.flat && totalDiscount.flat > 0) {
5
- newDiscountValue = totalDiscount.flat;
6
- }
7
- if (totalDiscount.type === DISCOUNT_TYPE.PERCENT && !!totalDiscount.percentage && totalDiscount.percentage > 0) {
8
- newDiscountValue = amount * (totalDiscount.percentage / 100);
9
- }
10
- return newDiscountValue;
11
- };
12
- export const getItemDiscount = (discount, itemPrice, quantity) => (Object.assign(Object.assign({}, discount), { value: getDiscountValue(itemPrice, discount) * quantity }));
@@ -1,6 +0,0 @@
1
- export declare const RATES: {
2
- ZERO: number;
3
- FIVE: number;
4
- TEN: number;
5
- FIFTEEN: number;
6
- };
@@ -1,6 +0,0 @@
1
- export const RATES = {
2
- ZERO: 0,
3
- FIVE: 5,
4
- TEN: 10,
5
- FIFTEEN: 15,
6
- };
@@ -1,5 +0,0 @@
1
- export declare enum DISCOUNT_TYPE {
2
- NO_DISCOUNT = "noDiscount",
3
- PERCENT = "percent",
4
- FLAT = "flat"
5
- }
@@ -1,6 +0,0 @@
1
- export var DISCOUNT_TYPE;
2
- (function (DISCOUNT_TYPE) {
3
- DISCOUNT_TYPE["NO_DISCOUNT"] = "noDiscount";
4
- DISCOUNT_TYPE["PERCENT"] = "percent";
5
- DISCOUNT_TYPE["FLAT"] = "flat";
6
- })(DISCOUNT_TYPE || (DISCOUNT_TYPE = {}));