@alipay/ams-checkout 0.0.1730107332-dev.4 → 0.0.1730706734-dev.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/dist/umd/ams-checkout.min.js +1 -1
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +6 -1
- package/esm/constant/index.js +80 -3
- package/esm/core/bus/ability/callback.d.ts +9 -0
- package/esm/{foundation/service/api-bus → core/bus}/ability/callback.js +1 -1
- package/esm/core/bus/ability/globalData.d.ts +10 -0
- package/esm/{foundation/service/api-bus → core/bus}/ability/globalData.js +2 -2
- package/esm/{foundation/service/api-bus → core/bus}/ability/request.d.ts +1 -1
- package/esm/{foundation/service/api-bus → core/bus}/ability/request.js +2 -2
- package/esm/core/bus/ability/security.d.ts +10 -0
- package/esm/core/bus/ability/security.js +104 -0
- package/esm/core/bus/ability/tracker.d.ts +9 -0
- package/esm/core/bus/ability/tracker.js +77 -0
- package/esm/core/bus/index.d.ts +125 -0
- package/esm/core/bus/index.js +366 -0
- package/esm/core/component/address.d.ts +8 -0
- package/esm/core/component/address.js +72 -0
- package/esm/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/core/component/appPreloadProcessing.js +91 -0
- package/esm/core/component/ckp/index.d.ts +27 -0
- package/esm/core/component/ckp/index.js +166 -0
- package/esm/core/component/element/components/address.d.ts +19 -0
- package/esm/core/component/element/components/address.js +68 -0
- package/esm/core/component/element/components/auth.d.ts +17 -0
- package/esm/core/component/element/components/auth.js +59 -0
- package/esm/core/component/element/components/payment.d.ts +19 -0
- package/esm/core/component/element/components/payment.js +74 -0
- package/esm/core/component/element/element-mock.d.ts +2 -0
- package/esm/core/component/element/element-mock.js +263 -0
- package/esm/core/component/element/index.d.ts +47 -0
- package/esm/core/component/element/index.js +776 -0
- package/esm/core/component/element/mock.d.ts +3 -0
- package/esm/core/component/element/mock.js +1156 -0
- package/esm/core/component/element/type.d.ts +176 -0
- package/esm/core/component/element/type.js +34 -0
- package/esm/core/component/element/utils.d.ts +13 -0
- package/esm/core/component/element/utils.js +6 -0
- package/esm/core/component/index.d.ts +51 -0
- package/esm/core/component/index.js +535 -0
- package/esm/core/drop-in/index.d.ts +22 -0
- package/esm/core/drop-in/index.js +104 -0
- package/esm/core/instance/index.d.ts +89 -0
- package/esm/core/instance/index.js +500 -0
- package/esm/foundation/core/index.d.ts +3 -3
- package/esm/foundation/core/index.js +51 -114
- package/esm/foundation/index.d.ts +3 -5
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +4 -7
- package/esm/foundation/product-processor/easysafepay/deps.js +2 -5
- package/esm/foundation/product-processor/easysafepay/index.d.ts +4 -5
- package/esm/foundation/product-processor/easysafepay/index.js +114 -174
- package/esm/foundation/service/container/index.js +5 -5
- package/esm/foundation/service/container/popup.js +1 -1
- package/esm/foundation/service/event-bus/ability/callback.js +55 -0
- package/esm/foundation/service/{api-bus → event-bus}/ability/globalData.d.ts +1 -1
- package/esm/foundation/service/event-bus/ability/globalData.js +89 -0
- package/esm/foundation/service/event-bus/ability/request.d.ts +10 -0
- package/esm/foundation/service/event-bus/ability/request.js +151 -0
- package/esm/foundation/service/{api-bus → event-bus}/ability/security.js +19 -29
- package/esm/foundation/service/{api-bus → event-bus}/ability/tracker.js +1 -1
- package/esm/foundation/service/{api-bus → event-bus}/busManager.js +1 -1
- package/esm/foundation/service/event-center.d.ts +5 -4
- package/esm/foundation/service/event-center.js +39 -8
- package/esm/foundation/service/global-data/index.js +5 -4
- package/esm/foundation/service/index.js +1 -1
- package/esm/foundation/service/requester/requester.js +11 -14
- package/esm/foundation/service/security/index.d.ts +7 -9
- package/esm/foundation/service/security/index.js +44 -113
- package/esm/foundation/utils/redirect_utils.js +8 -24
- package/esm/foundation/utils/web_app_url_utils.d.ts +2 -11
- package/esm/foundation/utils/web_app_url_utils.js +2 -17
- package/esm/index.d.ts +30 -1
- package/esm/index.js +147 -7
- package/esm/plugin/applepay/component.d.ts +50 -0
- package/esm/plugin/applepay/component.js +339 -0
- package/esm/plugin/applepay/index.d.ts +17 -0
- package/esm/plugin/applepay/index.js +117 -0
- package/esm/plugin/applepay/interface.d.ts +161 -0
- package/esm/plugin/applepay/interface.js +69 -0
- package/esm/plugin/applepay/service.d.ts +54 -0
- package/esm/plugin/applepay/service.js +289 -0
- package/esm/plugin/component/cashierApp.d.ts +36 -0
- package/esm/plugin/component/cashierApp.js +245 -0
- package/esm/{component → plugin/component}/channel.d.ts +2 -1
- package/esm/{component → plugin/component}/channel.js +37 -1
- package/esm/{component → plugin/component}/component.inline.style.d.ts +2 -2
- package/esm/{component → plugin/component}/component.inline.style.js +7 -6
- package/esm/{component → plugin/component}/component.popup.style.d.ts +1 -1
- package/esm/{component → plugin/component}/component.popup.style.js +4 -4
- package/esm/plugin/component/index.d.ts +126 -0
- package/esm/plugin/component/index.js +1862 -0
- package/esm/{component → plugin/component}/popupWindow.style.js +2 -2
- package/esm/plugin/const.d.ts +2 -0
- package/esm/plugin/const.js +33 -0
- package/esm/plugin/drop-in/index.d.ts +71 -0
- package/esm/plugin/drop-in/index.js +324 -0
- package/esm/plugin/payment-element/utils.d.ts +2 -0
- package/esm/plugin/payment-element/utils.js +7 -0
- package/esm/plugin/paypal/index.d.ts +20 -0
- package/esm/plugin/paypal/index.js +390 -0
- package/esm/plugin/type.d.ts +34 -0
- package/esm/plugin/type.js +1 -0
- package/esm/plugin/utils.d.ts +6 -0
- package/esm/plugin/utils.js +21 -0
- package/esm/service/element.d.ts +4 -0
- package/esm/service/element.js +51 -0
- package/esm/service/index.d.ts +1 -0
- package/esm/service/index.js +2 -0
- package/esm/types/index.d.ts +218 -22
- package/esm/types/index.js +47 -4
- package/esm/util/createIframeNode.d.ts +6 -0
- package/esm/util/createIframeNode.js +48 -0
- package/esm/util/getBackScheme.d.ts +2 -2
- package/esm/util/getBackScheme.js +2 -94
- package/esm/util/index.d.ts +11 -1
- package/esm/util/index.js +84 -4
- package/esm/util/intl-callapp/es/index.js +0 -1
- package/esm/util/ua/index.d.ts +2 -0
- package/esm/util/ua/index.js +2 -0
- package/esm/util/ua/isAndroid.d.ts +4 -0
- package/esm/util/ua/isAndroid.js +7 -0
- package/esm/util/ua/isIOS.d.ts +4 -0
- package/esm/util/ua/isIOS.js +7 -0
- package/package.json +2 -1
- package/esm/foundation/utils/payment_product_utils.d.ts +0 -13
- package/esm/foundation/utils/payment_product_utils.js +0 -38
- /package/esm/{foundation/service/api-bus → core/bus}/interface.d.ts +0 -0
- /package/esm/{foundation/service/api-bus → core/bus}/interface.js +0 -0
- /package/esm/foundation/service/{api-bus → event-bus}/ability/callback.d.ts +0 -0
- /package/esm/foundation/service/{api-bus → event-bus}/ability/security.d.ts +0 -0
- /package/esm/foundation/service/{api-bus → event-bus}/ability/tracker.d.ts +0 -0
- /package/esm/foundation/service/{api-bus → event-bus}/busManager.d.ts +0 -0
- /package/esm/foundation/service/{api-bus → event-bus}/index.d.ts +0 -0
- /package/esm/foundation/service/{api-bus → event-bus}/index.js +0 -0
- /package/esm/{component → plugin/component}/popupWindow.style.d.ts +0 -0
@@ -5,9 +5,9 @@
|
|
5
5
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
|
-
import { COMPONENT_CONTAINER_ID, COMPONENT_IFRAME_TAG_ID, INLINE_BASE_STYLE_ID, INLINE_IMG_CLASSNAME, LOADING_ID } from "
|
9
|
-
import { ComponentSignEnum, PlatformEnum } from "
|
10
|
-
import { amsSetSize } from "
|
8
|
+
import { COMPONENT_CONTAINER_ID, COMPONENT_IFRAME_TAG_ID, INLINE_BASE_STYLE_ID, INLINE_IMG_CLASSNAME, LOADING_ID } from "../../constant";
|
9
|
+
import { ComponentSignEnum, PlatformEnum } from "../../types";
|
10
|
+
import { amsSetSize } from "../../util";
|
11
11
|
// border-radius: 8px;
|
12
12
|
var inlineComponentCss = "#".concat(COMPONENT_IFRAME_TAG_ID, "-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(COMPONENT_IFRAME_TAG_ID, "-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(COMPONENT_CONTAINER_ID, "-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(LOADING_ID, "{\n width: 100%;\n flex: 1;\n}\n.").concat(INLINE_IMG_CLASSNAME, "{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(INLINE_IMG_CLASSNAME, "-mobile{\n padding: 0 0.16em;\n}\n.").concat(INLINE_IMG_CLASSNAME, "-desktop{}\n");
|
13
13
|
export var inlineComponentAddCss = function inlineComponentAddCss() {
|
@@ -109,13 +109,14 @@ export var addInlineLoading = function addInlineLoading(_selector, platform, opt
|
|
109
109
|
};
|
110
110
|
export var createInlineBaseElement = function createInlineBaseElement(selector) {
|
111
111
|
var containerId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : COMPONENT_CONTAINER_ID;
|
112
|
+
var selectorId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
112
113
|
var inlineBaseStyle = document.getElementById(INLINE_BASE_STYLE_ID);
|
113
114
|
if (!inlineBaseStyle) inlineComponentAddCss();
|
114
|
-
if (document.getElementById(containerId)) return;
|
115
|
+
if (document.getElementById(selectorId ? selectorId : containerId)) return;
|
115
116
|
var amsComponentContainer = document.createElement('div');
|
116
117
|
amsComponentContainer.className = "".concat(containerId, "-inline");
|
117
|
-
amsComponentContainer.id = containerId;
|
118
|
-
var selectorDom = document.querySelector("
|
118
|
+
amsComponentContainer.id = selectorId ? selectorId : containerId;
|
119
|
+
var selectorDom = document.querySelector("".concat(selector));
|
119
120
|
if (selectorDom) selectorDom.appendChild(amsComponentContainer);
|
120
121
|
return amsComponentContainer;
|
121
122
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PlatformEnum } from '
|
1
|
+
import { PlatformEnum } from '../../types';
|
2
2
|
export declare const componentAddCSS: () => void;
|
3
3
|
export declare const createBaseElement: (platform: PlatformEnum, closeBtnFunc: () => void) => HTMLDivElement;
|
4
4
|
export declare const createCloseBtn: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
|
@@ -5,9 +5,9 @@
|
|
5
5
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
|
-
import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "
|
9
|
-
import { PlatformEnum } from "
|
10
|
-
import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "
|
8
|
+
import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
|
9
|
+
import { PlatformEnum } from "../../types";
|
10
|
+
import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../../util";
|
11
11
|
var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
|
12
12
|
export var componentAddCSS = function componentAddCSS() {
|
13
13
|
var style = document.createElement('style');
|
@@ -31,7 +31,7 @@ export var createBaseElement = function createBaseElement(platform, closeBtnFunc
|
|
31
31
|
amsComponentContainer.classList.remove("".concat(COMPONENT_CONTAINER_ID, "-hidden-").concat(platform));
|
32
32
|
amsComponentContainer.classList.add("".concat(COMPONENT_CONTAINER_ID, "-").concat(platform));
|
33
33
|
createCloseBtn(platform, closeBtnFunc);
|
34
|
-
return
|
34
|
+
return amsComponentContainer;
|
35
35
|
};
|
36
36
|
export var createCloseBtn = function createCloseBtn(platform, closeBtnFunc) {
|
37
37
|
var clickEventName = platform === PlatformEnum.mobile ? 'touchend' : 'click';
|
@@ -0,0 +1,126 @@
|
|
1
|
+
import type AMSCheckout from '../../core/instance';
|
2
|
+
import type { EventPayload, EventPayloadContext, IappendIframeNodesParams, IMerchantAppointParam, Iselector } from '../../types';
|
3
|
+
import { ComponentSignEnum, DeviceIdParameter, DisplayTypeEnum, PlatformEnum } from '../../types';
|
4
|
+
type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: DisplayTypeEnum) => Promise<void>;
|
5
|
+
export default class ComponentApp {
|
6
|
+
app: null | HTMLIFrameElement;
|
7
|
+
AMSSDK: AMSCheckout;
|
8
|
+
platform: PlatformEnum;
|
9
|
+
_performanceData: any[];
|
10
|
+
_loadAppPromiseResolve: ((value: boolean) => void) | null;
|
11
|
+
_isInitComponent: boolean;
|
12
|
+
private _globalData?;
|
13
|
+
private popupApp?;
|
14
|
+
private appDomain;
|
15
|
+
private createIframeNode;
|
16
|
+
private createPreloadIframeNode;
|
17
|
+
private _selector;
|
18
|
+
private _appVersion;
|
19
|
+
private _isRetention;
|
20
|
+
private _allowSubmitPayCallAhead;
|
21
|
+
private _actionQueryPromise;
|
22
|
+
private _actionSubmitPromise;
|
23
|
+
private _renderParams;
|
24
|
+
private _componentSign;
|
25
|
+
private _appLocationSearch;
|
26
|
+
private _renderDisplayType;
|
27
|
+
private _multipleCallbackEvents;
|
28
|
+
private _isAppWebview;
|
29
|
+
_merchantAppointParam: IMerchantAppointParam;
|
30
|
+
private _webAppHeartBeatTimeoutFn;
|
31
|
+
constructor(componentOption?: {
|
32
|
+
appVersion?: string;
|
33
|
+
});
|
34
|
+
/**
|
35
|
+
* @description Cancel listening and destroy the dom
|
36
|
+
*/
|
37
|
+
logoutPlugin(): void;
|
38
|
+
/**
|
39
|
+
* @description When SDK registers plug-ins, it is a required function to receive SDK instances
|
40
|
+
*/
|
41
|
+
applyPlugin(AMSSDK: AMSCheckout): void;
|
42
|
+
private initLoggerMeta;
|
43
|
+
/**
|
44
|
+
* @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
|
45
|
+
*/
|
46
|
+
setRender(renderFunc: IrenderFuncParams): void;
|
47
|
+
setPreloadRender(renderFunc: any): void;
|
48
|
+
private initSecurity;
|
49
|
+
private logDeviceId;
|
50
|
+
getDeviceIdAndLog(deviceIdParameter?: DeviceIdParameter, isPolling?: boolean): Promise<string>;
|
51
|
+
/**
|
52
|
+
* @description render iframe content
|
53
|
+
*/
|
54
|
+
appendIframeNodes(componentSign: ComponentSignEnum, renderParams: IappendIframeNodesParams): Promise<void>;
|
55
|
+
appendPreloadIframeNodes(componentSign: any, productSceneVersion: any): void;
|
56
|
+
private setParameterDefaultValues;
|
57
|
+
private renderInlineLoading;
|
58
|
+
private renderPopupLoading;
|
59
|
+
_createLoadAppPromise(loadTimeLimit?: number): Promise<unknown>;
|
60
|
+
/**
|
61
|
+
* @description Interface request
|
62
|
+
*/
|
63
|
+
private createActionQueryPromise;
|
64
|
+
private createSubmitPromise;
|
65
|
+
private cleanElement;
|
66
|
+
private createPreloadApp;
|
67
|
+
/**
|
68
|
+
* @description Create app
|
69
|
+
*/
|
70
|
+
private createApp;
|
71
|
+
private listener;
|
72
|
+
private resizeListener;
|
73
|
+
private createDialog;
|
74
|
+
private getDeviceIdAndCallback;
|
75
|
+
private getUserAgentAndCallback;
|
76
|
+
private returnDataAndCallback;
|
77
|
+
/**
|
78
|
+
* @description Initialize subscription iframe message
|
79
|
+
*/
|
80
|
+
private addEventListener;
|
81
|
+
private removeEventListener;
|
82
|
+
/**
|
83
|
+
* @description Processing messages from iframe
|
84
|
+
*/
|
85
|
+
_handleAppMessage(data: EventPayload): void;
|
86
|
+
private dismissLoadingFunc;
|
87
|
+
private handleSizeChanged;
|
88
|
+
private handleAuthUrlInfo;
|
89
|
+
private handleRedirect;
|
90
|
+
private handleDeclareInfo;
|
91
|
+
private handleDeclarePopWindowCallback;
|
92
|
+
private handleAppHeartBeat;
|
93
|
+
private isAppAttached;
|
94
|
+
private isWindowVisible;
|
95
|
+
private handleCloseBtnShow;
|
96
|
+
/**
|
97
|
+
* @description Send message to SDK
|
98
|
+
*/
|
99
|
+
dispatchToSDK(event: string, data: any, eventCallbackId?: string): void;
|
100
|
+
/**
|
101
|
+
* @description Send message to iframe
|
102
|
+
*/
|
103
|
+
dispatchToApp(payload: {
|
104
|
+
context: EventPayloadContext;
|
105
|
+
}, targetElement?: any): any;
|
106
|
+
/**
|
107
|
+
* @description Subscribe to messages from SDK
|
108
|
+
*/
|
109
|
+
private subscribeFromSDK;
|
110
|
+
/**
|
111
|
+
* @description Send rendering events to iframe
|
112
|
+
*/
|
113
|
+
private sendRenderEvent;
|
114
|
+
/**
|
115
|
+
* @description close cashier
|
116
|
+
*/
|
117
|
+
private cleanContainer;
|
118
|
+
private hideComponentAnimation;
|
119
|
+
private closeBtnFunc;
|
120
|
+
private retentionPopupLeaveFunc;
|
121
|
+
private removeRetentionPopup;
|
122
|
+
private showRetentionPopup;
|
123
|
+
private hideRetentionPopupFunc;
|
124
|
+
private submitForm;
|
125
|
+
}
|
126
|
+
export {};
|