@pisell/private-materials 6.11.177 → 6.11.178
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/checkout/plugin.js +21 -4
- package/lib/components/checkout/plugin.js +20 -1
- package/package.json +3 -3
|
@@ -4,14 +4,14 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
|
|
|
4
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
7
10
|
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; }
|
|
8
11
|
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; }
|
|
9
12
|
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; }
|
|
10
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
14
|
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); }
|
|
12
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
13
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
14
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
15
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
16
|
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."); }
|
|
17
17
|
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); }
|
|
@@ -74,6 +74,23 @@ var PaymentModalContent = function PaymentModalContent(_ref) {
|
|
|
74
74
|
}
|
|
75
75
|
return null;
|
|
76
76
|
};
|
|
77
|
+
var getEditModeClient = function getEditModeClient(bookingOrigin, booking) {
|
|
78
|
+
var _booking$client;
|
|
79
|
+
var formattedClient = (booking === null || booking === void 0 || (_booking$client = booking.client) === null || _booking$client === void 0 ? void 0 : _booking$client.value) || {};
|
|
80
|
+
var originCustomer = (bookingOrigin === null || bookingOrigin === void 0 ? void 0 : bookingOrigin.customer) || {};
|
|
81
|
+
var displayName = (originCustomer.display_name || '').trim() || (formattedClient.display_name || '').trim() || ((bookingOrigin === null || bookingOrigin === void 0 ? void 0 : bookingOrigin.customer_name) || '').trim();
|
|
82
|
+
var nickname = (originCustomer.nickname || '').trim() || (formattedClient.nickname || '').trim() || (formattedClient.name || '').trim();
|
|
83
|
+
return _objectSpread(_objectSpread(_objectSpread({}, originCustomer), formattedClient), {}, {
|
|
84
|
+
id: formattedClient.id || originCustomer.id || (bookingOrigin === null || bookingOrigin === void 0 ? void 0 : bookingOrigin.customer_id),
|
|
85
|
+
name: formattedClient.name || displayName || nickname,
|
|
86
|
+
display_name: displayName,
|
|
87
|
+
nickname: nickname,
|
|
88
|
+
email: formattedClient.email || originCustomer.email || (bookingOrigin === null || bookingOrigin === void 0 ? void 0 : bookingOrigin.email) || '',
|
|
89
|
+
phone: formattedClient.phone || originCustomer.phone || (bookingOrigin === null || bookingOrigin === void 0 ? void 0 : bookingOrigin.phone) || '',
|
|
90
|
+
country_calling_code: formattedClient.country_calling_code || originCustomer.country_calling_code || (bookingOrigin === null || bookingOrigin === void 0 ? void 0 : bookingOrigin.country_calling_code) || '',
|
|
91
|
+
cover: formattedClient.cover || originCustomer.cover || ''
|
|
92
|
+
});
|
|
93
|
+
};
|
|
77
94
|
useLayoutEffect(function () {
|
|
78
95
|
if (BookingTicket && !bookingTicketModule) {
|
|
79
96
|
pisellos === null || pisellos === void 0 || pisellos.registerModule(new BookingTicket(getBookingTicketKey('ticket')), {
|
|
@@ -387,7 +404,7 @@ var PaymentModalContent = function PaymentModalContent(_ref) {
|
|
|
387
404
|
payload: _objectSpread({}, booking)
|
|
388
405
|
});
|
|
389
406
|
}
|
|
390
|
-
setClient(booking
|
|
407
|
+
setClient(getEditModeClient(bookingOrigin, booking));
|
|
391
408
|
setData(modalData);
|
|
392
409
|
setDataReady(true);
|
|
393
410
|
window.isPaymentModalPluginOpen = true;
|
|
@@ -69,6 +69,25 @@ var PaymentModalContent = ({ state, dispatch }) => {
|
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
};
|
|
72
|
+
const getEditModeClient = (bookingOrigin, booking) => {
|
|
73
|
+
var _a2;
|
|
74
|
+
const formattedClient = ((_a2 = booking == null ? void 0 : booking.client) == null ? void 0 : _a2.value) || {};
|
|
75
|
+
const originCustomer = (bookingOrigin == null ? void 0 : bookingOrigin.customer) || {};
|
|
76
|
+
const displayName = (originCustomer.display_name || "").trim() || (formattedClient.display_name || "").trim() || ((bookingOrigin == null ? void 0 : bookingOrigin.customer_name) || "").trim();
|
|
77
|
+
const nickname = (originCustomer.nickname || "").trim() || (formattedClient.nickname || "").trim() || (formattedClient.name || "").trim();
|
|
78
|
+
return {
|
|
79
|
+
...originCustomer,
|
|
80
|
+
...formattedClient,
|
|
81
|
+
id: formattedClient.id || originCustomer.id || (bookingOrigin == null ? void 0 : bookingOrigin.customer_id),
|
|
82
|
+
name: formattedClient.name || displayName || nickname,
|
|
83
|
+
display_name: displayName,
|
|
84
|
+
nickname,
|
|
85
|
+
email: formattedClient.email || originCustomer.email || (bookingOrigin == null ? void 0 : bookingOrigin.email) || "",
|
|
86
|
+
phone: formattedClient.phone || originCustomer.phone || (bookingOrigin == null ? void 0 : bookingOrigin.phone) || "",
|
|
87
|
+
country_calling_code: formattedClient.country_calling_code || originCustomer.country_calling_code || (bookingOrigin == null ? void 0 : bookingOrigin.country_calling_code) || "",
|
|
88
|
+
cover: formattedClient.cover || originCustomer.cover || ""
|
|
89
|
+
};
|
|
90
|
+
};
|
|
72
91
|
(0, import_react.useLayoutEffect)(() => {
|
|
73
92
|
if (BookingTicket && !bookingTicketModule) {
|
|
74
93
|
pisellos == null ? void 0 : pisellos.registerModule(new BookingTicket((0, import_utils4.getBookingTicketKey)("ticket")), {
|
|
@@ -353,7 +372,7 @@ var PaymentModalContent = ({ state, dispatch }) => {
|
|
|
353
372
|
}
|
|
354
373
|
});
|
|
355
374
|
}
|
|
356
|
-
setClient(booking
|
|
375
|
+
setClient(getEditModeClient(bookingOrigin, booking));
|
|
357
376
|
setData(modalData);
|
|
358
377
|
setDataReady(true);
|
|
359
378
|
window.isPaymentModalPluginOpen = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.178",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"styled-components": "^6.0.0-rc.3",
|
|
70
70
|
"@pisell/utils": "3.0.2",
|
|
71
71
|
"@pisell/materials": "6.11.57",
|
|
72
|
-
"@pisell/
|
|
73
|
-
"@pisell/
|
|
72
|
+
"@pisell/date-picker": "3.0.8",
|
|
73
|
+
"@pisell/icon": "0.0.11"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"react": "^18.0.0",
|