@pisell/private-materials 6.6.86 → 6.6.88

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 (55) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/Sales/Summary/utils.d.ts +1 -1
  8. package/es/components/booking/addons/model.d.ts +10 -1
  9. package/es/components/booking/components/footer/utils.js +49 -38
  10. package/es/components/booking/forms/model.d.ts +10 -1
  11. package/es/components/booking/info/model.d.ts +10 -1
  12. package/es/components/booking/info2/service/editService/index.js +16 -8
  13. package/es/components/booking/model.d.ts +9 -1
  14. package/es/components/booking/notes/model.d.ts +10 -1
  15. package/es/components/booking/payments/model.d.ts +10 -1
  16. package/es/components/booking/utils.d.ts +2 -2
  17. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  18. package/es/components/eftposPay/hooks.d.ts +1 -1
  19. package/es/components/eftposPay/store/index.d.ts +3 -3
  20. package/es/components/pay/toC/model.d.ts +9 -1
  21. package/es/components/schedules/model.d.ts +9 -1
  22. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  23. package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  24. package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  25. package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  26. package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  27. package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  28. package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  29. package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  30. package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  31. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  32. package/lib/components/booking/addons/model.d.ts +10 -1
  33. package/lib/components/booking/components/footer/utils.js +13 -3
  34. package/lib/components/booking/forms/model.d.ts +10 -1
  35. package/lib/components/booking/info/model.d.ts +10 -1
  36. package/lib/components/booking/info2/service/editService/index.js +18 -6
  37. package/lib/components/booking/model.d.ts +9 -1
  38. package/lib/components/booking/notes/model.d.ts +10 -1
  39. package/lib/components/booking/payments/model.d.ts +10 -1
  40. package/lib/components/booking/utils.d.ts +2 -2
  41. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  42. package/lib/components/eftposPay/hooks.d.ts +1 -1
  43. package/lib/components/eftposPay/store/index.d.ts +3 -3
  44. package/lib/components/pay/toC/model.d.ts +9 -1
  45. package/lib/components/schedules/model.d.ts +9 -1
  46. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  47. package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  48. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  49. package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  50. package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  51. package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  52. package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  53. package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  54. package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  55. package/package.json +1 -1
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1,5 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from '../model';
1
3
  export declare const walkInData: {
2
4
  id: number;
3
5
  nickname: string;
4
6
  };
5
- export declare const Provider: any, Context: any;
7
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
+ state: FormState;
9
+ } & {
10
+ dispatch: (params: {
11
+ type: string;
12
+ payload: any;
13
+ }) => void;
14
+ }>;
@@ -562,7 +562,7 @@ var Info = (_, ref) => {
562
562
  }
563
563
  },
