@pisell/private-materials 3.4.43 → 3.4.44

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 (131) 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 +9 -1
  6. package/build/lowcode/preview.js +149 -149
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +8 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  12. package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -2
  13. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
  14. package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  15. package/es/components/appointmentBooking/hooks.d.ts +1 -0
  16. package/es/components/appointmentBooking/hooks.js +30 -30
  17. package/es/components/appointmentBooking/locales.d.ts +3 -0
  18. package/es/components/appointmentBooking/locales.js +9 -6
  19. package/es/components/booking/components/customSelect/index.js +1 -1
  20. package/es/components/booking/components/footer/index.js +4 -1
  21. package/es/components/booking/components/footer/utils.js +75 -73
  22. package/es/components/booking/forms/footer.js +24 -10
  23. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  24. package/es/components/booking/info/client/index.js +28 -13
  25. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
  26. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
  27. package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
  28. package/es/components/booking/info/main.js +3 -2
  29. package/es/components/booking/info/model.js +5 -0
  30. package/es/components/booking/info2/index.js +3 -2
  31. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  32. package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
  33. package/es/components/booking/locales.d.ts +6 -0
  34. package/es/components/booking/locales.js +12 -3
  35. package/es/components/booking/model.d.ts +4 -0
  36. package/es/components/booking/model.js +3 -0
  37. package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
  38. package/es/index.d.ts +2 -0
  39. package/es/index.js +3 -1
  40. package/es/plus/clientName/index.d.ts +4 -0
  41. package/es/plus/clientName/index.js +18 -0
  42. package/es/plus/clientName/index.less +10 -0
  43. package/es/plus/clientName/type.d.ts +13 -0
  44. package/es/plus/clientName/type.js +1 -0
  45. package/es/plus/clientName/utils.d.ts +2 -0
  46. package/es/plus/clientName/utils.js +18 -0
  47. package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  48. package/es/plus/contactInfo/components/Avatar/index.js +30 -0
  49. package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  50. package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
  51. package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
  52. package/es/plus/contactInfo/index.d.ts +6 -0
  53. package/es/plus/contactInfo/index.js +198 -0
  54. package/es/plus/contactInfo/index.less +621 -0
  55. package/es/plus/contactInfo/locales.d.ts +15 -0
  56. package/es/plus/contactInfo/locales.js +14 -0
  57. package/es/plus/contactInfo/types.d.ts +91 -0
  58. package/es/plus/contactInfo/types.js +1 -0
  59. package/es/plus/contactInfo/utils.d.ts +7 -0
  60. package/es/plus/contactInfo/utils.js +50 -0
  61. package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  62. package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
  63. package/es/plus/contactInfoModal/index.d.ts +41 -0
  64. package/es/plus/contactInfoModal/index.js +155 -0
  65. package/es/plus/contactInfoModal/index.less +19 -0
  66. package/es/plus/contactInfoModal/locales.d.ts +66 -0
  67. package/es/plus/contactInfoModal/locales.js +65 -0
  68. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  69. package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -3
  70. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
  71. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  72. package/lib/components/appointmentBooking/hooks.d.ts +1 -0
  73. package/lib/components/appointmentBooking/hooks.js +73 -35
  74. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  75. package/lib/components/appointmentBooking/locales.js +6 -3
  76. package/lib/components/booking/components/customSelect/index.js +1 -1
  77. package/lib/components/booking/components/footer/index.js +4 -1
  78. package/lib/components/booking/components/footer/utils.js +93 -68
  79. package/lib/components/booking/forms/footer.js +29 -11
  80. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  81. package/lib/components/booking/info/client/index.js +14 -1
  82. package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
  83. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
  84. package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
  85. package/lib/components/booking/info/main.js +5 -4
  86. package/lib/components/booking/info/model.js +5 -0
  87. package/lib/components/booking/info2/index.js +5 -4
  88. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  89. package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
  90. package/lib/components/booking/locales.d.ts +6 -0
  91. package/lib/components/booking/locales.js +12 -3
  92. package/lib/components/booking/model.d.ts +4 -0
  93. package/lib/components/booking/model.js +3 -0
  94. package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
  95. package/lib/index.d.ts +2 -0
  96. package/lib/index.js +6 -0
  97. package/lib/plus/clientName/index.d.ts +4 -0
  98. package/lib/plus/clientName/index.js +53 -0
  99. package/lib/plus/clientName/index.less +10 -0
  100. package/lib/plus/clientName/type.d.ts +13 -0
  101. package/lib/plus/clientName/type.js +17 -0
  102. package/lib/plus/clientName/utils.d.ts +2 -0
  103. package/lib/plus/clientName/utils.js +43 -0
  104. package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  105. package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
  106. package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  107. package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
  108. package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
  109. package/lib/plus/contactInfo/index.d.ts +6 -0
  110. package/lib/plus/contactInfo/index.js +226 -0
  111. package/lib/plus/contactInfo/index.less +621 -0
  112. package/lib/plus/contactInfo/locales.d.ts +15 -0
  113. package/lib/plus/contactInfo/locales.js +38 -0
  114. package/lib/plus/contactInfo/types.d.ts +91 -0
  115. package/lib/plus/contactInfo/types.js +17 -0
  116. package/lib/plus/contactInfo/utils.d.ts +7 -0
  117. package/lib/plus/contactInfo/utils.js +64 -0
  118. package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  119. package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
  120. package/lib/plus/contactInfoModal/index.d.ts +41 -0
  121. package/lib/plus/contactInfoModal/index.js +139 -0
  122. package/lib/plus/contactInfoModal/index.less +19 -0
  123. package/lib/plus/contactInfoModal/locales.d.ts +66 -0
  124. package/lib/plus/contactInfoModal/locales.js +89 -0
  125. package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
  126. package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
  127. package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
  128. package/lowcode/contact-info/fragments/textStyle.ts +33 -0
  129. package/lowcode/contact-info/meta.ts +199 -0
  130. package/lowcode/contact-info-modal/meta.ts +98 -0
  131. package/package.json +4 -2
