@pisell/private-materials 3.4.82 → 3.4.83

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 (162) 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/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +152 -152
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +18 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +18 -10
  11. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  12. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  13. package/es/components/booking/notes/NoteBlock/index.js +3 -2
  14. package/es/components/booking/utils.d.ts +2 -2
  15. package/es/components/eftpos/hooks.d.ts +0 -1
  16. package/es/components/eftposPay/amount.d.ts +1 -1
  17. package/es/components/eftposPay/app.d.ts +1 -1
  18. package/es/components/eftposPay/device.d.ts +1 -1
  19. package/es/components/eftposPay/hooks.d.ts +2 -2
  20. package/es/components/eftposPay/store/index.d.ts +6 -6
  21. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  22. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  23. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  24. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  25. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  26. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  27. package/es/hooks/usePaymentLogger.d.ts +0 -1
  28. package/es/index.d.ts +4 -2
  29. package/es/index.js +3 -1
  30. package/es/plus/contactInfo/components/SwipeAction/index.js +1 -1
  31. package/es/plus/orderList/components/HandleActions.d.ts +1 -0
  32. package/es/plus/orderList/components/HandleActions.js +5 -2
  33. package/es/plus/orderList/components/Toolbar.d.ts +1 -0
  34. package/es/plus/orderList/components/Toolbar.js +4 -2
  35. package/es/plus/orderList/index.d.ts +1 -0
  36. package/es/plus/orderList/index.js +7 -2
  37. package/es/plus/pisellSalesGrid/PisellSalesGrid.d.ts +5 -0
  38. package/es/plus/pisellSalesGrid/PisellSalesGrid.js +363 -0
  39. package/es/plus/pisellSalesGrid/PisellSalesGrid.less +16 -0
  40. package/es/plus/pisellSalesGrid/PisellSalesGrid.stories.d.ts +14 -0
  41. package/es/plus/pisellSalesGrid/PisellSalesGrid.stories.js +559 -0
  42. package/es/plus/pisellSalesGrid/hooks/useActions.d.ts +19 -0
  43. package/es/plus/pisellSalesGrid/hooks/useActions.js +723 -0
  44. package/es/plus/pisellSalesGrid/index.d.ts +4 -0
  45. package/es/plus/pisellSalesGrid/index.js +3 -0
  46. package/es/plus/pisellSalesGrid/locales.d.ts +9 -0
  47. package/es/plus/pisellSalesGrid/locales.js +8 -0
  48. package/es/plus/pisellSalesGrid/serve.d.ts +19 -0
  49. package/es/plus/pisellSalesGrid/serve.js +151 -0
  50. package/es/plus/pisellSalesGrid/types.d.ts +170 -0
  51. package/es/plus/pisellSalesGrid/types.js +1 -0
  52. package/es/plus/pisellSalesManagement/components/BookingFormsPreview.d.ts +15 -0
  53. package/es/plus/pisellSalesManagement/components/BookingFormsPreview.js +211 -0
  54. package/es/plus/pisellSalesManagement/components/BookingNotesPreview.d.ts +19 -0
  55. package/es/plus/pisellSalesManagement/components/BookingNotesPreview.js +167 -0
  56. package/es/plus/pisellSalesManagement/components/ResourceSelector.d.ts +9 -0
  57. package/es/plus/pisellSalesManagement/components/ResourceSelector.js +102 -0
  58. package/es/plus/pisellSalesManagement/config/booking.d.ts +185 -0
  59. package/es/plus/pisellSalesManagement/config/booking.js +380 -0
  60. package/es/plus/pisellSalesManagement/config/index.d.ts +2 -0
  61. package/es/plus/pisellSalesManagement/config/index.js +11 -0
  62. package/es/plus/pisellSalesManagement/config/order.d.ts +172 -0
  63. package/es/plus/pisellSalesManagement/config/order.js +460 -0
  64. package/es/plus/pisellSalesManagement/hooks/perspectiveUtils.d.ts +15 -0
  65. package/es/plus/pisellSalesManagement/hooks/perspectiveUtils.js +66 -0
  66. package/es/plus/pisellSalesManagement/hooks/useBookingPerspective.d.ts +2 -0
  67. package/es/plus/pisellSalesManagement/hooks/useBookingPerspective.js +651 -0
  68. package/es/plus/pisellSalesManagement/hooks/useOrderPerspective.d.ts +2 -0
  69. package/es/plus/pisellSalesManagement/hooks/useOrderPerspective.js +656 -0
  70. package/es/plus/pisellSalesManagement/hooks/usePerspectives.d.ts +5 -0
  71. package/es/plus/pisellSalesManagement/hooks/usePerspectives.js +12 -0
  72. package/es/plus/pisellSalesManagement/index.d.ts +10 -0
  73. package/es/plus/pisellSalesManagement/index.js +84 -0
  74. package/es/plus/pisellSalesManagement/locales.d.ts +303 -0
  75. package/es/plus/pisellSalesManagement/locales.js +302 -0
  76. package/es/plus/pisellSalesManagement/serve.d.ts +26 -0
  77. package/es/plus/pisellSalesManagement/serve.js +222 -0
  78. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  79. package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  80. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
  81. package/es/plus/walletPassGallery/components/passDetail/index.js +2 -26
  82. package/es/plus/walletPassGallery/components/passList/index.js +8 -1
  83. package/es/plus/walletPassGallery/index.js +0 -31
  84. package/es/pro/Selector/Selector.d.ts +1 -1
  85. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  86. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  87. package/lib/components/booking/notes/NoteBlock/index.js +2 -1
  88. package/lib/components/booking/utils.d.ts +2 -2
  89. package/lib/components/eftpos/hooks.d.ts +0 -1
  90. package/lib/components/eftposPay/amount.d.ts +1 -1
  91. package/lib/components/eftposPay/app.d.ts +1 -1
  92. package/lib/components/eftposPay/device.d.ts +1 -1
  93. package/lib/components/eftposPay/hooks.d.ts +2 -2
  94. package/lib/components/eftposPay/store/index.d.ts +6 -6
  95. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  96. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  97. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  98. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  99. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  100. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  101. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  102. package/lib/index.d.ts +4 -2
  103. package/lib/index.js +8 -2
  104. package/lib/plus/contactInfo/components/SwipeAction/index.js +23 -23
  105. package/lib/plus/orderList/components/HandleActions.d.ts +1 -0
  106. package/lib/plus/orderList/components/HandleActions.js +2 -2
  107. package/lib/plus/orderList/components/Toolbar.d.ts +1 -0
  108. package/lib/plus/orderList/components/Toolbar.js +2 -2
  109. package/lib/plus/orderList/index.d.ts +1 -0
  110. package/lib/plus/orderList/index.js +3 -3
  111. package/lib/plus/pisellSalesGrid/PisellSalesGrid.d.ts +5 -0
  112. package/lib/plus/pisellSalesGrid/PisellSalesGrid.js +339 -0
  113. package/lib/plus/pisellSalesGrid/PisellSalesGrid.less +16 -0
  114. package/lib/plus/pisellSalesGrid/PisellSalesGrid.stories.d.ts +14 -0
  115. package/lib/plus/pisellSalesGrid/PisellSalesGrid.stories.js +455 -0
  116. package/lib/plus/pisellSalesGrid/hooks/useActions.d.ts +19 -0
  117. package/lib/plus/pisellSalesGrid/hooks/useActions.js +545 -0
  118. package/lib/plus/pisellSalesGrid/index.d.ts +4 -0
  119. package/lib/plus/pisellSalesGrid/index.js +42 -0
  120. package/lib/plus/pisellSalesGrid/locales.d.ts +9 -0
  121. package/lib/plus/pisellSalesGrid/locales.js +29 -0
  122. package/lib/plus/pisellSalesGrid/serve.d.ts +19 -0
  123. package/lib/plus/pisellSalesGrid/serve.js +142 -0
  124. package/lib/plus/pisellSalesGrid/types.d.ts +170 -0
  125. package/lib/plus/pisellSalesGrid/types.js +17 -0
  126. package/lib/plus/pisellSalesManagement/components/BookingFormsPreview.d.ts +15 -0
  127. package/lib/plus/pisellSalesManagement/components/BookingFormsPreview.js +250 -0
  128. package/lib/plus/pisellSalesManagement/components/BookingNotesPreview.d.ts +19 -0
  129. package/lib/plus/pisellSalesManagement/components/BookingNotesPreview.js +193 -0
  130. package/lib/plus/pisellSalesManagement/components/ResourceSelector.d.ts +9 -0
  131. package/lib/plus/pisellSalesManagement/components/ResourceSelector.js +106 -0
  132. package/lib/plus/pisellSalesManagement/config/booking.d.ts +185 -0
  133. package/lib/plus/pisellSalesManagement/config/booking.js +500 -0
  134. package/lib/plus/pisellSalesManagement/config/index.d.ts +2 -0
  135. package/lib/plus/pisellSalesManagement/config/index.js +43 -0
  136. package/lib/plus/pisellSalesManagement/config/order.d.ts +172 -0
  137. package/lib/plus/pisellSalesManagement/config/order.js +492 -0
  138. package/lib/plus/pisellSalesManagement/hooks/perspectiveUtils.d.ts +15 -0
  139. package/lib/plus/pisellSalesManagement/hooks/perspectiveUtils.js +113 -0
  140. package/lib/plus/pisellSalesManagement/hooks/useBookingPerspective.d.ts +2 -0
  141. package/lib/plus/pisellSalesManagement/hooks/useBookingPerspective.js +699 -0
  142. package/lib/plus/pisellSalesManagement/hooks/useOrderPerspective.d.ts +2 -0
  143. package/lib/plus/pisellSalesManagement/hooks/useOrderPerspective.js +700 -0
  144. package/lib/plus/pisellSalesManagement/hooks/usePerspectives.d.ts +5 -0
  145. package/lib/plus/pisellSalesManagement/hooks/usePerspectives.js +42 -0
  146. package/lib/plus/pisellSalesManagement/index.d.ts +10 -0
  147. package/lib/plus/pisellSalesManagement/index.js +113 -0
  148. package/lib/plus/pisellSalesManagement/locales.d.ts +303 -0
  149. package/lib/plus/pisellSalesManagement/locales.js +326 -0
  150. package/lib/plus/pisellSalesManagement/serve.d.ts +26 -0
  151. package/lib/plus/pisellSalesManagement/serve.js +120 -0
  152. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  153. package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  154. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
  155. package/lib/plus/walletPassGallery/components/passDetail/index.js +1 -16
  156. package/lib/plus/walletPassGallery/components/passList/index.js +9 -3
  157. package/lib/plus/walletPassGallery/index.js +0 -29
  158. package/lib/pro/Selector/Selector.d.ts +1 -1
  159. package/lowcode/eco-cup-list/meta.ts +1 -1
  160. package/lowcode/eco-customer-list/meta.ts +1 -1
  161. package/lowcode/pisell-sales-management/meta.ts +88 -0
  162. package/package.json +4 -4
