react-native-unit-components 2.0.2 → 2.2.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 +31 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +9 -3
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +31 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +8 -2
- 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.constants.js +6 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +29 -8
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +7 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +38 -8
- 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 +19 -3
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -1
- package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js +2 -0
- package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js +0 -2
- package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.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 +82 -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 +32 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +8 -3
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +32 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +7 -2
- 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.constants.js +5 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +30 -9
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +7 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +39 -9
- 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 +15 -2
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -1
- package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -1
- package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js +3 -1
- package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js.map +1 -1
- package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.js.map +1 -1
- package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js +0 -2
- package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.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 +81 -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 +4 -2
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +2 -0
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +3 -2
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +2 -0
- 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.constants.d.ts +5 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.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 +2 -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/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.d.ts +0 -1
- package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.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/messages/webMessages/unitComponentsMessages.d.ts +1 -0
- package/lib/typescript/src/messages/webMessages/unitComponentsMessages.d.ts.map +1 -1
- package/lib/typescript/src/scripts/html/bodyScript.d.ts +7 -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 +36 -4
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +10 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +35 -4
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +9 -2
- 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.constants.ts +6 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +32 -7
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.tsx +8 -1
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx +54 -18
- 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 +45 -9
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.ts +18 -2
- package/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.tsx +1 -0
- package/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.ts +3 -1
- package/src/components/UNWirePaymentComponent/UNWirePaymentComponent.tsx +0 -1
- package/src/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.ts +0 -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/messages/webMessages/unitComponentsMessages.ts +1 -0
- package/src/scripts/html/bodyScript.ts +84 -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
|
@@ -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,8 @@ export interface UNMultipleCardsComponentProps {
|
|
|
32
36
|
paginationType?: UNMultipleCardsComponentPaginationType;
|
|
33
37
|
cardsPerPage?: number;
|
|
34
38
|
disableCardClick?: boolean;
|
|
39
|
+
isRowItemClickable?: boolean;
|
|
40
|
+
showSeeAllCardsLink?: boolean;
|
|
35
41
|
theme?: string;
|
|
36
42
|
language?: string;
|
|
37
43
|
queryFilter?: string;
|
|
@@ -44,18 +50,34 @@ export interface UNMultipleCardsComponentProps {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
53
|
+
const dispatch = useDispatch();
|
|
47
54
|
const webRef = useRef<WebView>(null);
|
|
48
55
|
const [defaultHeight, setDefaultHeight] = useState<number>();
|
|
49
56
|
|
|
50
|
-
const
|
|
51
|
-
webRef.current
|
|
57
|
+
const dispatchCardStatusChanged = (card: UNCard) => {
|
|
58
|
+
injectCardStatusChangedEvent(webRef.current, card);
|
|
52
59
|
};
|
|
53
60
|
|
|
54
|
-
const
|
|
55
|
-
|
|
61
|
+
const dispatchMultipleCardsFiltersChanged = (query: string) => {
|
|
62
|
+
injectMultipleCardsFiltersChanged(webRef.current, query);
|
|
56
63
|
};
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
const dispatchCardCreated = (card: string) => {
|
|
66
|
+
injectCardCreated(webRef.current, card);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
useListenerToEvent({
|
|
70
|
+
busEventKey: CardMessage.CARD_STATUS_CHANGED,
|
|
71
|
+
action: dispatchCardStatusChanged
|
|
72
|
+
});
|
|
73
|
+
useListenerToEvent({
|
|
74
|
+
busEventKey: MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED,
|
|
75
|
+
action: dispatchMultipleCardsFiltersChanged,
|
|
76
|
+
});
|
|
77
|
+
useListenerToEvent({
|
|
78
|
+
busEventKey: CardMessage.CARD_CREATED,
|
|
79
|
+
action: dispatchCardCreated,
|
|
80
|
+
});
|
|
59
81
|
|
|
60
82
|
const cardClicked = (card: UNCard) => {
|
|
61
83
|
if (props.onCardClicked) {
|
|
@@ -74,7 +96,6 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
|
74
96
|
}
|
|
75
97
|
|
|
76
98
|
if (RESPONSE_KEYS.cards in response) {
|
|
77
|
-
// MultipleCardsOnLoadResponse;
|
|
78
99
|
props.onLoad(response[RESPONSE_KEYS.cards] as UNComponentsOnLoadResponseData<UNMultipleCardsOnLoadData>);
|
|
79
100
|
return;
|
|
80
101
|
}
|
|
@@ -96,6 +117,21 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
|
96
117
|
}
|
|
97
118
|
case MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED: {
|
|
98
119
|
cardClicked(message.details as MultipleCardsCardClickedEvent);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
case UnitComponentsMessage.UNIT_REQUEST_RENDERING: {
|
|
123
|
+
const slotData: BottomSheetSlotData = {
|
|
124
|
+
componentName: WebComponentType.multipleCards,
|
|
125
|
+
componentResourceId: undefined,
|
|
126
|
+
requestRenderingEvent: message.details as RequestRenderingEvent,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const data = {
|
|
130
|
+
type: BottomSheetRenderingType.Slot,
|
|
131
|
+
data: slotData,
|
|
132
|
+
} as SlotRendering;
|
|
133
|
+
dispatch(setEvent({ key: BottomSheetNativeMessage.REQUEST_RENDERING, data }));
|
|
134
|
+
break;
|
|
99
135
|
}
|
|
100
136
|
}
|
|
101
137
|
};
|
|
@@ -118,4 +154,4 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
|
118
154
|
);
|
|
119
155
|
};
|
|
120
156
|
|
|
121
|
-
export default withReduxStore<UNMultipleCardsComponentProps>(UNMultipleCardsComponent);
|
|
157
|
+
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,8 @@ 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}"
|
|
15
|
+
show-see-all-cards-link="${props.showSeeAllCardsLink || false}"
|
|
12
16
|
${queryFilter}
|
|
13
17
|
hide-title="${props.hideTitle || false}"
|
|
14
18
|
hide-back-to-top="${props.hideBackToTop || false}"
|
|
@@ -25,12 +29,24 @@ const MULTIPLE_CARDS_LISTENERS = {
|
|
|
25
29
|
}).catch((e) => {
|
|
26
30
|
console.log(e)
|
|
27
31
|
})
|
|
28
|
-
|
|
32
|
+
});
|
|
29
33
|
`,
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
export const getMultipleCardsScript = () => {
|
|
33
37
|
return `
|
|
34
|
-
|
|
38
|
+
${MULTIPLE_CARDS_LISTENERS.cardClicked}
|
|
35
39
|
`;
|
|
36
40
|
};
|
|
41
|
+
|
|
42
|
+
export const injectMultipleCardsFiltersChanged = (currentWeb: WebView | null, query: string) => {
|
|
43
|
+
currentWeb?.injectJavaScript(`dispatchMultipleCardsFilterChangedEvent('${query}')`);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const injectCardCreated = (currentWeb: WebView | null, card: string) => {
|
|
47
|
+
currentWeb?.injectJavaScript(`dispatchCardCreatedEvent('${card}')`);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const injectCardStatusChangedEvent = (currentWeb: WebView | null, card: UNCard | null) => {
|
|
51
|
+
currentWeb?.injectJavaScript(`dispatchCardStatusChanged('${JSON.stringify({ data: card })}')`);
|
|
52
|
+
};
|
|
@@ -3,7 +3,7 @@ import type WebView from 'react-native-webview';
|
|
|
3
3
|
import type { UNAccountMenuAction } from '../../types/shared';
|
|
4
4
|
import { WebComponentType } from '../../types/internal/webComponent.types';
|
|
5
5
|
import { UNPayeeManagementComponentProps } from './UNPayeeManagementComponent';
|
|
6
|
-
import { DISPATCH_OPEN_PLAID, DISPATCH_PLAID_EXIT, DISPATCH_PLAID_RESPONSE, DISPATCH_REQUEST_REFRESH, LISTENERS } from '../../scripts/html/bodyScript';
|
|
6
|
+
import { DISPATCH_COUNTERPARTY_DELETED, DISPATCH_OPEN_PLAID, DISPATCH_PLAID_EXIT, DISPATCH_PLAID_RESPONSE, DISPATCH_REQUEST_REFRESH, LISTENERS } from '../../scripts/html/bodyScript';
|
|
7
7
|
import { LinkError, LinkSuccess } from 'react-native-plaid-link-sdk';
|
|
8
8
|
import { OpenPlaidEvent } from '../../messages/webMessages/plaidMessages';
|
|
9
9
|
|
|
@@ -28,6 +28,7 @@ export const getPayeeParams = (props: UNPayeeManagementComponentProps) => {
|
|
|
28
28
|
${counterPartiesPerPageParam}
|
|
29
29
|
hide-title="${props.hideTitle || false}"
|
|
30
30
|
hide-counterparty-actions-button="${props.hideCounterpartyActionsButton || false}"
|
|
31
|
+
show-account-type-selector="${props.showAccountTypeSelector ?? false}"
|
|
31
32
|
${menuPlaceholderParam}
|
|
32
33
|
${flowPlaceholderParam}
|
|
33
34
|
${payeeCreationPlaceholderParam}
|
|
@@ -49,6 +50,7 @@ export const getPayeeManagementScript = () => {
|
|
|
49
50
|
${DISPATCH_PLAID_EXIT}
|
|
50
51
|
${DISPATCH_OPEN_PLAID}
|
|
51
52
|
${DISPATCH_REQUEST_REFRESH}
|
|
53
|
+
${DISPATCH_COUNTERPARTY_DELETED}
|
|
52
54
|
`;
|
|
53
55
|
};
|
|
54
56
|
|
|
@@ -3,10 +3,8 @@ import { UNWirePaymentComponentProps } from './UNWirePaymentComponent';
|
|
|
3
3
|
|
|
4
4
|
export const getWirePaymentParams = (props: UNWirePaymentComponentProps) => {
|
|
5
5
|
const accountIdParam = props.accountId ? `account-id="${props.accountId}"` : '';
|
|
6
|
-
const feeParam = props.fee ? `fee="${props.fee}"` : '';
|
|
7
6
|
return `
|
|
8
7
|
${accountIdParam}
|
|
9
|
-
${feeParam}
|
|
10
8
|
is-auto-focus="${props.isAutoFocus || false}"
|
|
11
9
|
initial-stage-back-button="${props.initialStageBackButton ?? false}"
|
|
12
10
|
final-stage-done-button="${props.finalStageDoneButton ?? false}"
|
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
|
|
@@ -6,12 +6,14 @@ import { AccountMessage } from '../../messages/webMessages/accountMessage';
|
|
|
6
6
|
import { ActivityMessage } from '../../messages/webMessages/activityMessage';
|
|
7
7
|
import { PlaidMessage } from '../../messages/webMessages/plaidMessages';
|
|
8
8
|
import { PayeeManagementMessage } from '../../messages/webMessages/payeeManagementMessage';
|
|
9
|
+
import { MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';
|
|
10
|
+
import { WebComponentType } from '../../types/internal/webComponent.types';
|
|
9
11
|
|
|
10
12
|
export const POST_MESSAGE_TO_SDK = `
|
|
11
13
|
const postMessageToSDK = (message) => {
|
|
12
14
|
if ('ReactNativeWebView' in window) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const messageString = JSON.stringify(message)
|
|
16
|
+
window['ReactNativeWebView'].postMessage(messageString)
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
`;
|
|
@@ -44,7 +46,7 @@ export const LISTENERS = {
|
|
|
44
46
|
`,
|
|
45
47
|
onLoad: `
|
|
46
48
|
window.addEventListener("${UnitComponentsMessage.UNIT_ON_LOAD}", (e) => {
|
|
47
|
-
if (document.querySelector("
|
|
49
|
+
if (document.querySelector("${WebComponentType.account}") !== null) {
|
|
48
50
|
// 10 milliseconds delay to render AccountComponent correctly
|
|
49
51
|
setTimeout(() => {
|
|
50
52
|
postHeight()
|
|
@@ -53,16 +55,14 @@ export const LISTENERS = {
|
|
|
53
55
|
postHeight()
|
|
54
56
|
}
|
|
55
57
|
postMessageToSDK({ type: "${UnitComponentsMessage.UNIT_ON_LOAD}", details: e.detail })
|
|
56
|
-
|
|
57
58
|
});
|
|
58
59
|
`,
|
|
59
60
|
requestCloseFlow: `
|
|
60
61
|
window.addEventListener("${UnitComponentsMessage.UNIT_REQUEST_CLOSE_FLOW}", (e) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
// Add a delay of 200 milliseconds to allow the SDK to finish processing prior events that require a Promise before closing the flow
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
postMessageToSDK({ type: "${UnitComponentsMessage.UNIT_REQUEST_CLOSE_FLOW}" });
|
|
65
|
+
}, 200);
|
|
66
66
|
});
|
|
67
67
|
`,
|
|
68
68
|
requestOpenLink: `
|
|
@@ -93,49 +93,58 @@ export const LISTENERS = {
|
|
|
93
93
|
}).catch((e) => {
|
|
94
94
|
console.log(e)
|
|
95
95
|
})
|
|
96
|
-
|
|
96
|
+
});
|
|
97
|
+
`,
|
|
98
|
+
cardCreated: `
|
|
99
|
+
window.addEventListener("${CardMessage.CARD_CREATED}", (e) => {
|
|
100
|
+
const response = e.detail
|
|
101
|
+
response.then((data) => {
|
|
102
|
+
postMessageToSDK({ type: "${CardMessage.CARD_CREATED}", details: JSON.stringify(data.data)})
|
|
103
|
+
}).catch((e) => {
|
|
104
|
+
console.log(e)
|
|
105
|
+
})
|
|
106
|
+
});
|
|
97
107
|
`,
|
|
98
108
|
unitRequestExternalSdk: `
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
window.addEventListener("${UnitComponentsMessage.UNIT_REQUEST_EXTERNAL_SDK}", (e) => {
|
|
110
|
+
postMessageToSDK({ type: "${UnitComponentsMessage.UNIT_REQUEST_EXTERNAL_SDK}", details: e.detail })
|
|
111
|
+
});
|
|
102
112
|
`,
|
|
103
|
-
|
|
104
113
|
unitRequestLeftToSpendDetails: `
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
window.addEventListener("${UnitComponentsMessage.UNIT_REQUEST_LEFT_TO_SPEND_DETAILS}", (e) => {
|
|
115
|
+
postMessageToSDK({ type: "${UnitComponentsMessage.UNIT_REQUEST_LEFT_TO_SPEND_DETAILS}", details: e.detail })
|
|
116
|
+
});
|
|
108
117
|
`,
|
|
109
118
|
unitPaymentCreated: `
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
window.addEventListener("${PaymentMessage.PAYMENT_CREATED}", (e) => {
|
|
120
|
+
const response = e.detail
|
|
112
121
|
response.then((data) => {
|
|
113
122
|
postMessageToSDK({ type: "${PaymentMessage.PAYMENT_CREATED}", details: { data: data.data }})
|
|
114
123
|
}).catch((e) => {
|
|
115
124
|
console.log(e)
|
|
116
125
|
})
|
|
117
|
-
|
|
126
|
+
});
|
|
118
127
|
`,
|
|
119
128
|
unitPaymentInitialStageBackButtonClicked: `
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
window.addEventListener("${PaymentMessage.INITIAL_STAGE_BACK_BUTTON_CLICKED}", (e) => {
|
|
130
|
+
postMessageToSDK({ type: "${PaymentMessage.INITIAL_STAGE_BACK_BUTTON_CLICKED}", details: { data: e.detail }})
|
|
131
|
+
});
|
|
123
132
|
`,
|
|
124
133
|
|
|
125
134
|
unitPaymentFinalStageDoneButtonClicked: `
|
|
126
|
-
window.addEventListener("
|
|
135
|
+
window.addEventListener("${PaymentMessage.FINAL_STAGE_DONE_BUTTON_CLICKED}", (e) => {
|
|
127
136
|
postMessageToSDK({ type: "${PaymentMessage.FINAL_STAGE_DONE_BUTTON_CLICKED}", details: { data: e.detail }})
|
|
128
137
|
});
|
|
129
138
|
`,
|
|
130
139
|
unitPlaidTokenCreated: `
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
window.addEventListener("${PlaidMessage.UNIT_PLAID_TOKEN_CREATED}", (e) => {
|
|
141
|
+
const response = e.detail
|
|
142
|
+
response.then((data) => {
|
|
143
|
+
postMessageToSDK({ type: "${PlaidMessage.UNIT_PLAID_TOKEN_CREATED}", details: { linkToken: data.data }})
|
|
144
|
+
}).catch((e) => {
|
|
145
|
+
console.log(e)
|
|
146
|
+
})
|
|
147
|
+
});
|
|
139
148
|
`,
|
|
140
149
|
unitAccountChanged: `
|
|
141
150
|
window.addEventListener("${AccountMessage.UNIT_ACCOUNT_CHANGED}", (e) => {
|
|
@@ -152,6 +161,11 @@ export const LISTENERS = {
|
|
|
152
161
|
postMessageToSDK({ type: "${ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED}", details: e.detail })
|
|
153
162
|
});
|
|
154
163
|
`,
|
|
164
|
+
unitMultipleCardsFiltersChanged: `
|
|
165
|
+
window.addEventListener("${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED}", (e) => {
|
|
166
|
+
postMessageToSDK({ type: "${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED}", details: e.detail })
|
|
167
|
+
});
|
|
168
|
+
`,
|
|
155
169
|
unitMultiFactorAuthFinished: `
|
|
156
170
|
window.addEventListener("${UnitComponentsMessage.UNIT_MULTI_FACTOR_AUTH_FINISHED}", async (e) => {
|
|
157
171
|
const response = await e.detail.response;
|
|
@@ -238,14 +252,14 @@ export const LISTENERS = {
|
|
|
238
252
|
`,
|
|
239
253
|
|
|
240
254
|
unitOpenPlaid: `
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
255
|
+
window.addEventListener("${PlaidMessage.UNIT_OPEN_PLAID}", async (e) => {
|
|
256
|
+
const response = event.detail;
|
|
257
|
+
response.then((data) => {
|
|
258
|
+
postMessageToSDK({ type: "${PlaidMessage.UNIT_OPEN_PLAID}", details: data.data })
|
|
259
|
+
}).catch((e) => {
|
|
260
|
+
console.log(e)
|
|
261
|
+
})
|
|
262
|
+
});
|
|
249
263
|
`
|
|
250
264
|
};
|
|
251
265
|
|
|
@@ -264,7 +278,7 @@ export const DISPATCH_EVENT_TO_CONTINUE = `
|
|
|
264
278
|
`;
|
|
265
279
|
|
|
266
280
|
export const DISPATCH_CARD_STATUS_CHANGED = `
|
|
267
|
-
const
|
|
281
|
+
const dispatchCardStatusChanged = (details) => {
|
|
268
282
|
const event = new CustomEvent("${CardMessage.CARD_STATUS_CHANGED}",{ detail: JSON.parse(details) })
|
|
269
283
|
window.dispatchEvent(event)
|
|
270
284
|
}
|
|
@@ -291,29 +305,44 @@ export const SET_ITEM_IN_WINDOW_UNIT_STORE = `
|
|
|
291
305
|
|
|
292
306
|
export const DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT = `
|
|
293
307
|
const dispatchActivityFilterChangedEvent = (details) => {
|
|
294
|
-
const event = new CustomEvent("
|
|
308
|
+
const event = new CustomEvent("${ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED}",{ detail: details});
|
|
309
|
+
window.dispatchEvent(event);
|
|
310
|
+
}
|
|
311
|
+
`;
|
|
312
|
+
|
|
313
|
+
export const DISPATCH_MULTIPLE_CARDS_FILTER_CHANGED_EVENT = `
|
|
314
|
+
const dispatchMultipleCardsFilterChangedEvent = (details) => {
|
|
315
|
+
const event = new CustomEvent("${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED}",{ detail: details });
|
|
316
|
+
window.dispatchEvent(event);
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
319
|
+
|
|
320
|
+
export const DISPATCH_CARD_CREATED_EVENT = `
|
|
321
|
+
const dispatchCardCreatedEvent = (details) => {
|
|
322
|
+
// Add fromSDK to avoid infinite loop
|
|
323
|
+
const event = new CustomEvent("${CardMessage.CARD_CREATED}",{ detail: { data: JSON.parse(details) ,fromSDK: true } });
|
|
295
324
|
window.dispatchEvent(event);
|
|
296
325
|
}
|
|
297
326
|
`;
|
|
298
327
|
|
|
299
328
|
export const DISPATCH_PLAID_RESPONSE = `
|
|
300
329
|
const dispatchPlaidEvent = (details) => {
|
|
301
|
-
|
|
302
|
-
|
|
330
|
+
const event = new CustomEvent("${PlaidMessage.UNIT_PLAID_RESPONSE}",{ detail: details })
|
|
331
|
+
window.dispatchEvent(event)
|
|
303
332
|
}
|
|
304
333
|
`;
|
|
305
334
|
|
|
306
335
|
export const DISPATCH_PLAID_EXIT = `
|
|
307
336
|
const dispatchPlaidExit = (details) => {
|
|
308
|
-
|
|
309
|
-
|
|
337
|
+
const event = new CustomEvent("${PlaidMessage.UNIT_PLAID_EXIT}",{ detail: details })
|
|
338
|
+
window.dispatchEvent(event)
|
|
310
339
|
}
|
|
311
340
|
`;
|
|
312
341
|
|
|
313
342
|
export const DISPATCH_OPEN_PLAID = `
|
|
314
343
|
const dispatchOpenPlaidEvent = (details) => {
|
|
315
|
-
|
|
316
|
-
|
|
344
|
+
const event = new CustomEvent("${PlaidMessage.UNIT_OPEN_PLAID}",{ detail: details })
|
|
345
|
+
window.dispatchEvent(event)
|
|
317
346
|
}
|
|
318
347
|
`;
|
|
319
348
|
|
|
@@ -346,3 +375,10 @@ export const DISPATCH_REQUEST_ACCOUNT_ACTION = `
|
|
|
346
375
|
document.querySelector("unit-elements-account").dispatchEvent(new CustomEvent("unitRequestAccountAction", {detail: {action: action}}))
|
|
347
376
|
}
|
|
348
377
|
`;
|
|
378
|
+
|
|
379
|
+
export const DISPATCH_COUNTERPARTY_DELETED = `
|
|
380
|
+
const dispatchCounterpartyDeletedEvent = (details) => {
|
|
381
|
+
const event = new CustomEvent("unitCounterpartyDeleted",{ detail: { data: details } });
|
|
382
|
+
window.dispatchEvent(event);
|
|
383
|
+
}
|
|
384
|
+
`;
|
|
@@ -6,11 +6,11 @@ import type { UNAccount, UNCard } from '../types/shared';
|
|
|
6
6
|
import type { ActivityFiltersChangedEvent } from '../messages/webMessages/activityMessage';
|
|
7
7
|
import type { MultiFactorAuthenticationFinishedEvent, RequestRefreshEvent } from '../messages/webMessages/unitComponentsMessages';
|
|
8
8
|
import type { BottomSheetNativeMessage } from '../messages/nativeMessages/bottomSheetMessage';
|
|
9
|
-
import type { CardMessage } from '../messages/webMessages/cardMessage';
|
|
9
|
+
import type { CardCreatedEvent, CardMessage } from '../messages/webMessages/cardMessage';
|
|
10
10
|
import type { AccountMessage } from '../messages/webMessages/accountMessage';
|
|
11
11
|
import type { ActivityMessage } from '../messages/webMessages/activityMessage';
|
|
12
12
|
import type { UnitComponentsMessage } from '../messages/webMessages/unitComponentsMessages';
|
|
13
|
-
import type { MultipleCardsMessage } from '../messages/webMessages/multipleCardsMessage';
|
|
13
|
+
import type { MultipleCardsFiltersChangedEvent, MultipleCardsMessage } from '../messages/webMessages/multipleCardsMessage';
|
|
14
14
|
import { BottomSheetRenderingMessage } from '../messages/nativeMessages/bottomSheetMessage';
|
|
15
15
|
import { PageMessage } from '../messages/webMessages/pageMessage';
|
|
16
16
|
import { OpenPlaidEvent, PlaidMessage } from '../messages/webMessages/plaidMessages';
|
|
@@ -44,6 +44,16 @@ type ActivityFiltersChangedEventState = {
|
|
|
44
44
|
data: ActivityFiltersChangedEvent
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
type MultipleCardsFiltersChangedEventState = {
|
|
48
|
+
key: MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED
|
|
49
|
+
data: MultipleCardsFiltersChangedEvent
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type CardCreatedEventState = {
|
|
53
|
+
key: CardMessage.CARD_CREATED
|
|
54
|
+
data: CardCreatedEvent
|
|
55
|
+
}
|
|
56
|
+
|
|
47
57
|
type RequestCloseBottomSheetFlowEventState = {
|
|
48
58
|
key: UnitComponentsMessage.UNIT_REQUEST_CLOSE_FLOW,
|
|
49
59
|
data: EmptyObj
|
|
@@ -83,9 +93,11 @@ type PayeeCounterpartyDeletedEventState = {
|
|
|
83
93
|
type SharedEvent =
|
|
84
94
|
| CardStatusChangedEventState
|
|
85
95
|
| CardActivatedEventState
|
|
86
|
-
|
|
|
96
|
+
| CardCreatedEventState
|
|
87
97
|
| AccountChangedEventState
|
|
88
98
|
| ActivityFiltersChangedEventState
|
|
99
|
+
| MultipleCardsCardClickedEventState
|
|
100
|
+
| MultipleCardsFiltersChangedEventState
|
|
89
101
|
| RequestCloseBottomSheetFlowEventState
|
|
90
102
|
| RequestRenderingBottomSheetEventState
|
|
91
103
|
| RequestRefreshEventState
|
|
@@ -8,6 +8,7 @@ import { UNACHDebitComponentProps } from '../../components/UNACHDebitComponent';
|
|
|
8
8
|
import { UNCheckDepositComponentProps } from '../../components/UNCheckDepositComponent';
|
|
9
9
|
import { UNBookPaymentComponentProps } from '../../components/UNBookPaymentComponent';
|
|
10
10
|
import { UNWirePaymentComponentProps } from '../../components/UNWirePaymentComponent';
|
|
11
|
+
import { UNCreateCardComponentProps } from '../../components/UNCreateCardComponent';
|
|
11
12
|
|
|
12
13
|
export enum BottomSheetNativePlaceType {
|
|
13
14
|
overFullScreen = 'overFullScreen',
|
|
@@ -50,7 +51,8 @@ export enum BottomSheetNativeComponentType {
|
|
|
50
51
|
ACHDebitComponent = 'UNACHDebitComponent',
|
|
51
52
|
CheckDepositComponent = 'UNCheckDepositComponent',
|
|
52
53
|
BookPaymentComponent = 'UNBookPaymentComponent',
|
|
53
|
-
WirePaymentComponent = 'UNWirePaymentComponent'
|
|
54
|
+
WirePaymentComponent = 'UNWirePaymentComponent',
|
|
55
|
+
CreateCardComponent = 'UNCreateCardComponent'
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
export type BottomSheetNativeAddToWalletComponentType = {
|
|
@@ -83,12 +85,18 @@ export type BottomSheetNativeWirePaymentComponentType = {
|
|
|
83
85
|
props: UNWirePaymentComponentProps
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
export type BottomSheetNativeCreateCardComponentType = {
|
|
89
|
+
type: BottomSheetNativeComponentType.CreateCardComponent,
|
|
90
|
+
props: UNCreateCardComponentProps
|
|
91
|
+
}
|
|
92
|
+
|
|
86
93
|
export type BottomSheetNativeComponent = BottomSheetNativeAddToWalletComponentType
|
|
87
94
|
| BottomSheetNativeACHCreditComponentType
|
|
88
95
|
| BottomSheetNativeACHDebitComponentType
|
|
89
96
|
| BottomSheetNativeCheckDepositComponentType
|
|
90
97
|
| BottomSheetNativeBookPaymentComponentType
|
|
91
98
|
| BottomSheetNativeWirePaymentComponentType
|
|
99
|
+
| BottomSheetNativeCreateCardComponentType
|
|
92
100
|
|
|
93
101
|
export type BottomSheetSlotData = {
|
|
94
102
|
// The data that rendered by the web view
|
|
@@ -15,6 +15,7 @@ export enum WebComponentType {
|
|
|
15
15
|
wirePayment = 'unit-elements-wire-payment',
|
|
16
16
|
whiteLabelApp = 'unit-elements-white-label-app',
|
|
17
17
|
multiFactorAuthentication = 'unit-elements-multi-factor-authentication',
|
|
18
|
+
createCard = 'unit-elements-create-card',
|
|
18
19
|
cardMenu = 'unit-elements-card-menu'
|
|
19
20
|
}
|
|
20
21
|
|