@pisell/materials 1.0.961 → 1.0.962

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 (69) 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 +148 -148
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +24 -20
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +26 -22
  11. package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +18 -5
  12. package/es/components/page/index.js +4 -2
  13. package/es/components/pisellWalletPassCard/index.js +80 -62
  14. package/es/components/pisellWalletPassCard/index.less +95 -33
  15. package/es/components/table/index.js +1 -1
  16. package/es/components/virtualInput/index.js +0 -1
  17. package/es/components/walletCard/index.js +61 -6
  18. package/es/components/walletCard/index.less +62 -2
  19. package/es/locales/en-US.js +6 -11
  20. package/es/locales/zh-CN.js +6 -11
  21. package/es/locales/zh-TW.js +6 -11
  22. package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +20 -10
  23. package/lib/components/page/index.js +3 -2
  24. package/lib/components/pisellWalletPassCard/index.js +62 -31
  25. package/lib/components/pisellWalletPassCard/index.less +95 -33
  26. package/lib/components/table/index.js +1 -1
  27. package/lib/components/virtualInput/index.js +0 -8
  28. package/lib/components/walletCard/index.js +57 -4
  29. package/lib/components/walletCard/index.less +62 -2
  30. package/lib/locales/en-US.js +3 -11
  31. package/lib/locales/zh-CN.js +3 -11
  32. package/lib/locales/zh-TW.js +3 -11
  33. package/package.json +2 -2
  34. package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -25
  35. package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -12
  36. package/es/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +0 -4
  37. package/es/components/page/index.d.ts +0 -6
  38. package/es/components/pisellCardList/index.d.ts +0 -107
  39. package/es/components/pisellGoodPassCard/index.d.ts +0 -50
  40. package/es/components/pisellQRScanner/index.d.ts +0 -24
  41. package/es/components/pisellQrcode/index.d.ts +0 -10
  42. package/es/components/pisellText/components/Editable/index.d.ts +0 -29
  43. package/es/components/pisellText/index.d.ts +0 -9
  44. package/es/components/pisellWalletPassCard/index.d.ts +0 -140
  45. package/es/components/productCard/index.d.ts +0 -7
  46. package/es/components/select/index.d.ts +0 -9
  47. package/es/components/sortableList/index.d.ts +0 -11
  48. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +0 -7
  49. package/es/components/table/serve.d.ts +0 -13
  50. package/es/components/tabs/index.d.ts +0 -17
  51. package/es/index.d.ts +0 -146
  52. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -25
  53. package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -12
  54. package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +0 -4
  55. package/lib/components/page/index.d.ts +0 -6
  56. package/lib/components/pisellCardList/index.d.ts +0 -107
  57. package/lib/components/pisellGoodPassCard/index.d.ts +0 -50
  58. package/lib/components/pisellQRScanner/index.d.ts +0 -24
  59. package/lib/components/pisellQrcode/index.d.ts +0 -10
  60. package/lib/components/pisellText/components/Editable/index.d.ts +0 -29
  61. package/lib/components/pisellText/index.d.ts +0 -9
  62. package/lib/components/pisellWalletPassCard/index.d.ts +0 -140
  63. package/lib/components/productCard/index.d.ts +0 -7
  64. package/lib/components/select/index.d.ts +0 -9
  65. package/lib/components/sortableList/index.d.ts +0 -11
  66. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +0 -7
  67. package/lib/components/table/serve.d.ts +0 -13
  68. package/lib/components/tabs/index.d.ts +0 -17
  69. package/lib/index.d.ts +0 -146
@@ -15,16 +15,23 @@ var defaultCustomizer = function defaultCustomizer(objValue, srcValue) {
15
15
  };
16
16
  var VARIABLE_PATTERN = /{{([^}]+)}}/g;
17
17
  var VariablesProvider = function VariablesProvider(props) {
18
- var _context$appHelper;
18
+ var _context$engine, _context$appHelper;
19
19
  var children = props.children,
20
- variables = props.variables;
20
+ variables = props.variables,
21
+ config = props.config;
21
22
  var context = useEngineContext();
23
+
24
+ // 获取 disabledHistoryListener 参数,如果为 true 则不监听 history
25
+ var disabledHistoryListener = config !== null && config !== void 0 ? config : context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 || (_context$engine = _context$engine.variablesConfig) === null || _context$engine === void 0 ? void 0 : _context$engine.disabledHistoryListener;
22
26
  var _ref = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
23
27
  getApp = _ref.getApp;
24
28
 
25
29
  // 在组件创建时就初始化 URL 参数
26
30
  var initialQuery = useMemo(function () {
27
31
  var _getApp;
32
+ if (disabledHistoryListener) {
33
+ return {};
34
+ }
28
35
  var currentLocation = getApp === null || getApp === void 0 || (_getApp = getApp()) === null || _getApp === void 0 || (_getApp = _getApp.history) === null || _getApp === void 0 || (_getApp = _getApp.instance) === null || _getApp === void 0 ? void 0 : _getApp.location;
29
36
  if (currentLocation !== null && currentLocation !== void 0 && currentLocation.search) {
30
37
  var searchParams = new URLSearchParams(currentLocation.search);
@@ -35,10 +42,10 @@ var VariablesProvider = function VariablesProvider(props) {
35
42
  return query;
36
43
  }
37
44
  return {};
38
- }, []);
45
+ }, [disabledHistoryListener]);
39
46
 
