@pisell/private-materials 3.4.76 → 3.4.78

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 (208) 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 +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +10 -10
  11. package/es/components/booking/addons/model.d.ts +1 -10
  12. package/es/components/booking/forms/model.d.ts +1 -10
  13. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  14. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  15. package/es/components/booking/info/model.d.ts +1 -10
  16. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  17. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  18. package/es/components/booking/model.d.ts +1 -9
  19. package/es/components/booking/notes/model.d.ts +1 -10
  20. package/es/components/booking/payments/model.d.ts +1 -10
  21. package/es/components/booking/utils.d.ts +2 -2
  22. package/es/components/eftpos/hooks.d.ts +0 -1
  23. package/es/components/eftposPay/amount.d.ts +1 -1
  24. package/es/components/eftposPay/device.d.ts +1 -1
  25. package/es/components/eftposPay/hooks.d.ts +1 -1
  26. package/es/components/eftposPay/store/index.d.ts +2 -2
  27. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  28. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  29. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  30. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  31. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  32. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  33. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  34. package/es/components/pay/toC/model.d.ts +1 -9
  35. package/es/components/schedules/model.d.ts +1 -9
  36. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  37. package/es/hooks/useTranslationOriginal.d.ts +1 -0
  38. package/es/hooks/useTranslationOriginal.js +10 -0
  39. package/es/index.d.ts +3 -0
  40. package/es/index.js +3 -0
  41. package/es/plus/clientCard/index.d.ts +7 -0
  42. package/es/plus/clientCard/index.js +462 -0
  43. package/es/plus/clientCard/index.less +515 -0
  44. package/es/plus/clientCard/line/index.d.ts +9 -0
  45. package/es/plus/clientCard/line/index.js +157 -0
  46. package/es/plus/clientCard/line/index.less +142 -0
  47. package/es/plus/clientCard/locales.d.ts +18 -0
  48. package/es/plus/clientCard/locales.js +17 -0
  49. package/es/plus/clientCard/types.d.ts +135 -0
  50. package/es/plus/clientCard/types.js +1 -0
  51. package/es/plus/clientCard/utils.d.ts +8 -0
  52. package/es/plus/clientCard/utils.js +59 -0
  53. package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +3 -0
  54. package/es/plus/clinetSearch/Add/BirthdayField/index.js +277 -0
  55. package/es/plus/clinetSearch/Add/GenderField/index.d.ts +3 -0
  56. package/es/plus/clinetSearch/Add/GenderField/index.js +18 -0
  57. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +3 -0
  58. package/es/plus/clinetSearch/Add/PhoneField/index.js +52 -0
  59. package/es/plus/clinetSearch/Add/PhoneField/serve.d.ts +2 -0
  60. package/es/plus/clinetSearch/Add/PhoneField/serve.js +166 -0
  61. package/es/plus/clinetSearch/Add/index.d.ts +18 -0
  62. package/es/plus/clinetSearch/Add/index.js +213 -0
  63. package/es/plus/clinetSearch/Add/index.less +30 -0
  64. package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +5 -0
  65. package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.js +265 -0
  66. package/es/plus/clinetSearch/InfiniteScroll/index.d.ts +2 -0
  67. package/es/plus/clinetSearch/InfiniteScroll/index.js +1 -0
  68. package/es/plus/clinetSearch/InfiniteScroll/types.d.ts +46 -0
  69. package/es/plus/clinetSearch/InfiniteScroll/types.js +1 -0
  70. package/es/plus/clinetSearch/index.d.ts +18 -0
  71. package/es/plus/clinetSearch/index.js +234 -0
  72. package/es/plus/clinetSearch/index.less +95 -0
  73. package/es/plus/clinetSearch/locales.d.ts +108 -0
  74. package/es/plus/clinetSearch/locales.js +107 -0
  75. package/es/plus/clinetSearch/serve.d.ts +1 -0
  76. package/es/plus/clinetSearch/serve.js +31 -0
  77. package/es/plus/clinetSearch/types.d.ts +70 -0
  78. package/es/plus/clinetSearch/types.js +1 -0
  79. package/es/plus/saasAttendance/locales.d.ts +63 -0
  80. package/es/plus/saasAttendance/locales.js +71 -2
  81. package/es/plus/saasAttendance/settings/PermissonTab.d.ts +5 -0
  82. package/es/plus/saasAttendance/settings/PermissonTab.js +79 -0
  83. package/es/plus/saasAttendance/settings/ShiftScheduleTab.js +9 -3
  84. package/es/plus/saasAttendance/settings/components/MapField.js +69 -33
  85. package/es/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.d.ts +7 -0
  86. package/es/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.js +149 -0
  87. package/es/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.less +119 -0
  88. package/es/plus/saasAttendance/settings/index.js +7 -0
  89. package/es/plus/saasAttendance/settings/index.less +15 -0
  90. package/es/plus/saasAttendance/settings/types.d.ts +6 -0
  91. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  92. package/es/plus/walletPassGallery/components/passDetail/index.d.ts +2 -0
  93. package/es/plus/walletPassGallery/components/passDetail/index.js +104 -39
  94. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +2 -0
  95. package/es/plus/walletPassGallery/components/timelineSection/index.js +19 -2
  96. package/es/plus/walletPassGallery/index.d.ts +4 -0
  97. package/es/plus/walletPassGallery/index.js +121 -42
  98. package/es/plus/walletPassGallery/serve.d.ts +3 -1
  99. package/es/plus/walletPassGallery/serve.js +13 -13
  100. package/es/pro/pisellPhoneKeyboard/index.d.ts +13 -0
  101. package/es/pro/pisellPhoneKeyboard/index.js +210 -0
  102. package/es/pro/pisellPhoneKeyboard/index.less +157 -0
  103. package/es/pro/pisellPhoneKeyboard/locales.d.ts +12 -0
  104. package/es/pro/pisellPhoneKeyboard/locales.js +11 -0
  105. package/lib/components/booking/addons/model.d.ts +1 -10
  106. package/lib/components/booking/forms/model.d.ts +1 -10
  107. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  108. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  109. package/lib/components/booking/info/model.d.ts +1 -10
  110. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  111. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  112. package/lib/components/booking/model.d.ts +1 -9
  113. package/lib/components/booking/notes/model.d.ts +1 -10
  114. package/lib/components/booking/payments/model.d.ts +1 -10
  115. package/lib/components/booking/utils.d.ts +2 -2
  116. package/lib/components/eftpos/hooks.d.ts +0 -1
  117. package/lib/components/eftposPay/amount.d.ts +1 -1
  118. package/lib/components/eftposPay/device.d.ts +1 -1
  119. package/lib/components/eftposPay/hooks.d.ts +1 -1
  120. package/lib/components/eftposPay/store/index.d.ts +2 -2
  121. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  122. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  123. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  124. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  125. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  126. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  127. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  128. package/lib/components/pay/toC/model.d.ts +1 -9
  129. package/lib/components/schedules/model.d.ts +1 -9
  130. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  131. package/lib/hooks/useTranslationOriginal.d.ts +1 -0
  132. package/lib/hooks/useTranslationOriginal.js +42 -0
  133. package/lib/index.d.ts +3 -0
  134. package/lib/index.js +9 -0
  135. package/lib/plus/clientCard/index.d.ts +7 -0
  136. package/lib/plus/clientCard/index.js +457 -0
  137. package/lib/plus/clientCard/index.less +515 -0
  138. package/lib/plus/clientCard/line/index.d.ts +9 -0
  139. package/lib/plus/clientCard/line/index.js +153 -0
  140. package/lib/plus/clientCard/line/index.less +142 -0
  141. package/lib/plus/clientCard/locales.d.ts +18 -0
  142. package/lib/plus/clientCard/locales.js +41 -0
  143. package/lib/plus/clientCard/types.d.ts +135 -0
  144. package/lib/plus/clientCard/types.js +17 -0
  145. package/lib/plus/clientCard/utils.d.ts +8 -0
  146. package/lib/plus/clientCard/utils.js +75 -0
  147. package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +3 -0
  148. package/lib/plus/clinetSearch/Add/BirthdayField/index.js +256 -0
  149. package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +3 -0
  150. package/lib/plus/clinetSearch/Add/GenderField/index.js +52 -0
  151. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +3 -0
  152. package/lib/plus/clinetSearch/Add/PhoneField/index.js +78 -0
  153. package/lib/plus/clinetSearch/Add/PhoneField/serve.d.ts +2 -0
  154. package/lib/plus/clinetSearch/Add/PhoneField/serve.js +193 -0
  155. package/lib/plus/clinetSearch/Add/index.d.ts +18 -0
  156. package/lib/plus/clinetSearch/Add/index.js +244 -0
  157. package/lib/plus/clinetSearch/Add/index.less +30 -0
  158. package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +5 -0
  159. package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.js +235 -0
  160. package/lib/plus/clinetSearch/InfiniteScroll/index.d.ts +2 -0
  161. package/lib/plus/clinetSearch/InfiniteScroll/index.js +35 -0
  162. package/lib/plus/clinetSearch/InfiniteScroll/types.d.ts +46 -0
  163. package/lib/plus/clinetSearch/InfiniteScroll/types.js +17 -0
  164. package/lib/plus/clinetSearch/index.d.ts +18 -0
  165. package/lib/plus/clinetSearch/index.js +237 -0
  166. package/lib/plus/clinetSearch/index.less +95 -0
  167. package/lib/plus/clinetSearch/locales.d.ts +108 -0
  168. package/lib/plus/clinetSearch/locales.js +131 -0
  169. package/lib/plus/clinetSearch/serve.d.ts +1 -0
  170. package/lib/plus/clinetSearch/serve.js +33 -0
  171. package/lib/plus/clinetSearch/types.d.ts +70 -0
  172. package/lib/plus/clinetSearch/types.js +17 -0
  173. package/lib/plus/saasAttendance/locales.d.ts +63 -0
  174. package/lib/plus/saasAttendance/locales.js +65 -2
  175. package/lib/plus/saasAttendance/settings/PermissonTab.d.ts +5 -0
  176. package/lib/plus/saasAttendance/settings/PermissonTab.js +128 -0
  177. package/lib/plus/saasAttendance/settings/ShiftScheduleTab.js +2 -1
  178. package/lib/plus/saasAttendance/settings/components/MapField.js +50 -11
  179. package/lib/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.d.ts +7 -0
  180. package/lib/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.js +150 -0
  181. package/lib/plus/saasAttendance/settings/components/shiftModal/ShiftPreview.less +119 -0
  182. package/lib/plus/saasAttendance/settings/index.js +12 -0
  183. package/lib/plus/saasAttendance/settings/index.less +15 -0
  184. package/lib/plus/saasAttendance/settings/types.d.ts +6 -0
  185. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  186. package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +2 -0
  187. package/lib/plus/walletPassGallery/components/passDetail/index.js +57 -5
  188. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +2 -0
  189. package/lib/plus/walletPassGallery/components/timelineSection/index.js +17 -2
  190. package/lib/plus/walletPassGallery/index.d.ts +4 -0
  191. package/lib/plus/walletPassGallery/index.js +141 -42
  192. package/lib/plus/walletPassGallery/serve.d.ts +3 -1
  193. package/lib/plus/walletPassGallery/serve.js +2 -2
  194. package/lib/pro/pisellPhoneKeyboard/index.d.ts +13 -0
  195. package/lib/pro/pisellPhoneKeyboard/index.js +219 -0
  196. package/lib/pro/pisellPhoneKeyboard/index.less +157 -0
  197. package/lib/pro/pisellPhoneKeyboard/locales.d.ts +12 -0
  198. package/lib/pro/pisellPhoneKeyboard/locales.js +35 -0
  199. package/lowcode/client-card/fragments/cardStyle.ts +63 -0
  200. package/lowcode/client-card/fragments/nameStyle.ts +34 -0
  201. package/lowcode/client-card/fragments/pisellAvatar.ts +87 -0
  202. package/lowcode/client-card/fragments/tagConfig.ts +88 -0
  203. package/lowcode/client-card/meta.ts +343 -0
  204. package/lowcode/client-search/meta.ts +316 -0
  205. package/lowcode/eco-cup-list/meta.ts +1 -1
  206. package/lowcode/eco-customer-list/meta.ts +1 -1
  207. package/lowcode/wallet-pass-gallery/meta.ts +66 -1
  208. package/package.json +4 -4
