@pisell/private-materials 6.3.12 → 6.3.14

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 (86) 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 +13 -13
  7. package/build/lowcode/render/default/view.js +9 -9
  8. package/build/lowcode/view.js +8 -8
  9. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  10. package/es/components/booking/components/browserSelect/index.js +1 -1
  11. package/es/components/booking/components/footer/utils.js +9 -5
  12. package/es/components/booking/forms/model.js +5 -5
  13. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  14. package/es/components/booking/info/service/like/index.js +1 -1
  15. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  16. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  17. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  18. package/es/components/booking/notes/model.js +5 -5
  19. package/es/components/booking/payments/model.js +5 -5
  20. package/es/components/eftposPay/amount.d.ts +1 -1
  21. package/es/components/eftposPay/device.d.ts +1 -1
  22. package/es/components/eftposPay/hooks.d.ts +2 -2
  23. package/es/components/eftposPay/store/index.d.ts +3 -3
  24. package/es/components/eventBooking/components/progressBar/index.js +20 -0
  25. package/es/components/listComponent/index.js +5 -5
  26. package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +20 -7
  27. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +1 -0
  28. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.js +12 -2
  29. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +31 -24
  30. package/es/components/pay/toC/utils.d.ts +1 -1
  31. package/es/components/productExtension/card/index.js +3 -3
  32. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  33. package/es/components/productExtension/fields/Forms/index.js +12 -12
  34. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  35. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  36. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  37. package/es/components/productExtension/server.js +2 -2
  38. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  39. package/es/components/schedules/calendar/index.js +4 -4
  40. package/es/components/schedules/calendar/serve.js +2 -2
  41. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  42. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  43. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  44. package/es/components/schedules/components/ResourceList/index.js +1 -1
  45. package/es/components/schedules/components/Search/index.js +5 -5
  46. package/es/components/schedules/model.js +5 -5
  47. package/es/components/schedules/openHours/index.js +1 -1
  48. package/es/components/schedules/openHours/serve.js +2 -2
  49. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  50. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  51. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  52. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  53. package/es/components/schedules/products/serve.js +2 -2
  54. package/es/components/schedules/products/utils.js +5 -5
  55. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  56. package/es/components/schedules/resources/detail/index.js +10 -10
  57. package/es/components/schedules/resources/list/index.js +2 -2
  58. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  59. package/es/components/schedules/resources/serve.js +2 -2
  60. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  61. package/es/components/schedules/utils.d.ts +1 -1
  62. package/es/components/schedules/utils.js +4 -4
  63. package/es/components/selectModal/index.js +2 -2
  64. package/es/components/wallet/Detail/index.js +2 -2
  65. package/es/components/wallet/components/WalletCard.js +3 -2
  66. package/es/hooks/useComponents.js +1 -1
  67. package/es/utils/index.d.ts +1 -1
  68. package/lib/components/booking/components/footer/utils.js +11 -3
  69. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  70. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  71. package/lib/components/eftposPay/amount.d.ts +1 -1
  72. package/lib/components/eftposPay/device.d.ts +1 -1
  73. package/lib/components/eftposPay/hooks.d.ts +2 -2
  74. package/lib/components/eftposPay/store/index.d.ts +3 -3
  75. package/lib/components/eventBooking/components/progressBar/index.js +18 -0
  76. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +11 -7
  77. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +1 -0
  78. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.js +9 -2
  79. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +6 -2
  80. package/lib/components/pay/toC/utils.d.ts +1 -1
  81. package/lib/components/schedules/utils.d.ts +1 -1
  82. package/lib/components/schedules/utils.js +1 -1
  83. package/lib/components/wallet/Detail/index.js +3 -3
  84. package/lib/components/wallet/components/WalletCard.js +1 -1
  85. package/lib/utils/index.d.ts +1 -1
  86. package/package.json +3 -3
