@pisell/private-materials 3.3.5 → 3.3.7

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 (47) 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 +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/booking/components/voucher/index.js +3 -2
  8. package/es/components/booking/info/utils.js +1 -1
  9. package/es/components/ticketBooking/components/ticketBooking/index.js +2 -1
  10. package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  11. package/es/components/ticketBooking/components/timeBar/index.js +3 -2
  12. package/lib/components/booking/components/voucher/index.js +3 -2
  13. package/lib/components/booking/info/utils.js +1 -1
  14. package/lib/components/ticketBooking/components/ticketBooking/index.js +2 -1
  15. package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
  16. package/lib/components/ticketBooking/components/timeBar/index.js +2 -2
  17. package/package.json +2 -2
  18. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.d.ts +0 -8
  19. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
  20. package/es/components/appointmentBooking/components/Cart/utils.d.ts +0 -77
  21. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -3
  22. package/es/components/appointmentBooking/components/Date/index.d.ts +0 -3
  23. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -3
  24. package/es/components/appointmentBooking/components/TimeSlicing/index.d.ts +0 -3
  25. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  26. package/es/components/appointmentBooking/deposit/index.d.ts +0 -3
  27. package/es/components/appointmentBooking/hooks.d.ts +0 -104
  28. package/es/components/appointmentBooking/index.d.ts +0 -3
  29. package/es/components/appointmentBooking/locales.d.ts +0 -345
  30. package/es/components/booking/info/service/serviceList/index.d.ts +0 -5
  31. package/es/components/booking/utils.d.ts +0 -172
  32. package/es/components/wallet/components/WalletCard.d.ts +0 -11
  33. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.d.ts +0 -8
  34. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -3
  35. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +0 -77
  36. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -3
  37. package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -3
  38. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -3
  39. package/lib/components/appointmentBooking/components/TimeSlicing/index.d.ts +0 -3
  40. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  41. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -3
  42. package/lib/components/appointmentBooking/hooks.d.ts +0 -104
  43. package/lib/components/appointmentBooking/index.d.ts +0 -3
  44. package/lib/components/appointmentBooking/locales.d.ts +0 -345
  45. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -5
  46. package/lib/components/booking/utils.d.ts +0 -172
  47. package/lib/components/wallet/components/WalletCard.d.ts +0 -11
@@ -112,13 +112,14 @@ var VoucherCard = function VoucherCard(props) {
112
112
  dispatch({
113
113
  type: 'setService',
114
114
  payload: _objectSpread(_objectSpread({}, services), {}, {
115
- value: val.productList
115
+ value: ((val === null || val === void 0 ? void 0 : val.productList) || []).filter(Boolean)
116
116
  })
117
117
  });
118
118
  }
119
119
  }, [JSON.stringify(serviceMemo), isBooking4Shop]);