@@ -0,0 +1,42 @@
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/hooks/useTranslationOriginal.ts
30
+ var useTranslationOriginal_exports = {};
31
+ __export(useTranslationOriginal_exports, {
32
+ default: () => useTranslationOriginal
33
+ });
34
+ module.exports = __toCommonJS(useTranslationOriginal_exports);
35
+ var import_useEngineContext = __toESM(require("./useEngineContext"));
36
+ function useTranslationOriginal() {
37
+ const context = (0, import_useEngineContext.default)();
38
+ const { appHelper } = context;
39
+ const { utils } = appHelper || {};
40
+ const { translationOriginal } = utils || {};
41
+ return translationOriginal;
42
+ }
package/lib/index.d.ts CHANGED
@@ -44,6 +44,9 @@ export { default as TicketBooking } from './components/ticketBooking';
44
44
  export { default as SubTotal } from './components/subTotal';
45
45
  export { default as EditBookingModal } from './components/booking/editBookingModal';
46
46
  export { default as StepController } from './components/stepController';
47
+ export { default as ClientCard } from './plus/clientCard';
48
+ export { default as ClientSearch } from './plus/clinetSearch';
49
+ export { default as ComprehensiveSearch } from './pro/comprehensiveSearch';
47
50
  export { default as SaasLogin } from './plus/saasLogin';