@@ -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: "success" | "loading" | "warn" | "fail" | "question";
177
+ status: "loading" | "success" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
300
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | 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?: "success" | "loading" | "warn" | "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
  /** 用于重置当前步骤 */
@@ -64,6 +64,24 @@ var ProgressBar = ({
64
64
  const handleOk = () => {
65
65
  var _a2, _b;
66
66
  if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
67
+ const url = window.location.href;
68
+ if (url.includes("isByTabbar")) {
69
+ removeSessionStorage == null ? void 0 : removeSessionStorage();
70
+ const urlParams = new URLSearchParams(window.location.search);
71
+ urlParams.delete("cacheId");
72
+ setOpen(false);
73
+ interaction.utils.postMessageToApp({
74
+ module: "global",
75
+ key: "openNative",
76
+ data: {
77
+ link: {
78
+ page: "home"
79
+ }
80
+ }
81
+ });
82
+ window.location.href = window.location.pathname + "?" + urlParams.toString();
83
+ return;
84
+ }
67
85
  interaction.utils.postMessageToApp({
68
86
  module: "global",
69
87
  key: "paymentResultAction",
@@ -41,30 +41,34 @@ var import_payGroup = require("../../payGroup");
41
41
  var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
42
42
  var import_utils2 = require("../../utils");
43
43
  var GooglePay = (props, ref) => {
44
- var _a;
44
+ var _a, _b;
45
45
  const { state } = (0, import_react.useContext)(import_model.Context);
46
46
  const [open, setOpen] = (0, import_react.useState)(false);
47
47
  const context = (0, import_useEngineContext.default)();
48
48
  const { config } = ((_a = context.appHelper) == null ? void 0 : _a.constants) || {};
49
+ const { interaction } = (_b = context.appHelper) == null ? void 0 : _b.utils;
49
50
  const init = async ({ payGroup }) => {
50
- var _a2, _b, _c, _d, _e, _f, _g;
51
- setOpen(true);
51
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
52
52
  const utils = context.appHelper.utils || {};
53
- const dvaStore = (_b = (_a2 = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a2.call(utils)) == null ? void 0 : _b.getState();
53
+ const dvaStore = (_b2 = (_a2 = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a2.call(utils)) == null ? void 0 : _b2.getState();
54
54
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
55
+ if (((_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.isAppEnv) == null ? void 0 : _d.call(_c)) && ((_f = (_e = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _e.isAndroid_ios) == null ? void 0 : _f.call(_e)) === "android") {
56
+ return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "google_pay", values, interaction });
57
+ }
58
+ setOpen(true);
55
59
  if (!values) {
56
60
  setOpen(false);
57
61
  return;
58
62
  }
59
63
  try {
60
- const locale = ((_c = dvaStore.core) == null ? void 0 : _c.translateLocale) || "en";
61
- const shopId = (_f = (_e = (_d = dvaStore.core) == null ? void 0 : _d.core) == null ? void 0 : _e.shop) == null ? void 0 : _f.id;
64
+ const locale = ((_g = dvaStore.core) == null ? void 0 : _g.translateLocale) || "en";
65
+ const shopId = (_j = (_i = (_h = dvaStore.core) == null ? void 0 : _h.core) == null ? void 0 : _i.shop) == null ? void 0 : _j.id;
62
66
  const currentURL = window.location.href;
63
67
  const linkElement = document.createElement("a");
64
68
  linkElement.href = currentURL;
65
69
  const shop_domain = linkElement.hostname;
66
70
  const _href = `${config.pay}${(0, import_utils2.formatFranchiseeRoute)(
67
- `/google-pay?order_id=${(_g = state.payGroup) == null ? void 0 : _g.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}`,
71
+ `/google-pay?order_id=${(_k = state.payGroup) == null ? void 0 : _k.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}`,
68
72
  state.history
69
73
  )}`;
70
74
  window.location.href = _href;
@@ -10,6 +10,7 @@ export interface WalletPassListProps {
10
10
  walletSetting: {
11
11
  name: string;
12
12
  };
13
+ onChangeDebounce?: boolean;
13
14
  }
14
15
  export declare type WalletPassListRef = {
15
16
  init: (params: MachineCodeListParams, formatList?: (val: WalletPassDataType[]) => WalletPassDataType[]) => void;
@@ -41,7 +41,7 @@ var import_utils2 = require("../utils");
41
41
  var import_index = require("./index.less");
42
42
  var WalletPassList = (0, import_react.forwardRef)(
43
43
  (props, ref) => {
44
- const { title, onChange, data: propsData, value, walletSetting } = props;
44
+ const { title, onChange, data: propsData, value, walletSetting, onLoadingChange, loading: propsLoading, onChangeDebounce } = props;
45
45
  const [data, setData] = (0, import_react.useState)(
46
46
  propsData || []
47
47
  );
@@ -51,6 +51,9 @@ var WalletPassList = (0, import_react.forwardRef)(
51
51
  setData(propsData);
52
52
  }
53
53
  }, [propsData]);
54
+ (0, import_react.useEffect)(() => {
55
+ setLoading(!!propsLoading);
56
+ }, [propsLoading]);
54
57
  const getList = async (params, formatList) => {
55
58
  setLoading(true);
56
59
  try {
@@ -70,6 +73,9 @@ var WalletPassList = (0, import_react.forwardRef)(
70
73
  (0, import_react.useImperativeHandle)(ref, () => ({
71
74
  init
72
75
  }));
76
+ (0, import_react.useEffect)(() => {
77
+ onLoadingChange == null ? void 0 : onLoadingChange(loading);
78
+ }, [loading]);
73
79
  const { availableList, disabledList } = (0, import_react.useMemo)(() => {
74
80
  const _disabledList = [];
75
81
  const _availableList = [];
@@ -111,7 +117,8 @@ var WalletPassList = (0, import_react.forwardRef)(
111
117
  value,
112
118
  onChange: handleChange,
113
119
  showEmpty: data.length === 0,
114
- empty
120
+ empty,
121
+ onChangeDebounce
115
122
  }
116
123
  ), !!disabledList.length && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-walletPass-list-disabled" }, import_utils.locales.getText("tocPay.text.walletPassDisabled")), /* @__PURE__ */ import_react.default.createElement(
117
124
  import_materials.PisellCardList,
@@ -48,6 +48,7 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
48
48
  var _a;
49
49
  const { onWalletPassChange, walletPass, walletSetting } = props;
50
50
  const [currentWalletPass, setCurrentWalletPass] = (0, import_react.useState)(walletPass);
51
+ const [loading, setLoading] = (0, import_react.useState)(false);
51
52
  const [open, setOpen] = (0, import_react.useState)(false);
52
53
  const [searchOpen, setSearchOpen] = (0, import_react.useState)(false);
53
54
  const [addList, setAddList] = (0, import_react.useState)([]);
@@ -281,7 +282,9 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
281
282
  data: otherCustomerWalletPassList,
282
283
  title: import_utils.locales.getText("tocPay.text.couponCodesAdded"),
283
284
  onChange: handleOtherChange,
284
- value: selectValue
285
+ value: selectValue,
286
+ loading,
287
+ onChangeDebounce: true
285
288
  }
286
289
  ), /* @__PURE__ */ import_react.default.createElement(
287
290
  import_List.default,
@@ -290,7 +293,8 @@ var WalletPass = (0, import_react.forwardRef)((props, ref) => {
290
293
  title: walletSetting.name,
291
294
  onChange: handleCurrentChange,
292
295
  ref: listRef,
293
- value: selectValue
296
+ value: selectValue,
297
+ onLoadingChange: setLoading
294
298
  }
295
299
  ))
296
300
  ), /* @__PURE__ */ import_react.default.createElement(
@@ -51,7 +51,7 @@ export declare const formatFranchiseeRoute: (url: string, history?: any) => stri
51
51
  export declare const getAvailableMaxAmount: (data: WalletPassDataType) => string;
52
52
  export declare const clientPayment: (params: {
53
53
  order_id: number;
54
- type: "aliPay" | "wxPay";
54
+ type: "aliPay" | "wxPay" | 'google_pay';
55
55
  values: any;
56
56
  interaction?: any;
57
57
  }) => void;
@@ -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").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
20
+ update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
21
21
  }>;
22
22
  export { modal };
@@ -27,8 +27,8 @@ __export(utils_exports, {
27
27
  module.exports = __toCommonJS(utils_exports);
28
28
  var import_utils = require("@pisell/utils");
29
29
  var Request = class {
30
+ request = {};
30
31
  constructor() {
31
- this.request = {};
32
32
  }
33
33
  setRequest(val) {
34
34
  this.request = val;
@@ -50,7 +50,7 @@ var { Text } = import_materials2.Typography;
50
50
  import_dayjs.default.extend(import_timezone.default);
51
51
  import_dayjs.default.extend(import_utc.default);
52
52
  var Detail = (0, import_react.forwardRef)((props, ref) => {
53
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
53
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
54
54
  const {
55
55
  detail = {},
56
56
  buttonGroupList = [[]],
@@ -659,7 +659,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
659
659
  className: `wallet-detail${platform === "h5" ? " wallet-detail-h5" : " wallet-detail-pc"} ${className || ""}`,
660
660
  ref: detailWrapperRef
661
661
  },
662
- (platform === "h5" || showWalletBar) && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-header" }, /* @__PURE__ */ import_react.default.createElement(import_components.WalletBar, { setup: "detail", onBack: handleBack })),
662
+ (platform === "h5" || showWalletBar) && !((_l = (_k = (_j = utils == null ? void 0 : utils.interaction) == null ? void 0 : _j.utils) == null ? void 0 : _k.isAppEnv) == null ? void 0 : _l.call(_k)) && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-header" }, /* @__PURE__ */ import_react.default.createElement(import_components.WalletBar, { setup: "detail", onBack: handleBack })),
663
663
  /* @__PURE__ */ import_react.default.createElement(
664
664
  "div",
665
665
  {
@@ -751,7 +751,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
751
751
  step: "detail",
752
752
  addWalletLoading,
753
753
  onAppleWalletClick: tag === "gift_card" ? addWalletCard : void 0,
754
- onRechargeClick: tag === "gift_card" && ((_j = detail == null ? void 0 : detail.machinecode_config) == null ? void 0 : _j.hide_recharge) === 0 ? handleRecharge : void 0,
754
+ onRechargeClick: tag === "gift_card" && ((_m = detail == null ? void 0 : detail.machinecode_config) == null ? void 0 : _m.hide_recharge) === 0 ? handleRecharge : void 0,
755
755
  platform,
756
756
  isIOS: (0, import_utils.isIos)()
757
757
  }
@@ -73,7 +73,7 @@ var WalletCard = ({
73
73
  disabled: isDisabled,
74
74
  showDisabledReason: isDisabled,
75
75
  disabledReason,
76
- propStyle: { marginBottom: 16 },
76
+ style: { marginBottom: 16, width: "100%" },
77
77
  showBalanceSymbol: !["point_card", "good_pass"].includes(tag),
78
78
  active: isActive,
79
79
  name: product_title,
@@ -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").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
21
+ update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
22
22
  }>;
23
23
  export { modal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.3.12",
3
+ "version": "6.3.14",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -61,8 +61,8 @@
61
61
  "decimal.js": "^10.4.3",
62
62
  "@pisell/utils": "3.0.1",
63
63
  "@pisell/materials": "6.3.4",
64
- "@pisell/icon": "0.0.11",
65
- "@pisell/date-picker": "3.0.4"
64
+ "@pisell/date-picker": "3.0.4",
65
+ "@pisell/icon": "0.0.11"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",