@pisell/private-materials 6.4.41 → 6.4.43
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/actionButtons/index.js +37 -42
- package/es/components/booking/components/actionButtons/index.less +0 -28
- package/es/components/booking/components/footer/amount.d.ts +3 -3
- package/es/components/booking/components/footer/amount.js +13 -2
- package/es/components/booking/components/footer/index.js +168 -68
- package/es/components/booking/components/footer/utils.js +62 -33
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/addService/index.js +2 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/index.js +42 -2
- package/es/components/booking/info2/service/addService/index.js +2 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +12 -4
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.d.ts +2 -0
- package/es/components/checkout/PaymentModal.js +395 -240
- package/es/components/checkout/components/AdditionalModule/index.less +1 -1
- package/es/components/checkout/components/AmountSummary/index.js +161 -54
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/es/components/checkout/components/CashPaymentModule/index.js +114 -137
- package/es/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +210 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/es/components/checkout/components/PaymentOptionsModule/index.js +12 -114
- package/es/components/checkout/components/PaymentOptionsModule/index.less +29 -0
- package/es/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
- package/es/components/checkout/components/WalletPassModule/index.js +3 -2
- package/es/components/checkout/components/WalletPassModule/utils.js +6 -1
- package/es/components/checkout/hooks/useWalletPass.js +2 -0
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +33 -0
- package/es/components/checkout/locales.js +39 -3
- package/es/components/checkout/types.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/shoppingCart/components/Cart/Product.js +143 -71
- package/es/components/shoppingCart/components/Cart/index.js +1 -1
- package/es/components/shoppingCart/components/Cart/index.less +31 -0
- package/es/components/shoppingCart/locales.d.ts +3 -0
- package/es/components/shoppingCart/locales.js +12 -3
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/es/components/ticketBooking/utils/index.js +2 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +1 -1
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +148 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.js +1 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.js +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +310 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +349 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +49 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.js +41 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +442 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +44 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +444 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.js +47 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +47 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/es/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/es/pro/priceKeyboard/hooks/keyActions.js +252 -0
- package/es/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
- package/es/pro/priceKeyboard/hooks/rightItems.js +50 -0
- package/es/pro/priceKeyboard/index.d.ts +3 -0
- package/es/pro/priceKeyboard/index.js +3 -0
- package/es/pro/priceKeyboard/index.less +215 -0
- package/es/pro/priceKeyboard/utils.d.ts +31 -0
- package/es/pro/priceKeyboard/utils.js +51 -0
- package/es/pro/skuDetailModal/index.js +19 -16
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/actionButtons/index.js +31 -28
- package/lib/components/booking/components/actionButtons/index.less +0 -28
- package/lib/components/booking/components/footer/amount.d.ts +3 -3
- package/lib/components/booking/components/footer/amount.js +10 -4
- package/lib/components/booking/components/footer/index.js +107 -40
- package/lib/components/booking/components/footer/utils.js +35 -7
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/addService/index.js +2 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/index.js +18 -1
- package/lib/components/booking/info2/service/addService/index.js +2 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +12 -4
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.d.ts +2 -0
- package/lib/components/checkout/PaymentModal.js +152 -73
- package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
- package/lib/components/checkout/components/AmountSummary/index.js +114 -40
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/lib/components/checkout/components/CashPaymentModule/index.js +103 -140
- package/lib/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +172 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -123
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +29 -0
- package/lib/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
- package/lib/components/checkout/components/WalletPassModule/index.js +3 -2
- package/lib/components/checkout/components/WalletPassModule/utils.js +4 -1
- package/lib/components/checkout/hooks/useWalletPass.js +2 -0
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +33 -0
- package/lib/components/checkout/locales.js +39 -3
- package/lib/components/checkout/types.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +111 -51
- package/lib/components/shoppingCart/components/Cart/index.js +1 -1
- package/lib/components/shoppingCart/components/Cart/index.less +31 -0
- package/lib/components/shoppingCart/locales.d.ts +3 -0
- package/lib/components/shoppingCart/locales.js +6 -3
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/lib/components/ticketBooking/index.js +5 -1
- package/lib/components/ticketBooking/utils/index.js +2 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +2 -2
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +144 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.js +35 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.js +17 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +4 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +332 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +399 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +11 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +76 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.js +65 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +485 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +68 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +11 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +488 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.js +71 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +79 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.js +176 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +27 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.js +81 -0
- package/lib/pro/priceKeyboard/index.d.ts +3 -0
- package/lib/pro/priceKeyboard/index.js +45 -0
- package/lib/pro/priceKeyboard/index.less +215 -0
- package/lib/pro/priceKeyboard/utils.d.ts +31 -0
- package/lib/pro/priceKeyboard/utils.js +75 -0
- package/lib/pro/skuDetailModal/index.js +18 -22
- package/package.json +3 -3
@@ -1 +1,29 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface RechargeState {
|
3
|
+
selectedGiftOptionId: string | null;
|
4
|
+
cardList: Array<{
|
5
|
+
id: string;
|
6
|
+
name: string;
|
7
|
+
price: number;
|
8
|
+
}>;
|
9
|
+
selectedItem: {
|
10
|
+
id?: string;
|
11
|
+
gift_price?: number;
|
12
|
+
price?: number;
|
13
|
+
name?: string;
|
14
|
+
variant_id?: string;
|
15
|
+
};
|
16
|
+
productId?: string;
|
17
|
+
detailId?: string;
|
18
|
+
total: string | number;
|
19
|
+
rechargeModalOpen: boolean;
|
20
|
+
}
|
21
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
22
|
+
state: RechargeState;
|
23
|
+
} & {
|
24
|
+
dispatch: (params: {
|
25
|
+
type: string;
|
26
|
+
payload: any;
|
27
|
+
}) => void;
|
28
|
+
}>;
|
29
|
+
export {};
|
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface RechargeState {
|
3
|
+
total: 0;
|
4
|
+
}
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
6
|
+
state: RechargeState;
|
7
|
+
} & {
|
8
|
+
dispatch: (params: {
|
9
|
+
type: string;
|
10
|
+
payload: any;
|
11
|
+
}) => void;
|
12
|
+
}>;
|
13
|
+
export {};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { IWalletListItemProps } from './serve';
|
2
3
|
export interface WalletCardItemProps {
|
3
4
|
id: string;
|
@@ -26,4 +27,11 @@ export interface WalletListProps {
|
|
26
27
|
currentSearchListItemCode?: string;
|
27
28
|
[key: string]: any;
|
28
29
|
}
|
29
|
-
export declare const Provider: any, Context:
|
30
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
31
|
+
global_wallet: WalletListProps;
|
32
|
+
} & {
|
33
|
+
dispatch: (params: {
|
34
|
+
type: string;
|
35
|
+
payload: any;
|
36
|
+
}) => void;
|
37
|
+
}>;
|
@@ -34,7 +34,7 @@ __export(PisellPriceKeyboardPopover_exports, {
|
|
34
34
|
module.exports = __toCommonJS(PisellPriceKeyboardPopover_exports);
|
35
35
|
var import_react = __toESM(require("react"));
|
36
36
|
var import_antd = require("antd");
|
37
|
-
var
|
37
|
+
var import_pisellAdjustPrice = __toESM(require("@pisell/materials/src/components/pisellAdjustPrice/index"));
|
38
38
|
var import_utils = require("@pisell/utils");
|
39
39
|
var import_PisellPriceKeyboardPopover = require("./PisellPriceKeyboardPopover.less");
|
40
40
|
var PisellPriceKeyboardPopover = (0, import_react.forwardRef)(
|
@@ -105,7 +105,7 @@ var PisellPriceKeyboardPopover = (0, import_react.forwardRef)(
|
|
105
105
|
onCancel == null ? void 0 : onCancel();
|
106
106
|
};
|
107
107
|
const keyboardContent = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-price-keyboard-popover-content" }, /* @__PURE__ */ import_react.default.createElement(
|
108
|
-
|
108
|
+
import_pisellAdjustPrice.default,
|
109
109
|
{
|
110
110
|
value: tempValue,
|
111
111
|
onChange: handlePriceChange,
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './PisellPriceKeyboardPopover.less';
|
3
|
+
import { PisellPriceKeyboardPopoverProps, PisellPriceKeyboardPopoverRef } from './types';
|
4
|
+
declare const PisellPriceKeyboardPopover: React.ForwardRefExoticComponent<PisellPriceKeyboardPopoverProps & React.RefAttributes<PisellPriceKeyboardPopoverRef>>;
|
5
|
+
export default PisellPriceKeyboardPopover;
|
@@ -0,0 +1,144 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
+
mod
|
26
|
+
));
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
|
+
|
29
|
+
// src/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.tsx
|
30
|
+
var PisellPriceKeyboardPopover_exports = {};
|
31
|
+
__export(PisellPriceKeyboardPopover_exports, {
|
32
|
+
default: () => PisellPriceKeyboardPopover_default
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(PisellPriceKeyboardPopover_exports);
|
35
|
+
var import_react = __toESM(require("react"));
|
36
|
+
var import_antd = require("antd");
|
37
|
+
var import_materials = require("@pisell/materials");
|
38
|
+
var import_utils = require("@pisell/utils");
|
39
|
+
var import_PisellPriceKeyboardPopover = require("./PisellPriceKeyboardPopover.less");
|
40
|
+
var PisellPriceKeyboardPopover = (0, import_react.forwardRef)(
|
41
|
+
({
|
42
|
+
children,
|
43
|
+
value = "",
|
44
|
+
onChange,
|
45
|
+
onConfirm,
|
46
|
+
onCancel,
|
47
|
+
showCurrencySymbol = true,
|
48
|
+
useThousandsSeparator = false,
|
49
|
+
selectType = "dark",
|
50
|
+
disabled = false,
|
51
|
+
overlayClassName = "",
|
52
|
+
style
|
53
|
+
}, ref) => {
|
54
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
55
|
+
const [tempValue, setTempValue] = (0, import_react.useState)("");
|
56
|
+
const [isFirstInput, setIsFirstInput] = (0, import_react.useState)(true);
|
57
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
58
|
+
open: () => {
|
59
|
+
setOpen(true);
|
60
|
+
setTempValue(value);
|
61
|
+
setIsFirstInput(true);
|
62
|
+
},
|
63
|
+
close: () => setOpen(false),
|
64
|
+
isOpen: () => open
|
65
|
+
}));
|
66
|
+
const handleOpenChange = (visible) => {
|
67
|
+
if (disabled) return;
|
68
|
+
setOpen(visible);
|
69
|
+
if (visible) {
|
70
|
+
setTempValue(value);
|
71
|
+
setIsFirstInput(true);
|
72
|
+
} else {
|
73
|
+
onCancel == null ? void 0 : onCancel();
|
74
|
+
}
|
75
|
+
};
|
76
|
+
const handlePriceChange = (val) => {
|
77
|
+
if ((val === "" || val === 0 || val === "0") && !isFirstInput) {
|
78
|
+
setIsFirstInput(true);
|
79
|
+
setTempValue(val);
|
80
|
+
onChange == null ? void 0 : onChange(val);
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
if (isFirstInput && val !== "" && val !== 0 && val !== "0") {
|
84
|
+
setIsFirstInput(false);
|
85
|
+
const currentValueStr = String(tempValue || "").replace(/[^\d.]/g, "");
|
86
|
+
const newValueStr = String(val).replace(/[^\d.]/g, "");
|
87
|
+
if (currentValueStr && currentValueStr !== "0" && newValueStr.length > currentValueStr.length && newValueStr.startsWith(currentValueStr)) {
|
88
|
+
const newInput = newValueStr.slice(currentValueStr.length);
|
89
|
+
if (newInput) {
|
90
|
+
setTempValue(newInput);
|
91
|
+
onChange == null ? void 0 : onChange(newInput);
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
setTempValue(val);
|
97
|
+
onChange == null ? void 0 : onChange(val);
|
98
|
+
};
|
99
|
+
const handleConfirm = (val) => {
|
100
|
+
onConfirm == null ? void 0 : onConfirm(val);
|
101
|
+
setOpen(false);
|
102
|
+
};
|
103
|
+
const handleCancel = () => {
|
104
|
+
setOpen(false);
|
105
|
+
onCancel == null ? void 0 : onCancel();
|
106
|
+
};
|
107
|
+
const keyboardContent = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-price-keyboard-popover-content" }, /* @__PURE__ */ import_react.default.createElement(
|
108
|
+
import_materials.PisellPriceKeyboard,
|
109
|
+
{
|
110
|
+
value: tempValue,
|
111
|
+
onChange: handlePriceChange,
|
112
|
+
onEnter: handleConfirm,
|
113
|
+
doneText: import_utils.locales.getText("pisell2.customise-item.save"),
|
114
|
+
resetText: import_utils.locales.getText("pisell2.booking.info.text.clear"),
|
115
|
+
amountProps: {
|
116
|
+
showCurrencySymbol,
|
117
|
+
useThousandsSeparator
|
118
|
+
},
|
119
|
+
selectType,
|
120
|
+
backgroundColor: "transparent"
|
121
|
+
}
|
122
|
+
));
|
123
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
124
|
+
import_antd.Popover,
|
125
|
+
{
|
126
|
+
open,
|
127
|
+
content: keyboardContent,
|
128
|
+
trigger: disabled ? [] : ["click"],
|
129
|
+
overlayInnerStyle: { padding: 0 },
|
130
|
+
destroyTooltipOnHide: true,
|
131
|
+
arrow: false,
|
132
|
+
align: {
|
133
|
+
offset: [0, 0]
|
134
|
+
},
|
135
|
+
overlayClassName: `pisell-price-keyboard-popover ${overlayClassName}`,
|
136
|
+
onOpenChange: handleOpenChange,
|
137
|
+
overlayStyle: style
|
138
|
+
},
|
139
|
+
children
|
140
|
+
);
|
141
|
+
}
|
142
|
+
);
|
143
|
+
PisellPriceKeyboardPopover.displayName = "PisellPriceKeyboardPopover";
|
144
|
+
var PisellPriceKeyboardPopover_default = PisellPriceKeyboardPopover;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.pisell-price-keyboard-popover {
|
2
|
+
&.ant-popover {
|
3
|
+
z-index: 1050;
|
4
|
+
|
5
|
+
.ant-popover-inner {
|
6
|
+
border-radius: 12px;
|
7
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
8
|
+
background: transparent;
|
9
|
+
}
|
10
|
+
|
11
|
+
.ant-popover-inner-content {
|
12
|
+
padding: 0;
|
13
|
+
background: transparent;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.pisell-price-keyboard-popover-content {
|
18
|
+
background: rgba(29, 41, 57, 0.8) !important;
|
19
|
+
border-radius: 10px;
|
20
|
+
overflow: hidden;
|
21
|
+
padding: 10px;
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
+
mod
|
26
|
+
));
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
28
|
+
|
29
|
+
// src/pro/pisellSimplePriceKeyboardPopover/index.tsx
|
30
|
+
var pisellSimplePriceKeyboardPopover_exports = {};
|
31
|
+
__export(pisellSimplePriceKeyboardPopover_exports, {
|
32
|
+
default: () => import_PisellPriceKeyboardPopover.default
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(pisellSimplePriceKeyboardPopover_exports);
|
35
|
+
var import_PisellPriceKeyboardPopover = __toESM(require("./PisellPriceKeyboardPopover"));
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export interface PisellPriceKeyboardPopoverProps {
|
3
|
+
/** 触发元素 */
|
4
|
+
children: React.ReactNode;
|
5
|
+
/** 当前价格值 */
|
6
|
+
value?: string | number;
|
7
|
+
/** 价格变化回调(合并了 onChange 和 onEnter) */
|
8
|
+
onChange?: (value: string | number) => void;
|
9
|
+
/** 确认回调 */
|
10
|
+
onConfirm?: (value: string | number) => void;
|
11
|
+
/** 取消回调 */
|
12
|
+
onCancel?: () => void;
|
13
|
+
/** 货币符号显示 */
|
14
|
+
showCurrencySymbol?: boolean;
|
15
|
+
/** 是否使用千分位分隔符 */
|
16
|
+
useThousandsSeparator?: boolean;
|
17
|
+
/** 键盘主题 */
|
18
|
+
selectType?: 'light' | 'dark';
|
19
|
+
/** 是否禁用 */
|
20
|
+
disabled?: boolean;
|
21
|
+
/** Popover 额外的类名 */
|
22
|
+
overlayClassName?: string;
|
23
|
+
/** 自定义样式 */
|
24
|
+
style?: React.CSSProperties;
|
25
|
+
}
|
26
|
+
export interface PisellPriceKeyboardPopoverRef {
|
27
|
+
/** 打开键盘 */
|
28
|
+
open: () => void;
|
29
|
+
/** 关闭键盘 */
|
30
|
+
close: () => void;
|
31
|
+
/** 获取当前是否打开 */
|
32
|
+
isOpen: () => boolean;
|
33
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
7
|
+
for (let key of __getOwnPropNames(from))
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
10
|
+
}
|
11
|
+
return to;
|
12
|
+
};
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
14
|
+
|
15
|
+
// src/pro/pisellSimplePriceKeyboardPopover/types.ts
|
16
|
+
var types_exports = {};
|
17
|
+
module.exports = __toCommonJS(types_exports);
|