@pisell/private-materials 6.1.2 → 6.1.3

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.
Files changed (25) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/booking/info/service/Lists.js +2 -0
  8. package/es/components/booking/info/service/editService/index.js +3 -0
  9. package/es/components/booking/info/service/serviceList/index.js +2 -0
  10. package/es/components/booking/info/service/serviceManager/index.js +3 -1
  11. package/es/components/booking/info/service2/Lists.js +1 -0
  12. package/es/components/booking/info2/service/addService/index.js +1 -0
  13. package/es/components/booking/info2/service/editService/index.js +18 -2
  14. package/es/components/booking/info2/service/serviceList/index.js +2 -0
  15. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
  16. package/lib/components/booking/info/service/Lists.js +2 -0
  17. package/lib/components/booking/info/service/editService/index.js +3 -0
  18. package/lib/components/booking/info/service/serviceList/index.js +2 -0
  19. package/lib/components/booking/info/service/serviceManager/index.js +2 -0
  20. package/lib/components/booking/info/service2/Lists.js +1 -0
  21. package/lib/components/booking/info2/service/addService/index.js +1 -0
  22. package/lib/components/booking/info2/service/editService/index.js +16 -3
  23. package/lib/components/booking/info2/service/serviceList/index.js +2 -0
  24. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
  25. package/package.json +3 -3
@@ -57,12 +57,14 @@ var Lists = function Lists(_ref) {
57
57
  state: state
58
58
  });
59
59
  }
60
+ openBookingEditModal();
60
61
  onChange({
61
62
  editModal: true,
62
63
  cacheItem: cacheItem
63
64
  });
64
65
  return onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem, type);
65
66
  }
67
+ closeBookingEditModal();
66
68
  var params = {
67
69
  editModal: false,
68
70
  value: products,
@@ -269,6 +269,7 @@ var Info = function Info(_, ref) {
269
269
  return d._id !== _id;
270
270
  });
271
271
  }