40
47
  // 初始变量中包含 URL 参数
41
- var variablesRef = useRef(mergeWith(variables, {
48
+ var variablesRef = useRef(disabledHistoryListener ? variables || {} : mergeWith(variables, {
42
49
  global: {
43
50
  value: {
44
51
  query: initialQuery
@@ -52,6 +59,9 @@ var VariablesProvider = function VariablesProvider(props) {
52
59
 
53
60
  // 解析并设置 query 参数
54
61
  var setQueryVariable = useMemoizedFn(function (search) {
62
+ if (disabledHistoryListener) {
63
+ return;
64
+ }
55
65
  var searchParams = new URLSearchParams(search);
56
66
  var query = {};
57
67
  searchParams.forEach(function (value, key) {
@@ -63,13 +73,16 @@ var VariablesProvider = function VariablesProvider(props) {
63
73
  });
64
74
  useEffect(function () {
65
75
  var _getApp2;
76
+ if (disabledHistoryListener) {
77
+ return;
78
+ }
66
79
  var unlisten = getApp === null || getApp === void 0 || (_getApp2 = getApp()) === null || _getApp2 === void 0 || (_getApp2 = _getApp2.history) === null || _getApp2 === void 0 || (_getApp2 = _getApp2.instance) === null || _getApp2 === void 0 ? void 0 : _getApp2.listen(function (location) {
67
80
  setQueryVariable(location.search);
68
81
  });
69
82
  return function () {
70
83
  unlisten === null || unlisten === void 0 || unlisten();
71
84
  };
72
- }, []);
85
+ }, [disabledHistoryListener]);
73
86
 
74
87
  // useEffect(() => {
75
88
  // if (variables) {
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["children", "style", "className", "locale"];
2
+ var _excluded = ["children", "style", "className", "locale", "variablesConfig"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  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; }
5
5
  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; }
@@ -50,6 +50,7 @@ var Page = function Page(props) {
50
50
  style = props.style,
51
51
  className = props.className,
52
52
  propsLocale = props.locale,
53
+ variablesConfig = props.variablesConfig,
53
54
  others = _objectWithoutProperties(props, _excluded);
54
55
  var context = useEngineContext();
55
56
  var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.constants) || {},
@@ -218,7 +219,8 @@ var Page = function Page(props) {
218
219
  }, /*#__PURE__*/React.createElement(PisellConfigProvider, {
219
220
  locale: locale
220
221
  }, /*#__PURE__*/React.createElement(VariablesProvider, {
221
- variables: ((_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.variables) || {}
222
+ variables: ((_context$engine2 = context.engine) === null || _context$engine2 === void 0 || (_context$engine2 = _context$engine2.props) === null || _context$engine2 === void 0 ? void 0 : _context$engine2.variables) || {},
223
+ config: variablesConfig
222
224
  }, /*#__PURE__*/React.createElement("div", {
223
225
  style: _objectSpread(_objectSpread({}, style), {}, {
224
226
  '--theme-color': themeColor || '#5D3F9F'
@@ -17,7 +17,7 @@ import React, { useEffect, useMemo, useRef } from 'react';
17
17
  import { useSize } from 'ahooks';
18
18
  import classNames from 'classnames';
19
19
  import { CheckCircleFilled, EditOutlined, ExclamationCircleOutlined, MoreOutlined } from '@ant-design/icons';
20
- import { Dropdown, Form, Input, InputNumber, DatePicker, Radio } from 'antd';
20
+ import { Button, Dropdown, Form, Input, InputNumber, DatePicker, Radio } from 'antd';
21
21
  import dayjs from 'dayjs';
22
22
  import Iconfont from "../iconfont";
23
23
  import { PisellModal, usePisellConfig } from "../../index";
@@ -147,7 +147,13 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
147
147
  formatRedeemTitle = props.formatRedeemTitle,
148
148
  maxRedeem = props.maxRedeem,
149
149
  validDateBySchedule = props.validDateBySchedule,
150
- scheduleList = props.scheduleList;
150
+ scheduleList = props.scheduleList,
151
+ _props$showHolderName = props.showHolderName,
152
+ showHolderName = _props$showHolderName === void 0 ? true : _props$showHolderName,
153
+ _props$holderType = props.holderType,
154
+ holderType = _props$holderType === void 0 ? 'customer' : _props$holderType,
155
+ holder = props.holder,
156
+ onSetHolder = props.onSetHolder;
151
157
  useEffect(function () {
152
158
  document.body.id = 'body';
153
159
  }, []);
@@ -289,35 +295,6 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
289
295
  return _ref.apply(this, arguments);
290
296
  };
291
297
  }();
292
-
293
- // 添加长按相关处理函数
294
- var handleTouchStart = function handleTouchStart() {
295
- var _actions$edit3;
296
- if (disabled || disabledReason || !(actions !== null && actions !== void 0 && (_actions$edit3 = actions.edit) !== null && _actions$edit3 !== void 0 && _actions$edit3.enableDialog)) return;
297
- var timer = setTimeout(function () {
298
- onEdit();
299
- }, 500); // 500ms 长按阈值
300
-
301
- setPressTimer(timer);
302
- };
303
- var handleTouchEnd = function handleTouchEnd() {
304
- if (pressTimer) {
305
- clearTimeout(pressTimer);
306
- setPressTimer(null);
307
- }
308
- };
309
-
310
- // 处理移动端双击
311
- var handleTap = function handleTap() {
312
- if (disabled || disabledReason) return;
313
- var now = Date.now();
314
- var DOUBLE_TAP_DELAY = 300; // 双击间隔阈值
315
-
316
- if (now - lastTap < DOUBLE_TAP_DELAY) {
317
- handleDetail();
318
- }
319
- setLastTap(now);
320
- };
321
298
  var formatValidDate = useMemo(function () {
322
299
  if (validDateBySchedule && scheduleList && (scheduleList === null || scheduleList === void 0 ? void 0 : scheduleList.length) > 0) {
323
300
  return /*#__PURE__*/React.createElement(React.Fragment, null, getText('pisell-wallet-pass-card-valid'), ' ', getScheduleSummary(scheduleList, config === null || config === void 0 ? void 0 : config.locale) || validDate);
@@ -347,7 +324,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
347
324
  if ((disabled || disabledReason) && !showStatus) return null;
348
325
  if ((!showActions || !actions) && !showStatus) return null;
349
326
  if ('collapsed' === (actions === null || actions === void 0 ? void 0 : actions.layout)) {
350
- var _actions$detail2, _actions$edit4;
327
+ var _actions$detail2, _actions$edit3;
351
328
  var items = [];
352
329
  if (actions !== null && actions !== void 0 && actions.detail && actions !== null && actions !== void 0 && (_actions$detail2 = actions.detail) !== null && _actions$detail2 !== void 0 && _actions$detail2.visible) {
353
330
  items.push({
@@ -361,7 +338,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
361
338
  }, /*#__PURE__*/React.createElement("span", null, getText('pisell-wallet-pass-card-detail')))
362
339
  });
363
340
  }
364
- if (actions !== null && actions !== void 0 && actions.edit && actions !== null && actions !== void 0 && (_actions$edit4 = actions.edit) !== null && _actions$edit4 !== void 0 && _actions$edit4.visible) {
341
+ if (actions !== null && actions !== void 0 && actions.edit && actions !== null && actions !== void 0 && (_actions$edit3 = actions.edit) !== null && _actions$edit3 !== void 0 && _actions$edit3.visible) {
365
342
  items.push({
366
343
  key: 'edit',
367
344
  label: /*#__PURE__*/React.createElement("div", {
@@ -392,7 +369,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
392
369
  })));
393
370
  }
394
371
  if ('expanded' === (actions === null || actions === void 0 ? void 0 : actions.layout) || showStatus) {
395
- var _actions$detail3, _actions$edit5;
372
+ var _actions$detail3, _actions$edit4;
396
373
  return /*#__PURE__*/React.createElement("div", {
397
374
  className: "actions-btn-wrapper",
398
375
  ref: actionsWrapperRef
@@ -418,7 +395,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
418
395
  fontSize: 24,
419
396
  color: actions.detail.iconColor || '#1570EF'
420
397
  }
421
- })), (actions === null || actions === void 0 ? void 0 : actions.edit) && (actions === null || actions === void 0 || (_actions$edit5 = actions.edit) === null || _actions$edit5 === void 0 ? void 0 : _actions$edit5.visible) && /*#__PURE__*/React.createElement("div", {
398
+ })), (actions === null || actions === void 0 ? void 0 : actions.edit) && (actions === null || actions === void 0 || (_actions$edit4 = actions.edit) === null || _actions$edit4 === void 0 ? void 0 : _actions$edit4.visible) && /*#__PURE__*/React.createElement("div", {
422
399
  className: "pisell-card-actions-edit-btn",
423
400
  onClick: function onClick(e) {
424
401
  stop(e);
@@ -432,12 +409,30 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
432
409
  })));
433
410
  }
434
411
  };
412
+ var _showHolderName = useMemo(function () {
413
+ return holderType === 'custom' && showHolderName;
414
+ }, [holderType, showHolderName]);
415
+ var holderName = useMemo(function () {
416
+ if (holderType === 'custom' && !(holder !== null && holder !== void 0 && holder.id)) {
417
+ return '--';
418
+ }
419
+ return (holder === null || holder === void 0 ? void 0 : holder.name) || '';
420
+ }, [holderType, holder]);
435
421
  var renderNameInfo = function renderNameInfo() {
436
422
  var shouldShowStoreName = typeof showStoreName === 'function' ? showStoreName(props) : showStoreName;
437
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
438
- className: "pisell-card-name-wrap",
439
- style: dynamicNameWrapStyle
440
- }, showName && name), shouldShowStoreName && /*#__PURE__*/React.createElement("div", {
423
+ return /*#__PURE__*/React.createElement("div", {
424
+ className: "pisell-card-name-info-wrap"
425
+ }, /*#__PURE__*/React.createElement("div", {
426
+ className: "pisell-card-name-wrap"
427
+ }, showName && name), _showHolderName && /*#__PURE__*/React.createElement("div", {
428
+ className: "pisell-card-holder-name",
429
+ onClick: function onClick(e) {
430
+ e.stopPropagation();
431
+ onSetHolder === null || onSetHolder === void 0 || onSetHolder(holder);
432
+ }
433
+ }, holderName), /*#__PURE__*/React.createElement("div", {
434
+ className: "pisell-card-store-name"
435
+ }, showStoreName && storeName), shouldShowStoreName && /*#__PURE__*/React.createElement("div", {
441
436
  className: "pisell-card-store-name"
442
437
  }, storeName));
443
438
  };
@@ -524,11 +519,8 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
524
519
  // onClick={handleEditAmount}
525
520
  });
526
521
  };
527
- var renderBalanceInfo = function renderBalanceInfo() {
528
- var _props$metadata;
529
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
530
- className: "pisell-card-amount-wrap"
531
- }, showRedeem && !disabled && /*#__PURE__*/React.createElement("div", {
522
+ var renderRedeemInfo = function renderRedeemInfo() {
523
+ return showRedeem && !disabled && /*#__PURE__*/React.createElement("div", {
532
524
  className: "pisell-card-amount-item pisell-wallet-pass-card-redeem"
533
525
  }, /*#__PURE__*/React.createElement("div", {
534
526
  className: "pisell-card-amount-item-label"
@@ -540,17 +532,23 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
540
532
  originDom: createOriginalRedeemDom(),
541
533
  active: active,
542
534
  data: props
543
- }) : createOriginalRedeemDom()), showBalance && /*#__PURE__*/React.createElement("div", {
544
- className: "pisell-card-amount-item pisell-wallet-pass-card-balance"
535
+ }) : createOriginalRedeemDom());
536
+ };
537
+ var renderBalanceInfo = function renderBalanceInfo() {
538
+ var _props$metadata;
539
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
540
+ className: "pisell-card-amount-info-wrap"
541
+ }, showBalance && /*#__PURE__*/React.createElement("div", {
542
+ className: "pisell-card-amount-item pisell-card-amount-item-balance"
545
543
  }, createOriginalBalanceTitleDom(), formatBalance ? formatBalance(balance, {
546
544
  originDom: createOriginalBalanceDom(),
547
545
  active: active,
548
546
  data: props
549
547
  }) : createOriginalBalanceDom()), showDiscount && /*#__PURE__*/React.createElement("div", {
550
- className: "pisell-card-amount-item"
548
+ className: "pisell-card-amount-item pisell-card-amount-item-discount"
551
549
  }, /*#__PURE__*/React.createElement("div", {
552
550
  className: "pisell-card-amount-item-label"
553
- }, getText('pisell-discount-card-title')), /*#__PURE__*/React.createElement("div", {
551
+ }, getText('pisell-discount-card-title'), ': '), /*#__PURE__*/React.createElement("div", {
554
552
  className: "pisell-card-amount-item-value"
555
553
  }, ((_props$metadata = props.metadata) === null || _props$metadata === void 0 ? void 0 : _props$metadata.discount_card_type) === 'fixed_amount' ? /*#__PURE__*/React.createElement(React.Fragment, null, getText('pisell-discount-card-fixed-amount-prefix'), ' ', /*#__PURE__*/React.createElement(Amount, {
556
554
  className: "pisell-card-amount-item-value",
@@ -594,9 +592,9 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
594
592
  });
595
593
  };
596
594
  var renderEditModal = function renderEditModal() {
597
- var _actions$edit6, _actions$edit7;
595
+ var _actions$edit5, _actions$edit6;
598
596
  return /*#__PURE__*/React.createElement(PisellModal, {
599
- title: (actions === null || actions === void 0 || (_actions$edit6 = actions.edit) === null || _actions$edit6 === void 0 ? void 0 : _actions$edit6.dialogTitle) || getText('pisell-wallet-pass-card-edit'),
597
+ title: (actions === null || actions === void 0 || (_actions$edit5 = actions.edit) === null || _actions$edit5 === void 0 ? void 0 : _actions$edit5.dialogTitle) || getText('pisell-wallet-pass-card-edit'),
600
598
  open: isShowEdit,
601
599
  className: "pisell-wallet-pass-card-edit-modal",
602
600
  onCancel: function onCancel() {
@@ -613,7 +611,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
613
611
  style: {
614
612
  padding: '16px 0'
615
613
  }
616
- }, Array.isArray(actions === null || actions === void 0 || (_actions$edit7 = actions.edit) === null || _actions$edit7 === void 0 ? void 0 : _actions$edit7.fields) && actions.edit.fields.map(function (item) {
614
+ }, Array.isArray(actions === null || actions === void 0 || (_actions$edit6 = actions.edit) === null || _actions$edit6 === void 0 ? void 0 : _actions$edit6.fields) && actions.edit.fields.map(function (item) {
617
615
  return /*#__PURE__*/React.createElement(Form.Item, {
618
616
  key: item.name,
619
617
  name: item.name,
@@ -722,26 +720,46 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
722
720
  paddingBottom: dynamicPaddingBottom
723
721
  });
724
722
  }, [style, showCover, isMini, cover, dynamicPaddingBottom]);
723
+ var _renderMask = function _renderMask() {
724
+ if (holderType === 'customer') return null;
725
+ if (holderType === 'custom' && !(holder !== null && holder !== void 0 && holder.id)) {
726
+ return /*#__PURE__*/React.createElement("div", {
727
+ className: "pisell-wallet-add-holder-mask",
728
+ onClick: function onClick(e) {
729
+ return e.stopPropagation();
730
+ }
731
+ }, /*#__PURE__*/React.createElement("div", {
732
+ className: "pisell-wallet-add-holder-mask-text"
733
+ }, getText('pisell2.wallet-card.add-holder-tip')), /*#__PURE__*/React.createElement(Button, {
734
+ type: "primary",
735
+ className: "pisell-wallet-add-holder-mask-button"
736
+ // @ts-ignore
737
+ ,
738
+ onClick: function onClick(e) {
739
+ e.stopPropagation();
740
+ onSetHolder === null || onSetHolder === void 0 || onSetHolder();
741
+ }
742
+ }, getText('pisell2.wallet-card.add-holder-button-text'), /*#__PURE__*/React.createElement(Iconfont, {
743
+ type: "pisell2-user-edit",
744
+ style: {
745
+ fontSize: 16
746
+ }
747
+ })));
748
+ }
749
+ return null;
750
+ };
725
751
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, renderDetailModal(), renderEditModal()), /*#__PURE__*/React.createElement("div", {
726
752
  className: classNames('pisell-wallet-pass-card', {
727
753
  'pisell-card-disabled': disabled,
728
754
  'pisell-card-disabled-hide-disabled-reason': disabled && !showDisabledReason,
729
755
  'pisell-wallet-pass-card-mini': isMini,
730
756
  active: active
731
- })
732
- // onTouchStart={handleTouchStart}
733
- // onTouchEnd={handleTouchEnd}
734
- // onTouchCancel={handleTouchEnd}
735
- // onMouseDown={handleTouchStart}
736
- // onMouseUp={handleTouchEnd}
737
- // onMouseLeave={handleTouchEnd}
738
- // onClick={handleTap}
739
- ,
757
+ }),
740
758
  style: wrapperStyle
741
- }, renderActions(), /*#__PURE__*/React.createElement("div", {
759
+ }, _renderMask(), renderActions(), /*#__PURE__*/React.createElement("div", {
742
760
  className: "pisell-wallet-pass-card-body",
743
761
  onClick: handleEditAmount
744
- }, renderNameInfo(), renderBalanceInfo(), showQrCode && !isMini && /*#__PURE__*/React.createElement("div", {
762
+ }, renderNameInfo(), renderRedeemInfo(), renderBalanceInfo(), showQrCode && !isMini && /*#__PURE__*/React.createElement("div", {
745
763
  className: "pisell-card-qr-code"
746
764
  }, /*#__PURE__*/React.createElement(PisellQrcode, {
747
765
  value: qrCode,
@@ -8,6 +8,35 @@
8
8
  position: relative;
9
9
  overflow: hidden;
10
10
 
11
+ .pisell-wallet-add-holder-mask {
12
+ position: absolute;
13
+ top: 0;
14
+ left: 0;
15
+ width: 100%;
16
+ height: 100%;
17
+ background-color: rgba(0, 0, 0, 0.6);
18
+ display: flex;
19
+ flex-direction: column;
20
+ align-items: center;
21
+ justify-content: center;
22
+ gap: 16px;
23
+ z-index: 9;
24
+
25
+ &-text {
26
+ color: #fff;
27
+ text-align: center;
28
+ font-size: 16px;
29
+ font-style: normal;
30
+ font-weight: 600;
31
+ line-height: 24px;
32
+ white-space: pre-line;
33
+ }
34
+
35
+ &-button {
36
+ font-weight: bold;
37
+ }
38
+ }
39
+
11
40
  .actions-dropdown-trigger {
12
41
  position: absolute;
13
42
  top: 16px;
@@ -61,9 +90,15 @@
61
90
  z-index: 2;
62
91
  }
63
92
 
93
+ .pisell-card-name-info-wrap {
94
+ // 避免子组件 display: inline-block 产生的幽灵间距
95
+ font-size: 0px;
96
+ }
97
+
64
98
  .pisell-card-name-wrap {
65
99
  font-weight: 500;
66
100
  line-height: 20px;
101
+ font-size: 14px;
67
102
  white-space: nowrap;
68
103
  overflow: hidden;
69
104
  text-overflow: ellipsis;
@@ -75,6 +110,27 @@
75
110
  }
76
111
  }
77
112
 
113
+ .pisell-card-holder-name {
114
+ cursor: pointer;
115
+ display: inline-block;
116
+ overflow: hidden;
117
+ text-overflow: ellipsis;
118
+ white-space: nowrap;
119
+ padding: 2px 8px;
120
+ border-radius: 16px;
121
+ max-width: 60%;
122
+ height: 22px;
123
+ min-width: 50px;
124
+ text-align: center;
125
+ line-height: 16px;
126
+ font-size: 12px;
127
+ font-style: normal;
128
+ font-weight: 500;
129
+ line-height: 18px;
130
+ background-color: #475467;
131
+ color: white;
132
+ }
133
+
78
134
  .pisell-card-store-name {
79
135
  height: 20px;
80
136
  font-size: 12px;
@@ -85,30 +141,34 @@
85
141
  text-overflow: ellipsis;
86
142
  }
87
143
 
88
- .pisell-card-amount-wrap {
144
+ .pisell-card-amount-item {
89
145
  display: flex;
90
- margin-bottom: 4px;
146
+ flex-direction: row;
147
+ align-items: center;
148
+ margin-right: 16px;
149
+ overflow: hidden;
91
150
 
92
- .pisell-card-amount-item {
93
- display: flex;
94
- flex-direction: column;
95
- margin-right: 16px;
151
+ .pisell-card-amount-item-label {
152
+ color: var(--Gray-500, #667085);
153
+ font-weight: 400;
154
+ line-height: 20px;
155
+ height: 20px;
156
+ white-space: nowrap;
157
+ }
158
+
159
+ .pisell-card-amount-item-value {
160
+ font-size: 20px;
161
+ font-weight: 600;
162
+ line-height: 30px;
96
163
  overflow: hidden;
164
+ text-overflow: ellipsis;
165
+ }
97
166
 
167
+ &-balance,
168
+ &-discount {
98
169
  .pisell-card-amount-item-label {
99
- color: var(--Gray-500, #667085);
100
- font-weight: 400;
101
- line-height: 20px;
102
- height: 20px;
103
- white-space: nowrap;
104
- }
105
-
106
- .pisell-card-amount-item-value {
107
- font-size: 20px;
108
- font-weight: 600;
109
- line-height: 20px;
110
- overflow: hidden;
111
- text-overflow: ellipsis;
170
+ transform: translateY(2px);
171
+ margin-right: 2px;
112
172
  }
113
173
  }
114
174
  }
@@ -167,16 +227,18 @@
167
227
  color: var(--Gray-500, #667085);
168
228
  padding-bottom: 30px;
169
229
 
170
- .pisell-card-amount-wrap {
171
- .pisell-card-amount-item {
172
- flex-direction: row;
173
- align-items: center;
230
+ .pisell-card-amount-item {
231
+ flex-direction: row;
232
+ align-items: center;
174
233
 
175
- .pisell-card-amount-item-value {
176
- font-size: 14px;
177
- font-weight: 400;
178
- line-height: 20px;
179
- }
234
+ .pisell-card-amount-item-label {
235
+ transform: unset !important;
236
+ }
237
+
238
+ .pisell-card-amount-item-value {
239
+ font-size: 14px;
240
+ font-weight: 400;
241
+ line-height: 20px;
180
242
  }
181
243
  }
182
244
 
@@ -211,10 +273,6 @@
211
273
  line-height: 20px;
212
274
  }
213
275
 
214
- .pisell-card-amount-wrap {
215
- display: block;
216
- }
217
-
218
276
  .pisell-wallet-pass-card-redeem {
219
277
  visibility: hidden;
220
278
  flex-direction: row;
@@ -252,7 +310,7 @@
252
310
  }
253
311
  }
254
312
 
255
- .pisell-wallet-pass-card-balance {
313
+ .pisell-card-amount-item-balance {
256
314
  flex-direction: row;
257
315
  align-items: center;
258
316
 
@@ -279,6 +337,10 @@
279
337
  height: 20px;
280
338
  }
281
339
  }
340
+
341
+ .pisell-card-warn-message {
342
+ padding: 6px 16px;
343
+ }
282
344
  }
283
345
 
284
346
  .pisell-wallet-pass-card-detail-modal,
@@ -180,7 +180,7 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
180
180
  useEffect(function () {
181
181
  modal.dispatch({
182
182
  type: 'setUtils',
183
- payload: utils || {}
183
+ payload: omit(utils, ['pisellos']) || {}
184
184
  });
185
185
  modal.dispatch({
186
186
  type: 'setIsTerminal',
@@ -7,7 +7,6 @@ import classNames from 'classnames';
7
7
  import Icon from "../icon";
8
8
  import BaseVirtualInput from "./BaseVirtualInput";
9
9
  import "./index.less";
10
- export { BaseVirtualInputProps, BaseVirtualInputRef } from "./BaseVirtualInput";
11
10
  var VirtualInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
12
11
  var topContent = _ref.topContent,
13
12
  bottomContent = _ref.bottomContent,
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { Card, QRCode } from 'antd';
13
+ import { Button, Card, QRCode } from 'antd';
14
14
  import classNames from 'classnames';
15
15
  import React, { useMemo, useState } from 'react';
16
16
  import Barcode from 'react-barcode';
@@ -44,6 +44,10 @@ var DEFAULT_PROPS = {
44
44
  showCode: true,
45
45
  walletName: 'Level',
46
46
  isLogin: true,
47
+ showHolderName: true,
48
+ holderType: 'customer',
49
+ holder: null,
50
+ onSetHolder: function onSetHolder() {},
47
51
  items: [{
48
52
  type: 'rechargeable',
49
53
  display: 1,
@@ -166,7 +170,10 @@ var CardHeader = function CardHeader(_ref2) {
166
170
  isLogin = _ref2$isLogin === void 0 ? false : _ref2$isLogin,
167
171
  _ref2$showViewPin = _ref2.showViewPin,
168
172
  showViewPin = _ref2$showViewPin === void 0 ? false : _ref2$showViewPin,
169
- onViewPinClick = _ref2.onViewPinClick;
173
+ onViewPinClick = _ref2.onViewPinClick,
174
+ showHolderName = _ref2.showHolderName,
175
+ holderName = _ref2.holderName,
176
+ onHolderClick = _ref2.onHolderClick;
170
177
  // 处理可能为0/1的布尔值
171
178
  var processedShowIcon = toBooleanValue(showIcon);
172
179
  var processedShowWalletName = toBooleanValue(showWalletName);
@@ -191,7 +198,10 @@ var CardHeader = function CardHeader(_ref2) {
191
198
  }
192
199
  })) : null, processedShowWalletName && walletName && /*#__PURE__*/React.createElement("div", {
193
200
  className: "pisell-wallet-card-header-level-text"
194
- }, walletName)), processedShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), processedShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo), processedShowViewPin && /*#__PURE__*/React.createElement("div", {
201
+ }, walletName)), showHolderName && /*#__PURE__*/React.createElement("div", {
202
+ className: classNames('pisell-wallet-card-header-holder-name'),
203
+ onClick: onHolderClick
204
+ }, holderName), processedShowShopName && shopName && /*#__PURE__*/React.createElement("div", null, shopName), processedShowCardNo && cardNo && /*#__PURE__*/React.createElement("div", null, cardNo), processedShowViewPin && /*#__PURE__*/React.createElement("div", {
195
205
  className: "pisell-wallet-card-header-view-pin",
196
206
  onClick: onViewPinClick
197
207
  }, getText('walletCard-viewPin'), /*#__PURE__*/React.createElement(EyeOff, {
@@ -349,7 +359,11 @@ var WalletCard = function WalletCard(props) {
349
359
  onClick = mergedProps.onClick,
350
360
  className = mergedProps.className,
351
361
  style = mergedProps.style,
352
- isGuide = mergedProps.isGuide;
362
+ isGuide = mergedProps.isGuide,
363
+ showHolderName = mergedProps.showHolderName,
364
+ holderType = mergedProps.holderType,
365
+ holder = mergedProps.holder,
366
+ onSetHolder = mergedProps.onSetHolder;
353
367
 
354
368
  // 处理可能为0/1的布尔值props
355
369
  var showIcon = toBooleanValue(mergedProps.showIcon);
@@ -413,6 +427,44 @@ var WalletCard = function WalletCard(props) {
413
427
  console.error('onViewPinClick方法需要传入');
414
428
  }
415
429
  };
430
+ var _renderMask = function _renderMask() {
431
+ if (holderType === 'customer') return null;
432
+ if (holderType === 'custom' && !(holder !== null && holder !== void 0 && holder.id)) {
433
+ return /*#__PURE__*/React.createElement("div", {
434
+ className: "pisell-wallet-add-holder-mask"
435
+ }, /*#__PURE__*/React.createElement("div", {
436
+ className: "pisell-wallet-add-holder-mask-text"
437
+ }, getText('pisell2.wallet-card.add-holder-tip')), /*#__PURE__*/React.createElement(Button, {
438
+ type: "primary",
439
+ className: "pisell-wallet-add-holder-mask-button"
440
+ //@ts-ignore
441
+ ,
442
+ onClick: function onClick() {
443
+ return onSetHolder === null || onSetHolder === void 0 ? void 0 : onSetHolder();
444
+ }
445
+ }, getText('pisell2.wallet-card.add-holder-button-text'), /*#__PURE__*/React.createElement(Iconfont, {
446
+ type: "pisell2-user-edit",
447
+ style: {
448
+ fontSize: 16
449
+ }
450
+ })));
451
+ }
452
+ return null;
453
+ };
454
+ var _showHolderName = useMemo(function () {
455
+ return holderType === 'custom' && showHolderName;
456
+ }, [holderType, showHolderName]);
457
+ var holderName = useMemo(function () {
458
+ if (holderType === 'custom' && !(holder !== null && holder !== void 0 && holder.id)) {
459
+ return '--';
460
+ }
461
+ return (holder === null || holder === void 0 ? void 0 : holder.name) || '';
462
+ }, [holderType, holder]);
463
+ var handleHolderClick = function handleHolderClick(e) {
464
+ e.stopPropagation();
465
+ e.preventDefault();
466
+ onSetHolder === null || onSetHolder === void 0 || onSetHolder(holder);
467
+ };
416
468
  return /*#__PURE__*/React.createElement("div", {
417
469
  className: classNames('pisell-wallet-card-wrapper', className),
418
470
  style: style,
@@ -429,7 +481,7 @@ var WalletCard = function WalletCard(props) {
429
481
  style: {
430
482
  flexDirection: codeDirection === 'top' ? 'column-reverse' : 'column'
431
483
  }
432
- }, /*#__PURE__*/React.createElement("div", {
484
+ }, _renderMask(), /*#__PURE__*/React.createElement("div", {
433
485
  className: classNames('pisell-wallet-card-content', mode, (!isLogin || isGuide) && 'pisell-wallet-card-guest-content'),
434
486
  style: backgroundStyle
435
487
  }, isLogin ? !isGuide ? /*#__PURE__*/React.createElement("div", {
@@ -452,7 +504,10 @@ var WalletCard = function WalletCard(props) {
452
504
  onCodeClick: handleCodeClick,
453
505
  isLogin: isLogin,
454
506
  showViewPin: showViewPin,
455
- onViewPinClick: onViewPinClick
507
+ onViewPinClick: onViewPinClick,
508
+ showHolderName: _showHolderName,
509
+ holderName: holderName,
510
+ onHolderClick: handleHolderClick
456
511
  }), /*#__PURE__*/React.createElement(CardContent, {
457
512
  items: items,
458
513
  symbol: symbol