@pisell/private-materials 6.2.32 → 6.2.34

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 (79) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +11 -11
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/booking/components/footer/index.js +15 -5
  12. package/es/components/booking/components/footer/index.less +23 -0
  13. package/es/components/booking/components/tabPane/index.less +3 -3
  14. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  15. package/es/components/booking/info/service/Lists.d.ts +0 -1
  16. package/es/components/booking/info/service/Lists.js +1 -1
  17. package/es/components/booking/info/service2/utils.js +18 -17
  18. package/es/components/booking/info2/cartClientCard/index.js +60 -67
  19. package/es/components/booking/info2/service/editService/index.js +66 -10
  20. package/es/components/booking/info2/service/editService/index.less +47 -11
  21. package/es/components/booking/locales.js +4 -4
  22. package/es/components/booking/materiels/startTime/index.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/store/index.d.ts +1 -1
  26. package/es/components/productSelect/components/productGroup/index.js +2 -2
  27. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  28. package/es/components/shoppingCart/components/Cart/Product.js +4 -3
  29. package/es/components/ticketBooking/components/timeBar/index.js +4 -1
  30. package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +23 -18
  31. package/es/components/ticketBooking/locales.js +3 -0
  32. package/es/plus/clientCard/locales.js +2 -2
  33. package/es/plus/clientName/index.d.ts +0 -1
  34. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  35. package/es/plus/clinetSearch/index.d.ts +0 -1
  36. package/es/plus/clinetSearch/index.js +6 -6
  37. package/es/plus/clinetSearch/index.less +4 -0
  38. package/es/pro/comprehensiveSearch/index.d.ts +1 -3
  39. package/es/pro/comprehensiveSearch/index.js +18 -49
  40. package/es/pro/comprehensiveSearch/index.less +1 -6
  41. package/es/pro/comprehensiveSearch/types.d.ts +2 -1
  42. package/es/pro/skuDetailModal/index.js +21 -7
  43. package/es/pro/skuDetailModal/index.less +40 -0
  44. package/lib/components/booking/components/footer/index.js +16 -9
  45. package/lib/components/booking/components/footer/index.less +23 -0
  46. package/lib/components/booking/components/tabPane/index.less +3 -3
  47. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  48. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  49. package/lib/components/booking/info/service/Lists.js +1 -1
  50. package/lib/components/booking/info/service2/utils.js +12 -11
  51. package/lib/components/booking/info2/cartClientCard/index.js +23 -31
  52. package/lib/components/booking/info2/service/editService/index.js +105 -31
  53. package/lib/components/booking/info2/service/editService/index.less +47 -11
  54. package/lib/components/booking/locales.js +4 -4
  55. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  56. package/lib/components/eftposPay/amount.d.ts +1 -1
  57. package/lib/components/eftposPay/device.d.ts +1 -1
  58. package/lib/components/eftposPay/store/index.d.ts +1 -1
  59. package/lib/components/productSelect/components/productGroup/index.js +1 -1
  60. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  61. package/lib/components/shoppingCart/components/Cart/Product.js +4 -3
  62. package/lib/components/ticketBooking/components/timeBar/index.js +1 -1
  63. package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +23 -12
  64. package/lib/components/ticketBooking/locales.js +12 -3
  65. package/lib/plus/clientCard/locales.js +2 -2
  66. package/lib/plus/clientName/index.d.ts +0 -1
  67. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  68. package/lib/plus/clinetSearch/index.d.ts +0 -1
  69. package/lib/plus/clinetSearch/index.js +6 -7
  70. package/lib/plus/clinetSearch/index.less +4 -0
  71. package/lib/pro/comprehensiveSearch/index.d.ts +1 -3
  72. package/lib/pro/comprehensiveSearch/index.js +12 -23
  73. package/lib/pro/comprehensiveSearch/index.less +1 -6
  74. package/lib/pro/comprehensiveSearch/types.d.ts +2 -1
  75. package/lib/pro/skuDetailModal/index.js +22 -6
  76. package/lib/pro/skuDetailModal/index.less +40 -0
  77. package/package.json +4 -4
  78. package/es/pro/comprehensiveSearch/camera.svg +0 -4
  79. package/lib/pro/comprehensiveSearch/camera.svg +0 -4
