@pisell/materials 6.12.66 → 6.12.68

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.
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { WalletPassValidity } from "@pisell/utils";
3
2
  //#region src/components/pisellWalletPassCard/index.d.ts
4
3
  interface FormatOption {
5
4
  /** 原始 DOM 元素 */
@@ -59,8 +58,6 @@ interface PisellWalletPassCardProps {
59
58
  validDateBySchedule?: boolean;
60
59
  /** 日程列表 */
61
60
  scheduleList?: any[];
62
- /** 卡自身的原始有效日期,与使用日程共同决定展示范围 */
63
- walletValidity?: WalletPassValidity;
64
61
  /** 是否展示右上角详情按钮 */
65
62
  showDetail?: boolean;
66
63
  /** 是否展示qrCode */
@@ -39,7 +39,7 @@ const PisellWalletPassCard = (props) => {
39
39
  if (pressTimer) clearTimeout(pressTimer);
40
40
  };
41
41
  }, [pressTimer]);
42
- const { id, type, code, qrCode, balance, formattedBalance, disabledReason, name, storeName, redeem, validDate, disabled, active = false, cover, balanceTitle, redeemTitle, showCover = true, showDetail = true, showBalance = true, showRedeem = true, showName = true, showCode = true, showStoreName = true, showValidDate = true, showQrCode = true, showBalanceSymbol = true, showDisabledReason = true, showDiscount = false, discount, showActions, actions, beforeEdit, onBeforeEditAmount, onConfirmEdit, onConfirmEditAmount, onDetail, useExternalDetail = false, originData, style = {}, mode = "multiple", showActiveIcon, enableEditAmount, showStatus, cardStatus, nameTitleStyle, formatBalance, formatBalanceTitle, formatRedeem, formatRedeemTitle, maxRedeem, showHolderName = true, holder, onSetHolder, validDateBySchedule, scheduleList, walletValidity } = props;
42
+ const { id, type, code, qrCode, balance, formattedBalance, disabledReason, name, storeName, redeem, validDate, disabled, active = false, cover, balanceTitle, redeemTitle, showCover = true, showDetail = true, showBalance = true, showRedeem = true, showName = true, showCode = true, showStoreName = true, showValidDate = true, showQrCode = true, showBalanceSymbol = true, showDisabledReason = true, showDiscount = false, discount, showActions, actions, beforeEdit, onBeforeEditAmount, onConfirmEdit, onConfirmEditAmount, onDetail, useExternalDetail = false, originData, style = {}, mode = "multiple", showActiveIcon, enableEditAmount, showStatus, cardStatus, nameTitleStyle, formatBalance, formatBalanceTitle, formatRedeem, formatRedeemTitle, maxRedeem, showHolderName = true, holder, onSetHolder, validDateBySchedule, scheduleList } = props;
43
43
  useEffect(() => {
44
44
  document.body.id = "body";
45
45
  }, []);
@@ -132,22 +132,12 @@ const PisellWalletPassCard = (props) => {
132
132
  };
133
133
  }();
134
134
  const formatValidDate = useMemo(() => {
135
- if (validDateBySchedule && scheduleList && (scheduleList === null || scheduleList === void 0 ? void 0 : scheduleList.length) > 0) {
136
- var _walletValidity$start, _ref2, _walletValidity$expir, _walletValidity$expir2;
137
- return /* @__PURE__ */ React.createElement(React.Fragment, null, getText("pisell-wallet-pass-card-valid"), " ", getScheduleSummary(scheduleList, config === null || config === void 0 ? void 0 : config.locale, {
138
- start_date: (_walletValidity$start = walletValidity === null || walletValidity === void 0 ? void 0 : walletValidity.start_date) !== null && _walletValidity$start !== void 0 ? _walletValidity$start : originData === null || originData === void 0 ? void 0 : originData.start_date,
139
- expire_date: (_ref2 = (_walletValidity$expir = walletValidity === null || walletValidity === void 0 ? void 0 : walletValidity.expire_date) !== null && _walletValidity$expir !== void 0 ? _walletValidity$expir : originData === null || originData === void 0 ? void 0 : originData.expire_date) !== null && _ref2 !== void 0 ? _ref2 : validDate,
140
- expire_time: (_walletValidity$expir2 = walletValidity === null || walletValidity === void 0 ? void 0 : walletValidity.expire_time) !== null && _walletValidity$expir2 !== void 0 ? _walletValidity$expir2 : originData === null || originData === void 0 ? void 0 : originData.expire_time
141
- }) || validDate);
142
- }
135
+ if (validDateBySchedule && scheduleList && (scheduleList === null || scheduleList === void 0 ? void 0 : scheduleList.length) > 0) 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);
143
136
  return /* @__PURE__ */ React.createElement(React.Fragment, null, getText("pisell-wallet-pass-card-valid-to"), " ", !!validDate ? validDate : getText("pisell-wallet-pass-card-expireDate"));
144
137
  }, [
145
138
  validDateBySchedule,
146
139
  scheduleList,
147
- validDate,
148
- walletValidity,
149
- originData,
150
- config === null || config === void 0 ? void 0 : config.locale
140
+ validDate
151
141
  ]);
