@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,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,360 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ import { animated, useSpring } from '@react-spring/web';
15
+ import { useDrag } from '@use-gesture/react/dist/use-gesture-react.cjs';
16
+ import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
17
+
18
+ // 本地实现的工具函数和类型
19
+
20
+ // withNativeProps 工具函数
21
+ function withNativeProps(props, element) {
22
+ var p = _objectSpread({}, element.props);
23
+ if (props.className) {
24
+ p.className = props.className + (element.props.className ? " ".concat(element.props.className) : '');
25
+ }
26
+ if (props.style) {
27
+ p.style = _objectSpread(_objectSpread({}, props.style), element.props.style);
28
+ }
29
+ return /*#__PURE__*/React.cloneElement(element, p);
30
+ }
31
+
32
+ // nearest 工具函数
33
+ function nearest(arr, target) {
34
+ return arr.reduce(function (prev, curr) {
35
+ return Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev;
36
+ });
37
+ }
38
+
39
+ // mergeProps 工具函数
40
+ function mergeProps(a, b) {
41
+ return _objectSpread(_objectSpread({}, a), b);
42
+ }
43
+
44
+ // withStopPropagation 工具函数
45
+ function withStopPropagation(events, element) {
46
+ if (!events.includes('click')) {
47
+ return element;
48
+ }
49
+ var onClick = function onClick(e) {
50
+ var _element$props$onClic, _element$props;
51
+ e.stopPropagation();
52
+ (_element$props$onClic = (_element$props = element.props).onClick) === null || _element$props$onClic === void 0 || _element$props$onClic.call(_element$props, e);
53
+ };
54
+ return /*#__PURE__*/React.cloneElement(element, _objectSpread(_objectSpread({}, element.props), {}, {
55
+ onClick: onClick
56
+ }));
57
+ }
58
+
59
+ // Button 组件实现
60
+
61
+ var Button = function Button(_ref) {
62
+ var children = _ref.children,
63
+ className = _ref.className,
64
+ style = _ref.style,
65
+ onClick = _ref.onClick;
66
+ return /*#__PURE__*/React.createElement("button", {
67
+ className: className,
68
+ style: _objectSpread({
69
+ border: 'none',
70
+ background: (style === null || style === void 0 ? void 0 : style['--background-color']) || 'transparent'
71
+ }, style),
72
+ onClick: onClick
73
+ }, children);
74
+ };
75
+ import "./index.less";
76
+ var classPrefix = "pisell-custom-swipe-action";
77
+ var defaultProps = {
78
+ rightActions: [],
79
+ leftActions: [],
80
+ closeOnTouchOutside: true,
81
+ closeOnAction: true,
82
+ stopPropagation: []
83
+ };
84
+ export var SwipeAction = /*#__PURE__*/forwardRef(function (p, ref) {
85
+ var props = mergeProps(defaultProps, p);
86
+ var rootRef = useRef(null);
87
+ var leftRef = useRef(null);
88
+ var rightRef = useRef(null);
89
+
90
+ // 添加容器高度状态
91
+ var _useState = useState(0),
92
+ _useState2 = _slicedToArray(_useState, 2),
93
+ containerHeight = _useState2[0],
94
+ setContainerHeight = _useState2[1];
95
+ function getWidth(ref) {
96
+ var element = ref.current;
97
+ if (!element) return 0;
98
+ return element.offsetWidth;
99
+ }
100
+
101
+ // 添加获取高度的函数
102
+ function getHeight(ref) {
103
+ var element = ref.current;
104
+ if (!element) return 0;
105
+ return element.offsetHeight;
106
+ }
107
+ function getLeftWidth() {
108
+ return getWidth(leftRef);
109
+ }
110
+ function getRightWidth() {
111
+ return getWidth(rightRef);
112
+ }
113
+
114
+ // 添加获取根容器高度的函数
115
+ function getRootHeight() {
116
+ return getHeight(rootRef);
117
+ }
118
+ var _useSpring = useSpring(function () {
119
+ return {
120
+ x: 0,
121
+ config: {
122
+ tension: 200,
123
+ friction: 30
124
+ }
125
+ };
126
+ }, []),
127
+ _useSpring2 = _slicedToArray(_useSpring, 2),
128
+ x = _useSpring2[0].x,
129
+ api = _useSpring2[1];
130
+ var draggingRef = useRef(false);
131
+ var dragCancelRef = useRef(null);
132
+ function forceCancelDrag() {
133
+ var _dragCancelRef$curren;
134
+ (_dragCancelRef$curren = dragCancelRef.current) === null || _dragCancelRef$curren === void 0 || _dragCancelRef$curren.call(dragCancelRef);
135
+ draggingRef.current = false;
136
+ }
137
+ var bind = useDrag(function (state) {
138
+ dragCancelRef.current = state.cancel;
139
+ if (!state.intentional) return;
140
+ if (state.down) {
141
+ draggingRef.current = true;
142
+ }
143
+ if (!draggingRef.current) return;
144
+ var _state$offset = _slicedToArray(state.offset, 1),
145
+ offsetX = _state$offset[0];
146
+ if (state.last) {
147
+ var leftWidth = getLeftWidth();
148
+ var rightWidth = getRightWidth();
149
+ var position = offsetX + state.velocity[0] * state.direction[0] * 50;
150
+ if (offsetX > 0) {
151
+ position = Math.max(0, position);
152
+ } else if (offsetX < 0) {
153
+ position = Math.min(0, position);
154
+ } else {
155
+ position = 0;
156
+ }
157
+ var targetX = nearest([-rightWidth, 0, leftWidth], position);
158
+ api.start({
159
+ x: targetX
160
+ });
161
+ if (targetX !== 0) {
162
+ var _p$onActionsReveal;
163
+ (_p$onActionsReveal = p.onActionsReveal) === null || _p$onActionsReveal === void 0 || _p$onActionsReveal.call(p, targetX > 0 ? 'left' : 'right');
164
+ }
165
+ window.setTimeout(function () {
166
+ draggingRef.current = false;
167
+ });
168
+ } else {
169
+ api.start({
170
+ x: offsetX,
171
+ immediate: true
172
+ });
173
+ }
174
+ }, {
175
+ from: function from() {
176
+ return [x.get(), 0];
177
+ },
178
+ bounds: function bounds() {
179
+ var leftWidth = getLeftWidth();
180
+ var rightWidth = getRightWidth();
181
+ return {
182
+ left: -rightWidth,
183
+ right: leftWidth
184
+ };
185
+ },
186
+ axis: 'x',
187
+ preventScroll: true,
188
+ pointer: {
189
+ touch: true
190
+ },
191
+ triggerAllEvents: true
192
+ });
193
+ var close = function close() {
194
+ var _props$onClose;
195
+ api.start({
196
+ x: 0
197
+ });
198
+ forceCancelDrag();
199
+ (_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
200
+ };
201
+ useImperativeHandle(ref, function () {
202
+ return {
203
+ show: function show() {
204
+ var _p$onActionsReveal2;
205
+ var side = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'right';
206
+ if (side === 'right') {
207
+ api.start({
208
+ x: -getRightWidth()
209
+ });
210
+ } else if (side === 'left') {
211
+ api.start({
212
+ x: getLeftWidth()
213
+ });
214
+ }
215
+ (_p$onActionsReveal2 = p.onActionsReveal) === null || _p$onActionsReveal2 === void 0 || _p$onActionsReveal2.call(p, side);
216
+ },
217
+ close: close
218
+ };
219
+ });
220
+
221
+ // 添加高度检测的 useEffect
222
+ useEffect(function () {
223
+ var updateHeight = function updateHeight() {
224
+ var height = getRootHeight();
225
+ setContainerHeight(height);
226
+ };
227
+
228
+ // 组件挂载后检测高度
229
+ updateHeight();
230
+
231
+ // 监听窗口大小变化
232
+ var resizeObserver = new ResizeObserver(updateHeight);
233
+ if (rootRef.current) {
234
+ resizeObserver.observe(rootRef.current);
235
+ }
236
+ return function () {
237
+ resizeObserver.disconnect();
238
+ };
239
+ }, []);
240
+ useEffect(function () {
241
+ if (!props.closeOnTouchOutside) return;
242
+ function handle(e) {
243
+ // 检查点击的元素或其祖先元素是否有特定 class
244
+ if (e.target && props.escapeDom) {
245
+ var container = document.querySelector(props.escapeDom);
246
+ if (container !== null && container !== void 0 && container.contains(e.target)) return;
247
+ }
248
+ if (x.get() === 0) {
249
+ return;
250
+ }
251
+ var root = rootRef.current;
252
+ if (root && !root.contains(e.target)) {
253
+ close();
254
+ }
255
+ }
256
+ if ('ontouchstart' in window) {
257
+ document.addEventListener('touchstart', handle);
258
+ } else {
259
+ document.addEventListener('mousedown', handle);
260
+ }
261
+ return function () {
262
+ document.removeEventListener('touchstart', handle);
263
+ document.removeEventListener('mousedown', handle);
264
+ };
265
+ }, [props.closeOnTouchOutside, props.escapeDom]);
266
+
267
+ // 根据容器高度获取右侧容器的 class 名称
268
+ var getRightContainerClass = function getRightContainerClass() {
269
+ var baseClass = "".concat(classPrefix, "-actions ").concat(classPrefix, "-actions-right");
270
+ if (containerHeight > 180) {
271
+ return "".concat(baseClass, " ").concat(classPrefix, "-height-large");
272
+ } else if (containerHeight > 120) {
273
+ return "".concat(baseClass, " ").concat(classPrefix, "-height-medium");
274
+ }
275
+ return "".concat(baseClass, " ").concat(classPrefix, "-height-small");
276
+ };
277
+
278
+ // 根据容器高度获取右侧按钮的 class 名称
279
+ var getRightActionButtonClass = function getRightActionButtonClass() {
280
+ if (containerHeight > 180) {
281
+ return "".concat(classPrefix, "-action-height-large");
282
+ } else if (containerHeight > 120) {
283
+ return "".concat(classPrefix, "-action-height-medium");
284
+ }
285
+ return "".concat(classPrefix, "-action-height-small");
286
+ };
287
+ function renderAction(action) {
288
+ var _action$color, _colorRecord$color;
289
+ var isRightAction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
290
+ var color = (_action$color = action.color) !== null && _action$color !== void 0 ? _action$color : 'light';
291
+ var _style = action.style || {};
292
+
293
+ // 为右侧按钮添加基于高度的 class
294
+ var buttonClass = isRightAction ? "".concat(classPrefix, "-action-button ").concat(getRightActionButtonClass()) : "".concat(classPrefix, "-action-button");
295
+ return /*#__PURE__*/React.createElement(Button, {
296
+ key: action.key,
297
+ className: buttonClass,
298
+ style: _objectSpread({
299
+ '--background-color': (_colorRecord$color = colorRecord[color]) !== null && _colorRecord$color !== void 0 ? _colorRecord$color : color
300
+ }, _style),
301
+ onClick: function onClick(e) {
302
+ var _action$onClick, _props$onAction;
303
+ if (props.closeOnAction) {
304
+ close();
305
+ }
306
+ (_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action, e);
307
+ (_props$onAction = props.onAction) === null || _props$onAction === void 0 || _props$onAction.call(props, action, e);
308
+ }
309
+ }, action.text);
310
+ }
311
+ return withNativeProps(props, /*#__PURE__*/React.createElement("div", _extends({
312
+ className: classPrefix
313
+ }, bind(), {
314
+ ref: rootRef,
315
+ onClickCapture: function onClickCapture(e) {
316
+ if (draggingRef.current) {
317
+ e.stopPropagation();
318
+ e.preventDefault();
319
+ }
320
+ }
321
+ }), /*#__PURE__*/React.createElement(animated.div, {
322
+ className: "".concat(classPrefix, "-track"),
323
+ style: {
324
+ x: x
325
+ }
326
+ }, withStopPropagation(props.stopPropagation, /*#__PURE__*/React.createElement("div", {
327
+ className: "".concat(classPrefix, "-actions ").concat(classPrefix, "-actions-left"),
328
+ ref: leftRef
329
+ }, props.leftActions.map(function (action) {
330
+ return renderAction(action, false);
331
+ }))), /*#__PURE__*/React.createElement("div", {
332
+ className: "".concat(classPrefix, "-content"),
333
+ onClickCapture: function onClickCapture(e) {
334
+ if (x.goal !== 0) {
335
+ e.preventDefault();
336
+ e.stopPropagation();
337
+ close();
338
+ }
339
+ }
340
+ }, /*#__PURE__*/React.createElement(animated.div, {
341
+ style: {
342
+ pointerEvents: x.to(function (v) {
343
+ return v !== 0 && x.goal !== 0 ? 'none' : 'auto';
344
+ })
345
+ }
346
+ }, props.children)), withStopPropagation(props.stopPropagation, /*#__PURE__*/React.createElement("div", {
347
+ className: getRightContainerClass(),
348
+ ref: rightRef
349
+ }, props.rightActions.map(function (action) {
350
+ return renderAction(action, true);
351
+ }))))));
352
+ });
353
+ var colorRecord = {
354
+ light: '#ccc',
355
+ weak: '#999',
356
+ primary: '#1677ff',
357
+ success: '#00b578',
358
+ warning: '#ff8f1f',
359
+ danger: '#ff3141'
360
+ };
@@ -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;
@@ -0,0 +1,54 @@
1
+ import Iconfont from "../../../../iconfont";
2
+ import React, { useEffect, useMemo } from 'react';
3
+ import { Divider } from 'antd';
4
+ import { getServiceTime } from "../../../utils";
5
+ import dayjs from 'dayjs';
6
+ import 'dayjs/locale/zh-cn';
7
+ import 'dayjs/locale/en';
8
+ import 'dayjs/locale/zh-tw';
9
+ import "./index.less";
10
+ import { PREFIX } from "../../index";
11
+ var localeTypes = {
12
+ 'en-US': 'en',
13
+ 'zh-CN': 'zh-cn',
14
+ 'zh-HK': 'zh-tw'
15
+ };
16
+ var TimeRange = function TimeRange(props) {
17
+ var _props$dataSource = props.dataSource,
18
+ dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
19
+ var start_date = dataSource.start_date,
20
+ end_date = dataSource.end_date,
21
+ _dataSource$locale = dataSource.locale,
22
+ locale = _dataSource$locale === void 0 ? 'en-US' : _dataSource$locale;
23
+ if (!dayjs(start_date).isValid() || !dayjs(end_date).isValid()) return null;
24
+ useEffect(function () {
25
+ dayjs.locale(localeTypes[locale]);
26
+ }, [locale]);
27
+ var isEn = useMemo(function () {
28
+ return locale === 'en-US' || locale === 'en';
29
+ }, [locale]);
30
+ var _format = useMemo(function () {
31
+ return isEn ? 'HH:mm DD/MM/YYYY' : 'YYYY-MM-DD HH:mm';
32
+ }, [isEn]);
33
+ var renderTimeItem = function renderTimeItem(time) {
34
+ return /*#__PURE__*/React.createElement("div", {
35
+ className: "time-range-item"
36
+ }, /*#__PURE__*/React.createElement(Iconfont, {
37
+ className: "time-icon",
38
+ type: "pisell2-clock"
39
+ }), /*#__PURE__*/React.createElement("span", {
40
+ className: "time-str"
41
+ }, dayjs(time).format(_format)));
42
+ };
43
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
44
+ style: {
45
+ margin: '0'
46
+ }
47
+ }), /*#__PURE__*/React.createElement("div", {
48
+ className: "".concat(PREFIX, "__time-range")
49
+ }, /*#__PURE__*/React.createElement(Iconfont, {
50
+ className: "time-icon",
51
+ type: "pisell2-clock"
52
+ }), getServiceTime(dataSource, start_date)));
53
+ };
54
+ export default TimeRange;
@@ -0,0 +1,38 @@
1
+ .pisell-cart-sku-card__time-range {
2
+ user-select: none;
3
+ color: #667085;
4
+
5
+ display: flex;
6
+ align-items: center;
7
+ gap: 4px;
8
+ overflow: hidden;
9
+
10
+ .joint-icon {
11
+ font-size: 16px;
12
+ color: #7f56da;
13
+ }
14
+
15
+ .time-icon {
16
+ font-size: 16px;
17
+ color: #7f56da;
18
+ }
19
+
20
+ .time-range-item {
21
+ white-space: nowrap;
22
+ display: flex;
23
+ gap: 8px;
24
+ align-items: center;
25
+ overflow: hidden;
26
+
27
+ .time-str {
28
+ color: #667085;
29
+ font-size: 14px;
30
+ font-weight: 400;
31
+ line-height: 20px;
32
+ display: inline-block;
33
+ white-space: nowrap;
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,10 @@
1
+ import './index.less';
2
+ import { ProductCardTypes } from '../types';
3
+ interface ISKUCardProps extends ProductCardTypes {
4
+ type: 'a2' | 'a5';
5
+ rightActions: any[];
6
+ escapeDom?: string;
7
+ }
8
+ export declare const PREFIX = "pisell-cart-sku-card";
9
+ declare const CartSkuCard: (props: ISKUCardProps) => JSX.Element;
10
+ export default CartSkuCard;