@pisell/private-materials 6.8.91 → 6.8.92

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 (57) hide show
  1. package/build/lowcode/render/default/view.css +1 -1
  2. package/build/lowcode/render/default/view.js +1 -1
  3. package/build/lowcode/view.css +1 -1
  4. package/build/lowcode/view.js +1 -1
  5. package/es/components/booking/components/footer/index.d.ts +1 -0
  6. package/es/components/booking/components/footer/utils.js +2 -1
  7. package/es/components/checkout/PaymentModal.js +4 -2
  8. package/es/components/list/List.js +4 -19
  9. package/es/components/list/hooks/useListState.d.ts +1 -2
  10. package/es/components/list/hooks/useListState.js +2 -7
  11. package/es/components/list/types.d.ts +0 -1
  12. package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  13. package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +1 -6
  14. package/es/components/ticketBooking/components/ProductDisplayAdapter/types.js +2 -11
  15. package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +1 -1
  16. package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +1 -62
  17. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
  18. package/es/components/ticketBooking/components/ticketBooking/index.js +4 -2
  19. package/es/components/ticketBooking/context/OsKeyContext.d.ts +3 -0
  20. package/es/components/ticketBooking/context/OsKeyContext.js +12 -2
  21. package/es/components/ticketBooking/context/index.d.ts +1 -1
  22. package/es/components/ticketBooking/context/index.js +1 -1
  23. package/es/components/ticketBooking/index.d.ts +1 -0
  24. package/es/components/ticketBooking/index.js +2 -1
  25. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +1 -0
  26. package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
  27. package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
  28. package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +1 -0
  29. package/es/pro/skuDetailModal/index.js +8 -3
  30. package/es/pro/skuDetailModal/index.less +15 -0
  31. package/lib/components/booking/components/footer/index.d.ts +1 -0
  32. package/lib/components/booking/components/footer/utils.js +2 -1
  33. package/lib/components/checkout/PaymentModal.js +3 -1
  34. package/lib/components/list/List.js +3 -15
  35. package/lib/components/list/hooks/useListState.d.ts +1 -2
  36. package/lib/components/list/hooks/useListState.js +2 -7
  37. package/lib/components/list/types.d.ts +0 -1
  38. package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
  39. package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +1 -4
  40. package/lib/components/ticketBooking/components/ProductDisplayAdapter/types.js +2 -11
  41. package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +1 -1
  42. package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +2 -46
  43. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
  44. package/lib/components/ticketBooking/components/ticketBooking/index.js +3 -1
  45. package/lib/components/ticketBooking/context/OsKeyContext.d.ts +3 -0
  46. package/lib/components/ticketBooking/context/OsKeyContext.js +13 -3
  47. package/lib/components/ticketBooking/context/index.d.ts +1 -1
  48. package/lib/components/ticketBooking/context/index.js +2 -0
  49. package/lib/components/ticketBooking/index.d.ts +1 -0
  50. package/lib/components/ticketBooking/index.js +1 -1
  51. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +1 -0
  52. package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
  53. package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
  54. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +1 -0
  55. package/lib/pro/skuDetailModal/index.js +2 -2
  56. package/lib/pro/skuDetailModal/index.less +15 -0
  57. package/package.json +1 -1
@@ -119,7 +119,6 @@ export interface ListProps<TItem extends BaseListItem = BaseListItem> {
119
119
  tabGroup?: TabConfig['tabGroup'];
120
120
  tabData?: TabConfig['tabData'];
121
121
  stickyTop?: TabConfig['stickyTop'];
122
- isTreeTab?: boolean;
123
122
  /** 分页配置 */
124
123
  paginationType?: PaginationConfig['paginationType'];
125
124
  defaultPageSize?: PaginationConfig['defaultPageSize'];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ProductProps } from '../../type';
2
3
  declare const Product: (props: ProductProps) => JSX.Element;
3
4
  export default Product;
