@pisell/private-materials 3.0.53 → 3.0.54

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.
@@ -27,7 +27,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
27
27
 
28
28
  import React, { useContext, useEffect, useMemo, useState, useRef } from "react";
29
29
  import SearchLg from "@pisell/icon/es/SearchLg";
30
- import { Input, Button, Skeleton } from "antd";
30
+ import { Input, Button, Skeleton, Modal } from "antd";
31
31
  import Drawer from "../components/drawer";
32
32
  import TabPane from "../components/tabPane";
33
33
  import { Context, Provider } from "./model";
@@ -129,6 +129,10 @@ var Addons = Provider(function (props) {
129
129
  setSearch = _useState6[1];
130
130
  var searchRef = useRef();
131
131
  var context = useEngineContext();
132
+ var _Modal$useModal = Modal.useModal(),
133
+ _Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
134
+ modal = _Modal$useModal2[0],
135
+ contextHolder = _Modal$useModal2[1];
132
136
  var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
133
137
  isTerminal = _ref.isTerminal,
134
138
  interaction = _ref.interaction;
@@ -414,6 +418,13 @@ var Addons = Provider(function (props) {
414
418
  }
415
419
  });
416
420
  }
421
+ if (state.channelDisabledEdit) {
422
+ modal.warning({
423
+ okText: locales.getText("pisell2.text.ok"),
424
+ content: locales.getText("pisell2.text.terminal-edit-message")
425
+ });
426
+ return;
427
+ }
417
428
  getProducts();
418
429
  setSearch("");
419
430
  dispatch({
@@ -443,9 +454,7 @@ var Addons = Provider(function (props) {
443
454
  if (state.disabledEdit) {
444
455
  return [];
445
456
  }
446
- if (state.channelDisabledEdit) {
447
- return [];
448
- }
457
+
449
458
  // 添加按钮
450
459
  var arr = [/*#__PURE__*/React.createElement(Button, {
451
460
  className: "pisell-lowcode__booking-footer-buttons-item",
@@ -579,6 +588,6 @@ var Addons = Provider(function (props) {
579
588
  list: renderList,
580
589
  amountSymbol: state.amountSymbol,
581
590
  onChange: handleAddProduct
582
- })))))));
591
+ })))))), contextHolder);
583
592
  });
584
593
  export default Addons;
