@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,142 @@
1
+ // Line类型特有样式 - 行内布局
2
+ .pisell-client-card--line {
3
+ padding: 8px 12px;
4
+ border: 1px solid #e5e7eb;
5
+ border-radius: 6px;
6
+ background: #ffffff;
7
+
8
+ // 内容容器 - 水平布局
9
+ .pisell-client-card__content {
10
+ display: flex;
11
+ align-items: center;
12
+ gap: 12px;
13
+ width: 100%;
14
+ min-width: 0; // 允许flex子元素收缩
15
+ }
16
+
17
+ // 插槽容器
18
+ .pisell-client-card__slot-left {
19
+ display: flex;
20
+ align-items: center;
21
+ flex-shrink: 0;
22
+ }
23
+
24
+ .pisell-client-card__slot-right {
25
+ display: flex;
26
+ align-items: center;
27
+ flex-shrink: 0;
28
+ }
29
+
30
+ // 头像样式
31
+ .pisell-client-card__avatar-wrapper {
32
+ position: relative;
33
+ flex-shrink: 0; // 头像不收缩
34
+ }
35
+
36
+ .pisell-client-card__avatar {
37
+ border: 1px solid #e5e7eb;
38
+
39
+ .ant-avatar-string {
40
+ font-weight: 600;
41
+ font-size: 12px;
42
+ }
43
+ }
44
+
45
+ // 状态指示器
46
+ .pisell-client-card__status-indicator {
47
+ position: absolute;
48
+ top: -2px;
49
+ right: -2px;
50
+ width: 8px;
51
+ height: 8px;
52
+ border-radius: 50%;
53
+ border: 2px solid #ffffff;
54
+ background-color: #17B26A;
55
+ }
56
+
57
+ // 客户名称样式
58
+ .pisell-client-card__name--line {
59
+ font-size: 14px;
60
+ font-weight: 500;
61
+ color: #1f2937;
62
+ white-space: nowrap;
63
+ overflow: hidden;
64
+ text-overflow: ellipsis;
65
+ flex-shrink: 1;
66
+ min-width: 0;
67
+ }
68
+
69
+ // 联系方式样式
70
+ .pisell-client-card__contact--line {
71
+ font-size: 13px;
72
+ color: #6b7280;
73
+ white-space: nowrap;
74
+ overflow: hidden;
75
+ text-overflow: ellipsis;
76
+ flex-shrink: 1;
77
+ min-width: 0;
78
+ }
79
+
80
+ // 标签容器样式
81
+ .pisell-client-card__tags--line {
82
+ display: flex;
83
+ gap: 6px;
84
+ flex-shrink: 0; // 标签不收缩
85
+ align-items: center;
86
+
87
+ .pisell-client-card__tag {
88
+ white-space: nowrap;
89
+ }
90
+ }
91
+
92
+ // 垂直布局样式
93
+ &.pisell-client-card--vertical {
94
+ .pisell-client-card__content {
95
+ flex-direction: column;
96
+ align-items: center;
97
+ text-align: center;
98
+ gap: 16px;
99
+ }
100
+
101
+ .pisell-client-card__name--line {
102
+ text-align: center;
103
+ }
104
+
105
+ .pisell-client-card__contact--line {
106
+ text-align: center;
107
+ }
108
+
109
+ .pisell-client-card__tags--line {
110
+ justify-content: center;
111
+ flex-wrap: wrap;
112
+ }
113
+ }
114
+
115
+ // Line类型空状态样式
116
+ &.pisell-client-card--empty {
117
+ cursor: pointer;
118
+ justify-content: center;
119
+ align-items: center;
120
+ border-style: dashed;
121
+ border-color: #d9d9d9;
122
+ background: #fafafa;
123
+
124
+ &:hover {
125
+ border-color: #1890ff;
126
+ background: #f0f8ff;
127
+ }
128
+
129
+ .pisell-client-card__empty-title {
130
+ font-size: 14px;
131
+ font-weight: 600;
132
+ color: #374151;
133
+ margin: 0;
134
+ }
135
+
136
+ .pisell-client-card__empty-subtitle {
137
+ font-size: 12px;
138
+ color: #6b7280;
139
+ margin: 0;
140
+ }
141
+ }
142
+ }
@@ -0,0 +1,18 @@
1
+ declare const _default: {
2
+ en: {
3
+ 'pisell2.text.add-client': string;
4
+ 'pisell2.text.change-client': string;
5
+ 'pisell2.text.remove-client': string;
6
+ };
7
+ 'zh-CN': {
8
+ 'pisell2.text.add-client': string;
9
+ 'pisell2.text.change-client': string;
10
+ 'pisell2.text.remove-client': string;
11
+ };
12
+ 'zh-HK': {
13
+ 'pisell2.text.add-client': string;
14
+ 'pisell2.text.change-client': string;
15
+ 'pisell2.text.remove-client': string;
16
+ };
17
+ };
18
+ export default _default;
@@ -0,0 +1,41 @@
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/clientCard/locales.ts
20
+ var locales_exports = {};
21
+ __export(locales_exports, {
22
+ default: () => locales_default
23
+ });
24
+ module.exports = __toCommonJS(locales_exports);
25
+ var locales_default = {
26
+ en: {
27
+ "pisell2.text.add-client": "Add Customer",
28
+ "pisell2.text.change-client": "Change Customer",
29
+ "pisell2.text.remove-client": " Remove Customer"
30
+ },
31
+ "zh-CN": {
32
+ "pisell2.text.add-client": "添加客户",
33
+ "pisell2.text.change-client": "更换客户",
34
+ "pisell2.text.remove-client": "移除客户"
35
+ },
36
+ "zh-HK": {
37
+ "pisell2.text.add-client": "新增客戶",
38
+ "pisell2.text.change-client": "更換客戶",
39
+ "pisell2.text.remove-client": "移除客戶"
40
+ }
41
+ };
@@ -0,0 +1,135 @@
1
+ import React, { ReactElement } from 'react';
2
+ export interface ClientData {
3
+ id: number;
4
+ shop_id: number;
5
+ display_name?: string;
6
+ nickname?: string;
7
+ email?: string;
8
+ phone?: string;
9
+ country_calling_code?: string;
10
+ channel?: string;
11
+ created_at: string;
12
+ updated_at: string;
13
+ waiver_form?: any;
14
+ avatar?: string;
15
+ birthday?: string;
16
+ address?: string;
17
+ tags?: string[];
18
+ [key: string]: any;
19
+ }
20
+ export declare type CardType = 'b1' | 'b2' | 'b5' | 'b9';
21
+ export declare type Direction = 'horizontal' | 'vertical';
22
+ export declare type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | number | string;
23
+ export declare type AvatarShape = 'circle' | 'square';
24
+ export interface AvatarConfig {
25
+ icon?: string;
26
+ shape?: AvatarShape;
27
+ borderRadius?: number | string;
28
+ size?: AvatarSize;
29
+ useTextAvatar?: boolean;
30
+ children?: string;
31
+ }
32
+ export interface StatusConfig {
33
+ color?: string;
34
+ }
35
+ export interface NameStyle {
36
+ fontSize?: number | string;
37
+ fontWeight?: number | string;
38
+ color?: string;
39
+ textDecoration?: string;
40
+ }
41
+ export interface TagItem {
42
+ children: string;
43
+ color: string;
44
+ }
45
+ export interface TagConfig {
46
+ placement?: 'separate' | 'inline';
47
+ flexWrap?: 'nowrap' | 'wrap';
48
+ gap?: number | string;
49
+ }
50
+ export interface ExtraField {
51
+ label?: string;
52
+ value?: string;
53
+ isShowLabel?: boolean;
54
+ isShowValue?: boolean;
55
+ icon?: string;
56
+ iconSize?: number;
57
+ iconColor?: string;
58
+ }
59
+ export interface Slots {
60
+ top?: React.ReactNode;
61
+ bottom?: React.ReactNode;
62
+ left?: React.ReactNode;
63
+ right?: React.ReactNode;
64
+ }
65
+ export interface StyleConfig {
66
+ width?: number | string;
67
+ border?: 'solid' | 'unset';
68
+ borderWidth?: number | string;
69
+ borderColor?: string;
70
+ borderRadius?: number | string;
71
+ padding?: number | string;
72
+ [key: string]: any;
73
+ }
74
+ export interface FieldNames {
75
+ id?: string | ((data: any) => any);
76
+ name?: string | ((data: any) => any);
77
+ cover?: string | ((data: any) => any);
78
+ phone?: string | ((data: any) => any);
79
+ email?: string | ((data: any) => any);
80
+ birthday?: string | ((data: any) => any);
81
+ address?: string | ((data: any) => any);
82
+ tags?: string | ((data: any) => any);
83
+ [key: string]: string | ((data: any) => any) | undefined;
84
+ }
85
+ export interface DisplayConfig {
86
+ isShowAvatar?: boolean;
87
+ isShowName?: boolean;
88
+ isShowPhone?: boolean;
89
+ isShowEmail?: boolean;
90
+ isShowBirthday?: boolean;
91
+ isShowAddress?: boolean;
92
+ isShowTag?: boolean;
93
+ isShowStatus?: boolean;
94
+ isShowEmptyDescription?: boolean;
95
+ }
96
+ export interface ClientCardProps extends DisplayConfig {
97
+ type?: CardType;
98
+ direction?: Direction;
99
+ dataSource?: ClientData | any;
100
+ fieldNames?: FieldNames;
101
+ style?: StyleConfig;
102
+ horizontalGap?: number | string;
103
+ verticalGap?: number | string;
104
+ avatar?: AvatarConfig;
105
+ status?: StatusConfig;
106
+ dropdown?: {
107
+ open?: boolean;
108
+ buttonProps?: {
109
+ icon?: ReactElement;
110
+ onClick?: (e: Event) => void;
111
+ style?: React.CSSProperties;
112
+ };
113
+ };
114
+ defaultName?: string;
115
+ nameStyle?: NameStyle;
116
+ tags?: Array<TagItem | string>;
117
+ tag?: TagConfig;
118
+ extraFields?: ExtraField[];
119
+ slots?: Slots;
120
+ onAddClient?: () => void;
121
+ onChangeClient?: (data: ClientData) => void;
122
+ onRemoveClient?: (data: ClientData) => void;
123
+ onViewClient?: (data: ClientData) => void;
124
+ }
125
+ export interface ProcessedClientData {
126
+ id: any;
127
+ name: string;
128
+ cover?: string;
129
+ phone?: string;
130
+ email?: string;
131
+ birthday?: string;
132
+ address?: string;
133
+ tags?: string[];
134
+ [key: string]: any;
135
+ }
@@ -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/clientCard/types.ts
16
+ var types_exports = {};
17
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,8 @@
1
+ interface FieldMapping<T = any, R = any> {
2
+ [key: string]: string | ((data: T) => R) | undefined;
3
+ }
4
+ export declare function getFieldValue<T, R = any>(data: T, fieldKey: string): R | undefined;
5
+ export declare function getFieldValue<T, R = any>(data: T, fieldKey: string, mapping: FieldMapping<T, R>): R | undefined;
6
+ export declare const getAvatarText: (name: string) => string;
7
+ export declare const isWalkIn: (customer_id?: number | string) => boolean;
8
+ export {};
@@ -0,0 +1,75 @@
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/clientCard/utils.ts
20
+ var utils_exports = {};
21
+ __export(utils_exports, {
22
+ getAvatarText: () => getAvatarText,
23
+ getFieldValue: () => getFieldValue,
24
+ isWalkIn: () => isWalkIn
25
+ });
26
+ module.exports = __toCommonJS(utils_exports);
27
+ var import_lodash = require("lodash");
28
+ function getFieldValue(data, fieldKey, mapping) {
29
+ if (!fieldKey || typeof fieldKey !== "string") {
30
+ console.warn("getFieldValue: fieldKey must be a non-empty string");
31
+ return void 0;
32
+ }
33
+ if (!data || typeof data !== "object") {
34
+ console.warn("getFieldValue: data must be a valid object");
35
+ return void 0;
36
+ }
37
+ const fieldMapping = mapping || {};
38
+ const mappingRule = fieldMapping[fieldKey];
39
+ try {
40
+ if (typeof mappingRule === "function") {
41
+ return mappingRule(data);
42
+ }
43
+ if (typeof mappingRule === "string") {
44
+ return (0, import_lodash.get)(data, mappingRule);
45
+ }
46
+ return (0, import_lodash.get)(data, fieldKey);
47
+ } catch (error) {
48
+ console.error(
49
+ `getFieldValue: Error processing field '${fieldKey}':`,
50
+ error
51
+ );
52
+ return void 0;
53
+ }
54
+ }
55
+ var getAvatarText = (name) => {
56
+ if (!name) return "";
57
+ const words = name.trim().split(/\s+/);
58
+ const initials = words.slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
59
+ return initials;
60
+ };
61
+ var isWalkIn = (customer_id) => {
62
+ if (customer_id === void 0) {
63
+ return true;
64
+ }
65
+ if (typeof customer_id === "string") {
66
+ return ["", "0", "1"].includes(customer_id);
67
+ }
68
+ return [0, 1].includes(customer_id);
69
+ };
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ getAvatarText,
73
+ getFieldValue,
74
+ isWalkIn
75
+ });
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DateSectionCom: ({ value, onChange, showTime, className, style, useSpace, format, itemStyle, }: any) => React.JSX.Element;
3
+ export default DateSectionCom;
@@ -0,0 +1,256 @@
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/clinetSearch/Add/BirthdayField/index.tsx
30
+ var BirthdayField_exports = {};
31
+ __export(BirthdayField_exports, {
32
+ default: () => BirthdayField_default
33
+ });
34
+ module.exports = __toCommonJS(BirthdayField_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_debounce = __toESM(require("lodash/debounce"));
38
+ var import_dayjs = __toESM(require("dayjs"));
39
+ var import_utils = require("@pisell/utils");
40
+ var { Option } = import_antd.Select;
41
+ var getSelectInput = (id) => {
42
+ const input = document.getElementById(id);
43
+ if (input) {
44
+ return input;
45
+ }
46
+ };
47
+ var setSelectInputType = ({
48
+ input,
49
+ type
50
+ }) => {
51
+ if (input) {
52
+ input.type = type;
53
+ }
54
+ };
55
+ var DateSectionCom = ({
56
+ value,
57
+ onChange,
58
+ showTime,
59
+ className = "",
60
+ style = {},
61
+ useSpace = true,
62
+ format,
63
+ itemStyle = {
64
+ width: 100
65
+ }
66
+ }) => {
67
+ const currentYear = (0, import_dayjs.default)().year();
68
+ const locale = import_utils.locales.locale;
69
+ const dayRef = (0, import_react.useRef)(null);
70
+ const monthRef = (0, import_react.useRef)(null);
71
+ const yearRef = (0, import_react.useRef)(null);
72
+ const [date, setDate] = (0, import_react.useState)({
73
+ year: value ? (0, import_dayjs.default)(value).year() : null,
74
+ month: value ? (0, import_dayjs.default)(value).month() + 1 : null,
75
+ day: value ? (0, import_dayjs.default)(value).date() : null
76
+ });
77
+ const [dayOptions, setDayOptions] = (0, import_react.useState)([]);
78
+ const [monthOptions, setMonthOptions] = (0, import_react.useState)([]);
79
+ const [yearOptions, setYearOptions] = (0, import_react.useState)([]);
80
+ const localeMap = {
81
+ year: import_utils.locales.getText("pisell2.text.date-year-text"),
82
+ month: import_utils.locales.getText("pisell2.text.date-month-text"),
83
+ day: import_utils.locales.getText("pisell2.text.date-day-text")
84
+ };
85
+ (0, import_react.useEffect)(() => {
86
+ setDate({
87
+ year: value ? (0, import_dayjs.default)(value).year() : null,
88
+ month: value ? (0, import_dayjs.default)(value).month() + 1 : null,
89
+ day: value ? (0, import_dayjs.default)(value).date() : null
90
+ });
91
+ }, [value]);
92
+ (0, import_react.useEffect)(() => {
93
+ setMonthOptions(renderOptions("month", 1, 12));
94
+ setYearOptions(renderOptions("year", currentYear - 100, currentYear + 50));
95
+ }, []);
96
+ (0, import_react.useEffect)(() => {
97
+ setDayOptions(
98
+ renderOptions(
99
+ "day",
100
+ 1,
101
+ date.month ? getDaysInMonth(date.year || currentYear, date.month) : 31
102
+ )
103
+ );
104
+ }, [date.month, date.year]);
105
+ const handleDateChange = (field, value2) => {
106
+ if (!value2) {
107
+ return;
108
+ }
109
+ let newDate = {
110
+ year: date.year,
111
+ month: date.month,
112
+ day: date.day,
113
+ [field]: value2
114
+ };
115
+ const foucsList = {
116
+ day: monthRef,
117
+ month: yearRef
118
+ };
119
+ if (field === "month" || field === "year") {
120
+ const daysInMonth = getDaysInMonth(
121
+ (newDate == null ? void 0 : newDate.year) || currentYear,
122
+ newDate == null ? void 0 : newDate.month
123
+ );
124
+ const newDay = (newDate == null ? void 0 : newDate.day) > daysInMonth ? daysInMonth : newDate.day;
125
+ newDate = {
126
+ ...newDate,
127
+ day: newDay
128
+ };
129
+ }
130
+ setDate(newDate);
131
+ if (foucsList[field]) {
132
+ foucsList[field].current.focus();
133
+ } else {
134
+ yearRef.current.blur();
135
+ }
136
+ const _format = format || "YYYY-MM-DD";
137
+ if (newDate.year && newDate.month && newDate.day) {
138
+ const _date = `${newDate.year}-${newDate.month.toString().padStart(2, "0")}-${newDate.day.toString().padStart(2, "0")}`;
139
+ onChange((0, import_dayjs.default)(_date).format(_format));
140
+ }
141
+ };
142
+ const getDaysInMonth = (year, month) => {
143
+ return (0, import_dayjs.default)(`${year}-${month}`, "YYYY-MM").daysInMonth();
144
+ };
145
+ const renderOptions = (field, start, end) => {
146
+ const options = [];
147
+ const _text = locale !== "en-US" && locale !== "en" ? localeMap[field] : "";
148
+ for (let i = start; i <= end; i++) {
149
+ options.push({
150
+ label: `${i}${_text}`,
151
+ value: i
152
+ });
153
+ }
154
+ return options;
155
+ };
156
+ const selectId = (0, import_react.useMemo)(() => {
157
+ return {
158
+ dayId: (0, import_utils.getUniqueId)("day"),
159
+ monthId: (0, import_utils.getUniqueId)("month"),
160
+ yearId: (0, import_utils.getUniqueId)("year")
161
+ };
162
+ }, []);
163
+ (0, import_react.useLayoutEffect)(() => {
164
+ setSelectInputType({
165
+ input: getSelectInput(selectId.dayId),
166
+ type: "number"
167
+ });
168
+ setSelectInputType({
169
+ input: getSelectInput(selectId.monthId),
170
+ type: "number"
171
+ });
172
+ setSelectInputType({
173
+ input: getSelectInput(selectId.yearId),
174
+ type: "number"
175
+ });
176
+ }, [selectId]);
177
+ const handleDateSearch = (0, import_react.useCallback)(
178
+ (0, import_debounce.default)((field, value2) => {
179
+ const dateOption = {
180
+ day: dayOptions,
181
+ month: monthOptions,
182
+ year: yearOptions
183
+ };
184
+ const _value = Number(value2);
185
+ const index = dateOption[field].findIndex((item) => {
186
+ return item.value === _value;
187
+ });
188
+ if (index !== -1) {
189
+ handleDateChange(field, _value);
190
+ } else {
191
+ handleDateChange(field, null);
192
+ }
193
+ }, 300),
194
+ [dayOptions, monthOptions, yearOptions, date]
195
+ );
196
+ const content = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
197
+ import_antd.Select,
198
+ {
199
+ id: selectId.dayId,
200
+ value: date.day,
201
+ placeholder: import_utils.locales.getText("pisell2.text.date-day-text"),
202
+ onChange: (value2) => handleDateChange("day", value2),
203
+ style: itemStyle,
204
+ showSearch: true,
205
+ onSearch: (value2) => {
206
+ handleDateSearch("day", value2);
207
+ },
208
+ ref: dayRef,
209
+ size: "large"
210
+ },
211
+ dayOptions.map((item) => {
212
+ return /* @__PURE__ */ import_react.default.createElement(Option, { key: item.value, value: item.value }, item.label);
213
+ })
214
+ ), /* @__PURE__ */ import_react.default.createElement(
215
+ import_antd.Select,
216
+ {
217
+ id: selectId.monthId,
218
+ value: date.month,
219
+ placeholder: import_utils.locales.getText("pisell2.text.date-month-text"),
220
+ onChange: (value2) => handleDateChange("month", value2),
221
+ style: itemStyle,
222
+ showSearch: true,
223
+ onSearch: (value2) => {
224
+ handleDateSearch("month", value2);
225
+ },
226
+ ref: monthRef,
227
+ size: "large"
228
+ },
229
+ monthOptions.map((item) => {
230
+ return /* @__PURE__ */ import_react.default.createElement(Option, { key: item.value, value: item.value }, item.label);
231
+ })
232
+ ), /* @__PURE__ */ import_react.default.createElement(
233
+ import_antd.Select,
234
+ {
235
+ id: selectId.yearId,
236
+ value: date.year,
237
+ placeholder: import_utils.locales.getText("pisell2.text.date-year-text"),
238
+ onChange: (value2) => handleDateChange("year", value2),
239
+ style: itemStyle,
240
+ showSearch: true,
241
+ onSearch: (value2) => {
242
+ handleDateSearch("year", value2);
243
+ },
244
+ ref: yearRef,
245
+ size: "large"
246
+ },
247
+ yearOptions.map((item) => {
248
+ return /* @__PURE__ */ import_react.default.createElement(Option, { key: item.value, value: item.value }, item.label);
249
+ })
250
+ ));
251
+ if (useSpace) {
252
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: className || "", style: style || {} }, content);
253
+ }
254
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: className || "", style: style || {} }, content);
255
+ };
256
+ var BirthdayField_default = DateSectionCom;