@pisell/materials 6.3.17 → 6.3.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 (269) 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 +5 -5
  6. package/build/lowcode/preview.js +144 -144
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +23 -23
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +23 -23
  11. package/es/components/TimeResourceSelector/index.d.ts +21 -0
  12. package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
  13. package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
  14. package/es/components/auto-resize-text/index.d.ts +6 -0
  15. package/es/components/auto-resize-text/index.js +40 -0
  16. package/es/components/cardPro/index.js +10 -3
  17. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  18. package/es/components/dataSourceComponents/fields/index.d.ts +16 -16
  19. package/es/components/iconfont/index.js +1 -1
  20. package/es/components/keyboard/index.d.ts +22 -0
  21. package/es/components/keyboard/index.js +159 -0
  22. package/es/components/keyboard/index.less +44 -0
  23. package/es/components/page/index.js +5 -2
  24. package/es/components/pisell-config-provider/context.d.ts +2 -0
  25. package/es/components/pisell-config-provider/index.d.ts +1 -0
  26. package/es/components/pisellAdjustPrice/index.js +5 -1
  27. package/es/components/pisellAdjustPrice/type.d.ts +2 -0
  28. package/es/components/pisellCardList/index.d.ts +32 -2
  29. package/es/components/pisellCardList/index.js +39 -2
  30. package/es/components/pisellCardList/index.less +9 -1
  31. package/es/components/pisellCheckboxGroup/index.d.ts +3 -0
  32. package/es/components/pisellCheckboxGroup/index.js +9 -4
  33. package/es/components/pisellCheckboxGroup/index.less +28 -1
  34. package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  35. package/es/components/pisellGoodPassCard/index.d.ts +1 -0
  36. package/es/components/pisellGoodPassCard/index.js +17 -5
  37. package/es/components/pisellText/components/Amount/index.js +2 -1
  38. package/es/components/pisellToast/index.d.ts +1 -0
  39. package/es/components/pisellToast/index.js +4 -0
  40. package/es/components/pisellToast/squareToast/index.d.ts +15 -0
  41. package/es/components/pisellToast/squareToast/index.js +28 -0
  42. package/es/components/pisellToast/squareToast/index.less +60 -0
  43. package/es/components/pisellToast/squareToast/methods.d.ts +13 -0
  44. package/es/components/pisellToast/squareToast/methods.js +136 -0
  45. package/es/components/pisellToast/squareToast/renderImperatively.d.ts +28 -0
  46. package/es/components/pisellToast/squareToast/renderImperatively.js +190 -0
  47. package/es/components/pisellToast/squareToast/toast.d.ts +25 -0
  48. package/es/components/pisellToast/squareToast/toast.js +60 -0
  49. package/es/components/pisellWalletPassCard/index.d.ts +53 -1
  50. package/es/components/pisellWalletPassCard/index.js +333 -73
  51. package/es/components/pisellWalletPassCard/index.less +47 -9
  52. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
  53. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
  54. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
  55. package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
  56. package/es/components/productCard/cartSkuCard/components/MultiDay/index.js +82 -0
  57. package/es/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
  58. package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
  59. package/es/components/productCard/cartSkuCard/components/MultiDay/utils.js +56 -0
  60. package/es/components/productCard/cartSkuCard/components/Note/index.d.ts +3 -0
  61. package/es/components/productCard/cartSkuCard/components/Note/index.js +29 -0
  62. package/es/components/productCard/cartSkuCard/components/Note/index.less +27 -0
  63. package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +28 -0
  64. package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +94 -0
  65. package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +117 -0
  66. package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
  67. package/es/components/productCard/cartSkuCard/components/discountReason/index.js +51 -0
  68. package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
  69. package/es/components/productCard/cartSkuCard/components/holders/index.js +49 -0
  70. package/es/components/productCard/cartSkuCard/components/holders/index.less +47 -0
  71. package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
  72. package/es/components/productCard/cartSkuCard/components/packages/index.js +52 -0
  73. package/es/components/productCard/cartSkuCard/components/packages/index.less +22 -0
  74. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
  75. package/es/components/productCard/cartSkuCard/components/packages/utils.js +40 -0
  76. package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
  77. package/es/components/productCard/cartSkuCard/components/resources/index.js +39 -0
  78. package/es/components/productCard/cartSkuCard/components/resources/index.less +19 -0
  79. package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +12 -0
  80. package/es/components/productCard/cartSkuCard/components/sales/index.js +57 -0
  81. package/es/components/productCard/cartSkuCard/components/sales/index.less +22 -0
  82. package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
  83. package/es/components/productCard/cartSkuCard/components/specs/index.js +44 -0
  84. package/es/components/productCard/cartSkuCard/components/specs/index.less +34 -0
  85. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
  86. package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +360 -0
  87. package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +74 -0
  88. package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
  89. package/es/components/productCard/cartSkuCard/components/timeRange/index.js +54 -0
  90. package/es/components/productCard/cartSkuCard/components/timeRange/index.less +38 -0
  91. package/es/components/productCard/cartSkuCard/index.d.ts +10 -0
  92. package/es/components/productCard/cartSkuCard/index.js +194 -0
  93. package/es/components/productCard/cartSkuCard/index.less +33 -0
  94. package/es/components/productCard/cartSkuCard/locales.d.ts +99 -0
  95. package/es/components/productCard/cartSkuCard/locales.js +33 -0
  96. package/es/components/productCard/components/Action/index.js +14 -1
  97. package/es/components/productCard/components/Action/index.less +3 -0
  98. package/es/components/productCard/components/Header/index.js +23 -8
  99. package/es/components/productCard/components/Header/index.less +16 -1
  100. package/es/components/productCard/components/Sales/index.js +2 -2
  101. package/es/components/productCard/components/Time/components/SelectHolderModal/index.js +3 -1
  102. package/es/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
  103. package/es/components/productCard/index.d.ts +3 -1
  104. package/es/components/productCard/index.js +7 -2
  105. package/es/components/productCard/index.less +6 -0
  106. package/es/components/productCard/locales.js +3 -0
  107. package/es/components/productCard/status.js +1 -0
  108. package/es/components/productCard/types.d.ts +1 -0
  109. package/es/components/productCard/utils.js +8 -1
  110. package/es/components/select-time/index.d.ts +14 -0
  111. package/es/components/table/Table/AddFieldModal/index.d.ts +1 -0
  112. package/es/components/table/Table/AddFieldModal/index.js +13 -13
  113. package/es/components/table/Table/AddFieldModal/index.less +11 -11
  114. package/es/components/table/Table/utils.d.ts +1 -1
  115. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  116. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
  117. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  118. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  119. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
  120. package/es/components/virtual-keyboard/Number/index.js +4 -1
  121. package/es/components/virtual-keyboard/Number/types.d.ts +1 -0
  122. package/es/components/virtual-keyboard/index.d.ts +11 -0
  123. package/es/components/virtual-keyboard/index.js +88 -3
  124. package/es/components/virtual-keyboard/index.less +33 -1
  125. package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  126. package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
  127. package/es/components/virtualInput/BaseVirtualInput/index.less +77 -0
  128. package/es/components/virtualInput/index.d.ts +24 -0
  129. package/es/components/virtualInput/index.js +60 -0
  130. package/es/components/virtualInput/index.less +42 -0
  131. package/es/index.d.ts +5 -1
  132. package/es/index.js +5 -2
  133. package/es/locales/en-US.d.ts +19 -2
  134. package/es/locales/en-US.js +29 -6
  135. package/es/locales/zh-CN.d.ts +19 -2
  136. package/es/locales/zh-CN.js +29 -6
  137. package/es/locales/zh-TW.d.ts +19 -2
  138. package/es/locales/zh-TW.js +28 -6
  139. package/lib/components/TimeResourceSelector/index.d.ts +21 -0
  140. package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
  141. package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
  142. package/lib/components/auto-resize-text/index.d.ts +6 -0
  143. package/lib/components/auto-resize-text/index.js +71 -0
  144. package/lib/components/cardPro/index.js +3 -2
  145. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  146. package/lib/components/dataSourceComponents/fields/index.d.ts +16 -16
  147. package/lib/components/iconfont/index.js +1 -1
  148. package/lib/components/keyboard/index.d.ts +22 -0
  149. package/lib/components/keyboard/index.js +223 -0
  150. package/lib/components/keyboard/index.less +44 -0
  151. package/lib/components/page/index.js +3 -2
  152. package/lib/components/pisell-config-provider/context.d.ts +2 -0
  153. package/lib/components/pisell-config-provider/index.d.ts +1 -0
  154. package/lib/components/pisellAdjustPrice/index.js +4 -0
  155. package/lib/components/pisellAdjustPrice/type.d.ts +2 -0
  156. package/lib/components/pisellCardList/index.d.ts +32 -2
  157. package/lib/components/pisellCardList/index.js +39 -2
  158. package/lib/components/pisellCardList/index.less +9 -1
  159. package/lib/components/pisellCheckboxGroup/index.d.ts +3 -0
  160. package/lib/components/pisellCheckboxGroup/index.js +6 -1
  161. package/lib/components/pisellCheckboxGroup/index.less +28 -1
  162. package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  163. package/lib/components/pisellGoodPassCard/index.d.ts +1 -0
  164. package/lib/components/pisellGoodPassCard/index.js +31 -4
  165. package/lib/components/pisellText/components/Amount/index.js +2 -1
  166. package/lib/components/pisellToast/index.d.ts +1 -0
  167. package/lib/components/pisellToast/index.js +10 -1
  168. package/lib/components/pisellToast/squareToast/index.d.ts +15 -0
  169. package/lib/components/pisellToast/squareToast/index.js +58 -0
  170. package/lib/components/pisellToast/squareToast/index.less +60 -0
  171. package/lib/components/pisellToast/squareToast/methods.d.ts +13 -0
  172. package/lib/components/pisellToast/squareToast/methods.js +150 -0
  173. package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +28 -0
  174. package/lib/components/pisellToast/squareToast/renderImperatively.js +162 -0
  175. package/lib/components/pisellToast/squareToast/toast.d.ts +25 -0
  176. package/lib/components/pisellToast/squareToast/toast.js +88 -0
  177. package/lib/components/pisellWalletPassCard/index.d.ts +53 -1
  178. package/lib/components/pisellWalletPassCard/index.js +257 -59
  179. package/lib/components/pisellWalletPassCard/index.less +47 -9
  180. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
  181. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
  182. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
  183. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
  184. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.js +71 -0
  185. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
  186. package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
  187. package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.js +77 -0
  188. package/lib/components/productCard/cartSkuCard/components/Note/index.d.ts +3 -0
  189. package/lib/components/productCard/cartSkuCard/components/Note/index.js +56 -0
  190. package/lib/components/productCard/cartSkuCard/components/Note/index.less +27 -0
  191. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +28 -0
  192. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +83 -0
  193. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +117 -0
  194. package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
  195. package/lib/components/productCard/cartSkuCard/components/discountReason/index.js +70 -0
  196. package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
  197. package/lib/components/productCard/cartSkuCard/components/holders/index.js +64 -0
  198. package/lib/components/productCard/cartSkuCard/components/holders/index.less +47 -0
  199. package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
  200. package/lib/components/productCard/cartSkuCard/components/packages/index.js +73 -0
  201. package/lib/components/productCard/cartSkuCard/components/packages/index.less +22 -0
  202. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
  203. package/lib/components/productCard/cartSkuCard/components/packages/utils.js +44 -0
  204. package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
  205. package/lib/components/productCard/cartSkuCard/components/resources/index.js +71 -0
  206. package/lib/components/productCard/cartSkuCard/components/resources/index.less +19 -0
  207. package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +12 -0
  208. package/lib/components/productCard/cartSkuCard/components/sales/index.js +77 -0
  209. package/lib/components/productCard/cartSkuCard/components/sales/index.less +22 -0
  210. package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
  211. package/lib/components/productCard/cartSkuCard/components/specs/index.js +66 -0
  212. package/lib/components/productCard/cartSkuCard/components/specs/index.less +34 -0
  213. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
  214. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +373 -0
  215. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +74 -0
  216. package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
  217. package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +68 -0
  218. package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +38 -0
  219. package/lib/components/productCard/cartSkuCard/index.d.ts +10 -0
  220. package/lib/components/productCard/cartSkuCard/index.js +229 -0
  221. package/lib/components/productCard/cartSkuCard/index.less +33 -0
  222. package/lib/components/productCard/cartSkuCard/locales.d.ts +99 -0
  223. package/lib/components/productCard/cartSkuCard/locales.js +64 -0
  224. package/lib/components/productCard/components/Action/index.js +9 -0
  225. package/lib/components/productCard/components/Action/index.less +3 -0
  226. package/lib/components/productCard/components/Header/index.js +21 -11
  227. package/lib/components/productCard/components/Header/index.less +16 -1
  228. package/lib/components/productCard/components/Sales/index.js +2 -2
  229. package/lib/components/productCard/components/Time/components/SelectHolderModal/index.js +1 -1
  230. package/lib/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
  231. package/lib/components/productCard/index.d.ts +3 -1
  232. package/lib/components/productCard/index.js +7 -2
  233. package/lib/components/productCard/index.less +6 -0
  234. package/lib/components/productCard/locales.js +12 -3
  235. package/lib/components/productCard/status.js +1 -0
  236. package/lib/components/productCard/types.d.ts +1 -0
  237. package/lib/components/productCard/utils.js +8 -1
  238. package/lib/components/select-time/index.d.ts +14 -0
  239. package/lib/components/table/Table/AddFieldModal/index.d.ts +1 -0
  240. package/lib/components/table/Table/AddFieldModal/index.js +9 -9
  241. package/lib/components/table/Table/AddFieldModal/index.less +11 -11
  242. package/lib/components/table/Table/utils.d.ts +1 -1
  243. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  244. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
  245. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  246. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  247. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
  248. package/lib/components/virtual-keyboard/Number/index.js +3 -0
  249. package/lib/components/virtual-keyboard/Number/types.d.ts +1 -0
  250. package/lib/components/virtual-keyboard/index.d.ts +11 -0
  251. package/lib/components/virtual-keyboard/index.js +60 -2
  252. package/lib/components/virtual-keyboard/index.less +33 -1
  253. package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  254. package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
  255. package/lib/components/virtualInput/BaseVirtualInput/index.less +77 -0
  256. package/lib/components/virtualInput/index.d.ts +24 -0
  257. package/lib/components/virtualInput/index.js +102 -0
  258. package/lib/components/virtualInput/index.less +42 -0
  259. package/lib/index.d.ts +5 -1
  260. package/lib/index.js +11 -0
  261. package/lib/locales/en-US.d.ts +19 -2
  262. package/lib/locales/en-US.js +24 -5
  263. package/lib/locales/zh-CN.d.ts +19 -2
  264. package/lib/locales/zh-CN.js +24 -5
  265. package/lib/locales/zh-TW.d.ts +19 -2
  266. package/lib/locales/zh-TW.js +23 -5
  267. package/package.json +4 -4
  268. package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -12
  269. package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -12
