@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,183 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/plus/productSelect/CategoryTabs/index.tsx
30
+ var CategoryTabs_exports = {};
31
+ __export(CategoryTabs_exports, {
32
+ CategorySkeleton: () => import_CategorySkeleton.default,
33
+ default: () => CategoryTabs_default
34
+ });
35
+ module.exports = __toCommonJS(CategoryTabs_exports);
36
+ var import_react = __toESM(require("react"));
37
+ var import_IntersectionObserver = __toESM(require("../components/IntersectionObserver"));
38
+ var import_TabsStructure = require("../components/TabsStructure");
39
+ var import_TabsStructure2 = require("../components/TabsStructure/TabsStructure.less");
40
+ var import_CategorySkeleton = __toESM(require("./CategorySkeleton"));
41
+ var import__ = require("../index");
42
+ var CategoryTabs = (0, import_react.forwardRef)((props, ref) => {
43
+ const { items, activeKey, onChange, loading = false, skeleton } = props;
44
+ const railRef = (0, import_react.useRef)(null);
45
+ const [isAtStart, setIsAtStart] = (0, import_react.useState)(true);
46
+ const [isAtEnd, setIsAtEnd] = (0, import_react.useState)(false);
47
+ const [needsScrollButtons, setNeedsScrollButtons] = (0, import_react.useState)(false);
48
+ const scrollLeft = (0, import_react.useCallback)(() => {
49
+ if (!railRef.current) return;
50
+ const container = railRef.current;
51
+ const scrollAmount = container.clientWidth * 0.8;
52
+ const newPosition = Math.max(0, container.scrollLeft - scrollAmount);
53
+ container.scrollTo({ left: newPosition, behavior: "smooth" });
54
+ }, []);
55
+ const scrollRight = (0, import_react.useCallback)(() => {
56
+ if (!railRef.current) return;
57
+ const container = railRef.current;
58
+ const scrollAmount = container.clientWidth * 0.8;
59
+ const maxScroll = container.scrollWidth - container.clientWidth;
60
+ const newPosition = Math.min(
61
+ maxScroll,
62
+ container.scrollLeft + scrollAmount
63
+ );
64
+ container.scrollTo({ left: newPosition, behavior: "smooth" });
65
+ }, []);
66
+ (0, import_react.useEffect)(() => {
67
+ const updateScrollButtonsVisibility = () => {
68
+ if (railRef.current) {
69
+ const { scrollWidth, clientWidth } = railRef.current;
70
+ console.log("检测滚动按钮需求:", {
71
+ scrollWidth,
72
+ clientWidth,
73
+ needsScroll: scrollWidth > clientWidth
74
+ });
75
+ setNeedsScrollButtons(scrollWidth > clientWidth);
76
+ }
77
+ };
78
+ let resizeObserver = null;
79
+ const timer = setTimeout(() => {
80
+ const container = railRef.current;
81
+ if (!container) {
82
+ console.log("容器未找到,跳过滚动按钮检测");
83
+ return;
84
+ }
85
+ updateScrollButtonsVisibility();
86
+ resizeObserver = new ResizeObserver(updateScrollButtonsVisibility);
87
+ resizeObserver.observe(container);
88
+ }, 100);
89
+ return () => {
90
+ clearTimeout(timer);
91
+ if (resizeObserver) {
92
+ resizeObserver.disconnect();
93
+ }
94
+ };
95
+ }, [items]);
96
+ const { selectionIndicatorProps, listContainerProps } = (0, import_TabsStructure.useSelectionIndicator)(
97
+ railRef,
98
+ activeKey || ""
99
+ );
100
+ if (loading && skeleton) {
101
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, skeleton);
102
+ }
103
+ return /* @__PURE__ */ import_react.default.createElement(import_IntersectionObserver.default, null, items.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__tabs-wrapper` }, /* @__PURE__ */ import_react.default.createElement(
104
+ import_TabsStructure.TabsStructure,
105
+ {
106
+ variant: "pill",
107
+ backgroundVariant: "onPage",
108
+ selectedTab: activeKey
109
+ },
110
+ needsScrollButtons && /* @__PURE__ */ import_react.default.createElement(
111
+ import_TabsStructure.TabsStructure.ChevronButton,
112
+ {
113
+ direction: "prev",
114
+ disabled: isAtStart,
115
+ onClick: scrollLeft,
116
+ style: { marginRight: "8px" }
117
+ }
118
+ ),
119
+ /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.Rail, { ref: railRef }, /* @__PURE__ */ import_react.default.createElement(
120
+ import_IntersectionObserver.IntersectionTrigger,
121
+ {
122
+ onShow: () => {
123
+ console.log("is start");
124
+ setIsAtStart(true);
125
+ },
126
+ onHide: () => {
127
+ console.log("is start false");
128
+ setIsAtStart(false);
129
+ },
130
+ style: {
131
+ width: 1,
132
+ height: 1,
133
+ flexShrink: 0,
134
+ background: "rgba(0,0,0,0)"
135
+ },
136
+ className: "visibility-detector start-detector"
137
+ }
138
+ ), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.SelectionIndicator, { ...selectionIndicatorProps }), /* @__PURE__ */ import_react.default.createElement(import_TabsStructure.TabsStructure.ListContainer, { ...listContainerProps }, items.map((item) => /* @__PURE__ */ import_react.default.createElement(
139
+ import_TabsStructure.TabsStructure.Item,
140
+ {
141
+ key: item.key,
142
+ tabId: item.key,
143
+ "aria-selected": activeKey === item.key,
144
+ onClick: () => onChange(item.key),
145
+ className: "tab-item"
146
+ },
147
+ item.label
148
+ ))), /* @__PURE__ */ import_react.default.createElement(
149
+ import_IntersectionObserver.IntersectionTrigger,
150
+ {
151
+ className: "visibility-detector end-detector",
152
+ onShow: () => {
153
+ console.log("is end");
154
+ setIsAtEnd(true);
155
+ },
156
+ onHide: () => {
157
+ console.log("is end false");
158
+ setIsAtEnd(false);
159
+ },
160
+ style: {
161
+ width: 1,
162
+ height: 1,
163
+ flexShrink: 0,
164
+ background: "rgba(0,0,0,0)"
165
+ }
166
+ }
167
+ )),
168
+ needsScrollButtons && /* @__PURE__ */ import_react.default.createElement(
169
+ import_TabsStructure.TabsStructure.ChevronButton,
170
+ {
171
+ direction: "next",
172
+ disabled: isAtEnd,
173
+ onClick: scrollRight,
174
+ style: { marginLeft: "8px" }
175
+ }
176
+ )
177
+ )));
178
+ });
179
+ var CategoryTabs_default = CategoryTabs;
180
+ // Annotate the CommonJS export names for ESM import in node:
181
+ 0 && (module.exports = {
182
+ CategorySkeleton
183
+ });
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface ProductCardSkeletonProps {
3
+ className?: string;
4
+ style?: React.CSSProperties;
5
+ isProductCover?: boolean;
6
+ item?: any;
7
+ index?: number;
8
+ }
9
+ declare const ProductCardSkeleton: React.FC<ProductCardSkeletonProps>;
10
+ export default ProductCardSkeleton;
@@ -0,0 +1,58 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/plus/productSelect/ProductCard/ProductCardSkeleton.tsx
30
+ var ProductCardSkeleton_exports = {};
31
+ __export(ProductCardSkeleton_exports, {
32
+ default: () => ProductCardSkeleton_default
33
+ });
34
+ module.exports = __toCommonJS(ProductCardSkeleton_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_classnames = __toESM(require("classnames"));
37
+ var import_antd = require("antd");
38
+ var import__ = require("../index");
39
+ var ProductCardSkeleton = ({
40
+ className,
41
+ style,
42
+ isProductCover = true,
43
+ item
44
+ }) => {
45
+ if ((item == null ? void 0 : item.__typename) === "category") {
46
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Input, { active: true, size: "small", block: false });
47
+ }
48
+ return /* @__PURE__ */ import_react.default.createElement(
49
+ "div",
50
+ {
51
+ className: (0, import_classnames.default)(`${import__.PREFIX}__product-card`, className),
52
+ style
53
+ },
54
+ isProductCover && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Image, { active: true, style: { width: 180, height: 126 } }),
55
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { active: true, paragraph: { rows: 2 } })
56
+ );
57
+ };
58
+ var ProductCardSkeleton_default = ProductCardSkeleton;
@@ -0,0 +1,81 @@
1
+ .product-card-skeleton {
2
+ display: flex;
3
+ gap: 12px;
4
+ padding: 8px;
5
+ border-radius: 12px;
6
+ background: #fff;
7
+ box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
8
+
9
+ &__cover {
10
+ width: 180px;
11
+ height: 126px;
12
+ border-radius: 6px;
13
+ flex-shrink: 0;
14
+ }
15
+
16
+ &__content {
17
+ flex: 1;
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 8px;
21
+ }
22
+
23
+ &__title {
24
+ height: 20px;
25
+ border-radius: 4px;
26
+ }
27
+
28
+ &__specs {
29
+ display: flex;
30
+ gap: 6px;
31
+ flex-wrap: wrap;
32
+ }
33
+
34
+ &__spec-item {
35
+ height: 24px;
36
+ width: 60px;
37
+ border-radius: 12px;
38
+ }
39
+
40
+ &__price {
41
+ height: 18px;
42
+ width: 60%;
43
+ border-radius: 4px;
44
+ }
45
+ }
46
+
47
+ .skeleton-item {
48
+ background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
49
+ background-size: 200% 100%;
50
+ display: block;
51
+ position: relative;
52
+ overflow: hidden;
53
+
54
+ &--animated {
55
+ animation: skeleton-loading 1.5s ease-in-out infinite;
56
+ }
57
+ }
58
+
59
+ @keyframes skeleton-loading {
60
+ 0% {
61
+ background-position: 200% 0;
62
+ }
63
+ 100% {
64
+ background-position: -200% 0;
65
+ }
66
+ }
67
+
68
+ // 网格布局中的产品卡片骨架屏样式调整
69
+ .product-grid-wrapper {
70
+ .product-card-skeleton {
71
+ min-width: unset;
72
+ width: 100%;
73
+ }
74
+ }
75
+
76
+ // 列表布局中的产品卡片骨架屏样式调整
77
+ .product-list-wrapper {
78
+ .product-card-skeleton {
79
+ width: 100%;
80
+ }
81
+ }
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import ProductCardSkeleton from './ProductCardSkeleton';
3
+ import './index.less';
4
+ declare type BoolConfigVal = 0 | 1;
5
+ export interface ProductCardConfig {
6
+ isProductCover?: BoolConfigVal;
7
+ imgWidth?: string;
8
+ imgHeight?: string;
9
+ radius?: number;
10
+ isTitle?: BoolConfigVal;
11
+ isSubtitle?: BoolConfigVal;
12
+ showSpec?: boolean;
13
+ isTag?: BoolConfigVal;
14
+ isPrice?: BoolConfigVal;
15
+ isOriginPrice?: BoolConfigVal;
16
+ showZeroPrice?: boolean;
17
+ showMarketingTag?: boolean;
18
+ showRemark?: boolean;
19
+ isStock?: BoolConfigVal;
20
+ }
21
+ export interface ProductCardProps {
22
+ item: any;
23
+ index: number;
24
+ context?: {
25
+ onItemIntersectionIn: (item: any) => void;
26
+ onItemIntersectionOut: (item: any) => void;
27
+ };
28
+ className?: string;
29
+ onSelectProduct?: (item: any) => void;
30
+ currentProductId?: number;
31
+ onSelect?: (item: any) => void;
32
+ isSelected?: boolean;
33
+ decorateConfig?: ProductCardConfig;
34
+ }
35
+ export declare const ProductCard: React.MemoExoticComponent<({ item, index, context, onSelect, isSelected, className, decorateConfig, }: ProductCardProps) => JSX.Element>;
36
+ export declare const DefaultItemContent: React.MemoExoticComponent<(props: {
37
+ item: any;
38
+ index: number;
39
+ context?: {
40
+ onItemIntersectionIn: (item: any) => void;
41
+ onItemIntersectionOut: (item: any) => void;
42
+ } | undefined;
43
+ }) => JSX.Element>;
44
+ export default ProductCard;
45
+ export { ProductCardSkeleton };
@@ -0,0 +1,184 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/plus/productSelect/ProductCard/index.tsx
30
+ var ProductCard_exports = {};
31
+ __export(ProductCard_exports, {
32
+ DefaultItemContent: () => DefaultItemContent,
33
+ ProductCard: () => ProductCard,
34
+ ProductCardSkeleton: () => import_ProductCardSkeleton.default,
35
+ default: () => ProductCard_default
36
+ });
37
+ module.exports = __toCommonJS(ProductCard_exports);
38
+ var import_react = __toESM(require("react"));
39
+ var import_classnames = __toESM(require("classnames"));
40
+ var import_utils = require("@pisell/utils");
41
+ var import_decimal = __toESM(require("decimal.js"));
42
+ var import_IntersectionObserver = require("../components/IntersectionObserver");
43
+ var import_pisellPriceText = __toESM(require("../components/pisellPriceText"));
44
+ var import_ProductCardSkeleton = __toESM(require("./ProductCardSkeleton"));
45
+ var import_index = require("./index.less");
46
+ var import__ = require("../index");
47
+ var defaultConfig = {
48
+ isProductCover: 1,
49
+ imgWidth: "180px",
50
+ imgHeight: "126px",
51
+ radius: 8,
52
+ isTitle: 1,
53
+ isSubtitle: 0,
54
+ showSpec: true,
55
+ isTag: 0,
56
+ isPrice: 0,
57
+ isOriginPrice: 0,
58
+ showZeroPrice: false,
59
+ showMarketingTag: true,
60
+ showRemark: true,
61
+ isStock: 0
62
+ };
63
+ var ProductCard = (0, import_react.memo)(
64
+ ({
65
+ item,
66
+ index,
67
+ context,
68
+ onSelect,
69
+ isSelected,
70
+ className,
71
+ decorateConfig = {}
72
+ }) => {
73
+ const finalConfig = { ...defaultConfig, ...decorateConfig };
74
+ const {
75
+ imgHeight,
76
+ imgWidth,
77
+ isOriginPrice,
78
+ isPrice,
79
+ isProductCover,
80
+ isStock,
81
+ isSubtitle,
82
+ isTitle,
83
+ radius,
84
+ showZeroPrice
85
+ } = finalConfig;
86
+ const { __typename } = item;
87
+ if (__typename === "category") {
88
+ return /* @__PURE__ */ import_react.default.createElement(
89
+ "div",
90
+ {
91
+ className: (0, import_classnames.default)(`${import__.PREFIX}__product-category`, className),
92
+ "data-index": index,
93
+ "data-item-index": index
94
+ },
95
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "category-title" }, item.name)
96
+ );
97
+ }
98
+ const getStockText = (item2) => {
99
+ if (item2.is_track === 0) {
100
+ return false;
101
+ }
102
+ return `${import_utils.locales.getText("pisell2.product-select.stock")}:${item2.stock_quantity}`;
103
+ };
104
+ const getTextCover = (title) => {
105
+ if (!title) return "";
106
+ const cleanTitle = title.trim();
107
+ if (cleanTitle.length === 0) return "";
108
+ return cleanTitle.substring(0, 2).toUpperCase();
109
+ };
110
+ const renderPrice = (item2) => {
111
+ const {
112
+ price: _price,
113
+ original_price: _original_price,
114
+ is_bundle,
115
+ minimum_markup_price
116
+ } = item2;
117
+ let price = _price;
118
+ let original_price = _original_price;
119
+ if (is_bundle) {
120
+ price = new import_decimal.default(price).plus(new import_decimal.default(minimum_markup_price)).toFixed(2);
121
+ original_price = new import_decimal.default(original_price).plus(new import_decimal.default(minimum_markup_price)).toFixed(2);
122
+ }
123
+ if (!showZeroPrice && !parseFloat(price)) return null;
124
+ return !!isPrice || !!isOriginPrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: "price-info" }, isPrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: "price" }, /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { value: price, isMini: is_bundle })) : null, !!isOriginPrice && parseFloat(original_price) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "original-price" }, /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { value: original_price, isMini: is_bundle })) : null) : null;
125
+ };
126
+ const cardContent = /* @__PURE__ */ import_react.default.createElement(
127
+ "div",
128
+ {
129
+ className: (0, import_classnames.default)(`${import__.PREFIX}__product-card`, className, {
130
+ selected: isSelected
131
+ }),
132
+ onClick: () => {
133
+ onSelect == null ? void 0 : onSelect(item);
134
+ },
135
+ "data-index": index,
136
+ "data-item-index": index
137
+ },
138
+ isProductCover ? /* @__PURE__ */ import_react.default.createElement(
139
+ "div",
140
+ {
141
+ className: "card-left",
142
+ style: {
143
+ width: imgWidth || "auto",
144
+ height: imgHeight || "auto"
145
+ }
146
+ },
147
+ item.cover ? /* @__PURE__ */ import_react.default.createElement(
148
+ "img",
149
+ {
150
+ loading: "lazy",
151
+ src: import_utils.image.ali(item.cover, 360),
152
+ alt: item.title,
153
+ style: { borderRadius: radius }
154
+ }
155
+ ) : /* @__PURE__ */ import_react.default.createElement("div", { className: "text-cover", style: { borderRadius: radius } }, getTextCover(item.title))
156
+ ) : null,
157
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "card-right" }, !!isTitle ? /* @__PURE__ */ import_react.default.createElement("div", { className: "title" }, item.title) : null, !!isSubtitle && item.subtitle ? /* @__PURE__ */ import_react.default.createElement("div", { className: "subtitle" }, item.subtitle) : null, !!isStock && !!item.is_track ? /* @__PURE__ */ import_react.default.createElement("div", { className: "stock" }, getStockText(item)) : null, renderPrice(item))
158
+ );
159
+ if (context) {
160
+ return /* @__PURE__ */ import_react.default.createElement(
161
+ import_IntersectionObserver.IntersectionTrigger,
162
+ {
163
+ onShow: () => context.onItemIntersectionIn(item)
164
+ },
165
+ cardContent
166
+ );
167
+ }
168
+ return cardContent;
169
+ }
170
+ );
171
+ ProductCard.displayName = "ProductCard";
172
+ var DefaultItemContent = (0, import_react.memo)(
173
+ (props) => {
174
+ return /* @__PURE__ */ import_react.default.createElement(ProductCard, { ...props });
175
+ }
176
+ );
177
+ DefaultItemContent.displayName = "DefaultItemContent";
178
+ var ProductCard_default = ProductCard;
179
+ // Annotate the CommonJS export names for ESM import in node:
180
+ 0 && (module.exports = {
181
+ DefaultItemContent,
182
+ ProductCard,
183
+ ProductCardSkeleton
184
+ });