@networkinternational/ni-card-management-sdk 1.0.2
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/LICENSE +21 -0
- package/README.md +651 -0
- package/android/build.gradle +95 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/nicardmanagement/JsonDeserialization.kt +24 -0
- package/android/src/main/java/com/nicardmanagement/NiCardManagementModule.kt +163 -0
- package/android/src/main/java/com/nicardmanagement/NiCardManagementPackage.kt +17 -0
- package/ios/NiCardManagement-Bridging-Header.h +2 -0
- package/ios/NiCardManagement.mm +29 -0
- package/ios/NiCardManagement.swift +142 -0
- package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js +71 -0
- package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js.map +1 -0
- package/lib/commonjs/NICardManagementComponents/ChangePinView.js +44 -0
- package/lib/commonjs/NICardManagementComponents/ChangePinView.js.map +1 -0
- package/lib/commonjs/NICardManagementComponents/NiInputInterfaces.js +17 -0
- package/lib/commonjs/NICardManagementComponents/NiInputInterfaces.js.map +1 -0
- package/lib/commonjs/NICardManagementComponents/SetPinView.js +44 -0
- package/lib/commonjs/NICardManagementComponents/SetPinView.js.map +1 -0
- package/lib/commonjs/NICardManagementComponents/VerifyPinView.js +44 -0
- package/lib/commonjs/NICardManagementComponents/VerifyPinView.js.map +1 -0
- package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js +52 -0
- package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js.map +1 -0
- package/lib/commonjs/assets/icons/content-copy.png +0 -0
- package/lib/commonjs/assets/icons/eye-off-outline.png +0 -0
- package/lib/commonjs/assets/icons/eye-outline.png +0 -0
- package/lib/commonjs/assets/icons/icons8-arrow-100.png +0 -0
- package/lib/commonjs/assets/icons/icons8-arrow-100_1.png +0 -0
- package/lib/commonjs/assets/icons/red-eye-off-outline.png +0 -0
- package/lib/commonjs/assets/icons/red-eye-outline.png +0 -0
- package/lib/commonjs/assets/images/grayCard.png +0 -0
- package/lib/commonjs/components/CardDetails/CardDetails.js +27 -0
- package/lib/commonjs/components/CardDetails/CardDetails.js.map +1 -0
- package/lib/commonjs/components/CardDetails/CardDetailsBackgroundImage.js +29 -0
- package/lib/commonjs/components/CardDetails/CardDetailsBackgroundImage.js.map +1 -0
- package/lib/commonjs/components/CardDetails/CardDetailsGroups.js +94 -0
- package/lib/commonjs/components/CardDetails/CardDetailsGroups.js.map +1 -0
- package/lib/commonjs/components/CardDetails/CardHolderNameGroups.js +67 -0
- package/lib/commonjs/components/CardDetails/CardHolderNameGroups.js.map +1 -0
- package/lib/commonjs/components/CardDetails/CardNumberGroup.js +69 -0
- package/lib/commonjs/components/CardDetails/CardNumberGroup.js.map +1 -0
- package/lib/commonjs/components/CardDetails/DateCVVGroupOneRow.js +104 -0
- package/lib/commonjs/components/CardDetails/DateCVVGroupOneRow.js.map +1 -0
- package/lib/commonjs/components/CardDetails/styles.js +98 -0
- package/lib/commonjs/components/CardDetails/styles.js.map +1 -0
- package/lib/commonjs/components/ChangePin/CaptureCurrentPin.js +50 -0
- package/lib/commonjs/components/ChangePin/CaptureCurrentPin.js.map +1 -0
- package/lib/commonjs/components/ChangePin/CaptureNewPin.js +50 -0
- package/lib/commonjs/components/ChangePin/CaptureNewPin.js.map +1 -0
- package/lib/commonjs/components/ChangePin/ChangePin.js +135 -0
- package/lib/commonjs/components/ChangePin/ChangePin.js.map +1 -0
- package/lib/commonjs/components/ChangePin/ConfirmPin.js +39 -0
- package/lib/commonjs/components/ChangePin/ConfirmPin.js.map +1 -0
- package/lib/commonjs/components/ChangePin/ReenterNewPin.js +53 -0
- package/lib/commonjs/components/ChangePin/ReenterNewPin.js.map +1 -0
- package/lib/commonjs/components/ChangePin/styles.js +29 -0
- package/lib/commonjs/components/ChangePin/styles.js.map +1 -0
- package/lib/commonjs/components/NIButton/NIButton.js +46 -0
- package/lib/commonjs/components/NIButton/NIButton.js.map +1 -0
- package/lib/commonjs/components/NIButton/styles.js +15 -0
- package/lib/commonjs/components/NIButton/styles.js.map +1 -0
- package/lib/commonjs/components/Pin/CapturePin.js +152 -0
- package/lib/commonjs/components/Pin/CapturePin.js.map +1 -0
- package/lib/commonjs/components/Pin/NextButton.js +40 -0
- package/lib/commonjs/components/Pin/NextButton.js.map +1 -0
- package/lib/commonjs/components/Pin/ShowHideButton.js +48 -0
- package/lib/commonjs/components/Pin/ShowHideButton.js.map +1 -0
- package/lib/commonjs/components/Pin/styles.js +61 -0
- package/lib/commonjs/components/Pin/styles.js.map +1 -0
- package/lib/commonjs/components/PinState/LoadingState.js +29 -0
- package/lib/commonjs/components/PinState/LoadingState.js.map +1 -0
- package/lib/commonjs/components/PinState/PinState.js +29 -0
- package/lib/commonjs/components/PinState/PinState.js.map +1 -0
- package/lib/commonjs/components/SetPin/ConfirmPin.js +39 -0
- package/lib/commonjs/components/SetPin/ConfirmPin.js.map +1 -0
- package/lib/commonjs/components/SetPin/ReenterCardPin.js +53 -0
- package/lib/commonjs/components/SetPin/ReenterCardPin.js.map +1 -0
- package/lib/commonjs/components/SetPin/SetPin.js +118 -0
- package/lib/commonjs/components/SetPin/SetPin.js.map +1 -0
- package/lib/commonjs/components/SetPin/SetUpNewCardPin.js +50 -0
- package/lib/commonjs/components/SetPin/SetUpNewCardPin.js.map +1 -0
- package/lib/commonjs/components/SetPin/styles.js +29 -0
- package/lib/commonjs/components/SetPin/styles.js.map +1 -0
- package/lib/commonjs/components/VerifyPin/CaptureVerifyPin.js +50 -0
- package/lib/commonjs/components/VerifyPin/CaptureVerifyPin.js.map +1 -0
- package/lib/commonjs/components/VerifyPin/ConfirmPin.js +40 -0
- package/lib/commonjs/components/VerifyPin/ConfirmPin.js.map +1 -0
- package/lib/commonjs/components/VerifyPin/VerifyPin.js +92 -0
- package/lib/commonjs/components/VerifyPin/VerifyPin.js.map +1 -0
- package/lib/commonjs/components/VerifyPin/styles.js +26 -0
- package/lib/commonjs/components/VerifyPin/styles.js.map +1 -0
- package/lib/commonjs/components/ViewPin/ViewPin.js +76 -0
- package/lib/commonjs/components/ViewPin/ViewPin.js.map +1 -0
- package/lib/commonjs/components/ViewPin/styles.js +19 -0
- package/lib/commonjs/components/ViewPin/styles.js.map +1 -0
- package/lib/commonjs/components/icons/PredeterminedIcon.js +43 -0
- package/lib/commonjs/components/icons/PredeterminedIcon.js.map +1 -0
- package/lib/commonjs/config/configCard.js +9 -0
- package/lib/commonjs/config/configCard.js.map +1 -0
- package/lib/commonjs/config/localization.js +47 -0
- package/lib/commonjs/config/localization.js.map +1 -0
- package/lib/commonjs/config/themeColors.js +34 -0
- package/lib/commonjs/config/themeColors.js.map +1 -0
- package/lib/commonjs/hooks/useChangePin.js +37 -0
- package/lib/commonjs/hooks/useChangePin.js.map +1 -0
- package/lib/commonjs/hooks/useGetCardDetails.js +37 -0
- package/lib/commonjs/hooks/useGetCardDetails.js.map +1 -0
- package/lib/commonjs/hooks/useSetPin.js +37 -0
- package/lib/commonjs/hooks/useSetPin.js.map +1 -0
- package/lib/commonjs/hooks/useVerifyPin.js +37 -0
- package/lib/commonjs/hooks/useVerifyPin.js.map +1 -0
- package/lib/commonjs/hooks/useViewPin.js +37 -0
- package/lib/commonjs/hooks/useViewPin.js.map +1 -0
- package/lib/commonjs/index.js +72 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/interfaces/NiCardManagementInterfaces.js +2 -0
- package/lib/commonjs/interfaces/NiCardManagementInterfaces.js.map +1 -0
- package/lib/commonjs/interfaces/NiInputInterfaces.js +39 -0
- package/lib/commonjs/interfaces/NiInputInterfaces.js.map +1 -0
- package/lib/commonjs/interfaces/NiInterfaces.js +14 -0
- package/lib/commonjs/interfaces/NiInterfaces.js.map +1 -0
- package/lib/commonjs/nativeComponents/NICardManagementSDKModule.js +9 -0
- package/lib/commonjs/nativeComponents/NICardManagementSDKModule.js.map +1 -0
- package/lib/commonjs/utils/formatInput.js +10 -0
- package/lib/commonjs/utils/formatInput.js.map +1 -0
- package/lib/commonjs/utils/localization.js +13 -0
- package/lib/commonjs/utils/localization.js.map +1 -0
- package/lib/module/NICardManagementComponents/CardDetailsComponent.js +57 -0
- package/lib/module/NICardManagementComponents/CardDetailsComponent.js.map +1 -0
- package/lib/module/NICardManagementComponents/ChangePinView.js +32 -0
- package/lib/module/NICardManagementComponents/ChangePinView.js.map +1 -0
- package/lib/module/NICardManagementComponents/NiInputInterfaces.js +3 -0
- package/lib/module/NICardManagementComponents/NiInputInterfaces.js.map +1 -0
- package/lib/module/NICardManagementComponents/SetPinView.js +32 -0
- package/lib/module/NICardManagementComponents/SetPinView.js.map +1 -0
- package/lib/module/NICardManagementComponents/VerifyPinView.js +32 -0
- package/lib/module/NICardManagementComponents/VerifyPinView.js.map +1 -0
- package/lib/module/NICardManagementComponents/ViewPinComponent.js +38 -0
- package/lib/module/NICardManagementComponents/ViewPinComponent.js.map +1 -0
- package/lib/module/assets/icons/content-copy.png +0 -0
- package/lib/module/assets/icons/eye-off-outline.png +0 -0
- package/lib/module/assets/icons/eye-outline.png +0 -0
- package/lib/module/assets/icons/icons8-arrow-100.png +0 -0
- package/lib/module/assets/icons/icons8-arrow-100_1.png +0 -0
- package/lib/module/assets/icons/red-eye-off-outline.png +0 -0
- package/lib/module/assets/icons/red-eye-outline.png +0 -0
- package/lib/module/assets/images/grayCard.png +0 -0
- package/lib/module/components/CardDetails/CardDetails.js +20 -0
- package/lib/module/components/CardDetails/CardDetails.js.map +1 -0
- package/lib/module/components/CardDetails/CardDetailsBackgroundImage.js +22 -0
- package/lib/module/components/CardDetails/CardDetailsBackgroundImage.js.map +1 -0
- package/lib/module/components/CardDetails/CardDetailsGroups.js +85 -0
- package/lib/module/components/CardDetails/CardDetailsGroups.js.map +1 -0
- package/lib/module/components/CardDetails/CardHolderNameGroups.js +60 -0
- package/lib/module/components/CardDetails/CardHolderNameGroups.js.map +1 -0
- package/lib/module/components/CardDetails/CardNumberGroup.js +62 -0
- package/lib/module/components/CardDetails/CardNumberGroup.js.map +1 -0
- package/lib/module/components/CardDetails/DateCVVGroupOneRow.js +97 -0
- package/lib/module/components/CardDetails/DateCVVGroupOneRow.js.map +1 -0
- package/lib/module/components/CardDetails/styles.js +92 -0
- package/lib/module/components/CardDetails/styles.js.map +1 -0
- package/lib/module/components/ChangePin/CaptureCurrentPin.js +43 -0
- package/lib/module/components/ChangePin/CaptureCurrentPin.js.map +1 -0
- package/lib/module/components/ChangePin/CaptureNewPin.js +43 -0
- package/lib/module/components/ChangePin/CaptureNewPin.js.map +1 -0
- package/lib/module/components/ChangePin/ChangePin.js +126 -0
- package/lib/module/components/ChangePin/ChangePin.js.map +1 -0
- package/lib/module/components/ChangePin/ConfirmPin.js +32 -0
- package/lib/module/components/ChangePin/ConfirmPin.js.map +1 -0
- package/lib/module/components/ChangePin/ReenterNewPin.js +46 -0
- package/lib/module/components/ChangePin/ReenterNewPin.js.map +1 -0
- package/lib/module/components/ChangePin/styles.js +23 -0
- package/lib/module/components/ChangePin/styles.js.map +1 -0
- package/lib/module/components/NIButton/NIButton.js +38 -0
- package/lib/module/components/NIButton/NIButton.js.map +1 -0
- package/lib/module/components/NIButton/styles.js +9 -0
- package/lib/module/components/NIButton/styles.js.map +1 -0
- package/lib/module/components/Pin/CapturePin.js +143 -0
- package/lib/module/components/Pin/CapturePin.js.map +1 -0
- package/lib/module/components/Pin/NextButton.js +33 -0
- package/lib/module/components/Pin/NextButton.js.map +1 -0
- package/lib/module/components/Pin/ShowHideButton.js +41 -0
- package/lib/module/components/Pin/ShowHideButton.js.map +1 -0
- package/lib/module/components/Pin/styles.js +55 -0
- package/lib/module/components/Pin/styles.js.map +1 -0
- package/lib/module/components/PinState/LoadingState.js +22 -0
- package/lib/module/components/PinState/LoadingState.js.map +1 -0
- package/lib/module/components/PinState/PinState.js +22 -0
- package/lib/module/components/PinState/PinState.js.map +1 -0
- package/lib/module/components/SetPin/ConfirmPin.js +32 -0
- package/lib/module/components/SetPin/ConfirmPin.js.map +1 -0
- package/lib/module/components/SetPin/ReenterCardPin.js +46 -0
- package/lib/module/components/SetPin/ReenterCardPin.js.map +1 -0
- package/lib/module/components/SetPin/SetPin.js +109 -0
- package/lib/module/components/SetPin/SetPin.js.map +1 -0
- package/lib/module/components/SetPin/SetUpNewCardPin.js +43 -0
- package/lib/module/components/SetPin/SetUpNewCardPin.js.map +1 -0
- package/lib/module/components/SetPin/styles.js +23 -0
- package/lib/module/components/SetPin/styles.js.map +1 -0
- package/lib/module/components/VerifyPin/CaptureVerifyPin.js +43 -0
- package/lib/module/components/VerifyPin/CaptureVerifyPin.js.map +1 -0
- package/lib/module/components/VerifyPin/ConfirmPin.js +33 -0
- package/lib/module/components/VerifyPin/ConfirmPin.js.map +1 -0
- package/lib/module/components/VerifyPin/VerifyPin.js +83 -0
- package/lib/module/components/VerifyPin/VerifyPin.js.map +1 -0
- package/lib/module/components/VerifyPin/styles.js +20 -0
- package/lib/module/components/VerifyPin/styles.js.map +1 -0
- package/lib/module/components/ViewPin/ViewPin.js +67 -0
- package/lib/module/components/ViewPin/ViewPin.js.map +1 -0
- package/lib/module/components/ViewPin/styles.js +13 -0
- package/lib/module/components/ViewPin/styles.js.map +1 -0
- package/lib/module/components/icons/PredeterminedIcon.js +35 -0
- package/lib/module/components/icons/PredeterminedIcon.js.map +1 -0
- package/lib/module/config/configCard.js +3 -0
- package/lib/module/config/configCard.js.map +1 -0
- package/lib/module/config/localization.js +41 -0
- package/lib/module/config/localization.js.map +1 -0
- package/lib/module/config/themeColors.js +29 -0
- package/lib/module/config/themeColors.js.map +1 -0
- package/lib/module/hooks/useChangePin.js +29 -0
- package/lib/module/hooks/useChangePin.js.map +1 -0
- package/lib/module/hooks/useGetCardDetails.js +29 -0
- package/lib/module/hooks/useGetCardDetails.js.map +1 -0
- package/lib/module/hooks/useSetPin.js +29 -0
- package/lib/module/hooks/useSetPin.js.map +1 -0
- package/lib/module/hooks/useVerifyPin.js +29 -0
- package/lib/module/hooks/useVerifyPin.js.map +1 -0
- package/lib/module/hooks/useViewPin.js +29 -0
- package/lib/module/hooks/useViewPin.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/interfaces/NiCardManagementInterfaces.js +2 -0
- package/lib/module/interfaces/NiCardManagementInterfaces.js.map +1 -0
- package/lib/module/interfaces/NiInputInterfaces.js +33 -0
- package/lib/module/interfaces/NiInputInterfaces.js.map +1 -0
- package/lib/module/interfaces/NiInterfaces.js +8 -0
- package/lib/module/interfaces/NiInterfaces.js.map +1 -0
- package/lib/module/nativeComponents/NICardManagementSDKModule.js +3 -0
- package/lib/module/nativeComponents/NICardManagementSDKModule.js.map +1 -0
- package/lib/module/utils/formatInput.js +4 -0
- package/lib/module/utils/formatInput.js.map +1 -0
- package/lib/module/utils/localization.js +7 -0
- package/lib/module/utils/localization.js.map +1 -0
- package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts +7 -0
- package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts.map +1 -0
- package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts +6 -0
- package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts.map +1 -0
- package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts +4 -0
- package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts.map +1 -0
- package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts +6 -0
- package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts.map +1 -0
- package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts +6 -0
- package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts.map +1 -0
- package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts +6 -0
- package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/CardDetails/CardDetails.d.ts +4 -0
- package/lib/typescript/src/components/CardDetails/CardDetails.d.ts.map +1 -0
- package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts +4 -0
- package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts.map +1 -0
- package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts +4 -0
- package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts.map +1 -0
- package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts +4 -0
- package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts.map +1 -0
- package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts +4 -0
- package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts.map +1 -0
- package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts +4 -0
- package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts.map +1 -0
- package/lib/typescript/src/components/CardDetails/styles.d.ts +90 -0
- package/lib/typescript/src/components/CardDetails/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts +4 -0
- package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts.map +1 -0
- package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts +4 -0
- package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts.map +1 -0
- package/lib/typescript/src/components/ChangePin/ChangePin.d.ts +5 -0
- package/lib/typescript/src/components/ChangePin/ChangePin.d.ts.map +1 -0
- package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts +4 -0
- package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts.map +1 -0
- package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts +4 -0
- package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts.map +1 -0
- package/lib/typescript/src/components/ChangePin/styles.d.ts +22 -0
- package/lib/typescript/src/components/ChangePin/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/NIButton/NIButton.d.ts +13 -0
- package/lib/typescript/src/components/NIButton/NIButton.d.ts.map +1 -0
- package/lib/typescript/src/components/NIButton/styles.d.ts +8 -0
- package/lib/typescript/src/components/NIButton/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Pin/CapturePin.d.ts +4 -0
- package/lib/typescript/src/components/Pin/CapturePin.d.ts.map +1 -0
- package/lib/typescript/src/components/Pin/NextButton.d.ts +4 -0
- package/lib/typescript/src/components/Pin/NextButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Pin/ShowHideButton.d.ts +4 -0
- package/lib/typescript/src/components/Pin/ShowHideButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Pin/styles.d.ts +54 -0
- package/lib/typescript/src/components/Pin/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/PinState/LoadingState.d.ts +7 -0
- package/lib/typescript/src/components/PinState/LoadingState.d.ts.map +1 -0
- package/lib/typescript/src/components/PinState/PinState.d.ts +8 -0
- package/lib/typescript/src/components/PinState/PinState.d.ts.map +1 -0
- package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts +4 -0
- package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts.map +1 -0
- package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts +4 -0
- package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts.map +1 -0
- package/lib/typescript/src/components/SetPin/SetPin.d.ts +5 -0
- package/lib/typescript/src/components/SetPin/SetPin.d.ts.map +1 -0
- package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts +4 -0
- package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts.map +1 -0
- package/lib/typescript/src/components/SetPin/styles.d.ts +22 -0
- package/lib/typescript/src/components/SetPin/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts +4 -0
- package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts.map +1 -0
- package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts +5 -0
- package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts.map +1 -0
- package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts +5 -0
- package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts.map +1 -0
- package/lib/typescript/src/components/VerifyPin/styles.d.ts +19 -0
- package/lib/typescript/src/components/VerifyPin/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/ViewPin/ViewPin.d.ts +5 -0
- package/lib/typescript/src/components/ViewPin/ViewPin.d.ts.map +1 -0
- package/lib/typescript/src/components/ViewPin/styles.d.ts +12 -0
- package/lib/typescript/src/components/ViewPin/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts +7 -0
- package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts.map +1 -0
- package/lib/typescript/src/config/configCard.d.ts +3 -0
- package/lib/typescript/src/config/configCard.d.ts.map +1 -0
- package/lib/typescript/src/config/localization.d.ts +39 -0
- package/lib/typescript/src/config/localization.d.ts.map +1 -0
- package/lib/typescript/src/config/themeColors.d.ts +29 -0
- package/lib/typescript/src/config/themeColors.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useChangePin.d.ts +9 -0
- package/lib/typescript/src/hooks/useChangePin.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useGetCardDetails.d.ts +9 -0
- package/lib/typescript/src/hooks/useGetCardDetails.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSetPin.d.ts +9 -0
- package/lib/typescript/src/hooks/useSetPin.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useVerifyPin.d.ts +9 -0
- package/lib/typescript/src/hooks/useVerifyPin.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useViewPin.d.ts +9 -0
- package/lib/typescript/src/hooks/useViewPin.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts +37 -0
- package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts.map +1 -0
- package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts +62 -0
- package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts.map +1 -0
- package/lib/typescript/src/interfaces/NiInterfaces.d.ts +232 -0
- package/lib/typescript/src/interfaces/NiInterfaces.d.ts.map +1 -0
- package/lib/typescript/src/nativeComponents/NICardManagementSDKModule.d.ts +4 -0
- package/lib/typescript/src/nativeComponents/NICardManagementSDKModule.d.ts.map +1 -0
- package/lib/typescript/src/utils/formatInput.d.ts +4 -0
- package/lib/typescript/src/utils/formatInput.d.ts.map +1 -0
- package/lib/typescript/src/utils/localization.d.ts +20 -0
- package/lib/typescript/src/utils/localization.d.ts.map +1 -0
- package/package.json +167 -0
- package/react-native-ni-card-management.podspec +43 -0
- package/src/NICardManagementComponents/CardDetailsComponent.tsx +77 -0
- package/src/NICardManagementComponents/ChangePinView.tsx +41 -0
- package/src/NICardManagementComponents/NiInputInterfaces.ts +14 -0
- package/src/NICardManagementComponents/SetPinView.tsx +38 -0
- package/src/NICardManagementComponents/VerifyPinView.tsx +42 -0
- package/src/NICardManagementComponents/ViewPinComponent.tsx +48 -0
- package/src/assets/icons/content-copy.png +0 -0
- package/src/assets/icons/eye-off-outline.png +0 -0
- package/src/assets/icons/eye-outline.png +0 -0
- package/src/assets/icons/icons8-arrow-100.png +0 -0
- package/src/assets/icons/icons8-arrow-100_1.png +0 -0
- package/src/assets/icons/red-eye-off-outline.png +0 -0
- package/src/assets/icons/red-eye-outline.png +0 -0
- package/src/assets/images/grayCard.png +0 -0
- package/src/components/CardDetails/CardDetails.tsx +24 -0
- package/src/components/CardDetails/CardDetailsBackgroundImage.tsx +33 -0
- package/src/components/CardDetails/CardDetailsGroups.tsx +119 -0
- package/src/components/CardDetails/CardHolderNameGroups.tsx +101 -0
- package/src/components/CardDetails/CardNumberGroup.tsx +101 -0
- package/src/components/CardDetails/DateCVVGroupOneRow.tsx +146 -0
- package/src/components/CardDetails/styles.ts +105 -0
- package/src/components/ChangePin/CaptureCurrentPin.tsx +39 -0
- package/src/components/ChangePin/CaptureNewPin.tsx +39 -0
- package/src/components/ChangePin/ChangePin.tsx +153 -0
- package/src/components/ChangePin/ConfirmPin.tsx +47 -0
- package/src/components/ChangePin/ReenterNewPin.tsx +45 -0
- package/src/components/ChangePin/styles.ts +24 -0
- package/src/components/NIButton/NIButton.tsx +57 -0
- package/src/components/NIButton/styles.ts +10 -0
- package/src/components/Pin/CapturePin.tsx +227 -0
- package/src/components/Pin/NextButton.tsx +50 -0
- package/src/components/Pin/ShowHideButton.tsx +53 -0
- package/src/components/Pin/styles.ts +56 -0
- package/src/components/PinState/LoadingState.tsx +30 -0
- package/src/components/PinState/PinState.tsx +33 -0
- package/src/components/SetPin/ConfirmPin.tsx +47 -0
- package/src/components/SetPin/ReenterCardPin.tsx +45 -0
- package/src/components/SetPin/SetPin.tsx +140 -0
- package/src/components/SetPin/SetUpNewCardPin.tsx +39 -0
- package/src/components/SetPin/styles.ts +24 -0
- package/src/components/VerifyPin/CaptureVerifyPin.tsx +39 -0
- package/src/components/VerifyPin/ConfirmPin.tsx +49 -0
- package/src/components/VerifyPin/VerifyPin.tsx +105 -0
- package/src/components/VerifyPin/styles.ts +21 -0
- package/src/components/ViewPin/ViewPin.tsx +99 -0
- package/src/components/ViewPin/styles.ts +14 -0
- package/src/components/icons/PredeterminedIcon.tsx +41 -0
- package/src/config/configCard.ts +2 -0
- package/src/config/localization.ts +44 -0
- package/src/config/themeColors.ts +37 -0
- package/src/hooks/useChangePin.ts +39 -0
- package/src/hooks/useGetCardDetails.ts +38 -0
- package/src/hooks/useSetPin.ts +37 -0
- package/src/hooks/useVerifyPin.ts +37 -0
- package/src/hooks/useViewPin.ts +35 -0
- package/src/index.tsx +6 -0
- package/src/interfaces/NiCardManagementInterfaces.ts +61 -0
- package/src/interfaces/NiInputInterfaces.ts +78 -0
- package/src/interfaces/NiInterfaces.ts +259 -0
- package/src/nativeComponents/NICardManagementSDKModule.ts +5 -0
- package/src/utils/formatInput.ts +8 -0
- package/src/utils/localization.ts +10 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |s|
|
|
7
|
+
s.name = "react-native-ni-card-management"
|
|
8
|
+
s.version = package["version"]
|
|
9
|
+
s.summary = package["description"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.authors = package["author"]
|
|
13
|
+
|
|
14
|
+
s.platforms = { :ios => "12.0" }
|
|
15
|
+
s.source = { :git => "#{package["homepage"]}", :tag => "#{s.version}" }
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
17
|
+
|
|
18
|
+
s.dependency "React-Core"
|
|
19
|
+
s.dependency "NICardManagementSDK", '1.1.0'
|
|
20
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
22
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
23
|
+
install_modules_dependencies(s)
|
|
24
|
+
else
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
29
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
30
|
+
s.pod_target_xcconfig = {
|
|
31
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
32
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
33
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
34
|
+
}
|
|
35
|
+
s.dependency "React-Codegen"
|
|
36
|
+
s.dependency "RCT-Folly"
|
|
37
|
+
s.dependency "RCTRequired"
|
|
38
|
+
s.dependency "RCTTypeSafety"
|
|
39
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { StyleSheet, type TextStyle, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { NICardDetailsComponent } from '../interfaces/NiInterfaces';
|
|
5
|
+
import { CardDetails } from '../components/CardDetails/CardDetails';
|
|
6
|
+
import PinState from '../components/PinState/PinState';
|
|
7
|
+
import { useGetCardDetails } from '../hooks/useGetCardDetails';
|
|
8
|
+
import { NIThemeEnum } from '../interfaces/NiInputInterfaces';
|
|
9
|
+
import type { NIGetCardSuccessResponse } from '../interfaces/NiCardManagementInterfaces';
|
|
10
|
+
import { themeColors } from '../config/themeColors';
|
|
11
|
+
|
|
12
|
+
function CardDetailsComponent({
|
|
13
|
+
input,
|
|
14
|
+
callback,
|
|
15
|
+
}: NICardDetailsComponent): JSX.Element {
|
|
16
|
+
const { displayAttributes } = input || {};
|
|
17
|
+
const theme = displayAttributes?.theme || NIThemeEnum.light;
|
|
18
|
+
const cardDetailsStyle: TextStyle = {
|
|
19
|
+
height: '100%',
|
|
20
|
+
width: '100%',
|
|
21
|
+
backgroundColor:
|
|
22
|
+
theme === NIThemeEnum.light
|
|
23
|
+
? themeColors.light.background
|
|
24
|
+
: themeColors.dark.background,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
result: getCardDetailsResult,
|
|
29
|
+
error: getCardDetailsError,
|
|
30
|
+
isLoading: getCardDetailsIsLoading,
|
|
31
|
+
onGetCardDetails,
|
|
32
|
+
} = useGetCardDetails();
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
input && onGetCardDetails(input, callback);
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
const error_getCardDetailsResult: NIGetCardSuccessResponse = {
|
|
39
|
+
clearPan: '-',
|
|
40
|
+
maskedPan: '-',
|
|
41
|
+
expiry: '-',
|
|
42
|
+
clearCVV2: '-',
|
|
43
|
+
cardholderName: '-',
|
|
44
|
+
};
|
|
45
|
+
return (
|
|
46
|
+
<View style={cardDetailsStyle}>
|
|
47
|
+
<View style={styles.cardDetailsStyle}>
|
|
48
|
+
<CardDetails
|
|
49
|
+
displayAttributes={displayAttributes}
|
|
50
|
+
getCardDetailsResult={
|
|
51
|
+
!getCardDetailsError
|
|
52
|
+
? getCardDetailsResult
|
|
53
|
+
: error_getCardDetailsResult
|
|
54
|
+
}
|
|
55
|
+
isError={!!getCardDetailsError}
|
|
56
|
+
/>
|
|
57
|
+
<PinState
|
|
58
|
+
isLoading={getCardDetailsIsLoading}
|
|
59
|
+
theme={theme}
|
|
60
|
+
isCardDetails={true}
|
|
61
|
+
/>
|
|
62
|
+
</View>
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const styles = StyleSheet.create({
|
|
68
|
+
cardDetailsStyle: {
|
|
69
|
+
marginTop: 60,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
CardDetailsComponent,
|
|
75
|
+
useGetCardDetails,
|
|
76
|
+
type NIGetCardSuccessResponse,
|
|
77
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { NIPinTypeEnum, NIThemeEnum } from '../interfaces/NiInputInterfaces';
|
|
4
|
+
import { type NIChangePinView } from '../interfaces/NiInterfaces';
|
|
5
|
+
import { useChangePin } from '../hooks/useChangePin';
|
|
6
|
+
import ChangePin from '../components/ChangePin/ChangePin';
|
|
7
|
+
import PinState from '../components/PinState/PinState';
|
|
8
|
+
|
|
9
|
+
function ChangePinView({
|
|
10
|
+
input,
|
|
11
|
+
type,
|
|
12
|
+
callback,
|
|
13
|
+
}: NIChangePinView): JSX.Element {
|
|
14
|
+
const theme = input?.displayAttributes?.theme || NIThemeEnum.light;
|
|
15
|
+
|
|
16
|
+
const _pinType = type || NIPinTypeEnum.dynamicFourToSix;
|
|
17
|
+
const pinType = [0, 4, 5, 6].includes(type || NIPinTypeEnum.dynamicFourToSix)
|
|
18
|
+
? _pinType
|
|
19
|
+
: NIPinTypeEnum.dynamicFourToSix;
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
result: changePinResult,
|
|
23
|
+
isLoading: isChangePinLoading,
|
|
24
|
+
onChangePin,
|
|
25
|
+
} = useChangePin();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<ChangePin
|
|
30
|
+
input={input}
|
|
31
|
+
pinType={pinType || NIPinTypeEnum.dynamicFourToSix}
|
|
32
|
+
result={changePinResult}
|
|
33
|
+
isLoading={isChangePinLoading}
|
|
34
|
+
onChangePin={onChangePin}
|
|
35
|
+
callback={callback}
|
|
36
|
+
/>
|
|
37
|
+
<PinState isLoading={isChangePinLoading} theme={theme} />
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
export { ChangePinView, useChangePin };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NIErrorResponse,
|
|
3
|
+
NIInputInterface,
|
|
4
|
+
NIConnectionProperties,
|
|
5
|
+
NIGetCardSuccessResponse,
|
|
6
|
+
} from '../interfaces/NiCardManagementInterfaces';
|
|
7
|
+
export type {
|
|
8
|
+
NIErrorResponse,
|
|
9
|
+
NIInputInterface,
|
|
10
|
+
NIConnectionProperties,
|
|
11
|
+
NIGetCardSuccessResponse,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export * from '../interfaces/NiInputInterfaces';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { NIPinTypeEnum, NIThemeEnum } from '../interfaces/NiInputInterfaces';
|
|
4
|
+
import { type NISetPinView } from '../interfaces/NiInterfaces';
|
|
5
|
+
import { useSetPin } from '../hooks/useSetPin';
|
|
6
|
+
import SetPin from '../components/SetPin/SetPin';
|
|
7
|
+
import PinState from '../components/PinState/PinState';
|
|
8
|
+
|
|
9
|
+
function SetPinView({ input, type, callback }: NISetPinView): JSX.Element {
|
|
10
|
+
const theme = input?.displayAttributes?.theme || NIThemeEnum.light;
|
|
11
|
+
|
|
12
|
+
const _pinType = type || NIPinTypeEnum.dynamicFourToSix;
|
|
13
|
+
const pinType = [0, 4, 5, 6].includes(type || NIPinTypeEnum.dynamicFourToSix)
|
|
14
|
+
? _pinType
|
|
15
|
+
: NIPinTypeEnum.dynamicFourToSix;
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
result: setPinResult,
|
|
19
|
+
isLoading: isSetPinLoading,
|
|
20
|
+
onSetPin,
|
|
21
|
+
} = useSetPin();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<SetPin
|
|
26
|
+
input={input}
|
|
27
|
+
pinType={pinType || NIPinTypeEnum.dynamicFourToSix}
|
|
28
|
+
result={setPinResult}
|
|
29
|
+
isLoading={isSetPinLoading}
|
|
30
|
+
onSetPin={onSetPin}
|
|
31
|
+
callback={callback}
|
|
32
|
+
/>
|
|
33
|
+
<PinState isLoading={isSetPinLoading} theme={theme} />
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { SetPinView, useSetPin };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { NIPinTypeEnum, NIThemeEnum } from '../interfaces/NiInputInterfaces';
|
|
4
|
+
import { type NIVerifyPinView } from '../interfaces/NiInterfaces';
|
|
5
|
+
import { useVerifyPin } from '../hooks/useVerifyPin';
|
|
6
|
+
import VerifyPin from '../components/VerifyPin/VerifyPin';
|
|
7
|
+
import PinState from '../components/PinState/PinState';
|
|
8
|
+
|
|
9
|
+
function VerifyPinView({
|
|
10
|
+
input,
|
|
11
|
+
type,
|
|
12
|
+
callback,
|
|
13
|
+
}: NIVerifyPinView): JSX.Element {
|
|
14
|
+
const theme = input?.displayAttributes?.theme || NIThemeEnum.light;
|
|
15
|
+
|
|
16
|
+
const _pinType = type || NIPinTypeEnum.dynamicFourToSix;
|
|
17
|
+
const pinType = [0, 4, 5, 6].includes(type || NIPinTypeEnum.dynamicFourToSix)
|
|
18
|
+
? _pinType
|
|
19
|
+
: NIPinTypeEnum.dynamicFourToSix;
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
result: verifyPinResult,
|
|
23
|
+
isLoading: isVerifyPinLoading,
|
|
24
|
+
onVerifyPin,
|
|
25
|
+
} = useVerifyPin();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<VerifyPin
|
|
30
|
+
input={input}
|
|
31
|
+
pinType={pinType}
|
|
32
|
+
result={verifyPinResult}
|
|
33
|
+
isLoading={isVerifyPinLoading}
|
|
34
|
+
onVerifyPin={onVerifyPin}
|
|
35
|
+
callback={callback}
|
|
36
|
+
/>
|
|
37
|
+
<PinState isLoading={isVerifyPinLoading} theme={theme} />
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { VerifyPinView, useVerifyPin };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
import { NIPinTypeEnum, NIThemeEnum } from '../interfaces/NiInputInterfaces';
|
|
4
|
+
import { type NIViewPinComponent } from '../interfaces/NiInterfaces';
|
|
5
|
+
import { useViewPin } from '../hooks/useViewPin';
|
|
6
|
+
import PinState from '../components/PinState/PinState';
|
|
7
|
+
import ViewPin from '../components/ViewPin/ViewPin';
|
|
8
|
+
|
|
9
|
+
function ViewPinComponent({
|
|
10
|
+
input,
|
|
11
|
+
type: pinType,
|
|
12
|
+
callback,
|
|
13
|
+
}: NIViewPinComponent): JSX.Element {
|
|
14
|
+
const theme = input?.displayAttributes?.theme || NIThemeEnum.light;
|
|
15
|
+
const countdownTime = input?.timer;
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
result: viewPinResult,
|
|
19
|
+
error: viewPinError,
|
|
20
|
+
isLoading: isViewPinLoading,
|
|
21
|
+
onViewPin,
|
|
22
|
+
} = useViewPin();
|
|
23
|
+
|
|
24
|
+
(!!viewPinResult || !!viewPinError) &&
|
|
25
|
+
console.log('ViewPinView', {
|
|
26
|
+
viewPinResult,
|
|
27
|
+
viewPinError,
|
|
28
|
+
isViewPinLoading,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
input && onViewPin(input, callback);
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<ViewPin
|
|
38
|
+
input={input}
|
|
39
|
+
pinType={pinType || NIPinTypeEnum.dynamicFourToSix}
|
|
40
|
+
result={viewPinResult || ''}
|
|
41
|
+
countdownTime={countdownTime || 0}
|
|
42
|
+
/>
|
|
43
|
+
<PinState isLoading={isViewPinLoading} theme={theme} />
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { ViewPinComponent, useViewPin };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { type NICardDetails } from '../../interfaces/NiInterfaces';
|
|
4
|
+
import { CardDetailsBackgroundImage } from './CardDetailsBackgroundImage';
|
|
5
|
+
import styles from './styles';
|
|
6
|
+
import { View } from 'react-native';
|
|
7
|
+
|
|
8
|
+
export function CardDetails({
|
|
9
|
+
displayAttributes,
|
|
10
|
+
getCardDetailsResult,
|
|
11
|
+
isError,
|
|
12
|
+
}: NICardDetails): JSX.Element {
|
|
13
|
+
return (
|
|
14
|
+
<View style={styles.cardDetailsContainer}>
|
|
15
|
+
<View style={styles.cardDetailsRow}>
|
|
16
|
+
<CardDetailsBackgroundImage
|
|
17
|
+
displayAttributes={displayAttributes}
|
|
18
|
+
getCardDetailsResult={getCardDetailsResult}
|
|
19
|
+
isError={isError}
|
|
20
|
+
/>
|
|
21
|
+
</View>
|
|
22
|
+
</View>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageBackground, type ImageURISource } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { type NICardDetailsImage } from '../../interfaces/NiInterfaces';
|
|
5
|
+
import { CardDetailsGroups } from './CardDetailsGroups';
|
|
6
|
+
import { styles } from './styles';
|
|
7
|
+
|
|
8
|
+
export function CardDetailsBackgroundImage({
|
|
9
|
+
displayAttributes,
|
|
10
|
+
getCardDetailsResult,
|
|
11
|
+
isError,
|
|
12
|
+
}: NICardDetailsImage): JSX.Element {
|
|
13
|
+
const backgroundImageDefault =
|
|
14
|
+
require('../../assets/images/grayCard.png') as ImageURISource;
|
|
15
|
+
|
|
16
|
+
const backgroundImage =
|
|
17
|
+
displayAttributes?.cardAttributes?.backgroundImage ||
|
|
18
|
+
backgroundImageDefault;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<ImageBackground
|
|
22
|
+
source={backgroundImage}
|
|
23
|
+
style={styles.containerCardDetails}
|
|
24
|
+
imageStyle={styles.backgroundImageStyle}
|
|
25
|
+
>
|
|
26
|
+
<CardDetailsGroups
|
|
27
|
+
displayAttributes={displayAttributes}
|
|
28
|
+
getCardDetailsResult={getCardDetailsResult}
|
|
29
|
+
isError={isError}
|
|
30
|
+
/>
|
|
31
|
+
</ImageBackground>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, useWindowDimensions, I18nManager } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
NILabels,
|
|
6
|
+
NILanguageEnum,
|
|
7
|
+
NIThemeEnum,
|
|
8
|
+
} from '../../interfaces/NiInputInterfaces';
|
|
9
|
+
import { type NICardDetailsGroups } from '../../interfaces/NiInterfaces';
|
|
10
|
+
import { CardDetailsCardNumberGroup } from './CardNumberGroup';
|
|
11
|
+
import { CardDetailsDateCVVGroupOneRow } from './DateCVVGroupOneRow';
|
|
12
|
+
import { CardDetailsCardHolderNameGroups } from './CardHolderNameGroups';
|
|
13
|
+
import { styles } from './styles';
|
|
14
|
+
import { WIDTH_CARD } from '../../config/configCard';
|
|
15
|
+
import { NIButton } from '../NIButton/NIButton';
|
|
16
|
+
import { themeColors } from '../../config/themeColors';
|
|
17
|
+
import localLabels from '../../utils/localization';
|
|
18
|
+
|
|
19
|
+
export function CardDetailsGroups({
|
|
20
|
+
displayAttributes,
|
|
21
|
+
getCardDetailsResult,
|
|
22
|
+
isError,
|
|
23
|
+
}: NICardDetailsGroups): JSX.Element {
|
|
24
|
+
const language =
|
|
25
|
+
(displayAttributes?.language as string) || NILanguageEnum.english;
|
|
26
|
+
const theme = displayAttributes?.theme || NIThemeEnum.light;
|
|
27
|
+
|
|
28
|
+
const shouldHide = displayAttributes?.cardAttributes?.shouldHide || false;
|
|
29
|
+
const [cardDetailsVisible, setCardDetailsVisible] = useState(shouldHide);
|
|
30
|
+
const [isVisibleCopiedButton, setIsVisibleCopiedButton] = useState(false);
|
|
31
|
+
const [timeoutId, setTimeoutId] = useState<NodeJS.Timeout>();
|
|
32
|
+
|
|
33
|
+
const { width } = useWindowDimensions();
|
|
34
|
+
const leftAlignment =
|
|
35
|
+
displayAttributes?.cardAttributes?.textPositioning?.leftAlignment || 0.09;
|
|
36
|
+
const groupsLeftAlignment = Math.round(
|
|
37
|
+
(leftAlignment * width * WIDTH_CARD) / 100
|
|
38
|
+
);
|
|
39
|
+
const containerGroupsLeftAlignmentStyle = {
|
|
40
|
+
marginLeft: groupsLeftAlignment,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const textColor =
|
|
44
|
+
theme === NIThemeEnum.light
|
|
45
|
+
? themeColors.light.buttonCopiedTextColor
|
|
46
|
+
: themeColors.dark.buttonCopiedTextColor;
|
|
47
|
+
|
|
48
|
+
const setTimeOut = () => {
|
|
49
|
+
clearTimeout(timeoutId);
|
|
50
|
+
|
|
51
|
+
setTimeoutId(
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
setIsVisibleCopiedButton(false);
|
|
54
|
+
setTimeoutId(undefined);
|
|
55
|
+
}, 4000)
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
{getCardDetailsResult && (
|
|
62
|
+
<View
|
|
63
|
+
style={[
|
|
64
|
+
styles.containerGroupsLeftAlignment,
|
|
65
|
+
containerGroupsLeftAlignmentStyle,
|
|
66
|
+
I18nManager.isRTL ? { flexDirection: 'row-reverse' } : {},
|
|
67
|
+
]}
|
|
68
|
+
>
|
|
69
|
+
<CardDetailsCardNumberGroup
|
|
70
|
+
clearPan={getCardDetailsResult.clearPan}
|
|
71
|
+
maskedPan={getCardDetailsResult.maskedPan}
|
|
72
|
+
pinContentIndex={NILabels.cardNumberValueLabel}
|
|
73
|
+
cardDetailsVisible={cardDetailsVisible}
|
|
74
|
+
setIsVisibleCopiedButton={setIsVisibleCopiedButton}
|
|
75
|
+
displayAttributes={displayAttributes}
|
|
76
|
+
setTimeOut={setTimeOut}
|
|
77
|
+
/>
|
|
78
|
+
<CardDetailsDateCVVGroupOneRow
|
|
79
|
+
expiry={getCardDetailsResult.expiry}
|
|
80
|
+
clearCVV2={getCardDetailsResult.clearCVV2}
|
|
81
|
+
pinLabelIndex={NILabels.expiryDateLabel}
|
|
82
|
+
pinContentIndex={NILabels.expiryDateValueLabel}
|
|
83
|
+
pinLabel1Index={NILabels.cvvLabel}
|
|
84
|
+
pinContent1Index={NILabels.cvvValueLabel}
|
|
85
|
+
cardDetailsVisible={{ cardDetailsVisible, setCardDetailsVisible }}
|
|
86
|
+
shouldHide={shouldHide}
|
|
87
|
+
displayAttributes={displayAttributes}
|
|
88
|
+
isError={isError}
|
|
89
|
+
/>
|
|
90
|
+
<CardDetailsCardHolderNameGroups
|
|
91
|
+
cardholderName={getCardDetailsResult.cardholderName}
|
|
92
|
+
pinContentIndex={NILabels.cardholderNameLabel}
|
|
93
|
+
cardDetailsVisible={cardDetailsVisible}
|
|
94
|
+
setIsVisibleCopiedButton={setIsVisibleCopiedButton}
|
|
95
|
+
setTimeOut={setTimeOut}
|
|
96
|
+
displayAttributes={displayAttributes}
|
|
97
|
+
/>
|
|
98
|
+
{isVisibleCopiedButton && (
|
|
99
|
+
<View
|
|
100
|
+
style={[
|
|
101
|
+
styles.copyButton,
|
|
102
|
+
I18nManager.isRTL ? { marginRight: '15%' } : {},
|
|
103
|
+
]}
|
|
104
|
+
>
|
|
105
|
+
<NIButton
|
|
106
|
+
title={localLabels(language).copiedToClipboard}
|
|
107
|
+
mode="text"
|
|
108
|
+
textColor={textColor}
|
|
109
|
+
colors={['#bbb', '#bbb', '#bbb']}
|
|
110
|
+
disabled={false}
|
|
111
|
+
opacity={0.8}
|
|
112
|
+
/>
|
|
113
|
+
</View>
|
|
114
|
+
)}
|
|
115
|
+
</View>
|
|
116
|
+
)}
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
type TextStyle,
|
|
4
|
+
View,
|
|
5
|
+
Text,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
I18nManager,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { useClipboard } from '@react-native-community/clipboard';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
type NIFontLabelPair,
|
|
13
|
+
NIThemeEnum,
|
|
14
|
+
} from '../../interfaces/NiInputInterfaces';
|
|
15
|
+
import { type NICardDetailsCardHolderNameGroups } from '../../interfaces/NiInterfaces';
|
|
16
|
+
import { styles } from './styles';
|
|
17
|
+
import { HEIGHT_CARD } from '../../config/configCard';
|
|
18
|
+
import { themeColors } from '../../config/themeColors';
|
|
19
|
+
import { PredeterminedIcon } from '../icons/PredeterminedIcon';
|
|
20
|
+
|
|
21
|
+
export function CardDetailsCardHolderNameGroups({
|
|
22
|
+
cardholderName,
|
|
23
|
+
pinContentIndex,
|
|
24
|
+
cardDetailsVisible,
|
|
25
|
+
setIsVisibleCopiedButton,
|
|
26
|
+
displayAttributes,
|
|
27
|
+
setTimeOut,
|
|
28
|
+
}: NICardDetailsCardHolderNameGroups): JSX.Element {
|
|
29
|
+
const [data, setString] = useClipboard();
|
|
30
|
+
|
|
31
|
+
const maskedCardholderName = cardholderName.replace(
|
|
32
|
+
/\b\w*/g,
|
|
33
|
+
function (s: string) {
|
|
34
|
+
return s.replace(/(?<!^)./g, '*');
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
const cardholderNameRendered = cardDetailsVisible
|
|
38
|
+
? maskedCardholderName
|
|
39
|
+
: cardholderName;
|
|
40
|
+
|
|
41
|
+
const holderNameContentGroupTopAlignment = Math.round(
|
|
42
|
+
(displayAttributes?.cardAttributes?.textPositioning
|
|
43
|
+
?.cardHolderNameGroupTopAlignment || 0.8) * HEIGHT_CARD
|
|
44
|
+
);
|
|
45
|
+
const containerHolderNameContentGroupTopAlignmentStyle: TextStyle = {
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
top: holderNameContentGroupTopAlignment,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const theme = displayAttributes?.theme || NIThemeEnum.light;
|
|
51
|
+
|
|
52
|
+
const textFonts = displayAttributes?.fonts?.filter(
|
|
53
|
+
(item: NIFontLabelPair) => item.label === pinContentIndex
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
let textFont = textFonts && textFonts.length && textFonts[0]?.font;
|
|
57
|
+
textFont = textFont || { name: 'Helvetica', size: 17 };
|
|
58
|
+
|
|
59
|
+
const contentStyleText: TextStyle = {
|
|
60
|
+
color:
|
|
61
|
+
theme === NIThemeEnum.light
|
|
62
|
+
? themeColors.light.colorCard
|
|
63
|
+
: themeColors.dark.colorCard,
|
|
64
|
+
fontSize: textFont.size,
|
|
65
|
+
fontFamily: textFont.name,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
async function handleOnPress(): Promise<void> {
|
|
69
|
+
await setString(cardholderName);
|
|
70
|
+
setIsVisibleCopiedButton(true);
|
|
71
|
+
setTimeOut();
|
|
72
|
+
}
|
|
73
|
+
!!data && console.log('clipboard', data);
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<>
|
|
77
|
+
<View
|
|
78
|
+
style={[
|
|
79
|
+
styles.containerHolderNameContentGroupTopAlignment,
|
|
80
|
+
containerHolderNameContentGroupTopAlignmentStyle,
|
|
81
|
+
]}
|
|
82
|
+
>
|
|
83
|
+
<View
|
|
84
|
+
style={[
|
|
85
|
+
styles.copyRow,
|
|
86
|
+
I18nManager.isRTL ? { flexDirection: 'row-reverse' } : {},
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<Text style={[styles.textContent, contentStyleText]}>
|
|
90
|
+
{cardholderNameRendered}
|
|
91
|
+
</Text>
|
|
92
|
+
{!cardDetailsVisible && (
|
|
93
|
+
<TouchableOpacity onPress={handleOnPress}>
|
|
94
|
+
<PredeterminedIcon name="content-copy" size={13} />
|
|
95
|
+
</TouchableOpacity>
|
|
96
|
+
)}
|
|
97
|
+
</View>
|
|
98
|
+
</View>
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
}
|