@pisell/private-materials 6.3.35 → 6.3.37
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +146 -151
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +15 -9
- package/es/components/booking/components/customSelect/index.js +1 -1
- package/es/components/booking/forms/footer.js +24 -10
- package/es/components/booking/info/client/index.js +28 -13
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +14 -8
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +6 -3
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/plus/contactInfoModal/index.d.ts +1 -0
- package/es/plus/contactInfoModal/index.js +1 -0
- package/es/pro/Login2.0/Login2.js +78 -27
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +5 -0
- package/lib/components/booking/components/customSelect/index.js +1 -1
- package/lib/components/booking/forms/footer.js +29 -11
- package/lib/components/booking/info/client/index.js +14 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +6 -1
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/plus/contactInfoModal/index.d.ts +1 -0
- package/lib/plus/contactInfoModal/index.js +1 -0
- package/lib/pro/Login2.0/Login2.js +86 -23
- package/package.json +2 -2
|
@@ -104,14 +104,11 @@ var Login2 = ({
|
|
|
104
104
|
(0, import_react.useEffect)(() => {
|
|
105
105
|
var _a2;
|
|
106
106
|
if (loginMethods.length > 0 && !currentLoginMethod) {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
const first = nonOAuthMethod || loginMethods[0];
|
|
111
|
-
setCurrentLoginMethod(first);
|
|
112
|
-
if (first.type === "email" || first.type === "phone") {
|
|
107
|
+
const initialMethod = loginMethods[0];
|
|
108
|
+
setCurrentLoginMethod(initialMethod);
|
|
109
|
+
if ((initialMethod == null ? void 0 : initialMethod.type) === "email" || (initialMethod == null ? void 0 : initialMethod.type) === "phone") {
|
|
113
110
|
setCurrentVerificationMethod(
|
|
114
|
-
((_a2 =
|
|
111
|
+
((_a2 = initialMethod.verificationMethods) == null ? void 0 : _a2[0]) || "password"
|
|
115
112
|
);
|
|
116
113
|
}
|
|
117
114
|
}
|
|
@@ -1219,12 +1216,16 @@ var Login2 = ({
|
|
|
1219
1216
|
};
|
|
1220
1217
|
const renderSwitchOptions = () => {
|
|
1221
1218
|
if (!currentLoginMethod) return null;
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1219
|
+
const primaryMethod = loginMethods[0];
|
|
1220
|
+
const currentIsFormMethod = currentLoginMethod.type === "email" || currentLoginMethod.type === "phone";
|
|
1221
|
+
const primaryIsFormMethod = (primaryMethod == null ? void 0 : primaryMethod.type) === "email" || (primaryMethod == null ? void 0 : primaryMethod.type) === "phone";
|
|
1222
|
+
const shouldUseFormLayout = currentIsFormMethod || primaryIsFormMethod;
|
|
1223
|
+
const verificationSwitchButtons = [];
|
|
1224
|
+
if (currentIsFormMethod) {
|
|
1224
1225
|
(currentLoginMethod.verificationMethods || []).filter((method) => method !== currentVerificationMethod).forEach((method) => {
|
|
1225
1226
|
if (method === "verification_code") {
|
|
1226
1227
|
const text = currentLoginMethod.type === "email" ? import_utils.locales.getText("pisell-login2-switch-to-email-code") : import_utils.locales.getText("pisell-login2-switch-to-sms-code");
|
|
1227
|
-
|
|
1228
|
+
verificationSwitchButtons.push(
|
|
1228
1229
|
/* @__PURE__ */ import_react.default.createElement(
|
|
1229
1230
|
"button",
|
|
1230
1231
|
{
|
|
@@ -1237,7 +1238,7 @@ var Login2 = ({
|
|
|
1237
1238
|
)
|
|
1238
1239
|
);
|
|
1239
1240
|
} else {
|
|
1240
|
-
|
|
1241
|
+
verificationSwitchButtons.push(
|
|
1241
1242
|
/* @__PURE__ */ import_react.default.createElement(
|
|
1242
1243
|
"button",
|
|
1243
1244
|
{
|
|
@@ -1252,17 +1253,15 @@ var Login2 = ({
|
|
|
1252
1253
|
}
|
|
1253
1254
|
});
|
|
1254
1255
|
}
|
|
1256
|
+
const emailPhoneSwitchButtons = [];
|
|
1255
1257
|
loginMethods.forEach((method, index) => {
|
|
1256
1258
|
if (method.type === "email" || method.type === "phone") {
|
|
1257
|
-
if (method.type === currentLoginMethod.type)
|
|
1258
|
-
return;
|
|
1259
|
-
}
|
|
1259
|
+
if (method.type === currentLoginMethod.type) return;
|
|
1260
1260
|
const isLast = isLastLoginMethod(method.type);
|
|
1261
|
-
const className2 = (0, import_classnames.default)(
|
|
1262
|
-
"
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
nonOauthButtons.push(
|
|
1261
|
+
const className2 = (0, import_classnames.default)("login2-switch-option-button", {
|
|
1262
|
+
"has-last-login-badge": isLast
|
|
1263
|
+
});
|
|
1264
|
+
emailPhoneSwitchButtons.push(
|
|
1266
1265
|
/* @__PURE__ */ import_react.default.createElement(
|
|
1267
1266
|
"button",
|
|
1268
1267
|
{
|
|
@@ -1282,7 +1281,10 @@ var Login2 = ({
|
|
|
1282
1281
|
);
|
|
1283
1282
|
}
|
|
1284
1283
|
});
|
|
1285
|
-
const
|
|
1284
|
+
const nonOauthButtons = [
|
|
1285
|
+
...verificationSwitchButtons,
|
|
1286
|
+
...emailPhoneSwitchButtons
|
|
1287
|
+
];
|
|
1286
1288
|
const registerPrompt = onSwitchToRegister && /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-register-prompt" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "register-prompt-text" }, import_utils.locales.getText("pisell-login2-no-account")), /* @__PURE__ */ import_react.default.createElement(
|
|
1287
1289
|
"button",
|
|
1288
1290
|
{
|
|
@@ -1294,15 +1296,76 @@ var Login2 = ({
|
|
|
1294
1296
|
if (!nonOauthButtons.length && !oauthProviders.length) {
|
|
1295
1297
|
return registerPrompt;
|
|
1296
1298
|
}
|
|
1297
|
-
|
|
1299
|
+
if (shouldUseFormLayout) {
|
|
1300
|
+
const groups = [];
|
|
1301
|
+
if (nonOauthButtons.length > 0) {
|
|
1302
|
+
groups.push(
|
|
1303
|
+
/* @__PURE__ */ import_react.default.createElement("div", { key: "non-oauth", className: "login2-switch-options" }, nonOauthButtons)
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
if (oauthProviders.length > 0) {
|
|
1307
|
+
groups.push(
|
|
1308
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1309
|
+
import_OAuthButtonGroup.default,
|
|
1310
|
+
{
|
|
1311
|
+
key: "oauth",
|
|
1312
|
+
providers: oauthProviders,
|
|
1313
|
+
wrapperClassName: "login2-oauth-buttons",
|
|
1314
|
+
buttonClassName: "login2-oauth-button",
|
|
1315
|
+
gap: 12
|
|
1316
|
+
}
|
|
1317
|
+
)
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
if (!groups.length) {
|
|
1321
|
+
return registerPrompt;
|
|
1322
|
+
}
|
|
1323
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-divider" }, import_utils.locales.getText("pisell-login2-or")), /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-groups" }, groups), registerPrompt);
|
|
1324
|
+
}
|
|
1325
|
+
const primaryProvider = oauthProviders.find(
|
|
1326
|
+
(provider) => provider.key === (primaryMethod == null ? void 0 : primaryMethod.type)
|
|
1327
|
+
);
|
|
1328
|
+
const secondaryOauthProviders = oauthProviders.filter(
|
|
1329
|
+
(provider) => provider.key !== (primaryMethod == null ? void 0 : primaryMethod.type)
|
|
1330
|
+
);
|
|
1331
|
+
const hasSecondaryButtons = nonOauthButtons.length > 0 || secondaryOauthProviders.length > 0;
|
|
1332
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-groups" }, primaryProvider ? /* @__PURE__ */ import_react.default.createElement(
|
|
1333
|
+
import_OAuthButtonGroup.default,
|
|
1334
|
+
{
|
|
1335
|
+
providers: [primaryProvider],
|
|
1336
|
+
wrapperClassName: "login2-oauth-buttons",
|
|
1337
|
+
buttonClassName: "login2-oauth-button",
|
|
1338
|
+
gap: 12
|
|
1339
|
+
}
|
|
1340
|
+
) : /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-options" }, /* @__PURE__ */ import_react.default.createElement(
|
|
1341
|
+
"button",
|
|
1342
|
+
{
|
|
1343
|
+
key: "primary-fallback",
|
|
1344
|
+
className: "login2-switch-option-button",
|
|
1345
|
+
onClick: () => {
|
|
1346
|
+
if ((primaryMethod == null ? void 0 : primaryMethod.type) === "guest") {
|
|
1347
|
+
handleGuestLogin();
|
|
1348
|
+
} else if ((primaryMethod == null ? void 0 : primaryMethod.type) === "google" || (primaryMethod == null ? void 0 : primaryMethod.type) === "facebook" || (primaryMethod == null ? void 0 : primaryMethod.type) === "apple") {
|
|
1349
|
+
handleOAuthClick(primaryMethod.type);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1354
|
+
import_materials2.Iconfont,
|
|
1355
|
+
{
|
|
1356
|
+
type: (primaryMethod == null ? void 0 : primaryMethod.type) === "guest" ? "pisell2-user-01" : (primaryMethod == null ? void 0 : primaryMethod.type) === "google" ? "pisell2-google" : (primaryMethod == null ? void 0 : primaryMethod.type) === "facebook" ? "pisell2-facebook" : "pisell2-apple"
|
|
1357
|
+
}
|
|
1358
|
+
),
|
|
1359
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "option-text" }, (primaryMethod == null ? void 0 : primaryMethod.type) === "guest" ? import_utils.locales.getText("pisell-login2-login-as-guest") : `${import_utils.locales.getText("pisell-login2-continue-with")} ${(primaryMethod == null ? void 0 : primaryMethod.type) ? primaryMethod.type.charAt(0).toUpperCase() + primaryMethod.type.slice(1) : ""}`)
|
|
1360
|
+
)), hasSecondaryButtons && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-divider" }, import_utils.locales.getText("pisell-login2-or")), nonOauthButtons.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-switch-options" }, nonOauthButtons), secondaryOauthProviders.length > 0 && /* @__PURE__ */ import_react.default.createElement(
|
|
1298
1361
|
import_OAuthButtonGroup.default,
|
|
1299
1362
|
{
|
|
1300
|
-
providers:
|
|
1363
|
+
providers: secondaryOauthProviders,
|
|
1301
1364
|
wrapperClassName: "login2-oauth-buttons",
|
|
1302
1365
|
buttonClassName: "login2-oauth-button",
|
|
1303
1366
|
gap: 12
|
|
1304
1367
|
}
|
|
1305
|
-
)), registerPrompt);
|
|
1368
|
+
))), registerPrompt);
|
|
1306
1369
|
};
|
|
1307
1370
|
if (!visible) {
|
|
1308
1371
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.37",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@react-spring/web": "^9.6.1",
|
|
63
63
|
"@use-gesture/react": "^10.3.1",
|
|
64
64
|
"@pisell/utils": "3.0.1",
|
|
65
|
-
"@pisell/icon": "0.0.11",
|
|
66
65
|
"@pisell/materials": "6.3.10",
|
|
66
|
+
"@pisell/icon": "0.0.11",
|
|
67
67
|
"@pisell/date-picker": "3.0.4"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|