152
142
  const _onConfirmEdit = () => {
153
143
  form.validateFields().then((values) => {
@@ -248,7 +238,7 @@ const PisellWalletPassCard = (props) => {
248
238
  return /* @__PURE__ */ React.createElement("div", { className: classNames("pisell-card-name-info-wrap") }, /* @__PURE__ */ React.createElement("div", { className: "pisell-card-name-wrap" }, showName && name), _showHolderName && /* @__PURE__ */ React.createElement("div", { className: "pisell-card-holder-name" }, holderName), shouldShowStoreName && /* @__PURE__ */ React.createElement("div", { className: "pisell-card-store-name" }, storeName));
249
239
  };
250
240
  const handleEditAmount = function() {
251
- var _ref3 = _asyncToGenerator(function* (e) {
241
+ var _ref2 = _asyncToGenerator(function* (e) {
252
242
  if (active && enableEditAmount) e.stopPropagation();
253
243
  if (!active) return;
254
244
  if (enableEditAmount && !disabled) {
@@ -269,7 +259,7 @@ const PisellWalletPassCard = (props) => {
269
259
  }
270
260
  });
271
261
  return function handleEditAmount(_x) {
272
- return _ref3.apply(this, arguments);
262
+ return _ref2.apply(this, arguments);
273
263
  };
274
264
  }();
275
265
  const createOriginalBalanceTitleDom = () => /* @__PURE__ */ React.createElement("div", { className: "pisell-card-amount-item-label" }, formatBalanceTitle ? formatBalanceTitle(balanceTitle, {
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { WalletPassValidity } from "@pisell/utils";
3
2
  //#region src/components/pisellWalletPassCard/index.d.ts
4
3
  interface FormatOption {
5
4
  /** 原始 DOM 元素 */
@@ -59,8 +58,6 @@ interface PisellWalletPassCardProps {
59
58
  validDateBySchedule?: boolean;
60
59
  /** 日程列表 */
61
60
  scheduleList?: any[];
62
- /** 卡自身的原始有效日期,与使用日程共同决定展示范围 */
63
- walletValidity?: WalletPassValidity;
64
61
  /** 是否展示右上角详情按钮 */
65
62
  showDetail?: boolean;
66
63
  /** 是否展示qrCode */
@@ -43,7 +43,7 @@ const PisellWalletPassCard = (props) => {
43
43
  if (pressTimer) clearTimeout(pressTimer);
44
44
  };
45
45
  }, [pressTimer]);
46
- const { id, type, code, qrCode, balance, formattedBalance, disabledReason, name, storeName, redeem, validDate, disabled, active = false, cover, balanceTitle, redeemTitle, showCover = true, showDetail = true, showBalance = true, showRedeem = true, showName = true, showCode = true, showStoreName = true, showValidDate = true, showQrCode = true, showBalanceSymbol = true, showDisabledReason = true, showDiscount = false, discount, showActions, actions, beforeEdit, onBeforeEditAmount, onConfirmEdit, onConfirmEditAmount, onDetail, useExternalDetail = false, originData, style = {}, mode = "multiple", showActiveIcon, enableEditAmount, showStatus, cardStatus, nameTitleStyle, formatBalance, formatBalanceTitle, formatRedeem, formatRedeemTitle, maxRedeem, showHolderName = true, holder, onSetHolder, validDateBySchedule, scheduleList, walletValidity } = props;
46
+ const { id, type, code, qrCode, balance, formattedBalance, disabledReason, name, storeName, redeem, validDate, disabled, active = false, cover, balanceTitle, redeemTitle, showCover = true, showDetail = true, showBalance = true, showRedeem = true, showName = true, showCode = true, showStoreName = true, showValidDate = true, showQrCode = true, showBalanceSymbol = true, showDisabledReason = true, showDiscount = false, discount, showActions, actions, beforeEdit, onBeforeEditAmount, onConfirmEdit, onConfirmEditAmount, onDetail, useExternalDetail = false, originData, style = {}, mode = "multiple", showActiveIcon, enableEditAmount, showStatus, cardStatus, nameTitleStyle, formatBalance, formatBalanceTitle, formatRedeem, formatRedeemTitle, maxRedeem, showHolderName = true, holder, onSetHolder, validDateBySchedule, scheduleList } = props;
47
47
  (0, react.useEffect)(() => {
48
48
  document.body.id = "body";
49
49
  }, []);
@@ -136,22 +136,12 @@ const PisellWalletPassCard = (props) => {
136
136
  };
137
137
  }();
138
138
  const formatValidDate = (0, react.useMemo)(() => {
139
- if (validDateBySchedule && scheduleList && (scheduleList === null || scheduleList === void 0 ? void 0 : scheduleList.length) > 0) {
140
- var _walletValidity$start, _ref2, _walletValidity$expir, _walletValidity$expir2;
141
- return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, require_index.getText("pisell-wallet-pass-card-valid"), " ", (0, _pisell_utils.getScheduleSummary)(scheduleList, config === null || config === void 0 ? void 0 : config.locale, {
142
- start_date: (_walletValidity$start = walletValidity === null || walletValidity === void 0 ? void 0 : walletValidity.start_date) !== null && _walletValidity$start !== void 0 ? _walletValidity$start : originData === null || originData === void 0 ? void 0 : originData.start_date,
143
- expire_date: (_ref2 = (_walletValidity$expir = walletValidity === null || walletValidity === void 0 ? void 0 : walletValidity.expire_date) !== null && _walletValidity$expir !== void 0 ? _walletValidity$expir : originData === null || originData === void 0 ? void 0 : originData.expire_date) !== null && _ref2 !== void 0 ? _ref2 : validDate,
144
- expire_time: (_walletValidity$expir2 = walletValidity === null || walletValidity === void 0 ? void 0 : walletValidity.expire_time) !== null && _walletValidity$expir2 !== void 0 ? _walletValidity$expir2 : originData === null || originData === void 0 ? void 0 : originData.expire_time
145
- }) || validDate);
146
- }
139
+ if (validDateBySchedule && scheduleList && (scheduleList === null || scheduleList === void 0 ? void 0 : scheduleList.length) > 0) return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, require_index.getText("pisell-wallet-pass-card-valid"), " ", (0, _pisell_utils.getScheduleSummary)(scheduleList, config === null || config === void 0 ? void 0 : config.locale) || validDate);
147
140
  return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, require_index.getText("pisell-wallet-pass-card-valid-to"), " ", !!validDate ? validDate : require_index.getText("pisell-wallet-pass-card-expireDate"));
148
141
  }, [
149
142
  validDateBySchedule,
150
143
  scheduleList,
151
- validDate,
152
- walletValidity,
153
- originData,
154
- config === null || config === void 0 ? void 0 : config.locale
144
+ validDate
155
145
  ]);
156
146
  const _onConfirmEdit = () => {
157
147
  form.validateFields().then((values) => {
@@ -252,7 +242,7 @@ const PisellWalletPassCard = (props) => {
252
242
  return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)("pisell-card-name-info-wrap") }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-card-name-wrap" }, showName && name), _showHolderName && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-card-holder-name" }, holderName), shouldShowStoreName && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-card-store-name" }, storeName));
253
243
  };
254
244
  const handleEditAmount = function() {
255
- var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (e) {
245
+ var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (e) {
256
246
  if (active && enableEditAmount) e.stopPropagation();
257
247
  if (!active) return;
258
248
  if (enableEditAmount && !disabled) {
@@ -273,7 +263,7 @@ const PisellWalletPassCard = (props) => {
273
263
  }
274
264
  });
275
265
  return function handleEditAmount(_x) {
276
- return _ref3.apply(this, arguments);
266
+ return _ref2.apply(this, arguments);
277
267
  };
278
268
  }();
279
269
  const createOriginalBalanceTitleDom = () => /* @__PURE__ */ react.default.createElement("div", { className: "pisell-card-amount-item-label" }, formatBalanceTitle ? formatBalanceTitle(balanceTitle, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.12.66",
3
+ "version": "6.12.68",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -95,9 +95,9 @@
95
95
  "swiper": "^8.4.7",
96
96
  "antd-mobile": "^5.38.1",
97
97
  "vod-js-sdk-v6": "^1.4.11",
98
- "@pisell/date-picker": "3.0.11",
99
- "@pisell/utils": "3.0.5",
100
- "@pisell/icon": "0.0.11"
98
+ "@pisell/date-picker": "3.0.10",
99
+ "@pisell/icon": "0.0.11",
100
+ "@pisell/utils": "3.0.4"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "react": "^18.0.0",