@pisell/private-materials 3.0.197 → 3.0.199

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 (198) 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 +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/components/customSelect/index.d.ts +0 -1
  12. package/es/components/booking/components/customSelect/index.js +2 -6
  13. package/es/components/booking/components/footer/amount.js +22 -45
  14. package/es/components/booking/components/footer/index.js +40 -84
  15. package/es/components/booking/components/footer/utils.js +32 -218
  16. package/es/components/booking/info/addServiceVariant/index.js +1 -8
  17. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
  18. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +13 -14
  19. package/es/components/booking/info/clientVariant/vertical/index.js +4 -33
  20. package/es/components/booking/info/main.js +8 -20
  21. package/es/components/booking/info/model.js +0 -3
  22. package/es/components/booking/info/pet/index.js +5 -54
  23. package/es/components/booking/info/service/addService/index.js +20 -127
  24. package/es/components/booking/info/service/addService/index.less +3 -13
  25. package/es/components/booking/info/service/addService/utils.d.ts +2 -11
  26. package/es/components/booking/info/service/addService/utils.js +24 -49
  27. package/es/components/booking/info/service/editService/index.js +41 -232
  28. package/es/components/booking/info/service/editService/index.less +13 -18
  29. package/es/components/booking/info/utils.d.ts +0 -9
  30. package/es/components/booking/info/utils.js +0 -13
  31. package/es/components/booking/locales.d.ts +0 -60
  32. package/es/components/booking/locales.js +3 -75
  33. package/es/components/booking/model.d.ts +1 -4
  34. package/es/components/booking/model.js +2 -4
  35. package/es/components/booking/utils.d.ts +3 -12
  36. package/es/components/booking/utils.js +22 -126
  37. package/es/components/eftpos/form/index.js +12 -6
  38. package/es/components/eftpos/group/index.d.ts +1 -2
  39. package/es/components/eftpos/group/index.js +1 -2
  40. package/es/components/eftpos/index.js +2 -2
  41. package/es/components/eftpos/receipt/index.d.ts +24 -0
  42. package/es/components/eftpos/receipt/index.js +96 -0
  43. package/es/components/eftposPay/helper.d.ts +1 -0
  44. package/es/components/eftposPay/helper.js +14 -0
  45. package/es/components/eftposPay/hooks.d.ts +1 -1
  46. package/es/components/eftposPay/tyro/index.js +51 -20
  47. package/es/index.d.ts +0 -1
  48. package/es/index.js +1 -2
  49. package/lib/components/booking/components/customSelect/index.d.ts +0 -1
  50. package/lib/components/booking/components/customSelect/index.js +2 -6
  51. package/lib/components/booking/components/footer/amount.js +8 -26
  52. package/lib/components/booking/components/footer/index.js +4 -25
  53. package/lib/components/booking/components/footer/utils.js +31 -144
  54. package/lib/components/booking/info/addServiceVariant/index.js +0 -5
  55. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
  56. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +7 -8
  57. package/lib/components/booking/info/clientVariant/vertical/index.js +10 -36
  58. package/lib/components/booking/info/main.js +4 -11
  59. package/lib/components/booking/info/model.js +0 -3
  60. package/lib/components/booking/info/pet/index.js +25 -61
  61. package/lib/components/booking/info/service/addService/index.js +28 -95
  62. package/lib/components/booking/info/service/addService/index.less +3 -13
  63. package/lib/components/booking/info/service/addService/utils.d.ts +2 -11
  64. package/lib/components/booking/info/service/addService/utils.js +10 -31
  65. package/lib/components/booking/info/service/editService/index.js +122 -271
  66. package/lib/components/booking/info/service/editService/index.less +13 -18
  67. package/lib/components/booking/info/utils.d.ts +0 -9
  68. package/lib/components/booking/info/utils.js +0 -6
  69. package/lib/components/booking/locales.d.ts +0 -60
  70. package/lib/components/booking/locales.js +3 -63
  71. package/lib/components/booking/model.d.ts +1 -4
  72. package/lib/components/booking/model.js +2 -4
  73. package/lib/components/booking/utils.d.ts +3 -12
  74. package/lib/components/booking/utils.js +15 -79
  75. package/lib/components/eftpos/form/index.js +12 -6
  76. package/lib/components/eftpos/group/index.d.ts +1 -2
  77. package/lib/components/eftpos/group/index.js +0 -1
  78. package/lib/components/eftpos/index.js +2 -2
  79. package/lib/components/eftpos/receipt/index.d.ts +24 -0
  80. package/lib/components/eftpos/receipt/index.js +88 -0
  81. package/lib/components/eftposPay/helper.d.ts +1 -0
  82. package/lib/components/eftposPay/helper.js +21 -0
  83. package/lib/components/eftposPay/hooks.d.ts +1 -1
  84. package/lib/components/eftposPay/tyro/index.js +36 -7
  85. package/lib/index.d.ts +0 -1
  86. package/lib/index.js +0 -3
  87. package/package.json +3 -3
  88. package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
  89. package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -37
  90. package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  91. package/es/components/booking/info/dateRange/index.d.ts +0 -5
  92. package/es/components/booking/info/dateRange/index.js +0 -98
  93. package/es/components/booking/info/dateRange/index.less +0 -21
  94. package/es/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
  95. package/es/components/booking/info/pet/ChangePetModal/index.js +0 -118
  96. package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
  97. package/es/components/booking/info/service2/Lists.d.ts +0 -3
  98. package/es/components/booking/info/service2/Lists.js +0 -158
  99. package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
  100. package/es/components/booking/info/service2/hooks/useSelectPet.js +0 -54
  101. package/es/components/booking/info/service2/index.d.ts +0 -3
  102. package/es/components/booking/info/service2/index.js +0 -58
  103. package/es/components/booking/info/service2/status.d.ts +0 -31
  104. package/es/components/booking/info/service2/status.js +0 -78
  105. package/es/components/booking/info/service2/utils.d.ts +0 -145
  106. package/es/components/booking/info/service2/utils.js +0 -436
  107. package/es/components/booking/materiels/holder/index.d.ts +0 -7
  108. package/es/components/booking/materiels/holder/index.js +0 -51
  109. package/es/components/shoppingCart/Provider.d.ts +0 -3
  110. package/es/components/shoppingCart/Provider.js +0 -86
  111. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -4
  112. package/es/components/shoppingCart/components/Cart/Product.js +0 -96
  113. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -4
  114. package/es/components/shoppingCart/components/Cart/index.js +0 -72
  115. package/es/components/shoppingCart/components/Cart/index.less +0 -68
  116. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -4
  117. package/es/components/shoppingCart/components/Empty/index.js +0 -14
  118. package/es/components/shoppingCart/components/Empty/index.less +0 -19
  119. package/es/components/shoppingCart/components/Render/index.d.ts +0 -4
  120. package/es/components/shoppingCart/components/Render/index.js +0 -68
  121. package/es/components/shoppingCart/components/Render/index.less +0 -2
  122. package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
  123. package/es/components/shoppingCart/components/SelectHolderModal/index.js +0 -124
  124. package/es/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
  125. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -3
  126. package/es/components/shoppingCart/hooks/useAddService.js +0 -23
  127. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
  128. package/es/components/shoppingCart/hooks/useClearCart.js +0 -54
  129. package/es/components/shoppingCart/hooks/useContext.d.ts +0 -1
  130. package/es/components/shoppingCart/hooks/useContext.js +0 -5
  131. package/es/components/shoppingCart/index.d.ts +0 -4
  132. package/es/components/shoppingCart/index.js +0 -24
  133. package/es/components/shoppingCart/locales.d.ts +0 -33
  134. package/es/components/shoppingCart/locales.js +0 -38
  135. package/es/components/shoppingCart/mock.d.ts +0 -40
  136. package/es/components/shoppingCart/mock.js +0 -40
  137. package/es/components/shoppingCart/status.d.ts +0 -2
  138. package/es/components/shoppingCart/status.js +0 -22
  139. package/es/components/shoppingCart/type.d.ts +0 -39
  140. package/es/components/shoppingCart/type.js +0 -1
  141. package/es/components/shoppingCart/utils.d.ts +0 -63
  142. package/es/components/shoppingCart/utils.js +0 -119
  143. package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
  144. package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -59
  145. package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  146. package/lib/components/booking/info/dateRange/index.d.ts +0 -5
  147. package/lib/components/booking/info/dateRange/index.js +0 -111
  148. package/lib/components/booking/info/dateRange/index.less +0 -21
  149. package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
  150. package/lib/components/booking/info/pet/ChangePetModal/index.js +0 -110
  151. package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
  152. package/lib/components/booking/info/service2/Lists.d.ts +0 -3
  153. package/lib/components/booking/info/service2/Lists.js +0 -113
  154. package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
  155. package/lib/components/booking/info/service2/hooks/useSelectPet.js +0 -50
  156. package/lib/components/booking/info/service2/index.d.ts +0 -3
  157. package/lib/components/booking/info/service2/index.js +0 -75
  158. package/lib/components/booking/info/service2/status.d.ts +0 -31
  159. package/lib/components/booking/info/service2/status.js +0 -81
  160. package/lib/components/booking/info/service2/utils.d.ts +0 -145
  161. package/lib/components/booking/info/service2/utils.js +0 -320
  162. package/lib/components/booking/materiels/holder/index.d.ts +0 -7
  163. package/lib/components/booking/materiels/holder/index.js +0 -65
  164. package/lib/components/shoppingCart/Provider.d.ts +0 -3
  165. package/lib/components/shoppingCart/Provider.js +0 -110
  166. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -4
  167. package/lib/components/shoppingCart/components/Cart/Product.js +0 -89
  168. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -4
  169. package/lib/components/shoppingCart/components/Cart/index.js +0 -77
  170. package/lib/components/shoppingCart/components/Cart/index.less +0 -68
  171. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -4
  172. package/lib/components/shoppingCart/components/Empty/index.js +0 -43
  173. package/lib/components/shoppingCart/components/Empty/index.less +0 -19
  174. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -4
  175. package/lib/components/shoppingCart/components/Render/index.js +0 -79
  176. package/lib/components/shoppingCart/components/Render/index.less +0 -2
  177. package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
  178. package/lib/components/shoppingCart/components/SelectHolderModal/index.js +0 -116
  179. package/lib/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
  180. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -3
  181. package/lib/components/shoppingCart/hooks/useAddService.js +0 -55
  182. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
  183. package/lib/components/shoppingCart/hooks/useClearCart.js +0 -71
  184. package/lib/components/shoppingCart/hooks/useContext.d.ts +0 -1
  185. package/lib/components/shoppingCart/hooks/useContext.js +0 -31
  186. package/lib/components/shoppingCart/index.d.ts +0 -4
  187. package/lib/components/shoppingCart/index.js +0 -60
  188. package/lib/components/shoppingCart/locales.d.ts +0 -33
  189. package/lib/components/shoppingCart/locales.js +0 -56
  190. package/lib/components/shoppingCart/mock.d.ts +0 -40
  191. package/lib/components/shoppingCart/mock.js +0 -76
  192. package/lib/components/shoppingCart/status.d.ts +0 -2
  193. package/lib/components/shoppingCart/status.js +0 -60
  194. package/lib/components/shoppingCart/type.d.ts +0 -39
  195. package/lib/components/shoppingCart/type.js +0 -17
  196. package/lib/components/shoppingCart/utils.d.ts +0 -63
  197. package/lib/components/shoppingCart/utils.js +0 -92
  198. package/lowcode/shopping-cart/meta.ts +0 -98
