@pisell/private-materials 6.3.30 → 6.3.32
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 +9 -1
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -2
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +267 -76
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +30 -30
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -6
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/index.js +4 -1
- package/es/components/booking/components/footer/utils.js +62 -46
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +2 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/main.js +3 -2
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/index.js +3 -2
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +9 -3
- package/es/components/booking/model.d.ts +13 -1
- package/es/components/booking/model.js +3 -0
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/plus/clientName/index.d.ts +4 -0
- package/es/plus/clientName/index.js +18 -0
- package/es/plus/clientName/index.less +10 -0
- package/es/plus/clientName/type.d.ts +13 -0
- package/es/plus/clientName/type.js +1 -0
- package/es/plus/clientName/utils.d.ts +2 -0
- package/es/plus/clientName/utils.js +18 -0
- package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/es/plus/contactInfo/components/Avatar/index.js +30 -0
- package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
- package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/es/plus/contactInfo/index.d.ts +6 -0
- package/es/plus/contactInfo/index.js +198 -0
- package/es/plus/contactInfo/index.less +621 -0
- package/es/plus/contactInfo/locales.d.ts +15 -0
- package/es/plus/contactInfo/locales.js +14 -0
- package/es/plus/contactInfo/types.d.ts +91 -0
- package/es/plus/contactInfo/types.js +1 -0
- package/es/plus/contactInfo/utils.d.ts +7 -0
- package/es/plus/contactInfo/utils.js +50 -0
- package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
- package/es/plus/contactInfoModal/index.d.ts +40 -0
- package/es/plus/contactInfoModal/index.js +154 -0
- package/es/plus/contactInfoModal/index.less +19 -0
- package/es/plus/contactInfoModal/locales.d.ts +66 -0
- package/es/plus/contactInfoModal/locales.js +65 -0
- package/es/pro/Login2.0/AuthModal.d.ts +143 -0
- package/es/pro/Login2.0/AuthModal.js +624 -0
- package/es/pro/Login2.0/Login2.d.ts +61 -0
- package/es/pro/Login2.0/Login2.js +2157 -0
- package/es/pro/Login2.0/Register2.d.ts +65 -0
- package/es/pro/Login2.0/Register2.js +1501 -0
- package/es/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
- package/es/pro/Login2.0/components/ForgotPasswordFlow.js +330 -0
- package/es/pro/Login2.0/components/LegalTerms.d.ts +8 -0
- package/es/pro/Login2.0/components/LegalTerms.js +51 -0
- package/es/pro/Login2.0/components/LegalTerms.less +74 -0
- package/es/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
- package/es/pro/Login2.0/components/LoginCodeInput.js +207 -0
- package/es/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
- package/es/pro/Login2.0/components/OAuthButtonGroup.js +55 -0
- package/es/pro/Login2.0/components/PhoneInput.d.ts +53 -0
- package/es/pro/Login2.0/components/PhoneInput.js +414 -0
- package/es/pro/Login2.0/components/PhoneInput.less +148 -0
- package/es/pro/Login2.0/components/phoneValidation.d.ts +17 -0
- package/es/pro/Login2.0/components/phoneValidation.js +228 -0
- package/es/pro/Login2.0/hooks/index.d.ts +2 -0
- package/es/pro/Login2.0/hooks/index.js +1 -0
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.js +87 -0
- package/es/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
- package/es/pro/Login2.0/hooks/useRegisterFlow.js +158 -0
- package/es/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
- package/es/pro/Login2.0/hooks/useRegistrationMethods.js +31 -0
- package/es/pro/Login2.0/index.js +8 -0
- package/es/pro/Login2.0/index.less +993 -0
- package/es/pro/Login2.0/locales.d.ts +543 -0
- package/es/pro/Login2.0/locales.js +622 -0
- package/es/pro/Login2.0/shared/Header.d.ts +11 -0
- package/es/pro/Login2.0/shared/Header.js +42 -0
- package/es/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
- package/es/pro/Login2.0/shared/OAuthButtons.js +59 -0
- package/es/pro/Login2.0/shared/registerFlow.d.ts +116 -0
- package/es/pro/Login2.0/shared/registerFlow.js +171 -0
- package/es/pro/Login2.0/shared/types.d.ts +232 -0
- package/es/pro/Login2.0/shared/types.js +1 -0
- package/es/pro/Login2.0/steps/CodeInput.d.ts +24 -0
- package/es/pro/Login2.0/steps/CodeInput.js +209 -0
- package/es/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
- package/es/pro/Login2.0/steps/EmailAlreadyRegistered.js +35 -0
- package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
- package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +25 -0
- package/es/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
- package/es/pro/Login2.0/steps/EmailLinkExpired.js +33 -0
- package/es/pro/Login2.0/steps/SetPassword.d.ts +19 -0
- package/es/pro/Login2.0/steps/SetPassword.js +148 -0
- package/es/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
- package/es/pro/Login2.0/steps/VerificationSuccess.js +35 -0
- package/es/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
- package/es/pro/Login2.0/steps/VerifyingEmailLink.js +17 -0
- package/es/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
- package/es/pro/Login2.0/steps/WaitEmailLink.js +54 -0
- package/es/pro/Login2.0/steps/index.d.ts +19 -0
- package/es/pro/Login2.0/steps/index.js +11 -0
- package/es/pro/Login2.0/steps/steps.less +423 -0
- package/es/pro/Login2.0/types.d.ts +167 -0
- package/es/pro/Login2.0/types.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -3
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +151 -13
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +73 -35
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +6 -3
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/index.js +4 -1
- package/lib/components/booking/components/footer/utils.js +70 -38
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +1 -1
- package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
- package/lib/components/booking/info/main.js +5 -4
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/model.js +5 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/index.js +5 -4
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +9 -3
- package/lib/components/booking/model.d.ts +13 -1
- package/lib/components/booking/model.js +3 -0
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js +13 -0
- package/lib/plus/clientName/index.d.ts +4 -0
- package/lib/plus/clientName/index.js +53 -0
- package/lib/plus/clientName/index.less +10 -0
- package/lib/plus/clientName/type.d.ts +13 -0
- package/lib/plus/clientName/type.js +17 -0
- package/lib/plus/clientName/utils.d.ts +2 -0
- package/lib/plus/clientName/utils.js +43 -0
- package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/lib/plus/contactInfo/index.d.ts +6 -0
- package/lib/plus/contactInfo/index.js +226 -0
- package/lib/plus/contactInfo/index.less +621 -0
- package/lib/plus/contactInfo/locales.d.ts +15 -0
- package/lib/plus/contactInfo/locales.js +38 -0
- package/lib/plus/contactInfo/types.d.ts +91 -0
- package/lib/plus/contactInfo/types.js +17 -0
- package/lib/plus/contactInfo/utils.d.ts +7 -0
- package/lib/plus/contactInfo/utils.js +64 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
- package/lib/plus/contactInfoModal/index.d.ts +40 -0
- package/lib/plus/contactInfoModal/index.js +138 -0
- package/lib/plus/contactInfoModal/index.less +19 -0
- package/lib/plus/contactInfoModal/locales.d.ts +66 -0
- package/lib/plus/contactInfoModal/locales.js +89 -0
- package/lib/pro/Login2.0/AuthModal.d.ts +143 -0
- package/lib/pro/Login2.0/AuthModal.js +498 -0
- package/lib/pro/Login2.0/Login2.d.ts +61 -0
- package/lib/pro/Login2.0/Login2.js +1468 -0
- package/lib/pro/Login2.0/Register2.d.ts +65 -0
- package/lib/pro/Login2.0/Register2.js +1062 -0
- package/lib/pro/Login2.0/components/ForgotPasswordFlow.d.ts +31 -0
- package/lib/pro/Login2.0/components/ForgotPasswordFlow.js +213 -0
- package/lib/pro/Login2.0/components/LegalTerms.d.ts +8 -0
- package/lib/pro/Login2.0/components/LegalTerms.js +76 -0
- package/lib/pro/Login2.0/components/LegalTerms.less +74 -0
- package/lib/pro/Login2.0/components/LoginCodeInput.d.ts +27 -0
- package/lib/pro/Login2.0/components/LoginCodeInput.js +161 -0
- package/lib/pro/Login2.0/components/OAuthButtonGroup.d.ts +22 -0
- package/lib/pro/Login2.0/components/OAuthButtonGroup.js +87 -0
- package/lib/pro/Login2.0/components/PhoneInput.d.ts +53 -0
- package/lib/pro/Login2.0/components/PhoneInput.js +263 -0
- package/lib/pro/Login2.0/components/PhoneInput.less +148 -0
- package/lib/pro/Login2.0/components/phoneValidation.d.ts +17 -0
- package/lib/pro/Login2.0/components/phoneValidation.js +153 -0
- package/lib/pro/Login2.0/hooks/index.d.ts +2 -0
- package/lib/pro/Login2.0/hooks/index.js +29 -0
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +24 -0
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.js +140 -0
- package/lib/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
- package/lib/pro/Login2.0/hooks/useRegisterFlow.js +149 -0
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.js +51 -0
- package/lib/pro/Login2.0/index.js +45 -0
- package/lib/pro/Login2.0/index.less +993 -0
- package/lib/pro/Login2.0/locales.d.ts +543 -0
- package/lib/pro/Login2.0/locales.js +646 -0
- package/lib/pro/Login2.0/shared/Header.d.ts +11 -0
- package/lib/pro/Login2.0/shared/Header.js +81 -0
- package/lib/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
- package/lib/pro/Login2.0/shared/OAuthButtons.js +78 -0
- package/lib/pro/Login2.0/shared/registerFlow.d.ts +116 -0
- package/lib/pro/Login2.0/shared/registerFlow.js +235 -0
- package/lib/pro/Login2.0/shared/types.d.ts +232 -0
- package/lib/pro/Login2.0/shared/types.js +17 -0
- package/lib/pro/Login2.0/steps/CodeInput.d.ts +24 -0
- package/lib/pro/Login2.0/steps/CodeInput.js +160 -0
- package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.d.ts +12 -0
- package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.js +46 -0
- package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.d.ts +7 -0
- package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +51 -0
- package/lib/pro/Login2.0/steps/EmailLinkExpired.d.ts +9 -0
- package/lib/pro/Login2.0/steps/EmailLinkExpired.js +51 -0
- package/lib/pro/Login2.0/steps/SetPassword.d.ts +19 -0
- package/lib/pro/Login2.0/steps/SetPassword.js +131 -0
- package/lib/pro/Login2.0/steps/VerificationSuccess.d.ts +8 -0
- package/lib/pro/Login2.0/steps/VerificationSuccess.js +49 -0
- package/lib/pro/Login2.0/steps/VerifyingEmailLink.d.ts +7 -0
- package/lib/pro/Login2.0/steps/VerifyingEmailLink.js +41 -0
- package/lib/pro/Login2.0/steps/WaitEmailLink.d.ts +18 -0
- package/lib/pro/Login2.0/steps/WaitEmailLink.js +67 -0
- package/lib/pro/Login2.0/steps/index.d.ts +19 -0
- package/lib/pro/Login2.0/steps/index.js +60 -0
- package/lib/pro/Login2.0/steps/steps.less +423 -0
- package/lib/pro/Login2.0/types.d.ts +167 -0
- package/lib/pro/Login2.0/types.js +17 -0
- package/lowcode/authmodal/meta.ts +395 -0
- package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
- package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
- package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
- package/lowcode/contact-info/fragments/textStyle.ts +33 -0
- package/lowcode/contact-info/meta.ts +199 -0
- package/lowcode/contact-info-modal/meta.ts +98 -0
- package/lowcode/login2/CONFIG.md +447 -0
- package/lowcode/login2/TEST_CONFIG.md +324 -0
- package/lowcode/login2/VERIFICATION_METHODS.md +364 -0
- package/lowcode/login2/meta.ts +560 -0
- package/lowcode/login2/snippets.ts +124 -0
- package/lowcode/register2/meta.ts +562 -0
- package/lowcode/register2/snippets.ts +257 -0
- package/package.json +7 -5
|
@@ -0,0 +1,198 @@
|
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useMemo, useState } from 'react';
|
|
14
|
+
import { Iconfont } from '@pisell/materials';
|
|
15
|
+
import { locales } from '@pisell/utils';
|
|
16
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
17
|
+
import Avatar from "./components/Avatar";
|
|
18
|
+
import { SwipeAction } from "./components/SwipeAction";
|
|
19
|
+
import ContactInfoModal from "../contactInfoModal";
|
|
20
|
+
import localeTexts from "./locales";
|
|
21
|
+
import "./index.less";
|
|
22
|
+
export var PREFIX = 'pisell-plus-contact-info';
|
|
23
|
+
var ContactInfo = function ContactInfo(props) {
|
|
24
|
+
var _context$appHelper$ut, _props$style2;
|
|
25
|
+
console.log('props>>>>>>>>>', props);
|
|
26
|
+
var dataSource = props.dataSource,
|
|
27
|
+
defaultName = props.defaultName,
|
|
28
|
+
placeholder = props.placeholder,
|
|
29
|
+
_props$direction = props.direction,
|
|
30
|
+
direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
|
|
31
|
+
isShowDelete = props.isShowDelete,
|
|
32
|
+
isShowAvatar = props.isShowAvatar,
|
|
33
|
+
isShowPhone = props.isShowPhone,
|
|
34
|
+
isShowEmail = props.isShowEmail,
|
|
35
|
+
horizontalGap = props.horizontalGap,
|
|
36
|
+
verticalGap = props.verticalGap,
|
|
37
|
+
_onSave = props.onSave,
|
|
38
|
+
_onDelete = props.onDelete,
|
|
39
|
+
_onCancel = props.onCancel;
|
|
40
|
+
var context = useEngineContext();
|
|
41
|
+
locales.init(localeTexts, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale')) || 'en');
|
|
42
|
+
var _useState = useState(false),
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
modalVisible = _useState2[0],
|
|
45
|
+
setModalVisible = _useState2[1];
|
|
46
|
+
var isHorizontal = useMemo(function () {
|
|
47
|
+
return direction === 'horizontal';
|
|
48
|
+
}, [direction]);
|
|
49
|
+
var displayName = useMemo(function () {
|
|
50
|
+
var _ref = dataSource || {},
|
|
51
|
+
first_name = _ref.first_name,
|
|
52
|
+
last_name = _ref.last_name;
|
|
53
|
+
if (!first_name && !last_name) {
|
|
54
|
+
return defaultName || '';
|
|
55
|
+
}
|
|
56
|
+
return "".concat(first_name || '', " ").concat(last_name || '');
|
|
57
|
+
}, [dataSource, defaultName]);
|
|
58
|
+
var displayPhone = useMemo(function () {
|
|
59
|
+
var _ref2 = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.phone) || {},
|
|
60
|
+
country_calling_code = _ref2.country_calling_code,
|
|
61
|
+
phone = _ref2.phone;
|
|
62
|
+
if (!country_calling_code || !phone) {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
// 需要对country_calling_code做兼容处理,部分数据可能没有+号前缀
|
|
66
|
+
var countryCallingCode = country_calling_code !== null && country_calling_code !== void 0 && country_calling_code.startsWith('+') ? country_calling_code : "+".concat(country_calling_code);
|
|
67
|
+
return "".concat(countryCallingCode || '', " ").concat(phone || '');
|
|
68
|
+
}, [dataSource === null || dataSource === void 0 ? void 0 : dataSource.phone]);
|
|
69
|
+
var isEmpty = useMemo(function () {
|
|
70
|
+
var _dataSource$phone;
|
|
71
|
+
return !(dataSource !== null && dataSource !== void 0 && dataSource.first_name) && !(dataSource !== null && dataSource !== void 0 && dataSource.last_name) && !(dataSource !== null && dataSource !== void 0 && (_dataSource$phone = dataSource.phone) !== null && _dataSource$phone !== void 0 && _dataSource$phone.phone) && !(dataSource !== null && dataSource !== void 0 && dataSource.email);
|
|
72
|
+
}, [dataSource]);
|
|
73
|
+
var handleClick = function handleClick() {
|
|
74
|
+
console.log('handleClick');
|
|
75
|
+
setModalVisible(true);
|
|
76
|
+
};
|
|
77
|
+
var _rightActions = useMemo(function () {
|
|
78
|
+
var deleteAction = {
|
|
79
|
+
key: 'delete',
|
|
80
|
+
text: /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
style: {
|
|
82
|
+
display: 'flex',
|
|
83
|
+
justifyContent: 'center',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
color: 'white',
|
|
86
|
+
cursor: 'pointer',
|
|
87
|
+
padding: '10px 0px',
|
|
88
|
+
borderRadius: '8px'
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
91
|
+
type: "pisell2-trash-01",
|
|
92
|
+
style: {
|
|
93
|
+
fontSize: 20,
|
|
94
|
+
marginRight: 4
|
|
95
|
+
}
|
|
96
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
97
|
+
style: {
|
|
98
|
+
fontSize: 12,
|
|
99
|
+
fontWeight: 500
|
|
100
|
+
}
|
|
101
|
+
}, locales.getText('pisell2.text.contact-info.actions.delete'))),
|
|
102
|
+
color: 'danger',
|
|
103
|
+
onClick: function onClick(e) {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
_onDelete === null || _onDelete === void 0 || _onDelete();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return [deleteAction];
|
|
110
|
+
}, [dataSource, _onDelete]);
|
|
111
|
+
var renderContent = function renderContent() {
|
|
112
|
+
var _props$style;
|
|
113
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: "".concat(PREFIX, "__").concat(direction),
|
|
115
|
+
style: {
|
|
116
|
+
gap: verticalGap,
|
|
117
|
+
padding: (props === null || props === void 0 || (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.padding) || '8px'
|
|
118
|
+
}
|
|
119
|
+
}, isHorizontal ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
className: "".concat(PREFIX, "__horizontal-left"),
|
|
121
|
+
style: {
|
|
122
|
+
gap: horizontalGap
|
|
123
|
+
}
|
|
124
|
+
}, isShowAvatar && /*#__PURE__*/React.createElement(Avatar, {
|
|
125
|
+
config: props.avatar,
|
|
126
|
+
name: displayName,
|
|
127
|
+
cover: ''
|
|
128
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: "".concat(PREFIX, "__horizontal-left-content"),
|
|
130
|
+
style: {
|
|
131
|
+
gap: verticalGap
|
|
132
|
+
}
|
|
133
|
+
}, isEmpty ? /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: "".concat(PREFIX, "__empty-description")
|
|
135
|
+
}, placeholder || locales.getText('pisell2.text.contact-info.placeholder')) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: "".concat(PREFIX, "__name-horizontal-container")
|
|
137
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
138
|
+
className: "".concat(PREFIX, "__name-horizontal"),
|
|
139
|
+
style: props.nameStyle
|
|
140
|
+
}, displayName), isShowPhone && displayPhone && /*#__PURE__*/React.createElement("span", {
|
|
141
|
+
className: "".concat(PREFIX, "__phone-horizontal"),
|
|
142
|
+
style: props.textStyle
|
|
143
|
+
}, "(", displayPhone, ")")), isShowEmail && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.email) && /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
className: "".concat(PREFIX, "__text"),
|
|
145
|
+
style: props.textStyle
|
|
146
|
+
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.email)))), /*#__PURE__*/React.createElement("div", {
|
|
147
|
+
className: "".concat(PREFIX, "__horizontal-right")
|
|
148
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
149
|
+
type: isEmpty ? 'pisell2-plus-circle' : 'pisell2-edit-05',
|
|
150
|
+
className: "".concat(PREFIX, "__horizontal-right-icon")
|
|
151
|
+
}))) : /*#__PURE__*/React.createElement(React.Fragment, null, isShowAvatar && /*#__PURE__*/React.createElement(Avatar, {
|
|
152
|
+
config: props.avatar,
|
|
153
|
+
name: 'hhhhh',
|
|
154
|
+
cover: ''
|
|
155
|
+
}), isEmpty ? /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: "".concat(PREFIX, "__empty-description")
|
|
157
|
+
}, placeholder || locales.getText('pisell2.text.contact-info.placeholder')) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: "".concat(PREFIX, "__name"),
|
|
159
|
+
style: props.nameStyle
|
|
160
|
+
}, displayName), isShowPhone && displayPhone && /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: "".concat(PREFIX, "__text"),
|
|
162
|
+
style: props.textStyle
|
|
163
|
+
}, displayPhone), isShowEmail && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.email) && /*#__PURE__*/React.createElement("div", {
|
|
164
|
+
className: "".concat(PREFIX, "__text"),
|
|
165
|
+
style: props.textStyle
|
|
166
|
+
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.email))));
|
|
167
|
+
};
|
|
168
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
169
|
+
className: "".concat(PREFIX),
|
|
170
|
+
style: _objectSpread(_objectSpread({}, props.style || {}), {}, {
|
|
171
|
+
padding: 0
|
|
172
|
+
}),
|
|
173
|
+
onClick: handleClick
|
|
174
|
+
}, isShowDelete && !isEmpty ? /*#__PURE__*/React.createElement(SwipeAction, {
|
|
175
|
+
closeOnAction: false,
|
|
176
|
+
rightActions: _rightActions,
|
|
177
|
+
style: {
|
|
178
|
+
borderRadius: (props === null || props === void 0 || (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.borderRadius) || 0
|
|
179
|
+
}
|
|
180
|
+
}, renderContent()) : renderContent()), /*#__PURE__*/React.createElement(ContactInfoModal, {
|
|
181
|
+
open: modalVisible,
|
|
182
|
+
dataSource: dataSource,
|
|
183
|
+
isShowDelete: isShowDelete,
|
|
184
|
+
onCancel: function onCancel() {
|
|
185
|
+
setModalVisible(false);
|
|
186
|
+
_onCancel === null || _onCancel === void 0 || _onCancel();
|
|
187
|
+
},
|
|
188
|
+
onSave: function onSave(value) {
|
|
189
|
+
setModalVisible(false);
|
|
190
|
+
_onSave === null || _onSave === void 0 || _onSave(value);
|
|
191
|
+
},
|
|
192
|
+
onDelete: function onDelete() {
|
|
193
|
+
setModalVisible(false);
|
|
194
|
+
_onDelete === null || _onDelete === void 0 || _onDelete();
|
|
195
|
+
}
|
|
196
|
+
}));
|
|
197
|
+
};
|
|
198
|
+
export default ContactInfo;
|