react-native-unit-components 2.0.2 → 2.1.0
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/android/build.gradle +0 -4
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +2 -0
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +3 -3
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +29 -2
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +3 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +7 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +2 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCreateCardComponent/UNCreateCardComponent.js +84 -0
- package/lib/commonjs/components/UNCreateCardComponent/UNCreateCardComponent.js.map +1 -0
- package/lib/commonjs/components/UNCreateCardComponent/UNCreateCardComponent.utils.js +19 -0
- package/lib/commonjs/components/UNCreateCardComponent/UNCreateCardComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNCreateCardComponent/index.js +21 -0
- package/lib/commonjs/components/UNCreateCardComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +39 -8
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -1
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +18 -3
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js +2 -2
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/messages/webMessages/cardMessage.js +1 -0
- package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js +1 -0
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/onLoadMessage.js +1 -0
- package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +76 -48
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/slices/SharedEventsSlice.js.map +1 -1
- package/lib/commonjs/types/internal/bottomSheet.types.js +1 -0
- package/lib/commonjs/types/internal/bottomSheet.types.js.map +1 -1
- package/lib/commonjs/types/internal/webComponent.types.js +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js.map +1 -1
- package/lib/commonjs/types/shared/account.types.js +6 -1
- package/lib/commonjs/types/shared/account.types.js.map +1 -1
- package/lib/commonjs/types/shared/createCard.types.js +21 -0
- package/lib/commonjs/types/shared/createCard.types.js.map +1 -0
- package/lib/commonjs/types/shared/customer.types.js +5 -5
- package/lib/commonjs/types/shared/customer.types.js.map +1 -1
- package/lib/commonjs/types/shared/index.js +11 -0
- package/lib/commonjs/types/shared/index.js.map +1 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdk.constants.js +1 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/commonjs/webComponent/html.js +8 -0
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +2 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +2 -2
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +30 -3
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +3 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +7 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +2 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCreateCardComponent/UNCreateCardComponent.js +76 -0
- package/lib/module/components/UNCreateCardComponent/UNCreateCardComponent.js.map +1 -0
- package/lib/module/components/UNCreateCardComponent/UNCreateCardComponent.utils.js +12 -0
- package/lib/module/components/UNCreateCardComponent/UNCreateCardComponent.utils.js.map +1 -0
- package/lib/module/components/UNCreateCardComponent/index.js +2 -0
- package/lib/module/components/UNCreateCardComponent/index.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +40 -9
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -1
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +14 -2
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.js +2 -2
- package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/messages/webMessages/cardMessage.js +1 -0
- package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/webMessages/multipleCardsMessage.js +1 -0
- package/lib/module/messages/webMessages/multipleCardsMessage.js.map +1 -1
- package/lib/module/messages/webMessages/onLoadMessage.js +1 -0
- package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +75 -47
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/slices/SharedEventsSlice.js.map +1 -1
- package/lib/module/types/internal/bottomSheet.types.js +1 -0
- package/lib/module/types/internal/bottomSheet.types.js.map +1 -1
- package/lib/module/types/internal/webComponent.types.js +1 -0
- package/lib/module/types/internal/webComponent.types.js.map +1 -1
- package/lib/module/types/shared/account.types.js +5 -0
- package/lib/module/types/shared/account.types.js.map +1 -1
- package/lib/module/types/shared/createCard.types.js +14 -0
- package/lib/module/types/shared/createCard.types.js.map +1 -0
- package/lib/module/types/shared/customer.types.js +4 -4
- package/lib/module/types/shared/customer.types.js.map +1 -1
- package/lib/module/types/shared/index.js +1 -0
- package/lib/module/types/shared/index.js.map +1 -1
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdk.constants.js +1 -1
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/module/webComponent/html.js +9 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNAccountComponent/UNAccountComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNAccountComponent/UNAccountComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNAccountComponent/UNAccountComponent.utils.d.ts +1 -1
- package/lib/typescript/src/components/UNAccountComponent/UNAccountComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.utils.d.ts +1 -1
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +2 -2
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCardComponent/UNCardComponent.d.ts +2 -0
- package/lib/typescript/src/components/UNCardComponent/UNCardComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCardComponent/UNCardComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCreateCardComponent/UNCreateCardComponent.d.ts +16 -0
- package/lib/typescript/src/components/UNCreateCardComponent/UNCreateCardComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/UNCreateCardComponent/UNCreateCardComponent.utils.d.ts +3 -0
- package/lib/typescript/src/components/UNCreateCardComponent/UNCreateCardComponent.utils.d.ts.map +1 -0
- package/lib/typescript/src/components/UNCreateCardComponent/index.d.ts +2 -0
- package/lib/typescript/src/components/UNCreateCardComponent/index.d.ts.map +1 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts +5 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/messages/webMessages/cardMessage.d.ts +4 -2
- package/lib/typescript/src/messages/webMessages/cardMessage.d.ts.map +1 -1
- package/lib/typescript/src/messages/webMessages/multipleCardsMessage.d.ts +4 -2
- package/lib/typescript/src/messages/webMessages/multipleCardsMessage.d.ts.map +1 -1
- package/lib/typescript/src/messages/webMessages/onLoadMessage.d.ts +7 -3
- package/lib/typescript/src/messages/webMessages/onLoadMessage.d.ts.map +1 -1
- package/lib/typescript/src/scripts/html/bodyScript.d.ts +6 -2
- package/lib/typescript/src/scripts/html/bodyScript.d.ts.map +1 -1
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts +11 -3
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts.map +1 -1
- package/lib/typescript/src/store/store.d.ts +14 -2
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/types/internal/bottomSheet.types.d.ts +8 -2
- package/lib/typescript/src/types/internal/bottomSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/types/internal/webComponent.types.d.ts +1 -0
- package/lib/typescript/src/types/internal/webComponent.types.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/account.types.d.ts +4 -0
- package/lib/typescript/src/types/shared/account.types.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/createCard.types.d.ts +166 -0
- package/lib/typescript/src/types/shared/createCard.types.d.ts.map +1 -0
- package/lib/typescript/src/types/shared/customer.types.d.ts +3 -3
- package/lib/typescript/src/types/shared/customer.types.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/index.d.ts +1 -0
- package/lib/typescript/src/types/shared/index.d.ts.map +1 -1
- package/lib/typescript/src/webComponent/html.d.ts.map +1 -1
- package/lib/typescript/tests/e2e/app-tests.d.ts +2 -0
- package/lib/typescript/tests/e2e/app-tests.d.ts.map +1 -0
- package/lib/typescript/tests/e2e/component-tests.d.ts +2 -0
- package/lib/typescript/tests/e2e/component-tests.d.ts.map +1 -0
- package/lib/typescript/tests/e2e/main.test.d.ts +2 -0
- package/lib/typescript/tests/e2e/main.test.d.ts.map +1 -0
- package/lib/typescript/tests/utils.d.ts +3 -0
- package/lib/typescript/tests/utils.d.ts.map +1 -0
- package/package.json +9 -4
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +2 -1
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -0
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +2 -1
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -0
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +3 -2
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -1
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +2 -2
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +1 -1
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +32 -1
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.tsx +7 -0
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx +7 -0
- package/src/components/UNCardComponent/UNCardComponent.tsx +2 -0
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +4 -1
- package/src/components/UNCreateCardComponent/UNCreateCardComponent.tsx +94 -0
- package/src/components/UNCreateCardComponent/UNCreateCardComponent.utils.ts +14 -0
- package/src/components/UNCreateCardComponent/index.ts +1 -0
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.tsx +44 -9
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.ts +17 -2
- package/src/components/index.ts +1 -0
- package/src/helpers/BottomSheet/BottomSheet.tsx +2 -2
- package/src/messages/webMessages/cardMessage.ts +6 -1
- package/src/messages/webMessages/multipleCardsMessage.ts +3 -1
- package/src/messages/webMessages/onLoadMessage.ts +9 -2
- package/src/scripts/html/bodyScript.ts +77 -48
- package/src/slices/SharedEventsSlice.ts +15 -3
- package/src/types/internal/bottomSheet.types.ts +9 -1
- package/src/types/internal/webComponent.types.ts +1 -0
- package/src/types/shared/account.types.ts +5 -0
- package/src/types/shared/createCard.types.ts +187 -0
- package/src/types/shared/customer.types.ts +3 -3
- package/src/types/shared/index.ts +1 -0
- package/src/unitComponentsSdkManager/UnitComponentsSdk.constants.ts +1 -1
- package/src/unitComponentsSdkManager/UnitComponentsSdkManager.ts +1 -1
- package/src/webComponent/html.ts +11 -1
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
BottomSheetNativeBookPaymentComponentType,
|
|
10
10
|
BottomSheetNativeCheckDepositComponentType,
|
|
11
11
|
BottomSheetNativeComponentType,
|
|
12
|
+
BottomSheetNativeCreateCardComponentType,
|
|
12
13
|
BottomSheetNativePlaceType,
|
|
13
14
|
BottomSheetNativeWirePaymentComponentType,
|
|
14
15
|
BottomSheetSlotData,
|
|
15
16
|
} from '../../types/internal/bottomSheet.types';
|
|
16
17
|
import { WebComponentType } from '../../types/internal/webComponent.types';
|
|
17
|
-
import { parseUNAccountFilters } from '../../types/shared';
|
|
18
|
+
import { parseUNAccountFilters, parseUNCreateCardTypes } from '../../types/shared';
|
|
18
19
|
|
|
19
20
|
export const getBottomSheetScript = () => {
|
|
20
21
|
return LISTENERS.requestRefresh;
|
|
@@ -95,6 +96,7 @@ const getACHCreditComponentDataFromEvent = (event: BottomSheetSlotData): BottomS
|
|
|
95
96
|
const plaidLinkCustomizationName = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'plaid-link-customization-name');
|
|
96
97
|
const isAutoFocus = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'is-auto-focus');
|
|
97
98
|
const sameDay = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'same-day');
|
|
99
|
+
const showSameDaySelection = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'show-same-day-selection');
|
|
98
100
|
const plaidAccountFiltersAsString = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'plaid-account-filters');
|
|
99
101
|
const plaidAccountFiltersArray = parseUNAccountFilters(plaidAccountFiltersAsString);
|
|
100
102
|
|
|
@@ -112,6 +114,7 @@ const getACHCreditComponentDataFromEvent = (event: BottomSheetSlotData): BottomS
|
|
|
112
114
|
plaidLinkCustomizationName: plaidLinkCustomizationName,
|
|
113
115
|
isAutoFocus: isAutoFocus ? isAutoFocus === 'true' : undefined,
|
|
114
116
|
sameDay: sameDay ? sameDay === 'true' : undefined,
|
|
117
|
+
showSameDaySelection: showSameDaySelection ? showSameDaySelection === 'true' : undefined
|
|
115
118
|
},
|
|
116
119
|
};
|
|
117
120
|
};
|
|
@@ -126,6 +129,7 @@ const getACHDebitComponentDataFromEvent = (event: BottomSheetSlotData): BottomSh
|
|
|
126
129
|
const plaidLinkCustomizationName = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'plaid-link-customization-name');
|
|
127
130
|
const isAutoFocus = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'is-auto-focus');
|
|
128
131
|
const sameDay = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'same-day');
|
|
132
|
+
const showSameDaySelection = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'show-same-day-selection');
|
|
129
133
|
const plaidAccountFiltersAsString = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'plaid-account-filters');
|
|
130
134
|
const plaidAccountFiltersArray = parseUNAccountFilters(plaidAccountFiltersAsString);
|
|
131
135
|
|
|
@@ -142,6 +146,7 @@ const getACHDebitComponentDataFromEvent = (event: BottomSheetSlotData): BottomSh
|
|
|
142
146
|
plaidLinkCustomizationName: plaidLinkCustomizationName,
|
|
143
147
|
isAutoFocus: isAutoFocus ? isAutoFocus === 'true' : undefined,
|
|
144
148
|
sameDay: sameDay ? sameDay === 'true' : undefined,
|
|
149
|
+
showSameDaySelection: showSameDaySelection ? showSameDaySelection === 'true' : undefined
|
|
145
150
|
},
|
|
146
151
|
};
|
|
147
152
|
};
|
|
@@ -224,6 +229,28 @@ const getWirePaymentComponentDataFromEvent = (event: BottomSheetSlotData): Botto
|
|
|
224
229
|
};
|
|
225
230
|
};
|
|
226
231
|
|
|
232
|
+
const getCreateCardComponentDataFromEvent = (event: BottomSheetSlotData): BottomSheetNativeCreateCardComponentType | null => {
|
|
233
|
+
const accountId = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'account-id');
|
|
234
|
+
const theme = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'theme');
|
|
235
|
+
const language = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'language');
|
|
236
|
+
const virtualCardFee = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'virtual-card-fee');
|
|
237
|
+
const physicalCardFee = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'physical-card-fee');
|
|
238
|
+
const cardTypesAsString = extractValueFromRequestRenderingEvent(event.requestRenderingEvent, 'card-types');
|
|
239
|
+
const cardTypes = parseUNCreateCardTypes(cardTypesAsString);
|
|
240
|
+
|
|
241
|
+
return {
|
|
242
|
+
type: BottomSheetNativeComponentType.CreateCardComponent,
|
|
243
|
+
props: {
|
|
244
|
+
accountId: accountId,
|
|
245
|
+
theme: theme,
|
|
246
|
+
language: language,
|
|
247
|
+
cardTypes: cardTypes,
|
|
248
|
+
physicalCardFee: physicalCardFee ? parseInt(physicalCardFee) : undefined,
|
|
249
|
+
virtualCardFee: virtualCardFee ? parseInt(virtualCardFee) : undefined,
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
|
|
227
254
|
export const getNativeComponentDataFromEvent = (event: BottomSheetSlotData) => {
|
|
228
255
|
let componentData = null;
|
|
229
256
|
let nativePlace = BottomSheetNativePlaceType.modal;
|
|
@@ -262,6 +289,10 @@ export const getNativeComponentDataFromEvent = (event: BottomSheetSlotData) => {
|
|
|
262
289
|
componentData = getWirePaymentComponentDataFromEvent(event);
|
|
263
290
|
break;
|
|
264
291
|
|
|
292
|
+
case WebComponentType.createCard:
|
|
293
|
+
componentData = getCreateCardComponentDataFromEvent(event);
|
|
294
|
+
break;
|
|
295
|
+
|
|
265
296
|
default:
|
|
266
297
|
break;
|
|
267
298
|
}
|
|
@@ -13,6 +13,7 @@ import UNCheckDepositComponent from '../../../UNCheckDepositComponent/UNCheckDep
|
|
|
13
13
|
import UNACHDebitComponent from '../../../UNACHDebitComponent/UNACHDebitComponent';
|
|
14
14
|
import UNBookPaymentComponent from '../../../UNBookPaymentComponent/UNBookPaymentComponent';
|
|
15
15
|
import UNWirePaymentComponent from '../../../UNWirePaymentComponent/UNWirePaymentComponent';
|
|
16
|
+
import UNCreateCardComponent from '../../../UNCreateCardComponent/UNCreateCardComponent';
|
|
16
17
|
import { PageMessage } from '../../../../messages/webMessages/pageMessage';
|
|
17
18
|
import { useListenerToEvent } from '../../../../hooks/useListenerToEvent';
|
|
18
19
|
import UNKeyboardAvoidingView from '../../../../helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView';
|
|
@@ -115,6 +116,12 @@ const UNBottomSheetNativeComponent = (props: UNBottomSheetNativeComponentProps)
|
|
|
115
116
|
{...props.nativeComponentData.component.props}
|
|
116
117
|
/>
|
|
117
118
|
);
|
|
119
|
+
case BottomSheetNativeComponentType.CreateCardComponent:
|
|
120
|
+
return (
|
|
121
|
+
<UNCreateCardComponent
|
|
122
|
+
{...props.nativeComponentData.component.props}
|
|
123
|
+
/>
|
|
124
|
+
);
|
|
118
125
|
}
|
|
119
126
|
};
|
|
120
127
|
|
|
@@ -35,6 +35,7 @@ import { BottomSheetNativeMessage } from '../../../../messages/nativeMessages/bo
|
|
|
35
35
|
import { OpenPlaidEvent, PlaidMessage } from '../../../../messages/webMessages/plaidMessages';
|
|
36
36
|
import { PayeeCounterpartyEvent, PayeeManagementMessage } from '../../../../messages/webMessages/payeeManagementMessage';
|
|
37
37
|
import UNKeyboardAvoidingView from '../../../../helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView';
|
|
38
|
+
import { MultipleCardsFiltersChangedEvent, MultipleCardsMessage } from '../../../../messages/webMessages/multipleCardsMessage';
|
|
38
39
|
|
|
39
40
|
export interface UNBottomSheetSlotComponentProps {
|
|
40
41
|
requestRenderingEvent: RequestRenderingEvent;
|
|
@@ -161,6 +162,12 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
161
162
|
data: (message.details as ActivityFiltersChangedEvent),
|
|
162
163
|
}));
|
|
163
164
|
break;
|
|
165
|
+
case MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED:
|
|
166
|
+
dispatch(setEvent({
|
|
167
|
+
key: MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED,
|
|
168
|
+
data: (message.details as MultipleCardsFiltersChangedEvent),
|
|
169
|
+
}));
|
|
170
|
+
break;
|
|
164
171
|
case PayeeManagementMessage.UNIT_COUNTERPARTY_DELETED: {
|
|
165
172
|
dispatch(setEvent({
|
|
166
173
|
key: PayeeManagementMessage.UNIT_COUNTERPARTY_DELETED,
|
|
@@ -45,6 +45,8 @@ export interface UNCardComponentProps {
|
|
|
45
45
|
hideActionsMenuButton?: boolean;
|
|
46
46
|
hideCardTitle?: boolean;
|
|
47
47
|
hideSensitiveDataButton?: boolean;
|
|
48
|
+
showCardTypeSubtitle?: boolean;
|
|
49
|
+
showCardHolderSubtitle?: boolean;
|
|
48
50
|
|
|
49
51
|
// events
|
|
50
52
|
onLoad?: (response: UNComponentsOnLoadResponse<UNCard>) => void;
|
|
@@ -18,6 +18,8 @@ export const getCardParams = (props: UNCardComponentProps) => {
|
|
|
18
18
|
learn-more-url="${props.learnMoreUrl || ''}"
|
|
19
19
|
${feeParam}
|
|
20
20
|
${menuItemsParam}
|
|
21
|
+
show-card-type-subtitle="${props.showCardTypeSubtitle || false}"
|
|
22
|
+
show-card-holder-subtitle="${props.showCardHolderSubtitle || false}"
|
|
21
23
|
`;
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -40,8 +42,9 @@ export const injectRequestHideSensitiveDataScript = (currentWeb: WebView | null)
|
|
|
40
42
|
export const injectRequestShowSensitiveDataScript = (currentWeb: WebView | null) => {
|
|
41
43
|
currentWeb?.injectJavaScript(`dispatchRequestShowSensitiveData('${WebComponentType.card}')`);
|
|
42
44
|
};
|
|
45
|
+
|
|
43
46
|
export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {
|
|
44
47
|
if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {
|
|
45
48
|
currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
|
|
46
49
|
}
|
|
47
|
-
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { UNBaseView } from '../../nativeComponents/UNBaseView';
|
|
3
|
+
import { WebComponent } from '../../webComponent/WebComponent';
|
|
4
|
+
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
5
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
6
|
+
import { getCreateCardParams } from './UNCreateCardComponent.utils';
|
|
7
|
+
import type { WebViewMessage } from '../../messages/webMessages';
|
|
8
|
+
import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
|
|
9
|
+
import { UnitComponentsMessage } from '../../messages/webMessages/unitComponentsMessages';
|
|
10
|
+
import { UNCard, UNComponentsError, UNComponentsOnLoadResponse, UNComponentsOnLoadResponseData } from '../../types/shared';
|
|
11
|
+
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
12
|
+
import { UNCreateCardComponentResources, UNCreateCardType } from '../../types/shared/createCard.types';
|
|
13
|
+
import { CardCreatedEvent, CardMessage } from '../../messages/webMessages/cardMessage';
|
|
14
|
+
import { useDispatch } from 'react-redux';
|
|
15
|
+
import { setEvent } from '../../slices/SharedEventsSlice';
|
|
16
|
+
|
|
17
|
+
export interface UNCreateCardComponentProps {
|
|
18
|
+
// inputs
|
|
19
|
+
accountId?: string;
|
|
20
|
+
cardTypes: UNCreateCardType[];
|
|
21
|
+
virtualCardFee?: number;
|
|
22
|
+
physicalCardFee?: number;
|
|
23
|
+
|
|
24
|
+
// ui
|
|
25
|
+
theme?: string;
|
|
26
|
+
language?: string;
|
|
27
|
+
|
|
28
|
+
// callbacks
|
|
29
|
+
onLoad?: (response: UNComponentsOnLoadResponse<UNCreateCardComponentResources>) => void
|
|
30
|
+
onCardCreated?: (cardData: UNCard) => void
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const UNCreateCardComponent = (props: UNCreateCardComponentProps) => {
|
|
34
|
+
const dispatch = useDispatch();
|
|
35
|
+
const [height, setHeight] = useState<number>(0);
|
|
36
|
+
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
37
|
+
|
|
38
|
+
const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
|
|
39
|
+
if (!props.onLoad) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (RESPONSE_KEYS.errors in response) {
|
|
44
|
+
props.onLoad(response as UNComponentsError);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (RESPONSE_KEYS.createCardResult in response) {
|
|
48
|
+
const createCardResponse = response[RESPONSE_KEYS.createCardResult] as UNComponentsOnLoadResponseData<UNCreateCardComponentResources>;
|
|
49
|
+
props.onLoad(createCardResponse);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
console.error('On Load Error: unexpected response type.');
|
|
53
|
+
return;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const handleWebViewMessage = (message: WebViewMessage) => {
|
|
57
|
+
if (!message || !message.details) return;
|
|
58
|
+
|
|
59
|
+
switch (message.type) {
|
|
60
|
+
case UnitComponentsMessage.UNIT_ON_LOAD:
|
|
61
|
+
handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);
|
|
62
|
+
break;
|
|
63
|
+
case PageMessage.PAGE_HEIGHT: {
|
|
64
|
+
const currentHeight = (message.details as HeightEvent).height;
|
|
65
|
+
setHeight(currentHeight);
|
|
66
|
+
if (presentationMode === PresentationMode.Inherit && currentHeight === 0) {
|
|
67
|
+
setPresentationMode(PresentationMode.Default);
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case CardMessage.CARD_CREATED:
|
|
72
|
+
dispatch(setEvent({
|
|
73
|
+
key: CardMessage.CARD_CREATED,
|
|
74
|
+
data: (message.details as CardCreatedEvent),
|
|
75
|
+
}));
|
|
76
|
+
props.onCardCreated && props.onCardCreated(message.details as UNCard);
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const style = presentationMode === PresentationMode.Inherit ? { flex: 1 } : { height: height };
|
|
82
|
+
return <UNBaseView style={style} onLoadError={handleUnitOnLoad} fallback={<></>}>
|
|
83
|
+
<WebComponent
|
|
84
|
+
type={WebComponentType.createCard}
|
|
85
|
+
presentationMode={PresentationMode.Inherit}
|
|
86
|
+
params={getCreateCardParams(props)}
|
|
87
|
+
onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
|
|
88
|
+
theme={props.theme}
|
|
89
|
+
language={props.language}
|
|
90
|
+
/>
|
|
91
|
+
</UNBaseView>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export default withReduxStore<UNCreateCardComponentProps>(UNCreateCardComponent);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UNCreateCardComponentProps } from "./UNCreateCardComponent";
|
|
2
|
+
|
|
3
|
+
export const getCreateCardParams = (props: UNCreateCardComponentProps) => {
|
|
4
|
+
const cardTypesParam = props.cardTypes ? `card-types="${props.cardTypes.join()}"` : '';
|
|
5
|
+
const physicalFeeParam = props.physicalCardFee ? `physical-card-fee="${props.physicalCardFee}"` : '';
|
|
6
|
+
const virtualFeeParam = props.virtualCardFee ? `virtual-card-fee="${props.virtualCardFee}"` : '';
|
|
7
|
+
|
|
8
|
+
return `
|
|
9
|
+
account-id="${props.accountId}"
|
|
10
|
+
${cardTypesParam}
|
|
11
|
+
${physicalFeeParam}
|
|
12
|
+
${virtualFeeParam}
|
|
13
|
+
`;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNCreateCardComponent, UNCreateCardComponentProps } from './UNCreateCardComponent';
|
|
@@ -8,8 +8,8 @@ import type WebView from 'react-native-webview';
|
|
|
8
8
|
|
|
9
9
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
10
10
|
import { withReduxStore } from '../../helpers/store/helpers';
|
|
11
|
-
import { getMultipleCardsParams, getMultipleCardsScript } from './UNMultipleCardsComponent.utils';
|
|
12
|
-
import { UnitComponentsMessage } from '../../messages/webMessages/unitComponentsMessages';
|
|
11
|
+
import { getMultipleCardsParams, getMultipleCardsScript, injectCardCreated, injectCardStatusChangedEvent, injectMultipleCardsFiltersChanged } from './UNMultipleCardsComponent.utils';
|
|
12
|
+
import { RequestRenderingEvent, UnitComponentsMessage } from '../../messages/webMessages/unitComponentsMessages';
|
|
13
13
|
import type { UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
14
14
|
import { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
|
|
15
15
|
import type {
|
|
@@ -24,6 +24,10 @@ import { MultipleCardsCardClickedEvent, MultipleCardsMessage } from '../../messa
|
|
|
24
24
|
import { UNBaseView } from '../../nativeComponents/UNBaseView';
|
|
25
25
|
import { useListenerToEvent } from '../../hooks/useListenerToEvent';
|
|
26
26
|
import { CardMessage } from '../../messages/webMessages/cardMessage';
|
|
27
|
+
import { BottomSheetRenderingType, BottomSheetSlotData, SlotRendering } from '../../types/internal/bottomSheet.types';
|
|
28
|
+
import { useDispatch } from 'react-redux';
|
|
29
|
+
import { setEvent } from '../../slices/SharedEventsSlice';
|
|
30
|
+
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
27
31
|
|
|
28
32
|
const DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;
|
|
29
33
|
|
|
@@ -32,6 +36,7 @@ export interface UNMultipleCardsComponentProps {
|
|
|
32
36
|
paginationType?: UNMultipleCardsComponentPaginationType;
|
|
33
37
|
cardsPerPage?: number;
|
|
34
38
|
disableCardClick?: boolean;
|
|
39
|
+
isRowItemClickable?: boolean;
|
|
35
40
|
theme?: string;
|
|
36
41
|
language?: string;
|
|
37
42
|
queryFilter?: string;
|
|
@@ -44,18 +49,34 @@ export interface UNMultipleCardsComponentProps {
|
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
52
|
+
const dispatch = useDispatch();
|
|
47
53
|
const webRef = useRef<WebView>(null);
|
|
48
54
|
const [defaultHeight, setDefaultHeight] = useState<number>();
|
|
49
55
|
|
|
50
|
-
const
|
|
51
|
-
webRef.current
|
|
56
|
+
const dispatchCardStatusChanged = (card: UNCard) => {
|
|
57
|
+
injectCardStatusChangedEvent(webRef.current, card);
|
|
52
58
|
};
|
|
53
59
|
|
|
54
|
-
const
|
|
55
|
-
|
|
60
|
+
const dispatchMultipleCardsFiltersChanged = (query: string) => {
|
|
61
|
+
injectMultipleCardsFiltersChanged(webRef.current, query);
|
|
56
62
|
};
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
const dispatchCardCreated = (card: string) => {
|
|
65
|
+
injectCardCreated(webRef.current, card);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
useListenerToEvent({
|
|
69
|
+
busEventKey: CardMessage.CARD_STATUS_CHANGED,
|
|
70
|
+
action: dispatchCardStatusChanged
|
|
71
|
+
});
|
|
72
|
+
useListenerToEvent({
|
|
73
|
+
busEventKey: MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED,
|
|
74
|
+
action: dispatchMultipleCardsFiltersChanged,
|
|
75
|
+
});
|
|
76
|
+
useListenerToEvent({
|
|
77
|
+
busEventKey: CardMessage.CARD_CREATED,
|
|
78
|
+
action: dispatchCardCreated,
|
|
79
|
+
});
|
|
59
80
|
|
|
60
81
|
const cardClicked = (card: UNCard) => {
|
|
61
82
|
if (props.onCardClicked) {
|
|
@@ -74,7 +95,6 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
|
74
95
|
}
|
|
75
96
|
|
|
76
97
|
if (RESPONSE_KEYS.cards in response) {
|
|
77
|
-
// MultipleCardsOnLoadResponse;
|
|
78
98
|
props.onLoad(response[RESPONSE_KEYS.cards] as UNComponentsOnLoadResponseData<UNMultipleCardsOnLoadData>);
|
|
79
99
|
return;
|
|
80
100
|
}
|
|
@@ -96,6 +116,21 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
|
96
116
|
}
|
|
97
117
|
case MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED: {
|
|
98
118
|
cardClicked(message.details as MultipleCardsCardClickedEvent);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case UnitComponentsMessage.UNIT_REQUEST_RENDERING: {
|
|
122
|
+
const slotData: BottomSheetSlotData = {
|
|
123
|
+
componentName: WebComponentType.multipleCards,
|
|
124
|
+
componentResourceId: undefined,
|
|
125
|
+
requestRenderingEvent: message.details as RequestRenderingEvent,
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const data = {
|
|
129
|
+
type: BottomSheetRenderingType.Slot,
|
|
130
|
+
data: slotData,
|
|
131
|
+
} as SlotRendering;
|
|
132
|
+
dispatch(setEvent({ key: BottomSheetNativeMessage.REQUEST_RENDERING, data }));
|
|
133
|
+
break;
|
|
99
134
|
}
|
|
100
135
|
}
|
|
101
136
|
};
|
|
@@ -118,4 +153,4 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
|
118
153
|
);
|
|
119
154
|
};
|
|
120
155
|
|
|
121
|
-
export default withReduxStore<UNMultipleCardsComponentProps>(UNMultipleCardsComponent);
|
|
156
|
+
export default withReduxStore<UNMultipleCardsComponentProps>(UNMultipleCardsComponent);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { UNMultipleCardsComponentProps } from './UNMultipleCardsComponent';
|
|
2
2
|
import { MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';
|
|
3
|
+
import WebView from 'react-native-webview';
|
|
4
|
+
import { UNCard } from '../../types/shared';
|
|
3
5
|
|
|
4
6
|
export const getMultipleCardsParams = (props: UNMultipleCardsComponentProps) => {
|
|
5
7
|
const paginationType = props.paginationType ? `pagination-type="${props.paginationType}"` : '';
|
|
@@ -9,6 +11,7 @@ export const getMultipleCardsParams = (props: UNMultipleCardsComponentProps) =>
|
|
|
9
11
|
${paginationType}
|
|
10
12
|
${cardsPerPage}
|
|
11
13
|
disable-card-click="${props.disableCardClick || false}"
|
|
14
|
+
is-row-item-clickable="${props.isRowItemClickable || false}"
|
|
12
15
|
${queryFilter}
|
|
13
16
|
hide-title="${props.hideTitle || false}"
|
|
14
17
|
hide-back-to-top="${props.hideBackToTop || false}"
|
|
@@ -25,12 +28,24 @@ const MULTIPLE_CARDS_LISTENERS = {
|
|
|
25
28
|
}).catch((e) => {
|
|
26
29
|
console.log(e)
|
|
27
30
|
})
|
|
28
|
-
|
|
31
|
+
});
|
|
29
32
|
`,
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
export const getMultipleCardsScript = () => {
|
|
33
36
|
return `
|
|
34
|
-
|
|
37
|
+
${MULTIPLE_CARDS_LISTENERS.cardClicked}
|
|
35
38
|
`;
|
|
36
39
|
};
|
|
40
|
+
|
|
41
|
+
export const injectMultipleCardsFiltersChanged = (currentWeb: WebView | null, query: string) => {
|
|
42
|
+
currentWeb?.injectJavaScript(`dispatchMultipleCardsFilterChangedEvent('${query}')`);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const injectCardCreated = (currentWeb: WebView | null, card: string) => {
|
|
46
|
+
currentWeb?.injectJavaScript(`dispatchCardCreatedEvent('${card}')`);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const injectCardStatusChangedEvent = (currentWeb: WebView | null, card: UNCard | null) => {
|
|
50
|
+
currentWeb?.injectJavaScript(`dispatchCardStatusChanged('${JSON.stringify({ data: card })}')`);
|
|
51
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -93,11 +93,11 @@ const BottomSheet = (props: BottomSheetProps) => {
|
|
|
93
93
|
}, [props.isOpen]);
|
|
94
94
|
|
|
95
95
|
useEffect(() => {
|
|
96
|
-
BackHandler.addEventListener('hardwareBackPress', _onBackPress);
|
|
96
|
+
const backHandlerSubscription = BackHandler.addEventListener('hardwareBackPress', _onBackPress);
|
|
97
97
|
const id = panelHeightValue.addListener(e => setCurrentHeight(e.value));
|
|
98
98
|
|
|
99
99
|
return (() => {
|
|
100
|
-
|
|
100
|
+
backHandlerSubscription.remove();
|
|
101
101
|
panelHeightValue.removeListener(id);
|
|
102
102
|
});
|
|
103
103
|
}, []);
|
|
@@ -2,7 +2,9 @@ import type { UNCard } from '../../types/shared';
|
|
|
2
2
|
|
|
3
3
|
export enum CardMessage {
|
|
4
4
|
CARD_ACTIVATED = 'unitCardActivated',
|
|
5
|
-
CARD_STATUS_CHANGED = 'unitCardStatusChanged'
|
|
5
|
+
CARD_STATUS_CHANGED = 'unitCardStatusChanged',
|
|
6
|
+
CARD_CREATED = 'unitCardCreated'
|
|
7
|
+
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
export interface CardStatusChangedEvent {
|
|
@@ -13,6 +15,9 @@ export interface CardActivatedEvent {
|
|
|
13
15
|
card: UNCard;
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
export type CardCreatedEvent = UNCard;
|
|
19
|
+
|
|
16
20
|
export type CardEvent =
|
|
17
21
|
| CardStatusChangedEvent
|
|
18
22
|
| CardActivatedEvent
|
|
23
|
+
| CardCreatedEvent
|
|
@@ -2,8 +2,10 @@ import type { UNCard } from '../../types/shared';
|
|
|
2
2
|
|
|
3
3
|
export enum MultipleCardsMessage {
|
|
4
4
|
UNIT_MULTIPLE_CARDS_CARD_CLICKED = 'unitMultipleCardsCardClicked',
|
|
5
|
+
UNIT_MULTIPLE_CARDS_FILTERS_CHANGED = 'unitMultipleCardsFiltersChanged'
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export type MultipleCardsCardClickedEvent = UNCard;
|
|
9
|
+
export type MultipleCardsFiltersChangedEvent = string;
|
|
8
10
|
|
|
9
|
-
export type MultipleCardsEvent = MultipleCardsCardClickedEvent
|
|
11
|
+
export type MultipleCardsEvent = MultipleCardsCardClickedEvent | MultipleCardsFiltersChangedEvent;
|
|
@@ -5,7 +5,8 @@ import type {
|
|
|
5
5
|
UNComponentsOnLoadResponseData,
|
|
6
6
|
UNAuthorization,
|
|
7
7
|
UNCounterparty,
|
|
8
|
-
UNTransaction
|
|
8
|
+
UNTransaction,
|
|
9
|
+
UNCreateCardComponentResources
|
|
9
10
|
} from '../../types/shared';
|
|
10
11
|
|
|
11
12
|
export enum RESPONSE_KEYS {
|
|
@@ -18,7 +19,8 @@ export enum RESPONSE_KEYS {
|
|
|
18
19
|
authorizations = 'authorizationsResult',
|
|
19
20
|
repayment = 'repaymentResult',
|
|
20
21
|
accountCards = 'accountCardsResult',
|
|
21
|
-
counterpartiesResult = 'counterpartiesResult'
|
|
22
|
+
counterpartiesResult = 'counterpartiesResult',
|
|
23
|
+
createCardResult = 'createCardResult'
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export type CardsOnLoadResponse = {
|
|
@@ -50,6 +52,10 @@ export type PayeeManagementOnLoadResponse = {
|
|
|
50
52
|
[RESPONSE_KEYS.counterpartiesResult]: UNComponentsOnLoadResponseData<[UNCounterparty]>
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
export type CreateCardOnLoadResponse = {
|
|
56
|
+
[RESPONSE_KEYS.createCardResult]: UNComponentsOnLoadResponseData<UNCreateCardComponentResources>
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
export type UnitOnLoadResponseSuccessData =
|
|
54
60
|
| CardOnLoadResponse
|
|
55
61
|
| CardsOnLoadResponse
|
|
@@ -58,6 +64,7 @@ export type UnitOnLoadResponseSuccessData =
|
|
|
58
64
|
| AccountOnLoadResponse
|
|
59
65
|
| ActivityOnLoadResponse
|
|
60
66
|
| PayeeManagementOnLoadResponse
|
|
67
|
+
| CreateCardOnLoadResponse
|
|
61
68
|
|
|
62
69
|
export type UnitOnLoadResponseEvent =
|
|
63
70
|
| UNComponentsError
|