@tap-payments/os-micro-frontend-shared 0.1.226-test.1 → 0.1.227

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 (113) hide show
  1. package/build/components/AccordionAdapter/style.d.ts +2 -2
  2. package/build/components/AccountDropdown/style.d.ts +1 -1
  3. package/build/components/ActionMenu/style.d.ts +1 -1
  4. package/build/components/ActivityAreaChart/styles.d.ts +3 -3
  5. package/build/components/AppServices/style.d.ts +1 -1
  6. package/build/components/AppWindowWrapper/AppWindow/style.d.ts +2 -2
  7. package/build/components/Autocomplete/Autocomplete.d.ts +10 -0
  8. package/build/components/Autocomplete/Autocomplete.js +33 -0
  9. package/build/components/Autocomplete/index.d.ts +2 -0
  10. package/build/components/Autocomplete/index.js +1 -0
  11. package/build/components/Autocomplete/style.d.ts +4 -0
  12. package/build/components/Autocomplete/style.js +47 -0
  13. package/build/components/Button/style.d.ts +1 -1
  14. package/build/components/Calender/style.d.ts +4 -4
  15. package/build/components/Chip/style.d.ts +7 -6
  16. package/build/components/CircularProgressWithLabel/style.d.ts +1 -1
  17. package/build/components/ColorPicker/style.d.ts +3 -3
  18. package/build/components/ConfirmDialog/styles.d.ts +1 -1
  19. package/build/components/CountBadge/style.d.ts +7 -6
  20. package/build/components/Dialog/style.d.ts +7 -6
  21. package/build/components/DockButton/style.d.ts +1 -1
  22. package/build/components/DropdownButton/constants.d.ts +2 -2
  23. package/build/components/DropdownButton/style.d.ts +2 -2
  24. package/build/components/DropdownMenu/styles.d.ts +2 -2
  25. package/build/components/ErrorBoundary/style.d.ts +1 -1
  26. package/build/components/ErrorToast/style.d.ts +1 -1
  27. package/build/components/FileUpload/style.d.ts +3 -3
  28. package/build/components/FileUploader/style.d.ts +1 -1
  29. package/build/components/FlippingCard/style.d.ts +7 -6
  30. package/build/components/IconWithLabel/style.d.ts +1 -1
  31. package/build/components/IconsDropdown/style.d.ts +2 -2
  32. package/build/components/ImageWrapper/ImageWrapper.d.ts +7 -6
  33. package/build/components/InputBase/SelectBase/style.d.ts +1 -1
  34. package/build/components/Inputs/FileInput/style.d.ts +1 -1
  35. package/build/components/JSONViewer/style.d.ts +14 -13
  36. package/build/components/LabeledIconDropdown/style.d.ts +3 -3
  37. package/build/components/LeftPeekRightExpandingChip/style.d.ts +19 -18
  38. package/build/components/MultiSelectStatusButton/style.d.ts +1 -1
  39. package/build/components/MultiSelectWithSearch/style.d.ts +3 -3
  40. package/build/components/NestedDropdown/styles.d.ts +1 -1
  41. package/build/components/ProgressBar/style.d.ts +1 -1
  42. package/build/components/ProgressRing/style.d.ts +2 -2
  43. package/build/components/RFH/Inputs/SelectWithAccordion/style.d.ts +3 -3
  44. package/build/components/RangeCalender/components/QuickFilters/style.d.ts +1 -1
  45. package/build/components/RangeCalender/components/RangeDatepicker/style.d.ts +1 -1
  46. package/build/components/RangeCalender/style.d.ts +3 -3
  47. package/build/components/RightLeftExpandingCenterChip/style.d.ts +79 -78
  48. package/build/components/SearchButton/styles.d.ts +18 -17
  49. package/build/components/SelectDropdown/style.d.ts +1 -1
  50. package/build/components/SelectWithSearch/style.d.ts +3 -3
  51. package/build/components/StatusButton/style.d.ts +2 -2
  52. package/build/components/StatusIcons/AuthIcons/style.d.ts +13 -12
  53. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +7 -6
  54. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +37 -36
  55. package/build/components/StatusIcons/SourceIcons/style.d.ts +7 -6
  56. package/build/components/StatusLabel/style.d.ts +1 -1
  57. package/build/components/TableCells/CustomCells/ActionCell/hooks/useActionCell.d.ts +1 -1
  58. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +9 -8
  59. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +7 -6
  60. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +13 -12
  61. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +31 -30
  62. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +31 -30
  63. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +7 -6
  64. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +7 -6
  65. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +7 -6
  66. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +31 -30
  67. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +7 -6
  68. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +13 -12
  69. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +7 -6
  70. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +7 -6
  71. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +31 -30
  72. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +7 -6
  73. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +7 -6
  74. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +13 -12
  75. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +7 -6
  76. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +7 -6
  77. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +7 -6
  78. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +7 -6
  79. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +38 -37
  80. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +31 -30
  81. package/build/components/TableCells/CustomCells/style.d.ts +8 -7
  82. package/build/components/TableHeader/style.d.ts +1 -1
  83. package/build/components/Timepicker/style.d.ts +2 -2
  84. package/build/components/ToolbarIcon/ExpandButton/style.d.ts +1 -1
  85. package/build/components/VirtualTables/SheetViewVirtualTable/style.d.ts +2 -2
  86. package/build/components/VirtualTables/components/ColumnFilter/Inputs/style.d.ts +1 -1
  87. package/build/components/VirtualTables/components/ColumnFilter/style.d.ts +2 -2
  88. package/build/components/VirtualTables/components/ErrorList/styles.d.ts +1 -1
  89. package/build/components/VirtualTables/components/TableFooter/style.d.ts +2 -2
  90. package/build/components/VirtualTables/components/TableHeader/style.d.ts +2 -2
  91. package/build/components/VirtualTables/components/style.d.ts +9 -8
  92. package/build/components/Widget/style.d.ts +1 -1
  93. package/build/components/Window/style.d.ts +12 -12
  94. package/build/components/WindowAppIcon/style.d.ts +1 -1
  95. package/build/constants/apps.d.ts +0 -1
  96. package/build/constants/apps.js +0 -1
  97. package/build/hooks/index.d.ts +0 -3
  98. package/build/hooks/index.js +0 -3
  99. package/build/types/apps.d.ts +15 -20
  100. package/build/types/index.d.ts +1 -1
  101. package/build/types/index.js +1 -1
  102. package/build/types/tsUtils.d.ts +4 -0
  103. package/build/utils/table.d.ts +1 -12
  104. package/build/utils/table.js +1 -147
  105. package/package.json +3 -3
  106. package/build/hooks/useAppEventListener.d.ts +0 -2
  107. package/build/hooks/useAppEventListener.js +0 -13
  108. package/build/hooks/useAppEventPublisher.d.ts +0 -2
  109. package/build/hooks/useAppEventPublisher.js +0 -7
  110. package/build/hooks/useAppsInfo.d.ts +0 -17
  111. package/build/hooks/useAppsInfo.js +0 -21
  112. package/build/types/appEvents.d.ts +0 -30
  113. /package/build/types/{appEvents.js → tsUtils.js} +0 -0
