@alipay/ams-checkout 0.0.1726046231-dev.1 → 0.0.1726046231-dev.12
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/core/component/element/components/address.d.ts +6 -4
- package/esm/core/component/element/components/address.js +16 -10
- package/esm/core/component/element/components/auth.d.ts +1 -1
- package/esm/core/component/element/components/auth.js +15 -10
- package/esm/core/component/element/components/payment.d.ts +4 -2
- package/esm/core/component/element/components/payment.js +15 -8
- 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 +8 -4
- package/esm/core/component/element/index.js +296 -177
- package/esm/core/component/element/type.d.ts +35 -20
- package/esm/core/component/element/type.js +13 -5
- package/esm/types/index.d.ts +2 -1
- package/esm/types/index.js +1 -0
- package/package.json +1 -1
@@ -1,30 +1,35 @@
|
|
1
1
|
import { ConnectErrorCode, ElementPaymentMethod } from '../../../types';
|
2
|
-
interface BaseMountOptions<T = void> {
|
3
|
-
config?: {};
|
4
|
-
}
|
5
2
|
export declare enum ThemeType {
|
6
3
|
NostalgicGray = "nostalgicGray",
|
7
|
-
|
4
|
+
Default = "default",
|
8
5
|
Night = "night",
|
9
6
|
CherryBlossomPink = "cherryBlossomPink",
|
10
7
|
GamingPurple = "gamingPurple",
|
11
8
|
AgateGreen = "agateGreen"
|
12
9
|
}
|
13
10
|
export declare const addressTheme: {
|
11
|
+
default: string;
|
14
12
|
night: string;
|
15
|
-
light: string;
|
16
13
|
};
|
17
14
|
export declare enum EventCallbackCode {
|
18
15
|
Failed = "Failed",
|
19
16
|
Completed = "Completed"
|
20
17
|
}
|
18
|
+
export declare enum ELEMENT_ENVIRONMENT {
|
19
|
+
DEV = "DEV",
|
20
|
+
TEST = "TEST",
|
21
|
+
PRE = "PRE",
|
22
|
+
PROD = "PROD"
|
23
|
+
}
|
24
|
+
export type ELEMENT_ENVIRONMENT_TYPE = keyof typeof ELEMENT_ENVIRONMENT | (typeof ELEMENT_ENVIRONMENT)[keyof typeof ELEMENT_ENVIRONMENT];
|
21
25
|
export interface IElementOptions {
|
22
26
|
sessionData: string;
|
23
|
-
environment?:
|
27
|
+
environment?: ELEMENT_ENVIRONMENT_TYPE;
|
24
28
|
locale?: string;
|
25
29
|
mode?: string;
|
30
|
+
version?: string;
|
26
31
|
appearance?: {
|
27
|
-
theme: ThemeType.
|
32
|
+
theme: ThemeType.Default | ThemeType.Night;
|
28
33
|
};
|
29
34
|
onEventCallback?: ({ code, message }: {
|
30
35
|
code: EventCallbackCode;
|
@@ -35,8 +40,24 @@ export interface IElementOptions {
|
|
35
40
|
onEndLoading: () => void;
|
36
41
|
};
|
37
42
|
}
|
43
|
+
export interface AddressMountComponentsParams {
|
44
|
+
configParams?: AddressMountConfig;
|
45
|
+
prefillValue: Array<AddressSubmitData>;
|
46
|
+
appearance: {
|
47
|
+
themeType: string;
|
48
|
+
};
|
49
|
+
debugProps?: {
|
50
|
+
localLink: string;
|
51
|
+
};
|
52
|
+
}
|
53
|
+
interface BaseMountOptions<T = void> {
|
54
|
+
configParams?: T;
|
55
|
+
debugProps?: {
|
56
|
+
localLink: string;
|
57
|
+
};
|
58
|
+
}
|
38
59
|
type HideField = 'shippingCountry' | 'shippingName' | 'shippingPhoneNo' | 'shippingRegion' | 'shippingAddress1' | 'shippingZipCode' | 'shippingAddress2';
|
39
|
-
|
60
|
+
interface AddressMountConfig {
|
40
61
|
/**
|
41
62
|
* 是否开启地址联想功能
|
42
63
|
* 0 开启
|
@@ -47,32 +68,25 @@ export interface AddressMountOptions extends BaseMountOptions<{
|
|
47
68
|
* 隐藏部分地址要素
|
48
69
|
*/
|
49
70
|
hideFields?: Array<HideField>;
|
50
|
-
}
|
71
|
+
}
|
72
|
+
export interface AddressMountOptions extends BaseMountOptions<AddressMountConfig> {
|
51
73
|
type: 'address';
|
74
|
+
prefillValue: Array<AddressSubmitData>;
|
52
75
|
appearance?: {
|
53
|
-
theme: ThemeType.
|
54
|
-
};
|
55
|
-
debugProps?: {
|
56
|
-
localLink: string;
|
76
|
+
theme: ThemeType.Default | ThemeType.Night;
|
57
77
|
};
|
58
78
|
}
|
59
79
|
export interface LinkAuthMountOptions extends BaseMountOptions {
|
60
|
-
type: '
|
80
|
+
type: 'auth';
|
61
81
|
appearance?: {
|
62
82
|
theme: ThemeType;
|
63
83
|
};
|
64
|
-
debugProps?: {
|
65
|
-
localLink?: string;
|
66
|
-
};
|
67
84
|
}
|
68
85
|
export interface PaymentMountOptions extends BaseMountOptions {
|
69
86
|
type: 'payment';
|
70
87
|
appearance?: {
|
71
88
|
theme: ThemeType;
|
72
89
|
};
|
73
|
-
debugProps?: {
|
74
|
-
localLink: string;
|
75
|
-
};
|
76
90
|
}
|
77
91
|
export declare enum AddressEventCallbackName {
|
78
92
|
SHIPPING_CHANGE = "SHIPPING_CHANGE"
|
@@ -142,6 +156,7 @@ export interface AddressSubmitData {
|
|
142
156
|
notes: string;
|
143
157
|
prefer: '1' | '0';
|
144
158
|
shippingId: string;
|
159
|
+
actionFlag?: 'I' | 'U' | 'D';
|
145
160
|
}
|
146
161
|
export interface SubmitServiceParams extends PaymentSubmitData {
|
147
162
|
accountInfo: AuthSubmitData['accountInfo'];
|
@@ -1,21 +1,29 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
4
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
1
5
|
export var ThemeType = /*#__PURE__*/function (ThemeType) {
|
2
6
|
ThemeType["NostalgicGray"] = "nostalgicGray";
|
3
|
-
ThemeType["
|
7
|
+
ThemeType["Default"] = "default";
|
4
8
|
ThemeType["Night"] = "night";
|
5
9
|
ThemeType["CherryBlossomPink"] = "cherryBlossomPink";
|
6
10
|
ThemeType["GamingPurple"] = "gamingPurple";
|
7
11
|
ThemeType["AgateGreen"] = "agateGreen";
|
8
12
|
return ThemeType;
|
9
13
|
}({});
|
10
|
-
export var addressTheme = {
|
11
|
-
night: 'NIGHT',
|
12
|
-
light: 'LIGHT'
|
13
|
-
};
|
14
|
+
export var addressTheme = _defineProperty(_defineProperty({}, ThemeType.Default, 'LIGHT'), ThemeType.Night, 'NIGHT');
|
14
15
|
export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
|
15
16
|
EventCallbackCode["Failed"] = "Failed";
|
16
17
|
EventCallbackCode["Completed"] = "Completed";
|
17
18
|
return EventCallbackCode;
|
18
19
|
}({});
|
20
|
+
export var ELEMENT_ENVIRONMENT = /*#__PURE__*/function (ELEMENT_ENVIRONMENT) {
|
21
|
+
ELEMENT_ENVIRONMENT["DEV"] = "DEV";
|
22
|
+
ELEMENT_ENVIRONMENT["TEST"] = "TEST";
|
23
|
+
ELEMENT_ENVIRONMENT["PRE"] = "PRE";
|
24
|
+
ELEMENT_ENVIRONMENT["PROD"] = "PROD";
|
25
|
+
return ELEMENT_ENVIRONMENT;
|
26
|
+
}({});
|
19
27
|
// export type IMountOptions = AddressMountOptions | LinkAuthMountOptions | PaymentMountOptions;
|
20
28
|
|
21
29
|
export var AddressEventCallbackName = /*#__PURE__*/function (AddressEventCallbackName) {
|
package/esm/types/index.d.ts
CHANGED
@@ -845,7 +845,8 @@ export declare enum ElementPaymentEvent {
|
|
845
845
|
AFTER_SUBMIT = "onAfterSubmit",
|
846
846
|
SIZE_CHANGE = "onSizeChange",
|
847
847
|
LAUNCH = "onLaunch",
|
848
|
-
CALLBACK = "callback"
|
848
|
+
CALLBACK = "callback",
|
849
|
+
LOG = "log"
|
849
850
|
}
|
850
851
|
export declare enum ConnectErrorCode {
|
851
852
|
RISK_REJECT = "RISK_REJECT",
|
package/esm/types/index.js
CHANGED
@@ -244,6 +244,7 @@ export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
|
|
244
244
|
ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
|
245
245
|
ElementPaymentEvent["LAUNCH"] = "onLaunch";
|
246
246
|
ElementPaymentEvent["CALLBACK"] = "callback";
|
247
|
+
ElementPaymentEvent["LOG"] = "log";
|
247
248
|
return ElementPaymentEvent;
|
248
249
|
}({});
|
249
250
|
export var ConnectErrorCode = /*#__PURE__*/function (ConnectErrorCode) {
|