@pisell/private-materials 3.4.16 → 3.4.18

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 (211) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Content/index.js +1 -1
  12. package/es/components/appointmentBooking/components/Content/index.less +3 -3
  13. package/es/components/appointmentBooking/components/Services/index.js +2 -2
  14. package/es/components/appointmentBooking/index.js +8 -2
  15. package/es/components/booking/info2/service/addTimeModal/index.js +0 -1
  16. package/es/components/booking/utils.d.ts +2 -2
  17. package/es/components/eftposPay/hooks.d.ts +1 -1
  18. package/es/components/eftposPay/store/index.d.ts +2 -2
  19. package/es/components/eventBooking/index.js +8 -1
  20. package/es/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
  21. package/es/hooks/useWindowSize.js +8 -1
  22. package/es/index.d.ts +3 -0
  23. package/es/index.js +4 -1
  24. package/es/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
  25. package/es/plus/productSelect/CategoryTabs/CategorySkeleton.js +29 -0
  26. package/es/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
  27. package/es/plus/productSelect/CategoryTabs/index.d.ts +18 -0
  28. package/es/plus/productSelect/CategoryTabs/index.js +171 -0
  29. package/es/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
  30. package/es/plus/productSelect/ProductCard/ProductCardSkeleton.js +37 -0
  31. package/es/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
  32. package/es/plus/productSelect/ProductCard/index.d.ts +45 -0
  33. package/es/plus/productSelect/ProductCard/index.js +170 -0
  34. package/es/plus/productSelect/ProductCard/index.less +253 -0
  35. package/es/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
  36. package/es/plus/productSelect/ProductList/gridComponents.js +149 -0
  37. package/es/plus/productSelect/ProductList/index.d.ts +22 -0
  38. package/es/plus/productSelect/ProductList/index.js +72 -0
  39. package/es/plus/productSelect/ProductList/index.less +0 -0
  40. package/es/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
  41. package/es/plus/productSelect/components/IntersectionObserver.js +276 -0
  42. package/es/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
  43. package/es/plus/productSelect/components/TabsStructure/TabsStructure.js +357 -0
  44. package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
  45. package/es/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
  46. package/es/plus/productSelect/components/TabsStructure/hooks.js +243 -0
  47. package/es/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
  48. package/es/plus/productSelect/components/TabsStructure/index.js +13 -0
  49. package/es/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
  50. package/es/plus/productSelect/components/TabsStructure/styles.js +87 -0
  51. package/es/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
  52. package/es/plus/productSelect/components/TabsStructure/types.js +1 -0
  53. package/es/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
  54. package/es/plus/productSelect/components/TabsStructure/utils.js +56 -0
  55. package/es/plus/productSelect/components/pisellPriceText/index.d.ts +12 -0
  56. package/es/plus/productSelect/components/pisellPriceText/index.js +44 -0
  57. package/es/plus/productSelect/components/pisellPriceText/index.less +4 -0
  58. package/es/plus/productSelect/hooks/useToken.d.ts +18 -0
  59. package/es/plus/productSelect/hooks/useToken.js +34 -0
  60. package/es/plus/productSelect/index.d.ts +31 -0
  61. package/es/plus/productSelect/index.js +270 -0
  62. package/es/plus/productSelect/index.less +56 -0
  63. package/es/plus/productSelect/locales.d.ts +18 -0
  64. package/es/plus/productSelect/locales.js +17 -0
  65. package/es/plus/productSelect/theme/token.d.ts +17 -0
  66. package/es/plus/productSelect/theme/token.js +19 -0
  67. package/es/plus/productSelect/utils.d.ts +39 -0
  68. package/es/plus/productSelect/utils.js +162 -0
  69. package/es/plus/saasCreateOrganization/components/Header.d.ts +3 -0
  70. package/es/plus/saasCreateOrganization/components/Header.js +62 -0
  71. package/es/plus/saasCreateOrganization/index.d.ts +4 -0
  72. package/es/plus/saasCreateOrganization/index.js +15 -0
  73. package/es/plus/saasCreateOrganization/index.less +55 -0
  74. package/es/plus/saasCreateOrganization/locales.d.ts +15 -0
  75. package/es/plus/saasCreateOrganization/locales.js +14 -0
  76. package/es/plus/saasCreateOrganization/types.d.ts +69 -0
  77. package/es/plus/saasCreateOrganization/types.js +1 -0
  78. package/es/plus/saasLogin/index.d.ts +5 -0
  79. package/es/plus/saasLogin/index.js +165 -0
  80. package/es/plus/saasLogin/index.less +136 -0
  81. package/es/plus/saasLogin/locales.d.ts +51 -0
  82. package/es/plus/saasLogin/locales.js +50 -0
  83. package/es/plus/saasLogin/types.d.ts +62 -0
  84. package/es/plus/saasLogin/types.js +1 -0
  85. package/es/plus/saasLogin/utils.d.ts +35 -0
  86. package/es/plus/saasLogin/utils.js +31 -0
  87. package/es/plus/saasRegister/components/EntryEmail.d.ts +9 -0
  88. package/es/plus/saasRegister/components/EntryEmail.js +92 -0
  89. package/es/plus/saasRegister/components/EntryInfo.d.ts +9 -0
  90. package/es/plus/saasRegister/components/EntryInfo.js +145 -0
  91. package/es/plus/saasRegister/components/GoLogin.d.ts +4 -0
  92. package/es/plus/saasRegister/components/GoLogin.js +27 -0
  93. package/es/plus/saasRegister/components/Header.d.ts +3 -0
  94. package/es/plus/saasRegister/components/Header.js +62 -0
  95. package/es/plus/saasRegister/components/VerifyError.d.ts +8 -0
  96. package/es/plus/saasRegister/components/VerifyError.js +68 -0
  97. package/es/plus/saasRegister/components/VerifyingLink.d.ts +5 -0
  98. package/es/plus/saasRegister/components/VerifyingLink.js +16 -0
  99. package/es/plus/saasRegister/components/VertifyEmail.d.ts +7 -0
  100. package/es/plus/saasRegister/components/VertifyEmail.js +121 -0
  101. package/es/plus/saasRegister/index.d.ts +5 -0
  102. package/es/plus/saasRegister/index.js +246 -0
  103. package/es/plus/saasRegister/index.less +218 -0
  104. package/es/plus/saasRegister/locales.d.ts +117 -0
  105. package/es/plus/saasRegister/locales.js +116 -0
  106. package/es/plus/saasRegister/types.d.ts +114 -0
  107. package/es/plus/saasRegister/types.js +24 -0
  108. package/lib/components/appointmentBooking/components/Content/index.js +1 -1
  109. package/lib/components/appointmentBooking/components/Content/index.less +3 -3
  110. package/lib/components/appointmentBooking/components/Services/index.js +2 -2
  111. package/lib/components/appointmentBooking/index.js +6 -1
  112. package/lib/components/booking/info2/service/addTimeModal/index.js +0 -1
  113. package/lib/components/booking/utils.d.ts +2 -2
  114. package/lib/components/eftposPay/hooks.d.ts +1 -1
  115. package/lib/components/eftposPay/store/index.d.ts +2 -2
  116. package/lib/components/eventBooking/index.js +6 -1
  117. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +3 -3
  118. package/lib/hooks/useWindowSize.js +6 -1
  119. package/lib/index.d.ts +3 -0
  120. package/lib/index.js +9 -0
  121. package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.d.ts +10 -0
  122. package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.js +62 -0
  123. package/lib/plus/productSelect/CategoryTabs/CategorySkeleton.less +30 -0
  124. package/lib/plus/productSelect/CategoryTabs/index.d.ts +18 -0
  125. package/lib/plus/productSelect/CategoryTabs/index.js +183 -0
  126. package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.d.ts +10 -0
  127. package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.js +58 -0
  128. package/lib/plus/productSelect/ProductCard/ProductCardSkeleton.less +81 -0
  129. package/lib/plus/productSelect/ProductCard/index.d.ts +45 -0
  130. package/lib/plus/productSelect/ProductCard/index.js +184 -0
  131. package/lib/plus/productSelect/ProductCard/index.less +253 -0
  132. package/lib/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
  133. package/lib/plus/productSelect/ProductList/gridComponents.js +148 -0
  134. package/lib/plus/productSelect/ProductList/index.d.ts +22 -0
  135. package/lib/plus/productSelect/ProductList/index.js +86 -0
  136. package/lib/plus/productSelect/ProductList/index.less +0 -0
  137. package/lib/plus/productSelect/components/IntersectionObserver.d.ts +42 -0
  138. package/lib/plus/productSelect/components/IntersectionObserver.js +269 -0
  139. package/lib/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
  140. package/lib/plus/productSelect/components/TabsStructure/TabsStructure.js +393 -0
  141. package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +224 -0
  142. package/lib/plus/productSelect/components/TabsStructure/hooks.d.ts +22 -0
  143. package/lib/plus/productSelect/components/TabsStructure/hooks.js +209 -0
  144. package/lib/plus/productSelect/components/TabsStructure/index.d.ts +5 -0
  145. package/lib/plus/productSelect/components/TabsStructure/index.js +92 -0
  146. package/lib/plus/productSelect/components/TabsStructure/styles.d.ts +47 -0
  147. package/lib/plus/productSelect/components/TabsStructure/styles.js +122 -0
  148. package/lib/plus/productSelect/components/TabsStructure/types.d.ts +105 -0
  149. package/lib/plus/productSelect/components/TabsStructure/types.js +17 -0
  150. package/lib/plus/productSelect/components/TabsStructure/utils.d.ts +12 -0
  151. package/lib/plus/productSelect/components/TabsStructure/utils.js +72 -0
  152. package/lib/plus/productSelect/components/pisellPriceText/index.d.ts +12 -0
  153. package/lib/plus/productSelect/components/pisellPriceText/index.js +73 -0
  154. package/lib/plus/productSelect/components/pisellPriceText/index.less +4 -0
  155. package/lib/plus/productSelect/hooks/useToken.d.ts +18 -0
  156. package/lib/plus/productSelect/hooks/useToken.js +50 -0
  157. package/lib/plus/productSelect/index.d.ts +31 -0
  158. package/lib/plus/productSelect/index.js +299 -0
  159. package/lib/plus/productSelect/index.less +56 -0
  160. package/lib/plus/productSelect/locales.d.ts +18 -0
  161. package/lib/plus/productSelect/locales.js +41 -0
  162. package/lib/plus/productSelect/theme/token.d.ts +17 -0
  163. package/lib/plus/productSelect/theme/token.js +47 -0
  164. package/lib/plus/productSelect/utils.d.ts +39 -0
  165. package/lib/plus/productSelect/utils.js +138 -0
  166. package/lib/plus/saasCreateOrganization/components/Header.d.ts +3 -0
  167. package/lib/plus/saasCreateOrganization/components/Header.js +99 -0
  168. package/lib/plus/saasCreateOrganization/index.d.ts +4 -0
  169. package/lib/plus/saasCreateOrganization/index.js +47 -0
  170. package/lib/plus/saasCreateOrganization/index.less +55 -0
  171. package/lib/plus/saasCreateOrganization/locales.d.ts +15 -0
  172. package/lib/plus/saasCreateOrganization/locales.js +38 -0
  173. package/lib/plus/saasCreateOrganization/types.d.ts +69 -0
  174. package/lib/plus/saasCreateOrganization/types.js +17 -0
  175. package/lib/plus/saasLogin/index.d.ts +5 -0
  176. package/lib/plus/saasLogin/index.js +171 -0
  177. package/lib/plus/saasLogin/index.less +136 -0
  178. package/lib/plus/saasLogin/locales.d.ts +51 -0
  179. package/lib/plus/saasLogin/locales.js +74 -0
  180. package/lib/plus/saasLogin/types.d.ts +62 -0
  181. package/lib/plus/saasLogin/types.js +17 -0
  182. package/lib/plus/saasLogin/utils.d.ts +35 -0
  183. package/lib/plus/saasLogin/utils.js +50 -0
  184. package/lib/plus/saasRegister/components/EntryEmail.d.ts +9 -0
  185. package/lib/plus/saasRegister/components/EntryEmail.js +92 -0
  186. package/lib/plus/saasRegister/components/EntryInfo.d.ts +9 -0
  187. package/lib/plus/saasRegister/components/EntryInfo.js +128 -0
  188. package/lib/plus/saasRegister/components/GoLogin.d.ts +4 -0
  189. package/lib/plus/saasRegister/components/GoLogin.js +58 -0
  190. package/lib/plus/saasRegister/components/Header.d.ts +3 -0
  191. package/lib/plus/saasRegister/components/Header.js +99 -0
  192. package/lib/plus/saasRegister/components/VerifyError.d.ts +8 -0
  193. package/lib/plus/saasRegister/components/VerifyError.js +123 -0
  194. package/lib/plus/saasRegister/components/VerifyingLink.d.ts +5 -0
  195. package/lib/plus/saasRegister/components/VerifyingLink.js +44 -0
  196. package/lib/plus/saasRegister/components/VertifyEmail.d.ts +7 -0
  197. package/lib/plus/saasRegister/components/VertifyEmail.js +110 -0
  198. package/lib/plus/saasRegister/index.d.ts +5 -0
  199. package/lib/plus/saasRegister/index.js +205 -0
  200. package/lib/plus/saasRegister/index.less +218 -0
  201. package/lib/plus/saasRegister/locales.d.ts +117 -0
  202. package/lib/plus/saasRegister/locales.js +140 -0
  203. package/lib/plus/saasRegister/types.d.ts +114 -0
  204. package/lib/plus/saasRegister/types.js +54 -0
  205. package/lowcode/saas-create-organization/meta.ts +214 -0
  206. package/lowcode/saas-create-organization/snippets.ts +25 -0
  207. package/lowcode/saas-login/meta.ts +370 -0
  208. package/lowcode/saas-login/snippets.ts +38 -0
  209. package/lowcode/saas-register/meta.ts +386 -0
  210. package/lowcode/saas-register/snippets.ts +31 -0
  211. package/package.json +2 -2