@@ -122,8 +122,7 @@ var ProductDisplayAdapter = (props) => {
122
122
  const { listConfig = {} } = config.skuListConfig || {};
123
123
  const enableTab = listConfig.showTab || false;
124
124
  const tabStyle = listConfig.tabStyle || "switch";
125
- const isTreeTab = listConfig.isTreeTab ?? true;
126
- return enableTab ? (0, import_utils.generateProductTabs)(_filteredList, tabStyle, isTreeTab) : void 0;
125
+ return enableTab ? (0, import_utils.generateProductTabs)(_filteredList, tabStyle) : void 0;
127
126
  }, [_filteredList]);
128
127
  const renderSkuList = (0, import_react.useMemo)(() => {
129
128
  const { listConfig = {}, skuCardAllConfig = {} } = config.skuListConfig || {};
@@ -132,7 +131,6 @@ var ProductDisplayAdapter = (props) => {
132
131
  const paginationType = listConfig.showPagination ? "pager" : "all";
133
132
  const enableTab = listConfig.showTab || false;
134
133
  const tabStyle = listConfig.tabStyle || "switch";
135
- const isTreeTab = listConfig.isTreeTab ?? true;
136
134
  const stickyTop = listConfig.stickyTop !== void 0 ? listConfig.stickyTop : true;
137
135
  const filteredData = _filteredList.map((item) => {
138
136
  var _a, _b;
@@ -162,7 +160,6 @@ var ProductDisplayAdapter = (props) => {
162
160
  paginationType,
163
161
  layoutDirection: "vertical",
164
162
  tabStyle: enableTab ? tabStyle : "none",
165
- isTreeTab,
166
163
  tabData,
167
164
  tabGroup: "category",
168
165
  stickyTop,
@@ -90,17 +90,9 @@ var ProductDisplayPresets = {
90
90
  listConfig: {
91
91
  layout: "grid",
92
92
  showPagination: false,
93
- showTab: true,
94
- tabStyle: "switch",
95
- isTreeTab: false
93
+ showTab: false
96
94
  },
97
95
  skuCardAllConfig: {
98
- skuActionConfig: {
99
- isOpen: false
100
- },
101
- skuExtraConfig: {
102
- isFavorite: false
103
- },
104
96
  skuCardConfig: {
105
97
  displayMode: "display_a2",
106
98
  layoutDirection: "row",
@@ -159,8 +151,7 @@ var ProductDisplayPresets = {
159
151
  stickyTop: true,
160
152
  // Tab 吸顶
161
153
  columns: 4,
162
- tabGroup: "category",
163
- isTreeTab: true
154
+ tabGroup: "category"
164
155
  },
165
156
  skuCardAllConfig: {
166
157
  skuCardConfig: {
@@ -80,5 +80,5 @@ export interface CategoryTreeNode {
80
80
  * @param tabStyle tab 样式类型
81
81
  * @returns Switch 模式返回 CategoryTreeNode[],Anchor 模式返回 TabItem[]
82
82
  */
83
- export declare const generateProductTabs: (products: Product[], tabStyle?: 'switch' | 'anchor', isTreeTab?: boolean) => CategoryTreeNode[] | TabItem[];
83
+ export declare const generateProductTabs: (products: Product[], tabStyle?: 'switch' | 'anchor') => CategoryTreeNode[] | TabItem[];
84
84
  export {};
@@ -36,51 +36,7 @@ var formatSkuDataSource = (dataSource) => {
36
36
  sortKeys: ["title", "subtitle", "price"]
37
37
  };
38
38
  };
39
- var generateSimpleTabItems = (products) => {
40
- const categoryMap = /* @__PURE__ */ new Map();
41
- const categoryProductMap = /* @__PURE__ */ new Map();
42
- products.forEach((product) => {
43
- if (product.category && Array.isArray(product.category)) {
44
- product.category.forEach((cat) => {
45
- if (!categoryMap.has(cat.id)) {
46
- categoryMap.set(cat.id, {
47
- id: cat.id,
48
- name: cat.name,
49
- icon: cat.icon,
50
- slug: cat.slug,
51
- sort: cat.sort
52
- });
53
- }
54
- if (!categoryProductMap.has(cat.id)) {
55
- categoryProductMap.set(cat.id, /* @__PURE__ */ new Set());
56
- }
57
- categoryProductMap.get(cat.id).add(product.id);
58
- });
59
- }
60
- });
61
- const result = [];
62
- categoryMap.forEach((category, id) => {
63
- const productIds = Array.from(categoryProductMap.get(id) || []);
64
- result.push({
65
- id,
66
- key: id,
67
- group: id,
68
- label: category.name,
69
- name: category.name,
70
- icon: category.icon,
71
- productIds,
72
- children: [],
73
- childrenMaxLevel: 0
74
- });
75
- });
76
- result.sort((a, b) => {
77
- const catA = categoryMap.get(a.id);
78
- const catB = categoryMap.get(b.id);
79
- return ((catB == null ? void 0 : catB.sort) || 0) - ((catA == null ? void 0 : catA.sort) || 0);
80
- });
81
- return result;
82
- };
83
- var generateProductTabs = (products, tabStyle = "switch", isTreeTab = true) => {
39
+ var generateProductTabs = (products, tabStyle = "switch") => {
84
40
  if (!products || products.length === 0) {
85
41
  if (tabStyle === "switch") {
86
42
  return [];
@@ -88,7 +44,7 @@ var generateProductTabs = (products, tabStyle = "switch", isTreeTab = true) => {
88
44
  return [{ key: "all", label: import_utils.locales.getText("pisell2.ticket-booking.all") }];
89
45
  }
90
46
  if (tabStyle === "switch") {
91
- return isTreeTab ? buildCategoryTree(products) : generateSimpleTabItems(products);
47
+ return buildCategoryTree(products);
92
48
  } else {
93
49
  const categoryCount = products.reduce((acc, product) => {
94
50
  if (product.category && Array.isArray(product.category)) {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter';
2
3
  import './index.less';
3
4
  interface AddServiceProps {
@@ -319,6 +319,7 @@ var TicketBooking = (props) => {
319
319
  }
320
320
  }
321
321
  });
322
+ const businessCode = (0, import_context.useBusinessCode)();
322
323
  (0, import_react.useEffect)(() => {
323
324
  if (isActive) {
324
325
  openScan((data) => {
@@ -1178,7 +1179,8 @@ var TicketBooking = (props) => {
1178
1179
  onQrCodeClick: () => {
1179
1180
  console.log("onQrCodeClick");
1180
1181
  bookingTicket == null ? void 0 : bookingTicket.activateCamera();
1181
- }
1182
+ },
1183
+ businessCode
1182
1184
  };
1183
1185
  }, [
1184
1186
  state.modalState,
@@ -7,10 +7,12 @@ import React from 'react';
7
7
  interface OsKeyContextType {
8
8
  /** pisellos 模块的唯一标识 */
9
9
  osKey: string | undefined;
10
+ businessCode: string | undefined;
10
11
  }
11
12
  declare const OsKeyContext: React.Context<OsKeyContextType>;
12
13
  interface OsKeyProviderProps {
13
14
  osKey: string | undefined;
15
+ businessCode: string | undefined;
14
16
  children: React.ReactNode;
15
17
  }
16
18
  /**
@@ -23,4 +25,5 @@ export declare const OsKeyProvider: React.FC<OsKeyProviderProps>;
23
25
  * 在子组件中使用此 hook 获取 osKey
24
26
  */
25
27
  export declare const useOsKey: () => string;
28
+ export declare const useBusinessCode: () => string;
26
29
  export default OsKeyContext;
@@ -31,15 +31,17 @@ var OsKeyContext_exports = {};
31
31
  __export(OsKeyContext_exports, {
32
32
  OsKeyProvider: () => OsKeyProvider,
33
33
  default: () => OsKeyContext_default,
34
+ useBusinessCode: () => useBusinessCode,
34
35
  useOsKey: () => useOsKey
35
36
  });
36
37
  module.exports = __toCommonJS(OsKeyContext_exports);
37
38
  var import_react = __toESM(require("react"));
38
39
  var OsKeyContext = (0, import_react.createContext)({
39
- osKey: void 0
40
+ osKey: void 0,
41
+ businessCode: void 0
40
42
  });
41
- var OsKeyProvider = ({ osKey, children }) => {
42
- return /* @__PURE__ */ import_react.default.createElement(OsKeyContext.Provider, { value: { osKey } }, children);
43
+ var OsKeyProvider = ({ osKey, businessCode, children }) => {
44
+ return /* @__PURE__ */ import_react.default.createElement(OsKeyContext.Provider, { value: { osKey, businessCode } }, children);
43
45
  };
44
46
  var useOsKey = () => {
45
47
  const context = (0, import_react.useContext)(OsKeyContext);
@@ -48,9 +50,17 @@ var useOsKey = () => {
48
50
  }
49
51
  return (context == null ? void 0 : context.osKey) || "ticket";
50
52
  };
53
+ var useBusinessCode = () => {
54
+ const context = (0, import_react.useContext)(OsKeyContext);
55
+ if (!context) {
56
+ throw new Error("useBusinessCode must be used within an OsKeyProvider");
57
+ }
58
+ return (context == null ? void 0 : context.businessCode) || "";
59
+ };
51
60
  var OsKeyContext_default = OsKeyContext;
52
61
  // Annotate the CommonJS export names for ESM import in node:
53
62
  0 && (module.exports = {
54
63
  OsKeyProvider,
64
+ useBusinessCode,
55
65
  useOsKey
56
66
  });
@@ -1,2 +1,2 @@
1
- export { OsKeyProvider, useOsKey } from './OsKeyContext';
1
+ export { OsKeyProvider, useOsKey, useBusinessCode } from './OsKeyContext';
2
2
  export { default as OsKeyContext } from './OsKeyContext';
@@ -31,6 +31,7 @@ var context_exports = {};
31
31
  __export(context_exports, {
32
32
  OsKeyContext: () => import_OsKeyContext2.default,
33
33
  OsKeyProvider: () => import_OsKeyContext.OsKeyProvider,
34
+ useBusinessCode: () => import_OsKeyContext.useBusinessCode,
34
35
  useOsKey: () => import_OsKeyContext.useOsKey
35
36
  });
36
37
  module.exports = __toCommonJS(context_exports);
@@ -40,5 +41,6 @@ var import_OsKeyContext2 = __toESM(require("./OsKeyContext"));
40
41
  0 && (module.exports = {
41
42
  OsKeyContext,
42
43
  OsKeyProvider,
44
+ useBusinessCode,
43
45
  useOsKey
44
46
  });
@@ -10,6 +10,7 @@ interface TicketBookingProps {
10
10
  productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
11
11
  isActive?: boolean;
12
12
  rulesHooks?: any;
13
+ businessCode?: string;
13
14
  }
14
15
  declare const _default: (props: TicketBookingProps) => JSX.Element;
15
16
  export default _default;
@@ -272,7 +272,7 @@ var ticketBooking_default = (props) => {
272
272
  });
273
273
  }
274
274
  }, [osKey]);
275
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-wrapper" }, isShowMenuBar && /* @__PURE__ */ import_react.default.createElement(import_menuBar.default, { activeNavKey, onNavChange: setActiveNavKey }), /* @__PURE__ */ import_react.default.createElement(import_IsActiveContext.IsActiveProvider, { isActive }, /* @__PURE__ */ import_react.default.createElement(import_OsKeyContext.OsKeyProvider, { osKey }, /* @__PURE__ */ import_react.default.createElement(import_miniRedux.Provider, { store: storeRef.current, key: activeNavKey }, /* @__PURE__ */ import_react.default.createElement(
275
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-wrapper" }, isShowMenuBar && /* @__PURE__ */ import_react.default.createElement(import_menuBar.default, { activeNavKey, onNavChange: setActiveNavKey }), /* @__PURE__ */ import_react.default.createElement(import_IsActiveContext.IsActiveProvider, { isActive }, /* @__PURE__ */ import_react.default.createElement(import_OsKeyContext.OsKeyProvider, { osKey, businessCode: props == null ? void 0 : props.businessCode }, /* @__PURE__ */ import_react.default.createElement(import_miniRedux.Provider, { store: storeRef.current, key: activeNavKey }, /* @__PURE__ */ import_react.default.createElement(
276
276
  import_ticketBooking.default,
277
277
  {
278
278
  onPrerenderComplete,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ProductCardConfig } from '../../type';
2
3
  import './index.less';
3
4
  declare const CardWrapper: (props: ProductCardConfig) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const OptionItemCard: (props: any) => JSX.Element;
3
4
  export default OptionItemCard;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface OptionsModalProps {
2
3
  parentDataSource: any;
3
4
  dataSource: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PaymentKeyboardBaseProps } from './types';
2
3
  import './index.less';
3
4
  interface PaymentKeyboardProps extends PaymentKeyboardBaseProps {
@@ -516,7 +516,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
516
516
  };
517
517
  if (!productData) return null;
518
518
  const rightContent = () => {
519
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content" }, currentStep === 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-title" }, (productData == null ? void 0 : productData.title) || ""), /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-description" }, (productData == null ? void 0 : productData.subtitle) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-subtitle" }, productData.subtitle) : null, (productData == null ? void 0 : productData.description) ? /* @__PURE__ */ import_react.default.createElement(
519
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content" }, currentStep === 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-description" }, (productData == null ? void 0 : productData.subtitle) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-subtitle" }, productData.subtitle) : null, (productData == null ? void 0 : productData.description) ? /* @__PURE__ */ import_react.default.createElement(
520
520
  "div",
521
521
  {
522
522
  className: "sku-detail-right-content-detail-description-html",
@@ -524,7 +524,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
524
524
  __html: productData.description
525
525
  }
526
526
  }
527
- ) : null)), currentStep === 1 && hasSkuOptions && /* @__PURE__ */ import_react.default.createElement(
527
+ ) : null, (productData == null ? void 0 : productData.description) === "" && !hasSkuOptions && /* @__PURE__ */ import_react.default.createElement("div", { className: "sku-detail-right-content-detail-placeholder" }, /* @__PURE__ */ import_react.default.createElement("img", { width: 300, height: 300, src: "https://static.pisellcdn.com/sku_empty.png", alt: "placeholder" }), /* @__PURE__ */ import_react.default.createElement("p", null, "No additional options for this item")))), currentStep === 1 && hasSkuOptions && /* @__PURE__ */ import_react.default.createElement(
528
528
  import_skuOptionsSelection.default,
529
529
  {
530
530
  ref: skuOptionsSelectionRef,
@@ -427,3 +427,18 @@
427
427
  position: relative;
428
428
  z-index: 10000; // 确保键盘在遮罩之上
429
429
  }
430
+
431
+ .sku-detail-right-content-detail-placeholder {
432
+ display: flex;
433
+ flex-direction: column;
434
+ align-items: center;
435
+ justify-content: center;
436
+ gap: 8px;
437
+ color: #667085;
438
+
439
+ p {
440
+ margin: 0;
441
+ text-align: center;
442
+ font-size: 16px;
443
+ }
444
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.8.91",
3
+ "version": "6.8.92",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",