@@ -0,0 +1,167 @@
1
+ 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; }
2
+ 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; }
3
+ 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; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
+ 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); }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ 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."); }
8
+ 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); }
9
+ 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; }
10
+ 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; } }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+ 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); }
13
+ import React, { useMemo, useState } from 'react';
14
+ import { PisellModal, Icon } from '@pisell/materials';
15
+ import { locales } from '@pisell/utils';
16
+ import NoteBlock from "../../../components/booking/notes/NoteBlock";
17
+ import { textStyles } from "../hooks/perspectiveUtils";
18
+ var normalizeInternalNotes = function normalizeInternalNotes(value) {
19
+ if (!value) return [];
20
+ if (Array.isArray(value)) {
21
+ return value.map(function (item, index) {
22
+ if (typeof item === 'string' || typeof item === 'number') {
23
+ return {
24
+ id: index,
25
+ content: String(item)
26
+ };
27
+ }
28
+ if (item && _typeof(item) === 'object') {
29
+ return item;
30
+ }
31
+ return {
32
+ id: index,
33
+ content: String(item)
34
+ };
35
+ }).filter(function (item) {
36
+ return (item === null || item === void 0 ? void 0 : item.content) != null && (item === null || item === void 0 ? void 0 : item.content) !== '';
37
+ });
38
+ }
39
+ if (typeof value === 'string' || typeof value === 'number') {
40
+ return [{
41
+ id: 0,
42
+ content: String(value)
43
+ }];
44
+ }
45
+ return [];
46
+ };
47
+ var BookingNotesPreview = function BookingNotesPreview(props) {
48
+ var dataSource = props.dataSource,
49
+ labels = props.labels,
50
+ style = props.style;
51
+ var orderNote = typeof (dataSource === null || dataSource === void 0 ? void 0 : dataSource.note) === 'string' ? dataSource.note.trim() : '';
52
+ var internalNotes = useMemo(function () {
53
+ return normalizeInternalNotes(dataSource === null || dataSource === void 0 ? void 0 : dataSource.internalNotes);
54
+ }, [dataSource === null || dataSource === void 0 ? void 0 : dataSource.internalNotes]);
55
+ var displayLines = useMemo(function () {
56
+ var lines = [];
57
+ if (orderNote) {
58
+ lines.push({
59
+ label: (labels === null || labels === void 0 ? void 0 : labels.orderNote) || locales.getText('pisell2.salesManagement.booking.notes.orderNotes'),
60
+ content: orderNote
61
+ });
62
+ }
63
+ internalNotes.forEach(function (item) {
64
+ var content = typeof (item === null || item === void 0 ? void 0 : item.content) === 'string' ? item.content.trim() : '';
65
+ if (!content) return;
66
+ lines.push({
67
+ label: (labels === null || labels === void 0 ? void 0 : labels.internalNote) || locales.getText('pisell2.salesManagement.booking.notes.internalNotes'),
68
+ content: content
69
+ });
70
+ });
71
+ return lines;
72
+ }, [orderNote, internalNotes, labels === null || labels === void 0 ? void 0 : labels.orderNote, labels === null || labels === void 0 ? void 0 : labels.internalNote]);
73
+ var visibleLines = displayLines.slice(0, 2);
74
+ var showMore = displayLines.length > 0;
75
+ var _useState = useState(false),
76
+ _useState2 = _slicedToArray(_useState, 2),
77
+ modalOpen = _useState2[0],
78
+ setModalOpen = _useState2[1];
79
+ if (!displayLines.length) {
80
+ return null;
81
+ }
82
+ var openNotesModal = function openNotesModal(event) {
83
+ event.stopPropagation();
84
+ setModalOpen(true);
85
+ };
86
+ var orderNotes = orderNote ? [{
87
+ id: 0,
88
+ content: orderNote
89
+ }] : [];
90
+ var isEditable = Boolean(dataSource === null || dataSource === void 0 ? void 0 : dataSource.apis);
91
+ return /*#__PURE__*/React.createElement("div", {
92
+ style: style,
93
+ onClick: function onClick(e) {
94
+ return e.stopPropagation();
95
+ }
96
+ }, /*#__PURE__*/React.createElement("div", {
97
+ style: {
98
+ display: 'flex',
99
+ flexDirection: 'column',
100
+ cursor: 'pointer'
101
+ },
102
+ onClick: openNotesModal
103
+ }, visibleLines.map(function (line, index) {
104
+ return /*#__PURE__*/React.createElement("div", {
105
+ key: "".concat(line.label, "-").concat(index),
106
+ style: _objectSpread(_objectSpread({}, textStyles.text), {}, {
107
+ fontSize: 14,
108
+ whiteSpace: 'nowrap',
109
+ overflow: 'hidden',
110
+ textOverflow: 'ellipsis'
111
+ })
112
+ }, /*#__PURE__*/React.createElement("span", null, line.label, ":"), ' ', /*#__PURE__*/React.createElement("span", {
113
+ style: {
114
+ color: '#eaa96f'
115
+ }
116
+ }, line.content));
117
+ }), showMore ? /*#__PURE__*/React.createElement("div", {
118
+ style: {
119
+ color: '#7f56d9',
120
+ display: 'flex',
121
+ alignItems: 'center'
122
+ }
123
+ }, (labels === null || labels === void 0 ? void 0 : labels.more) || locales.getText('pisell2.salesManagement.booking.view-more'), /*#__PURE__*/React.createElement(Icon, {
124
+ size: 20,
125
+ type: "pisell2-chevron-right-double"
126
+ })) : null), /*#__PURE__*/React.createElement(PisellModal, {
127
+ open: modalOpen,
128
+ title: locales.getText('pisell2.salesManagement.booking.notes.title'),
129
+ width: 600,
130
+ footer: null,
131
+ onCancel: function onCancel() {
132
+ return setModalOpen(false);
133
+ },
134
+ destroyOnClose: true,
135
+ bodyStyle: {
136
+ overflowX: 'hidden'
137
+ }
138
+ }, /*#__PURE__*/React.createElement("div", {
139
+ style: {
140
+ display: 'flex',
141
+ flexDirection: 'column',
142
+ gap: 16
143
+ }
144
+ }, /*#__PURE__*/React.createElement(NoteBlock, {
145
+ noteType: "order",
146
+ maxLength: 1,
147
+ title: "".concat(locales.getText('pisell2.salesManagement.booking.notes.orderNotes'), ":"),
148
+ describe: "",
149
+ notes: orderNotes,
150
+ apis: dataSource === null || dataSource === void 0 ? void 0 : dataSource.apis,
151
+ placeholder: locales.getText('pisell2.salesManagement.booking.notes.addOrderNotes'),
152
+ isEdit: isEditable,
153
+ onChange: dataSource === null || dataSource === void 0 ? void 0 : dataSource.onChange
154
+ }), (internalNotes.length > 0 || isEditable) && /*#__PURE__*/React.createElement(NoteBlock, {
155
+ maxLength: 99,
156
+ noteType: "internal",
157
+ title: "".concat(locales.getText('pisell2.salesManagement.booking.notes.internalNotes'), ":"),
158
+ describe: locales.getText('pisell2.salesManagement.booking.notes.internalVisibleOnlyTip'),
159
+ placeholder: locales.getText('pisell2.salesManagement.booking.notes.addInternalNotes'),
160
+ notes: internalNotes,
161
+ isEdit: isEditable,
162
+ apis: dataSource === null || dataSource === void 0 ? void 0 : dataSource.apis,
163
+ bookingId: dataSource === null || dataSource === void 0 ? void 0 : dataSource.bookingId,
164
+ onChange: dataSource === null || dataSource === void 0 ? void 0 : dataSource.onChange
165
+ }))));
166
+ };
167
+ export default BookingNotesPreview;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ declare type ResourceSelectorProps = {
3
+ value?: Array<string | number> | string | number;
4
+ onChange?: (value: Array<string | number>) => void;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ };
8
+ declare const ResourceSelector: (props: ResourceSelectorProps) => React.JSX.Element;
9
+ export default ResourceSelector;
@@ -0,0 +1,102 @@
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
+ import React, { useMemo } from 'react';
8
+ import { Empty, Spin, TreeSelect } from 'antd';
9
+ import { useRequest } from 'ahooks';
10
+ import { locales } from '@pisell/utils';
11
+ import { getResourceTypes } from "../serve";
12
+ var formatResourceNode = function formatResourceNode(item) {
13
+ var _ref, _ref2, _ref3, _ref4, _ref5, _item$id, _ref6, _item$name, _item$resources;
14
+ var key = (_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_item$id = item.id) !== null && _item$id !== void 0 ? _item$id : item.value) !== null && _ref5 !== void 0 ? _ref5 : item.code) !== null && _ref4 !== void 0 ? _ref4 : item.name) !== null && _ref3 !== void 0 ? _ref3 : item.title) !== null && _ref2 !== void 0 ? _ref2 : item.label) !== null && _ref !== void 0 ? _ref : '';
15
+ return {
16
+ key: key,
17
+ value: key,
18
+ title: (_ref6 = (_item$name = item.name) !== null && _item$name !== void 0 ? _item$name : item.title) !== null && _ref6 !== void 0 ? _ref6 : item.label,
19
+ children: formatResourceNodes((_item$resources = item.resources) !== null && _item$resources !== void 0 ? _item$resources : item.children)
20
+ };
21
+ };
22
+ var formatResourceNodes = function formatResourceNodes(items) {
23
+ if (!items) return [];
24
+ return items.map(formatResourceNode);
25
+ };
26
+ var buildTreeData = function buildTreeData(list) {
27
+ console.log('xxxxxx', list);
28
+ var formatted = (list || []).map(function (item) {
29
+ var _item$resources2;
30
+ return _objectSpread(_objectSpread({}, item), {}, {
31
+ resources: (_item$resources2 = item.resources) !== null && _item$resources2 !== void 0 ? _item$resources2 : item.children
32
+ });
33
+ });
34
+ formatted.unshift({
35
+ id: 0,
36
+ name: locales.getText('pisell2.salesManagement.booking.filter.resource.none'),
37
+ resources: []
38
+ });
39
+ return formatResourceNodes(formatted);
40
+ };
41
+ var normalizeValue = function normalizeValue(value) {
42
+ if (Array.isArray(value)) return value;
43
+ if (value === undefined || value === null) return [];
44
+ return [value];
45
+ };
46
+ var extractLeafKeys = function extractLeafKeys(nodes) {
47
+ if (!(nodes !== null && nodes !== void 0 && nodes.length)) return [];
48
+ return nodes.filter(function (node) {
49
+ return !(node !== null && node !== void 0 && node.children) || node.children.length === 0;
50
+ }).map(function (node) {
51
+ var _node$key;
52
+ return (_node$key = node.key) !== null && _node$key !== void 0 ? _node$key : node.value;
53
+ }).filter(function (key) {
54
+ return key !== undefined && key !== null;
55
+ });
56
+ };
57
+ var ResourceSelector = function ResourceSelector(props) {
58
+ var value = props.value,
59
+ _onChange = props.onChange,
60
+ className = props.className,
61
+ style = props.style;
62
+ var _useRequest = useRequest(getResourceTypes),
63
+ data = _useRequest.data,
64
+ loading = _useRequest.loading;
65
+ var treeData = useMemo(function () {
66
+ return buildTreeData(data || []);
67
+ }, [data]);
68
+ var checkedKeys = useMemo(function () {
69
+ return normalizeValue(value);
70
+ }, [value]);
71
+ return /*#__PURE__*/React.createElement("div", {
72
+ className: className,
73
+ style: style
74
+ }, loading ? /*#__PURE__*/React.createElement(Spin, {
75
+ size: "small"
76
+ }) : treeData.length ? /*#__PURE__*/React.createElement(TreeSelect, {
77
+ maxTagCount: 'responsive',
78
+ value: checkedKeys,
79
+ treeData: treeData,
80
+ treeCheckable: true,
81
+ showCheckedStrategy: TreeSelect.SHOW_CHILD,
82
+ treeNodeFilterProp: "title",
83
+ allowClear: true,
84
+ multiple: true,
85
+ style: {
86
+ width: '100%'
87
+ },
88
+ dropdownStyle: {
89
+ maxHeight: 320,
90
+ overflow: 'auto'
91
+ },
92
+ onChange: function onChange(nextValue, _label, extra) {
93
+ var leafKeys = extractLeafKeys(extra === null || extra === void 0 ? void 0 : extra.allCheckedNodes);
94
+ var normalizedKeys = Array.isArray(nextValue) ? nextValue : nextValue != null ? [nextValue] : [];
95
+ _onChange === null || _onChange === void 0 || _onChange(leafKeys.length ? leafKeys : normalizedKeys);
96
+ },
97
+ placeholder: locales.getText('pisell2.salesManagement.booking.filter.resource.placeholder')
98
+ }) : /*#__PURE__*/React.createElement(Empty, {
99
+ image: Empty.PRESENTED_IMAGE_SIMPLE
100
+ }));
101
+ };
102
+ export default ResourceSelector;
@@ -0,0 +1,185 @@
1
+ export declare const getBookingStatusMap: () => Record<string, string>;
2
+ export declare const BOOKING_STATUS_COLOR_MAP: Record<string, string>;
3
+ export declare const getBookingPlatformMap: () => Record<string, string>;
4
+ export declare const getBookingHeaderLabels: () => Record<string, string>;
5
+ export declare const defaultPaymentStatusKeys: string[];
6
+ export declare const getFilterButtonList: () => ({
7
+ name: string;
8
+ type: string;
9
+ key: string;
10
+ label: any;
11
+ other: {
12
+ allowClear: boolean;
13
+ mode: string;
14
+ maxTagCount: string;
15
+ placeholder: any;
16
+ options: {
17
+ label: string;
18
+ value: string;
19
+ }[];
20
+ minInputNumberProps?: undefined;
21
+ maxInputNumberProps?: undefined;
22
+ component?: undefined;
23
+ isSearchServer?: undefined;
24
+ showSearch?: undefined;
25
+ showTime?: undefined;
26
+ };
27
+ sort?: undefined;
28
+ localFilter?: undefined;
29
+ } | {
30
+ name: string;
31
+ type: string;
32
+ key: string;
33
+ label: any;
34
+ other: {
35
+ placeholder: any;
36
+ minInputNumberProps: {
37
+ min: number;
38
+ precision: number;
39
+ };
40
+ maxInputNumberProps: {
41
+ min: number;
42
+ precision: number;
43
+ };
44
+ allowClear?: undefined;
45
+ mode?: undefined;
46
+ maxTagCount?: undefined;
47
+ options?: undefined;
48
+ component?: undefined;
49
+ isSearchServer?: undefined;
50
+ showSearch?: undefined;
51
+ showTime?: undefined;
52
+ };
53
+ sort?: undefined;
54
+ localFilter?: undefined;
55
+ } | {
56
+ name: string;
57
+ type: string;
58
+ key: string;
59
+ label: any;
60
+ sort: boolean;
61
+ localFilter: boolean;
62
+ other: {
63
+ allowClear: boolean;
64
+ mode: string;
65
+ maxTagCount: string;
66
+ component: (props: {
67
+ value?: string | number | (string | number)[] | undefined;
68
+ onChange?: ((value: (string | number)[]) => void) | undefined;
69
+ className?: string | undefined;
70
+ style?: import("react").CSSProperties | undefined;
71
+ }) => import("react").JSX.Element;
72
+ placeholder?: undefined;
73
+ options?: undefined;
74
+ minInputNumberProps?: undefined;
75
+ maxInputNumberProps?: undefined;
76
+ isSearchServer?: undefined;
77
+ showSearch?: undefined;
78
+ showTime?: undefined;
79
+ };
80
+ } | {
81
+ name: string;
82
+ type: string;
83
+ key: string;
84
+ label: any;
85
+ other: {
86
+ allowClear: boolean;
87
+ mode: string;
88
+ maxTagCount: string;
89
+ placeholder: any;
90
+ options: () => Promise<any>;
91
+ minInputNumberProps?: undefined;
92
+ maxInputNumberProps?: undefined;
93
+ component?: undefined;
94
+ isSearchServer?: undefined;
95
+ showSearch?: undefined;
96
+ showTime?: undefined;
97
+ };
98
+ sort?: undefined;
99
+ localFilter?: undefined;
100
+ } | {
101
+ name: string;
102
+ type: string;
103
+ key: string;
104
+ label: any;
105
+ other: {
106
+ placeholder: any;
107
+ allowClear?: undefined;
108
+ mode?: undefined;
109
+ maxTagCount?: undefined;
110
+ options?: undefined;
111
+ minInputNumberProps?: undefined;
112
+ maxInputNumberProps?: undefined;
113
+ component?: undefined;
114
+ isSearchServer?: undefined;
115
+ showSearch?: undefined;
116
+ showTime?: undefined;
117
+ };
118
+ sort?: undefined;
119
+ localFilter?: undefined;
120
+ } | {
121
+ name: string;
122
+ type: string;
123
+ key: string;
124
+ label: any;
125
+ other: {
126
+ allowClear: boolean;
127
+ isSearchServer: boolean;
128
+ showSearch: boolean;
129
+ placeholder: any;
130
+ options: (params?: string) => Promise<any>;
131
+ mode?: undefined;
132
+ maxTagCount?: undefined;
133
+ minInputNumberProps?: undefined;
134
+ maxInputNumberProps?: undefined;
135
+ component?: undefined;
136
+ showTime?: undefined;
137
+ };
138
+ sort?: undefined;
139
+ localFilter?: undefined;
140
+ } | {
141
+ name: string;
142
+ type: string;
143
+ key: string;
144
+ label: any;
145
+ other: {
146
+ placeholder: any;
147
+ showTime: boolean;
148
+ allowClear?: undefined;
149
+ mode?: undefined;
150
+ maxTagCount?: undefined;
151
+ options?: undefined;
152
+ minInputNumberProps?: undefined;
153
+ maxInputNumberProps?: undefined;
154
+ component?: undefined;
155
+ isSearchServer?: undefined;
156
+ showSearch?: undefined;
157
+ };
158
+ sort?: undefined;
159
+ localFilter?: undefined;
160
+ })[];
161
+ export declare const getSortList: () => ({
162
+ type: string;
163
+ isCustom: boolean;
164
+ name: string;
165
+ label: any;
166
+ getSortItems: () => {
167
+ key: string;
168
+ label: any;
169
+ }[];
170
+ other?: undefined;
171
+ } | {
172
+ type: string;
173
+ isCustom: boolean;
174
+ name: string;
175
+ label: any;
176
+ getSortItems: () => {
177
+ key: string;
178
+ label: any;
179
+ }[];
180
+ other: {
181
+ style: {
182
+ width: string;
183
+ };
184
+ };
185
+ })[];