@@ -2,13 +2,12 @@
2
2
  padding: 24px 32px 100px !important;
3
3
  }
4
4
 
5
-
6
5
  .pisell-lowcode__booking-service-body-edit-footer {
7
6
  position: absolute;
8
7
  bottom: 0;
9
8
  left: 0;
10
9
  width: 100%;
11
- border-top: 1px solid #E7E8E9;
10
+ border-top: 1px solid #e7e8e9;
12
11
  padding: 20px 32px;
13
12
  display: flex;
14
13
  align-items: center;
@@ -16,12 +15,19 @@
16
15
  gap: 12px;
17
16
  background-color: #fff;
18
17
 
18
+ .pisell-lowcode__booking-service-body-edit-footer-left {
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 12px;
22
+ width: fit-content;
23
+ }
24
+
19
25
  .pisell-lowcode__booking-service-delete-wrap {
20
26
  height: 48px;
21
27
  width: 48px;
22
28
  border-radius: 8px;
23
- border: 1px solid var(--gray-300, #D0D5DD);
24
- background: var(--base-white, #FFF);
29
+ border: 1px solid var(--gray-300, #d0d5dd);
30
+ background: var(--base-white, #fff);
25
31
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
26
32
  cursor: pointer;
27
33
  display: flex;
@@ -29,11 +35,42 @@
29
35
  justify-content: center;
30
36
 
31
37
  .pisell-lowcode__booking-service-delete-icon {
32
- color: #B42318;
38
+ color: #b42318;
33
39
  font-size: 20px;
34
40
  }
35
41
  }
36
42
 
43
+ .pisell-lowcode__booking-service-buttons-item {
44
+ height: 48px;
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ flex: 1;
49
+ position: relative;
50
+
51
+ &.note-button {
52
+ .note-indicator {
53
+ position: absolute;
54
+ top: 0; // 不使用负数偏移
55
+ right: 0; // 不使用负数偏移
56
+ transform: translate(12%, -12%); // 向外溢出约 2-3px
57
+ width: 24px;
58
+ height: 24px;
59
+ border-radius: 50%;
60
+ background-color: #7f56da; // 紫色
61
+ color: #fff;
62
+ font-weight: 700;
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ line-height: 1;
67
+ font-size: 30px;
68
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
69
+ pointer-events: none;
70
+ }
71
+ }
72
+ }
73
+
37
74
  .pisell-lowcode__booking-service-body-edit-footer-apple {
38
75
  flex: 1;
39
76
  height: 48px;
@@ -46,14 +83,12 @@
46
83
  .pisell-lowcode-select-selection-item {
47
84
  .resource-option {
48
85
  padding-left: 0;
49
-
50
86
  }
51
87
  }
52
88
 
53
89
  .pisell-lowcode-select-item-option-content {
54
90
  .resource-option {
55
91
  padding-left: 0;
56
-
57
92
  }
58
93
  }
59
94
 
@@ -63,7 +98,7 @@
63
98
  gap: 8px;
64
99
 
65
100
  .resource-option-alert-icon {
66
- color: #B42318;
101
+ color: #b42318;
67
102
  cursor: pointer;
68
103
  }
69
104
  }
@@ -72,7 +107,7 @@
72
107
  min-height: 40px;
73
108
  cursor: pointer;
74
109
  background-color: #ffffff;
75
- border: 1px solid #D0D5DD;
110
+ border: 1px solid #d0d5dd;
76
111
  border-radius: 10px;
77
112
  transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
78
113
  overflow: hidden;
@@ -90,10 +125,11 @@
90
125
  flex: 1;
91
126
  }
92
127
 
93
- .current-service-info-change-btn {}
128
+ .current-service-info-change-btn {
129
+ }
94
130
  }
95
131
 
96
132
  &:hover {
97
133
  border-color: #7f56d9;
98
134
  }
99
- }
135
+ }
@@ -51,7 +51,7 @@ export default {
51
51
  'pisell2.text.enroll.detail': 'Details',
52
52
  'pisell2.text.add-products-successfully': 'Add products successfully',
53
53
  'pisell2.text.add': 'Add',
54
- 'pisell2.text.created-successfully': 'Appointment created',
54
+ 'pisell2.text.created-successfully': 'Order saved. You can find it in Order List.',
55
55
  'pisell2.text.edit-successfully': 'Edited successfully',
56
56
  'pisell2.text.updated': ' updated',
57
57
  'pisell2.text.appointment-updated': 'Appointment updated',
@@ -285,7 +285,7 @@ export default {
285
285
  'pisell2.action-buttons.no-items-to-adjust': 'No items in cart to adjust price.',
286
286
  'pisell2.action-buttons.adjust-order-price': 'Adjust Order Price',
287
287
  'pisell2.action-buttons.price-adjusted-success': 'Order price adjusted successfully.',
288
- 'pisell2.action-buttons.clear-success': 'Clear Success',
288
+ 'pisell2.action-buttons.clear-success': 'Cart Cleared',
289
289
  'pisell2.text.manual-price-adjustment': 'Discount',
290
290
  // Customise Item Modal
291
291
  'pisell2.customise-item.modal-title': 'Create and Add Customise (Once-off) Item',
@@ -410,7 +410,7 @@ export default {
410
410
  'pisell2.text.refund-amount': '退款金额',
411
411
  //
412
412
  'pisell2.text.add': '添加',
413
- 'pisell2.text.created-successfully': '预约已创建',
413
+ 'pisell2.text.created-successfully': '订单已保存。您可以在订单列表中找到它。',
414
414
  'pisell2.text.edit-successfully': '编辑成功',
415
415
  'pisell2.text.appointment-updated': '预约已更新',
416
416
  'pisell2.text.updated': '已更新',
@@ -764,7 +764,7 @@ export default {
764
764
  'pisell2.text.add-products-successfully': '添加商品成功',
765
765
  //
766
766
  'pisell2.text.add': '添加',
767
- 'pisell2.text.created-successfully': '預約已創建',
767
+ 'pisell2.text.created-successfully': '訂單已保存。 您可以在訂單清單中找到它。',
768
768
  'pisell2.text.edit-successfully': '編輯成功',
769
769
  'pisell2.text.appointment-updated': '預約已更新',
770
770
  'pisell2.text.updated': '已更新',
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from "antd";
3
2
  interface StartTimeProps extends SelectProps {
4
3
  locale?: string;
@@ -8,7 +8,7 @@ import { PosProps } from './const';
8
8
  */
9
9
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
10
10
  className?: string | undefined;
11
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -10,7 +10,7 @@ import './device.less';
10
10
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
11
11
  api: PayProps['api'];
12
12
  className?: string | undefined;
13
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
13
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
14
  [keys: string]: unknown;
15
15
  } | undefined, other?: any) => void) | undefined;
16
16
  onClose: () => void;
@@ -295,7 +295,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
298
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
300
  eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
@@ -1,7 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import GridLayout from "../gridLayout";
4
- import { locales } from '@pisell/utils';
4
+ import { image as imageAli, locales } from '@pisell/utils';
5
5
  import { Skeleton } from 'antd';
6
6
  import Decimal from 'decimal.js';
7
7
  import "./index.less";
@@ -108,7 +108,7 @@ var ProductGroup = function ProductGroup(_ref) {
108
108
  }
109
109
  }, item.cover ? /*#__PURE__*/React.createElement("img", {
110
110
  loading: "lazy",
111
- src: item.cover,
111
+ src: imageAli.ali(item.cover, 360),
112
112
  style: {
113
113
  borderRadius: radius
114
114
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ProductProps } from '../../type';
3
2
  declare const Product: (props: ProductProps) => JSX.Element;
4
3
  export default Product;
@@ -61,7 +61,8 @@ var Product = function Product(props) {
61
61
  var conf = productCardStyleConfig["".concat(type, "_product_card_style")];
62
62
  return {
63
63
  isShowImage: conf === null || conf === void 0 ? void 0 : conf.show_product_image,
64
- isShowDelete: conf === null || conf === void 0 ? void 0 : conf.show_remove_button
64
+ isShowDelete: conf === null || conf === void 0 ? void 0 : conf.show_remove_button,
65
+ disabledEdit: true
65
66
  };
66
67
  });
67
68
  return useMemo(function () {
@@ -73,10 +74,10 @@ var Product = function Product(props) {
73
74
  var isRetail;
74
75
  if (state.scenario === 'booking2') {
75
76
  isRetail = isNormalProductByDurationSchedule(item === null || item === void 0 ? void 0 : item._origin);
76
- Comp = isRetail ? ProductCard.V2 : ProductCard;
77
+ Comp = ProductCard.V2;
77
78
  }
78
79
  return /*#__PURE__*/React.createElement(Comp, _extends({
79
- type: isRetail ? 'a2' : undefined,
80
+ type: isRetail ? 'a2' : 'a5',
80
81
  rightActions: [{
81
82
  key: 'update_number',
82
83
  text: /*#__PURE__*/React.createElement(PisellNumberSelector, {
@@ -59,7 +59,10 @@ var TimeBar = function TimeBar(props) {
59
59
  return useMemo(function () {
60
60
  var _state$modalState4, _state$modalState5;
61
61
  return /*#__PURE__*/React.createElement("div", {
62
- className: "pisell-ticket-booking-time-bar"
62
+ className: "pisell-ticket-booking-time-bar",
63
+ style: {
64
+ backgroundColor: state.isDateChange ? "#F79009" : ""
65
+ }
63
66
  }, /*#__PURE__*/React.createElement(Button, {
64
67
  icon: /*#__PURE__*/React.createElement(LeftOutlined, null),
65
68
  onClick: _onClickPre,
@@ -16,7 +16,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  import { useState, useEffect } from 'react';
17
17
  import { useBookingTicket } from "./bookingTicket";
18
18
  import { usePisellOS } from "../../../../hooks/useEngineContext";
19
- import { useMemoizedFn } from "ahooks";
19
+ import { useMemoizedFn } from 'ahooks';
20
20
  export var useCustomer = function useCustomer(props) {
21
21
  var bookingTicket = useBookingTicket();
22
22
  var pisellos = usePisellOS();
@@ -127,22 +127,25 @@ export var useCustomer = function useCustomer(props) {
127
127
  case 0:
128
128
  keyword = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : '';
129
129
  _context2.prev = 1;
130
- _context2.next = 4;
130
+ setLoading(true);
131
+ _context2.next = 5;
131
132
  return bookingTicket.resetAndLoadCustomers({
132
133
  search: keyword || undefined
133
134
  });
134
- case 4:
135
- _context2.next = 9;
135
+ case 5:
136
+ _context2.next = 10;
136
137
  break;
137
- case 6:
138
- _context2.prev = 6;
138
+ case 7:
139
+ _context2.prev = 7;
139
140
  _context2.t0 = _context2["catch"](1);
140
141
  console.error('初始化加载失败:', _context2.t0);
141
- case 9:
142
+ case 10:
143
+ setLoading(false);
144
+ case 11:
142
145
  case "end":
143
146
  return _context2.stop();
144
147
  }
145
- }, _callee2, null, [[1, 6]]);
148
+ }, _callee2, null, [[1, 7]]);
146
149
  })));
147
150
 
148
151
  // 加载更多
@@ -157,23 +160,25 @@ export var useCustomer = function useCustomer(props) {
157
160
  return _context3.abrupt("return");
158
161
  case 2:
159
162
  setLoadingMore(true);
160
- _context3.prev = 3;
161
- _context3.next = 6;
163
+ setLoading(true);
164
+ _context3.prev = 4;
165
+ _context3.next = 7;
162
166
  return bookingTicket.loadMoreCustomers();
163
- case 6:
164
- _context3.next = 11;
167
+ case 7:
168
+ _context3.next = 12;
165
169
  break;
166
- case 8:
167
- _context3.prev = 8;
168
- _context3.t0 = _context3["catch"](3);
170
+ case 9:
171
+ _context3.prev = 9;
172
+ _context3.t0 = _context3["catch"](4);
169
173
  console.error('加载更多失败:', _context3.t0);
170
- case 11:
171
- setLoadingMore(false);
172
174
  case 12:
175
+ setLoading(false);
176
+ setLoadingMore(false);
177
+ case 14:
173
178
  case "end":
174
179
  return _context3.stop();
175
180
  }
176
- }, _callee3, null, [[3, 8]]);
181
+ }, _callee3, null, [[4, 9]]);
177
182
  })));
178
183
 
179
184
  // 切换分页
@@ -56,6 +56,7 @@ export default {
56
56
  },
57
57
  'pisell2.product.card.subtotal': 'Subtotal',
58
58
  'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
59
+ if (hour === 0 && minute === 0) return "".concat(minute, "min");
59
60
  return "".concat(hour > 0 ? "".concat(hour, "h") : '').concat(hour > 0 && minute > 0 ? ' ' : '').concat(minute > 0 ? "".concat(minute, "min") : '');
60
61
  },
61
62
  'pisell2.product.card.day': function pisell2ProductCardDay(val) {
@@ -127,6 +128,7 @@ export default {
127
128
  return "\u5DF2\u6709".concat(number, "\u4EF6");
128
129
  },
129
130
  'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
131
+ if (hour === 0 && minute === 0) return "".concat(minute, "\u5206\u949F");
130
132
  return "".concat(hour > 0 ? "".concat(hour, "\u5C0F\u65F6") : '').concat(minute > 0 ? "".concat(minute, "\u5206\u949F") : '');
131
133
  },
132
134
  'pisell2.product.card.day': function pisell2ProductCardDay(val) {
@@ -198,6 +200,7 @@ export default {
198
200
  },
199
201
  'pisell2.product.card.subtotal': '小計',
200
202
  'pisell2.product.card.hour.minute': function pisell2ProductCardHourMinute(hour, minute) {
203
+ if (hour === 0 && minute === 0) return "".concat(minute, "\u5206\u9418");
201
204
  return "".concat(hour > 0 ? "".concat(hour, "\u5C0F\u6642") : '').concat(minute > 0 ? "".concat(minute, "\u5206\u9418") : '');
202
205
  },
203
206
  'pisell2.product.card.day': function pisell2ProductCardDay(val) {
@@ -7,11 +7,11 @@ export default {
7
7
  'zh-CN': {
8
8
  'pisell2.text.add-client': '添加客户',
9
9
  'pisell2.text.change-client': '更换客户',
10
- 'pisell2.text.remove-client': '移除客戶'
10
+ 'pisell2.text.remove-client': '移除客户'
11
11
  },
12
12
  'zh-HK': {
13
13
  'pisell2.text.add-client': '新增客戶',
14
14
  'pisell2.text.change-client': '更換客戶',
15
- 'pisell2.text.remove-client': '移除客户'
15
+ 'pisell2.text.remove-client': '移除客戶'
16
16
  }
17
17
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { IClientNameProps } from './type';
4
3
  declare const ClientName: ({ className, dataSource, style }: IClientNameProps) => JSX.Element | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PhoneField: ({ value, onChange }: any) => JSX.Element;
3
2
  export default PhoneField;
@@ -11,7 +11,6 @@ interface ClientSearchProps extends Omit<ComprehensiveSearchProps, 'resultDispla
11
11
  onLoadMore?: () => void;
12
12
  }
13
13
  export declare type ClientSearchRef = {
14
- setSearchKeyword: (keyword: string) => void;
15
14
  resetScrollPosition: () => void;
16
15
  };
17
16
  declare const ClientSearch: React.ForwardRefExoticComponent<ClientSearchProps & React.RefAttributes<ClientSearchRef>>;
@@ -93,7 +93,10 @@ var ClientSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
93
93
  }
94
94
  }, /*#__PURE__*/React.createElement(InfiniteScroll, {
95
95
  dataLength: searchResults.length,
96
- next: onLoadMore || function () {},
96
+ next: function next() {
97
+ console.log('loading more');
98
+ onLoadMore === null || onLoadMore === void 0 || onLoadMore();
99
+ },
97
100
  hasMore: hasMore || false,
98
101
  style: {
99
102
  width: '100%'
@@ -111,7 +114,8 @@ var ClientSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
111
114
  color: '#999'
112
115
  }
113
116
  }, searchResults !== null && searchResults !== void 0 && searchResults.length ? locales.getText('pisell2.text.no-more-data') : null),
114
- scrollableTarget: "client-search_infinite-scroll"
117
+ scrollableTarget: "client-search_infinite-scroll",
118
+ scrollThreshold: '180px'
115
119
  }, /*#__PURE__*/React.createElement(List, {
116
120
  dataSource: searchResults,
117
121
  renderItem: function renderItem(item, index) {
@@ -183,10 +187,6 @@ var ClientSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
183
187
  };
184
188
  useImperativeHandle(ref, function () {
185
189
  return {
186
- setSearchKeyword: function setSearchKeyword(keyword) {
187
- var _comprehensiveSearchR, _comprehensiveSearchR2;
188
- (_comprehensiveSearchR = comprehensiveSearchRef.current) === null || _comprehensiveSearchR === void 0 || (_comprehensiveSearchR2 = _comprehensiveSearchR.setSearchKeyword) === null || _comprehensiveSearchR2 === void 0 || _comprehensiveSearchR2.call(_comprehensiveSearchR, keyword);
189
- },
190
190
  resetScrollPosition: function resetScrollPosition() {
191
191
  if (scrollContainerRef.current) {
192
192
  scrollContainerRef.current.scrollTop = 0;
@@ -26,6 +26,10 @@
26
26
  padding-right: 16px;
27
27
  color: rgba(0, 0, 0, 0.85);
28
28
  font-size: 14px;
29
+ word-break: keep-all;
30
+ overflow: hidden;
31
+ word-wrap: normal;
32
+ text-overflow: ellipsis;
29
33
  }
30
34
  }
31
35
 
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { ComprehensiveSearchProps, SearchResult } from './types';
3
3
  import './index.less';
4
- export declare type ComprehensiveSearchRef = {
5
- setSearchKeyword: (keyword: string) => void;
6
- };
4
+ export declare type ComprehensiveSearchRef = {};
7
5
  declare const ComprehensiveSearch: React.ForwardRefExoticComponent<ComprehensiveSearchProps & React.RefAttributes<ComprehensiveSearchRef>>;
8
6
  export default ComprehensiveSearch;
9
7
  export type { ComprehensiveSearchProps, SearchResult };
@@ -1,4 +1,4 @@
1
- var _excluded = ["dataSource", "isShowScanner", "isShowCamera", "isShowNFC", "isShowNewButton", "newButtonAlign", "newButtonText", "renderType", "containerProps", "isShowSearch", "isShowSearchCamera", "searchIcon", "placeholder", "isShowSearchButton", "resultDisplay", "resultSort", "style", "loading", "onSearchTextChange", "onSearch", "onAdd", "onRowClick"];
1
+ var _excluded = ["dataSource", "isShowScanner", "isShowCamera", "isShowNFC", "isShowNewButton", "newButtonAlign", "newButtonText", "renderType", "containerProps", "isShowSearch", "isShowSearchCamera", "searchIcon", "placeholder", "isShowSearchButton", "resultDisplay", "resultSort", "style", "loading", "keyword", "onKeywordChange", "onSearch", "onAdd", "onRowClick"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -17,15 +17,15 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
19
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
- import React, { forwardRef, useImperativeHandle, useState } from 'react';
20
+ import React, { forwardRef, useImperativeHandle } from 'react';
21
21
  import { Button, Input, Empty, Spin } from 'antd';
22
22
  import { PisellContainer, Iconfont } from '@pisell/materials';
23
23
  import { PlusCircle } from '@pisell/icon';
24
24
  import { locales } from '@pisell/utils';
25
+ import { useControllableValue } from 'ahooks';
25
26
  import useEngineContext from "../../hooks/useEngineContext";
26
27
  import useTerminalPeripherals from "./hooks/useTerminalPeripherals";
27
28
  import useNativeScanner from "./hooks/useNativeScanner";
28
- import Camera from "./camera.svg";
29
29
  import localeTexts from "./locales";
30
30
  import "./index.less";
31
31
  import classNames from 'classnames';
@@ -62,15 +62,20 @@ var ComprehensiveSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
62
62
  resultSort = _ref$resultSort === void 0 ? 'asc' : _ref$resultSort,
63
63
  style = _ref.style,
64
64
  loading = _ref.loading,
65
- onSearchTextChange = _ref.onSearchTextChange,
65
+ keyword = _ref.keyword,
66
+ onKeywordChange = _ref.onKeywordChange,
66
67
  onSearch = _ref.onSearch,
67
68
  onAdd = _ref.onAdd,
68
69
  onRowClick = _ref.onRowClick,
69
70
  props = _objectWithoutProperties(_ref, _excluded);
70
- var _useState = useState(''),
71
- _useState2 = _slicedToArray(_useState, 2),
72
- searchValue = _useState2[0],
73
- setSearchValue = _useState2[1];
71
+ var _useControllableValue = useControllableValue({
72
+ value: keyword,
73
+ onChange: onKeywordChange,
74
+ defaultValue: ''
75
+ }),
76
+ _useControllableValue2 = _slicedToArray(_useControllableValue, 2),
77
+ searchValue = _useControllableValue2[0],
78
+ setSearchValue = _useControllableValue2[1];
74
79
  var _useTerminalPeriphera = useTerminalPeripherals(),
75
80
  peripheralsStatus = _useTerminalPeriphera.peripheralsStatus;
76
81
  var _useNativeScanner = useNativeScanner(),
@@ -78,38 +83,6 @@ var ComprehensiveSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
78
83
  isTerminal = _useNativeScanner.isTerminal;
79
84
  var context = useEngineContext();
80
85
  locales.init(localeTexts, ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.storage) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.get('umi_locale')) || 'en');
81
- function checkCameraAvailability() {
82
- return _checkCameraAvailability.apply(this, arguments);
83
- }
84
- function _checkCameraAvailability() {
85
- _checkCameraAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
86
- var devices, hasCamera;
87
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
88
- while (1) switch (_context2.prev = _context2.next) {
89
- case 0:
90
- _context2.prev = 0;
91
- _context2.next = 3;
92
- return navigator.mediaDevices.enumerateDevices();
93
- case 3:
94
- devices = _context2.sent;
95
- hasCamera = devices.some(function (device) {
96
- return device.kind === 'videoinput';
97
- });
98
- return _context2.abrupt("return", hasCamera);
99
- case 8:
100
- _context2.prev = 8;
101
- _context2.t0 = _context2["catch"](0);
102
- console.error('Error checking camera availability:', _context2.t0);
103
- case 11:
104
- return _context2.abrupt("return", false);
105
- case 12:
106
- case "end":
107
- return _context2.stop();
108
- }
109
- }, _callee2, null, [[0, 8]]);
110
- }));
111
- return _checkCameraAvailability.apply(this, arguments);
112
- }
113
86
  var handleSearch = /*#__PURE__*/function () {
114
87
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
115
88
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -137,7 +110,6 @@ var ComprehensiveSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
137
110
  var handleInputChange = function handleInputChange(e) {
138
111
  var value = e.target.value;
139
112
  setSearchValue(value);
140
- onSearchTextChange === null || onSearchTextChange === void 0 || onSearchTextChange(value);
141
113
  };
142
114
  var handleAdd = function handleAdd() {
143
115
  onAdd === null || onAdd === void 0 || onAdd();
@@ -185,11 +157,7 @@ var ComprehensiveSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
185
157
  }, locales.getText('pisell2.text.search')))));