@@ -1,11 +1,11 @@
1
1
  import { ColumnsView } from './column';
2
- import { SegmentCountry, SelectedBrand, SelectedCountry, TextAndLang } from './user';
2
+ import { Segment, SegmentCountry, TextAndLang } from './user';
3
3
  import { BusinessMerchant } from './merchant';
4
4
  import type { i18n } from 'i18next';
5
+ import type { DragControls } from 'framer-motion';
5
6
  import { Theme } from '@mui/material';
6
7
  import { CalenderMode } from './theme';
7
8
  import { Timezone } from './appConfig';
8
- import { Brand, Entity, TableMode } from './index.js';
9
9
  export interface AccountAppPayload {
10
10
  disabledAccountDataFetching?: boolean;
11
11
  isAccountDetailsOpen: boolean;
@@ -73,13 +73,12 @@ export type NavigateFunction = (params: {
73
73
  appId?: string;
74
74
  appCode: string;
75
75
  serviceCode: string;
76
- sandboxMode?: boolean;
77
76
  state?: any;
78
77
  }) => void;
79
78
  export type MFWidgetBaseProps = {
80
79
  instanceId: string;
81
80
  i18n?: i18n;
82
- app: UserApp;
81
+ app?: UserApp;
83
82
  appWindow: {
84
83
  isMinimized: boolean;
85
84
  isMaximized: boolean;
@@ -87,33 +86,29 @@ export type MFWidgetBaseProps = {
87
86
  dimensions: Pick<AppDetails['dimensions'], 'width' | 'height'>;
88
87
  };
89
88
  features: {
90
- calendarMode: CalenderMode;
91
- tableMode: TableMode;
92
89
  hasReportsApp: boolean;
93
90
  hasHeader: boolean;
94
91
  sandboxMode: boolean;
95
92
  initialServiceCode?: string;
96
- initialPayload?: Record<string, any> & AppPayload;
97
93
  };
98
- segment: {
99
- brands: Brand[];
100
- countries: SegmentCountry[];
101
- defaultCountry: SegmentCountry;
102
- defaultEntity: Entity;
103
- apps: UserApp[];
104
- isBusinessSegment: boolean;
105
- isAnyMerchantHasMarketplace: boolean;
106
- };
107
- activeSegment: {
108
- id: string;
109
- brands: SelectedBrand[];
110
- countries: SelectedCountry[];
94
+ segment: Pick<Segment, 'id' | 'brands' | 'countries'> & {
95
+ defaultCountry?: SegmentCountry;
111
96
  };
112
97
  ui: {
113
98
  theme: Theme;
99
+ onStartDrag: DragControls['start'];
100
+ };
101
+ calendar: {
102
+ mode: CalenderMode;
103
+ onSwitch: (mode: CalenderMode) => void;
104
+ };
105
+ navigation: {
106
+ navigate: NavigateFunction;
114
107
  };
115
108
  timezone: {
116
109
  current?: Timezone | null;
117
110
  default?: Timezone;
111
+ onChange: (timezone: Timezone) => void;
112
+ onChangeHistory: (timezone: Timezone) => void;
118
113
  };
119
114
  };
@@ -23,4 +23,4 @@ export * from './refund';
23
23
  export * from './destination';
24
24
  export * from './account';
25
25
  export * from './day';
26
- export * from './appEvents';
26
+ export * from './tsUtils';
@@ -23,4 +23,4 @@ export * from './refund';
23
23
  export * from './destination';
24
24
  export * from './account';
25
25
  export * from './day';
26
- export * from './appEvents';
26
+ export * from './tsUtils';
@@ -0,0 +1,4 @@
1
+ export type Override<T, R> = Omit<T, keyof R> & R;
2
+ export type MakeOptional<T, K extends keyof T> = Override<T, {
3
+ [P in K]?: T[K];
4
+ }>;
@@ -1,4 +1,4 @@
1
- import { TableCellWidthProps, TableMode, TableNavigation } from '../types/index.js';
1
+ import { TableCellWidthProps, TableMode } from '../types/index.js';
2
2
  export declare const getColumnWidthPercentage: (widthInPx: number, options?: {
3
3
  isFirst?: boolean;
4
4
  isLast?: boolean;
@@ -9,14 +9,3 @@ export declare const isHeightNotFullyFilledByRows: (totalRows: number) => boolea
9
9
  export declare const isTableDefaultMode: (tableMode: TableMode) => boolean;
10
10
  export declare const isTableSheetMode: (tableMode: TableMode) => boolean;
11
11
  export declare const isTableTextMode: (tableMode: TableMode) => boolean;
12
- interface NavigationMap<T> {
13
- prefixes: string[];
14
- keys?: string[];
15
- label: string;
16
- appCode: string;
17
- serviceCode: string;
18
- icon: TableNavigation['icon'];
19
- accessor?: (rowData: T) => string[];
20
- }
21
- export declare const getPossibleNavigationTablesMap: <T>() => Record<string, NavigationMap<T>>;
22
- export {};
@@ -1,4 +1,4 @@
1
- import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, terminalsTableCellWidth, APP_CODES, } from '../constants/index.js';
1
+ import { walletDetailsTableCellWidth, authenticationsTableCellWidth, authorizationTableCellWidth, chargeTableCellWidth, destinationsTableCellWidth, intentsTableCellWidth, invoicesTableCellWidth, leadsTableCellWidth, ordersTableCellWidth, payoutsTableCellWidth, protectChargesTableCellWidth, protectAuthorizationsTableCellWidth, refundTableCellWidth, tokensTableCellWidth, walletStatementTableCellWidth, topupsTableCellWidth, walletTableCellWidth, TABLE_CONTENT_ROW_HEIGHT, TABLE_LOADING_ROW_HEIGHT, TABLE_ROW_HEIGHT, merchantsTableCellWidth, terminalsTableCellWidth, } from '../constants/index.js';
2
2
  export const getColumnWidthPercentage = (widthInPx, options) => {
3
3
  const { isFirst, isLast } = options || {};
4
4
  const paddingInPx = isFirst || isLast ? 0 : 0;
@@ -82,149 +82,3 @@ export const isTableSheetMode = (tableMode) => {
82
82
  export const isTableTextMode = (tableMode) => {
83
83
  return tableMode === 'text';
84
84
  };
85
- export const getPossibleNavigationTablesMap = () => {
86
- return {
87
- charge: {
88
- prefixes: ['chg_', 'payout_', 'settlement_', 'terminal_'],
89
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
90
- accessor: (rowData) => {
91
- var _a, _b, _c, _d;
92
- return [
93
- rowData.id,
94
- (_b = (_a = rowData.capture) === null || _a === void 0 ? void 0 : _a.charge) === null || _b === void 0 ? void 0 : _b.map((charge) => charge.id),
95
- (_c = rowData.charge) === null || _c === void 0 ? void 0 : _c.id,
96
- (_d = rowData.transactions) === null || _d === void 0 ? void 0 : _d.map((transaction) => transaction.id),
97
- rowData.charge_id,
98
- ];
99
- },
100
- label: 'Charge',
101
- appCode: APP_CODES.acceptance.code,
102
- serviceCode: APP_CODES.acceptance.services.charges.code,
103
- icon: 'capture',
104
- },
105
- authorize: {
106
- prefixes: ['auth_'],
107
- keys: ['id', 'authorize.id', 'source.id'],
108
- label: 'Authorization',
109
- appCode: APP_CODES.acceptance.code,
110
- serviceCode: APP_CODES.acceptance.services.authorization.code,
111
- icon: 'capture',
112
- },
113
- intents: {
114
- prefixes: ['intent_'],
115
- keys: [],
116
- label: 'Intents',
117
- appCode: APP_CODES.acceptance.code,
118
- serviceCode: APP_CODES.acceptance.services.intents.code,
119
- icon: 'capture',
120
- },
121
- refunds: {
122
- prefixes: ['re_', 'payout_'],
123
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
124
- accessor: (rowData) => {
125
- var _a, _b, _c, _d;
126
- return [
127
- (_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.refunds) === null || _a === void 0 ? void 0 : _a.refund) === null || _b === void 0 ? void 0 : _b.map((refund) => refund.id),
128
- rowData === null || rowData === void 0 ? void 0 : rowData.id,
129
- ...(((_c = rowData === null || rowData === void 0 ? void 0 : rowData.refunds) === null || _c === void 0 ? void 0 : _c.length) ? [(_d = rowData === null || rowData === void 0 ? void 0 : rowData.refunds) === null || _d === void 0 ? void 0 : _d.map((refund) => refund.id)] : []),
130
- ];
131
- },
132
- label: 'Refunds',
133
- appCode: APP_CODES.acceptance.code,
134
- serviceCode: APP_CODES.acceptance.services.refunds.code,
135
- icon: 'refund',
136
- },
137
- authentication: {
138
- prefixes: ['auth_payer_'],
139
- keys: ['authentication.id'],
140
- label: 'Authentication',
141
- appCode: APP_CODES.authentication.code,
142
- serviceCode: APP_CODES.authentication.services.authentication.code,
143
- icon: 'capture',
144
- },
145
- order: {
146
- prefixes: ['order_', 'ord_'],
147
- keys: ['order.id'],
148
- label: 'Order',
149
- appCode: APP_CODES.order.code,
150
- serviceCode: APP_CODES.order.services.orders.code,
151
- icon: 'capture',
152
- },
153
- chargeFlags: {
154
- prefixes: ['flag_'],
155
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
156
- accessor: (rowData) => {
157
- var _a, _b;
158
- return (_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.flags) === null || _a === void 0 ? void 0 : _a.flag) === null || _b === void 0 ? void 0 : _b.map((flag) => flag.id);
159
- },
160
- label: 'Flags',
161
- appCode: APP_CODES.protect.code,
162
- serviceCode: APP_CODES.protect.services.chargesFlags.code,
163
- icon: 'flag',
164
- },
165
- authorizationFlags: {
166
- prefixes: ['flag_'],
167
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
168
- accessor: (rowData) => {
169
- var _a, _b;
170
- return (_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.flags) === null || _a === void 0 ? void 0 : _a.flag) === null || _b === void 0 ? void 0 : _b.map((flag) => flag.id);
171
- },
172
- label: 'Flags',
173
- appCode: APP_CODES.protect.code,
174
- serviceCode: APP_CODES.protect.services.authorizationsFlags.code,
175
- icon: 'flag',
176
- },
177
- token: {
178
- prefixes: ['tok_'],
179
- keys: ['source.id'],
180
- label: 'Token',
181
- appCode: APP_CODES.tokens.code,
182
- serviceCode: APP_CODES.tokens.services.tokens.code,
183
- icon: 'capture',
184
- },
185
- destination: {
186
- prefixes: ['trf_', 'payout_'],
187
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
- accessor: (rowData) => {
189
- var _a, _b;
190
- return [(_b = (_a = rowData === null || rowData === void 0 ? void 0 : rowData.destinations) === null || _a === void 0 ? void 0 : _a.destination) === null || _b === void 0 ? void 0 : _b.map((destination) => { var _a; return (_a = destination === null || destination === void 0 ? void 0 : destination.transfer) === null || _a === void 0 ? void 0 : _a.id; }), rowData === null || rowData === void 0 ? void 0 : rowData.id];
191
- },
192
- label: 'Destination',
193
- appCode: APP_CODES.acceptance.code,
194
- serviceCode: APP_CODES.acceptance.services.destinations.code,
195
- icon: 'destination',
196
- },
197
- payout: {
198
- prefixes: ['payout_'],
199
- keys: ['balance.payout.id'],
200
- label: 'Payout',
201
- appCode: APP_CODES.payouts.code,
202
- serviceCode: APP_CODES.payouts.services.payouts.code,
203
- icon: 'capture',
204
- },
205
- settlement: {
206
- prefixes: ['settlement_'],
207
- keys: ['settlement.id'],
208
- label: 'Settlement',
209
- appCode: APP_CODES.acceptance.code,
210
- serviceCode: APP_CODES.acceptance.services.settlements.code,
211
- icon: 'capture',
212
- },
213
- intent: {
214
- prefixes: ['intent_'],
215
- keys: ['intent.id'],
216
- label: 'Intent',
217
- appCode: APP_CODES.acceptance.code,
218
- serviceCode: APP_CODES.acceptance.services.intents.code,
219
- icon: 'capture',
220
- },
221
- topup: {
222
- prefixes: ['topup_'],
223
- keys: ['topup.id'],
224
- label: 'Topup',
225
- appCode: APP_CODES.acceptance.code,
226
- serviceCode: APP_CODES.acceptance.services.topups.code,
227
- icon: 'capture',
228
- },
229
- };
230
- };
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.226-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.227",
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,2 +0,0 @@
1
- import { CustomEventMap } from '../types';
2
- export declare function useAppEventListener<K extends keyof CustomEventMap>(eventName: K, handler: CustomEventMap[K]): void;
@@ -1,13 +0,0 @@
1
- import { useEffect } from 'react';
2
- export function useAppEventListener(eventName, handler) {
3
- useEffect(() => {
4
- const listener = (e) => {
5
- const customEvent = e;
6
- handler(...(customEvent.detail || []));
7
- };
8
- window.addEventListener(eventName, listener);
9
- return () => {
10
- window.removeEventListener(eventName, listener);
11
- };
12
- }, [eventName, handler]);
13
- }
@@ -1,2 +0,0 @@
1
- import { CustomEventMap } from '../types';
2
- export declare function useAppEventPublisher<K extends keyof CustomEventMap>(eventName: K): (...args: Parameters<CustomEventMap[K]>) => void;
@@ -1,7 +0,0 @@
1
- import { useCallback } from 'react';
2
- export function useAppEventPublisher(eventName) {
3
- return useCallback((...args) => {
4
- const event = new CustomEvent(eventName, { detail: args });
5
- window.dispatchEvent(event);
6
- }, [eventName]);
7
- }
@@ -1,17 +0,0 @@
1
- import { AppService, UserApp } from '../types/index.js';
2
- interface GetService {
3
- appCode: string;
4
- serviceCode: string;
5
- }
6
- interface GetFunction {
7
- appCode: string;
8
- serviceCode: string;
9
- functionCode: string;
10
- }
11
- export declare const useAppsInfo: (segmentApps: UserApp[]) => {
12
- getAppInfo: (appCode: string) => UserApp | undefined;
13
- getServiceInfo: ({ appCode, serviceCode }: GetService) => AppService | undefined;
14
- getServiceFunctions: ({ appCode, serviceCode }: GetService) => import("../types/index.js").ServiceFunction[];
15
- getFunctionInfo: ({ appCode, serviceCode, functionCode }: GetFunction) => import("../types/index.js").ServiceFunction | undefined;
16
- };
17
- export {};
@@ -1,21 +0,0 @@
1
- import { useCallback } from 'react';
2
- export const useAppsInfo = (segmentApps) => {
3
- const getAppInfo = useCallback((appCode) => segmentApps.find((app) => app.code.toLowerCase() === appCode.toLowerCase()), [segmentApps]);
4
- const getServiceInfo = useCallback(({ appCode, serviceCode }) => {
5
- var _a;
6
- return (_a = getAppInfo(appCode)) === null || _a === void 0 ? void 0 : _a.app_services.find(({ code }) => code.toLowerCase() === serviceCode.toLowerCase());
7
- }, [getAppInfo]);
8
- const getServiceFunctions = useCallback(({ appCode, serviceCode }) => {
9
- var _a, _b;
10
- return (_b = (_a = getServiceInfo({ appCode, serviceCode })) === null || _a === void 0 ? void 0 : _a.functions) !== null && _b !== void 0 ? _b : [];
11
- }, [getServiceInfo]);
12
- const getFunctionInfo = useCallback(({ appCode, serviceCode, functionCode }) => {
13
- return getServiceFunctions({ appCode, serviceCode }).find(({ code }) => code.toLowerCase() === functionCode.toLowerCase());
14
- }, [getServiceFunctions]);
15
- return {
16
- getAppInfo,
17
- getServiceInfo,
18
- getServiceFunctions,
19
- getFunctionInfo,
20
- };
21
- };
@@ -1,30 +0,0 @@
1
- import { CalenderMode, NavigateFunction, TableMode, Timezone } from './index.js';
2
- import { DragControls } from 'framer-motion';
3
- export type CustomEventMap = {
4
- 'on-click-table-action': (params: {
5
- targetApp: {
6
- appCode: string;
7
- serviceCode: string;
8
- sandboxMode?: boolean;
9
- payload?: object;
10
- };
11
- }) => void;
12
- 'on-right-click-table-action': (params: {
13
- targetApp: {
14
- appCode: string;
15
- serviceCode: string;
16
- sandboxMode?: boolean;
17
- payload?: object;
18
- };
19
- }) => void;
20
- 'modify-remote-payload': (params: {
21
- instanceId: string;
22
- payload: object;
23
- }) => void;
24
- 'on-toggle-table-mode': () => void;
25
- 'on-change-table-mode': (tableMode: TableMode) => void;
26
- 'on-change-calender-mode': (calenderMode: CalenderMode) => void;
27
- 'on-change-timezone': (timezone: Timezone) => void;
28
- 'on-navigate': NavigateFunction;
29
- 'on-start-drag': (...args: Parameters<DragControls['start']>) => void;
30
- };
File without changes