564
564
  callback: (e2, extension_type, detail) => {
565
- var _a3, _b3, _c3, _d3, _e3, _f2, _g2, _h2, _i2;
565
+ var _a3, _b3, _c3, _d3, _e3, _f2, _g2, _h2, _i2, _j2;
566
566
  isEditedRef.current = true;
567
567
  shouldReallocateBundlePriceRef.current = false;
568
568
  const _detail = detail || item;
@@ -579,12 +579,24 @@ var Info = (_, ref) => {
579
579
  other = (0, import_utils8.mergeBundleWithOriginalPrice)(other, ((_d3 = item._extend) == null ? void 0 : _d3.other) || {});
580
580
  }
581
581
  other.session = e2.session;
582
+ const originalVariantId = Number((item == null ? void 0 : item.product_variant_id) || 0);
583
+ const currentVariantId = Number((other == null ? void 0 : other.product_variant_id) || 0);
584
+ const isProductVariantChanged = originalVariantId !== currentVariantId;
585
+ const sourceProductPrice = ((_e3 = item == null ? void 0 : item.metadata) == null ? void 0 : _e3.source_product_price) ?? (item == null ? void 0 : item.source_product_price) ?? (item == null ? void 0 : item.price);
582
586
  let cacheItem = {
583
587
  ...item,
584
588
  ..._detail,
585
589
  product_id: item.id,
586
590
  _id: item == null ? void 0 : item._id,
587
591
  _key: e2.key,
592
+ metadata: {
593
+ ...item == null ? void 0 : item.metadata,
594
+ ..._detail == null ? void 0 : _detail.metadata,
595
+ ...(item == null ? void 0 : item.booking_id) ? {
596
+ // 仅编辑套餐时保留历史主商品价格;切换组合规格时由新规格重新生成。
597
+ source_product_price: isProductVariantChanged ? void 0 : sourceProductPrice
598
+ } : {}
599
+ },
588
600
  _extend: {
589
601
  ...item._extend,
590
602
  // 将当前表单的值覆盖进去
@@ -595,8 +607,8 @@ var Info = (_, ref) => {
595
607
  },
596
608
  new: 0
597
609
  };
598
- if (hasManualPriceAdjustment && ((_e3 = cacheItem == null ? void 0 : cacheItem.metadata) == null ? void 0 : _e3.main_product_selling_price)) {
599
- cacheItem._extend.price = (_f2 = cacheItem == null ? void 0 : cacheItem.metadata) == null ? void 0 : _f2.main_product_selling_price;
610
+ if (hasManualPriceAdjustment && ((_f2 = cacheItem == null ? void 0 : cacheItem.metadata) == null ? void 0 : _f2.main_product_selling_price)) {
611
+ cacheItem._extend.price = (_g2 = cacheItem == null ? void 0 : cacheItem.metadata) == null ? void 0 : _g2.main_product_selling_price;
600
612
  }
601
613
  let _total = (0, import_utils6.getProductTotalPrice)(cacheItem);
602
614
  cacheItem._extend.total = _total;
@@ -616,7 +628,7 @@ var Info = (_, ref) => {
616
628
  });
617
629
  }, 200);
618
630
  }
619
- const hasSourcePriceSnapshot = ((_g2 = cacheItem == null ? void 0 : cacheItem.metadata) == null ? void 0 : _g2.source_product_price) != null;
631
+ const hasSourcePriceSnapshot = ((_h2 = cacheItem == null ? void 0 : cacheItem.metadata) == null ? void 0 : _h2.source_product_price) != null;
620
632
  const origin_total = hasSourcePriceSnapshot || hasManualPriceAdjustment ? (0, import_utils6.getProductOriginTotalPrice)(cacheItem) : _total;
621
633
  if (hasManualPriceAdjustment && previousOriginTotal > 0 && Number.isFinite(previousTotal)) {
622
634
  const sellingRatio = new import_decimal.default(previousTotal).div(previousOriginTotal);
@@ -625,7 +637,7 @@ var Info = (_, ref) => {
625
637
  shouldReallocateBundlePriceRef.current = true;
626
638
  }
627
639
  cacheItem._extend.origin_total = origin_total;
628
- (((_h2 = cacheItem._extend) == null ? void 0 : _h2.items) || []).forEach((item2) => item2._extend.origin_total = origin_total);
640
+ (((_i2 = cacheItem._extend) == null ? void 0 : _i2.items) || []).forEach((item2) => item2._extend.origin_total = origin_total);
629
641
  dispatch({
630
642
  type: "setService",
631
643
  payload: {
@@ -634,7 +646,7 @@ var Info = (_, ref) => {
634
646
  });
635
647
  form.setFieldsValue({
636
648
  total: _total,
637
- capacity: (_i2 = cacheItem._extend) == null ? void 0 : _i2.capacity,
649
+ capacity: (_j2 = cacheItem._extend) == null ? void 0 : _j2.capacity,
638
650
  quantity: (e2 == null ? void 0 : e2.quantity) || (values == null ? void 0 : values.quantity) || 1
639
651
  });
640
652
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -109,4 +110,11 @@ export declare const walkInData: {
109
110
  id: number;
110
111
  nickname: string;
111
112
  };
112
- export declare const Provider: any, Context: any;
113
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
114
+ state: FormState;
115
+ } & {
116
+ dispatch: (params: {
117
+ type: string;
118
+ payload: any;
119
+ }) => void;
120
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -1 +1,10 @@
1
- export declare const Provider: any, Context: any;
1
+ /// <reference types="react" />
2
+ import { FormState } from "../model";
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
+ state: FormState;
5
+ } & {
6
+ dispatch: (params: {
7
+ type: string;
8
+ payload: any;
9
+ }) => void;
10
+ }>;
@@ -175,10 +175,10 @@ export declare const getProductOriginTotalPrice: (item: any) => number;
175
175
  export declare const getDuration: (duration: number | {
176
176
  type: string;
177
177
  value: number;
178
- }) => number | "flexible" | {
178
+ }) => number | {
179
179
  type: string;
180
180
  value: number;
181
- };
181
+ } | "flexible";
182
182
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
183
183
  export declare const getIsEdit: (state: any) => boolean;