186
158
  };
187
159
  useImperativeHandle(ref, function () {
188
- return {
189
- setSearchKeyword: function setSearchKeyword(keyword) {
190
- setSearchValue(keyword);
191
- }
192
- };
160
+ return {};
193
161
  });
194
162
  var renderResults = function renderResults() {
195
163
  if ( /*#__PURE__*/React.isValidElement(resultDisplay)) {
@@ -271,7 +239,8 @@ var ComprehensiveSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
271
239
  var getTopRowLayout = function getTopRowLayout() {
272
240
  var newButton = /*#__PURE__*/React.createElement(Button, {
273
241
  className: "comprehensive-search__new-button",
274
- onClick: handleAdd
242
+ onClick: handleAdd,
243
+ type: "primary"
275
244
  }, newButtonText || locales.getText('pisell2.text.new-client'), /*#__PURE__*/React.createElement(PlusCircle, {
276
245
  style: {
277
246
  fontSize: 20
@@ -293,8 +262,8 @@ var ComprehensiveSearch = /*#__PURE__*/forwardRef(function (_ref, ref) {
293
262
  className: "status-indicator"
294
263
  }, stautsIndicator((peripheralsStatus === null || peripheralsStatus === void 0 ? void 0 : peripheralsStatus.nfc) === 'connected'))), isShowCamera && /*#__PURE__*/React.createElement("span", {
295
264
  className: "comprehensive-search__icon-button"
296
- }, /*#__PURE__*/React.createElement("img", {
297
- src: Camera
265
+ }, /*#__PURE__*/React.createElement(Iconfont, {
266
+ type: "pisell2-camera"
298
267
  }), /*#__PURE__*/React.createElement("div", {
299
268
  className: "status-indicator"
300
269
  }, stautsIndicator(isTerminal))));
@@ -37,12 +37,7 @@
37
37
  line-height: 20px;
38
38
  word-wrap: break-word;
39
39
  height: 40px;
40
- color: #6941c6;
41
- border-color: #e9d7fe;
42
-
43
- &:hover {
44
- background-color: #f9f5ff;
45
- }
40
+ color: #fff;
46
41
  }
47
42
 
48
43
  &__icon-group {
@@ -20,7 +20,8 @@ export interface ComprehensiveSearchProps {
20
20
  sortBy?: string;
21
21
  style?: React.CSSProperties;
22
22
  loading?: boolean;
23
- onSearchTextChange?: (value: string) => void;
23
+ keyword?: string;
24
+ onKeywordChange?: (value: string) => void;
24
25
  onSearch?: (value: string) => void;
25
26
  onAdd?: () => void;
26
27
  onDataChange?: (data: any) => void;