@pisell/materials 6.11.257 → 6.11.259

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 (255) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +3 -3
  5. package/build/lowcode/preview.css +1 -1
  6. package/build/lowcode/preview.js +1 -1
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +32 -32
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +32 -32
  11. package/es/components/PisellBasicGrid/PisellBasicGrid.d.ts +2 -1
  12. package/es/components/PisellCards/components/GraphicTextCard/GraphicTextCard.d.ts +2 -1
  13. package/es/components/PisellCards/components/MultilevelCard/MultilevelCard.d.ts +1 -1
  14. package/es/components/PisellCards/components/PisellImageCard/PisellImageCard.d.ts +2 -1
  15. package/es/components/PisellCards/components/TabCard/TabCard.d.ts +2 -1
  16. package/es/components/PisellCards/components/TextCard/TextCard.d.ts +2 -1
  17. package/es/components/PisellCards/index.d.ts +7 -5
  18. package/es/components/PisellFields/index.d.ts +1 -0
  19. package/es/components/PisellGroupView/PisellGroupView.d.ts +2 -1
  20. package/es/components/PisellLayouts/index.d.ts +3 -2
  21. package/es/components/PisellMetrics/index.d.ts +3 -2
  22. package/es/components/appVersionControl/index.d.ts +2 -1
  23. package/es/components/appVersionControl/types.d.ts +1 -0
  24. package/es/components/auto-complete-number/index.d.ts +2 -1
  25. package/es/components/badge/index.d.ts +2 -1
  26. package/es/components/batch-editor/index.d.ts +2 -1
  27. package/es/components/calendar/index.d.ts +4 -1
  28. package/es/components/cardMetricItem/index.d.ts +1 -1
  29. package/es/components/cardPro/index.d.ts +2 -1
  30. package/es/components/checkbox/index.d.ts +4 -1
  31. package/es/components/classicLayout/index.d.ts +2 -1
  32. package/es/components/config-provider/index.d.ts +2 -1
  33. package/es/components/customSelect/index.d.ts +1 -1
  34. package/es/components/dataSourceComponents/dataSourceForm/group/index.d.ts +1 -1
  35. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -1
  36. package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +1 -1
  37. package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +2 -1
  38. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +4 -1
  39. package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +2 -2
  40. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
  41. package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -1
  42. package/es/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
  43. package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
  44. package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +2 -1
  45. package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
  46. package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +3 -1
  47. package/es/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
  48. package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
  49. package/es/components/date-picker/index.d.ts +4 -1
  50. package/es/components/drag-sort-tree/index.d.ts +2 -1
  51. package/es/components/drag-sort-tree/types.d.ts +1 -0
  52. package/es/components/dropdown/index.d.ts +3 -1
  53. package/es/components/filter/components/FilterButton/types.d.ts +1 -0
  54. package/es/components/filter/index.d.ts +2 -1
  55. package/es/components/input/index.d.ts +1 -0
  56. package/es/components/keyboard/index.d.ts +1 -1
  57. package/es/components/list/index.d.ts +2 -1
  58. package/es/components/lowCodePage/index.d.ts +3 -1
  59. package/es/components/page/index.d.ts +2 -1
  60. package/es/components/page-header/index.d.ts +1 -1
  61. package/es/components/pisell-config-provider/context.d.ts +1 -0
  62. package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +2 -1
  63. package/es/components/pisellAdjustPrice/index.d.ts +2 -1
  64. package/es/components/pisellAlert/index.d.ts +1 -1
  65. package/es/components/pisellCard/index.d.ts +2 -1
  66. package/es/components/pisellCheckboxGroup/index.d.ts +1 -1
  67. package/es/components/pisellCountdown/index.d.ts +1 -1
  68. package/es/components/pisellDatePicker/index.d.ts +4 -1
  69. package/es/components/pisellDraggable/index.d.ts +1 -1
  70. package/es/components/pisellEmpty/index.d.ts +1 -1
  71. package/es/components/pisellFilter/index.d.ts +2 -1
  72. package/es/components/pisellFloatingPanel/index.d.ts +1 -1
  73. package/es/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +5 -4
  74. package/es/components/pisellFloorMapLayout/components/FloorMapBuiltinShapeElement.d.ts +2 -1
  75. package/es/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +3 -1
  76. package/es/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +2 -1
  77. package/es/components/pisellFloorMapLayout/context/FloorMapLayoutContext.d.ts +1 -1
  78. package/es/components/pisellGoodPassCard/index.d.ts +1 -1
  79. package/es/components/pisellGridPro/GridView/index.d.ts +2 -1
  80. package/es/components/pisellGridPro/ToolBar/type.d.ts +1 -0
  81. package/es/components/pisellInformationEntry/index.d.ts +1 -1
  82. package/es/components/pisellInput/components/BankCard/index.d.ts +1 -0
  83. package/es/components/pisellInput/components/Copy/index.d.ts +1 -0
  84. package/es/components/pisellInput/components/SecurityCode/index.d.ts +1 -0
  85. package/es/components/pisellInput/index.d.ts +5 -4
  86. package/es/components/pisellLoading/index.d.ts +2 -1
  87. package/es/components/pisellMenu/types.d.ts +1 -0
  88. package/es/components/pisellModal/index.d.ts +2 -2
  89. package/es/components/pisellQuickFilter/type.d.ts +1 -0
  90. package/es/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +2 -1
  91. package/es/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +2 -1
  92. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +2 -1
  93. package/es/components/pisellRow/index.d.ts +1 -1
  94. package/es/components/pisellSort/index.d.ts +2 -1
  95. package/es/components/pisellStatisticList/index.d.ts +1 -1
  96. package/es/components/pisellTags/index.d.ts +1 -1
  97. package/es/components/pisellText/index.d.ts +2 -2
  98. package/es/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +2 -1
  99. package/es/components/pisellTooltip/index.d.ts +2 -1
  100. package/es/components/pisellUpload/index.d.ts +2 -1
  101. package/es/components/pisellWalletPassCard/index.d.ts +3 -1
  102. package/es/components/pisellWalletPassCard/index.js +2 -2
  103. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +2 -1
  104. package/es/components/productCard/cartSkuCard/components/Note/index.less +6 -2
  105. package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +5 -4
  106. package/es/components/productCard/cartSkuCard/components/packages/index.js +5 -3
  107. package/es/components/productCard/cartSkuCard/components/specs/index.js +5 -3
  108. package/es/components/productCard/cartSkuCard/index.js +33 -3
  109. package/es/components/productCard/cartSkuCard/index.less +18 -0
  110. package/es/components/productCard/cartSkuCard/types.d.ts +56 -0
  111. package/es/components/productCard/cartSkuCard/variants/A12/index.js +126 -0
  112. package/es/components/productCard/cartSkuCard/variants/A12/index.less +279 -0
  113. package/es/components/productCard/components/Packages/components/options/index.js +3 -2
  114. package/es/components/productCard/lineItem/index.js +57 -19
  115. package/es/components/productCard/types.d.ts +4 -1
  116. package/es/components/qrcode/index.d.ts +3 -1
  117. package/es/components/radio/index.d.ts +4 -1
  118. package/es/components/section-footers/index.d.ts +4 -1
  119. package/es/components/segmented/index.d.ts +2 -1
  120. package/es/components/select-time/index.d.ts +2 -1
  121. package/es/components/skeleton/index.d.ts +4 -1
  122. package/es/components/slider/index.d.ts +3 -1
  123. package/es/components/tabs/index.d.ts +2 -2
  124. package/es/components/time-picker/index.d.ts +4 -1
  125. package/es/components/upload/index.d.ts +4 -1
  126. package/es/components/versionSelect/index.d.ts +1 -0
  127. package/es/components/virtual-keyboard/Amount/index.d.ts +2 -1
  128. package/es/components/virtual-keyboard/Amount/types.d.ts +1 -0
  129. package/es/components/virtual-keyboard/Number/index.d.ts +2 -1
  130. package/es/components/virtual-keyboard/Time/index.d.ts +1 -1
  131. package/es/components/virtual-keyboard/index.d.ts +1 -1
  132. package/es/index.d.ts +2 -1
  133. package/lib/components/PisellBasicGrid/PisellBasicGrid.d.ts +2 -1
  134. package/lib/components/PisellCards/components/GraphicTextCard/GraphicTextCard.d.ts +2 -1
  135. package/lib/components/PisellCards/components/MultilevelCard/MultilevelCard.d.ts +1 -1
  136. package/lib/components/PisellCards/components/PisellImageCard/PisellImageCard.d.ts +2 -1
  137. package/lib/components/PisellCards/components/TabCard/TabCard.d.ts +2 -1
  138. package/lib/components/PisellCards/components/TextCard/TextCard.d.ts +2 -1
  139. package/lib/components/PisellCards/index.d.ts +7 -5
  140. package/lib/components/PisellFields/index.d.ts +1 -0
  141. package/lib/components/PisellGroupView/PisellGroupView.d.ts +2 -1
  142. package/lib/components/PisellLayouts/index.d.ts +3 -2
  143. package/lib/components/PisellMetrics/index.d.ts +3 -2
  144. package/lib/components/appVersionControl/index.d.ts +2 -1
  145. package/lib/components/appVersionControl/types.d.ts +1 -0
  146. package/lib/components/auto-complete-number/index.d.ts +2 -1
  147. package/lib/components/badge/index.d.ts +2 -1
  148. package/lib/components/batch-editor/index.d.ts +2 -1
  149. package/lib/components/calendar/index.d.ts +4 -1
  150. package/lib/components/cardMetricItem/index.d.ts +1 -1
  151. package/lib/components/cardPro/index.d.ts +2 -1
  152. package/lib/components/checkbox/index.d.ts +4 -1
  153. package/lib/components/classicLayout/index.d.ts +2 -1
  154. package/lib/components/config-provider/index.d.ts +2 -1
  155. package/lib/components/customSelect/index.d.ts +1 -1
  156. package/lib/components/dataSourceComponents/dataSourceForm/group/index.d.ts +1 -1
  157. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -1
  158. package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +1 -1
  159. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +2 -1
  160. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +4 -1
  161. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +2 -2
  162. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
  163. package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -1
  164. package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
  165. package/lib/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
  166. package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +2 -1
  167. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
  168. package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +3 -1
  169. package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
  170. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
  171. package/lib/components/date-picker/index.d.ts +4 -1
  172. package/lib/components/drag-sort-tree/index.d.ts +2 -1
  173. package/lib/components/drag-sort-tree/types.d.ts +1 -0
  174. package/lib/components/dropdown/index.d.ts +3 -1
  175. package/lib/components/filter/components/FilterButton/types.d.ts +1 -0
  176. package/lib/components/filter/index.d.ts +2 -1
  177. package/lib/components/input/index.d.ts +1 -0
  178. package/lib/components/keyboard/index.d.ts +1 -1
  179. package/lib/components/list/index.d.ts +2 -1
  180. package/lib/components/lowCodePage/index.d.ts +3 -1
  181. package/lib/components/page/index.d.ts +2 -1
  182. package/lib/components/page-header/index.d.ts +1 -1
  183. package/lib/components/pisell-config-provider/context.d.ts +1 -0
  184. package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +2 -1
  185. package/lib/components/pisellAdjustPrice/index.d.ts +2 -1
  186. package/lib/components/pisellAlert/index.d.ts +1 -1
  187. package/lib/components/pisellCard/index.d.ts +2 -1
  188. package/lib/components/pisellCheckboxGroup/index.d.ts +1 -1
  189. package/lib/components/pisellCountdown/index.d.ts +1 -1
  190. package/lib/components/pisellDatePicker/index.d.ts +4 -1
  191. package/lib/components/pisellDraggable/index.d.ts +1 -1
  192. package/lib/components/pisellEmpty/index.d.ts +1 -1
  193. package/lib/components/pisellFilter/index.d.ts +2 -1
  194. package/lib/components/pisellFloatingPanel/index.d.ts +1 -1
  195. package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +5 -4
  196. package/lib/components/pisellFloorMapLayout/components/FloorMapBuiltinShapeElement.d.ts +2 -1
  197. package/lib/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +3 -1
  198. package/lib/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +2 -1
  199. package/lib/components/pisellFloorMapLayout/context/FloorMapLayoutContext.d.ts +1 -1
  200. package/lib/components/pisellGoodPassCard/index.d.ts +1 -1
  201. package/lib/components/pisellGridPro/GridView/index.d.ts +2 -1
  202. package/lib/components/pisellGridPro/ToolBar/type.d.ts +1 -0
  203. package/lib/components/pisellInformationEntry/index.d.ts +1 -1
  204. package/lib/components/pisellInput/components/BankCard/index.d.ts +1 -0
  205. package/lib/components/pisellInput/components/Copy/index.d.ts +1 -0
  206. package/lib/components/pisellInput/components/SecurityCode/index.d.ts +1 -0
  207. package/lib/components/pisellInput/index.d.ts +5 -4
  208. package/lib/components/pisellLoading/index.d.ts +2 -1
  209. package/lib/components/pisellMenu/types.d.ts +1 -0
  210. package/lib/components/pisellModal/index.d.ts +2 -2
  211. package/lib/components/pisellQuickFilter/type.d.ts +1 -0
  212. package/lib/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +2 -1
  213. package/lib/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +2 -1
  214. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +2 -1
  215. package/lib/components/pisellRow/index.d.ts +1 -1
  216. package/lib/components/pisellSort/index.d.ts +2 -1
  217. package/lib/components/pisellStatisticList/index.d.ts +1 -1
  218. package/lib/components/pisellTags/index.d.ts +1 -1
  219. package/lib/components/pisellText/index.d.ts +2 -2
  220. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +2 -1
  221. package/lib/components/pisellTooltip/index.d.ts +2 -1
  222. package/lib/components/pisellUpload/index.d.ts +2 -1
  223. package/lib/components/pisellWalletPassCard/index.d.ts +3 -1
  224. package/lib/components/pisellWalletPassCard/index.js +2 -2
  225. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +2 -1
  226. package/lib/components/productCard/cartSkuCard/components/Note/index.less +6 -2
  227. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +5 -4
  228. package/lib/components/productCard/cartSkuCard/components/packages/index.js +5 -3
  229. package/lib/components/productCard/cartSkuCard/components/specs/index.js +5 -3
  230. package/lib/components/productCard/cartSkuCard/index.js +33 -3
  231. package/lib/components/productCard/cartSkuCard/index.less +18 -0
  232. package/lib/components/productCard/cartSkuCard/types.d.ts +56 -0
  233. package/lib/components/productCard/cartSkuCard/variants/A12/index.js +129 -0
  234. package/lib/components/productCard/cartSkuCard/variants/A12/index.less +279 -0
  235. package/lib/components/productCard/components/Packages/components/options/index.js +3 -2
  236. package/lib/components/productCard/lineItem/index.js +57 -19
  237. package/lib/components/productCard/types.d.ts +4 -1
  238. package/lib/components/qrcode/index.d.ts +3 -1
  239. package/lib/components/radio/index.d.ts +4 -1
  240. package/lib/components/section-footers/index.d.ts +4 -1
  241. package/lib/components/segmented/index.d.ts +2 -1
  242. package/lib/components/select-time/index.d.ts +2 -1
  243. package/lib/components/skeleton/index.d.ts +4 -1
  244. package/lib/components/slider/index.d.ts +3 -1
  245. package/lib/components/tabs/index.d.ts +2 -2
  246. package/lib/components/time-picker/index.d.ts +4 -1
  247. package/lib/components/upload/index.d.ts +4 -1
  248. package/lib/components/versionSelect/index.d.ts +1 -0
  249. package/lib/components/virtual-keyboard/Amount/index.d.ts +2 -1
  250. package/lib/components/virtual-keyboard/Amount/types.d.ts +1 -0
  251. package/lib/components/virtual-keyboard/Number/index.d.ts +2 -1
  252. package/lib/components/virtual-keyboard/Time/index.d.ts +1 -1
  253. package/lib/components/virtual-keyboard/index.d.ts +1 -1
  254. package/lib/index.d.ts +2 -1
  255. package/package.json +3 -3
