@pisell/private-materials 6.4.11 → 6.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +150 -150
  7. package/build/lowcode/render/default/view.js +1 -1
  8. package/build/lowcode/view.js +8 -8
  9. package/es/components/Sales/Summary/utils.d.ts +1 -1
  10. package/es/components/booking/addons/model.d.ts +10 -1
  11. package/es/components/booking/forms/model.d.ts +10 -1
  12. package/es/components/booking/info/model.d.ts +10 -1
  13. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  14. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  15. package/es/components/booking/model.d.ts +9 -1
  16. package/es/components/booking/notes/model.d.ts +10 -1
  17. package/es/components/booking/payments/model.d.ts +10 -1
  18. package/es/components/booking/utils.d.ts +2 -2
  19. package/es/components/checkout/PaymentModal.js +59 -23
  20. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  21. package/es/components/eftposPay/hooks.d.ts +1 -1
  22. package/es/components/eftposPay/store/index.d.ts +4 -4
  23. package/es/components/pay/toC/model.d.ts +9 -1
  24. package/es/components/schedules/model.d.ts +9 -1
  25. package/es/components/schedules/utils.d.ts +1 -1
  26. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  27. package/es/components/wallet/Detail/model.d.ts +13 -1
  28. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  29. package/es/components/wallet/PointCard/model.d.ts +13 -1
  30. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  31. package/es/components/wallet/Voucher/model.d.ts +13 -1
  32. package/es/components/wallet/model.d.ts +9 -1
  33. package/es/utils/index.d.ts +1 -1
  34. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  35. package/lib/components/booking/addons/model.d.ts +10 -1
  36. package/lib/components/booking/forms/model.d.ts +10 -1
  37. package/lib/components/booking/info/model.d.ts +10 -1
  38. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  39. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  40. package/lib/components/booking/model.d.ts +9 -1
  41. package/lib/components/booking/notes/model.d.ts +10 -1
  42. package/lib/components/booking/payments/model.d.ts +10 -1
  43. package/lib/components/booking/utils.d.ts +2 -2
  44. package/lib/components/checkout/PaymentModal.js +45 -6
  45. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  46. package/lib/components/eftposPay/hooks.d.ts +1 -1
  47. package/lib/components/eftposPay/store/index.d.ts +4 -4
  48. package/lib/components/pay/toC/model.d.ts +9 -1
  49. package/lib/components/schedules/model.d.ts +9 -1
  50. package/lib/components/schedules/utils.d.ts +1 -1
  51. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  52. package/lib/components/wallet/Detail/model.d.ts +13 -1
  53. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  54. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  55. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  56. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  57. package/lib/components/wallet/model.d.ts +9 -1
  58. package/lib/utils/index.d.ts +1 -1
  59. package/package.json +12 -12
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
165
165
  export declare const getDuration: (duration: number | {
166
166
  type: string;
167
167
  value: number;
168
- }) => number | {
168
+ }) => number | "flexible" | {
169
169
  type: string;
170
170
  value: number;
171
- } | "flexible";
171
+ };
172
172
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
173
  export declare const getIsEdit: (state: any) => boolean;
174
174
  export {};
@@ -1188,15 +1188,16 @@ var PaymentModal = ({
1188
1188
  setOrderNote(data.order_info.order_note);
1189
1189
  }
1190
1190
  }, [data]);
1191
- const [isLocalOrderCreated, setIsLocalOrderCreated] = (0, import_react.useState)(false);
1191
+ const logger = (0, import_usePaymentLogger.default)();
1192
+ const isLocalOrderCreated = (0, import_react.useRef)(void 0);
1192
1193
  const unsubscribeRef = (0, import_react.useRef)(void 0);