@@ -1,320 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/booking/info/service2/utils.ts
30
- var utils_exports = {};
31
- __export(utils_exports, {
32
- disabledDate: () => disabledDate,
33
- formatActiveKey: () => formatActiveKey,
34
- formatDateTime: () => formatDateTime,
35
- formatDayDate: () => formatDayDate,
36
- formatDayTime: () => formatDayTime,
37
- formatHolderLists: () => formatHolderLists,
38
- formatProducts: () => formatProducts,
39
- getDayProducts: () => getDayProducts,
40
- getErrorMessage: () => getErrorMessage,
41
- getResourceItem: () => getResourceItem,
42
- holderId: () => holderId,
43
- initDate: () => initDate,
44
- isAppointment: () => isAppointment,
45
- isDayBooking: () => isDayBooking,
46
- isHasDayAppointmentProduct: () => isHasDayAppointmentProduct,
47
- isOpenDeletePet: () => isOpenDeletePet,
48
- isTerminalDayBooking: () => isTerminalDayBooking
49
- });
50
- module.exports = __toCommonJS(utils_exports);
51
- var import_mock = require("../../mock");
52
- var import_utils = require("../../utils");
53
- var import_utils2 = require("@pisell/utils");
54
- var import_dayjs = __toESM(require("dayjs"));
55
- var import_status = require("./status");
56
- var import_locales = __toESM(require("../../locales"));
57
- import_utils2.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
58
- var formatActiveKey = (lists, platform) => {
59
- var _a;
60
- if (!(lists == null ? void 0 : lists.length))
61
- return [];
62
- if (platform === "shop") {
63
- return [(_a = lists[lists.length - 1]) == null ? void 0 : _a.key];
64
- }
65
- return lists == null ? void 0 : lists.map((cart) => cart == null ? void 0 : cart.key);
66
- };
67
- var getResourceItem = (id, state) => {
68
- var _a;
69
- if (id === 0) {
70
- return (0, import_mock.getNoResource)();
71
- }
72
- return (_a = state.service.resources) == null ? void 0 : _a.find((d) => d.form_record_id === id);
73
- };
74
- var errorTypes = {
75
- product: import_utils2.locales.getText("pisell2.text.status.service-error-1"),
76
- time: import_utils2.locales.getText("pisell2.text.status.service-error-2"),
77
- maxLimit: import_utils2.locales.getText("pisell2.text.status.service-error-3"),
78
- limit: import_utils2.locales.getText("pisell2.text.status.service-error-3")
79
- };
80
- var getErrorMessage = (service, resourceItem, isDay) => {
81
- const errorList = (0, import_utils.getErrorList)(resourceItem, service, isDay);
82
- let errorMessage = "";
83
- if (!service.id) {
84
- return errorList[0].label;
85
- }
86
- if (errorList.length) {
87
- if (errorList.length > 1) {
88
- errorMessage = `${errorList.length} ${import_utils2.locales.getText(
89
- "pisell2.text.warnings"
90
- )}`;
91
- } else {
92
- errorMessage = (resourceItem == null ? void 0 : resourceItem.labelText) + " " + errorTypes[errorList[0].type];
93
- }
94
- }
95
- return errorMessage;
96
- };
97
- var formatHolderLists = (lists) => {
98
- const isOpenGroup = true;
99
- const _lists = lists == null ? void 0 : lists.map((item) => {
100
- return {
101
- ...item,
102
- id: (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id),
103
- key: (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id),
104
- label: import_utils2.locales.getText("pisell2.text.cart.of")(item == null ? void 0 : item.main_field)
105
- };
106
- });
107
- if (isOpenGroup) {
108
- const defaults = [
109
- {
110
- key: 0,
111
- id: 0,
112
- label: import_utils2.locales.getText("pisell2.text.open.items"),
113
- main_field: import_utils2.locales.getText("pisell2.text.open.items")
114
- }
115
- ];
116
- return defaults.concat(_lists);
117
- }
118
- return _lists;
119
- };
120
- var getHolderLists = (state) => {
121
- var _a, _b, _c, _d, _e, _f;
122
- const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
123
- const petLists = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
124
- const _lists = formatHolderLists(petLists);
125
- return _lists;
126
- };
127
- var getHolderName = (state, id) => {
128
- const holderLists = getHolderLists(state);
129
- if (!holderLists.length || !id)
130
- return "";
131
- const resource = holderLists.find((d) => (d == null ? void 0 : d.id) === id);
132
- return resource == null ? void 0 : resource.main_field;
133
- };
134
- var isAppointment = (item, state) => {
135
- return import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type) && isDayBooking(state);
136
- };
137
- var formatProducts = (lists, state) => {
138
- if (!(lists == null ? void 0 : lists.length))
139
- return [];
140
- try {
141
- return lists.map((item) => {
142
- var _a, _b, _c, _d, _e, _f, _g;
143
- const _isAppointment = isAppointment(item, state);
144
- const clientTitle = getHolderName(state, (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.holder_id);
145
- let resourceItem = {};
146
- let errorMessage = "";
147
- if (_isAppointment) {
148
- resourceItem = getResourceItem((_b = item == null ? void 0 : item._extend) == null ? void 0 : _b.resource, state);
149
- errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
150
- }
151
- return {
152
- ...item,
153
- note: (item == null ? void 0 : item.note) || "",
154
- locale: state.locale,
155
- symbol: state.amountSymbol,
156
- total: item == null ? void 0 : item._extend.total,
157
- price: item == null ? void 0 : item._extend.price,
158
- origin_total: item == null ? void 0 : item._extend.origin_total,
159
- num: item == null ? void 0 : item._extend.quantity,
160
- bundle: (_d = (_c = item == null ? void 0 : item._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.bundle,
161
- options: (_f = (_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.option,
162
- _showAction: false,
163
- _actionText: import_utils2.locales.getText("page.booking.text.add-time"),
164
- _errorMessage: errorMessage,
165
- _extend: {
166
- ...(item == null ? void 0 : item._extend) || {},
167
- date: !_isAppointment ? null : state == null ? void 0 : state.date,
168
- relation_form_name: !_isAppointment ? "" : (resourceItem == null ? void 0 : resourceItem.labelText) || item.relation_form_name,
169
- holder_title: clientTitle,
170
- resource: !_isAppointment ? null : (_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.resource,
171
- relation_details: []
172
- }
173
- };
174
- });
175
- } catch (error) {
176
- }
177
- };
178
- var disabledDate = (current, position, currentDate) => {
179
- if (!(0, import_dayjs.default)(currentDate).isValid())
180
- return;
181
- if (position === "start") {
182
- return false;
183
- }
184
- if (position === "end" && current.endOf("day") && currentDate) {
185
- console.log(currentDate, current, position, "currentDate");
186
- const endDisabled = currentDate.add(8, "months").format("YYYY-MM-DD");
187
- return (0, import_dayjs.default)(endDisabled) < current.startOf("day") || current.startOf("day") <= currentDate;
188
- }
189
- return current && current <= currentDate;
190
- };
191
- var isDayBooking = (state) => {
192
- return (state == null ? void 0 : state.renderType) === "dayBooking";
193
- };
194
- var isTerminalDayBooking = (state) => {
195
- return state.isTerminalDayBookingPage;
196
- };
197
- var formatDayDate = (_extend) => {
198
- let startDate = (0, import_dayjs.default)(_extend == null ? void 0 : _extend.start_date).startOf("day");
199
- let endDate = (0, import_dayjs.default)(_extend == null ? void 0 : _extend.end_date).startOf("day");
200
- return {
201
- ..._extend,
202
- start_date: startDate,
203
- end_date: endDate
204
- };
205
- };
206
- var formatDayTime = ({ startDate, endDate }) => {
207
- const shopOpeningTime = localStorage.getItem("shopOpeningHours") || "00:00";
208
- let start_date = (0, import_dayjs.default)(startDate).format("YYYY-MM-DD");
209
- let end_date = (0, import_dayjs.default)(endDate).format("YYYY-MM-DD");
210
- const result = {
211
- startDateTime: (0, import_dayjs.default)(`${start_date}T${shopOpeningTime}:00`),
212
- // 结束日期根据营业日时间减去一分钟
213
- endDateTime: (0, import_dayjs.default)(`${end_date}T${shopOpeningTime}:00`).subtract(1, "minute")
214
- };
215
- return result;
216
- };
217
- var formatDateTime = (start_date, end_date) => {
218
- const _openingTime = (0, import_status.openingTime)();
219
- const startDate = `${start_date} ${_openingTime}`;
220
- let endDate = `${end_date} ${_openingTime}`;
221
- const date = {
222
- value: (0, import_dayjs.default)(startDate),
223
- end_date: (0, import_dayjs.default)(endDate).subtract(1, "minute")
224
- };
225
- return date;
226
- };
227
- var initDate = () => {
228
- const startDate = (0, import_dayjs.default)().format("YYYY-MM-DD");
229
- let endDate = (0, import_dayjs.default)().add(1, "days").format("YYYY-MM-DD");
230
- const date = formatDateTime(startDate, endDate);
231
- return date;
232
- };
233
- var isHasDayAppointmentProduct = (state) => {
234
- var _a, _b, _c, _d, _e, _f, _g;
235
- const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
236
- const services = ((_e = state.service) == null ? void 0 : _e.value) || [];
237
- const pets = ((_g = (_f = state.pet) == null ? void 0 : _f.value) == null ? void 0 : _g[form_id]) || [];
238
- const appointmentServices = services.filter((d) => import_status.appointmentTypes.includes(d.extension_type));
239
- if (!appointmentServices.length)
240
- return true;
241
- let _pets = pets == null ? void 0 : pets.map((d) => {
242
- const holderProducts = services.filter((d2) => {
243
- var _a2;
244
- return ((_a2 = d2._extend) == null ? void 0 : _a2.holder_id) == d2.form_record_id;
245
- });
246
- return {
247
- ...d,
248
- // 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
249
- // services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
250
- services: services.filter((item) => {
251
- var _a2;
252
- return ((_a2 = item._extend) == null ? void 0 : _a2.holder_id) == d.form_record_id && import_status.appointmentTypes.includes(item.extension_type);
253
- })
254
- };
255
- });
256
- _pets = _pets.filter((d) => !d.services.length);
257
- return _pets.length > 0;
258
- };
259
- var getDayProducts = (holderId2, lists, isTerminal) => {
260
- let _lists = lists || [];
261
- if (!holderId2 && !isTerminal) {
262
- _lists = _lists.filter((item) => !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type));
263
- } else {
264
- _lists = _lists.filter((item) => {
265
- var _a;
266
- return !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type) || import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type) && ((_a = item.duration) == null ? void 0 : _a.type) === "days";
267
- });
268
- }
269
- return _lists;
270
- };
271
- var isOpenDeletePet = (state, newVal) => {
272
- var _a, _b, _c, _d, _e, _f, _g;
273
- const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
274
- const oldPets = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
275
- const newPets = (newVal == null ? void 0 : newVal[form_id]) || [];
276
- const deletePets = oldPets.filter((item) => !newPets.some((newItem) => newItem.form_record_id === item.form_record_id));
277
- const servicePets = deletePets.map((item) => {
278
- var _a2, _b2;
279
- return {
280
- ...item,
281
- services: (_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.filter((d) => {
282
- var _a3;
283
- return ((_a3 = d._extend) == null ? void 0 : _a3.holder_id) == item.form_record_id;
284
- })
285
- };
286
- });
287
- const lists = servicePets.filter((item) => {
288
- var _a2;
289
- return ((_a2 = item.services) == null ? void 0 : _a2.length) > 0;
290
- });
291
- console.log(deletePets, (_g = state.service) == null ? void 0 : _g.value, lists, "wh98888888");
292
- return {
293
- ids: lists.map((item) => item.form_record_id),
294
- lists
295
- };
296
- };
297
- var holderId = (state) => {
298
- var _a;
299
- return Number(((_a = state == null ? void 0 : state.activeCartId) == null ? void 0 : _a[0]) || 0);
300
- };
301
- // Annotate the CommonJS export names for ESM import in node:
302
- 0 && (module.exports = {
303
- disabledDate,
304
- formatActiveKey,
305
- formatDateTime,
306
- formatDayDate,
307
- formatDayTime,
308
- formatHolderLists,
309
- formatProducts,
310
- getDayProducts,
311
- getErrorMessage,
312
- getResourceItem,
313
- holderId,
314
- initDate,
315
- isAppointment,
316
- isDayBooking,
317
- isHasDayAppointmentProduct,
318
- isOpenDeletePet,
319
- isTerminalDayBooking
320
- });
@@ -1,7 +0,0 @@
1
- import { SelectProps } from 'antd';
2
- import React from 'react';
3
- interface HolderProps extends SelectProps {
4
- selectProps?: SelectProps;
5
- }
6
- declare const Holder: (props: HolderProps) => React.JSX.Element;
7
- export default Holder;
@@ -1,65 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/booking/materiels/holder/index.tsx
30
- var holder_exports = {};
31
- __export(holder_exports, {
32
- default: () => holder_default
33
- });
34
- module.exports = __toCommonJS(holder_exports);
35
- var import_antd = require("antd");
36
- var import_model = require("../../info/model");
37
- var import_react = __toESM(require("react"));
38
- var import_useSelectPet = __toESM(require("../../info/service2/hooks/useSelectPet"));
39
- var Holder = (props) => {
40
- var _a;
41
- const { selectProps, ...resetProps } = props;
42
- const { state } = (0, import_react.useContext)(import_model.Context);
43
- const { holderLists } = (0, import_useSelectPet.default)(state);
44
- const holders = (0, import_react.useMemo)(() => {
45
- const lists = holderLists == null ? void 0 : holderLists.filter((d) => (d == null ? void 0 : d.id) > 0);
46
- if (!(lists == null ? void 0 : lists.length))
47
- return [];
48
- return lists.map((d) => {
49
- return {
50
- value: d == null ? void 0 : d.id,
51
- label: d == null ? void 0 : d.main_field
52
- };
53
- });
54
- }, [(_a = state == null ? void 0 : state.pet) == null ? void 0 : _a.value]);
55
- const renderOptions = (0, import_react.useCallback)(
56
- (array, value = "value", label = "label") => {
57
- return array.map((d) => {
58
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Select.Option, { value: d[value], key: d[value], disabled: d.disabled }, d[label]);
59
- });
60
- },
61
- []
62
- );
63
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { ...selectProps, ...resetProps }, renderOptions(holders));
64
- };
65
- var holder_default = Holder;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const CartContext: React.Context<any>;
3
- export declare const CartProvider: ({ children, props, onCard, onChange, onAddProduct, onActiveKey, }: any) => React.JSX.Element;
@@ -1,110 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/shoppingCart/Provider.tsx
30
- var Provider_exports = {};
31
- __export(Provider_exports, {
32
- CartContext: () => CartContext,
33
- CartProvider: () => CartProvider
34
- });
35
- module.exports = __toCommonJS(Provider_exports);
36
- var import_react = __toESM(require("react"));
37
- var import_status = require("./status");
38
- var import_utils = require("./utils");
39
- var CartContext = (0, import_react.createContext)({});
40
- var CartProvider = ({
41
- children,
42
- props,
43
- onCard,
44
- onChange,
45
- onAddProduct,
46
- onActiveKey
47
- }) => {
48
- const defaultState = { ...import_status.defaultData, ...props };
49
- const [state, setState] = (0, import_react.useState)(defaultState);
50
- const updateState = (newState) => {
51
- console.log(newState, "wh_new");
52
- setState((prevState) => {
53
- return {
54
- ...prevState,
55
- ...newState
56
- };
57
- });
58
- };
59
- (0, import_react.useEffect)(() => {
60
- const _isOpenGroup = props == null ? void 0 : props.hasOwnProperty("isOpenGroup");
61
- let newState = {};
62
- if (props == null ? void 0 : props.platform) {
63
- newState["platform"] = props == null ? void 0 : props.platform;
64
- }
65
- if (_isOpenGroup) {
66
- newState["isOpenGroup"] = props == null ? void 0 : props.isOpenGroup;
67
- }
68
- if (props == null ? void 0 : props.emptyText) {
69
- newState["emptyText"] = props == null ? void 0 : props.emptyText;
70
- }
71
- if (props == null ? void 0 : props.productParams) {
72
- newState = {
73
- ...newState,
74
- ...props == null ? void 0 : props.productParams
75
- };
76
- }
77
- if (props == null ? void 0 : props.collapseParams) {
78
- newState["collapseParams"] = props == null ? void 0 : props.collapseParams;
79
- }
80
- const params = { ...defaultState, ...newState };
81
- const result = { ...params, ...(0, import_utils.formatState)(params) };
82
- console.log(result, params, "result");
83
- setState(result);
84
- }, [
85
- props == null ? void 0 : props.platform,
86
- props == null ? void 0 : props.isOpenGroup,
87
- props == null ? void 0 : props.emptyText,
88
- props == null ? void 0 : props.productParams,
89
- props == null ? void 0 : props.collapseParams
90
- ]);
91
- return /* @__PURE__ */ import_react.default.createElement(
92
- CartContext.Provider,
93
- {
94
- value: {
95
- state,
96
- updateState,
97
- onCard,
98
- onChange,
99
- onAddProduct,
100
- onActiveKey
101
- }
102
- },
103
- children
104
- );
105
- };
106
- // Annotate the CommonJS export names for ESM import in node:
107
- 0 && (module.exports = {
108
- CartContext,
109
- CartProvider
110
- });
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { ProductProps } from '../../type';
3
- declare const Product: (props: ProductProps) => React.JSX.Element;
4
- export default Product;
@@ -1,89 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/shoppingCart/components/Cart/Product.tsx
30
- var Product_exports = {};
31
- __export(Product_exports, {
32
- default: () => Product_default
33
- });
34
- module.exports = __toCommonJS(Product_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_materials = require("@pisell/materials");
37
- var import_useClearCart = __toESM(require("../../hooks/useClearCart"));
38
- var import_utils = require("../../utils");
39
- var import_useContext = require("../../hooks/useContext");
40
- var import_useAddService = __toESM(require("../../hooks/useAddService"));
41
- var Product = (props) => {
42
- const { id, lists } = props;
43
- const { state, updateState, onAction, onChange, onCard } = (0, import_useContext.useContext)();
44
- const { disabledEdit, isShowPackageNote, isShowNote, hideAddBtn } = state;
45
- const clearCart = (0, import_useClearCart.default)(id);
46
- const handleChange = (item, type) => {
47
- if (disabledEdit)
48
- return;
49
- let products = [...state.products];
50
- if (type === "delete") {
51
- products = products.filter((product) => product._id !== item._id);
52
- } else {
53
- products = products.map((product) => {
54
- if (product._id === item._id) {
55
- return {
56
- ...product,
57
- ...item
58
- };
59
- }
60
- return product;
61
- });
62
- }
63
- updateState((0, import_utils.updateProduct)(state, products));
64
- onChange == null ? void 0 : onChange(products);
65
- };
66
- const productParams = (0, import_react.useMemo)(() => {
67
- return {
68
- isShowNote,
69
- isShowPackageNote,
70
- disabledEdit
71
- };
72
- }, [isShowNote, isShowPackageNote, disabledEdit]);
73
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__shopping-cart-content" }, clearCart, lists == null ? void 0 : lists.map((item) => {
74
- return /* @__PURE__ */ import_react.default.createElement(
75
- import_materials.ProductCard,
76
- {
77
- key: item.id,
78
- dataSource: item,
79
- onAction: (e) => onAction == null ? void 0 : onAction(e),
80
- onDelete: (e) => handleChange(e, "delete"),
81
- onNote: (e) => handleChange(e),
82
- onLike: (e) => handleChange(e),
83
- onCard: (e) => onCard == null ? void 0 : onCard(e),
84
- ...productParams
85
- }
86
- );
87
- }), !hideAddBtn ? (0, import_useAddService.default)(id, "more") : null);
88
- };
89
- var Product_default = Product;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- declare const Cart: () => React.JSX.Element;
4
- export default Cart;