@@ -3,6 +3,10 @@
3
3
  width: 100%;
4
4
  min-width: 0;
5
5
  }
6
+
7
+ &--a12 {
8
+ container-type: inline-size;
9
+ }
6
10
  }
7
11
 
8
12
  .pisell-cart-sku-card-wrapper {
@@ -15,6 +19,14 @@
15
19
  width: 100%;
16
20
  overflow: hidden;
17
21
  }
22
+
23
+
24
+ &--a12 {
25
+ border: 0;
26
+ border-radius: 18px;
27
+ background: transparent;
28
+ overflow: visible;
29
+ }
18
30
  }
19
31
 
20
32
  .pisell-cart-sku-card__main-row {
@@ -51,6 +63,12 @@
51
63
  cursor: pointer;
52
64
  }
53
65
 
66
+ &--a12 {
67
+ display: block;
68
+ padding: 0;
69
+ gap: 0;
70
+ }
71
+
54
72
  &__delete-btn {
55
73
  cursor: pointer;
56
74
  position: absolute;
@@ -0,0 +1,56 @@
1
+ import { CSSProperties, ReactNode } from "react";
2
+
3
+ //#region src/components/productCard/cartSkuCard/types.d.ts
4
+ type CartSkuCardVariant = 'a2' | 'a5' | 'a9' | 'a12';
5
+ interface CartSkuCardA12Display {
6
+ eyebrow?: ReactNode;
7
+ quantityText?: ReactNode;
8
+ }
9
+ interface CartSkuCardSlotContext {
10
+ item: any;
11
+ disabled: boolean;
12
+ }
13
+ interface CartSkuCardA12Slots {
14
+ contentFooter?: (context: CartSkuCardSlotContext) => ReactNode;
15
+ quantityControl?: (context: CartSkuCardSlotContext) => ReactNode;
16
+ actionRail?: (context: CartSkuCardSlotContext & {
17
+ defaultPrice: ReactNode;
18
+ defaultEdit: ReactNode;
19
+ defaultQuantityControl: ReactNode;
20
+ }) => ReactNode;
21
+ specifications?: (context: CartSkuCardSlotContext & {
22
+ defaultSpecifications: ReactNode;
23
+ }) => ReactNode;
24
+ }
25
+ interface CartSkuCardA12Tokens {
26
+ background: string;
27
+ borderColor: string;
28
+ borderRadius: string;
29
+ minHeight: string;
30
+ mediaWidth: string;
31
+ actionRailWidth: string;
32
+ contentPadding: string;
33
+ actionRailPadding: string;
34
+ accentColor: string;
35
+ titleColor: string;
36
+ titleFontSize: string;
37
+ titleFontWeight: number;
38
+ priceColor: string;
39
+ priceFontSize: string;
40
+ optionBackground: string;
41
+ optionLabelColor: string;
42
+ optionValueColor: string;
43
+ optionGap: string;
44
+ shadow: string;
45
+ }
46
+ interface CartSkuCardA12Presentation {
47
+ density?: 'compact' | 'comfortable';
48
+ optionColumns?: 1 | 2 | 3;
49
+ mediaFit?: 'cover' | 'contain';
50
+ contentAlign?: 'start' | 'center';
51
+ className?: string;
52
+ style?: CSSProperties;
53
+ tokens?: Partial<CartSkuCardA12Tokens>;
54
+ }
55
+ //#endregion
56
+ export { CartSkuCardA12Display, CartSkuCardA12Presentation, CartSkuCardA12Slots, CartSkuCardVariant };
@@ -0,0 +1,126 @@
1
+ import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ import IconFont from "../../../../iconfont/index.js";
3
+ import Weighing from "../../components/weighing/index.js";
4
+ import { PREFIX } from "../../index.js";
5
+ import React, { useMemo } from "react";
6
+ import { formatAmount, image, locales, resolveWeighingSnapshot } from "@pisell/utils";
7
+ import classNames from "classnames";
8
+ import "./index.less";
9
+ //#region src/components/productCard/cartSkuCard/variants/A12/index.tsx
10
+ const TOKEN_VARIABLES = {
11
+ background: "--pc-a12-bg",
12
+ borderColor: "--pc-a12-border-color",
13
+ borderRadius: "--pc-a12-radius",
14
+ minHeight: "--pc-a12-min-height",
15
+ mediaWidth: "--pc-a12-media-width",
16
+ actionRailWidth: "--pc-a12-rail-width",
17
+ contentPadding: "--pc-a12-content-padding",
18
+ actionRailPadding: "--pc-a12-rail-padding",
19
+ accentColor: "--pc-a12-accent",
20
+ titleColor: "--pc-a12-title-color",
21
+ titleFontSize: "--pc-a12-title-size",
22
+ titleFontWeight: "--pc-a12-title-weight",
23
+ priceColor: "--pc-a12-price-color",
24
+ priceFontSize: "--pc-a12-price-size",
25
+ optionBackground: "--pc-a12-option-bg",
26
+ optionLabelColor: "--pc-a12-option-label-color",
27
+ optionValueColor: "--pc-a12-option-value-color",
28
+ optionGap: "--pc-a12-option-gap",
29
+ shadow: "--pc-a12-shadow"
30
+ };
31
+ /** 复用其它变体使用的 options,只在展示阶段合并同组已选项。 */
32
+ function resolveSpecifications(dataSource) {
33
+ if (!Array.isArray(dataSource === null || dataSource === void 0 ? void 0 : dataSource.options)) return [];
34
+ const groups = /* @__PURE__ */ new Map();
35
+ dataSource.options.forEach((option, index) => {
36
+ var _ref, _option$name, _ref2, _option$quantity, _ref3, _ref4, _option$option_group_, _ref5, _ref6, _ref7, _option$option_group_2;
37
+ const name = (_ref = (_option$name = option === null || option === void 0 ? void 0 : option.name) !== null && _option$name !== void 0 ? _option$name : option === null || option === void 0 ? void 0 : option.title) !== null && _ref !== void 0 ? _ref : option === null || option === void 0 ? void 0 : option.variant_item_name;
38
+ if (name === void 0 || name === null || name === "") return;
39
+ const quantity = Math.max(1, Number((_ref2 = (_option$quantity = option.quantity) !== null && _option$quantity !== void 0 ? _option$quantity : option.num) !== null && _ref2 !== void 0 ? _ref2 : 1));
40
+ const value = quantity > 1 ? `${String(name)} × ${quantity}` : name;
41
+ const groupKey = String((_ref3 = (_ref4 = (_option$option_group_ = option.option_group_id) !== null && _option$option_group_ !== void 0 ? _option$option_group_ : option.group_id) !== null && _ref4 !== void 0 ? _ref4 : option.variant_group_id) !== null && _ref3 !== void 0 ? _ref3 : `option-${index}`);
42
+ const label = (_ref5 = (_ref6 = (_ref7 = (_option$option_group_2 = option.option_group_name) !== null && _option$option_group_2 !== void 0 ? _option$option_group_2 : option.group_name) !== null && _ref7 !== void 0 ? _ref7 : option.option_group_title) !== null && _ref6 !== void 0 ? _ref6 : option.group_title) !== null && _ref5 !== void 0 ? _ref5 : option.variant_group_name;
43
+ const current = groups.get(groupKey);
44
+ if (current) {
45
+ current.values.push(value);
46
+ if (!current.label && label) current.label = label;
47
+ return;
48
+ }
49
+ groups.set(groupKey, _objectSpread2(_objectSpread2({ key: groupKey }, label ? { label } : {}), {}, { values: [value] }));
50
+ });
51
+ return Array.from(groups.values()).map((group) => ({
52
+ key: group.key,
53
+ label: group.label,
54
+ value: group.values.map(String).join(", ")
55
+ }));
56
+ }
57
+ function getPresentationStyle(presentation) {
58
+ const style = _objectSpread2({}, (presentation === null || presentation === void 0 ? void 0 : presentation.style) || {});
59
+ Object.entries((presentation === null || presentation === void 0 ? void 0 : presentation.tokens) || {}).forEach(([key, value]) => {
60
+ if (value !== void 0) style[TOKEN_VARIABLES[key]] = value;
61
+ });
62
+ style["--pc-a12-option-columns"] = (presentation === null || presentation === void 0 ? void 0 : presentation.optionColumns) || 2;
63
+ return style;
64
+ }
65
+ const A12 = ({ dataSource, isShowImage = true, isShowDelete = false, isShowOriginalPrice = false, isShowEditProduct = false, disabled = false, disabledEditClick = false, slots, presentation, onDelete, onEditProduct }) => {
66
+ var _ref8, _dataSource$num, _dataSource$total, _dataSource$origin_to, _slots$contentFooter;
67
+ const display = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.a12) || {};
68
+ const specificationsData = useMemo(() => resolveSpecifications(dataSource), [dataSource]);
69
+ const weighingInfo = useMemo(() => resolveWeighingSnapshot(dataSource), [dataSource]);
70
+ const quantity = Number((_ref8 = (_dataSource$num = dataSource === null || dataSource === void 0 ? void 0 : dataSource.num) !== null && _dataSource$num !== void 0 ? _dataSource$num : dataSource === null || dataSource === void 0 ? void 0 : dataSource.quantity) !== null && _ref8 !== void 0 ? _ref8 : 1) || 1;
71
+ const lineTotal = Number((_dataSource$total = dataSource === null || dataSource === void 0 ? void 0 : dataSource.total) !== null && _dataSource$total !== void 0 ? _dataSource$total : 0) * quantity - Number((dataSource === null || dataSource === void 0 ? void 0 : dataSource.totalDifference) || 0);
72
+ const originalTotal = Number((_dataSource$origin_to = dataSource === null || dataSource === void 0 ? void 0 : dataSource.origin_total) !== null && _dataSource$origin_to !== void 0 ? _dataSource$origin_to : 0) * quantity;
73
+ const symbol = dataSource === null || dataSource === void 0 ? void 0 : dataSource.symbol;
74
+ const slotContext = useMemo(() => ({
75
+ item: dataSource,
76
+ disabled
77
+ }), [dataSource, disabled]);
78
+ const style = useMemo(() => getPresentationStyle(presentation), [presentation]);
79
+ const defaultSpecifications = specificationsData.length ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__specifications` }, specificationsData.map((specification) => /* @__PURE__ */ React.createElement("div", {
80
+ className: `${PREFIX}-a12__specification`,
81
+ key: specification.key
82
+ }, specification.label ? /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}-a12__specification-label` }, specification.label) : null, /* @__PURE__ */ React.createElement("strong", { className: `${PREFIX}-a12__specification-value` }, specification.value)))) : (dataSource === null || dataSource === void 0 ? void 0 : dataSource.product_option_string) ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__specification-summary` }, dataSource.product_option_string) : null;
83
+ const specifications = (slots === null || slots === void 0 ? void 0 : slots.specifications) ? slots.specifications(_objectSpread2(_objectSpread2({}, slotContext), {}, { defaultSpecifications })) : defaultSpecifications;
84
+ const contentFooter = slots === null || slots === void 0 || (_slots$contentFooter = slots.contentFooter) === null || _slots$contentFooter === void 0 ? void 0 : _slots$contentFooter.call(slots, slotContext);
85
+ const defaultPrice = /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__price` }, /* @__PURE__ */ React.createElement("strong", null, formatAmount(lineTotal, 2, symbol)), isShowOriginalPrice && originalTotal > 0 && originalTotal !== lineTotal ? /* @__PURE__ */ React.createElement("del", null, formatAmount(originalTotal, 2, symbol)) : null);
86
+ const defaultEdit = Boolean(isShowEditProduct && onEditProduct) ? /* @__PURE__ */ React.createElement("button", {
87
+ type: "button",
88
+ className: `${PREFIX}-a12__edit`,
89
+ disabled: disabled || disabledEditClick,
90
+ onClick: (event) => {
91
+ event.preventDefault();
92
+ event.stopPropagation();
93
+ onEditProduct === null || onEditProduct === void 0 || onEditProduct(dataSource);
94
+ }
95
+ }, locales.getText("pisell2.product.card.edit")) : null;
96
+ const defaultQuantityControl = (slots === null || slots === void 0 ? void 0 : slots.quantityControl) ? slots.quantityControl(slotContext) : /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__quantity-fallback` }, /* @__PURE__ */ React.createElement("span", null, display.quantityText || `× ${quantity}`));
97
+ const defaultActionRail = /* @__PURE__ */ React.createElement("aside", { className: `${PREFIX}-a12__rail` }, isShowDelete && onDelete ? /* @__PURE__ */ React.createElement("button", {
98
+ type: "button",
99
+ className: `${PREFIX}-a12__delete`,
100
+ "aria-label": locales.getText("pisell2.cart.sku-card.actions.delete"),
101
+ disabled,
102
+ onClick: (event) => {
103
+ event.preventDefault();
104
+ event.stopPropagation();
105
+ onDelete(dataSource);
106
+ }
107
+ }, /* @__PURE__ */ React.createElement(IconFont, { type: "pisell2-trash-01" })) : null, defaultPrice, defaultEdit, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__quantity-control` }, defaultQuantityControl));
108
+ const actionRail = (slots === null || slots === void 0 ? void 0 : slots.actionRail) ? slots.actionRail(_objectSpread2(_objectSpread2({}, slotContext), {}, {
109
+ defaultPrice,
110
+ defaultEdit,
111
+ defaultQuantityControl
112
+ })) : defaultActionRail;
113
+ return /* @__PURE__ */ React.createElement("div", {
114
+ className: classNames(`${PREFIX}-a12`, `${PREFIX}-a12--${(presentation === null || presentation === void 0 ? void 0 : presentation.density) || "comfortable"}`, `${PREFIX}-a12--align-${(presentation === null || presentation === void 0 ? void 0 : presentation.contentAlign) || "start"}`, !isShowImage && `pisell-cart-sku-card-a12--without-media`, presentation === null || presentation === void 0 ? void 0 : presentation.className),
115
+ style
116
+ }, isShowImage ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__media` }, (dataSource === null || dataSource === void 0 ? void 0 : dataSource.image) ? /* @__PURE__ */ React.createElement("img", {
117
+ alt: "",
118
+ src: image.ali(dataSource.image, 320),
119
+ style: { objectFit: (presentation === null || presentation === void 0 ? void 0 : presentation.mediaFit) || "cover" }
120
+ }) : /* @__PURE__ */ React.createElement("span", { "aria-hidden": "true" }, String((dataSource === null || dataSource === void 0 ? void 0 : dataSource.name) || "").slice(0, 2))) : null, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__content` }, display.eyebrow ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__eyebrow` }, display.eyebrow) : null, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__name` }, dataSource === null || dataSource === void 0 ? void 0 : dataSource.name), weighingInfo ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__weighing` }, /* @__PURE__ */ React.createElement(Weighing, {
121
+ dataSource: weighingInfo,
122
+ symbol
123
+ })) : null, specifications, contentFooter ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}-a12__content-footer` }, contentFooter) : null), actionRail);
124
+ };
125
+ //#endregion
126
+ export { A12 as default };
@@ -0,0 +1,279 @@
1
+ .pisell-cart-sku-card-a12 {
2
+ --pc-a12-bg: #fff;
3
+ --pc-a12-border-color: #e4e7ec;
4
+ --pc-a12-radius: 18px;
5
+ --pc-a12-min-height: 164px;
6
+ --pc-a12-media-width: 228px;
7
+ --pc-a12-rail-width: 190px;
8
+ --pc-a12-content-padding: 20px 22px;
9
+ --pc-a12-rail-padding: 18px 20px;
10
+ --pc-a12-accent: #b20d12;
11
+ --pc-a12-title-color: #101828;
12
+ --pc-a12-title-size: 32px;
13
+ --pc-a12-title-weight: 800;
14
+ --pc-a12-price-color: var(--pc-a12-accent);
15
+ --pc-a12-price-size: 30px;
16
+ --pc-a12-option-bg: #f5f6f8;
17
+ --pc-a12-option-label-color: #667085;
18
+ --pc-a12-option-value-color: #101828;
19
+ --pc-a12-option-gap: 6px;
20
+ --pc-a12-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
21
+
22
+ display: grid;
23
+ grid-template-columns:
24
+ var(--pc-a12-media-width)
25
+ minmax(0, 1fr)
26
+ var(--pc-a12-rail-width);
27
+ min-height: var(--pc-a12-min-height);
28
+ overflow: hidden;
29
+ border: 1px solid var(--pc-a12-border-color);
30
+ border-radius: var(--pc-a12-radius);
31
+ background: var(--pc-a12-bg);
32
+ box-shadow: var(--pc-a12-shadow);
33
+ hyphens: none;
34
+ overflow-wrap: normal;
35
+ word-break: normal;
36
+
37
+ &--without-media {
38
+ grid-template-columns: minmax(0, 1fr) var(--pc-a12-rail-width);
39
+ }
40
+
41
+ &__media {
42
+ position: relative;
43
+ display: grid;
44
+ min-height: var(--pc-a12-min-height);
45
+ place-items: center;
46
+ overflow: hidden;
47
+ background: #f2f4f7;
48
+ color: var(--pc-a12-accent);
49
+ font-size: 32px;
50
+ font-weight: 800;
51
+
52
+ img {
53
+ position: absolute;
54
+ inset: 0;
55
+ display: block;
56
+ width: 100%;
57
+ height: 100%;
58
+ min-height: 0;
59
+ }
60
+ }
61
+
62
+ &__content {
63
+ display: flex;
64
+ min-width: 0;
65
+ flex-direction: column;
66
+ justify-content: flex-start;
67
+ padding: var(--pc-a12-content-padding);
68
+ }
69
+
70
+ &__content-footer {
71
+ display: flex;
72
+ flex-direction: column;
73
+ gap: 8px;
74
+ margin-top: auto;
75
+ padding-top: 12px;
76
+
77
+ .ant-divider {
78
+ margin: 0 !important;
79
+ }
80
+ }
81
+
82
+ &--align-center &__content {
83
+ justify-content: center;
84
+ }
85
+
86
+ &__eyebrow {
87
+ overflow: hidden;
88
+ margin-bottom: 4px;
89
+ color: var(--pc-a12-accent);
90
+ font-size: 14px;
91
+ font-weight: 800;
92
+ line-height: 20px;
93
+ text-overflow: ellipsis;
94
+ text-transform: uppercase;
95
+ white-space: nowrap;
96
+ }
97
+
98
+ &__name {
99
+ min-width: 0;
100
+ overflow: hidden;
101
+ color: var(--pc-a12-title-color);
102
+ font-size: var(--pc-a12-title-size);
103
+ font-weight: var(--pc-a12-title-weight);
104
+ line-height: 1.15;
105
+ text-overflow: ellipsis;
106
+ white-space: nowrap;
107
+ }
108
+
109
+ &__weighing {
110
+ min-width: 0;
111
+ margin-top: 8px;
112
+ }
113
+
114
+ &__specifications {
115
+ display: grid;
116
+ grid-template-columns: repeat(
117
+ var(--pc-a12-option-columns, 2),
118
+ minmax(0, 1fr)
119
+ );
120
+ gap: var(--pc-a12-option-gap);
121
+ margin-top: 10px;
122
+ }
123
+
124
+ &__specification,
125
+ &__specification-summary {
126
+ min-width: 0;
127
+ padding: 7px 9px;
128
+ border-radius: 7px;
129
+ background: var(--pc-a12-option-bg);
130
+ }
131
+
132
+ &__specification {
133
+ display: flex;
134
+ flex-direction: column;
135
+ gap: 2px;
136
+ }
137
+
138
+ &__specification-label {
139
+ overflow: hidden;
140
+ color: var(--pc-a12-option-label-color);
141
+ font-size: 11px;
142
+ font-weight: 700;
143
+ line-height: 16px;
144
+ text-overflow: ellipsis;
145
+ white-space: nowrap;
146
+ }
147
+
148
+ &__specification-value,
149
+ &__specification-summary {
150
+ overflow: hidden;
151
+ color: var(--pc-a12-option-value-color);
152
+ font-size: 16px;
153
+ font-weight: 700;
154
+ line-height: 20px;
155
+ text-overflow: ellipsis;
156
+ white-space: nowrap;
157
+ }
158
+
159
+ &__rail {
160
+ position: relative;
161
+ display: flex;
162
+ min-width: 0;
163
+ flex-direction: column;
164
+ align-items: center;
165
+ justify-content: center;
166
+ padding: var(--pc-a12-rail-padding);
167
+ border-left: 1px solid var(--pc-a12-border-color);
168
+ }
169
+
170
+ &__delete {
171
+ position: absolute;
172
+ top: 6px;
173
+ right: 6px;
174
+ display: grid;
175
+ width: 42px;
176
+ height: 42px;
177
+ padding: 0;
178
+ place-items: center;
179
+ border: 0;
180
+ border-radius: 50%;
181
+ background: transparent;
182
+ color: var(--pc-a12-accent);
183
+ font-size: 26px;
184
+ cursor: pointer;
185
+
186
+ .anticon,
187
+ svg {
188
+ width: 30px;
189
+ height: 30px;
190
+ font-size: 30px;
191
+ }
192
+
193
+ &:active {
194
+ background: #fef3f2;
195
+ }
196
+
197
+ &:disabled {
198
+ cursor: not-allowed;
199
+ opacity: 0.5;
200
+ }
201
+ }
202
+
203
+ &__price {
204
+ display: flex;
205
+ flex-direction: column;
206
+ align-items: center;
207
+ color: var(--pc-a12-price-color);
208
+
209
+ strong {
210
+ font-size: var(--pc-a12-price-size);
211
+ font-weight: 800;
212
+ line-height: 1.15;
213
+ white-space: nowrap;
214
+ }
215
+
216
+ del {
217
+ color: #667085;
218
+ font-size: 13px;
219
+ }
220
+ }
221
+
222
+ &__edit {
223
+ min-width: 62px;
224
+ min-height: 38px;
225
+ margin-top: 10px;
226
+ padding: 7px 14px;
227
+ border: 1px solid #f5b7ba;
228
+ border-radius: 999px;
229
+ background: #fff;
230
+ color: var(--pc-a12-accent);
231
+ font: inherit;
232
+ font-size: 14px;
233
+ font-weight: 700;
234
+ white-space: nowrap;
235
+ cursor: pointer;
236
+
237
+ &:disabled {
238
+ cursor: not-allowed;
239
+ opacity: 0.5;
240
+ }
241
+ }
242
+
243
+ &__quantity-control {
244
+ display: flex;
245
+ width: 100%;
246
+ min-height: 44px;
247
+ align-items: center;
248
+ justify-content: center;
249
+ margin-top: 10px;
250
+ padding-top: 10px;
251
+ }
252
+
253
+ &__quantity-fallback {
254
+ display: flex;
255
+ align-items: center;
256
+ justify-content: center;
257
+ gap: 16px;
258
+ font-weight: 700;
259
+ }
260
+
261
+ &--compact {
262
+ --pc-a12-min-height: 132px;
263
+ --pc-a12-media-width: 124px;
264
+ --pc-a12-rail-width: 156px;
265
+ --pc-a12-content-padding: 15px 18px;
266
+ --pc-a12-rail-padding: 14px 16px;
267
+ --pc-a12-price-size: 25px;
268
+ }
269
+ }
270
+
271
+ @container (max-width: 620px) {
272
+ .pisell-cart-sku-card-a12 {
273
+ --pc-a12-media-width: 112px;
274
+ --pc-a12-rail-width: 150px;
275
+ --pc-a12-content-padding: 14px;
276
+ --pc-a12-price-size: 24px;
277
+ --pc-a12-option-columns: 1;
278
+ }
279
+ }
@@ -3,12 +3,13 @@ import React from "react";
3
3
  import "./index.less";