1193
1194
  (0, import_react.useEffect)(() => {
1194
1195
  const initCheckoutData = async () => {
1195
1196
  var _a2, _b2;
1196
1197
  try {
1197
1198
  const checkout = pisellos == null ? void 0 : pisellos.getModule("checkout");
1198
- if (checkout && data && !isLocalOrderCreated) {
1199
- setIsLocalOrderCreated(true);
1199
+ if (checkout && data && !isLocalOrderCreated.current) {
1200
+ isLocalOrderCreated.current = true;
1200
1201
  const shop_wallet_pass_id = await (0, import_utils2.getShopWalletPassId)(interaction);
1201
1202
  checkout.setOtherParams({
1202
1203
  is_price_include_tax: getData("is_price_include_tax"),
@@ -1224,6 +1225,15 @@ var PaymentModal = ({
1224
1225
  setTotalAmount(orderInfo2.totalAmount);
1225
1226
  }
1226
1227
  setOrderInfo(orderInfo2);
1228
+ if (unsubscribeRef.current) {
1229
+ logger == null ? void 0 : logger.addLog({
1230
+ type: "info",
1231
+ title: "有重复的checkout:onOrderSynced,清空",
1232
+ metadata: {}
1233
+ });
1234
+ unsubscribeRef.current();
1235
+ unsubscribeRef.current = void 0;
1236
+ }
1227
1237
  unsubscribeRef.current = checkout.core.effects.on("checkout:onOrderSynced", (data2) => {
1228
1238
  var _a3, _b3, _c2;
1229
1239
  const responseData = (_a3 = data2.response) == null ? void 0 : _a3.data;
@@ -1241,6 +1251,13 @@ var PaymentModal = ({
1241
1251
  const failureReason = responseData == null ? void 0 : responseData.failure_reason;
1242
1252
  if (paymentStatus) {
1243
1253
  console.log("print_order_onOrderSynced>>>>", responseData);
1254
+ logger == null ? void 0 : logger.addLog({
1255
+ type: "info",
1256
+ title: "print_order_onOrderSynced",
1257
+ metadata: {
1258
+ responseData
1259
+ }
1260
+ });
1244
1261
  try {
1245
1262
  const params = {
1246
1263
  type: "99",
@@ -1252,11 +1269,32 @@ var PaymentModal = ({
1252
1269
  }
1253
1270
  };
1254
1271
  console.log("print_order_onOrderSynced_params>>>>", params);
1272
+ logger == null ? void 0 : logger.addLog({
1273
+ type: "info",
1274
+ title: "print_order_onOrderSynced_params",
1275
+ metadata: {
1276
+ params
1277
+ }
1278
+ });
1255
1279
  (0, import_utils.webPrint)(params, (res) => {
1256
1280
  console.log("print_order_onOrderSynced_res>>>>", res);
1281
+ logger == null ? void 0 : logger.addLog({
1282
+ type: "info",
1283
+ title: "print_order_onOrderSynced_res",
1284
+ metadata: {
1285
+ res
1286
+ }
1287
+ });
1257
1288
  });
1258
1289
  } catch (error) {
1259
1290
  console.error("print_order_onOrderSynced_error>>>>", error);
1291
+ logger == null ? void 0 : logger.addLog({
1292
+ type: "info",
1293
+ title: "print_order_onOrderSynced_error",
1294
+ metadata: {
1295
+ error
1296
+ }
1297
+ });
1260
1298
  }
1261
1299
  const statusClassName = (0, import_PaymentResultToastUtils.calculateStatusClassName)(paymentStatus);
1262
1300
  const autoCloseConfig = (0, import_PaymentResultToastUtils.calculateAutoCloseConfig)(
@@ -1288,11 +1326,11 @@ var PaymentModal = ({
1288
1326
  handlePaymentComplete(data2);
1289
1327
  }
1290
1328
  });
1291
- } else if (isLocalOrderCreated) {
1329
+ } else if (isLocalOrderCreated.current) {
1292
1330
  console.log(
1293
1331
  "🔄 PaymentModal: data changed, updating checkout data..."
1294
1332
  );
1295
- setIsLocalOrderCreated(false);
1333
+ isLocalOrderCreated.current = false;
1296
1334
  await checkout.cancelCurrentOrderAsync();
1297
1335
  await checkout.createLocalOrderAsync({
1298
1336
  orderData: data == null ? void 0 : data.order_info,
@@ -1305,7 +1343,7 @@ var PaymentModal = ({
1305
1343
  setTotalAmount(orderInfo2.totalAmount);
1306
1344
  }
1307
1345
  setOrderInfo(orderInfo2);
1308
- setIsLocalOrderCreated(true);
1346
+ isLocalOrderCreated.current = true;
1309
1347
  }
1310
1348
  } catch (error) {
1311
1349
  console.error("Failed to initialize checkout data:", error);
@@ -1320,6 +1358,7 @@ var PaymentModal = ({
1320
1358
  var _a2;
1321
1359
  if (typeof unsubscribeRef.current === "function") {
1322
1360
  (_a2 = unsubscribeRef.current) == null ? void 0 : _a2.call(unsubscribeRef);
1361
+ unsubscribeRef.current = void 0;
1323
1362
  }
1324
1363
  };
1325
1364
  }, []);
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
17
17
  cardData: any;
18
18
  handleSelectWallet: (value: number[]) => void;
19
19
  selectedWalletIds: any[];
20
- expiredWalletIds: any;
20
+ expiredWalletIds: any[];
21
21
  expiredWalletData: any;
22
22
  disabledWalletData: any[];
23
23
  clearAllSelectedWallet: () => void;
@@ -15,7 +15,7 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
174
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
175
175
  type: EActionTypes;
176
176
  payload: {
177
- status: "loading" | "warn" | "success" | "fail" | "question";
177
+ status: "loading" | "success" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
298
+ mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
300
  eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
- action?: "amount" | "pay" | "deviceList" | undefined;
301
+ action?: "pay" | "amount" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
312
312
  warn?: string | undefined;
313
313
  steps?: {
314
314
  /** 用于重置当前步骤 */
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  platform: 'pc' | 'h5' | '' | undefined;
3
4
  order: any;
@@ -28,4 +29,11 @@ export interface PayGroup {
28
29
  pay_number?: string;
29
30
  _order: any;
30
31
  }
31
- export declare const Provider: any, Context: any;
32
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
33
+ state: FormState;
34
+ } & {
35
+ dispatch: (params: {
36
+ type: string;
37
+ payload: any;
38
+ }) => void;
39
+ }>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,4 +69,11 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: any, Context: any;
72
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
73
+ state: FormState;
74
+ } & {
75
+ dispatch: (params: {
76
+ type: string;
77
+ payload: any;
78
+ }) => void;
79
+ }>;
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
17
17
  export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
18
18
  export declare const saveConfirm: () => Promise<{
19
19
  destroy: () => void;
20
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
20
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
21
21
  }>;
22
22
  export { modal };
@@ -41,7 +41,7 @@ declare type ScanData = {
41
41
  };
42
42
  };
43
43
  export declare const formatScanCustomer: (data: ScanData) => {
44
- searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
44
+ searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
45
45
  data: any;
46
46
  scanCode: string;
47
47
  } | null;
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ addWalletCard: any;
4
+ }
5
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
6
+ walletDetailState: RechargeState;
7
+ } & {
8
+ dispatch: (params: {
9
+ type: string;
10
+ payload: any;
11
+ }) => void;
12
+ }>;
13
+ export {};
@@ -1 +1,14 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: number;
4
+ setup?: 'menu' | 'list' | 'detail' | string;
5
+ }
6
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
7
+ state: RechargeState;
8
+ } & {
9
+ dispatch: (params: {
10
+ type: string;
11
+ payload: any;
12
+ }) => void;
13
+ }>;
14
+ export {};
@@ -1 +1,13 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ interface RechargeState {
3
+ total: number;
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 +1,29 @@
1
- export declare const Provider: any, Context: any;
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
- export declare const Provider: any, Context: any;
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: any;
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
+ }>;
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
18
18
  export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
19
19
  export declare const saveConfirm: () => Promise<{
20
20
  destroy: () => void;
21
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
21
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
22
22
  }>;
23
23
  export { modal };
package/package.json CHANGED
@@ -1,12 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.4.11",
4
- "scripts": {
5
- "dev": "father dev",
6
- "build": "father build",
7
- "lowcode:dev": "build-scripts start --config ./build.lowcode.js",
8
- "lowcode:build": " build-scripts build --config ./build.lowcode.js"
9
- },
3
+ "version": "6.4.13",
10
4
  "main": "./lib/index.js",
11
5
  "module": "./es/index.js",
12
6
  "types": "./lib/index.d.ts",
@@ -56,10 +50,6 @@
56
50
  "@dnd-kit/modifiers": "^6.0.1",
57
51
  "@dnd-kit/sortable": "^7.0.2",
58
52
  "@dnd-kit/utilities": "^3.2.1",
59
- "@pisell/date-picker": "workspace:*",
60
- "@pisell/icon": "workspace:*",
61
- "@pisell/materials": "workspace:*",
62
- "@pisell/utils": "workspace:*",
63
53
  "ahooks": "^3.7.6",
64
54
  "antd": "^5.6.3",
65
55
  "classnames": "^2.3.2",
@@ -68,7 +58,11 @@
68
58
  "rc-virtual-list": "^3.11.3",
69
59
  "react-infinite-scroll-component": "^6.1.0",
70
60
  "react-resizable": "^3.0.5",
71
- "styled-components": "^6.0.0-rc.3"
61
+ "styled-components": "^6.0.0-rc.3",
62
+ "@pisell/date-picker": "3.0.6",
63
+ "@pisell/materials": "6.4.1",
64
+ "@pisell/icon": "0.0.11",
65
+ "@pisell/utils": "3.0.2"
72
66
  },
73
67
  "peerDependencies": {
74
68
  "react": "^18.0.0",
@@ -76,5 +70,11 @@
76
70
  },
77
71
  "componentConfig": {
78
72
  "materialSchema": "https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/assets-prod.json"
73
+ },
74
+ "scripts": {
75
+ "dev": "father dev",
76
+ "build": "father build",
77
+ "lowcode:dev": "build-scripts start --config ./build.lowcode.js",
78
+ "lowcode:build": " build-scripts build --config ./build.lowcode.js"
79
79
  }
80
80
  }