@@ -200,7 +200,11 @@ var Info = function Info() {
200
200
  case 3:
201
201
  data = _context3.sent;
202
202
  setLoading(false);
203
- setDefaultService(data === null || data === void 0 ? void 0 : data.list);
203
+
204
+ // 只有自动获取列表的时候才设置商品, 手动点击添加按钮的时候不设置
205
+ if (!state.service.addModal) {
206
+ setDefaultService(data === null || data === void 0 ? void 0 : data.list);
207
+ }
204
208
  dispatch({
205
209
  type: "setService",
206
210
  payload: {
@@ -145,6 +145,8 @@ declare const _default: {
145
145
  'pisell2.text.payment-link': string;
146
146
  'pisell2.text.send-mail': string;
147
147
  'pisell2.text.copy-to-clipboard': string;
148
+ 'pisell2.text.ok': string;
149
+ 'pisell2.text.terminal-edit-message': string;
148
150
  };
149
151
  'zh-CN': {
150
152
  'pisell2.text.refunded-amount': string;
@@ -292,6 +294,8 @@ declare const _default: {
292
294
  'pisell2.text.payment-link': string;
293
295
  'pisell2.text.send-mail': string;
294
296
  'pisell2.text.copy-to-clipboard': string;
297
+ 'pisell2.text.ok': string;
298
+ 'pisell2.text.terminal-edit-message': string;
295
299
  };
296
300
  'zh-HK': {
297
301
  'pisell2.text.refunded-amount': string;
@@ -439,6 +443,8 @@ declare const _default: {
439
443
  'pisell2.text.payment-link': string;
440
444
  'pisell2.text.send-mail': string;
441
445
  'pisell2.text.copy-to-clipboard': string;
446
+ 'pisell2.text.ok': string;
447
+ 'pisell2.text.terminal-edit-message': string;
442
448
  };
443
449
  };
444
450
  export default _default;
@@ -159,7 +159,9 @@ export default {
159
159
  "pisell2.text.stock": "Stock",
160
160
  'pisell2.text.payment-link': "Payment link",
161
161
  'pisell2.text.send-mail': "Send mail",
162
- 'pisell2.text.copy-to-clipboard': "Copy to clipboard"
162
+ 'pisell2.text.copy-to-clipboard': "Copy to clipboard",
163
+ 'pisell2.text.ok': "OK",
164
+ 'pisell2.text.terminal-edit-message': "This operation cannot be performed. To proceed, please use the Pisell Terminal."
163
165
  },
164
166
  'zh-CN': {
165
167
  'pisell2.text.refunded-amount': '已退金额',
@@ -326,7 +328,9 @@ export default {
326
328
  "pisell2.text.stock": "库存",
327
329
  'pisell2.text.payment-link': "付款链接",
328
330
  'pisell2.text.send-mail': "发送邮件",
329
- 'pisell2.text.copy-to-clipboard': "复制到剪切板"
331
+ 'pisell2.text.copy-to-clipboard': "复制到剪切板",
332
+ 'pisell2.text.ok': "好的",
333
+ 'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用请至Pisell 终端设备操作。"
330
334
  },
331
335
  'zh-HK': {
332
336
  'pisell2.text.refunded-amount': '已退金額',
@@ -493,6 +497,8 @@ export default {
493
497
  "pisell2.text.stock": "庫存",
494
498
  'pisell2.text.payment-link': "付款鏈接",
495
499
  'pisell2.text.send-mail': "發送郵件",
496
- 'pisell2.text.copy-to-clipboard': "複製到剪切板"
500
+ 'pisell2.text.copy-to-clipboard': "複製到剪切板",
501
+ 'pisell2.text.ok': "好的",
502
+ 'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用請至Pisell 終端設備操作。"
497
503
  }
498
504
  };
@@ -127,6 +127,7 @@ var Addons = (0, import_model.Provider)((props) => {
127
127
  const [search, setSearch] = (0, import_react.useState)("");
128
128
  const searchRef = (0, import_react.useRef)();
129
129
  const context = (0, import_useEngineContext.default)();
130
+ const [modal, contextHolder] = import_antd.Modal.useModal();
130
131
  const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
131
132
  (0, import_react.useEffect)(() => {
132
133
  dispatch({
@@ -312,6 +313,13 @@ var Addons = (0, import_model.Provider)((props) => {
312
313
  }
313
314
  });
314
315
  }
316
+ if (state.channelDisabledEdit) {
317
+ modal.warning({
318
+ okText: import_utils3.locales.getText("pisell2.text.ok"),
319
+ content: import_utils3.locales.getText("pisell2.text.terminal-edit-message")
320
+ });
321
+ return;
322
+ }
315
323
  getProducts();
316
324
  setSearch("");
317
325
  dispatch({
@@ -331,9 +339,6 @@ var Addons = (0, import_model.Provider)((props) => {
331
339
  if (state.disabledEdit) {
332
340
  return [];
333
341
  }
334
- if (state.channelDisabledEdit) {
335
- return [];
336
- }
337
342
  let arr = [
338
343
  /* @__PURE__ */ import_react.default.createElement(
339
344
  import_antd.Button,
@@ -477,7 +482,7 @@ var Addons = (0, import_model.Provider)((props) => {
477
482
  )
478
483
  ))
479
484
  ))
480
- ));
485
+ ), contextHolder);
481
486
  });
482
487
  var addons_default = Addons;
483
488
  // Annotate the CommonJS export names for ESM import in node:
@@ -132,7 +132,9 @@ var Info = () => {
132
132
  }
133
133
  });
134
134
  setLoading(false);
135
- setDefaultService(data == null ? void 0 : data.list);
135
+ if (!state.service.addModal) {
136
+ setDefaultService(data == null ? void 0 : data.list);
137
+ }
136
138
  dispatch({
137
139
  type: "setService",
138
140
  payload: {
@@ -145,6 +145,8 @@ declare const _default: {
145
145
  'pisell2.text.payment-link': string;
146
146
  'pisell2.text.send-mail': string;
147
147
  'pisell2.text.copy-to-clipboard': string;
148
+ 'pisell2.text.ok': string;
149
+ 'pisell2.text.terminal-edit-message': string;
148
150
  };
149
151
  'zh-CN': {
150
152
  'pisell2.text.refunded-amount': string;
@@ -292,6 +294,8 @@ declare const _default: {
292
294
  'pisell2.text.payment-link': string;
293
295
  'pisell2.text.send-mail': string;
294
296
  'pisell2.text.copy-to-clipboard': string;
297
+ 'pisell2.text.ok': string;
298
+ 'pisell2.text.terminal-edit-message': string;
295
299
  };
296
300
  'zh-HK': {
297
301
  'pisell2.text.refunded-amount': string;
@@ -439,6 +443,8 @@ declare const _default: {
439
443
  'pisell2.text.payment-link': string;
440
444
  'pisell2.text.send-mail': string;
441
445
  'pisell2.text.copy-to-clipboard': string;
446
+ 'pisell2.text.ok': string;
447
+ 'pisell2.text.terminal-edit-message': string;
442
448
  };
443
449
  };
444
450
  export default _default;
@@ -177,7 +177,9 @@ var locales_default = {
177
177
  "pisell2.text.stock": "Stock",
178
178
  "pisell2.text.payment-link": "Payment link",
179
179
  "pisell2.text.send-mail": "Send mail",
180
- "pisell2.text.copy-to-clipboard": "Copy to clipboard"
180
+ "pisell2.text.copy-to-clipboard": "Copy to clipboard",
181
+ "pisell2.text.ok": "OK",
182
+ "pisell2.text.terminal-edit-message": "This operation cannot be performed. To proceed, please use the Pisell Terminal."
181
183
  },
182
184
  "zh-CN": {
183
185
  "pisell2.text.refunded-amount": "已退金额",
@@ -338,7 +340,9 @@ var locales_default = {
338
340
  "pisell2.text.stock": "库存",
339
341
  "pisell2.text.payment-link": "付款链接",
340
342
  "pisell2.text.send-mail": "发送邮件",
341
- "pisell2.text.copy-to-clipboard": "复制到剪切板"
343
+ "pisell2.text.copy-to-clipboard": "复制到剪切板",
344
+ "pisell2.text.ok": "好的",
345
+ "pisell2.text.terminal-edit-message": "此操作不可使用,如需使用请至Pisell 终端设备操作。"
342
346
  },
343
347
  "zh-HK": {
344
348
  "pisell2.text.refunded-amount": "已退金額",
@@ -499,6 +503,8 @@ var locales_default = {
499
503
  "pisell2.text.stock": "庫存",
500
504
  "pisell2.text.payment-link": "付款鏈接",
501
505
  "pisell2.text.send-mail": "發送郵件",
502
- "pisell2.text.copy-to-clipboard": "複製到剪切板"
506
+ "pisell2.text.copy-to-clipboard": "複製到剪切板",
507
+ "pisell2.text.ok": "好的",
508
+ "pisell2.text.terminal-edit-message": "此操作不可使用,如需使用請至Pisell 終端設備操作。"
503
509
  }
504
510
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.53",
3
+ "version": "3.0.54",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",