120
120
  var fn = useMemoizedFn(function (result) {
121
- if (result.productList.some(function (item) {
121
+ var _result$productList;
122
+ if (!(result !== null && result !== void 0 && result.productList) || result !== null && result !== void 0 && (_result$productList = result.productList) !== null && _result$productList !== void 0 && _result$productList.some(function (item) {
122
123
  return !item;
123
124
  })) {
124
125
  return;
@@ -95,7 +95,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
95
95
  if (renderType === 'eventBooking') {
96
96
  return false;
97
97
  }
98
- var booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9];
98
+ var booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155];
99
99
  return booking4Shops.includes(shopId);
100
100
  };
101
101
  function generateDateRange(start, end) {
@@ -772,7 +772,8 @@ var TicketBooking = function TicketBooking() {
772
772
  }
773
773
  _setDataChange.apply(void 0, args.concat([true]));
774
774
  },
775
- setIntervalTime: _setIntervalTime
775
+ setIntervalTime: _setIntervalTime,
776
+ locale: engineProps.locale
776
777
  })), /*#__PURE__*/React.createElement("div", {
777
778
  style: {
778
779
  flexShrink: 0,
@@ -6,6 +6,7 @@ interface ITimeBarProps {
6
6
  onDateChange: (date: Dayjs, dateString?: string) => void;
7
7
  onDateTimeChange: (date: Dayjs, timeString: string) => void;
8
8
  setIntervalTime: (value: boolean) => void;
9
+ locale: string;
9
10
  }
10
11
  declare const TimeBar: (props: ITimeBarProps) => JSX.Element;
11
12
  export default TimeBar;
@@ -14,7 +14,8 @@ import "./index.less";
14
14
  var TimeBar = function TimeBar(props) {
15
15
  var _state$modalState4, _state$modalState5;
16
16
  var state = props.globalState,
17
- setGlobalState = props.setGlobalState;
17
+ setGlobalState = props.setGlobalState,
18
+ locale = props.locale;
18
19
  var _onClickNext = function _onClickNext() {
19
20
  var _state$modalState, _props$onDateChange, _props$setIntervalTim;
20
21
  var currentTime = (_state$modalState = state.modalState) === null || _state$modalState === void 0 || (_state$modalState = _state$modalState.date) === null || _state$modalState === void 0 ? void 0 : _state$modalState.value;
@@ -76,7 +77,7 @@ var TimeBar = function TimeBar(props) {
76
77
  }
77
78
  }, /*#__PURE__*/React.createElement(DatePicker, {
78
79
  value: state === null || state === void 0 || (_state$modalState4 = state.modalState) === null || _state$modalState4 === void 0 || (_state$modalState4 = _state$modalState4.date) === null || _state$modalState4 === void 0 ? void 0 : _state$modalState4.value,
79
- format: state.locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
80
+ format: locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
80
81
  onChange: props === null || props === void 0 ? void 0 : props.onDateChange,
81
82
  size: "large",
82
83
  style: {
@@ -114,13 +114,14 @@ var VoucherCard = (props) => {
114
114
  type: "setService",
115
115
  payload: {
116
116
  ...services,
117
- value: val.productList
117
+ value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
118
118
  }
119
119
  });
120
120
  }
121
121
  }, [JSON.stringify(serviceMemo), isBooking4Shop]);
122
122
  const fn = (0, import_ahooks.useMemoizedFn)((result) => {
123
- if (result.productList.some((item) => !item)) {
123
+ var _a2;
124
+ if (!(result == null ? void 0 : result.productList) || ((_a2 = result == null ? void 0 : result.productList) == null ? void 0 : _a2.some((item) => !item))) {
124
125
  return;
125
126
  }
126
127
  dispatch({
@@ -103,7 +103,7 @@ var isBooking4Shop = (shopId, renderType) => {
103
103
  if (renderType === "eventBooking") {
104
104
  return false;
105
105
  }
106
- const booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9];
106
+ const booking4Shops = [1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155];
107
107
  return booking4Shops.includes(shopId);
108
108
  };
109
109
  function generateDateRange(start, end) {
@@ -716,7 +716,8 @@ var TicketBooking = () => {
716
716
  onDateTimeChange: (...args) => {
717
717
  _setDataChange(...args, true);
718
718
  },
719
- setIntervalTime: _setIntervalTime
719
+ setIntervalTime: _setIntervalTime,
720
+ locale: engineProps.locale
720
721
  }
721
722
  )
722
723
  ), /* @__PURE__ */ import_react.default.createElement(
@@ -6,6 +6,7 @@ interface ITimeBarProps {
6
6
  onDateChange: (date: Dayjs, dateString?: string) => void;
7
7
  onDateTimeChange: (date: Dayjs, timeString: string) => void;
8
8
  setIntervalTime: (value: boolean) => void;
9
+ locale: string;
9
10
  }
10
11
  declare const TimeBar: (props: ITimeBarProps) => JSX.Element;
11
12
  export default TimeBar;
@@ -41,7 +41,7 @@ var import_utils = require("@pisell/utils");
41
41
  var import_index = require("./index.less");
42
42
  var TimeBar = (props) => {
43
43
  var _a, _b, _c, _d;
44
- const { globalState: state, setGlobalState } = props;
44
+ const { globalState: state, setGlobalState, locale } = props;
45
45
  const _onClickNext = () => {
46
46
  var _a2, _b2, _c2, _d2;
47
47
  const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
@@ -102,7 +102,7 @@ var TimeBar = (props) => {
102
102
  import_materials.DatePicker,
103
103
  {
104
104
  value: (_b = (_a = state == null ? void 0 : state.modalState) == null ? void 0 : _a.date) == null ? void 0 : _b.value,
105
- format: state.locale === "en" ? "dddd, DD MMM YYYY" : "YYYY年MM月DD日",
105
+ format: locale === "en" ? "dddd, DD MMM YYYY" : "YYYY年MM月DD日",
106
106
  onChange: props == null ? void 0 : props.onDateChange,
107
107
  size: "large",
108
108
  style: { width: "100%" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -60,7 +60,7 @@
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
62
  "@pisell/utils": "1.0.42",
63
- "@pisell/materials": "3.3.4",
63
+ "@pisell/materials": "3.3.5",
64
64
  "@pisell/icon": "0.0.11",
65
65
  "@pisell/date-picker": "3.0.2"
66
66
  },
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface ContinueButtonProps {
4
- onContinue?: () => void;
5
- onIsErrorResource?: (isError: boolean) => void;
6
- }
7
- declare const ContinueButton: React.FC<ContinueButtonProps>;
8
- export default ContinueButton;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Total: ({ className, isFooter }: any) => JSX.Element;
3
- export default Total;
@@ -1,77 +0,0 @@
1
- import { locales } from '@pisell/utils';
2
- interface CheckLoginParams {
3
- isLogin: boolean;
4
- openLoginModal: (params: {
5
- callback: (status: string) => void;
6
- }) => void;
7
- isFormSubject: boolean;
8
- utils: any;
9
- accountLists: any[];
10
- appointmentBooking: any;
11
- getHolders: () => void;
12
- }
13
- export declare const checkLogin: ({ isLogin, openLoginModal, isFormSubject, utils, accountLists, appointmentBooking, getHolders, }: CheckLoginParams) => Promise<boolean>;
14
- interface CheckHolderParams {
15
- isFormSubject: boolean;
16
- checkAccount: (type: string) => boolean;
17
- carts: any[];
18
- }
19
- export declare const checkHolder: ({ isFormSubject, checkAccount, carts }: CheckHolderParams) => false | any[];
20
- interface CheckResourceParams {
21
- carts: any[];
22
- resources: any[];
23
- }
24
- /**
25
- * @title: 检测资源数据
26
- * @description:
27
- * @param {CheckResourceParams} param1
28
- * @return {*}
29
- * @Author: WangHan
30
- * @Date: 2025-04-29 18:02
31
- */
32
- export declare const checkResource: ({ carts, resources }: CheckResourceParams) => false | any[];
33
- interface CheckResourceParams {
34
- carts: any[];
35
- }
36
- interface HandleFormStepParams {
37
- newCarts: any[];
38
- addStep: (params: {
39
- index: number;
40
- key: string;
41
- description: string;
42
- }) => void;
43
- removeStep: (key: string) => void;
44
- setResourceOtherParams: (params: any) => void;
45
- resourceOtherParams: any;
46
- index: number;
47
- locales: typeof locales;
48
- }
49
- export declare const handleFormStep: ({ newCarts, addStep, removeStep, setResourceOtherParams, resourceOtherParams, index, locales, }: HandleFormStepParams) => void;
50
- /**
51
- * 滚动到第一个错误卡片
52
- * @param {string} selector - 错误卡片的 class 选择器
53
- */
54
- export declare const scrollToFirstErrorCard: (selector?: string) => void;
55
- export declare type StepKey = 'select-resource' | 'fill-form' | 'select-time' | 'confirm-information' | 'select-service' | 'select-date' | 'select-guest';
56
- interface HandleResourceParams {
57
- handleCheckResource: () => boolean;
58
- newCarts: any[];
59
- locales: typeof locales;
60
- addStep: (params: {
61
- index: number;
62
- key: string;
63
- description: string;
64
- }, key?: StepKey) => void;
65
- removeStep: (key: string) => void;
66
- setResourceOtherParams: (params: any) => void;
67
- resourceOtherParams: any;
68
- currentStep: any;
69
- getResourceTimeSlot: () => void;
70
- appointmentBooking: any;
71
- onIsErrorResource?: (isError: boolean) => void;
72
- stepList: any[];
73
- }
74
- export declare const handleResource: ({ handleCheckResource, newCarts, addStep, removeStep, setResourceOtherParams, resourceOtherParams, currentStep, getResourceTimeSlot, appointmentBooking, onIsErrorResource, stepList }: HandleResourceParams) => Promise<void>;
75
- export declare const stepHandlers: Record<StepKey, (params: any) => Promise<any>>;
76
- export declare const handleContinueStep: (key: StepKey, params: any) => Promise<any>;
77
- export {};
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Layout: () => JSX.Element;
3
- export default Layout;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const CalendarDate: (props: any) => JSX.Element;
3
- export default CalendarDate;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Footer: ({ onContinue }: any) => JSX.Element;
3
- export default Footer;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Resource: () => JSX.Element;
3
- export default Resource;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const DepositModal: (props: any) => JSX.Element;
3
- export default DepositModal;
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const Deposit: (props: any) => JSX.Element;
3
- export default Deposit;
@@ -1,104 +0,0 @@
1
- export declare const useAppointmentBooking: () => any;
2
- export declare const useShopDiscount: () => any;
3
- export declare const contextUtils: () => any;
4
- /**
5
- * @title: 监听步骤发生变化
6
- * @description:
7
- * @return {*}
8
- * @Author: WangHan
9
- * @Date: 2025-04-15 11:11
10
- */
11
- export declare const useAppointmentBookingStep: () => {
12
- getStepIndex: (type: string, skipNumber?: number) => any;
13
- stepList: any;
14
- removeStep: (key: string) => any;
15
- addStep: (props: any, stepKey?: string) => any;
16
- };
17
- /**
18
- * @title: 获取商品数据
19
- * @description:
20
- * @return {*}
21
- * @Author: WangHan
22
- * @Date: 2025-04-15 11:12
23
- */
24
- export declare const useAppointmentBookingProduct: () => {
25
- checkProductType: (productId: number) => Promise<any>;
26
- getProducts: () => Promise<any>;
27
- };
28
- /**
29
- * @title: 更新购物车数据
30
- * @description:
31
- * @return {*}
32
- * @Author: WangHan
33
- * @Date: 2025-04-15 11:12
34
- */
35
- export declare const useAppointmentBookingCart: () => void;
36
- /**
37
- * @title: 获取登录状态
38
- * @description:
39
- * @return {*}
40
- * @Author: WangHan
41
- * @Date: 2025-04-15 11:14
42
- */
43
- export declare const useAppointmentBookingLogin: () => {
44
- isLogin: boolean;
45
- openLoginModal: (params: {
46
- callback: any;
47
- }) => void;
48
- };
49
- /**
50
- * @title: 获取账户
51
- * @description:
52
- * @return {*}
53
- * @Author: WangHan
54
- * @Date: 2025-04-15 11:15
55
- */
56
- export declare const useAppointmentBookingAccount: () => {
57
- accountLists: any;
58
- getHolders: () => Promise<any>;
59
- form_id: any;
60
- addAccount: (val: any, type?: string) => Promise<any>;
61
- checkAccount: (type: any) => any;
62
- };
63
- /**
64
- * @title: 获取资源数据
65
- * @description:
66
- * @return {*}
67
- * @Author: WangHan
68
- * @Date: 2025-04-15 11:29
69
- */
70
- export declare const useAppointmentBookingResource: () => {
71
- getResourceTimeSlot: (index?: number) => Promise<void>;
72
- getResourceList: () => {
73
- resources: any;
74
- resourceCodes: any;
75
- };
76
- autoSelectAllProductResources: (index?: number) => Promise<any>;
77
- };
78
- /**
79
- * @title: 是否跳过资源选择步骤
80
- * @description:
81
- * @return {*}
82
- * @Author: WangHan
83
- * @Date: 2025-04-21 11:47
84
- */
85
- export declare const useIsSkipResourceStep: () => {
86
- checkSkipResourceStep: () => Promise<boolean>;
87
- };
88
- /**
89
- * @title: 获取预约配置
90
- * @description:
91
- * @return {*}
92
- * @Author: WangHan
93
- * @Date: 2025-04-24 18:15
94
- */
95
- export declare const useAppointmentBookingSetting: () => {
96
- isDateSelectedFirst: boolean;
97
- isFormSubject: boolean;
98
- customPageId: any;
99
- getLoadAllSchedule: () => void;
100
- bookingSubject: any;
101
- setOtherData: (key: string, val: any) => any;
102
- getOtherData: (key: string) => any;
103
- formName: any;
104
- };
@@ -1,3 +0,0 @@
1
- import './index.less';
2
- declare const AppointmentBooking: () => JSX.Element;
3
- export default AppointmentBooking;