@alipay/ams-checkout 0.0.1756987734-dev.2 → 0.0.1757298389-dev.1

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/index.js CHANGED
@@ -111,21 +111,7 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout2) {
111
111
  }
112
112
  return _super3.call(this, _options, currentChannelType);
113
113
  }
114
- _createClass(AMSCashierPayment, [{
115
- key: "validateFields",
116
- value:
117
- /**
118
- * Form validation function
119
- * If the form is currently displayed:
120
- * - Successful validation: isValid is true
121
- * - Failed validation: isValid is false, and error messages are displayed on the form page
122
- * If not on the form display page, isValid returns false
123
- * @returns {Promise<ValidationResult>} Returns a Promise containing the validation result
124
- */
125
- function validateFields() {
126
- return this._validateFields();
127
- }
128
- }], [{
114
+ _createClass(AMSCashierPayment, null, [{
129
115
  key: "preload",
130
116
  value: function preload() {
131
117
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
@@ -28,7 +28,6 @@ export default class ComponentApp {
28
28
  private _isAppWebview;
29
29
  _merchantAppointParam: IMerchantAppointParam;
30
30
  private _webAppHeartBeatTimeoutFn;
31
- private _hasRenderComponent;
32
31
  constructor(componentOption?: {
33
32
  appVersion?: string;
34
33
  });
@@ -127,6 +126,5 @@ export default class ComponentApp {
127
126
  private showRetentionPopup;
128
127
  private hideRetentionPopupFunc;
129
128
  private submitForm;
130
- shouldValidateFields(): boolean;
131
129
  }
132
130
  export {};
@@ -23,7 +23,7 @@ import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK
23
23
  import { ElementPaymentMethod } from "../../core/component/oldElement/type";
24
24
  import { queryPaymentInfo, submitPayInfo } from "../../service";
25
25
  import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, MessageName, PlatformEnum, ProductSceneEnum, RedirectType, TargetEnum } from "../../types";
26
- import { getType, isJsonString, isPC, device } from "../../util";
26
+ import { getType, isJsonString, isPC } from "../../util";
27
27
  import { getBackScheme } from "../../util/getBackScheme";
28
28
  import { isLocalMock } from "../../util/mock";
29
29
  import { matchVersion } from "../../util/versionCompare";
@@ -62,7 +62,6 @@ var ComponentApp = /*#__PURE__*/function () {
62
62
  _defineProperty(this, "_isAppWebview", void 0);
63
63
  _defineProperty(this, "_merchantAppointParam", void 0);
64
64
  _defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
65
- _defineProperty(this, "_hasRenderComponent", false);
66
65
  this._appVersion = componentOption.appVersion;
67
66
  this._isInitComponent = false;
68
67
  this._selector = "#".concat(COMPONENT_SECTION_ID);
@@ -72,7 +71,7 @@ var ComponentApp = /*#__PURE__*/function () {
72
71
  this.createPreloadIframeNode = function () {
73
72
  return Promise.resolve();
74
73
  };
75
- this.platform = device.isMobile ? PlatformEnum.mobile : PlatformEnum.desktop;
74
+ this.platform = isPC() ? PlatformEnum.desktop : PlatformEnum.mobile;
76
75
  this._isRetention = true;
77
76
  this._appLocationSearch = '';
78
77
  this._performanceData.push({
@@ -1843,7 +1842,6 @@ var ComponentApp = /*#__PURE__*/function () {
1843
1842
  return this._actionSubmitPromise;
1844
1843
  case 9:
1845
1844
  submitRes = _context8.sent;
1846
- this._hasRenderComponent = true;
1847
1845
  this._performanceData.push({
1848
1846
  key: 'sdk_render_component',
1849
1847
  value: Date.now()
@@ -1899,16 +1897,16 @@ var ComponentApp = /*#__PURE__*/function () {
1899
1897
  }
1900
1898
  });
1901
1899
  // eslint-disable-next-line no-empty
1902
- _context8.next = 19;
1900
+ _context8.next = 18;
1903
1901
  break;
1904
- case 17:
1905
- _context8.prev = 17;
1902
+ case 16:
1903
+ _context8.prev = 16;
1906
1904
  _context8.t0 = _context8["catch"](0);
1907
- case 19:
1905
+ case 18:
1908
1906
  case "end":
1909
1907
  return _context8.stop();
1910
1908
  }
1911
- }, _callee8, this, [[0, 17]]);
1909
+ }, _callee8, this, [[0, 16]]);
1912
1910
  }));
1913
1911
  function sendRenderEvent() {
1914
1912
  return _sendRenderEvent.apply(this, arguments);
@@ -1935,7 +1933,6 @@ var ComponentApp = /*#__PURE__*/function () {
1935
1933
  this._performanceData = [];
1936
1934
  this._isInitComponent = false;
1937
1935
  this.app = null;
1938
- this._hasRenderComponent = false;
1939
1936
  if (immediately) this.cleanElement();else {
1940
1937
  setTimeout(function () {
1941
1938
  _this10.cleanElement();
@@ -2022,11 +2019,6 @@ var ComponentApp = /*#__PURE__*/function () {
2022
2019
  form.submit();
2023
2020
  }, 0);
2024
2021
  }
2025
- }, {
2026
- key: "shouldValidateFields",
2027
- value: function shouldValidateFields() {
2028
- return this._hasRenderComponent;
2029
- }
2030
2022
  }]);
2031
2023
  return ComponentApp;
2032
2024
  }();
@@ -82,7 +82,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
82
82
  }
83
83
  return Promise.resolve(paypalPluginProps);
84
84
  });
85
- // 加载paypal资源 TODO
85
+ // 加载paypal资源
86
86
  _defineProperty(_assertThisInitialized(_this), "loadPaypalResource", function (paypalPluginProps) {
87
87
  return new Promise(function (resolve, reject) {
88
88
  var _paypalPluginProps$ap;
@@ -265,7 +265,6 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
265
265
  return _ref6.apply(this, arguments);
266
266
  };
267
267
  }());
268
- // TODO
269
268
  _defineProperty(_assertThisInitialized(_this), "destroyComponent", /*#__PURE__*/function () {
270
269
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(context, message) {
271
270
  var data;
@@ -374,9 +373,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
374
373
  }
375
374
  }, {
376
375
  key: "onMessage",
377
- value:
378
- // TODO
379
- function onMessage(context, message) {
376
+ value: function onMessage(context, message) {
380
377
  switch (message.getAction()) {
381
378
  case PaypalActionEnum.mountComponent:
382
379
  this.renderPaypalButton(context, message);
@@ -40,9 +40,6 @@ export interface IoptionsParams {
40
40
  mode?: string;
41
41
  securityRegion?: 'US' | 'SG' | 'DE';
42
42
  }
43
- export interface ValidationResult {
44
- isValid: boolean;
45
- }
46
43
  export interface IPreloadOptions {
47
44
  environment?: string;
48
45
  securityRegion?: 'US' | 'SG' | 'DE';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1756987734-dev.2",
3
+ "version": "0.0.1757298389-dev.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",
@@ -21,7 +21,7 @@
21
21
  "dev": "father dev",
22
22
  "format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
23
23
  "lint": "eslint ./src",
24
- "test": "jest --coverage --silent",
24
+ "test": "jest --silent",
25
25
  "tsc": "tsc --noEmit"
26
26
  },
27
27
  "commitlint": {