@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,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,148 @@
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/ProductList/gridComponents.tsx
30
+ var gridComponents_exports = {};
31
+ __export(gridComponents_exports, {
32
+ GRID_LAYOUTS: () => GRID_LAYOUTS,
33
+ createCustomGrid: () => createCustomGrid,
34
+ createGridComponents: () => createGridComponents,
35
+ createTwoColumnGrid: () => createTwoColumnGrid,
36
+ parseGridConfig: () => parseGridConfig
37
+ });
38
+ module.exports = __toCommonJS(gridComponents_exports);
39
+ var import_react = __toESM(require("react"));
40
+ var parseGridConfig = (config) => {
41
+ return config.split(":").map((num) => parseInt(num, 10)).filter((num) => !isNaN(num));
42
+ };
43
+ var calculateColumnWidth = (columns, index) => {
44
+ const total = columns.reduce((sum, col) => sum + col, 0);
45
+ const percentage = columns[index] / total * 100;
46
+ return `${percentage}%`;
47
+ };
48
+ var createGridComponents = (layout) => {
49
+ if (!layout) {
50
+ layout = GRID_LAYOUTS.SINGLE_COLUMN;
51
+ }
52
+ const columns = parseGridConfig(layout.config);
53
+ const isGrid = layout.grid && columns.length > 1;
54
+ const GridListComponent = (0, import_react.memo)(({ children, ...props }) => {
55
+ if (!isGrid) {
56
+ return /* @__PURE__ */ import_react.default.createElement(
57
+ "div",
58
+ {
59
+ className: "product-list-wrapper",
60
+ style: {
61
+ display: "flex",
62
+ flexDirection: "column",
63
+ gap: "12px"
64
+ },
65
+ ...props
66
+ },
67
+ children
68
+ );
69
+ }
70
+ return /* @__PURE__ */ import_react.default.createElement(
71
+ "div",
72
+ {
73
+ className: "product-grid-wrapper",
74
+ style: {
75
+ display: "flex",
76
+ flexWrap: "wrap",
77
+ gap: "12px",
78
+ ...props.style
79
+ },
80
+ ...props
81
+ },
82
+ children
83
+ );
84
+ });
85
+ const GridItemComponent = (0, import_react.memo)(({ children, index, item, ...props }) => {
86
+ if (!isGrid) {
87
+ if (item && item.__typename === "category") {
88
+ return /* @__PURE__ */ import_react.default.createElement("div", { id: `ps_category_${item.id}`, ...props }, children);
89
+ }
90
+ return /* @__PURE__ */ import_react.default.createElement("div", { ...props }, children);
91
+ }
92
+ if (item && item.__typename === "category") {
93
+ return /* @__PURE__ */ import_react.default.createElement(
94
+ "div",
95
+ {
96
+ id: `ps_category_${item.id}`,
97
+ style: {
98
+ width: "100%",
99
+ flexShrink: 0,
100
+ ...props.style
101
+ },
102
+ ...props
103
+ },
104
+ children
105
+ );
106
+ }
107
+ const columnIndex = index % columns.length;
108
+ const width = calculateColumnWidth(columns, columnIndex);
109
+ return /* @__PURE__ */ import_react.default.createElement(
110
+ "div",
111
+ {
112
+ style: {
113
+ width: `calc(${width} - ${(columns.length - 1) * 12 / columns.length}px)`,
114
+ flexShrink: 0,
115
+ ...props.style
116
+ },
117
+ ...props
118
+ },
119
+ children
120
+ );
121
+ });
122
+ GridListComponent.displayName = `GridListComponent_${layout.config}`;
123
+ GridItemComponent.displayName = `GridItemComponent_${layout.config}`;
124
+ return {
125
+ List: GridListComponent,
126
+ Item: GridItemComponent
127
+ };
128
+ };
129
+ var GRID_LAYOUTS = {
130
+ SINGLE_COLUMN: { grid: false, config: "12" },
131
+ TWO_COLUMNS: { grid: true, config: "12:12" },
132
+ THREE_COLUMNS: { grid: true, config: "8:8:8" },
133
+ FOUR_COLUMNS: { grid: true, config: "6:6:6:6" },
134
+ UNEQUAL_TWO: { grid: true, config: "8:16" },
135
+ // 1:2 比例
136
+ UNEQUAL_THREE: { grid: true, config: "6:12:6" }
137
+ // 1:2:1 比例
138
+ };
139
+ var createTwoColumnGrid = () => createGridComponents(GRID_LAYOUTS.TWO_COLUMNS);
140
+ var createCustomGrid = (config) => createGridComponents({ grid: true, config });
141
+ // Annotate the CommonJS export names for ESM import in node:
142
+ 0 && (module.exports = {
143
+ GRID_LAYOUTS,
144
+ createCustomGrid,
145
+ createGridComponents,
146
+ createTwoColumnGrid,
147
+ parseGridConfig
148
+ });
@@ -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';
@@ -0,0 +1,86 @@
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/ProductList/index.tsx
30
+ var ProductList_exports = {};
31
+ __export(ProductList_exports, {
32
+ GRID_LAYOUTS: () => import_gridComponents.GRID_LAYOUTS,
33
+ createCustomGrid: () => import_gridComponents.createCustomGrid,
34
+ createGridComponents: () => import_gridComponents.createGridComponents,
35
+ createTwoColumnGrid: () => import_gridComponents.createTwoColumnGrid,
36
+ default: () => ProductList_default
37
+ });
38
+ module.exports = __toCommonJS(ProductList_exports);
39
+ var import_react = __toESM(require("react"));
40
+ var import_classnames = __toESM(require("classnames"));
41
+ var import_gridComponents = require("./gridComponents");
42
+ var DefaultListComponent = (0, import_react.memo)(({ children, ...listProps }) => /* @__PURE__ */ import_react.default.createElement("div", { className: "product-list-wrapper", ...listProps }, children));
43
+ var DefaultItemComponent = (0, import_react.memo)(({ children, index, ...itemProps }) => /* @__PURE__ */ import_react.default.createElement("div", { ...itemProps, "data-index": index, "data-item-index": index }, children));
44
+ var ProductList = (0, import_react.forwardRef)((props, ref) => {
45
+ const { className, data, context, components, itemContent } = props;
46
+ const ListComponent = (0, import_react.useMemo)(
47
+ () => (components == null ? void 0 : components.List) || DefaultListComponent,
48
+ [components == null ? void 0 : components.List]
49
+ );
50
+ const ItemComponent = (0, import_react.useMemo)(
51
+ () => (components == null ? void 0 : components.Item) || DefaultItemComponent,
52
+ [components == null ? void 0 : components.Item]
53
+ );
54
+ const itemContentRenderer = (0, import_react.useMemo)(() => {
55
+ if (itemContent) {
56
+ return (item, index) => itemContent(index, item, context);
57
+ }
58
+ return (item, index) => /* @__PURE__ */ import_react.default.createElement("div", null, index);
59
+ }, [itemContent, context]);
60
+ const renderedItems = (0, import_react.useMemo)(() => {
61
+ return data == null ? void 0 : data.map((item, index) => {
62
+ const content = itemContentRenderer(item, index);
63
+ return /* @__PURE__ */ import_react.default.createElement(
64
+ ItemComponent,
65
+ {
66
+ key: `${item.id || index}-${index}`,
67
+ item,
68
+ index,
69
+ "data-index": index,
70
+ "data-item-index": index,
71
+ context
72
+ },
73
+ content
74
+ );
75
+ });
76
+ }, [data, ItemComponent, itemContentRenderer]);
77
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(className) }, /* @__PURE__ */ import_react.default.createElement(ListComponent, { ref, context }, renderedItems));
78
+ });
79
+ var ProductList_default = ProductList;
80
+ // Annotate the CommonJS export names for ESM import in node:
81
+ 0 && (module.exports = {
82
+ GRID_LAYOUTS,
83
+ createCustomGrid,
84
+ createGridComponents,
85
+ createTwoColumnGrid
86
+ });
File without changes
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import type { ReactNode, CSSProperties } from 'react';
3
+ declare global {
4
+ interface Window {
5
+ IntersectionObserver: typeof IntersectionObserver;
6
+ }
7
+ }
8
+ interface IntersectionObserverContextValue {
9
+ initialized: boolean;
10
+ register: (params: {
11
+ ref: React.RefObject<HTMLElement>;
12
+ callback: (entry: IntersectionObserverEntry) => void;
13
+ }) => void;
14
+ unregister: (params: {
15
+ ref: React.RefObject<HTMLElement>;
16
+ }) => void;
17
+ }
18
+ declare type PriorityMode = 'top' | 'bottom' | 'left' | 'right' | undefined;
19
+ interface IntersectionObserverProps {
20
+ children: ReactNode;
21
+ root?: Element | null;
22
+ rootMargin?: string;
23
+ threshold?: number | number[];
24
+ priorityMode?: PriorityMode;
25
+ }
26
+ interface IntersectionTriggerOptions {
27
+ once?: boolean;
28
+ onHide?: (cleanup: () => void) => void;
29
+ onShow?: (cleanup: () => void) => void;
30
+ }
31
+ interface IntersectionTriggerProps extends IntersectionTriggerOptions {
32
+ children?: ReactNode;
33
+ className?: string;
34
+ style?: CSSProperties;
35
+ }
36
+ declare const IntersectionObserverContext: React.Context<IntersectionObserverContextValue>;
37
+ declare const Consumer: React.Consumer<IntersectionObserverContextValue>;
38
+ export declare const IntersectionObserverProvider: React.FC<IntersectionObserverProps>;
39
+ export declare const IntersectionTrigger: React.FC<IntersectionTriggerProps>;
40
+ export type { IntersectionObserverProps, IntersectionTriggerProps, IntersectionTriggerOptions, IntersectionObserverContextValue, PriorityMode, };
41
+ export { IntersectionObserverContext, Consumer as IntersectionObserverConsumer, };
42
+ export default IntersectionObserverProvider;