@pisell/materials 3.3.34 → 3.3.35

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.
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ /**
4
+ * loginAndRegister组件的属性接口
5
+ */
6
+ export interface loginAndRegisterProps {
7
+ /** Logo相关配置 */
8
+ showLogo?: boolean;
9
+ logo?: string;
10
+ logoPosition?: 'left' | 'center' | 'right';
11
+ logoSize?: {
12
+ width?: number;
13
+ height?: number;
14
+ };
15
+ /** 标题相关配置 */
16
+ title?: string;
17
+ showTitle?: boolean;
18
+ titleAlign?: 'left' | 'center' | 'right';
19
+ /** 副标题相关配置 */
20
+ subtitle?: string;
21
+ showSubtitle?: boolean;
22
+ subtitleAlign?: 'left' | 'center' | 'right';
23
+ /** 登录方式配置 */
24
+ loginMethods?: ('email' | 'google' | 'facebook' | 'apple')[];
25
+ defaultLoginMethod?: 'email' | 'google' | 'facebook' | 'apple';
26
+ /** 表单配置 */
27
+ emailLabel?: string;
28
+ passwordLabel?: string;
29
+ emailPlaceholder?: string;
30
+ passwordPlaceholder?: string;
31
+ emailRules?: any[];
32
+ buttonText?: string;
33
+ rememberMeText?: string;
34
+ forgotPasswordText?: string;
35
+ showRememberMe?: boolean;
36
+ showForgotPassword?: boolean;
37
+ /** 社交登录配置 */
38
+ socialLoginTexts?: {
39
+ google?: string;
40
+ facebook?: string;
41
+ apple?: string;
42
+ };
43
+ /** 底部配置 */
44
+ showFooter?: boolean;
45
+ showSignUp?: boolean;
46
+ signUpText?: string;
47
+ signUpLink?: string;
48
+ signUpPosition?: 'left' | 'center' | 'right';
49
+ otherLinks?: Array<{
50
+ text: string;
51
+ url: string;
52
+ }>;
53
+ otherLinksPosition?: 'left' | 'center' | 'right';
54
+ /** 登录/注册切换配置 */
55
+ showTabs?: boolean;
56
+ loginTabText?: string;
57
+ registerTabText?: string;
58
+ /** 注册表单配置 */
59
+ registerEmailPlaceholder?: string;
60
+ registerPasswordPlaceholder?: string;
61
+ registerButtonText?: string;
62
+ /** 事件回调 */
63
+ onLogin?: (values: {
64
+ email: string;
65
+ loginMethod: string;
66
+ }) => void;
67
+ onSocialLogin?: (type: 'google' | 'facebook' | 'apple') => void;
68
+ onSignUp?: () => void;
69
+ onRegister?: (values: {
70
+ email: string;
71
+ password: string;
72
+ }) => void;
73
+ /** 新增背景图片属性 */
74
+ backgroundImage?: string;
75
+ }
76
+ /**
77
+ * Saas登录组件
78
+ * @param props - 组件属性
79
+ * @returns React组件
80
+ */
81
+ declare const loginAndRegister: React.FC<loginAndRegisterProps>;
82
+ export default loginAndRegister;
@@ -151,24 +151,26 @@ var loginAndRegister = function loginAndRegister(_ref) {
151
151
  return form.validateFields();
152
152
  case 4:
153
153
  _values = _context.sent;
154
- onLogin === null || onLogin === void 0 || onLogin(_objectSpread(_objectSpread({}, _values), {}, {
154
+ _context.next = 7;
155
+ return onLogin === null || onLogin === void 0 ? void 0 : onLogin(_objectSpread(_objectSpread({}, _values), {}, {
155
156
  loginMethod: 'email'
156
157
  }));
157
- _context.next = 11;
158
+ case 7:
159
+ _context.next = 12;
158
160
  break;
159
- case 8:
160
- _context.prev = 8;
161
+ case 9:
162
+ _context.prev = 9;
161
163
  _context.t0 = _context["catch"](0);
162
164
  console.error('Validation failed:', _context.t0);
163
- case 11:
164
- _context.prev = 11;
165
+ case 12:
166
+ _context.prev = 12;
165
167
  setLoading(false);
166
- return _context.finish(11);
167
- case 14:
168
+ return _context.finish(12);
169
+ case 15:
168
170
  case "end":
169
171
  return _context.stop();
170
172
  }
171
- }, _callee, null, [[0, 8, 11, 14]]);
173
+ }, _callee, null, [[0, 9, 12, 15]]);
172
174
  }));