@@ -0,0 +1,22 @@
1
+ .pisell-cart-sku-_sales-wrap {
2
+ padding: 0 4px;
3
+
4
+ ._sales-title {
5
+ color: #101828;
6
+ font-size: 12px;
7
+ font-weight: 600;
8
+ line-height: 18px;
9
+ word-wrap: break-word;
10
+ }
11
+
12
+ .pisell2-collapsible-list {
13
+ gap: 4px;
14
+ }
15
+
16
+ .product-info {
17
+ .product-name,
18
+ .product-price {
19
+ color: #667085;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Specs: (props: any) => JSX.Element | null;
3
+ export default Specs;
@@ -0,0 +1,66 @@
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/components/productCard/cartSkuCard/components/specs/index.tsx
30
+ var specs_exports = {};
31
+ __export(specs_exports, {
32
+ default: () => specs_default
33
+ });
34
+ module.exports = __toCommonJS(specs_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
37
+ var import_index = require("./index.less");
38
+ var import__ = require("../../index");
39
+ var Specs = (props) => {
40
+ const { dataSource = {} } = props;
41
+ const { bundle, options, product_option_string, symbol } = dataSource;
42
+ const more = /* @__PURE__ */ import_react.default.createElement(
43
+ "div",
44
+ {
45
+ style: {
46
+ color: "#667085",
47
+ fontSize: 10,
48
+ lineHeight: "10px"
49
+ }
50
+ },
51
+ import_utils.locales.getText("pisell2.cart.sku-card.more")
52
+ );
53
+ if (Array.isArray(bundle) && (bundle == null ? void 0 : bundle.length) > 0) {
54
+ const first = bundle[0];
55
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__specs` }, /* @__PURE__ */ import_react.default.createElement("div", null, first.title), bundle.length > 1 ? more : null);
56
+ }
57
+ if (product_option_string) {
58
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__specs` }, /* @__PURE__ */ import_react.default.createElement("div", null, product_option_string), options.length > 1 ? more : null);
59
+ }
60
+ if (options.length > 0) {
61
+ const first = options[0];
62
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__specs` }, /* @__PURE__ */ import_react.default.createElement("div", { className: "spec-item" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "spec-name" }, first.name), /* @__PURE__ */ import_react.default.createElement("span", { className: "spec-num" }, /* @__PURE__ */ import_react.default.createElement("span", null, symbol, first.price), /* @__PURE__ */ import_react.default.createElement("span", null), "x", /* @__PURE__ */ import_react.default.createElement("span", null, first.num))), options.length > 1 ? more : null);
63
+ }
64
+ return null;
65
+ };
66
+ var specs_default = Specs;
@@ -0,0 +1,34 @@
1
+ .pisell-cart-sku-card__specs {
2
+ user-select: none;
3
+
4
+ color: #667085;
5
+ font-size: 14px;
6
+ font-weight: 400;
7
+ line-height: 20px;
8
+ word-wrap: break-word;
9
+ overflow: hidden;
10
+
11
+ > div {
12
+ overflow: hidden;
13
+ text-overflow: ellipsis;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ .spec-item {
18
+ display: flex;
19
+
20
+ .spec-name {
21
+ display: inline-block;
22
+ overflow: hidden;
23
+ text-overflow: ellipsis;
24
+ white-space: nowrap;
25
+ margin-right: 8px;
26
+ }
27
+
28
+ .spec-num {
29
+ display: flex;
30
+ gap: 4px;
31
+ align-items: center;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,46 @@
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ declare type NativeProps<S extends string = never> = {
4
+ className?: string;
5
+ style?: React.CSSProperties & Partial<Record<S, string>>;
6
+ };
7
+ declare type PropagationEvent = 'click';
8
+ import './index.less';
9
+ declare type SideType = 'left' | 'right';
10
+ export declare type SwipeActionRef = {
11
+ close: () => void;
12
+ show: (side?: SideType) => void;
13
+ };
14
+ declare type ActionColor = 'light' | 'weak' | 'primary' | 'success' | 'warning' | 'danger';
15
+ export declare type Action = {
16
+ key: string | number;
17
+ text: ReactNode;
18
+ color?: ActionColor | string;
19
+ onClick?: (e: React.MouseEvent) => void;
20
+ style?: React.CSSProperties;
21
+ };
22
+ export declare type SwipeActionProps = {
23
+ rightActions?: Action[];
24
+ leftActions?: Action[];
25
+ onAction?: (action: Action, e: React.MouseEvent) => void;
26
+ closeOnTouchOutside?: boolean;
27
+ closeOnAction?: boolean;
28
+ children: ReactNode;
29
+ stopPropagation?: PropagationEvent[];
30
+ onActionsReveal?: (side: SideType) => void;
31
+ onClose?: () => void;
32
+ escapeDom?: string;
33
+ } & NativeProps<'--background'>;
34
+ export declare const SwipeAction: React.ForwardRefExoticComponent<{
35
+ rightActions?: Action[] | undefined;
36
+ leftActions?: Action[] | undefined;
37
+ onAction?: ((action: Action, e: React.MouseEvent) => void) | undefined;
38
+ closeOnTouchOutside?: boolean | undefined;
39
+ closeOnAction?: boolean | undefined;
40
+ children: ReactNode;
41
+ stopPropagation?: "click"[] | undefined;
42
+ onActionsReveal?: ((side: SideType) => void) | undefined;
43
+ onClose?: (() => void) | undefined;
44
+ escapeDom?: string | undefined;
45
+ } & NativeProps<"--background"> & React.RefAttributes<SwipeActionRef>>;
46
+ export {};
@@ -0,0 +1,373 @@
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/components/productCard/cartSkuCard/components/swipeAction/index.tsx
30
+ var swipeAction_exports = {};
31
+ __export(swipeAction_exports, {
32
+ SwipeAction: () => SwipeAction
33
+ });
34
+ module.exports = __toCommonJS(swipeAction_exports);
35
+ var import_web = require("@react-spring/web");
36
+ var import_use_gesture_react = require("@use-gesture/react/dist/use-gesture-react.cjs");
37
+ var import_react = __toESM(require("react"));
38
+ var import_index = require("./index.less");
39
+ function withNativeProps(props, element) {
40
+ const p = {
41
+ ...element.props
42
+ };
43
+ if (props.className) {
44
+ p.className = props.className + (element.props.className ? ` ${element.props.className}` : "");
45
+ }
46
+ if (props.style) {
47
+ p.style = {
48
+ ...props.style,
49
+ ...element.props.style
50
+ };
51
+ }
52
+ return import_react.default.cloneElement(element, p);
53
+ }
54
+ function nearest(arr, target) {
55
+ return arr.reduce((prev, curr) => {
56
+ return Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev;
57
+ });
58
+ }
59
+ function mergeProps(a, b) {
60
+ return {
61
+ ...a,
62
+ ...b
63
+ };
64
+ }
65
+ function withStopPropagation(events, element) {
66
+ if (!events.includes("click")) {
67
+ return element;
68
+ }
69
+ const onClick = (e) => {
70
+ var _a, _b;
71
+ e.stopPropagation();
72
+ (_b = (_a = element.props).onClick) == null ? void 0 : _b.call(_a, e);
73
+ };
74
+ return import_react.default.cloneElement(element, {
75
+ ...element.props,
76
+ onClick
77
+ });
78
+ }
79
+ var Button = ({
80
+ children,
81
+ className,
82
+ style,
83
+ onClick
84
+ }) => {
85
+ return /* @__PURE__ */ import_react.default.createElement(
86
+ "button",
87
+ {
88
+ className,
89
+ style: {
90
+ border: "none",
91
+ background: (style == null ? void 0 : style["--background-color"]) || "transparent",
92
+ ...style
93
+ },
94
+ onClick
95
+ },
96
+ children
97
+ );
98
+ };
99
+ var classPrefix = `pisell-custom-swipe-action`;
100
+ var defaultProps = {
101
+ rightActions: [],
102
+ leftActions: [],
103
+ closeOnTouchOutside: true,
104
+ closeOnAction: true,
105
+ stopPropagation: []
106
+ };
107
+ var SwipeAction = (0, import_react.forwardRef)(
108
+ (p, ref) => {
109
+ const props = mergeProps(defaultProps, p);
110
+ const rootRef = (0, import_react.useRef)(null);
111
+ const leftRef = (0, import_react.useRef)(null);
112
+ const rightRef = (0, import_react.useRef)(null);
113
+ const [containerHeight, setContainerHeight] = (0, import_react.useState)(0);
114
+ function getWidth(ref2) {
115
+ const element = ref2.current;
116
+ if (!element) return 0;
117
+ return element.offsetWidth;
118
+ }
119
+ function getHeight(ref2) {
120
+ const element = ref2.current;
121
+ if (!element) return 0;
122
+ return element.offsetHeight;
123
+ }
124
+ function getLeftWidth() {
125
+ return getWidth(leftRef);
126
+ }
127
+ function getRightWidth() {
128
+ return getWidth(rightRef);
129
+ }
130
+ function getRootHeight() {
131
+ return getHeight(rootRef);
132
+ }
133
+ const [{ x }, api] = (0, import_web.useSpring)(
134
+ () => ({
135
+ x: 0,
136
+ config: { tension: 200, friction: 30 }
137
+ }),
138
+ []
139
+ );
140
+ const draggingRef = (0, import_react.useRef)(false);
141
+ const dragCancelRef = (0, import_react.useRef)(null);
142
+ function forceCancelDrag() {
143
+ var _a;
144
+ (_a = dragCancelRef.current) == null ? void 0 : _a.call(dragCancelRef);
145
+ draggingRef.current = false;
146
+ }
147
+ const bind = (0, import_use_gesture_react.useDrag)(
148
+ (state) => {
149
+ var _a;
150
+ dragCancelRef.current = state.cancel;
151
+ if (!state.intentional) return;
152
+ if (state.down) {
153
+ draggingRef.current = true;
154
+ }
155
+ if (!draggingRef.current) return;
156
+ const [offsetX] = state.offset;
157
+ if (state.last) {
158
+ const leftWidth = getLeftWidth();
159
+ const rightWidth = getRightWidth();
160
+ let position = offsetX + state.velocity[0] * state.direction[0] * 50;
161
+ if (offsetX > 0) {
162
+ position = Math.max(0, position);
163
+ } else if (offsetX < 0) {
164
+ position = Math.min(0, position);
165
+ } else {
166
+ position = 0;
167
+ }
168
+ const targetX = nearest([-rightWidth, 0, leftWidth], position);
169
+ api.start({
170
+ x: targetX
171
+ });
172
+ if (targetX !== 0) {
173
+ (_a = p.onActionsReveal) == null ? void 0 : _a.call(p, targetX > 0 ? "left" : "right");
174
+ }
175
+ window.setTimeout(() => {
176
+ draggingRef.current = false;
177
+ });
178
+ } else {
179
+ api.start({
180
+ x: offsetX,
181
+ immediate: true
182
+ });
183
+ }
184
+ },
185
+ {
186
+ from: () => [x.get(), 0],
187
+ bounds: () => {
188
+ const leftWidth = getLeftWidth();
189
+ const rightWidth = getRightWidth();
190
+ return {
191
+ left: -rightWidth,
192
+ right: leftWidth
193
+ };
194
+ },
195
+ axis: "x",
196
+ preventScroll: true,
197
+ pointer: { touch: true },
198
+ triggerAllEvents: true
199
+ }
200
+ );
201
+ const close = () => {
202
+ var _a;
203
+ api.start({
204
+ x: 0
205
+ });
206
+ forceCancelDrag();
207
+ (_a = props.onClose) == null ? void 0 : _a.call(props);
208
+ };
209
+ (0, import_react.useImperativeHandle)(ref, () => ({
210
+ show: (side = "right") => {
211
+ var _a;
212
+ if (side === "right") {
213
+ api.start({
214
+ x: -getRightWidth()
215
+ });
216
+ } else if (side === "left") {
217
+ api.start({
218
+ x: getLeftWidth()
219
+ });
220
+ }
221
+ (_a = p.onActionsReveal) == null ? void 0 : _a.call(p, side);
222
+ },
223
+ close
224
+ }));
225
+ (0, import_react.useEffect)(() => {
226
+ const updateHeight = () => {
227
+ const height = getRootHeight();
228
+ setContainerHeight(height);
229
+ };
230
+ updateHeight();
231
+ const resizeObserver = new ResizeObserver(updateHeight);
232
+ if (rootRef.current) {
233
+ resizeObserver.observe(rootRef.current);
234
+ }
235
+ return () => {
236
+ resizeObserver.disconnect();
237
+ };
238
+ }, []);
239
+ (0, import_react.useEffect)(() => {
240
+ if (!props.closeOnTouchOutside) return;
241
+ function handle(e) {
242
+ if (e.target && props.escapeDom) {
243
+ const container = document.querySelector(props.escapeDom);
244
+ if (container == null ? void 0 : container.contains(e.target)) return;
245
+ }
246
+ if (x.get() === 0) {
247
+ return;
248
+ }
249
+ const root = rootRef.current;
250
+ if (root && !root.contains(e.target)) {
251
+ close();
252
+ }
253
+ }
254
+ if ("ontouchstart" in window) {
255
+ document.addEventListener("touchstart", handle);
256
+ } else {
257
+ document.addEventListener("mousedown", handle);
258
+ }
259
+ return () => {
260
+ document.removeEventListener("touchstart", handle);
261
+ document.removeEventListener("mousedown", handle);
262
+ };
263
+ }, [props.closeOnTouchOutside, props.escapeDom]);
264
+ const getRightContainerClass = () => {
265
+ const baseClass = `${classPrefix}-actions ${classPrefix}-actions-right`;
266
+ if (containerHeight > 180) {
267
+ return `${baseClass} ${classPrefix}-height-large`;
268
+ } else if (containerHeight > 120) {
269
+ return `${baseClass} ${classPrefix}-height-medium`;
270
+ }
271
+ return `${baseClass} ${classPrefix}-height-small`;
272
+ };
273
+ const getRightActionButtonClass = () => {
274
+ if (containerHeight > 180) {
275
+ return `${classPrefix}-action-height-large`;
276
+ } else if (containerHeight > 120) {
277
+ return `${classPrefix}-action-height-medium`;
278
+ }
279
+ return `${classPrefix}-action-height-small`;
280
+ };
281
+ function renderAction(action, isRightAction = false) {
282
+ const color = action.color ?? "light";
283
+ const _style = action.style || {};
284
+ const buttonClass = isRightAction ? `${classPrefix}-action-button ${getRightActionButtonClass()}` : `${classPrefix}-action-button`;
285
+ return /* @__PURE__ */ import_react.default.createElement(
286
+ Button,
287
+ {
288
+ key: action.key,
289
+ className: buttonClass,
290
+ style: {
291
+ "--background-color": colorRecord[color] ?? color,
292
+ ..._style
293
+ },
294
+ onClick: (e) => {
295
+ var _a, _b;
296
+ if (props.closeOnAction) {
297
+ close();
298
+ }
299
+ (_a = action.onClick) == null ? void 0 : _a.call(action, e);
300
+ (_b = props.onAction) == null ? void 0 : _b.call(props, action, e);
301
+ }
302
+ },
303
+ action.text
304
+ );
305
+ }
306
+ return withNativeProps(
307
+ props,
308
+ /* @__PURE__ */ import_react.default.createElement(
309
+ "div",
310
+ {
311
+ className: classPrefix,
312
+ ...bind(),
313
+ ref: rootRef,
314
+ onClickCapture: (e) => {
315
+ if (draggingRef.current) {
316
+ e.stopPropagation();
317
+ e.preventDefault();
318
+ }
319
+ }
320
+ },
321
+ /* @__PURE__ */ import_react.default.createElement(import_web.animated.div, { className: `${classPrefix}-track`, style: { x } }, withStopPropagation(
322
+ props.stopPropagation,
323
+ /* @__PURE__ */ import_react.default.createElement(
324
+ "div",
325
+ {
326
+ className: `${classPrefix}-actions ${classPrefix}-actions-left`,
327
+ ref: leftRef
328
+ },
329
+ props.leftActions.map((action) => renderAction(action, false))
330
+ )
331
+ ), /* @__PURE__ */ import_react.default.createElement(
332
+ "div",
333
+ {
334
+ className: `${classPrefix}-content`,
335
+ onClickCapture: (e) => {
336
+ if (x.goal !== 0) {
337
+ e.preventDefault();
338
+ e.stopPropagation();
339
+ close();
340
+ }
341
+ }
342
+ },
343
+ /* @__PURE__ */ import_react.default.createElement(
344
+ import_web.animated.div,
345
+ {
346
+ style: {
347
+ pointerEvents: x.to(
348
+ (v) => v !== 0 && x.goal !== 0 ? "none" : "auto"
349
+ )
350
+ }
351
+ },
352
+ props.children
353
+ )
354
+ ), withStopPropagation(
355
+ props.stopPropagation,
356
+ /* @__PURE__ */ import_react.default.createElement("div", { className: getRightContainerClass(), ref: rightRef }, props.rightActions.map((action) => renderAction(action, true)))
357
+ ))
358
+ )
359
+ );
360
+ }
361
+ );
362
+ var colorRecord = {
363
+ light: "#ccc",
364
+ weak: "#999",
365
+ primary: "#1677ff",
366
+ success: "#00b578",
367
+ warning: "#ff8f1f",
368
+ danger: "#ff3141"
369
+ };
370
+ // Annotate the CommonJS export names for ESM import in node:
371
+ 0 && (module.exports = {
372
+ SwipeAction
373
+ });
@@ -0,0 +1,74 @@
1
+ .pisell-custom-swipe-action {
2
+ cursor: grab;
3
+ overflow: hidden;
4
+ touch-action: pan-y;
5
+ &-track {
6
+ position: relative;
7
+ overflow: visible;
8
+ }
9
+ &-content {
10
+ }
11
+ &-actions {
12
+ position: absolute;
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: stretch;
16
+ width: auto;
17
+ white-space: nowrap;
18
+ &-right {
19
+ left: 100%;
20
+ top: 0;
21
+ height: 100%;
22
+ }
23
+ &-left {
24
+ right: 100%;
25
+ top: 0;
26
+ height: 100%;
27
+ }
28
+ }
29
+ &-action-button {
30
+ --border-radius: 0;
31
+ --border-width: 0;
32
+ padding-left: 4px;
33
+ padding-right: 4px;
34
+ }
35
+ }
36
+
37
+ .pisell-custom-swipe-action-action-button {
38
+ min-width: 80px;
39
+ }
40
+
41
+ /* 容器样式 */
42
+ .pisell-custom-swipe-action-height-large {
43
+ display: flex;
44
+ flex-direction: column;
45
+ background-color: rgba(67, 93, 147, 0.3);
46
+ justify-content: flex-start;
47
+
48
+ .pisell-number-selector-btn {
49
+ width: 40px !important;
50
+ height: 40px !important;
51
+ }
52
+ }
53
+
54
+ .pisell-custom-swipe-action-height-medium {
55
+ display: flex;
56
+ flex-direction: column;
57
+ background-color: rgba(67, 93, 147, 0.3);
58
+
59
+ .pisell-number-selector-btn {
60
+ width: 40px !important;
61
+ height: 40px !important;
62
+ }
63
+ }
64
+
65
+ /* 按钮样式 */
66
+ .pisell-custom-swipe-action-action-height-large {
67
+ height: 60px;
68
+ width: 200px;
69
+ }
70
+
71
+ .pisell-custom-swipe-action-action-height-medium {
72
+ flex: 1;
73
+ width: 200px;
74
+ }
@@ -0,0 +1,6 @@
1
+ import 'dayjs/locale/zh-cn';
2
+ import 'dayjs/locale/en';
3
+ import 'dayjs/locale/zh-tw';
4
+ import './index.less';
5
+ declare const TimeRange: (props: any) => JSX.Element | null;
6
+ export default TimeRange;