272
+ closeBookingEditModal();
272
273
  dispatch({
273
274
  type: 'setService',
274
275
  payload: {
@@ -785,6 +786,7 @@ var Info = function Info(_, ref) {
785
786
  if (state.channelDisabledEdit) {
786
787
  return;
787
788
  }
789
+ openBookingEditModal();
788
790
  dispatch({
789
791
  type: 'setService',
790
792
  payload: {
@@ -972,6 +974,7 @@ var Info = function Info(_, ref) {
972
974
  open: state.service.editModal && !((_state$service$cacheI8 = state.service.cacheItem) !== null && _state$service$cacheI8 !== void 0 && _state$service$cacheI8.autoClose),
973
975
  title: isDayBookingMode ? locales.getText('pisell2.text.edit-select-service') : locales.getText('pisell2.text.edit-service'),
974
976
  onClose: function onClose() {
977
+ closeBookingEditModal();
975
978
  dispatch({
976
979
  type: 'setService',
977
980
  payload: {
@@ -33,6 +33,7 @@ var ServiceList = function ServiceList(_ref) {
33
33
  if (state.disabledEdit || state.disableEventBookingEdit) {
34
34
  return;
35
35
  }
36
+ openBookingEditModal();
36
37
  dispatch({
37
38
  type: 'setService',
38
39
  payload: {
@@ -54,6 +55,7 @@ var ServiceList = function ServiceList(_ref) {
54
55
  _list = _list.filter(function (d) {
55
56
  return d._id !== item._id;
56
57
  });
58
+ closeBookingEditModal();
57
59
  dispatch({
58
60
  type: 'setService',
59
61
  payload: {
@@ -242,6 +242,7 @@ export var useService = function useService(_ref) {
242
242
  }
243
243
  }
244
244
  deleteCacheParams();
245
+ closeBookingEditModal();
245
246
  dispatch({
246
247
  type: 'setService',
247
248
  payload: {
@@ -253,7 +254,7 @@ export var useService = function useService(_ref) {
253
254
  changeService: false
254
255
  }
255
256
  });
256
- case 7:
257
+ case 8:
257
258
  case "end":
258
259
  return _context4.stop();
259
260
  }
@@ -265,6 +266,7 @@ export var useService = function useService(_ref) {
265
266
  }();
266
267
  var goEditPanel = function goEditPanel(_ref11) {
267
268
  var booking = _ref11.booking;
269
+ openBookingEditModal();
268
270
  dispatch({
269
271
  type: 'setService',
270
272
  payload: {
@@ -61,6 +61,7 @@ var Lists = function Lists(_ref) {
61
61
  // } else {
62
62
  // product = products?.find((item: any) => item._id === currentItem._id);
63
63
  // }
64
+ openBookingEditModal();
64
65
  onChange({
65
66
  editModal: true,
66
67
  cacheItem: _objectSpread(_objectSpread({}, product), {}, {
@@ -340,6 +340,7 @@ var Info = function Info(props) {
340
340
  }
341
341
  });
342
342
  } else {
343
+ openBookingEditModal();
343
344
  dispatch({
344
345
  type: 'setService',
345
346
  payload: {
@@ -18,7 +18,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  import Delete_wght300_24px from '@pisell/icon/es/Delete_wght300_24px';
19
19
  import { formatAmount, locales } from '@pisell/utils';
20
20
  import { Button, Col, Form, Input, InputNumber, Row } from 'antd';
21
- import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
21
+ import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
22
22
  import CollapsibleList from "../../../components/collapsibleList";
23
23
  import { renderBundles } from "../../../components/collapsibleList/utils";
24
24
  import Drawer from "../../../components/drawer";
@@ -51,6 +51,18 @@ var Info = function Info(_, ref) {
51
51
  dispatch = _useContext.dispatch;
52
52
  var resourcesRef = useRef(null);
53
53
  var isChangeTotal = useRef(false);
54
+ var _useState = useState(false),
55
+ _useState2 = _slicedToArray(_useState, 2),
56
+ open = _useState2[0],
57
+ setOpen = _useState2[1];
58
+ useEffect(function () {
59
+ window.openBookingEditModal = function () {
60
+ setOpen(true);
61
+ };
62
+ window.closeBookingEditModal = function () {
63
+ setOpen(false);
64
+ };
65
+ }, []);
54
66
  var isNormalProduct = useMemo(function () {
55
67
  var _state$service, _state$service2;
56
68
  return (state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.cacheItem) && isNormalProductByDurationSchedule(state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.cacheItem);
@@ -166,6 +178,7 @@ var Info = function Info(_, ref) {
166
178
  _list = _list.filter(function (d) {
167
179
  return d._id !== _id;
168
180
  });
181
+ closeBookingEditModal();
169
182
  dispatch({
170
183
  type: 'setService',
171
184
  payload: {
@@ -275,6 +288,7 @@ var Info = function Info(_, ref) {
275
288
  deleteCacheParams();
276
289
  console.log('_onFinish', _list);
277
290
  form.resetFields();
291
+ closeBookingEditModal();
278
292
  dispatch({
279
293
  type: 'setService',
280
294
  payload: {
@@ -552,6 +566,7 @@ var Info = function Info(_, ref) {
552
566
  return;
553
567
  }
554
568
  form.resetFields();
569
+ closeBookingEditModal();
555
570
  dispatch({
556
571
  type: 'setService',
557
572
  payload: {
@@ -762,9 +777,10 @@ var Info = function Info(_, ref) {
762
777
  zIndex: state.service.changeService ? 999 : 1000,
763
778
  forceRender: true,
764
779
  mask: state.drawerMask,
765
- open: state.service.editModal && !((_state$service$cacheI14 = state.service.cacheItem) !== null && _state$service$cacheI14 !== void 0 && _state$service$cacheI14.autoClose),
780
+ open: open && !((_state$service$cacheI14 = state.service.cacheItem) !== null && _state$service$cacheI14 !== void 0 && _state$service$cacheI14.autoClose),
766
781
  title: locales.getText('pisell2.text.edit-service'),
767
782
  onClose: function onClose() {
783
+ closeBookingEditModal();
768
784
  dispatch({
769
785
  type: 'setService',
770
786
  payload: {
@@ -36,6 +36,7 @@ var ServiceList = function ServiceList(_ref) {
36
36
  }),
37
37
  state: state
38
38
  });
39
+ openBookingEditModal();
39
40
  dispatch({
40
41
  type: 'setService',
41
42
  payload: {
@@ -53,6 +54,7 @@ var ServiceList = function ServiceList(_ref) {
53
54
  _list = _list.filter(function (d) {
54
55
  return d._id !== item._id;
55
56
  });
57
+ closeBookingEditModal();
56
58
  dispatch({
57
59
  type: 'setService',
58
60
  payload: {
@@ -424,6 +424,7 @@ var AddSerivce = function AddSerivce(props) {
424
424
  }
425
425
  });
426
426
  } else {
427
+ openBookingEditModal();
427
428
  dispatch({
428
429
  type: 'setService',
429
430
  payload: {
@@ -65,9 +65,11 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
65
65
  state
66
66
  });
67
67
  }
68
+ openBookingEditModal();
68
69
  onChange({ editModal: true, cacheItem });
69
70
  return onEdit == null ? void 0 : onEdit(cacheItem, type);
70
71
  }
72
+ closeBookingEditModal();
71
73
  const params = {
72
74
  editModal: false,
73
75
  value: products2,
@@ -190,6 +190,7 @@ var Info = (_, ref) => {
190
190
  } else {
191
191
  _list = _list.filter((d) => d._id !== _id);
192
192
  }
193
+ closeBookingEditModal();
193
194
  dispatch({
194
195
  type: "setService",
195
196
  payload: {
@@ -504,6 +505,7 @@ var Info = (_, ref) => {
504
505
  if (state.channelDisabledEdit) {
505
506
  return;
506
507
  }
508
+ openBookingEditModal();
507
509
  dispatch({
508
510
  type: "setService",
509
511
  payload: {
@@ -632,6 +634,7 @@ var Info = (_, ref) => {
632
634
  open: state.service.editModal && !((_a2 = state.service.cacheItem) == null ? void 0 : _a2.autoClose),
633
635
  title: isDayBookingMode ? import_utils.locales.getText("pisell2.text.edit-select-service") : import_utils.locales.getText("pisell2.text.edit-service"),
634
636
  onClose: () => {
637
+ closeBookingEditModal();
635
638
  dispatch({
636
639
  type: "setService",
637
640
  payload: {
@@ -52,6 +52,7 @@ var ServiceList = ({ onEdit }) => {
52
52
  if (state.disabledEdit || state.disableEventBookingEdit) {
53
53
  return;
54
54
  }
55
+ openBookingEditModal();
55
56
  dispatch({
56
57
  type: "setService",
57
58
  payload: {
@@ -67,6 +68,7 @@ var ServiceList = ({ onEdit }) => {
67
68
  }
68
69
  let _list = [...state.service.value];
69
70
  _list = _list.filter((d) => d._id !== item._id);
71
+ closeBookingEditModal();
70
72
  dispatch({
71
73
  type: "setService",
72
74
  payload: {
@@ -178,6 +178,7 @@ var useService = ({
178
178
  }
179
179
  }
180
180
  (0, import_utils2.deleteCacheParams)();
181
+ closeBookingEditModal();
181
182
  dispatch({
182
183
  type: "setService",
183
184
  payload: {
@@ -191,6 +192,7 @@ var useService = ({
191
192
  });
192
193
  };
193
194
  const goEditPanel = ({ booking }) => {
195
+ openBookingEditModal();
194
196
  dispatch({
195
197
  type: "setService",
196
198
  payload: {
@@ -63,6 +63,7 @@ var Lists = ({ onEdit, onChange }) => {
63
63
  let products = (0, import_utils.updateServices)(state, currentItem, type, other);
64
64
  if (type === "view") {
65
65
  let product = currentItem._origin;
66
+ openBookingEditModal();
66
67
  onChange({ editModal: true, cacheItem: { ...product, new: 0 } });
67
68
  return onEdit == null ? void 0 : onEdit({ ...product, new: 0 });
68
69
  }
@@ -274,6 +274,7 @@ var Info = (props) => {
274
274
  }
275
275
  });
276
276
  } else {
277
+ openBookingEditModal();
277
278
  dispatch({
278
279
  type: "setService",
279
280
  payload: {
@@ -63,6 +63,15 @@ var Info = (_, ref) => {
63
63
  const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
64
64
  const resourcesRef = (0, import_react.useRef)(null);
65
65
  const isChangeTotal = (0, import_react.useRef)(false);
66
+ const [open, setOpen] = (0, import_react.useState)(false);
67
+ (0, import_react.useEffect)(() => {
68
+ window.openBookingEditModal = () => {
69
+ setOpen(true);
70
+ };
71
+ window.closeBookingEditModal = () => {
72
+ setOpen(false);
73
+ };
74
+ }, []);
66
75
  const isNormalProduct = (0, import_react.useMemo)(() => {
67
76
  var _a2, _b2;
68
77
  return ((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.cacheItem) && (0, import_utils4.isNormalProductByDurationSchedule)((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem);
@@ -141,6 +150,7 @@ var Info = (_, ref) => {
141
150
  let _list = [...state.service.value];
142
151
  let _id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
143
152
  _list = _list.filter((d) => d._id !== _id);
153
+ closeBookingEditModal();
144
154
  dispatch({
145
155
  type: "setService",
146
156
  payload: {
@@ -216,6 +226,7 @@ var Info = (_, ref) => {
216
226
  (0, import_utils6.deleteCacheParams)();
217
227
  console.log("_onFinish", _list);
218
228
  form.resetFields();
229
+ closeBookingEditModal();
219
230
  dispatch({
220
231
  type: "setService",
221
232
  payload: {
@@ -239,9 +250,9 @@ var Info = (_, ref) => {
239
250
  }
240
251
  );
241
252
  const setEditData = (0, import_ahooks.useMemoizedFn)(
242
- (_cacheItem, open, openProductDetail) => {
253
+ (_cacheItem, open2, openProductDetail) => {
243
254
  console.timeEnd("handleChange");
244
- console.log("setEditDatasetEditData", _cacheItem, open);
255
+ console.log("setEditDatasetEditData", _cacheItem, open2);
245
256
  isChangeTotal.current = false;
246
257
  let cacheItem = _cacheItem || state.service.cacheItem;
247
258
  let values = cacheItem._extend;
@@ -426,6 +437,7 @@ var Info = (_, ref) => {
426
437
  return;
427
438
  }
428
439
  form.resetFields();
440
+ closeBookingEditModal();
429
441
  dispatch({
430
442
  type: "setService",
431
443
  payload: {
@@ -636,9 +648,10 @@ var Info = (_, ref) => {
636
648
  zIndex: state.service.changeService ? 999 : 1e3,
637
649
  forceRender: true,
638
650
  mask: state.drawerMask,
639
- open: state.service.editModal && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
651
+ open: open && !((_I = state.service.cacheItem) == null ? void 0 : _I.autoClose),
640
652
  title: import_utils.locales.getText("pisell2.text.edit-service"),
641
653
  onClose: () => {
654
+ closeBookingEditModal();
642
655
  dispatch({
643
656
  type: "setService",
644
657
  payload: {
@@ -48,6 +48,7 @@ var ServiceList = ({ onEdit }) => {
48
48
  cacheItem: { ...item, new: 0 },
49
49
  state
50
50
  });
51
+ openBookingEditModal();
51
52
  dispatch({
52
53
  type: "setService",
53
54
  payload: {
@@ -63,6 +64,7 @@ var ServiceList = ({ onEdit }) => {
63
64
  }
64
65
  let _list = [...state.service.value];
65
66
  _list = _list.filter((d) => d._id !== item._id);
67
+ closeBookingEditModal();
66
68
  dispatch({
67
69
  type: "setService",
68
70
  payload: {
@@ -347,6 +347,7 @@ var AddSerivce = (props) => {
347
347
  }
348
348
  });
349
349
  } else {
350
+ openBookingEditModal();
350
351
  dispatch({
351
352
  type: "setService",
352
353
  payload: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.1.2",
3
+ "version": "6.1.3",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -60,9 +60,9 @@
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
62
  "@pisell/utils": "3.0.0",
63
- "@pisell/date-picker": "3.0.2",
63
+ "@pisell/materials": "6.1.1",
64
64
  "@pisell/icon": "0.0.11",
65
- "@pisell/materials": "6.1.1"
65
+ "@pisell/date-picker": "3.0.2"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",