173
175
  return function handleEmailLogin() {
174
176
  return _ref2.apply(this, arguments);
@@ -198,22 +200,24 @@ var loginAndRegister = function loginAndRegister(_ref) {
198
200
  return form.validateFields();
199
201
  case 4:
200
202
  _values2 = _context2.sent;
201
- onRegister === null || onRegister === void 0 || onRegister(_values2);
202
- _context2.next = 11;
203
+ _context2.next = 7;
204
+ return onRegister === null || onRegister === void 0 ? void 0 : onRegister(_values2);
205
+ case 7:
206
+ _context2.next = 12;
203
207
  break;
204
- case 8:
205
- _context2.prev = 8;
208
+ case 9:
209
+ _context2.prev = 9;
206
210
  _context2.t0 = _context2["catch"](0);
207
211
  console.error('Validation failed:', _context2.t0);
208
- case 11:
209
- _context2.prev = 11;
212
+ case 12:
213
+ _context2.prev = 12;
210
214
  setLoading(false);
211
- return _context2.finish(11);
212
- case 14:
215
+ return _context2.finish(12);
216
+ case 15:
213
217
  case "end":
214
218
  return _context2.stop();
215
219
  }
216
- }, _callee2, null, [[0, 8, 11, 14]]);
220
+ }, _callee2, null, [[0, 9, 12, 15]]);
217
221
  }));