@@ -57,6 +57,7 @@ var import_classnames = __toESM(require("classnames"));
57
57
  var import_useCreateBookingPageHeader = __toESM(require("../hooks/useCreateBookingPageHeader"));
58
58
  var import_locales2 = require("../../../utils/locales");
59
59
  var import_ahooks = require("ahooks");
60
+ var import_contactInfoMode = __toESM(require("./service/contactInfoMode"));
60
61
  var defaultModules = {
61
62
  client: 1,
62
63
  date: 1,
@@ -66,7 +67,7 @@ var defaultModules = {
66
67
  };
67
68
  import_utils.locales.init(import_locales.default, (0, import_locales2.getLocale)());
68
69
  var Info = (0, import_model.Provider)((props) => {
69
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
70
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
70
71
  const { style, globalState, modules = defaultModules, slot } = props;
71
72
  const modal = (0, import_react.useContext)(import_model.Context);
72
73
  const context = (0, import_useEngineContext.default)();
@@ -94,7 +95,7 @@ var Info = (0, import_model.Provider)((props) => {
94
95
  }
95
96
  }, []);
96
97
  (0, import_react.useMemo)(() => {
97
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m;
98
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2;
98
99
  const isFranchisee = (_d2 = (_c2 = (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.businessUtils) == null ? void 0 : _c2.getAppByModal) == null ? void 0 : _d2.call(_c2, "franchisee");
99
100
  modal.dispatch({
100
101
  type: "setState",
@@ -103,7 +104,7 @@ var Info = (0, import_model.Provider)((props) => {
103
104
  ...globalState,
104
105
  isTerminal: (_g2 = (_f2 = (_e2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _e2.utils) == null ? void 0 : _f2.isTerminal) == null ? void 0 : _g2.call(_f2),
105
106
  isFranchisee,
106
- timezone: (_m = (_l2 = (_k2 = (_j2 = (_i2 = (_h2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _h2.utils) == null ? void 0 : _i2.store) == null ? void 0 : _j2.getState()) == null ? void 0 : _k2.global) == null ? void 0 : _l2.globalConfig) == null ? void 0 : _m.timezone
107
+ timezone: (_m2 = (_l2 = (_k2 = (_j2 = (_i2 = (_h2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _h2.utils) == null ? void 0 : _i2.store) == null ? void 0 : _j2.getState()) == null ? void 0 : _k2.global) == null ? void 0 : _l2.globalConfig) == null ? void 0 : _m2.timezone
107
108
  }
108
109
  });
109
110
  }, [globalState]);
@@ -221,7 +222,7 @@ var Info = (0, import_model.Provider)((props) => {
221
222
  ["create-booking-page-info-wrap-create"]: isBookingCreatePageCreateMode
222
223
  })
223
224
  },
224
- /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, createHeader, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_l = modal.state) == null ? void 0 : _l.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, /* @__PURE__ */ import_react.default.createElement(
225
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, createHeader, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, ((_p = (_o = (_n = (_m = (_l = modal == null ? void 0 : modal.state) == null ? void 0 : _l.bookingConfig) == null ? void 0 : _m.config) == null ? void 0 : _n.cart_settings_tab) == null ? void 0 : _o.display_contact_info) == null ? void 0 : _p.show_contact_info) === true ? /* @__PURE__ */ import_react.default.createElement(import_contactInfoMode.default, null) : null, modules.holder && !((_q = modal.state) == null ? void 0 : _q.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, /* @__PURE__ */ import_react.default.createElement(
225
226
  import_antd.Skeleton,
226
227
  {
227
228
  loading: globalState.loading,
@@ -0,0 +1,2 @@
1
+ declare const ContactInfoMode: () => JSX.Element;
2
+ export default ContactInfoMode;
@@ -0,0 +1,111 @@
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/info2/service/contactInfoMode/index.tsx
30
+ var contactInfoMode_exports = {};
31
+ __export(contactInfoMode_exports, {
32
+ default: () => contactInfoMode_default
33
+ });
34
+ module.exports = __toCommonJS(contactInfoMode_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
37
+ var import_contactInfo = __toESM(require("../../../../../plus/contactInfo"));
38
+ var import_model = require("../../../info/model");
39
+ var ContactInfoMode = () => {
40
+ var _a, _b, _c;
41
+ const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
42
+ console.log("state>>>>>>>>>", state);
43
+ (0, import_react.useEffect)(() => {
44
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i;
45
+ console.log("state>>>>>>>>>111", (_a2 = state == null ? void 0 : state.contacts_info) == null ? void 0 : _a2.client_id);
46
+ console.log("state>>>>>>>>>222", (_b2 = state.client.value) == null ? void 0 : _b2.id);
47
+ if (((_c2 = state.client.value) == null ? void 0 : _c2.id) != ((_d = state == null ? void 0 : state.contacts_info) == null ? void 0 : _d.client_id)) {
48
+ const contactInfo = (_f = (_e = state.client.value) == null ? void 0 : _e.contacts_info) == null ? void 0 : _f.value;
49
+ if (!contactInfo) {
50
+ const {
51
+ first_name,
52
+ last_name,
53
+ phone,
54
+ country_calling_code,
55
+ country_code,
56
+ email
57
+ } = ((_g = state.client) == null ? void 0 : _g.value) || {};
58
+ dispatch({
59
+ type: "setContactsInfo",
60
+ payload: {
61
+ value: {
62
+ first_name: first_name || "",
63
+ last_name: last_name || "",
64
+ phone: {
65
+ phone: phone || "",
66
+ country_calling_code: country_calling_code || "",
67
+ country_code: country_code || ""
68
+ },
69
+ email: email || ""
70
+ },
71
+ client_id: (_h = state.client.value) == null ? void 0 : _h.id
72
+ }
73
+ });
74
+ } else {
75
+ dispatch({
76
+ type: "setContactsInfo",
77
+ payload: {
78
+ value: { ...contactInfo || {} },
79
+ client_id: (_i = state.client.value) == null ? void 0 : _i.id
80
+ }
81
+ });
82
+ }
83
+ }
84
+ }, [(_a = state.client.value) == null ? void 0 : _a.id, (_b = state == null ? void 0 : state.contacts_info) == null ? void 0 : _b.client_id]);
85
+ const handleSave = (value) => {
86
+ dispatch({
87
+ type: "setContactsInfo",
88
+ payload: { value, edit: true }
89
+ });
90
+ };
91
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: "24px" } }, /* @__PURE__ */ import_react.default.createElement(
92
+ "div",
93
+ {
94
+ className: "pisell-lowcode__booking-contact-info-title",
95
+ style: { fontSize: "16px", fontWeight: 500, marginBottom: "8px" }
96
+ },
97
+ import_utils.locales.getText("pisell2.booking.text.contact-info.title")
98
+ ), /* @__PURE__ */ import_react.default.createElement(
99
+ import_contactInfo.default,
100
+ {
101
+ dataSource: ((_c = state.contacts_info) == null ? void 0 : _c.value) || null,
102
+ isShowDelete: false,
103
+ isShowAvatar: false,
104
+ isShowPhone: true,
105
+ isShowEmail: true,
106
+ style: { padding: "14px 0 14px 14px" },
107
+ onSave: handleSave
108
+ }
109
+ ));
110
+ };
111
+ var contactInfoMode_default = ContactInfoMode;
@@ -273,6 +273,8 @@ declare const _default: {
273
273
  'pisell2.text.quotation.product.change.title': string;
274
274
  'pisell2.text.quotation.product.change.describe': string;
275
275
  'pisell2.text.form.link.to.another.record.more': string;
276
+ 'pisell2.booking.text.contact-info.title': string;
277
+ 'pisell2.booking.text.search-placeholder': string;
276
278
  };
277
279
  'zh-CN': {
278
280
  'pisell2.text.refunded-amount': string;
@@ -548,6 +550,8 @@ declare const _default: {
548
550
  'pisell2.text.quotation.product.change.title': string;
549
551
  'pisell2.text.quotation.product.change.describe': string;
550
552
  'pisell2.text.form.link.to.another.record.more': string;
553
+ 'pisell2.booking.text.contact-info.title': string;
554
+ 'pisell2.booking.text.search-placeholder': string;
551
555
  };
552
556
  'zh-HK': {
553
557
  'pisell2.text.refunded-amount': string;
@@ -823,6 +827,8 @@ declare const _default: {
823
827
  'pisell2.text.quotation.product.change.title': string;
824
828
  'pisell2.text.quotation.product.change.describe': string;
825
829
  'pisell2.text.form.link.to.another.record.more': string;
830
+ 'pisell2.booking.text.contact-info.title': string;
831
+ 'pisell2.booking.text.search-placeholder': string;
826
832
  };
827
833
  };
828
834
  export default _default;
@@ -334,7 +334,10 @@ var locales_default = {
334
334
  },
335
335
  "pisell2.text.quotation.product.change.title": "Notification",
336
336
  "pisell2.text.quotation.product.change.describe": "Product updates available: Please refresh the following items to load the latest data.",
337
- "pisell2.text.form.link.to.another.record.more": "View More"
337
+ "pisell2.text.form.link.to.another.record.more": "View More",
338
+ // 联系信息
339
+ "pisell2.booking.text.contact-info.title": "Contact info",
340
+ "pisell2.booking.text.search-placeholder": "Search Customers / Contacts"
338
341
  },
339
342
  "zh-CN": {
340
343
  "pisell2.text.refunded-amount": "已退金额",
@@ -641,7 +644,10 @@ var locales_default = {
641
644
  },
642
645
  "pisell2.text.quotation.product.change.title": "提示",
643
646
  "pisell2.text.quotation.product.change.describe": "以下商品信息已更新,请重新编辑相关商品以同步最新数据。",
644
- "pisell2.text.form.link.to.another.record.more": "查看更多"
647
+ "pisell2.text.form.link.to.another.record.more": "查看更多",
648
+ // 联系信息
649
+ "pisell2.booking.text.contact-info.title": "联系信息",
650
+ "pisell2.booking.text.search-placeholder": "搜索客户/联系信息"
645
651
  },
646
652
  "zh-HK": {
647
653
  "pisell2.text.refunded-amount": "已退金額",
@@ -948,6 +954,9 @@ var locales_default = {
948
954
  },
949
955
  "pisell2.text.quotation.product.change.title": "提示",
950
956
  "pisell2.text.quotation.product.change.describe": "以下商品信息已更新,请重新编辑相关商品以同步最新数据。",
951
- "pisell2.text.form.link.to.another.record.more": "查看更多"
957
+ "pisell2.text.form.link.to.another.record.more": "查看更多",
958
+ // 联系信息
959
+ "pisell2.booking.text.contact-info.title": "聯繫信息",
960
+ "pisell2.booking.text.search-placeholder": "搜索客戶/聯系信息"
952
961
  }
953
962
  };
@@ -27,6 +27,10 @@ export interface FormState {
27
27
  };
28
28
  edit: boolean;
29
29
  };
30
+ contacts_info: {
31
+ edit: boolean;
32
+ value: any;
33
+ };
30
34
  date: {
31
35
  value: any;
32
36
  end_date: any;
@@ -57,6 +57,9 @@ var apis = {
57
57
  },
58
58
  getFormData: () => {
59
59
  return [];
60
+ },
61
+ getContactsInfo: () => {
62
+ return null;
60
63
  }
61
64
  };
62
65
  var walkInData = {
@@ -8,7 +8,8 @@
8
8
  .booking-info-create-new,
9
9
  .pisell-lowcode__booking-field-title,
10
10
  .pisell-lowcode__shopping-cart-empty,
11
- .pisell-lowcode__booking-service-clear-btn {
11
+ .pisell-lowcode__booking-service-clear-btn,
12
+ .pisell-lowcode__booking-contact-info-title {
12
13
  color: #ffffff;
13
14
  }
14
15
  }
package/lib/index.d.ts CHANGED
@@ -52,3 +52,5 @@ export { default as PinModal } from './components/pinModal';
52
52
  export { default as PinVerifyModal } from './components/pinVerifyModal';
53
53
  export { OAuthConfig, SaaSAdminAuth, OrgAdminAuth, CustomerAuth, CustomerOAuthConfig, DeviceAuth, POSOperatorAuth, OnlineShopAuth, SaaSManagermentAuth } from './components/authentication/admin';
54
54
  export type { SaaSAdminAuthProps, OrgAdminAuthProps, DeviceAuthProps, POSOperatorAuthProps, CustomerOAuthConfigProps } from './components/authentication/admin';
55
+ export { default as ContactInfo } from './plus/contactInfo';
56
+ export { default as ContactInfoModal } from './plus/contactInfoModal';
package/lib/index.js CHANGED
@@ -43,6 +43,8 @@ __export(src_exports, {
43
43
  BookingPayment: () => import_payments.default,
44
44
  BookingResources: () => import_resources.default,
45
45
  BookingStartTime: () => import_startTime.default,
46
+ ContactInfo: () => import_contactInfo.default,
47
+ ContactInfoModal: () => import_contactInfoModal.default,
46
48
  CustomerAuth: () => import_admin.CustomerAuth,
47
49
  CustomerOAuthConfig: () => import_admin.CustomerOAuthConfig,
48
50
  DeviceAuth: () => import_admin.DeviceAuth,
@@ -146,6 +148,8 @@ var import_saasCreateOrganization = __toESM(require("./plus/saasCreateOrganizati
146
148
  var import_pinModal = __toESM(require("./components/pinModal"));
147
149
  var import_pinVerifyModal = __toESM(require("./components/pinVerifyModal"));
148
150
  var import_admin = require("./components/authentication/admin");
151
+ var import_contactInfo = __toESM(require("./plus/contactInfo"));
152
+ var import_contactInfoModal = __toESM(require("./plus/contactInfoModal"));
149
153
  import_dayjs.default.extend(import_weekday.default);
150
154
  import_dayjs.default.extend(import_localeData.default);
151
155
  // Annotate the CommonJS export names for ESM import in node:
@@ -164,6 +168,8 @@ import_dayjs.default.extend(import_localeData.default);
164
168
  BookingPayment,
165
169
  BookingResources,
166
170
  BookingStartTime,
171
+ ContactInfo,
172
+ ContactInfoModal,
167
173
  CustomerAuth,
168
174
  CustomerOAuthConfig,
169
175
  DeviceAuth,
@@ -0,0 +1,4 @@
1
+ import './index.less';
2
+ import { IClientNameProps } from './type';
3
+ declare const ClientName: ({ className, dataSource, style }: IClientNameProps) => JSX.Element | null;
4
+ export default ClientName;
@@ -0,0 +1,53 @@
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/clientName/index.tsx
30
+ var clientName_exports = {};
31
+ __export(clientName_exports, {
32
+ default: () => clientName_default
33
+ });
34
+ module.exports = __toCommonJS(clientName_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_classnames = __toESM(require("classnames"));
37
+ var import_index = require("./index.less");
38
+ var import_utils = require("./utils");
39
+ var ClientName = ({ className, dataSource, style }) => {
40
+ const name = (0, import_react.useMemo)(() => {
41
+ return (0, import_utils.getClientName)(dataSource);
42
+ }, [dataSource]);
43
+ if (!dataSource) return null;
44
+ return /* @__PURE__ */ import_react.default.createElement(
45
+ "div",
46
+ {
47
+ className: (0, import_classnames.default)("pisell-client-name", className),
48
+ style: style || {}
49
+ },
50
+ name
51
+ );
52
+ };
53
+ var clientName_default = ClientName;
@@ -0,0 +1,10 @@
1
+ .pisell-client-name {
2
+ color: var(--Base-Black, #000);
3
+ font-size: 16px;
4
+ font-style: normal;
5
+ font-weight: 600;
6
+ line-height: 20px;
7
+ white-space: nowrap;
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ }
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export declare type ClientData = {
3
+ display_name?: string;
4
+ nickname?: string;
5
+ first_name?: string;
6
+ last_name?: string;
7
+ [key: string]: any;
8
+ };
9
+ export interface IClientNameProps {
10
+ dataSource?: string | ClientData | null;
11
+ className?: string;
12
+ style?: React.CSSProperties;
13
+ }
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/plus/clientName/type.ts
16
+ var type_exports = {};
17
+ module.exports = __toCommonJS(type_exports);
@@ -0,0 +1,2 @@
1
+ import { ClientData } from './type';
2
+ export declare const getClientName: (dataSource: string | ClientData | null) => string | null;
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/plus/clientName/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ getClientName: () => getClientName
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var getClientName = (dataSource) => {
26
+ if (!dataSource || typeof dataSource === "string") {
27
+ return dataSource;
28
+ }
29
+ const { first_name, last_name, display_name, nickname } = dataSource;
30
+ let finalName = "";
31
+ if (display_name) {
32
+ finalName = display_name;
33
+ } else if (nickname) {
34
+ finalName = nickname;
35
+ } else if (first_name || last_name) {
36
+ finalName = `${first_name} ${last_name}`.trim();
37
+ }
38
+ return finalName;
39
+ };
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ getClientName
43
+ });
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AvatarConfig } from '../../types';
3
+ import '../../index.less';
4
+ interface AvatarProps {
5
+ config?: AvatarConfig;
6
+ name: string;
7
+ cover?: string;
8
+ }
9
+ declare const Avatar: React.FC<AvatarProps>;
10
+ export default Avatar;
@@ -0,0 +1,56 @@
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/contactInfo/components/Avatar/index.tsx
30
+ var Avatar_exports = {};
31
+ __export(Avatar_exports, {
32
+ default: () => Avatar_default
33
+ });
34
+ module.exports = __toCommonJS(Avatar_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_materials = require("@pisell/materials");
37
+ var import_utils = require("../../utils");
38
+ var import__ = require("../../index");
39
+ var import__2 = require("../../index.less");
40
+ var Avatar = (props) => {
41
+ const { config, name, cover } = props;
42
+ const { useTextAvatar, children } = config || {};
43
+ if (useTextAvatar) {
44
+ const text = children || (0, import_utils.getAvatarText)(name);
45
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__avatar-wrapper` }, /* @__PURE__ */ import_react.default.createElement(import_materials.PisellAvatar, { className: `${import__.PREFIX}__avatar`, ...config || {} }, text));
46
+ }
47
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__avatar-wrapper` }, /* @__PURE__ */ import_react.default.createElement(
48
+ import_materials.PisellAvatar,
49
+ {
50
+ className: `${import__.PREFIX}__avatar`,
51
+ ...config || {},
52
+ src: cover || ""
53
+ }
54
+ ));
55
+ };
56
+ var Avatar_default = Avatar;
@@ -0,0 +1,46 @@
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ declare type NativeProps<S extends string = never> = {
4
+ className?: string;
5
+ style?: React.CSSProperties & Partial<Record<S, string>>;
6
+ };
7
+ declare type PropagationEvent = 'click';
8
+ import './index.less';
9
+ declare type SideType = 'left' | 'right';
10
+ export declare type SwipeActionRef = {
11
+ close: () => void;
12
+ show: (side?: SideType) => void;
13
+ };
14
+ declare type ActionColor = 'light' | 'weak' | 'primary' | 'success' | 'warning' | 'danger';
15
+ export declare type Action = {
16
+ key: string | number;
17
+ text: ReactNode;
18
+ color?: ActionColor | string;
19
+ onClick?: (e: React.MouseEvent) => void;
20
+ style?: React.CSSProperties;
21
+ };
22
+ export declare type SwipeActionProps = {
23
+ rightActions?: Action[];
24
+ leftActions?: Action[];
25
+ onAction?: (action: Action, e: React.MouseEvent) => void;
26
+ closeOnTouchOutside?: boolean;
27
+ closeOnAction?: boolean;
28
+ children: ReactNode;
29
+ stopPropagation?: PropagationEvent[];
30
+ onActionsReveal?: (side: SideType) => void;
31
+ onClose?: () => void;
32
+ escapeDom?: string;
33
+ } & NativeProps<'--background'>;
34
+ export declare const SwipeAction: React.ForwardRefExoticComponent<{
35
+ rightActions?: Action[] | undefined;
36
+ leftActions?: Action[] | undefined;
37
+ onAction?: ((action: Action, e: React.MouseEvent) => void) | undefined;
38
+ closeOnTouchOutside?: boolean | undefined;
39
+ closeOnAction?: boolean | undefined;
40
+ children: ReactNode;
41
+ stopPropagation?: "click"[] | undefined;
42
+ onActionsReveal?: ((side: SideType) => void) | undefined;
43
+ onClose?: (() => void) | undefined;
44
+ escapeDom?: string | undefined;
45
+ } & NativeProps<"--background"> & React.RefAttributes<SwipeActionRef>>;
46
+ export {};