@alipay/ams-checkout 0.0.1694400497-dev.1 → 1.3.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/{esm/config/request.d.ts → dist/esm/config/index.d.ts} +1 -0
- package/{esm/config/request.js → dist/esm/config/index.js} +3 -1
- package/{esm → dist/esm}/constant/index.d.ts +32 -54
- package/{esm → dist/esm}/constant/index.js +32 -54
- package/dist/esm/core/component/index.d.ts +17 -0
- package/dist/esm/core/component/index.js +146 -0
- package/dist/esm/core/drop-in/index.d.ts +29 -0
- package/{esm → dist/esm}/core/drop-in/index.js +19 -19
- package/{esm → dist/esm}/core/instance/index.d.ts +23 -6
- package/{esm → dist/esm}/core/instance/index.js +75 -32
- package/{esm/config/index.js → dist/esm/index.d.ts} +15 -10
- package/{esm → dist/esm}/index.js +30 -8
- package/dist/esm/plugin/component/appPath.d.ts +2 -0
- package/dist/esm/plugin/component/appPath.js +75 -0
- package/{esm/plugin/component/component.inline.style.d.ts → dist/esm/plugin/component/component.style.d.ts} +1 -4
- package/dist/esm/plugin/component/component.style.js +15 -0
- package/{esm → dist/esm}/plugin/component/index.d.ts +45 -33
- package/{esm → dist/esm}/plugin/component/index.js +450 -316
- package/{esm → dist/esm}/plugin/drop-in/index.d.ts +9 -7
- package/{esm → dist/esm}/plugin/drop-in/index.js +3 -4
- package/{esm → dist/esm/request}/index.d.ts +8 -9
- package/{esm → dist/esm}/request/index.js +13 -11
- package/{esm → dist/esm}/request/utils.d.ts +3 -3
- package/{esm → dist/esm}/request/utils.js +4 -6
- package/dist/esm/service/index.d.ts +2 -0
- package/{esm → dist/esm}/types/index.d.ts +48 -116
- package/dist/esm/types/index.js +94 -0
- package/dist/esm/util/createIframeNode.d.ts +5 -0
- package/dist/esm/util/createIframeNode.js +35 -0
- package/{esm → dist/esm}/util/get.js +0 -7
- package/{esm → dist/esm}/util/index.d.ts +4 -6
- package/{esm → dist/esm}/util/index.js +13 -29
- package/dist/esm/util/mock.js +4 -0
- package/dist/umd/ams-checkout.min.js +1 -1
- package/package.json +1 -1
- package/esm/config/index.d.ts +0 -2
- package/esm/core/component/index.d.ts +0 -24
- package/esm/core/component/index.js +0 -211
- package/esm/core/drop-in/index.d.ts +0 -22
- package/esm/image/skeleton.svg +0 -18
- package/esm/plugin/component/cashierApp.d.ts +0 -23
- package/esm/plugin/component/cashierApp.js +0 -123
- package/esm/plugin/component/component.inline.style.js +0 -38
- package/esm/plugin/component/component.popup.style.d.ts +0 -12
- package/esm/plugin/component/component.popup.style.js +0 -165
- package/esm/request/index.d.ts +0 -8
- package/esm/service/index.d.ts +0 -2
- package/esm/types/index.js +0 -134
- package/esm/util/createIframeNode.d.ts +0 -5
- package/esm/util/createIframeNode.js +0 -42
- package/esm/util/mock.js +0 -3
- /package/{esm → dist/esm}/image/cta.svg +0 -0
- /package/{esm → dist/esm}/service/index.js +0 -0
- /package/{esm → dist/esm}/util/get.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/browser.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/browser.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/evoke.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/evoke.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/generate.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/generate.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/index.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/index.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/main.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/main.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/openWallet.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/openWallet.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/types.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/types.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/config.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/config.js +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/index.d.ts +0 -0
- /package/{esm → dist/esm}/util/intl-callapp/es/utils/index.js +0 -0
- /package/{esm → dist/esm}/util/mock.d.ts +0 -0
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"@alipay/ams-checkout","version":"
|
1
|
+
{"name":"@alipay/ams-checkout","version":"1.3.0","description":"","author":"","main":"dist/esm/index.js","module":"dist/esm/index.js","typings":"dist/esm/index.d.ts","files":["dist","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{}}
|
package/esm/config/index.d.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import ComponentApp from '../../plugin/component';
|
2
|
-
import { IcreateComponent, IoptionsParams, Iselector } from '../../types';
|
3
|
-
import CoreInstance from '../instance/index';
|
4
|
-
export declare class AMSComponent extends CoreInstance {
|
5
|
-
_componentApp: ComponentApp;
|
6
|
-
constructor(options: IoptionsParams);
|
7
|
-
private parameterInitAndCheck;
|
8
|
-
private pluginAppendIframe;
|
9
|
-
/**
|
10
|
-
* @description Create component application
|
11
|
-
* @param params - The data source created by the component, necessary paymentSessionData, optional appearance configuration, and refer to the documentation for other parameters and detailed information.
|
12
|
-
*/
|
13
|
-
createComponent(params: IcreateComponent): Promise<void>;
|
14
|
-
/**
|
15
|
-
* @description Create and render components in the specified element area
|
16
|
-
* @param params - The data source created by the component, necessary paymentSessionData, necessary element selector IDs, optional appearance configurations, and refer to the documentation for other parameters and detailed information.
|
17
|
-
*/
|
18
|
-
mountComponent(params: IcreateComponent, selector: Iselector): Promise<void>;
|
19
|
-
/**
|
20
|
-
* @description Execute payment submission process
|
21
|
-
* @description - When using your own payment button, you can execute the submit payment process by actively calling this function.
|
22
|
-
*/
|
23
|
-
submit(): Promise<unknown>;
|
24
|
-
}
|
@@ -1,211 +0,0 @@
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
5
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
6
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
7
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
8
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
9
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
10
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
11
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
12
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
14
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
15
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
16
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
17
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
18
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
20
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
21
|
-
/**
|
22
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
23
|
-
*
|
24
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
25
|
-
* 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
|
26
|
-
* 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.
|
27
|
-
*/
|
28
|
-
import { v4 as uuid } from 'uuid';
|
29
|
-
import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
|
30
|
-
import ComponentApp from "../../plugin/component";
|
31
|
-
import { componentSignEnum, modeEnum, networkModeEnum, productSceneEnum, renderDisplayTypeEnum } from "../../types";
|
32
|
-
import { isPC } from "../../util";
|
33
|
-
import { createIframeNode } from "../../util/createIframeNode";
|
34
|
-
import CoreInstance from "../instance/index";
|
35
|
-
var getComponentSign = function getComponentSign(params) {
|
36
|
-
var _params$paymentSessio = params.paymentSessionConfig,
|
37
|
-
_params$paymentSessio2 = _params$paymentSessio === void 0 ? {} : _params$paymentSessio,
|
38
|
-
_params$paymentSessio3 = _params$paymentSessio2.productScene,
|
39
|
-
productScene = _params$paymentSessio3 === void 0 ? '' : _params$paymentSessio3,
|
40
|
-
_params$paymentSessio4 = _params$paymentSessio2.paymentMethodCategoryType,
|
41
|
-
paymentMethodCategoryType = _params$paymentSessio4 === void 0 ? '' : _params$paymentSessio4;
|
42
|
-
return productScene && paymentMethodCategoryType ? "".concat(productScene, "_").concat(paymentMethodCategoryType) : componentSignEnum.NONE;
|
43
|
-
};
|
44
|
-
var parsePaymentSessionData = function parsePaymentSessionData(paymentSessionData) {
|
45
|
-
try {
|
46
|
-
return [JSON.parse(atob(paymentSessionData.split('&&')[3])), paymentSessionData.split('&&').slice(0, 3).join('&&')];
|
47
|
-
} catch (error) {
|
48
|
-
console.error('Parsing paymentSessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.');
|
49
|
-
return [{}, paymentSessionData];
|
50
|
-
}
|
51
|
-
};
|
52
|
-
|
53
|
-
// pc easy-pay execute 1.0 Process
|
54
|
-
var resetEasyPaySceneVersion = function resetEasyPaySceneVersion(parseData) {
|
55
|
-
if (isPC() && parseData !== null && parseData !== void 0 && parseData.paymentSessionConfig) {
|
56
|
-
var productScene = parseData.paymentSessionConfig.productScene;
|
57
|
-
if (productScene === productSceneEnum.EASY_PAY) {
|
58
|
-
parseData.paymentSessionConfig.productSceneVersion = '1.0';
|
59
|
-
}
|
60
|
-
}
|
61
|
-
};
|
62
|
-
var handlePaymentSessionData = function handlePaymentSessionData(originPaymentSessionData) {
|
63
|
-
var _parsePaymentSessionD = parsePaymentSessionData(originPaymentSessionData),
|
64
|
-
_parsePaymentSessionD2 = _slicedToArray(_parsePaymentSessionD, 2),
|
65
|
-
parseData = _parsePaymentSessionD2[0],
|
66
|
-
paymentSessionData = _parsePaymentSessionD2[1];
|
67
|
-
resetEasyPaySceneVersion(parseData);
|
68
|
-
return [parseData, paymentSessionData];
|
69
|
-
};
|
70
|
-
var handleParams = function handleParams(params) {
|
71
|
-
var _params = Object.assign({
|
72
|
-
paymentSessionMetaData: {},
|
73
|
-
renderDisplayType: renderDisplayTypeEnum.popup
|
74
|
-
}, params);
|
75
|
-
var _handlePaymentSession = handlePaymentSessionData(_params.paymentSessionData),
|
76
|
-
_handlePaymentSession2 = _slicedToArray(_handlePaymentSession, 2),
|
77
|
-
parseData = _handlePaymentSession2[0],
|
78
|
-
paymentSessionData = _handlePaymentSession2[1];
|
79
|
-
var componentSign = getComponentSign(parseData);
|
80
|
-
if (componentSign === componentSignEnum.NONE) {
|
81
|
-
// eslint-disable-next-line prefer-promise-reject-errors
|
82
|
-
return Promise.reject({
|
83
|
-
code: ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR.code,
|
84
|
-
message: "Abnormal response data, interface failure, or unsupported payment method"
|
85
|
-
});
|
86
|
-
}
|
87
|
-
_params.paymentSessionData = paymentSessionData;
|
88
|
-
_params.paymentSessionMetaData = parseData;
|
89
|
-
return Promise.resolve({
|
90
|
-
iframeNodesParams: _params,
|
91
|
-
componentSign: componentSign
|
92
|
-
});
|
93
|
-
};
|
94
|
-
export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
95
|
-
_inherits(AMSComponent, _CoreInstance);
|
96
|
-
var _super = _createSuper(AMSComponent);
|
97
|
-
function AMSComponent(options) {
|
98
|
-
var _this;
|
99
|
-
_classCallCheck(this, AMSComponent);
|
100
|
-
_this = _super.call(this, options);
|
101
|
-
// Instantiate the plug-in and set render
|
102
|
-
_defineProperty(_assertThisInitialized(_this), "_componentApp", void 0);
|
103
|
-
var ComponentPlugin = new ComponentApp();
|
104
|
-
ComponentPlugin.setRender(createIframeNode);
|
105
|
-
// Register Cashier Application Plug in
|
106
|
-
_this._registerPlugin(COMPONENTPLUGINID, ComponentPlugin);
|
107
|
-
_this._componentApp = _this._getPlugin(COMPONENTPLUGINID);
|
108
|
-
return _this;
|
109
|
-
}
|
110
|
-
_createClass(AMSComponent, [{
|
111
|
-
key: "parameterInitAndCheck",
|
112
|
-
value: function parameterInitAndCheck(_ref) {
|
113
|
-
var params = _ref.params,
|
114
|
-
selector = _ref.selector,
|
115
|
-
renderDisplayType = _ref.renderDisplayType;
|
116
|
-
this.options.mode = modeEnum.component;
|
117
|
-
this.options.networkMode = this.options.networkMode || networkModeEnum.session;
|
118
|
-
var _params = Object.assign({
|
119
|
-
selector: selector,
|
120
|
-
renderDisplayType: renderDisplayType
|
121
|
-
}, params);
|
122
|
-
if (_params && !_params.paymentSessionData) {
|
123
|
-
return Promise.reject(ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR);
|
124
|
-
}
|
125
|
-
if (this.options.networkMode === networkModeEnum.proxy) {
|
126
|
-
console.warn(ERRORMESSAGE.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message);
|
127
|
-
return Promise.reject(ERRORMESSAGE.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT);
|
128
|
-
}
|
129
|
-
return Promise.resolve(_params);
|
130
|
-
}
|
131
|
-
}, {
|
132
|
-
key: "pluginAppendIframe",
|
133
|
-
value: function pluginAppendIframe(appendParams) {
|
134
|
-
try {
|
135
|
-
return this._componentApp.appendIframeNodes(appendParams.componentSign, appendParams.iframeNodesParams);
|
136
|
-
} catch (error) {
|
137
|
-
return Promise.reject(error);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
/**
|
142
|
-
* @description Create component application
|
143
|
-
* @param params - The data source created by the component, necessary paymentSessionData, optional appearance configuration, and refer to the documentation for other parameters and detailed information.
|
144
|
-
*/
|
145
|
-
}, {
|
146
|
-
key: "createComponent",
|
147
|
-
value: function createComponent(params) {
|
148
|
-
var _this2 = this;
|
149
|
-
return this.parameterInitAndCheck({
|
150
|
-
params: params,
|
151
|
-
renderDisplayType: renderDisplayTypeEnum.popup
|
152
|
-
}).then(function (_params) {
|
153
|
-
return handleParams(_params);
|
154
|
-
}).catch(function (error) {
|
155
|
-
_this2._eventCenter.emit(EVENT.error.name, error);
|
156
|
-
return Promise.reject(error);
|
157
|
-
}).then(function (appendParams) {
|
158
|
-
return _this2.pluginAppendIframe(appendParams);
|
159
|
-
});
|
160
|
-
}
|
161
|
-
/**
|
162
|
-
* @description Create and render components in the specified element area
|
163
|
-
* @param params - The data source created by the component, necessary paymentSessionData, necessary element selector IDs, optional appearance configurations, and refer to the documentation for other parameters and detailed information.
|
164
|
-
*/
|
165
|
-
}, {
|
166
|
-
key: "mountComponent",
|
167
|
-
value: function mountComponent(params, selector) {
|
168
|
-
var _this3 = this;
|
169
|
-
return this.parameterInitAndCheck({
|
170
|
-
params: params,
|
171
|
-
renderDisplayType: renderDisplayTypeEnum.inline,
|
172
|
-
selector: selector
|
173
|
-
}).then(function (_params) {
|
174
|
-
return handleParams(_params);
|
175
|
-
}).catch(function (error) {
|
176
|
-
_this3._eventCenter.emit(EVENT.error.name, error);
|
177
|
-
return Promise.reject(error);
|
178
|
-
}).then(function (appendParams) {
|
179
|
-
return _this3.pluginAppendIframe(appendParams);
|
180
|
-
});
|
181
|
-
}
|
182
|
-
/**
|
183
|
-
* @description Execute payment submission process
|
184
|
-
* @description - When using your own payment button, you can execute the submit payment process by actively calling this function.
|
185
|
-
*/
|
186
|
-
}, {
|
187
|
-
key: "submit",
|
188
|
-
value: function submit() {
|
189
|
-
var _this4 = this;
|
190
|
-
return new Promise(function (resolve, reject) {
|
191
|
-
try {
|
192
|
-
var eventCallbackId = uuid();
|
193
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
194
|
-
_this4._eventCenter.once(eventCallbackId, function (_data) {
|
195
|
-
resolve(_data);
|
196
|
-
});
|
197
|
-
_this4._componentApp.dispatchToApp({
|
198
|
-
context: {
|
199
|
-
event: 'submitPay',
|
200
|
-
eventCallbackId: eventCallbackId,
|
201
|
-
data: {}
|
202
|
-
}
|
203
|
-
});
|
204
|
-
} catch (error) {
|
205
|
-
reject(error);
|
206
|
-
}
|
207
|
-
});
|
208
|
-
}
|
209
|
-
}]);
|
210
|
-
return AMSComponent;
|
211
|
-
}(CoreInstance);
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { IcreatePaymentParams, IoptionsParams } from '../../types';
|
2
|
-
export declare const mixinDropInConstructor: (options: IoptionsParams, context: any) => void;
|
3
|
-
/**
|
4
|
-
* @description Create checkout application
|
5
|
-
* @description drop-in
|
6
|
-
*/
|
7
|
-
export declare const createPayment: (params: IcreatePaymentParams) => Promise<void>;
|
8
|
-
export interface IcreatePaymentFunc {
|
9
|
-
(params: IcreatePaymentParams): Promise<void>;
|
10
|
-
}
|
11
|
-
/**
|
12
|
-
* @description Take action on the interface result of payment submission
|
13
|
-
* @description drop-in
|
14
|
-
*/
|
15
|
-
export declare const confirmPayment: (result: any) => Promise<void>;
|
16
|
-
export interface IconfirmPaymentFunc {
|
17
|
-
(result: any): Promise<void>;
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* @description Subscribe to the message of the cashier application plug-in
|
21
|
-
*/
|
22
|
-
export declare const _subscribeFromCheckoutPlugin: () => void;
|
package/esm/image/skeleton.svg
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
<svg width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">
|
2
|
-
<rect width="740" height="360" rx="12" fill="#F6F6F6"/>
|
3
|
-
<rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>
|
4
|
-
<rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>
|
5
|
-
<rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>
|
6
|
-
<g style="mix-blend-mode:multiply" opacity="0.336007">
|
7
|
-
<path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>
|
8
|
-
</g>
|
9
|
-
<g style="mix-blend-mode:multiply" opacity="0.336007">
|
10
|
-
<path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>
|
11
|
-
</g>
|
12
|
-
<g style="mix-blend-mode:multiply" opacity="0.336007">
|
13
|
-
<path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>
|
14
|
-
</g>
|
15
|
-
<g style="mix-blend-mode:multiply" opacity="0.336007">
|
16
|
-
<path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>
|
17
|
-
</g>
|
18
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { componentSignEnum, Ianalytics } from '../../types';
|
2
|
-
export declare const getAppPath: (environment: string | undefined, appVersion: string, componentSign: componentSignEnum, productSceneVersion: string, extendInfo: string) => any;
|
3
|
-
export declare const getAppDomain: (domainParams: {
|
4
|
-
environment: string;
|
5
|
-
appVersion: string;
|
6
|
-
componentSign: componentSignEnum;
|
7
|
-
productSceneVersion: string;
|
8
|
-
extendInfo: string;
|
9
|
-
}) => string;
|
10
|
-
export declare const getIframeUrl: (iframeParams: {
|
11
|
-
componentSign: componentSignEnum;
|
12
|
-
analytics?: Ianalytics;
|
13
|
-
productSceneVersion: string;
|
14
|
-
environment: string;
|
15
|
-
appVersion: string;
|
16
|
-
extendInfo: string;
|
17
|
-
locale: string;
|
18
|
-
instanceId: string;
|
19
|
-
}) => string;
|
20
|
-
/**
|
21
|
-
* @description Create iframe
|
22
|
-
*/
|
23
|
-
export declare const createIframe: (mode: string, platform: 'mobile' | 'desktop') => HTMLIFrameElement;
|
@@ -1,123 +0,0 @@
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
2
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
4
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
5
|
-
/**
|
6
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
7
|
-
*
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
9
|
-
* 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
|
10
|
-
* 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.
|
11
|
-
*/
|
12
|
-
import { marmptMap, sdkVersion } from "../../config/index";
|
13
|
-
import { componentSignEnum } from "../../types";
|
14
|
-
import { getViewPort, queryParse, serialize } from "../../util/index";
|
15
|
-
var getAppVersion = function getAppVersion(_extendInfo) {
|
16
|
-
try {
|
17
|
-
var info = JSON.parse(_extendInfo);
|
18
|
-
return info.versionMap.web[sdkVersion].targetWebVerison;
|
19
|
-
} catch (error) {
|
20
|
-
return '';
|
21
|
-
}
|
22
|
-
};
|
23
|
-
var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
|
24
|
-
var _signSupportMap;
|
25
|
-
var signSupportMap = (_signSupportMap = {}, _defineProperty(_signSupportMap, componentSignEnum.NONE, ['']), _defineProperty(_signSupportMap, componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), _signSupportMap);
|
26
|
-
var supportProductSceneVersion = signSupportMap[componentSign];
|
27
|
-
// 从左到右,从旧到新
|
28
|
-
var isSupport = supportProductSceneVersion.find(function (it) {
|
29
|
-
return it === productSceneVersion;
|
30
|
-
});
|
31
|
-
var finalProductSceneVersion = supportProductSceneVersion[supportProductSceneVersion.length - 1];
|
32
|
-
return isSupport ? productSceneVersion : finalProductSceneVersion;
|
33
|
-
};
|
34
|
-
export var getAppPath = function getAppPath() {
|
35
|
-
var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
|
36
|
-
var appVersion = arguments.length > 1 ? arguments[1] : undefined;
|
37
|
-
var componentSign = arguments.length > 2 ? arguments[2] : undefined;
|
38
|
-
var productSceneVersion = arguments.length > 3 ? arguments[3] : undefined;
|
39
|
-
var extendInfo = arguments.length > 4 ? arguments[4] : undefined;
|
40
|
-
var _ref = queryParse() || {},
|
41
|
-
urlTestHost = _ref.host;
|
42
|
-
var finalAppVersion = getAppVersion(extendInfo) || appVersion;
|
43
|
-
var finalProductSceneVersion = getFinalProductSceneVersion(componentSign, productSceneVersion);
|
44
|
-
|
45
|
-
// only for test while testurl?host=https://xxxxx.test.html
|
46
|
-
if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) {
|
47
|
-
return urlTestHost;
|
48
|
-
}
|
49
|
-
return "".concat(marmptMap[environment], "/").concat(componentSign, "/").concat(finalProductSceneVersion, "/index.").concat(finalAppVersion, ".html");
|
50
|
-
};
|
51
|
-
export var getAppDomain = function getAppDomain(domainParams) {
|
52
|
-
var environment = domainParams.environment,
|
53
|
-
appVersion = domainParams.appVersion,
|
54
|
-
componentSign = domainParams.componentSign,
|
55
|
-
productSceneVersion = domainParams.productSceneVersion,
|
56
|
-
extendInfo = domainParams.extendInfo;
|
57
|
-
var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
|
58
|
-
var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo));
|
59
|
-
return macth && macth[0] || '';
|
60
|
-
};
|
61
|
-
export var getIframeUrl = function getIframeUrl(iframeParams) {
|
62
|
-
var componentSign = iframeParams.componentSign,
|
63
|
-
_iframeParams$analyti = iframeParams.analytics,
|
64
|
-
analytics = _iframeParams$analyti === void 0 ? {
|
65
|
-
enabled: true
|
66
|
-
} : _iframeParams$analyti,
|
67
|
-
productSceneVersion = iframeParams.productSceneVersion,
|
68
|
-
environment = iframeParams.environment,
|
69
|
-
appVersion = iframeParams.appVersion,
|
70
|
-
extendInfo = iframeParams.extendInfo,
|
71
|
-
locale = iframeParams.locale,
|
72
|
-
instanceId = iframeParams.instanceId;
|
73
|
-
var path = getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo || '');
|
74
|
-
var initialScale = 1;
|
75
|
-
var scale = getViewPort('initial-scale') || initialScale;
|
76
|
-
var _queryParse = queryParse(),
|
77
|
-
_sandbox = _queryParse._sandbox,
|
78
|
-
_light_sandbox = _queryParse._light_sandbox,
|
79
|
-
_queryParse$requestHo = _queryParse.requestHost,
|
80
|
-
requestHost = _queryParse$requestHo === void 0 ? '' : _queryParse$requestHo,
|
81
|
-
_queryParse$groupId = _queryParse.groupId,
|
82
|
-
groupId = _queryParse$groupId === void 0 ? '' : _queryParse$groupId,
|
83
|
-
LOCAL_MOCK = _queryParse.LOCAL_MOCK;
|
84
|
-
var urlParams = Object.assign({}, {
|
85
|
-
locale: locale,
|
86
|
-
scale: scale,
|
87
|
-
instanceId: instanceId,
|
88
|
-
analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
|
89
|
-
sdkVersion: sdkVersion,
|
90
|
-
refUrl: window.location.href
|
91
|
-
});
|
92
|
-
if (LOCAL_MOCK) urlParams.LOCAL_MOCK = LOCAL_MOCK;
|
93
|
-
if (requestHost) urlParams.requestHost = requestHost;
|
94
|
-
if (groupId) urlParams.groupId = groupId;
|
95
|
-
if (environment === 'light_sandbox' || _light_sandbox === 'true') urlParams.sandbox = 'true';
|
96
|
-
if (environment === 'sandbox' || _sandbox === 'true') urlParams.shadow = 'true';
|
97
|
-
var locationSearch = serialize(urlParams);
|
98
|
-
return "".concat(path, "?").concat(locationSearch);
|
99
|
-
};
|
100
|
-
|
101
|
-
/**
|
102
|
-
* @description Create iframe
|
103
|
-
*/
|
104
|
-
export var createIframe = function createIframe(mode, platform) {
|
105
|
-
var getIframeId = function getIframeId() {
|
106
|
-
var IdMap = {
|
107
|
-
dropin: "ams-checkout-dropin-".concat(platform),
|
108
|
-
component: "ams-checkout-component-".concat(platform)
|
109
|
-
};
|
110
|
-
return IdMap[mode] || 'ams-checkout-component';
|
111
|
-
};
|
112
|
-
var iframe = document.createElement('iframe');
|
113
|
-
var iframeId = getIframeId();
|
114
|
-
var none = '0';
|
115
|
-
var width = '100%';
|
116
|
-
iframe.id = iframeId;
|
117
|
-
iframe.style.height = none;
|
118
|
-
iframe.style.width = width;
|
119
|
-
iframe.style.border = none;
|
120
|
-
iframe.style.opacity = none;
|
121
|
-
iframe.style.overflow = 'hidden';
|
122
|
-
return iframe;
|
123
|
-
};
|
@@ -1,38 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
3
|
-
*
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
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
|
-
* 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
|
-
*/
|
8
|
-
import { platformEnum } from "../../types";
|
9
|
-
import { INLINE_BASE_STYLE_ID, LOADING_ID, INLINE_IMG_CLASSNAME, COMPONENT_CONTAINER_ID, COMPONENT_IFRAME_TAG_ID } from "../../constant";
|
10
|
-
import { amsSetSize } from "../../util";
|
11
|
-
var inlineComponentCss = "#".concat(COMPONENT_IFRAME_TAG_ID, "-desktop{\n border-radius: 8px;\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");
|
12
|
-
export var inlineComponentAddCss = function inlineComponentAddCss() {
|
13
|
-
var style = document.createElement('style');
|
14
|
-
style.id = 'ams-inline-component-style';
|
15
|
-
style.type = 'text/css';
|
16
|
-
style.innerHTML = inlineComponentCss;
|
17
|
-
document.head.appendChild(style);
|
18
|
-
};
|
19
|
-
export var addInlineLoading = function addInlineLoading(_selector, platform) {
|
20
|
-
var loading = document.createElement('div');
|
21
|
-
loading.id = LOADING_ID;
|
22
|
-
if (platform === platformEnum.desktop) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"740\" height=\"360\" viewBox=\"0 0 740 360\" fill=\"none\" xmlns=\"\">\n <rect width=\"740\" height=\"360\" rx=\"12\" fill=\"#F6F6F6\"/>\n <rect opacity=\"0.7\" x=\"44\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"94\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"144\" y=\"44\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z\" fill=\"#E1E6ED\"/>\n </g>\n </svg>");
|
23
|
-
if (platform === platformEnum.mobile) loading.innerHTML = "<svg class=\"".concat(INLINE_IMG_CLASSNAME, " ").concat(INLINE_IMG_CLASSNAME, "-").concat(platform, "\" width=\"358\" height=\"186\" viewBox=\"0 0 358 186\" fill=\"none\" xmlns=\"\">\n <g clip-path=\"url(#clip0_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <g clip-path=\"url(#clip1_2543_91192)\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n <rect width=\"358\" height=\"40\" fill=\"white\"/>\n <rect opacity=\"0.7\" x=\"4\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"54\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <rect opacity=\"0.7\" x=\"104\" y=\"4\" width=\"32\" height=\"32\" rx=\"4\" fill=\"#E1E6ED\"/>\n <g clip-path=\"url(#clip2_2543_91192)\">\n <rect width=\"358\" height=\"120\" transform=\"translate(0 66)\" fill=\"white\"/>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z\" fill=\"#E1E6ED\"/>\n </g>\n <g clip-path=\"url(#clip3_2543_91192)\">\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z\" fill=\"#E1E6ED\"/>\n </g>\n <g style=\"mix-blend-mode:multiply\" opacity=\"0.336007\">\n <path d=\"M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z\" fill=\"#E1E6ED\"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id=\"clip0_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip1_2543_91192\">\n <rect width=\"358\" height=\"186\" fill=\"white\"/>\n </clipPath>\n <clipPath id=\"clip2_2543_91192\">\n <rect width=\"358\" height=\"120\" fill=\"white\" transform=\"translate(0 66)\"/>\n </clipPath>\n <clipPath id=\"clip3_2543_91192\">\n <rect width=\"358\" height=\"92\" fill=\"white\" transform=\"translate(0 94)\"/>\n </clipPath>\n </defs>\n </svg>\n ");
|
24
|
-
if (_selector) _selector.appendChild(loading);
|
25
|
-
var loadingDom = document.getElementById(LOADING_ID);
|
26
|
-
amsSetSize(null, loadingDom);
|
27
|
-
};
|
28
|
-
export var createInlineBaseElement = function createInlineBaseElement(selector) {
|
29
|
-
var inlineBaseStyle = document.getElementById(INLINE_BASE_STYLE_ID);
|
30
|
-
if (!inlineBaseStyle) inlineComponentAddCss();
|
31
|
-
if (document.getElementById(COMPONENT_CONTAINER_ID)) return;
|
32
|
-
var amsComponentContainer = document.createElement('div');
|
33
|
-
amsComponentContainer.className = "".concat(COMPONENT_CONTAINER_ID, "-inline");
|
34
|
-
amsComponentContainer.id = COMPONENT_CONTAINER_ID;
|
35
|
-
var selectorDom = document.querySelector(selector);
|
36
|
-
if (selectorDom) selectorDom.appendChild(amsComponentContainer);
|
37
|
-
return amsComponentContainer;
|
38
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { platformEnum } from '../../types';
|
2
|
-
export declare const componentAddCSS: () => void;
|
3
|
-
export declare const createBaseElement: (platform: platformEnum, closeBtnFunc: () => void) => HTMLDivElement | undefined;
|
4
|
-
export declare const createCloseBtn: (platform: platformEnum, closeBtnFunc: () => void) => void;
|
5
|
-
export declare const createRetentionPopup: (platform: platformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
6
|
-
export declare const hideRetentionPopup: () => void;
|
7
|
-
export declare const removeRetentionPopup: (platform: platformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
8
|
-
export declare const createMockup: () => void;
|
9
|
-
export declare const addPopupLoading: () => void;
|
10
|
-
export declare const handleDeclareInfo: ({ closeDialogData }: {
|
11
|
-
closeDialogData: any;
|
12
|
-
}) => void;
|