218
222
  return function handleRegister() {
219
223
  return _ref3.apply(this, arguments);
@@ -18,6 +18,7 @@ export var renderBundles = function renderBundles(item, hidePrice, isShowPackage
18
18
  id = item.id,
19
19
  price = item.price,
20
20
  symbol = item.symbol,
21
+ options = item.options,
21
22
  option = item.option;
22
23
  return /*#__PURE__*/React.createElement("div", {
23
24
  key: id,
@@ -29,7 +30,7 @@ export var renderBundles = function renderBundles(item, hidePrice, isShowPackage
29
30
  }, translation(title || name)), !hidePrice ? /*#__PURE__*/React.createElement("div", {
30
31
  className: "".concat(prefix, "packages-product-bundle-info-num")
31
32
  }, _formatAmount(price, symbol)) : null), /*#__PURE__*/React.createElement(Options, {
32
- options: option,
33
+ options: options || option,
33
34
  amountSymbol: symbol
34
35
  }), /*#__PURE__*/React.createElement(Footer, {
35
36
  item: item
@@ -14,15 +14,16 @@
14
14
  &-packages-product-bundle-option-item {
15
15
  display: flex;
16
16
  justify-content: space-between;
17
+ gap: 8px;
17
18
  }
18
19
 
19
20
  &-packages-product-bundle-option-item-left {
20
21
  display: flex;
21
- gap: 4px;
22
+ gap: 8px;
22
23
  }
23
24
 
24
25
  &-packages-product-bundle-option-item-left-amount {
25
- margin-left: 8px;
26
+ margin-left: 0;
26
27
  display: flex;
27
28
  gap: 4px;
28
29
  }
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ /**
4
+ * loginAndRegister组件的属性接口
5
+ */
6
+ export interface loginAndRegisterProps {
7
+ /** Logo相关配置 */
8
+ showLogo?: boolean;
9
+ logo?: string;
10
+ logoPosition?: 'left' | 'center' | 'right';
11
+ logoSize?: {
12
+ width?: number;
13
+ height?: number;
14
+ };
15
+ /** 标题相关配置 */
16
+ title?: string;
17
+ showTitle?: boolean;
18
+ titleAlign?: 'left' | 'center' | 'right';
19
+ /** 副标题相关配置 */
20
+ subtitle?: string;
21
+ showSubtitle?: boolean;
22
+ subtitleAlign?: 'left' | 'center' | 'right';
23
+ /** 登录方式配置 */
24
+ loginMethods?: ('email' | 'google' | 'facebook' | 'apple')[];
25
+ defaultLoginMethod?: 'email' | 'google' | 'facebook' | 'apple';
26
+ /** 表单配置 */
27
+ emailLabel?: string;
28
+ passwordLabel?: string;
29
+ emailPlaceholder?: string;
30
+ passwordPlaceholder?: string;
31
+ emailRules?: any[];
32
+ buttonText?: string;
33
+ rememberMeText?: string;
34
+ forgotPasswordText?: string;
35
+ showRememberMe?: boolean;
36
+ showForgotPassword?: boolean;
37
+ /** 社交登录配置 */
38
+ socialLoginTexts?: {
39
+ google?: string;
40
+ facebook?: string;
41
+ apple?: string;
42
+ };
43
+ /** 底部配置 */
44
+ showFooter?: boolean;
45
+ showSignUp?: boolean;
46
+ signUpText?: string;
47
+ signUpLink?: string;
48
+ signUpPosition?: 'left' | 'center' | 'right';
49
+ otherLinks?: Array<{
50
+ text: string;
51
+ url: string;
52
+ }>;
53
+ otherLinksPosition?: 'left' | 'center' | 'right';
54
+ /** 登录/注册切换配置 */
55
+ showTabs?: boolean;
56
+ loginTabText?: string;
57
+ registerTabText?: string;
58
+ /** 注册表单配置 */
59
+ registerEmailPlaceholder?: string;
60
+ registerPasswordPlaceholder?: string;
61
+ registerButtonText?: string;
62
+ /** 事件回调 */
63
+ onLogin?: (values: {
64
+ email: string;
65
+ loginMethod: string;
66
+ }) => void;
67
+ onSocialLogin?: (type: 'google' | 'facebook' | 'apple') => void;
68
+ onSignUp?: () => void;
69
+ onRegister?: (values: {
70
+ email: string;
71
+ password: string;
72
+ }) => void;
73
+ /** 新增背景图片属性 */
74
+ backgroundImage?: string;
75
+ }
76
+ /**
77
+ * Saas登录组件
78
+ * @param props - 组件属性
79
+ * @returns React组件
80
+ */
81
+ declare const loginAndRegister: React.FC<loginAndRegisterProps>;
82
+ export default loginAndRegister;
@@ -97,7 +97,7 @@ var loginAndRegister = ({
97
97
  try {
98
98
  setLoading(true);
99
99
  const values = await form.validateFields();
100
- onLogin == null ? void 0 : onLogin({ ...values, loginMethod: "email" });
100
+ await (onLogin == null ? void 0 : onLogin({ ...values, loginMethod: "email" }));
101
101
  } catch (error) {
102
102
  console.error("Validation failed:", error);
103
103
  } finally {
@@ -111,7 +111,7 @@ var loginAndRegister = ({
111
111
  try {
112
112
  setLoading(true);
113
113
  const values = await form.validateFields();
114
- onRegister == null ? void 0 : onRegister(values);
114
+ await (onRegister == null ? void 0 : onRegister(values));
115
115
  } catch (error) {
116
116
  console.error("Validation failed:", error);
117
117
  } finally {
@@ -45,8 +45,8 @@ var renderBundles = (item, hidePrice, isShowPackageNote) => {
45
45
  const context = (0, import_useEngineContext.default)();
46
46
  const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
47
47
  translation = (utils == null ? void 0 : utils.translationOriginal) || (utils == null ? void 0 : utils.translation);
48
- const { title, name, id, price, symbol, option } = item;
49
- return /* @__PURE__ */ import_react.default.createElement("div", { key: id, className: `${prefix}packages-product-bundle-item` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-title` }, translation(title || name)), !hidePrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-num` }, (0, import_utils._formatAmount)(price, symbol)) : null), /* @__PURE__ */ import_react.default.createElement(import_options.default, { options: option, amountSymbol: symbol }), /* @__PURE__ */ import_react.default.createElement(import_AmountFooter.default, { item }), isShowPackageNote ? /* @__PURE__ */ import_react.default.createElement(import_Note.default, { item, type: "inside" }) : null);
48
+ const { title, name, id, price, symbol, options, option } = item;
49
+ return /* @__PURE__ */ import_react.default.createElement("div", { key: id, className: `${prefix}packages-product-bundle-item` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-title` }, translation(title || name)), !hidePrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-num` }, (0, import_utils._formatAmount)(price, symbol)) : null), /* @__PURE__ */ import_react.default.createElement(import_options.default, { options: options || option, amountSymbol: symbol }), /* @__PURE__ */ import_react.default.createElement(import_AmountFooter.default, { item }), isShowPackageNote ? /* @__PURE__ */ import_react.default.createElement(import_Note.default, { item, type: "inside" }) : null);
50
50
  };
51
51
  // Annotate the CommonJS export names for ESM import in node:
52
52
  0 && (module.exports = {
@@ -14,15 +14,16 @@
14
14
  &-packages-product-bundle-option-item {
15
15
  display: flex;
16
16
  justify-content: space-between;
17
+ gap: 8px;
17
18
  }
18
19
 
19
20
  &-packages-product-bundle-option-item-left {
20
21
  display: flex;
21
- gap: 4px;
22
+ gap: 8px;
22
23
  }
23
24
 
24
25
  &-packages-product-bundle-option-item-left-amount {
25
- margin-left: 8px;
26
+ margin-left: 0;
26
27
  display: flex;
27
28
  gap: 4px;
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "3.3.34",
3
+ "version": "3.3.35",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -72,8 +72,8 @@
72
72
  "react-barcode": "^1.5.3",
73
73
  "vod-js-sdk-v6": "^1.4.11",
74
74
  "@pisell/date-picker": "3.0.2",
75
- "@pisell/utils": "3.0.0",
76
- "@pisell/icon": "0.0.11"
75
+ "@pisell/icon": "0.0.11",
76
+ "@pisell/utils": "3.0.0"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "react": "^18.0.0",