@pisell/private-materials 6.3.55 → 6.3.57
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/appointmentBooking/components/Services/index.js +27 -24
- package/es/components/appointmentBooking/components/Voucher/index.js +14 -0
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +29 -9
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +165 -145
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
- package/es/components/pay/toC/WalletPassBlock/index.js +3 -1
- package/es/components/pay/toC/index.js +65 -31
- package/es/components/pay/toC/model.d.ts +1 -0
- package/es/components/pay/toC/serve.d.ts +18 -0
- package/es/components/pay/toC/serve.js +29 -1
- package/es/components/pay/toC/utils.d.ts +2 -2
- package/es/components/pay/toC/utils.js +4 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.js +9 -12
- package/es/components/walletList/index.js +173 -39
- package/es/components/walletList/locales.js +12 -3
- package/es/components/walletList/serve.d.ts +19 -0
- package/es/components/walletList/serve.js +94 -5
- package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/es/components/walletList/tempHolderSelector/index.js +196 -0
- package/es/components/walletList/tempHolderSelector/index.less +63 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -2
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
- package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
- package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/es/plus/selectHolder/components/HolderList/index.js +43 -0
- package/es/plus/selectHolder/index.d.ts +7 -0
- package/es/plus/selectHolder/index.js +236 -0
- package/es/plus/selectHolder/index.less +117 -0
- package/es/plus/selectHolder/locales.d.ts +21 -0
- package/es/plus/selectHolder/locales.js +20 -0
- package/es/plus/selectHolder/types.js +1 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/plus/walletEditor/WalletEditor.js +60 -2
- package/es/plus/walletEditor/locales.js +12 -3
- package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passList/index.js +17 -5
- package/es/plus/walletPassGallery/index.js +223 -41
- package/es/plus/walletPassGallery/locales.js +29 -5
- package/es/plus/walletPassGallery/serve.d.ts +15 -1
- package/es/plus/walletPassGallery/serve.js +59 -2
- package/es/plus/walletPassGallery/utils.js +342 -0
- package/lib/components/appointmentBooking/components/Services/index.js +5 -2
- package/lib/components/appointmentBooking/components/Voucher/index.js +12 -0
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +29 -6
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +90 -103
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
- package/lib/components/pay/toC/WalletPassBlock/index.js +3 -1
- package/lib/components/pay/toC/index.js +52 -19
- package/lib/components/pay/toC/model.d.ts +1 -0
- package/lib/components/pay/toC/serve.d.ts +18 -0
- package/lib/components/pay/toC/serve.js +6 -0
- package/lib/components/pay/toC/utils.d.ts +2 -2
- package/lib/components/pay/toC/utils.js +4 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +2 -5
- package/lib/components/walletList/index.js +100 -4
- package/lib/components/walletList/locales.js +12 -3
- package/lib/components/walletList/serve.d.ts +19 -0
- package/lib/components/walletList/serve.js +26 -3
- package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/lib/components/walletList/tempHolderSelector/index.js +166 -0
- package/lib/components/walletList/tempHolderSelector/index.less +63 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -3
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/{components/wallet/PointCard/model.js → plus/selectHolder/components/ErrorTip/index.js} +10 -23
- package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
- package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/lib/{components/wallet/components/WalletBar → plus/selectHolder/components/HolderList}/index.js +29 -15
- package/lib/plus/selectHolder/index.d.ts +7 -0
- package/lib/plus/selectHolder/index.js +202 -0
- package/lib/plus/selectHolder/index.less +117 -0
- package/lib/plus/selectHolder/locales.d.ts +21 -0
- package/lib/{components/wallet/Voucher → plus/selectHolder}/locales.js +15 -15
- package/lib/plus/selectHolder/types.js +17 -0
- package/lib/{components/wallet/RechargeableCard/serve.js → plus/selectHolder/utils.js} +11 -10
- package/lib/plus/walletEditor/WalletEditor.js +53 -0
- package/lib/plus/walletEditor/locales.js +12 -3
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
- package/lib/plus/walletPassGallery/index.js +154 -27
- package/lib/plus/walletPassGallery/locales.js +32 -5
- package/lib/plus/walletPassGallery/serve.d.ts +15 -1
- package/lib/plus/walletPassGallery/serve.js +17 -5
- package/lib/plus/walletPassGallery/utils.js +287 -0
- package/lowcode/event-select-holder/meta.ts +2 -2
- package/lowcode/select-holder/meta.ts +220 -0
- package/lowcode/select-holder/snippets.ts +41 -0
- package/package.json +2 -2
- package/es/components/booking/info/service/editService/constants.d.ts +0 -1
- package/es/components/pay/toC/locales.d.ts +0 -301
- package/es/components/pay/toC/status.d.ts +0 -13
- package/es/components/systemSettings/registry/locales.d.ts +0 -272
- package/es/components/systemSettings/registry/services.d.ts +0 -77
- package/es/components/systemSettings/registry/types.d.ts +0 -126
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/es/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/es/components/wallet/Detail/index.d.ts +0 -42
- package/es/components/wallet/Detail/index.js +0 -1182
- package/es/components/wallet/Detail/index.less +0 -386
- package/es/components/wallet/Detail/locales.d.ts +0 -153
- package/es/components/wallet/Detail/locales.js +0 -170
- package/es/components/wallet/Detail/model.d.ts +0 -13
- package/es/components/wallet/Detail/model.js +0 -22
- package/es/components/wallet/Detail/serve.d.ts +0 -39
- package/es/components/wallet/Detail/serve.js +0 -64
- package/es/components/wallet/DetailContext.d.ts +0 -25
- package/es/components/wallet/DetailContext.js +0 -162
- package/es/components/wallet/DiscountCard/index.d.ts +0 -3
- package/es/components/wallet/DiscountCard/index.js +0 -218
- package/es/components/wallet/DiscountCard/index.less +0 -9
- package/es/components/wallet/DiscountCard/model.d.ts +0 -14
- package/es/components/wallet/DiscountCard/model.js +0 -22
- package/es/components/wallet/PointCard/index.d.ts +0 -3
- package/es/components/wallet/PointCard/index.js +0 -169
- package/es/components/wallet/PointCard/index.less +0 -9
- package/es/components/wallet/PointCard/model.d.ts +0 -13
- package/es/components/wallet/PointCard/model.js +0 -22
- package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/es/components/wallet/RechargeableCard/index.js +0 -463
- package/es/components/wallet/RechargeableCard/index.less +0 -108
- package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/es/components/wallet/RechargeableCard/model.js +0 -28
- package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/es/components/wallet/RechargeableCard/serve.js +0 -32
- package/es/components/wallet/Voucher/index.d.ts +0 -12
- package/es/components/wallet/Voucher/index.js +0 -131
- package/es/components/wallet/Voucher/index.less +0 -9
- package/es/components/wallet/Voucher/locales.d.ts +0 -21
- package/es/components/wallet/Voucher/locales.js +0 -20
- package/es/components/wallet/Voucher/model.d.ts +0 -13
- package/es/components/wallet/Voucher/model.js +0 -22
- package/es/components/wallet/carouselArrow.png +0 -0
- package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/es/components/wallet/components/FooterButtons/index.js +0 -81
- package/es/components/wallet/components/FooterButtons/index.less +0 -91
- package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/es/components/wallet/components/UsageRules/index.js +0 -147
- package/es/components/wallet/components/UsageRules/index.less +0 -157
- package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/es/components/wallet/components/WalletBar/index.js +0 -19
- package/es/components/wallet/components/WalletBar/index.less +0 -36
- package/es/components/wallet/components/WalletCard.d.ts +0 -11
- package/es/components/wallet/components/WalletCard.js +0 -91
- package/es/components/wallet/components/index.d.ts +0 -3
- package/es/components/wallet/components/index.js +0 -4
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -33
- package/es/components/wallet/hooks/useWalletCard.js +0 -147
- package/es/components/wallet/index.d.ts +0 -10
- package/es/components/wallet/index.js +0 -807
- package/es/components/wallet/index.less +0 -151
- package/es/components/wallet/locales.d.ts +0 -132
- package/es/components/wallet/locales.js +0 -139
- package/es/components/wallet/model.d.ts +0 -37
- package/es/components/wallet/model.js +0 -86
- package/es/components/wallet/serve.d.ts +0 -150
- package/es/components/wallet/serve.js +0 -205
- package/es/components/wallet/utils/formatUtils.d.ts +0 -36
- package/es/components/wallet/utils/formatUtils.js +0 -73
- package/es/components/wallet/utils.d.ts +0 -48
- package/es/components/walletList/locales.d.ts +0 -18
- package/es/components/walletList/types/index.d.ts +0 -194
- package/es/plus/walletEditor/components/JsonEditor/index.d.ts +0 -11
- package/es/plus/walletEditor/locales.d.ts +0 -126
- package/es/plus/walletEditor/types.d.ts +0 -52
- package/es/plus/walletPassGallery/locales.d.ts +0 -270
- package/es/pro/Login2.0/hooks/index.d.ts +0 -2
- package/es/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +0 -24
- package/es/pro/Login2.0/hooks/useRegisterFlow.d.ts +0 -39
- package/es/pro/Login2.0/hooks/useRegistrationMethods.d.ts +0 -9
- package/es/pro/Login2.0/locales.d.ts +0 -543
- package/es/pro/Login2.0/shared/Header.d.ts +0 -11
- package/es/pro/Login2.0/shared/registerFlow.d.ts +0 -116
- package/es/pro/Login2.0/shared/types.d.ts +0 -232
- package/es/pro/Login2.0/types.d.ts +0 -167
- package/lib/components/booking/info/service/editService/constants.d.ts +0 -1
- package/lib/components/pay/toC/locales.d.ts +0 -301
- package/lib/components/pay/toC/status.d.ts +0 -13
- package/lib/components/systemSettings/registry/locales.d.ts +0 -272
- package/lib/components/systemSettings/registry/services.d.ts +0 -77
- package/lib/components/systemSettings/registry/types.d.ts +0 -126
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +0 -16
- package/lib/components/systemSettings/registry/utils/validators.d.ts +0 -8
- package/lib/components/wallet/Detail/index.d.ts +0 -42
- package/lib/components/wallet/Detail/index.js +0 -874
- package/lib/components/wallet/Detail/index.less +0 -386
- package/lib/components/wallet/Detail/locales.d.ts +0 -153
- package/lib/components/wallet/Detail/locales.js +0 -194
- package/lib/components/wallet/Detail/model.d.ts +0 -13
- package/lib/components/wallet/Detail/model.js +0 -43
- package/lib/components/wallet/Detail/serve.d.ts +0 -39
- package/lib/components/wallet/Detail/serve.js +0 -44
- package/lib/components/wallet/DetailContext.d.ts +0 -25
- package/lib/components/wallet/DetailContext.js +0 -118
- package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
- package/lib/components/wallet/DiscountCard/index.js +0 -209
- package/lib/components/wallet/DiscountCard/index.less +0 -9
- package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
- package/lib/components/wallet/DiscountCard/model.js +0 -43
- package/lib/components/wallet/PointCard/index.d.ts +0 -3
- package/lib/components/wallet/PointCard/index.js +0 -190
- package/lib/components/wallet/PointCard/index.less +0 -9
- package/lib/components/wallet/PointCard/model.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.js +0 -380
- package/lib/components/wallet/RechargeableCard/index.less +0 -108
- package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/lib/components/wallet/RechargeableCard/model.js +0 -49
- package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/lib/components/wallet/Voucher/index.d.ts +0 -12
- package/lib/components/wallet/Voucher/index.js +0 -146
- package/lib/components/wallet/Voucher/index.less +0 -9
- package/lib/components/wallet/Voucher/locales.d.ts +0 -21
- package/lib/components/wallet/Voucher/model.d.ts +0 -13
- package/lib/components/wallet/Voucher/model.js +0 -43
- package/lib/components/wallet/carouselArrow.png +0 -0
- package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/lib/components/wallet/components/FooterButtons/index.js +0 -109
- package/lib/components/wallet/components/FooterButtons/index.less +0 -91
- package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/lib/components/wallet/components/UsageRules/index.js +0 -113
- package/lib/components/wallet/components/UsageRules/index.less +0 -157
- package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/lib/components/wallet/components/WalletBar/index.less +0 -36
- package/lib/components/wallet/components/WalletCard.d.ts +0 -11
- package/lib/components/wallet/components/WalletCard.js +0 -97
- package/lib/components/wallet/components/index.d.ts +0 -3
- package/lib/components/wallet/components/index.js +0 -45
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -33
- package/lib/components/wallet/hooks/useWalletCard.js +0 -111
- package/lib/components/wallet/index.d.ts +0 -10
- package/lib/components/wallet/index.js +0 -580
- package/lib/components/wallet/index.less +0 -151
- package/lib/components/wallet/locales.d.ts +0 -132
- package/lib/components/wallet/locales.js +0 -163
- package/lib/components/wallet/model.d.ts +0 -37
- package/lib/components/wallet/model.js +0 -91
- package/lib/components/wallet/serve.d.ts +0 -150
- package/lib/components/wallet/serve.js +0 -85
- package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
- package/lib/components/wallet/utils/formatUtils.js +0 -73
- package/lib/components/wallet/utils.d.ts +0 -48
- package/lib/components/walletList/locales.d.ts +0 -18
- package/lib/components/walletList/types/index.d.ts +0 -194
- package/lib/plus/walletEditor/components/JsonEditor/index.d.ts +0 -11
- package/lib/plus/walletEditor/locales.d.ts +0 -126
- package/lib/plus/walletEditor/types.d.ts +0 -52
- package/lib/plus/walletPassGallery/locales.d.ts +0 -270
- package/lib/pro/Login2.0/hooks/index.d.ts +0 -2
- package/lib/pro/Login2.0/hooks/usePasswordValidationRules.d.ts +0 -24
- package/lib/pro/Login2.0/hooks/useRegisterFlow.d.ts +0 -39
- package/lib/pro/Login2.0/hooks/useRegistrationMethods.d.ts +0 -9
- package/lib/pro/Login2.0/locales.d.ts +0 -543
- package/lib/pro/Login2.0/shared/Header.d.ts +0 -11
- package/lib/pro/Login2.0/shared/registerFlow.d.ts +0 -116
- package/lib/pro/Login2.0/shared/types.d.ts +0 -232
- package/lib/pro/Login2.0/types.d.ts +0 -167
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
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; }
|
|
10
|
+
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; } }
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
import React, { useEffect, useState, useMemo, useCallback } from 'react';
|
|
13
|
+
import { PisellModal, Button } from '@pisell/materials';
|
|
14
|
+
import { isMobile, locales } from '@pisell/utils';
|
|
15
|
+
import ErrorTip from "./components/ErrorTip";
|
|
16
|
+
import HolderItem from "./components/HolderItem";
|
|
17
|
+
import HolderList from "./components/HolderList";
|
|
18
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
19
|
+
import localeTexts from "./locales";
|
|
20
|
+
import "./index.less";
|
|
21
|
+
|
|
22
|
+
// 类名前缀
|
|
23
|
+
export var PREFIX = 'pisell-lowcode-select-holder';
|
|
24
|
+
var PisellSelectHolder = function PisellSelectHolder(_ref) {
|
|
25
|
+
var _context$engine;
|
|
26
|
+
var dataSource = _ref.dataSource,
|
|
27
|
+
_ref$open = _ref.open,
|
|
28
|
+
open = _ref$open === void 0 ? true : _ref$open,
|
|
29
|
+
onClose = _ref.onClose,
|
|
30
|
+
onConfirm = _ref.onConfirm,
|
|
31
|
+
onSkip = _ref.onSkip,
|
|
32
|
+
onAdd = _ref.onAdd,
|
|
33
|
+
value = _ref.value,
|
|
34
|
+
modalConfig = _ref.modalConfig,
|
|
35
|
+
displayConfig = _ref.displayConfig,
|
|
36
|
+
_ref$allowAdd = _ref.allowAdd,
|
|
37
|
+
allowAdd = _ref$allowAdd === void 0 ? true : _ref$allowAdd,
|
|
38
|
+
_ref$horizontalGap = _ref.horizontalGap,
|
|
39
|
+
horizontalGap = _ref$horizontalGap === void 0 ? 16 : _ref$horizontalGap,
|
|
40
|
+
_ref$verticalGap = _ref.verticalGap,
|
|
41
|
+
verticalGap = _ref$verticalGap === void 0 ? 16 : _ref$verticalGap,
|
|
42
|
+
_ref$maxSelectedCount = _ref.maxSelectedCount,
|
|
43
|
+
maxSelectedCount = _ref$maxSelectedCount === void 0 ? 2 : _ref$maxSelectedCount,
|
|
44
|
+
_ref$isInline = _ref.isInline,
|
|
45
|
+
isInline = _ref$isInline === void 0 ? false : _ref$isInline,
|
|
46
|
+
className = _ref.className,
|
|
47
|
+
style = _ref.style;
|
|
48
|
+
var _useState = useState(''),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
errorTip = _useState2[0],
|
|
51
|
+
setErrorTip = _useState2[1];
|
|
52
|
+
var _useState3 = useState([]),
|
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
+
selectedValues = _useState4[0],
|
|
55
|
+
setSelectedValues = _useState4[1];
|
|
56
|
+
var mobile = useMemo(function () {
|
|
57
|
+
return isMobile();
|
|
58
|
+
}, []);
|
|
59
|
+
var context = useEngineContext();
|
|
60
|
+
locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
var _value = [];
|
|
63
|
+
if (Array.isArray(value)) {
|
|
64
|
+
_value = value;
|
|
65
|
+
} else {
|
|
66
|
+
_value = value ? [value] : [];
|
|
67
|
+
}
|
|
68
|
+
setSelectedValues(_value);
|
|
69
|
+
}, [value]);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @title: 处理确认按钮点击
|
|
73
|
+
* @description:
|
|
74
|
+
* @param {*} useCallback
|
|
75
|
+
* @return {*}
|
|
76
|
+
* @Author: WangHan
|
|
77
|
+
* @Date: 2025-10-10 21:32
|
|
78
|
+
*/
|
|
79
|
+
var handleOk = useCallback(function () {
|
|
80
|
+
onConfirm === null || onConfirm === void 0 || onConfirm(selectedValues);
|
|
81
|
+
}, [selectedValues]);
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @title: 处理选项点击
|
|
85
|
+
* @description:
|
|
86
|
+
* @return {*}
|
|
87
|
+
* @Author: WangHan
|
|
88
|
+
* @Date: 2025-10-10 21:28
|
|
89
|
+
*/
|
|
90
|
+
var handleClick = useCallback(function (item) {
|
|
91
|
+
if (!(item !== null && item !== void 0 && item.value)) {
|
|
92
|
+
return onAdd === null || onAdd === void 0 ? void 0 : onAdd();
|
|
93
|
+
}
|
|
94
|
+
var selectType = (displayConfig === null || displayConfig === void 0 ? void 0 : displayConfig.selectType) || 'single';
|
|
95
|
+
|
|
96
|
+
// 单选模式:直接设置选中的值
|
|
97
|
+
if (selectType === 'single') {
|
|
98
|
+
setSelectedValues(function (prev) {
|
|
99
|
+
// 如果点击的是已选中的项,则取消选择(可选行为)
|
|
100
|
+
// 如果需要保持选中状态,可以改为:return [item.value];
|
|
101
|
+
return prev.includes(item.value) ? [] : [item.value];
|
|
102
|
+
});
|
|
103
|
+
} else {
|
|
104
|
+
// 多选模式:如果已选中,则移除,否则添加
|
|
105
|
+
setSelectedValues(function (prev) {
|
|
106
|
+
var newValues = prev.includes(item.value) ? prev.filter(function (v) {
|
|
107
|
+
return v !== item.value;
|
|
108
|
+
}) : [].concat(_toConsumableArray(prev), [item.value]);
|
|
109
|
+
return newValues;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}, [displayConfig === null || displayConfig === void 0 ? void 0 : displayConfig.selectType]);
|
|
113
|
+
var handleSkip = useCallback(function () {
|
|
114
|
+
onSkip === null || onSkip === void 0 || onSkip();
|
|
115
|
+
}, [onSkip]);
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @title: 渲染添加项
|
|
119
|
+
* @description:
|
|
120
|
+
* @param {*} useCallback
|
|
121
|
+
* @return {*}
|
|
122
|
+
* @Author: WangHan
|
|
123
|
+
* @Date: 2025-10-11 14:20
|
|
124
|
+
*/
|
|
125
|
+
var renderAddItem = useCallback(function () {
|
|
126
|
+
if (!allowAdd) return undefined;
|
|
127
|
+
return /*#__PURE__*/React.createElement(HolderItem, {
|
|
128
|
+
item: {
|
|
129
|
+
label: locales.getText('pisell-select-holder-create'),
|
|
130
|
+
value: null
|
|
131
|
+
},
|
|
132
|
+
isAddItem: true
|
|
133
|
+
});
|
|
134
|
+
}, [allowAdd]);
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @title: 模态框样式类名
|
|
138
|
+
* @description:
|
|
139
|
+
* @param {*} useMemo
|
|
140
|
+
* @return {*}
|
|
141
|
+
* @Author: WangHan
|
|
142
|
+
* @Date: 2025-10-11 14:20
|
|
143
|
+
*/
|
|
144
|
+
var modalClassName = useMemo(function () {
|
|
145
|
+
var classes = ["".concat(PREFIX, "-modal")];
|
|
146
|
+
if (mobile) {
|
|
147
|
+
classes.push("".concat(PREFIX, "-modal-mobile"));
|
|
148
|
+
}
|
|
149
|
+
return classes.join(' ');
|
|
150
|
+
}, [mobile]);
|
|
151
|
+
var okButtonProps = useMemo(function () {
|
|
152
|
+
// 多选模式,禁用按钮当已选数量大于最大可选数量
|
|
153
|
+
if ((displayConfig === null || displayConfig === void 0 ? void 0 : displayConfig.selectType) === 'multiple') {
|
|
154
|
+
return {
|
|
155
|
+
disabled: maxSelectedCount > (selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length)
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
disabled: !(selectedValues !== null && selectedValues !== void 0 && selectedValues.length)
|
|
160
|
+
};
|
|
161
|
+
}, [selectedValues, maxSelectedCount, displayConfig === null || displayConfig === void 0 ? void 0 : displayConfig.selectType]);
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @title: 渲染底部按钮
|
|
165
|
+
* @description:
|
|
166
|
+
* @param {*} useMemo
|
|
167
|
+
* @return {*}
|
|
168
|
+
* @Author: WangHan
|
|
169
|
+
* @Date: 2025-10-10 21:51
|
|
170
|
+
*/
|
|
171
|
+
var footerCom = useMemo(function () {
|
|
172
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
173
|
+
className: "".concat(PREFIX, "-footer")
|
|
174
|
+
}, displayConfig !== null && displayConfig !== void 0 && displayConfig.isSkipable ? /*#__PURE__*/React.createElement(Button, {
|
|
175
|
+
onClick: handleSkip
|
|
176
|
+
}, locales.getText('pisell-select-holder-skip')) : null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
177
|
+
onClick: handleOk
|
|
178
|
+
}, okButtonProps, {
|
|
179
|
+
type: "primary"
|
|
180
|
+
}), modalConfig === null || modalConfig === void 0 ? void 0 : modalConfig.confirmText));
|
|
181
|
+
}, [displayConfig === null || displayConfig === void 0 ? void 0 : displayConfig.isSkipable, modalConfig === null || modalConfig === void 0 ? void 0 : modalConfig.confirmText, okButtonProps]);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @description: 渲染内容
|
|
185
|
+
* @param {*} useMemo
|
|
186
|
+
* @return {*}
|
|
187
|
+
*/
|
|
188
|
+
var renderContent = useMemo(function () {
|
|
189
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, mobile && modalConfig !== null && modalConfig !== void 0 && modalConfig.title ? /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
className: "".concat(PREFIX, "-modal-title")
|
|
191
|
+
}, modalConfig === null || modalConfig === void 0 ? void 0 : modalConfig.title) : null, errorTip && /*#__PURE__*/React.createElement(ErrorTip, {
|
|
192
|
+
text: errorTip
|
|
193
|
+
}), (displayConfig === null || displayConfig === void 0 ? void 0 : displayConfig.selectType) === 'multiple' && maxSelectedCount ? /*#__PURE__*/React.createElement("div", {
|
|
194
|
+
className: "".concat(PREFIX, "-selected-info ").concat(selectedValues.length === maxSelectedCount ? "".concat(PREFIX, "-selected-info-max") : '')
|
|
195
|
+
}, locales.getText('pisell-select-holder-selected'), selectedValues.length, "/", maxSelectedCount) : null, /*#__PURE__*/React.createElement(HolderList, {
|
|
196
|
+
dataSource: dataSource,
|
|
197
|
+
selectedValues: selectedValues,
|
|
198
|
+
displayConfig: displayConfig,
|
|
199
|
+
renderAddItem: renderAddItem,
|
|
200
|
+
columns: mobile ? 2 : 3,
|
|
201
|
+
horizontalGap: horizontalGap,
|
|
202
|
+
verticalGap: verticalGap,
|
|
203
|
+
allowAdd: allowAdd,
|
|
204
|
+
onClick: handleClick
|
|
205
|
+
}));
|
|
206
|
+
}, [isInline, modalConfig, dataSource, errorTip, maxSelectedCount, selectedValues, displayConfig, renderAddItem, mobile, horizontalGap, verticalGap, allowAdd, handleClick]);
|
|
207
|
+
|
|
208
|
+
// 直接页面上显示
|
|
209
|
+
if (isInline) {
|
|
210
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
className: "".concat(PREFIX, "-inline-wrap ").concat(className),
|
|
212
|
+
style: style
|
|
213
|
+
}, renderContent);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// 弹窗打开
|
|
217
|
+
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
218
|
+
open: open,
|
|
219
|
+
title: mobile ? '' : modalConfig === null || modalConfig === void 0 ? void 0 : modalConfig.title,
|
|
220
|
+
platform: mobile ? 'h5' : 'pc',
|
|
221
|
+
closable: modalConfig === null || modalConfig === void 0 ? void 0 : modalConfig.showClose,
|
|
222
|
+
bodyStyle: {
|
|
223
|
+
padding: mobile ? '0 16px 16px' : 20
|
|
224
|
+
},
|
|
225
|
+
mobileModalHeight: "auto",
|
|
226
|
+
destroyOnClose: true,
|
|
227
|
+
className: modalClassName,
|
|
228
|
+
headerDivider: false,
|
|
229
|
+
width: mobile ? '100%' : '640px',
|
|
230
|
+
footer: footerCom,
|
|
231
|
+
onCancel: onClose
|
|
232
|
+
}, renderContent);
|
|
233
|
+
};
|
|
234
|
+
export default PisellSelectHolder;
|
|
235
|
+
// 导出 HolderList 组件供外部使用
|
|
236
|
+
export { default as HolderList } from "./components/HolderList";
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
.pisell-lowcode-select-holder {
|
|
2
|
+
&-modal {
|
|
3
|
+
.pisell-view-grid-item {
|
|
4
|
+
> div {
|
|
5
|
+
height: 100%;
|
|
6
|
+
.pisell-lowcode-card {
|
|
7
|
+
height: 100% !important;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-modal-title {
|
|
14
|
+
color: var(--Gray-900, #101828);
|
|
15
|
+
font-size: 18px;
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
line-height: 28px;
|
|
18
|
+
margin-bottom: 16px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-selected-info {
|
|
22
|
+
margin-bottom: 16px;
|
|
23
|
+
color: #d92d20;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
line-height: 20px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-selected-info-max {
|
|
30
|
+
color: #7f56d9;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-modal-mobile {
|
|
34
|
+
.pisell-lowcode-modal-header {
|
|
35
|
+
border: none !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-footer {
|
|
40
|
+
display: flex;
|
|
41
|
+
gap: 12px;
|
|
42
|
+
width: 100%;
|
|
43
|
+
button {
|
|
44
|
+
flex: 1;
|
|
45
|
+
height: 40px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.pisell-lowcode-select-holder-modal {
|
|
51
|
+
.pisell-view-grid-item {
|
|
52
|
+
> div {
|
|
53
|
+
height: 100%;
|
|
54
|
+
.pisell-lowcode-card {
|
|
55
|
+
height: 100% !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pisell-lowcode-select-holder-modal-title {
|
|
61
|
+
color: var(--Gray-900, #101828);
|
|
62
|
+
font-size: 18px;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
line-height: 28px;
|
|
65
|
+
margin-bottom: 16px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pisell-lowcode-select-holder-selected-info {
|
|
69
|
+
margin-bottom: 16px;
|
|
70
|
+
color: #d92d20;
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
line-height: 20px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pisell-lowcode-select-holder-selected-info-max {
|
|
77
|
+
color: #7f56d9;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.pisell-lowcode-select-holder-add-card {
|
|
81
|
+
.pisell-lowcode-avatar {
|
|
82
|
+
background: var(--Primary-100, #f4ebff);
|
|
83
|
+
.pisell-lowcode-avatar-string {
|
|
84
|
+
line-height: 32px !important;
|
|
85
|
+
width: 32px;
|
|
86
|
+
height: 32px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.anticon {
|
|
90
|
+
font-size: 32px !important;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.select-holder-name {
|
|
95
|
+
color: var(--Text-Text_1, #1b1b1b);
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
line-height: 20px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// .pisell-lowcode-select-holder-footer {
|
|
104
|
+
// display: flex;
|
|
105
|
+
// gap: 12px;
|
|
106
|
+
// width: 100%;
|
|
107
|
+
// button {
|
|
108
|
+
// flex: 1;
|
|
109
|
+
// height: 40px;
|
|
110
|
+
// }
|
|
111
|
+
// }
|
|
112
|
+
|
|
113
|
+
// .pisell-lowcode-select-holder-modal-mobile {
|
|
114
|
+
// .pisell-lowcode-modal-header {
|
|
115
|
+
// border: none !important;
|
|
116
|
+
// }
|
|
117
|
+
// }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell-select-holder-create': string;
|
|
4
|
+
'pisell-select-holder-please-select': string;
|
|
5
|
+
'pisell-select-holder-selected': string;
|
|
6
|
+
'pisell-select-holder-skip': string;
|
|
7
|
+
};
|
|
8
|
+
'zh-CN': {
|
|
9
|
+
'pisell-select-holder-create': string;
|
|
10
|
+
'pisell-select-holder-please-select': string;
|
|
11
|
+
'pisell-select-holder-selected': string;
|
|
12
|
+
'pisell-select-holder-skip': string;
|
|
13
|
+
};
|
|
14
|
+
'zh-TW': {
|
|
15
|
+
'pisell-select-holder-create': string;
|
|
16
|
+
'pisell-select-holder-please-select': string;
|
|
17
|
+
'pisell-select-holder-selected': string;
|
|
18
|
+
'pisell-select-holder-skip': string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell-select-holder-create': 'Create',
|
|
4
|
+
'pisell-select-holder-please-select': 'Please Select',
|
|
5
|
+
'pisell-select-holder-selected': 'Selected: ',
|
|
6
|
+
'pisell-select-holder-skip': 'Skip'
|
|
7
|
+
},
|
|
8
|
+
'zh-CN': {
|
|
9
|
+
'pisell-select-holder-create': '创建',
|
|
10
|
+
'pisell-select-holder-please-select': '请选择',
|
|
11
|
+
'pisell-select-holder-selected': '已选择:',
|
|
12
|
+
'pisell-select-holder-skip': '跳过'
|
|
13
|
+
},
|
|
14
|
+
'zh-TW': {
|
|
15
|
+
'pisell-select-holder-create': '創建',
|
|
16
|
+
'pisell-select-holder-please-select': '請選擇',
|
|
17
|
+
'pisell-select-holder-selected': '已選擇:',
|
|
18
|
+
'pisell-select-holder-skip': '跳過'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 获取头像文本
|
|
3
|
+
* @description: 获取头像文本(标签的首字母,最多两个单词)
|
|
4
|
+
* @param {string} label
|
|
5
|
+
* @return {*}
|
|
6
|
+
* @Author: WangHan
|
|
7
|
+
* @Date: 2025-10-11 13:46
|
|
8
|
+
*/
|
|
9
|
+
export var getAvatarText = function getAvatarText(label) {
|
|
10
|
+
if (!label) return '';
|
|
11
|
+
var words = label.trim().split(/\s+/);
|
|
12
|
+
var initials = words.slice(0, 2).map(function (word) {
|
|
13
|
+
return word.charAt(0).toUpperCase();
|
|
14
|
+
}).join('');
|
|
15
|
+
return initials;
|
|
16
|
+
};
|
|
@@ -13,7 +13,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
13
|
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; }
|
|
14
14
|
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; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
import React, { useCallback, useMemo, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
16
|
+
import React, { useCallback, useMemo, useState, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
17
17
|
import { locales } from '@pisell/utils';
|
|
18
18
|
import { Radio, Form, InputNumber } from 'antd';
|
|
19
19
|
import { Icon, PisellModal, WalletCard, Translation } from '@pisell/materials';
|
|
@@ -25,6 +25,7 @@ import SortableWalletPassTypes, { DEFAULT_WALLET_PASS_TYPES_CONFIG } from "./com
|
|
|
25
25
|
import ValidityPeriodSelector from "./components/ValidityPeriodSelector";
|
|
26
26
|
import RelationProduct from "./components/relationProduct";
|
|
27
27
|
import "./WalletEditor.less";
|
|
28
|
+
import useComponents from "../../hooks/useComponents";
|
|
28
29
|
var WalletEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
29
30
|
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _context$appHelper$ut6, _store$global;
|
|
30
31
|
var value = props.value,
|
|
@@ -52,6 +53,12 @@ var WalletEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
52
53
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
53
54
|
form = _Form$useForm2[0];
|
|
54
55
|
var isControlled = value !== undefined;
|
|
56
|
+
var _useComponents = useComponents({
|
|
57
|
+
components: ['HolderSelector']
|
|
58
|
+
}),
|
|
59
|
+
_useComponents2 = _slicedToArray(_useComponents, 1),
|
|
60
|
+
HolderSelector = _useComponents2[0];
|
|
61
|
+
var holderSelectorRef = useRef(null);
|
|
55
62
|
|
|
56
63
|
// 默认值
|
|
57
64
|
var defaultValue = useMemo(function () {
|
|
@@ -63,6 +70,9 @@ var WalletEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
63
70
|
type: 'normal'
|
|
64
71
|
},
|
|
65
72
|
metadata: {
|
|
73
|
+
holder: {
|
|
74
|
+
type: 'customer'
|
|
75
|
+
},
|
|
66
76
|
showcaseWalletPassNew: DEFAULT_WALLET_PASS_TYPES_CONFIG.map(function (item) {
|
|
67
77
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
68
78
|
display: 1
|
|
@@ -200,7 +210,55 @@ var WalletEditor = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
200
210
|
label: locales.getText('linkedPasses'),
|
|
201
211
|
name: "relation_id",
|
|
202
212
|
initialValue: []
|
|
203
|
-
}, /*#__PURE__*/React.createElement(RelationProduct, null)), /*#__PURE__*/React.createElement(Form.Item, {
|
|
213
|
+
}, /*#__PURE__*/React.createElement(RelationProduct, null)), HolderSelector && /*#__PURE__*/React.createElement(Form.Item, {
|
|
214
|
+
label: locales.getText('pisell2.wallet-editor.holder'),
|
|
215
|
+
name: ['metadata', 'holder'],
|
|
216
|
+
initialValue: {
|
|
217
|
+
type: 'customer'
|
|
218
|
+
},
|
|
219
|
+
rules: [{
|
|
220
|
+
validator: function () {
|
|
221
|
+
var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_, value) {
|
|
222
|
+
var _value$custom, _holderSelectorRef$cu, _holderSelectorRef$cu2, options;
|
|
223
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
224
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
225
|
+
case 0:
|
|
226
|
+
if (!((value === null || value === void 0 ? void 0 : value.type) === 'custom')) {
|
|
227
|
+
_context2.next = 6;
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
if (value !== null && value !== void 0 && (_value$custom = value.custom) !== null && _value$custom !== void 0 && _value$custom.custom_id) {
|
|
231
|
+
_context2.next = 3;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
return _context2.abrupt("return", Promise.reject(new Error(locales.getText('pisell2.wallet-editor.holder.required'))));
|
|
235
|
+
case 3:
|
|
236
|
+
options = ((_holderSelectorRef$cu = holderSelectorRef.current) === null || _holderSelectorRef$cu === void 0 || (_holderSelectorRef$cu2 = _holderSelectorRef$cu.getOptions) === null || _holderSelectorRef$cu2 === void 0 ? void 0 : _holderSelectorRef$cu2.call(_holderSelectorRef$cu)) || [];
|
|
237
|
+
if (options !== null && options !== void 0 && options.find(function (item) {
|
|
238
|
+
var _value$custom2;
|
|
239
|
+
return item.value === (value === null || value === void 0 || (_value$custom2 = value.custom) === null || _value$custom2 === void 0 ? void 0 : _value$custom2.custom_id);
|
|
240
|
+
})) {
|
|
241
|
+
_context2.next = 6;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
return _context2.abrupt("return", Promise.reject(new Error(locales.getText('pisell2.wallet-editor.holder.invalid'))));
|
|
245
|
+
case 6:
|
|
246
|
+
return _context2.abrupt("return", Promise.resolve());
|
|
247
|
+
case 7:
|
|
248
|
+
case "end":
|
|
249
|
+
return _context2.stop();
|
|
250
|
+
}
|
|
251
|
+
}, _callee2);
|
|
252
|
+
}));
|
|
253
|
+
function validator(_x3, _x4) {
|
|
254
|
+
return _validator2.apply(this, arguments);
|
|
255
|
+
}
|
|
256
|
+
return validator;
|
|
257
|
+
}()
|
|
258
|
+
}]
|
|
259
|
+
}, /*#__PURE__*/React.createElement(HolderSelector, {
|
|
260
|
+
ref: holderSelectorRef
|
|
261
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
204
262
|
label: locales.getText('sort'),
|
|
205
263
|
name: "sort"
|
|
206
264
|
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
@@ -44,7 +44,10 @@ export default {
|
|
|
44
44
|
enterJSONConfig: 'Enter JSON config, e.g. {"type": "register"}',
|
|
45
45
|
selectValidityPeriod: 'Select validity period',
|
|
46
46
|
selectCustomDate: 'Select custom date',
|
|
47
|
-
registerToIssue: 'Register to issue'
|
|
47
|
+
registerToIssue: 'Register to issue',
|
|
48
|
+
'pisell2.wallet-editor.holder': 'Holder',
|
|
49
|
+
'pisell2.wallet-editor.holder.required': 'Please select a holder',
|
|
50
|
+
'pisell2.wallet-editor.holder.invalid': 'Invalid holder. Please select again'
|
|
48
51
|
},
|
|
49
52
|
'zh-CN': {
|
|
50
53
|
// 表单标签
|
|
@@ -91,7 +94,10 @@ export default {
|
|
|
91
94
|
enterJSONConfig: '输入JSON配置,例如 {"type": "register"}',
|
|
92
95
|
selectValidityPeriod: '选择有效期',
|
|
93
96
|
selectCustomDate: '选择自定义日期',
|
|
94
|
-
registerToIssue: '注册即发放'
|
|
97
|
+
registerToIssue: '注册即发放',
|
|
98
|
+
'pisell2.wallet-editor.holder': '持有人',
|
|
99
|
+
'pisell2.wallet-editor.holder.required': '请选择持有人',
|
|
100
|
+
'pisell2.wallet-editor.holder.invalid': '无效持有人,请重新选择'
|
|
95
101
|
},
|
|
96
102
|
'zh-HK': {
|
|
97
103
|
// 表單標籤
|
|
@@ -138,6 +144,9 @@ export default {
|
|
|
138
144
|
enterJSONConfig: '輸入JSON配置,例如 {"type": "register"}',
|
|
139
145
|
selectValidityPeriod: '選擇有效期',
|
|
140
146
|
selectCustomDate: '選擇自定義日期',
|
|
141
|
-
registerToIssue: '註冊即發放'
|
|
147
|
+
registerToIssue: '註冊即發放',
|
|
148
|
+
'pisell2.wallet-editor.holder': '持有人',
|
|
149
|
+
'pisell2.wallet-editor.holder.required': '請選擇持有人',
|
|
150
|
+
'pisell2.wallet-editor.holder.invalid': '無效持有人,請重新選擇'
|
|
142
151
|
}
|
|
143
152
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["id", "tag", "product_title", "balance", "code", "encoded", "expire_date", "shop", "limit_status", "product_cover", "par_value", "unified_messages"];
|
|
1
|
+
var _excluded = ["id", "tag", "product_title", "balance", "code", "encoded", "expire_date", "shop", "limit_status", "product_cover", "par_value", "unified_messages", "holder", "metadata"];
|
|
2
2
|
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); }
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
@@ -15,7 +15,8 @@ var PassList = function PassList(props) {
|
|
|
15
15
|
valuePropName = _props$valuePropName === void 0 ? 'id' : _props$valuePropName,
|
|
16
16
|
hasMore = props.hasMore,
|
|
17
17
|
onLoadMore = props.onLoadMore,
|
|
18
|
-
loading = props.loading
|
|
18
|
+
loading = props.loading,
|
|
19
|
+
onEditHolder = props.onEditHolder;
|
|
19
20
|
var _loadMore = /*#__PURE__*/React.createElement("div", {
|
|
20
21
|
style: {
|
|
21
22
|
textAlign: 'center',
|
|
@@ -31,7 +32,7 @@ var PassList = function PassList(props) {
|
|
|
31
32
|
color: '#999'
|
|
32
33
|
}
|
|
33
34
|
}, locales.getText('wallet-pass-gallery.allLoaded')));
|
|
34
|
-
return /*#__PURE__*/React.createElement(List, {
|
|
35
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(List, {
|
|
35
36
|
className: "pisell-wallet-pass-gallery_list",
|
|
36
37
|
itemLayout: "horizontal",
|
|
37
38
|
dataSource: dataSource,
|
|
@@ -62,6 +63,8 @@ var PassList = function PassList(props) {
|
|
|
62
63
|
par_value = _item$par_value === void 0 ? '' : _item$par_value,
|
|
63
64
|
_item$unified_message = item.unified_messages,
|
|
64
65
|
unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message,
|
|
66
|
+
holder = item.holder,
|
|
67
|
+
metadata = item.metadata,
|
|
65
68
|
rest = _objectWithoutProperties(item, _excluded);
|
|
66
69
|
// 用于选中状态和变更回调的值(支持自定义属性名)
|
|
67
70
|
var itemValue = item === null || item === void 0 ? void 0 : item[valuePropName];
|
|
@@ -107,9 +110,18 @@ var PassList = function PassList(props) {
|
|
|
107
110
|
discount: isDiscountCard ? Number(par_value) : undefined,
|
|
108
111
|
showDiscount: isDiscountCard,
|
|
109
112
|
code: encoded,
|
|
110
|
-
validDate: expire_date
|
|
113
|
+
validDate: expire_date,
|
|
114
|
+
holder: holder,
|
|
115
|
+
onSetHolder: function onSetHolder() {
|
|
116
|
+
var _holder$metadata;
|
|
117
|
+
onEditHolder === null || onEditHolder === void 0 || onEditHolder({
|
|
118
|
+
wallet_pass_detail_id: id,
|
|
119
|
+
customer_id: holder === null || holder === void 0 ? void 0 : holder.customer_id,
|
|
120
|
+
form_id: holder === null || holder === void 0 || (_holder$metadata = holder.metadata) === null || _holder$metadata === void 0 ? void 0 : _holder$metadata.custom_id
|
|
121
|
+
});
|
|
122
|
+
}
|
|
111
123
|
}))));
|
|
112
124
|
}
|
|
113
|
-
});
|
|
125
|
+
}));
|
|
114
126
|
};
|
|
115
127
|
export default PassList;
|