@@ -0,0 +1,170 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import React, { memo } from 'react';
8
+ import classNames from 'classnames';
9
+ import { locales, image as imageAli } from '@pisell/utils';
10
+ import Decimal from 'decimal.js';
11
+ import { IntersectionTrigger } from "../components/IntersectionObserver";
12
+ import PisellPriceText from "../components/pisellPriceText";
13
+ import ProductCardSkeleton from "./ProductCardSkeleton";
14
+ import "./index.less";
15
+ import { PREFIX } from "../index";
16
+
17
+ // 产品卡片配置接口
18
+
19
+ // 产品卡片属性接口
20
+
21
+ // 默认配置
22
+ var defaultConfig = {
23
+ isProductCover: 1,
24
+ imgWidth: '180px',
25
+ imgHeight: '126px',
26
+ radius: 8,
27
+ isTitle: 1,
28
+ isSubtitle: 0,
29
+ showSpec: true,
30
+ isTag: 0,
31
+ isPrice: 0,
32
+ isOriginPrice: 0,
33
+ showZeroPrice: false,
34
+ showMarketingTag: true,
35
+ showRemark: true,
36
+ isStock: 0
37
+ };
38
+
39
+ // 产品卡片组件
40
+ export var ProductCard = /*#__PURE__*/memo(function (_ref) {
41
+ var item = _ref.item,
42
+ index = _ref.index,
43
+ context = _ref.context,
44
+ onSelect = _ref.onSelect,
45
+ isSelected = _ref.isSelected,
46
+ className = _ref.className,
47
+ _ref$decorateConfig = _ref.decorateConfig,
48
+ decorateConfig = _ref$decorateConfig === void 0 ? {} : _ref$decorateConfig;
49
+ var finalConfig = _objectSpread(_objectSpread({}, defaultConfig), decorateConfig);
50
+ var imgHeight = finalConfig.imgHeight,
51
+ imgWidth = finalConfig.imgWidth,
52
+ isOriginPrice = finalConfig.isOriginPrice,
53
+ isPrice = finalConfig.isPrice,
54
+ isProductCover = finalConfig.isProductCover,
55
+ isStock = finalConfig.isStock,
56
+ isSubtitle = finalConfig.isSubtitle,
57
+ isTitle = finalConfig.isTitle,
58
+ radius = finalConfig.radius,
59
+ showZeroPrice = finalConfig.showZeroPrice;
60
+ var __typename = item.__typename;
61
+
62
+ // 如果是分类,显示分类样式
63
+ if (__typename === 'category') {
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: classNames("".concat(PREFIX, "__product-category"), className),
66
+ "data-index": index,
67
+ "data-item-index": index
68
+ }, /*#__PURE__*/React.createElement("div", {
69
+ className: "category-title"
70
+ }, item.name));
71
+ }
72
+
73
+ // 获取库存文本
74
+ var getStockText = function getStockText(item) {
75
+ if (item.is_track === 0) {
76
+ return false;
77
+ }
78
+ return "".concat(locales.getText('pisell2.product-select.stock'), "\uFF1A").concat(item.stock_quantity);
79
+ };
80
+ var getTextCover = function getTextCover(title) {
81
+ if (!title) return '';
82
+ var cleanTitle = title.trim();
83
+ if (cleanTitle.length === 0) return '';
84
+ return cleanTitle.substring(0, 2).toUpperCase();
85
+ };
86
+
87
+ // 渲染价格
88
+ var renderPrice = function renderPrice(item) {
89
+ var _price = item.price,
90
+ _original_price = item.original_price,
91
+ is_bundle = item.is_bundle,
92
+ minimum_markup_price = item.minimum_markup_price;
93
+ var price = _price;
94
+ var original_price = _original_price;
95
+ if (is_bundle) {
96
+ price = new Decimal(price).plus(new Decimal(minimum_markup_price)).toFixed(2);
97
+ original_price = new Decimal(original_price).plus(new Decimal(minimum_markup_price)).toFixed(2);
98
+ }
99
+ if (!showZeroPrice && !parseFloat(price)) return null;
100
+ return !!isPrice || !!isOriginPrice ? /*#__PURE__*/React.createElement("div", {
101
+ className: "price-info"
102
+ }, isPrice ? /*#__PURE__*/React.createElement("div", {
103
+ className: "price"
104
+ }, /*#__PURE__*/React.createElement(PisellPriceText, {
105
+ value: price,
106
+ isMini: is_bundle
107
+ })) : null, !!isOriginPrice && parseFloat(original_price) ? /*#__PURE__*/React.createElement("div", {
108
+ className: "original-price"
109
+ }, /*#__PURE__*/React.createElement(PisellPriceText, {
110
+ value: original_price,
111
+ isMini: is_bundle
112
+ })) : null) : null;
113
+ };
114
+
115
+ // 产品卡片内容
116
+ var cardContent = /*#__PURE__*/React.createElement("div", {
117
+ className: classNames("".concat(PREFIX, "__product-card"), className, {
118
+ selected: isSelected
119
+ }),
120
+ onClick: function onClick() {
121
+ onSelect === null || onSelect === void 0 || onSelect(item);
122
+ },
123
+ "data-index": index,
124
+ "data-item-index": index
125
+ }, isProductCover ? /*#__PURE__*/React.createElement("div", {
126
+ className: "card-left",
127
+ style: {
128
+ width: imgWidth || 'auto',
129
+ height: imgHeight || 'auto'
130
+ }
131
+ }, item.cover ? /*#__PURE__*/React.createElement("img", {
132
+ loading: "lazy",
133
+ src: imageAli.ali(item.cover, 360),
134
+ alt: item.title,
135
+ style: {
136
+ borderRadius: radius
137
+ }
138
+ }) : /*#__PURE__*/React.createElement("div", {
139
+ className: "text-cover",
140
+ style: {
141
+ borderRadius: radius
142
+ }
143
+ }, getTextCover(item.title))) : null, /*#__PURE__*/React.createElement("div", {
144
+ className: "card-right"
145
+ }, !!isTitle ? /*#__PURE__*/React.createElement("div", {
146
+ className: "title"
147
+ }, item.title) : null, !!isSubtitle && item.subtitle ? /*#__PURE__*/React.createElement("div", {
148
+ className: "subtitle"
149
+ }, item.subtitle) : null, !!isStock && !!item.is_track ? /*#__PURE__*/React.createElement("div", {
150
+ className: "stock"
151
+ }, getStockText(item)) : null, renderPrice(item)));
152
+ if (context) {
153
+ return /*#__PURE__*/React.createElement(IntersectionTrigger, {
154
+ onShow: function onShow() {
155
+ return context.onItemIntersectionIn(item);
156
+ }
157
+ // onHide={() => context.onItemIntersectionOut(item)}
158
+ }, cardContent);
159
+ }
160
+ return cardContent;
161
+ });
162
+ ProductCard.displayName = 'ProductCard';
163
+
164
+ // 默认的ItemContent组件(保持向后兼容)
165
+ export var DefaultItemContent = /*#__PURE__*/memo(function (props) {
166
+ return /*#__PURE__*/React.createElement(ProductCard, props);
167
+ });
168
+ DefaultItemContent.displayName = 'DefaultItemContent';
169
+ export default ProductCard;
170
+ export { ProductCardSkeleton };
@@ -0,0 +1,253 @@
1
+ .pisell-product-select {
2
+ &__product-category {
3
+ padding: 4px 0;
4
+
5
+ &[data-index='0'] {
6
+ padding-top: 0px;
7
+ }
8
+ .category-title {
9
+ color: var(--ps-category-text-color, #000);
10
+ font-size: 18px;
11
+ font-style: normal;
12
+ font-weight: 600;
13
+ line-height: 24px;
14
+ }
15
+ }
16
+
17
+ &__product-card {
18
+ user-select: none;
19
+ cursor: pointer;
20
+ border-radius: 12px;
21
+ background: var(--ps-card-bg, #fff);
22
+ box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1),
23
+ 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
24
+ padding: 8px;
25
+ display: flex;
26
+ gap: 20px;
27
+ position: relative;
28
+ overflow: hidden;
29
+ min-height: 142px;
30
+ height: 100%;
31
+ align-items: center;
32
+ box-sizing: border-box;
33
+
34
+ // 只在非触摸设备上启用hover效果
35
+ @media (hover: hover) {
36
+ &:hover {
37
+ background: var(--ps-card-hover-bg, #eaecf0);
38
+ }
39
+ }
40
+
41
+ &.selected {
42
+ background: var(--ps-card-selected-bg, #8157d5);
43
+
44
+ .card-right {
45
+ .title,
46
+ .subtitle,
47
+ .price {
48
+ color: var(--ps-card-selected-text-color, #ffffff);
49
+ }
50
+
51
+ .spec-item,
52
+ .original-price,
53
+ .stock {
54
+ color: var(
55
+ --ps-card-selected-secondary-text-color,
56
+ rgba(255, 255, 255, 0.7)
57
+ );
58
+ }
59
+ }
60
+ }
61
+
62
+ .marketing-tags-wrapper {
63
+ position: absolute;
64
+ top: 0;
65
+ left: 0;
66
+ pointer-events: none;
67
+ user-select: none;
68
+ z-index: 1;
69
+
70
+ .marketing-tags {
71
+ display: flex;
72
+ flex-direction: column;
73
+ row-gap: 6px;
74
+ }
75
+
76
+ .marketing-tag-item {
77
+ display: flex;
78
+ padding: 6px 10px;
79
+ justify-content: center;
80
+ align-items: center;
81
+ gap: 10px;
82
+ border-radius: 0 12px 12px 0;
83
+ background: var(--Error-100, #fee4e2);
84
+ color: var(--Error-700, #b42318);
85
+ text-align: center;
86
+ font-size: 14px;
87
+ font-style: normal;
88
+ font-weight: 500;
89
+ line-height: 20px;
90
+
91
+ &:nth-of-type(1) {
92
+ border-radius: 0 0 12px 0;
93
+ }
94
+ }
95
+ }
96
+
97
+ .card-left {
98
+ flex-shrink: 0;
99
+
100
+ img {
101
+ border-radius: 8px;
102
+ background: lightgray 50% / cover no-repeat;
103
+ width: 100%;
104
+ height: 100%;
105
+ object-fit: cover;
106
+ }
107
+
108
+ .text-cover {
109
+ width: 100%;
110
+ height: 100%;
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ background: #dedede;
115
+ color: #6c6c6c;
116
+ font-size: 60px;
117
+ font-weight: 600;
118
+ text-align: center;
119
+ line-height: 1;
120
+ letter-spacing: 1px;
121
+ border-radius: 8px;
122
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
123
+ }
124
+ }
125
+
126
+ .card-right {
127
+ display: flex;
128
+ flex-direction: column;
129
+ row-gap: 8px;
130
+ min-height: 92px;
131
+ overflow: hidden;
132
+ flex: 1;
133
+
134
+ .title {
135
+ color: var(--ps-color-text, #1b1b1b);
136
+ font-size: 18px;
137
+ font-style: normal;
138
+ font-weight: 600;
139
+ line-height: 28px;
140
+ display: -webkit-box;
141
+ -webkit-line-clamp: 2;
142
+ -webkit-box-orient: vertical;
143
+ overflow: hidden;
144
+ text-overflow: ellipsis;
145
+ }
146
+
147
+ .subtitle {
148
+ color: var(--ps-color-text, #1b1b1b);
149
+ font-size: 16px;
150
+ font-style: normal;
151
+ font-weight: 500;
152
+ line-height: 24px;
153
+ display: -webkit-box;
154
+ -webkit-line-clamp: 2;
155
+ -webkit-box-orient: vertical;
156
+ overflow: hidden;
157
+ text-overflow: ellipsis;
158
+ }
159
+
160
+ .stock,
161
+ .specs {
162
+ overflow: hidden;
163
+ color: var(--ps-color-text-secondary, #4e4e4e);
164
+ text-overflow: ellipsis;
165
+ font-size: 14px;
166
+ font-style: normal;
167
+ font-weight: 500;
168
+ line-height: 20px;
169
+
170
+ .spec-item {
171
+ margin-top: 8px;
172
+
173
+ &:nth-of-type(1) {
174
+ margin-top: 0;
175
+ }
176
+ }
177
+ }
178
+
179
+ .tags {
180
+ display: flex;
181
+ gap: 8px;
182
+ flex-wrap: wrap;
183
+
184
+ .tag-item {
185
+ display: flex;
186
+ padding: 4px 12px;
187
+ align-items: center;
188
+ border-radius: 16px;
189
+ border: 1px solid var(--Error-200, #fecdca);
190
+ background: var(--Error-50, #fef3f2);
191
+ mix-blend-mode: multiply;
192
+ color: var(--Error-700, #b42318);
193
+ text-align: center;
194
+ font-size: 14px;
195
+ font-style: normal;
196
+ font-weight: 500;
197
+ line-height: 20px;
198
+ }
199
+ }
200
+
201
+ .price-info {
202
+ display: flex;
203
+ align-items: center;
204
+ flex-wrap: wrap;
205
+ gap: unset;
206
+ }
207
+
208
+ .price {
209
+ color: var(--ps-color-text, #1b1b1b);
210
+ font-size: 18px;
211
+ font-style: normal;
212
+ font-weight: 600;
213
+ line-height: 28px;
214
+ overflow: hidden;
215
+ margin-right: 8px;
216
+ }
217
+
218
+ .original-price {
219
+ color: var(--ps-color-text-secondary, #4e4e4e);
220
+ font-size: 16px;
221
+ font-style: normal;
222
+ font-weight: 400;
223
+ line-height: 24px;
224
+ position: relative;
225
+ overflow: hidden;
226
+
227
+ &::before {
228
+ content: '';
229
+ display: block;
230
+ position: absolute;
231
+ top: 50%;
232
+ left: 0;
233
+ width: 100%;
234
+ height: 1px;
235
+ background-color: #4e4e4e;
236
+ transform: translateY(-50%);
237
+ }
238
+
239
+ > span {
240
+ vertical-align: middle;
241
+ }
242
+ }
243
+
244
+ .remark {
245
+ color: var(--Warning-600, #dc6803);
246
+ font-size: 14px;
247
+ font-style: normal;
248
+ font-weight: 600;
249
+ line-height: 20px;
250
+ }
251
+ }
252
+ }
253
+ }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ export interface GridConfig {
3
+ grid: boolean;
4
+ config: string;
5
+ }
6
+ export declare const parseGridConfig: (config: string) => number[];
7
+ export declare const createGridComponents: (layout?: GridConfig | null) => {
8
+ List: React.MemoExoticComponent<({ children, ...props }: any) => JSX.Element>;
9
+ Item: React.MemoExoticComponent<({ children, index, item, ...props }: any) => JSX.Element>;
10
+ };
11
+ export declare const GRID_LAYOUTS: {
12
+ readonly SINGLE_COLUMN: {
13
+ readonly grid: false;
14
+ readonly config: "12";
15
+ };
16
+ readonly TWO_COLUMNS: {
17
+ readonly grid: true;
18
+ readonly config: "12:12";
19
+ };
20
+ readonly THREE_COLUMNS: {
21
+ readonly grid: true;
22
+ readonly config: "8:8:8";
23
+ };
24
+ readonly FOUR_COLUMNS: {
25
+ readonly grid: true;
26
+ readonly config: "6:6:6:6";
27
+ };
28
+ readonly UNEQUAL_TWO: {
29
+ readonly grid: true;
30
+ readonly config: "8:16";
31
+ };
32
+ readonly UNEQUAL_THREE: {
33
+ readonly grid: true;
34
+ readonly config: "6:12:6";
35
+ };
36
+ };
37
+ export declare const createTwoColumnGrid: () => {
38
+ List: React.MemoExoticComponent<({ children, ...props }: any) => JSX.Element>;
39
+ Item: React.MemoExoticComponent<({ children, index, item, ...props }: any) => JSX.Element>;
40
+ };
41
+ export declare const createCustomGrid: (config: string) => {
42
+ List: React.MemoExoticComponent<({ children, ...props }: any) => JSX.Element>;
43
+ Item: React.MemoExoticComponent<({ children, index, item, ...props }: any) => JSX.Element>;
44
+ };
@@ -0,0 +1,149 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["children"],
3
+ _excluded2 = ["children", "index", "item"];
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
10
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
12
+ import React, { memo } from 'react';
13
+
14
+ // 网格配置类型定义
15
+
16
+ // 解析网格配置字符串
17
+ export var parseGridConfig = function parseGridConfig(config) {
18
+ return config.split(':').map(function (num) {
19
+ return parseInt(num, 10);
20
+ }).filter(function (num) {
21
+ return !isNaN(num);
22
+ });
23
+ };
24
+
25
+ // 计算网格列宽度
26
+ var calculateColumnWidth = function calculateColumnWidth(columns, index) {
27
+ var total = columns.reduce(function (sum, col) {
28
+ return sum + col;
29
+ }, 0);
30
+ var percentage = columns[index] / total * 100;
31
+ return "".concat(percentage, "%");
32
+ };
33
+
34
+ // 创建网格组件的工厂函数
35
+ export var createGridComponents = function createGridComponents(layout) {
36
+ // 兼容性处理:当传入空值时,默认为单列布局
37
+ if (!layout) {
38
+ layout = GRID_LAYOUTS.SINGLE_COLUMN;
39
+ }
40
+ var columns = parseGridConfig(layout.config);
41
+ var isGrid = layout.grid && columns.length > 1;
42
+
43
+ // 网格容器组件
44
+ var GridListComponent = /*#__PURE__*/memo(function (_ref) {
45
+ var children = _ref.children,
46
+ props = _objectWithoutProperties(_ref, _excluded);
47
+ if (!isGrid) {
48
+ return /*#__PURE__*/React.createElement("div", _extends({
49
+ className: "product-list-wrapper",
50
+ style: {
51
+ display: 'flex',
52
+ flexDirection: 'column',
53
+ gap: '12px'
54
+ }
55
+ }, props), children);
56
+ }
57
+ return /*#__PURE__*/React.createElement("div", _extends({
58
+ className: "product-grid-wrapper",
59
+ style: _objectSpread({
60
+ display: 'flex',
61
+ flexWrap: 'wrap',
62
+ gap: '12px'
63
+ }, props.style)
64
+ }, props), children);
65
+ });
66
+
67
+ // 网格项组件
68
+ var GridItemComponent = /*#__PURE__*/memo(function (_ref2) {
69
+ var children = _ref2.children,
70
+ index = _ref2.index,
71
+ item = _ref2.item,
72
+ props = _objectWithoutProperties(_ref2, _excluded2);
73
+ if (!isGrid) {
74
+ if (item && item.__typename === 'category') {
75
+ return /*#__PURE__*/React.createElement("div", _extends({
76
+ id: "ps_category_".concat(item.id)
77
+ }, props), children);
78
+ }
79
+ return /*#__PURE__*/React.createElement("div", props, children);
80
+ }
81
+
82
+ // 如果是category类型,占据整行
83
+ if (item && item.__typename === 'category') {
84
+ return /*#__PURE__*/React.createElement("div", _extends({
85
+ id: "ps_category_".concat(item.id),
86
+ style: _objectSpread({
87
+ width: '100%',
88
+ flexShrink: 0
89
+ }, props.style)
90
+ }, props), children);
91
+ }
92
+ var columnIndex = index % columns.length;
93
+ var width = calculateColumnWidth(columns, columnIndex);
94
+ return /*#__PURE__*/React.createElement("div", _extends({
95
+ style: _objectSpread({
96
+ width: "calc(".concat(width, " - ").concat((columns.length - 1) * 12 / columns.length, "px)"),
97
+ flexShrink: 0
98
+ }, props.style)
99
+ }, props), children);
100
+ });
101
+ GridListComponent.displayName = "GridListComponent_".concat(layout.config);
102
+ GridItemComponent.displayName = "GridItemComponent_".concat(layout.config);
103
+ return {
104
+ List: GridListComponent,
105
+ Item: GridItemComponent
106
+ };
107
+ };
108
+
109
+ // 预定义的常用网格配置
110
+ export var GRID_LAYOUTS = {
111
+ SINGLE_COLUMN: {
112
+ grid: false,
113
+ config: '12'
114
+ },
115
+ TWO_COLUMNS: {
116
+ grid: true,
117
+ config: '12:12'
118
+ },
119
+ THREE_COLUMNS: {
120
+ grid: true,
121
+ config: '8:8:8'
122
+ },
123
+ FOUR_COLUMNS: {
124
+ grid: true,
125
+ config: '6:6:6:6'
126
+ },
127
+ UNEQUAL_TWO: {
128
+ grid: true,
129
+ config: '8:16'
130
+ },
131
+ // 1:2 比例
132
+ UNEQUAL_THREE: {
133
+ grid: true,
134
+ config: '6:12:6'
135
+ } // 1:2:1 比例
136
+ };
137
+
138
+ // 便捷函数:创建常用网格组件
139
+ export var createTwoColumnGrid = function createTwoColumnGrid() {
140
+ return createGridComponents(GRID_LAYOUTS.TWO_COLUMNS);
141
+ };
142
+
143
+ // 自定义网格配置创建函数
144
+ export var createCustomGrid = function createCustomGrid(config) {
145
+ return createGridComponents({
146
+ grid: true,
147
+ config: config
148
+ });
149
+ };
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ className?: string;
4
+ loading?: boolean;
5
+ data: any[];
6
+ context: {
7
+ onItemIntersectionIn: (item: any) => void;
8
+ onItemIntersectionOut: (item: any) => void;
9
+ };
10
+ customScrollParent?: Element | null;
11
+ components?: {
12
+ List?: React.ComponentType<any>;
13
+ Item?: React.ComponentType<any>;
14
+ [key: string]: React.ComponentType<any> | undefined;
15
+ };
16
+ itemContent?: (index: number, data: any, context: any) => React.ReactNode;
17
+ itemSkeleton?: React.ReactNode;
18
+ [key: string]: any;
19
+ }
20
+ declare const ProductList: React.ForwardRefExoticComponent<Omit<IProps, "ref"> & React.RefAttributes<any>>;
21
+ export default ProductList;
22
+ export { createGridComponents, createTwoColumnGrid, createCustomGrid, GRID_LAYOUTS, type GridConfig, } from './gridComponents';