48
51
  export { default as SaasRegister } from './plus/saasRegister';
49
52
  export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
package/lib/index.js CHANGED
@@ -44,6 +44,9 @@ __export(src_exports, {
44
44
  BookingPayment: () => import_payments.default,
45
45
  BookingResources: () => import_resources.default,
46
46
  BookingStartTime: () => import_startTime.default,
47
+ ClientCard: () => import_clientCard.default,
48
+ ClientSearch: () => import_clinetSearch.default,
49
+ ComprehensiveSearch: () => import_comprehensiveSearch.default,
47
50
  ContactInfo: () => import_contactInfo.default,
48
51
  ContactInfoModal: () => import_contactInfoModal.default,
49
52
  CustomerAuth: () => import_admin.CustomerAuth,
@@ -160,6 +163,9 @@ var import_ticketBooking = __toESM(require("./components/ticketBooking"));
160
163
  var import_subTotal = __toESM(require("./components/subTotal"));
161
164
  var import_editBookingModal = __toESM(require("./components/booking/editBookingModal"));
162
165
  var import_stepController = __toESM(require("./components/stepController"));
166
+ var import_clientCard = __toESM(require("./plus/clientCard"));
167
+ var import_clinetSearch = __toESM(require("./plus/clinetSearch"));
168
+ var import_comprehensiveSearch = __toESM(require("./pro/comprehensiveSearch"));
163
169
  var import_saasLogin = __toESM(require("./plus/saasLogin"));
164
170
  var import_saasRegister = __toESM(require("./plus/saasRegister"));
165
171
  var import_saasCreateOrganization = __toESM(require("./plus/saasCreateOrganization"));
@@ -205,6 +211,9 @@ import_dayjs.default.extend(import_localeData.default);
205
211
  BookingPayment,
206
212
  BookingResources,
207
213
  BookingStartTime,
214
+ ClientCard,
215
+ ClientSearch,
216
+ ComprehensiveSearch,
208
217
  ContactInfo,
209
218
  ContactInfoModal,
210
219
  CustomerAuth,
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ClientData, ClientCardProps, ProcessedClientData, FieldNames } from './types';
3
+ import './index.less';
4
+ export declare const processClientData: (dataSource: ClientData, fieldNames?: FieldNames) => ProcessedClientData | null;
5
+ export declare const PREFIX = "pisell-client-card";
6
+ declare const ClientCard: React.FC<ClientCardProps>;
7
+ export default ClientCard;
@@ -0,0 +1,457 @@
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/plus/clientCard/index.tsx
30
+ var clientCard_exports = {};
31
+ __export(clientCard_exports, {
32
+ PREFIX: () => PREFIX,
33
+ default: () => clientCard_default,
34
+ processClientData: () => processClientData
35
+ });
36
+ module.exports = __toCommonJS(clientCard_exports);
37
+ var import_react = __toESM(require("react"));
38
+ var import_antd = require("antd");
39
+ var import_materials = require("@pisell/materials");
40
+ var import_icon = require("@pisell/icon");
41
+ var import_classnames = __toESM(require("classnames"));
42
+ var import_line = __toESM(require("./line"));
43
+ var import_locales = __toESM(require("./locales"));
44
+ var import_utils = require("@pisell/utils");
45
+ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
46
+ var import_clientName = __toESM(require("../clientName"));
47
+ var import_utils2 = require("./utils");
48
+ var import_index = require("./index.less");
49
+ var processClientData = (dataSource, fieldNames = {}) => {
50
+ if (!dataSource) return null;
51
+ const fields = [
52
+ "id",
53
+ "name",
54
+ "display_name",
55
+ "nickname",
56
+ "cover",
57
+ "phone",
58
+ "email",
59
+ "birthday",
60
+ "address",
61
+ "tags"
62
+ ];
63
+ const _data = {};
64
+ fields.forEach((key) => {
65
+ _data[key] = (0, import_utils2.getFieldValue)(dataSource, key, fieldNames);
66
+ });
67
+ return {
68
+ ...dataSource,
69
+ ..._data
70
+ };
71
+ };
72
+ var PREFIX = "pisell-client-card";
73
+ var renderAvatar = (processedData, avatarConfig = {}, isShowAvatar = true, isShowStatus = false, statusConfig = {}) => {
74
+ if (!isShowAvatar || !processedData) return null;
75
+ const { icon, useTextAvatar = false, children } = avatarConfig;
76
+ const statusIndicator = isShowStatus && /* @__PURE__ */ import_react.default.createElement(
77
+ "div",
78
+ {
79
+ className: `${PREFIX}__status-indicator`,
80
+ style: {
81
+ backgroundColor: statusConfig.color || "#17B26A"
82
+ }
83
+ }
84
+ );
85
+ if (useTextAvatar) {
86
+ const text = children || (0, import_utils2.getAvatarText)(
87
+ processedData.name || processedData.display_name || processedData.nickname || ""
88
+ );
89
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__avatar-wrapper` }, /* @__PURE__ */ import_react.default.createElement(import_materials.PisellAvatar, { className: `${PREFIX}__avatar`, ...avatarConfig }, text), statusIndicator);
90
+ }
91
+ if (icon) {
92
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__avatar-wrapper` }, /* @__PURE__ */ import_react.default.createElement(
93
+ import_materials.PisellAvatar,
94
+ {
95
+ className: `${PREFIX}__avatar`,
96
+ ...avatarConfig,
97
+ icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: icon })
98
+ }
99
+ ), statusIndicator);
100
+ }
101
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__avatar-wrapper` }, /* @__PURE__ */ import_react.default.createElement(
102
+ import_materials.PisellAvatar,
103
+ {
104
+ className: `${PREFIX}__avatar`,
105
+ ...avatarConfig,
106
+ src: processedData.cover
107
+ }
108
+ ), statusIndicator);
109
+ };
110
+ var renderTags = (processedData, isShowTag = true, tags = [], tagConfig = {}) => {
111
+ if (!isShowTag) return null;
112
+ const tagsToShow = tags.length > 0 ? tags : (processedData == null ? void 0 : processedData.tags) || [];
113
+ if (!tagsToShow.length) return null;
114
+ const { gap = 4, flexWrap = "nowrap" } = tagConfig;
115
+ const isNoWrap = flexWrap === "nowrap";
116
+ return /* @__PURE__ */ import_react.default.createElement(
117
+ "div",
118
+ {
119
+ className: (0, import_classnames.default)(
120
+ `${PREFIX}__tags`,
121
+ isNoWrap && `${PREFIX}__tags--nowrap`
122
+ ),
123
+ style: { gap, flexWrap }
124
+ },
125
+ tagsToShow.map((tag, index) => {
126
+ const content = typeof tag === "string" ? tag : tag.children || tag.label;
127
+ const tagProps = {
128
+ key: index,
129
+ color: typeof tag === "object" ? tag.color : void 0,
130
+ className: (0, import_classnames.default)(
131
+ `${PREFIX}__tag`,
132
+ isNoWrap && `${PREFIX}__tag--nowrap`,
133
+ !isNoWrap && `${PREFIX}__tag--wrap`
134
+ )
135
+ };
136
+ return import_react.default.createElement(import_antd.Tag, tagProps, content);
137
+ })
138
+ );
139
+ };
140
+ var renderContactInfo = (processedData, isShowPhone = true, isShowEmail = true, isShowBirthday = true, isShowAddress = true, gap, cardType) => {
141
+ if (!processedData) return null;
142
+ const fields = [];
143
+ if (cardType === "b2") {
144
+ if (isShowPhone && processedData.phone) {
145
+ fields.push({ value: processedData.phone, type: "phone" });
146
+ } else if (isShowEmail && processedData.email) {
147
+ fields.push({ value: processedData.email, type: "email" });
148
+ }
149
+ } else {
150
+ if (isShowPhone && processedData.phone) {
151
+ fields.push({ value: processedData.phone, type: "phone" });
152
+ }
153
+ if (isShowEmail && processedData.email) {
154
+ fields.push({ value: processedData.email, type: "email" });
155
+ }
156
+ }
157
+ if (isShowBirthday && processedData.birthday) {
158
+ fields.push({ value: processedData.birthday, type: "birthday" });
159
+ }
160
+ if (isShowAddress && processedData.address) {
161
+ fields.push({ value: processedData.address, type: "address" });
162
+ }
163
+ if (!fields.length) return null;
164
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__fields`, style: { gap } }, fields.map((field, index) => /* @__PURE__ */ import_react.default.createElement(
165
+ "div",
166
+ {
167
+ key: index,
168
+ className: (0, import_classnames.default)(
169
+ `${PREFIX}__contact`,
170
+ field.type === "address" && `${PREFIX}__contact--address`
171
+ )
172
+ },
173
+ field.value
174
+ )));
175
+ };
176
+ var renderExtraFields = (extraFields = [], gap) => {
177
+ if (!extraFields.length) return null;
178
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__extra-fields`, style: { gap } }, extraFields.map((field, index) => {
179
+ return /* @__PURE__ */ import_react.default.createElement("div", { key: index, className: `${PREFIX}__extra-field` }, field.icon && /* @__PURE__ */ import_react.default.createElement(
180
+ import_materials.Icon,
181
+ {
182
+ type: field.icon,
183
+ className: `${PREFIX}__extra-field-icon`,
184
+ style: {
185
+ fontSize: field.iconSize,
186
+ color: field.iconColor
187
+ }
188
+ }
189
+ ), field.isShowLabel !== false && field.label && /* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}__extra-field-label` }, field.label, ":"), field.isShowValue !== false && field.value && /* @__PURE__ */ import_react.default.createElement("span", { className: (0, import_classnames.default)(`${PREFIX}__extra-field-value`) }, field.value));
190
+ }));
191
+ };
192
+ var ClientCard = ({
193
+ // 基础配置
194
+ type = "b2",
195
+ direction = "horizontal",
196
+ dataSource,
197
+ fieldNames = {},
198
+ // 样式配置
199
+ style: customStyle = {},
200
+ horizontalGap,
201
+ verticalGap,
202
+ // 显示配置
203
+ isShowAvatar = true,
204
+ isShowName = true,
205
+ isShowPhone = true,
206
+ isShowEmail = true,
207
+ isShowBirthday = true,
208
+ isShowAddress = true,
209
+ isShowTag = true,
210
+ isShowStatus = false,
211
+ isShowEmptyDescription = true,
212
+ // 头像配置
213
+ avatar = {},
214
+ status = {},
215
+ // 下拉菜单
216
+ dropdown,
217
+ // 姓名样式
218
+ defaultName,
219
+ nameStyle = {},
220
+ // 标签配置
221
+ tags = [],
222
+ tag = {},
223
+ // 额外字段
224
+ extraFields = [],
225
+ // 插槽
226
+ slots = {},
227
+ // 事件回调
228
+ onViewClient,
229
+ onAddClient,
230
+ onChangeClient,
231
+ onRemoveClient
232
+ }) => {
233
+ var _a, _b, _c;
234
+ const context = (0, import_useEngineContext.default)();
235
+ import_utils.locales.init(
236
+ import_locales.default,
237
+ ((_c = (_b = (_a = context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.storage) == null ? void 0 : _c.get("umi_locale")) || "en"
238
+ );
239
+ const processed = (0, import_react.useMemo)(() => {
240
+ if (dataSource) {
241
+ return processClientData(dataSource, fieldNames);
242
+ }
243
+ return null;
244
+ }, [dataSource, fieldNames]);
245
+ const translatedExtraFields = (0, import_react.useMemo)(() => {
246
+ const _fields = extraFields.filter((item) => !!item);
247
+ return _fields;
248
+ }, [extraFields]);
249
+ const _dropdownProps = (0, import_react.useMemo)(() => {
250
+ const _props = {
251
+ menu: {
252
+ items: [
253
+ {
254
+ key: "change",
255
+ label: import_utils.locales.getText("pisell2.text.change-client"),
256
+ onClick: () => {
257
+ onChangeClient == null ? void 0 : onChangeClient(dataSource);
258
+ }
259
+ },
260
+ {
261
+ key: "remove",
262
+ label: import_utils.locales.getText("pisell2.text.remove-client"),
263
+ onClick: () => {
264
+ onRemoveClient == null ? void 0 : onRemoveClient(dataSource);
265
+ }
266
+ }
267
+ ]
268
+ }
269
+ };
270
+ if (dropdown && "open" in dropdown) {
271
+ _props.open = dropdown.open;
272
+ }
273
+ return _props;
274
+ }, [dropdown]);
275
+ const isWalkIn = (0, import_utils2.isWalkIn)(processed == null ? void 0 : processed.id);
276
+ if (isWalkIn) {
277
+ const cardStyle2 = {
278
+ ...customStyle,
279
+ gap: horizontalGap
280
+ };
281
+ return /* @__PURE__ */ import_react.default.createElement(
282
+ "div",
283
+ {
284
+ className: (0, import_classnames.default)(PREFIX, `${PREFIX}--empty`),
285
+ ...{ onClick: () => onAddClient == null ? void 0 : onAddClient() },
286
+ style: { ...cardStyle2, cursor: "pointer" }
287
+ },
288
+ /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__content` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__info` }, isShowAvatar && /* @__PURE__ */ import_react.default.createElement(
289
+ import_materials.PisellAvatar,
290
+ {
291
+ icon: avatar.icon ? /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: avatar.icon }) : /* @__PURE__ */ import_react.default.createElement(
292
+ import_icon.User01,
293
+ {
294
+ style: {
295
+ color: "#475467"
296
+ }
297
+ }
298
+ ),
299
+ size: avatar.size
300
+ }
301
+ ), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__details`, style: { gap: verticalGap } }, isShowName && /* @__PURE__ */ import_react.default.createElement(
302
+ import_clientName.default,
303
+ {
304
+ dataSource: defaultName || import_utils.locales.getText("pisell2.text.add-client"),
305
+ style: nameStyle
306
+ }
307
+ ), isShowEmptyDescription && /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__empty-description` }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")))), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__actions` }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}__plugin-icon` }, /* @__PURE__ */ import_react.default.createElement(
308
+ import_icon.PlusCircle,
309
+ {
310
+ style: {
311
+ fontSize: 28,
312
+ color: "#475467"
313
+ }
314
+ }
315
+ ))))
316
+ );
317
+ }
318
+ if (type === "b1") {
319
+ return /* @__PURE__ */ import_react.default.createElement(
320
+ import_line.default,
321
+ {
322
+ dataSource: processed,
323
+ isShowAvatar,
324
+ isShowPhone,
325
+ isShowEmail,
326
+ isShowStatus,
327
+ style: customStyle,
328
+ horizontalGap,
329
+ avatar,
330
+ status,
331
+ nameStyle,
332
+ tags,
333
+ tag,
334
+ slots,
335
+ onViewClient
336
+ }
337
+ );
338
+ }
339
+ const cardStyle = {
340
+ ...customStyle,
341
+ gap: horizontalGap
342
+ };
343
+ const isVertical = direction === "vertical";
344
+ const isInlineTag = tag.placement === "inline";
345
+ const getFieldVisibility = () => {
346
+ switch (type) {
347
+ case "b2":
348
+ return {
349
+ showBirthday: false,
350
+ showAddress: false,
351
+ showExtraFields: false
352
+ };
353
+ case "b5":
354
+ return {
355
+ showBirthday: isShowBirthday,
356
+ showAddress: isShowAddress,
357
+ showExtraFields: false
358
+ };
359
+ case "b9":
360
+ return {
361
+ showBirthday: isShowBirthday,
362
+ showAddress: isShowAddress,
363
+ showExtraFields: true
364
+ };
365
+ default:
366
+ return {
367
+ showBirthday: isShowBirthday,
368
+ showAddress: isShowAddress,
369
+ showExtraFields: true
370
+ };
371
+ }
372
+ };
373
+ const { showBirthday, showAddress, showExtraFields } = getFieldVisibility();
374
+ return /* @__PURE__ */ import_react.default.createElement(
375
+ "div",
376
+ {
377
+ className: (0, import_classnames.default)(PREFIX, `${PREFIX}--${type}`, {
378
+ [`${PREFIX}--vertical`]: isVertical,
379
+ [`${PREFIX}--horizontal`]: !isVertical
380
+ }),
381
+ style: { ...cardStyle, cursor: "pointer" },
382
+ ...{ onClick: () => dataSource && (onViewClient == null ? void 0 : onViewClient(dataSource)) }
383
+ },
384
+ slots.top,
385
+ /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__content` }, slots.left && /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__slot-left` }, slots.left), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__info` }, renderAvatar(processed, avatar, isShowAvatar, isShowStatus, status), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__details`, style: { gap: verticalGap } }, /* @__PURE__ */ import_react.default.createElement(
386
+ "div",
387
+ {
388
+ className: (0, import_classnames.default)(
389
+ `${PREFIX}__name-tags`,
390
+ isInlineTag && `${PREFIX}__name-tags--inline`
391
+ )
392
+ },
393
+ isShowName && /* @__PURE__ */ import_react.default.createElement(
394
+ import_clientName.default,
395
+ {
396
+ dataSource: processed,
397
+ style: nameStyle,
398
+ className: "pisell-client-card__name "
399
+ }
400
+ ),
401
+ isInlineTag && renderTags(processed, isShowTag, tags, tag)
402
+ ), !isInlineTag && renderTags(processed, isShowTag, tags, tag), renderContactInfo(
403
+ processed,
404
+ isShowPhone,
405
+ isShowEmail,
406
+ showBirthday,
407
+ showAddress,
408
+ typeof verticalGap === "number" ? verticalGap : void 0,
409
+ type
410
+ ), showExtraFields && renderExtraFields(
411
+ translatedExtraFields,
412
+ typeof verticalGap === "number" ? verticalGap : void 0
413
+ ))), /* @__PURE__ */ import_react.default.createElement(
414
+ "div",
415
+ {
416
+ className: `${PREFIX}__actions`,
417
+ onClick: (e) => e.stopPropagation()
418
+ },
419
+ /* @__PURE__ */ import_react.default.createElement(
420
+ import_antd.Dropdown,
421
+ {
422
+ trigger: ["click"],
423
+ placement: "bottomRight",
424
+ ..._dropdownProps
425
+ },
426
+ /* @__PURE__ */ import_react.default.createElement(
427
+ import_antd.Button,
428
+ {
429
+ type: "text",
430
+ className: `${PREFIX}__menu-button`,
431
+ size: "large",
432
+ icon: /* @__PURE__ */ import_react.default.createElement(
433
+ import_materials.Icon,
434
+ {
435
+ type: "pisell2-dots-vertical",
436
+ className: `${PREFIX}__menu-button-icon`
437
+ }
438
+ ),
439
+ ...(dropdown == null ? void 0 : dropdown.buttonProps) || {},
440
+ onClick: (e) => {
441
+ var _a2, _b2;
442
+ e.stopPropagation();
443
+ (_b2 = (_a2 = dropdown == null ? void 0 : dropdown.buttonProps) == null ? void 0 : _a2.onClick) == null ? void 0 : _b2.call(_a2, e);
444
+ }
445
+ }
446
+ )
447
+ )
448
+ ), slots.right && /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__slot-right` }, slots.right)),
449
+ slots.bottom
450
+ );
451
+ };
452
+ var clientCard_default = ClientCard;
453
+ // Annotate the CommonJS export names for ESM import in node:
454
+ 0 && (module.exports = {
455
+ PREFIX,
456
+ processClientData
457
+ });