4
4
  //#region src/components/productCard/components/Packages/components/options/index.tsx
5
5
  const prefix = "pisell-lowcode-";
6
- const Options = ({ options, amountSymbol }) => {
6
+ const Options = ({ options, amountSymbol, amountFormatter }) => {
7
+ const formatOptionAmount = (value) => amountFormatter ? amountFormatter(value, 2) : _formatAmount(value, amountSymbol);
7
8
  return (options === null || options === void 0 ? void 0 : options.length) > 0 ? /* @__PURE__ */ React.createElement("div", { className: `${prefix}packages-product-bundle-option` }, options.map((option, index) => {
8
9
  return /* @__PURE__ */ React.createElement("div", {
9
10
  key: option.id,
10
11
  className: `${prefix}packages-product-bundle-option-item`
11
- }, /* @__PURE__ */ React.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left` }, /* @__PURE__ */ React.createElement("span", null, option === null || option === void 0 ? void 0 : option.name), /* @__PURE__ */ React.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left-amount` }, /* @__PURE__ */ React.createElement("span", null, _formatAmount(option === null || option === void 0 ? void 0 : option.price, amountSymbol)), /* @__PURE__ */ React.createElement("span", null, "×"), /* @__PURE__ */ React.createElement("span", null, option === null || option === void 0 ? void 0 : option.num))), /* @__PURE__ */ React.createElement("span", { className: `${prefix}packages-product-bundle-option-item-amount` }, _formatAmount((option === null || option === void 0 ? void 0 : option.price) * (option === null || option === void 0 ? void 0 : option.num), amountSymbol)));
12
+ }, /* @__PURE__ */ React.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left` }, /* @__PURE__ */ React.createElement("span", null, option === null || option === void 0 ? void 0 : option.name), /* @__PURE__ */ React.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left-amount` }, /* @__PURE__ */ React.createElement("span", null, formatOptionAmount(option === null || option === void 0 ? void 0 : option.price)), /* @__PURE__ */ React.createElement("span", null, "×"), /* @__PURE__ */ React.createElement("span", null, option === null || option === void 0 ? void 0 : option.num))), /* @__PURE__ */ React.createElement("span", { className: `${prefix}packages-product-bundle-option-item-amount` }, formatOptionAmount((option === null || option === void 0 ? void 0 : option.price) * (option === null || option === void 0 ? void 0 : option.num))));
12
13
  })) : null;
13
14
  };
14
15
  //#endregion