184
184
  export {};
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
17
17
  cardData: any;
18
18
  handleSelectWallet: (this: unknown, value: number[]) => void;
19
19
  selectedWalletIds: any[];
20
- expiredWalletIds: any[];
20
+ expiredWalletIds: any;
21
21
  expiredWalletData: any;
22
22
  disabledWalletData: any[];
23
23
  clearAllSelectedWallet: (this: unknown) => void;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat">;
22
+ readonly eftposRef: React.MutableRefObject<"tyro" | "mx51" | "payo" | "windcave" | "stripe" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -299,15 +299,15 @@ export declare const backUpFree: (payload: Partial<State>) => {
299
299
  name?: string | undefined;
300
300
  symbol?: string | undefined;
301
301
  amount?: string | number | undefined;
302
- mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
302
+ mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
303
303
  order_id?: string | number | undefined;
304
- eftpos?: "stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat" | undefined;
304
+ eftpos?: "tyro" | "mx51" | "payo" | "windcave" | "stripe" | "linkly" | "huifu" | "adyenpos" | "adyenalipay" | "adyenwechat" | undefined;
305
305
  action?: "amount" | "pay" | "deviceList" | undefined;
306
306
  key?: number | undefined;
307
307
  step?: number | undefined;
308
308
  title?: string | undefined;
309
309
  subTitle?: string | undefined;
310
- type?: "unset" | "step" | undefined;
310
+ type?: "step" | "unset" | undefined;
311
311
  render?: boolean | undefined;
312
312
  net?: boolean | undefined;
313
313
  component?: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  platform: 'pc' | 'h5' | '' | undefined;
3
4
  order: any;
@@ -29,4 +30,11 @@ export interface PayGroup {
29
30
  _order: any;
30
31
  front_order_uuid?: string;
31
32
  }
32
- export declare const Provider: any, Context: any;
33
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
34
+ state: FormState;
35
+ } & {
36
+ dispatch: (params: {
37
+ type: string;
38
+ payload: any;
39
+ }) => void;
40
+ }>;
@@ -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
+ }>;
@@ -47,7 +47,7 @@ declare type ScanData = {
47
47
  };
48
48
  };
49
49
  export declare const formatScanCustomer: (data: ScanData) => {
50
- searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
50
+ searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
51
51
  data: any;
52
52
  scanCode: string;
53
53
  } | null;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Capacity: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
6
  export default Capacity;
@@ -3,5 +3,5 @@ import { SkuStatusOverlayConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const CardMask: ({ props }: {
5
5
  props: SkuStatusOverlayConfig;
6
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
7
7
  export default CardMask;
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const Countdown: ({ props }: {
5
5
  props: ProductCardConfig;
6
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
7
7
  export default Countdown;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Duration: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
6
  export default Duration;
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const MemberPrice: ({ props }: {
5
5
  props: ProductCardConfig;
6
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
6
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
7
7
  export default MemberPrice;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Resource: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
6
  export default Resource;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Stock: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
6
  export default Stock;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Time: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
+ }) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element | null;
6
6
  export default Time;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.6.86",
3
+ "version": "6.6.88",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",