@pisell/materials 6.2.29 → 6.3.1

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 (248) 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 +3 -3
  6. package/build/lowcode/preview.js +150 -150
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +24 -28
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +25 -29
  11. package/dist/umd/materials.min.css +1 -0
  12. package/dist/umd/materials.min.js +1 -0
  13. package/dist/umd/static/DotsSix.57d66266.svg +1 -0
  14. package/dist/umd/static/arrow-left.e542294f.svg +1 -0
  15. package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
  16. package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
  17. package/dist/umd/static/help-circle.31c9be40.svg +1 -0
  18. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
  19. package/es/components/DragSortList/index.js +6 -6
  20. package/es/components/batch-editor/index.d.ts +0 -1
  21. package/es/components/classicLayout/index.js +5 -4
  22. package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +0 -1
  23. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
  24. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
  25. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  26. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
  27. package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
  28. package/es/components/dataSourceComponents/fields/Select/index.d.ts +0 -1
  29. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  30. package/es/components/dataSourceComponents/fields/index.d.ts +6 -7
  31. package/es/components/date-picker/index.d.ts +0 -1
  32. package/es/components/filter/index.d.ts +0 -1
  33. package/es/components/icon/index.js +5 -5
  34. package/es/components/iconfont/index.js +1 -1
  35. package/es/components/list/index.js +6 -6
  36. package/es/components/page/index.d.ts +0 -1
  37. package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
  38. package/es/components/pisellGoodPassCard/index.d.ts +0 -1
  39. package/es/components/pisellGoodPassCard/index.js +5 -17
  40. package/es/components/pisellInput/index.d.ts +0 -1
  41. package/es/components/pisellModal/components/IpadModal/index.d.ts +0 -1
  42. package/es/components/pisellModal/components/MobileModal/index.d.ts +0 -1
  43. package/es/components/pisellModal/components/index.d.ts +0 -1
  44. package/es/components/pisellToast/index.js +0 -3
  45. package/es/components/pisellWalletPassCard/index.d.ts +0 -1
  46. package/es/components/productCard/components/Header/index.js +8 -21
  47. package/es/components/productCard/components/Header/index.less +0 -15
  48. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  49. package/es/components/productCard/components/Sales/index.js +2 -2
  50. package/es/components/productCard/index.d.ts +1 -3
  51. package/es/components/productCard/index.js +2 -5
  52. package/es/components/productCard/index.less +0 -6
  53. package/es/components/qrcode/index.js +1 -1
  54. package/es/components/select-time/index.d.ts +0 -1
  55. package/es/components/sort/components/InlineMenu/index.js +1 -1
  56. package/es/components/table/Actions/component/ButtonIcon/index.js +5 -5
  57. package/es/components/table/Actions/component/ColumnsSetting/index.d.ts +0 -1
  58. package/es/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
  59. package/es/components/table/Actions/component/Group/index.d.ts +0 -1
  60. package/es/components/table/Actions/component/ViewMode/index.js +1 -1
  61. package/es/components/table/Actions/index.d.ts +0 -1
  62. package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
  63. package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.js +5 -4
  64. package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
  65. package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  66. package/es/components/table/Header/Buttons/index.js +5 -5
  67. package/es/components/table/Table/AddFieldModal/index.js +6 -6
  68. package/es/components/table/Table/SelectField/index.d.ts +0 -1
  69. package/es/components/table/Table/SelectField/index.js +4 -4
  70. package/es/components/table/Table/fields/date/Edit/index.js +1 -1
  71. package/es/components/table/Table/fields/date/index.d.ts +0 -1
  72. package/es/components/table/Table/fields/image/Show/index.d.ts +0 -1
  73. package/es/components/table/Table/fields/image/index.d.ts +0 -1
  74. package/es/components/table/Table/fields/index.d.ts +2 -3
  75. package/es/components/table/Table/fields/link/Edit/index.js +5 -5
  76. package/es/components/table/Table/fields/link/index.d.ts +0 -1
  77. package/es/components/table/Table/fields/number/Show/index.d.ts +0 -1
  78. package/es/components/table/Table/fields/number/index.d.ts +0 -1
  79. package/es/components/table/Table/fields/numberRange/Show/index.d.ts +0 -1
  80. package/es/components/table/Table/fields/numberRange/index.d.ts +0 -1
  81. package/es/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
  82. package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +0 -1
  83. package/es/components/table/Table/fields/pSwitch/index.d.ts +0 -1
  84. package/es/components/table/Table/fields/rangePicker/filterUtil/index.js +1 -1
  85. package/es/components/table/Table/fields/rangePicker/index.d.ts +0 -1
  86. package/es/components/table/Table/fields/search/Show/index.d.ts +0 -1
  87. package/es/components/table/Table/fields/search/filterUtil/index.js +1 -0
  88. package/es/components/table/Table/fields/search/index.d.ts +0 -1
  89. package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  90. package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
  91. package/es/components/table/Table/fields/text/Show/index.js +4 -4
  92. package/es/components/table/Table/fields/text/filterUtil/index.js +1 -0
  93. package/es/components/table/Table/fields/text/index.d.ts +0 -1
  94. package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  95. package/es/components/table/Table/tableConfig/SortRow/index.js +2 -2
  96. package/es/components/table/Table/tableConfig/body/CellContent/index.js +3 -3
  97. package/es/components/table/Table/tableConfig/body/CellProvider/index.js +8 -8
  98. package/es/components/table/Table/utils.d.ts +1 -1
  99. package/es/components/table/hooks/useMergeColumnSetting.js +2 -1
  100. package/es/components/table/hooks/useTransDataSourceGroupSetting.js +5 -5
  101. package/es/components/table/hooks/useTransFilterSetting.js +5 -5
  102. package/es/components/translation/utils.js +5 -5
  103. package/es/components/versionSelect/index.d.ts +0 -1
  104. package/es/components/virtual-keyboard/index.d.ts +0 -11
  105. package/es/components/virtual-keyboard/index.js +3 -88
  106. package/es/components/virtual-keyboard/index.less +1 -33
  107. package/es/hooks/useResponsive.js +2 -2
  108. package/es/utils/hoc.js +1 -1
  109. package/es/utils/index.d.ts +1 -1
  110. package/es/utils/miniRedux.js +9 -8
  111. package/lib/components/batch-editor/index.d.ts +0 -1
  112. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +0 -1
  113. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +0 -1
  114. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
  115. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  116. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
  117. package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
  118. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +0 -1
  119. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  120. package/lib/components/dataSourceComponents/fields/index.d.ts +6 -7
  121. package/lib/components/date-picker/index.d.ts +0 -1
  122. package/lib/components/filter/index.d.ts +0 -1
  123. package/lib/components/iconfont/index.js +1 -1
  124. package/lib/components/lowCodePage/index.js +2 -1
  125. package/lib/components/page/index.d.ts +0 -1
  126. package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
  127. package/lib/components/pisellGoodPassCard/index.d.ts +0 -1
  128. package/lib/components/pisellGoodPassCard/index.js +4 -31
  129. package/lib/components/pisellInput/index.d.ts +0 -1
  130. package/lib/components/pisellModal/components/IpadModal/index.d.ts +0 -1
  131. package/lib/components/pisellModal/components/MobileModal/index.d.ts +0 -1
  132. package/lib/components/pisellModal/components/index.d.ts +0 -1
  133. package/lib/components/pisellToast/index.js +0 -3
  134. package/lib/components/pisellWalletPassCard/index.d.ts +0 -1
  135. package/lib/components/productCard/components/Header/index.js +11 -20
  136. package/lib/components/productCard/components/Header/index.less +0 -15
  137. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  138. package/lib/components/productCard/components/Sales/index.js +2 -2
  139. package/lib/components/productCard/index.d.ts +1 -3
  140. package/lib/components/productCard/index.js +2 -6
  141. package/lib/components/productCard/index.less +0 -6
  142. package/lib/components/select-time/index.d.ts +0 -1
  143. package/lib/components/table/Actions/component/ColumnsSetting/index.d.ts +0 -1
  144. package/lib/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
  145. package/lib/components/table/Actions/component/Group/index.d.ts +0 -1
  146. package/lib/components/table/Actions/index.d.ts +0 -1
  147. package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
  148. package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
  149. package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  150. package/lib/components/table/Table/SelectField/index.d.ts +0 -1
  151. package/lib/components/table/Table/fields/date/filterUtil/index.js +6 -3
  152. package/lib/components/table/Table/fields/date/index.d.ts +0 -1
  153. package/lib/components/table/Table/fields/image/Show/index.d.ts +0 -1
  154. package/lib/components/table/Table/fields/image/index.d.ts +0 -1
  155. package/lib/components/table/Table/fields/index.d.ts +2 -3
  156. package/lib/components/table/Table/fields/link/index.d.ts +0 -1
  157. package/lib/components/table/Table/fields/number/Show/index.d.ts +0 -1
  158. package/lib/components/table/Table/fields/number/index.d.ts +0 -1
  159. package/lib/components/table/Table/fields/numberRange/Show/index.d.ts +0 -1
  160. package/lib/components/table/Table/fields/numberRange/index.d.ts +0 -1
  161. package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +0 -1
  162. package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +0 -1
  163. package/lib/components/table/Table/fields/pSwitch/index.d.ts +0 -1
  164. package/lib/components/table/Table/fields/rangePicker/filterUtil/index.js +8 -4
  165. package/lib/components/table/Table/fields/rangePicker/index.d.ts +0 -1
  166. package/lib/components/table/Table/fields/search/Show/index.d.ts +0 -1
  167. package/lib/components/table/Table/fields/search/index.d.ts +0 -1
  168. package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  169. package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
  170. package/lib/components/table/Table/fields/text/index.d.ts +0 -1
  171. package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  172. package/lib/components/table/Table/fields/utils/index.js +2 -1
  173. package/lib/components/table/Table/utils.d.ts +1 -1
  174. package/lib/components/versionSelect/index.d.ts +0 -1
  175. package/lib/components/virtual-keyboard/index.d.ts +0 -11
  176. package/lib/components/virtual-keyboard/index.js +2 -60
  177. package/lib/components/virtual-keyboard/index.less +1 -33
  178. package/lib/hooks/useResponsive.js +6 -3
  179. package/lib/utils/index.d.ts +1 -1
  180. package/lowcode/_setters/antd-icon-setter/index.tsx +2 -3
  181. package/lowcode/virtual-keyboard/meta.ts +0 -131
  182. package/package.json +3 -5
  183. package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -21
  184. package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +0 -73
  185. package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +0 -113
  186. package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +0 -2
  187. package/es/components/productCard/cartSkuCard/components/discountReason/index.js +0 -51
  188. package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +0 -4
  189. package/es/components/productCard/cartSkuCard/components/holders/index.js +0 -32
  190. package/es/components/productCard/cartSkuCard/components/holders/index.less +0 -32
  191. package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +0 -10
  192. package/es/components/productCard/cartSkuCard/components/packages/index.js +0 -52
  193. package/es/components/productCard/cartSkuCard/components/packages/index.less +0 -22
  194. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +0 -20
  195. package/es/components/productCard/cartSkuCard/components/packages/utils.js +0 -40
  196. package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -4
  197. package/es/components/productCard/cartSkuCard/components/resources/index.js +0 -44
  198. package/es/components/productCard/cartSkuCard/components/resources/index.less +0 -20
  199. package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +0 -11
  200. package/es/components/productCard/cartSkuCard/components/sales/index.js +0 -55
  201. package/es/components/productCard/cartSkuCard/components/sales/index.less +0 -22
  202. package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -3
  203. package/es/components/productCard/cartSkuCard/components/specs/index.js +0 -43
  204. package/es/components/productCard/cartSkuCard/components/specs/index.less +0 -28
  205. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +0 -45
  206. package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +0 -292
  207. package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +0 -35
  208. package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -7
  209. package/es/components/productCard/cartSkuCard/components/timeRange/index.js +0 -53
  210. package/es/components/productCard/cartSkuCard/components/timeRange/index.less +0 -37
  211. package/es/components/productCard/cartSkuCard/index.d.ts +0 -10
  212. package/es/components/productCard/cartSkuCard/index.js +0 -216
  213. package/es/components/productCard/cartSkuCard/index.less +0 -69
  214. package/es/components/productCard/cartSkuCard/locales.d.ts +0 -96
  215. package/es/components/productCard/cartSkuCard/locales.js +0 -30
  216. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -21
  217. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +0 -79
  218. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +0 -113
  219. package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +0 -2
  220. package/lib/components/productCard/cartSkuCard/components/discountReason/index.js +0 -70
  221. package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +0 -4
  222. package/lib/components/productCard/cartSkuCard/components/holders/index.js +0 -52
  223. package/lib/components/productCard/cartSkuCard/components/holders/index.less +0 -32
  224. package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +0 -10
  225. package/lib/components/productCard/cartSkuCard/components/packages/index.js +0 -73
  226. package/lib/components/productCard/cartSkuCard/components/packages/index.less +0 -22
  227. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +0 -20
  228. package/lib/components/productCard/cartSkuCard/components/packages/utils.js +0 -44
  229. package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -4
  230. package/lib/components/productCard/cartSkuCard/components/resources/index.js +0 -73
  231. package/lib/components/productCard/cartSkuCard/components/resources/index.less +0 -20
  232. package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +0 -11
  233. package/lib/components/productCard/cartSkuCard/components/sales/index.js +0 -76
  234. package/lib/components/productCard/cartSkuCard/components/sales/index.less +0 -22
  235. package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -3
  236. package/lib/components/productCard/cartSkuCard/components/specs/index.js +0 -65
  237. package/lib/components/productCard/cartSkuCard/components/specs/index.less +0 -28
  238. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +0 -45
  239. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +0 -339
  240. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +0 -35
  241. package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -7
  242. package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +0 -67
  243. package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +0 -37
  244. package/lib/components/productCard/cartSkuCard/index.d.ts +0 -10
  245. package/lib/components/productCard/cartSkuCard/index.js +0 -234
  246. package/lib/components/productCard/cartSkuCard/index.less +0 -69
  247. package/lib/components/productCard/cartSkuCard/locales.d.ts +0 -96
  248. package/lib/components/productCard/cartSkuCard/locales.js +0 -61
@@ -1,339 +0,0 @@
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
- function getWidth(ref2) {
114
- const element = ref2.current;
115
- if (!element) return 0;
116
- return element.offsetWidth;
117
- }
118
- function getLeftWidth() {
119
- return getWidth(leftRef);
120
- }
121
- function getRightWidth() {
122
- return getWidth(rightRef);
123
- }
124
- const [{ x }, api] = (0, import_web.useSpring)(
125
- () => ({
126
- x: 0,
127
- config: { tension: 200, friction: 30 }
128
- }),
129
- []
130
- );
131
- const draggingRef = (0, import_react.useRef)(false);
132
- const dragCancelRef = (0, import_react.useRef)(null);
133
- function forceCancelDrag() {
134
- var _a;
135
- (_a = dragCancelRef.current) == null ? void 0 : _a.call(dragCancelRef);
136
- draggingRef.current = false;
137
- }
138
- const bind = (0, import_use_gesture_react.useDrag)(
139
- (state) => {
140
- var _a;
141
- dragCancelRef.current = state.cancel;
142
- if (!state.intentional) return;
143
- if (state.down) {
144
- draggingRef.current = true;
145
- }
146
- if (!draggingRef.current) return;
147
- const [offsetX] = state.offset;
148
- if (state.last) {
149
- const leftWidth = getLeftWidth();
150
- const rightWidth = getRightWidth();
151
- let position = offsetX + state.velocity[0] * state.direction[0] * 50;
152
- if (offsetX > 0) {
153
- position = Math.max(0, position);
154
- } else if (offsetX < 0) {
155
- position = Math.min(0, position);
156
- } else {
157
- position = 0;
158
- }
159
- const targetX = nearest([-rightWidth, 0, leftWidth], position);
160
- api.start({
161
- x: targetX
162
- });
163
- if (targetX !== 0) {
164
- (_a = p.onActionsReveal) == null ? void 0 : _a.call(p, targetX > 0 ? "left" : "right");
165
- }
166
- window.setTimeout(() => {
167
- draggingRef.current = false;
168
- });
169
- } else {
170
- api.start({
171
- x: offsetX,
172
- immediate: true
173
- });
174
- }
175
- },
176
- {
177
- from: () => [x.get(), 0],
178
- bounds: () => {
179
- const leftWidth = getLeftWidth();
180
- const rightWidth = getRightWidth();
181
- return {
182
- left: -rightWidth,
183
- right: leftWidth
184
- };
185
- },
186
- axis: "x",
187
- preventScroll: true,
188
- pointer: { touch: true },
189
- triggerAllEvents: true
190
- }
191
- );
192
- const close = () => {
193
- var _a;
194
- api.start({
195
- x: 0
196
- });
197
- forceCancelDrag();
198
- (_a = props.onClose) == null ? void 0 : _a.call(props);
199
- };
200
- (0, import_react.useImperativeHandle)(ref, () => ({
201
- show: (side = "right") => {
202
- var _a;
203
- if (side === "right") {
204
- api.start({
205
- x: -getRightWidth()
206
- });
207
- } else if (side === "left") {
208
- api.start({
209
- x: getLeftWidth()
210
- });
211
- }
212
- (_a = p.onActionsReveal) == null ? void 0 : _a.call(p, side);
213
- },
214
- close
215
- }));
216
- (0, import_react.useEffect)(() => {
217
- if (!props.closeOnTouchOutside) return;
218
- function handle(e) {
219
- if (e.target && props.escapeDom) {
220
- const container = document.querySelector(props.escapeDom);
221
- if (container == null ? void 0 : container.contains(e.target)) return;
222
- }
223
- if (x.get() === 0) {
224
- return;
225
- }
226
- const root = rootRef.current;
227
- if (root && !root.contains(e.target)) {
228
- close();
229
- }
230
- }
231
- if ("ontouchstart" in window) {
232
- document.addEventListener("touchstart", handle);
233
- } else {
234
- document.addEventListener("mousedown", handle);
235
- }
236
- return () => {
237
- document.removeEventListener("touchstart", handle);
238
- document.removeEventListener("mousedown", handle);
239
- };
240
- }, [props.closeOnTouchOutside, props.escapeDom]);
241
- function renderAction(action) {
242
- const color = action.color ?? "light";
243
- const _style = action.style || {};
244
- return /* @__PURE__ */ import_react.default.createElement(
245
- Button,
246
- {
247
- key: action.key,
248
- className: `${classPrefix}-action-button`,
249
- style: {
250
- "--background-color": colorRecord[color] ?? color,
251
- ..._style
252
- },
253
- onClick: (e) => {
254
- var _a, _b;
255
- if (props.closeOnAction) {
256
- close();
257
- }
258
- (_a = action.onClick) == null ? void 0 : _a.call(action, e);
259
- (_b = props.onAction) == null ? void 0 : _b.call(props, action, e);
260
- }
261
- },
262
- action.text
263
- );
264
- }
265
- return withNativeProps(
266
- props,
267
- /* @__PURE__ */ import_react.default.createElement(
268
- "div",
269
- {
270
- className: classPrefix,
271
- ...bind(),
272
- ref: rootRef,
273
- onClickCapture: (e) => {
274
- if (draggingRef.current) {
275
- e.stopPropagation();
276
- e.preventDefault();
277
- }
278
- }
279
- },
280
- /* @__PURE__ */ import_react.default.createElement(import_web.animated.div, { className: `${classPrefix}-track`, style: { x } }, withStopPropagation(
281
- props.stopPropagation,
282
- /* @__PURE__ */ import_react.default.createElement(
283
- "div",
284
- {
285
- className: `${classPrefix}-actions ${classPrefix}-actions-left`,
286
- ref: leftRef
287
- },
288
- props.leftActions.map(renderAction)
289
- )
290
- ), /* @__PURE__ */ import_react.default.createElement(
291
- "div",
292
- {
293
- className: `${classPrefix}-content`,
294
- onClickCapture: (e) => {
295
- if (x.goal !== 0) {
296
- e.preventDefault();
297
- e.stopPropagation();
298
- close();
299
- }
300
- }
301
- },
302
- /* @__PURE__ */ import_react.default.createElement(
303
- import_web.animated.div,
304
- {
305
- style: {
306
- pointerEvents: x.to(
307
- (v) => v !== 0 && x.goal !== 0 ? "none" : "auto"
308
- )
309
- }
310
- },
311
- props.children
312
- )
313
- ), withStopPropagation(
314
- props.stopPropagation,
315
- /* @__PURE__ */ import_react.default.createElement(
316
- "div",
317
- {
318
- className: `${classPrefix}-actions ${classPrefix}-actions-right`,
319
- ref: rightRef
320
- },
321
- props.rightActions.map(renderAction)
322
- )
323
- ))
324
- )
325
- );
326
- }
327
- );
328
- var colorRecord = {
329
- light: "#ccc",
330
- weak: "#999",
331
- primary: "#1677ff",
332
- success: "#00b578",
333
- warning: "#ff8f1f",
334
- danger: "#ff3141"
335
- };
336
- // Annotate the CommonJS export names for ESM import in node:
337
- 0 && (module.exports = {
338
- SwipeAction
339
- });
@@ -1,35 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import 'dayjs/locale/zh-cn';
3
- import 'dayjs/locale/en';
4
- import 'dayjs/locale/zh-tw';
5
- import './index.less';
6
- declare const TimeRange: (props: any) => JSX.Element | null;
7
- export default TimeRange;
@@ -1,67 +0,0 @@
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/timeRange/index.tsx
30
- var timeRange_exports = {};
31
- __export(timeRange_exports, {
32
- default: () => timeRange_default
33
- });
34
- module.exports = __toCommonJS(timeRange_exports);
35
- var import_iconfont = __toESM(require("../../../../iconfont"));
36
- var import_react = __toESM(require("react"));
37
- var import_antd = require("antd");
38
- var import_dayjs = __toESM(require("dayjs"));
39
- var import_zh_cn = require("dayjs/locale/zh-cn");
40
- var import_en = require("dayjs/locale/en");
41
- var import_zh_tw = require("dayjs/locale/zh-tw");
42
- var import_index = require("./index.less");
43
- var import__ = require("../../index");
44
- var localeTypes = {
45
- "en-US": "en",
46
- "zh-CN": "zh-cn",
47
- "zh-HK": "zh-tw"
48
- };
49
- var TimeRange = (props) => {
50
- const { dataSource = {} } = props;
51
- const { start_date, end_date, locale = "en-US" } = dataSource;
52
- if (!(0, import_dayjs.default)(start_date).isValid() || !(0, import_dayjs.default)(end_date).isValid()) return null;
53
- (0, import_react.useEffect)(() => {
54
- import_dayjs.default.locale(localeTypes[locale]);
55
- }, [locale]);
56
- const isEn = (0, import_react.useMemo)(() => {
57
- return locale === "en-US" || locale === "en";
58
- }, [locale]);
59
- const _format = (0, import_react.useMemo)(() => {
60
- return isEn ? "HH:mm DD/MM/YYYY" : "YYYY-MM-DD HH:mm";
61
- }, [isEn]);
62
- const renderTimeItem = (time) => {
63
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "time-range-item" }, /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { className: "time-icon", type: "pisell2-clock" }), /* @__PURE__ */ import_react.default.createElement("span", { className: "time-str" }, (0, import_dayjs.default)(time).format(_format)));
64
- };
65
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: "4px 0" } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__time-range` }, renderTimeItem(start_date), /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { className: "joint-icon", type: "pisell2-arrow-right" }), renderTimeItem(end_date)));
66
- };
67
- var timeRange_default = TimeRange;
@@ -1,37 +0,0 @@
1
- .pisell-cart-sku-card__time-range {
2
- user-select: none;
3
-
4
- display: flex;
5
- align-items: center;
6
- gap: 8px;
7
- overflow: hidden;
8
-
9
- .joint-icon {
10
- font-size: 16px;
11
- color: #7f56da;
12
- }
13
-
14
- .time-range-item {
15
- white-space: nowrap;
16
- display: flex;
17
- gap: 8px;
18
- align-items: center;
19
- overflow: hidden;
20
-
21
- .time-icon {
22
- font-size: 16px;
23
- color: #7f56da;
24
- }
25
-
26
- .time-str {
27
- color: #667085;
28
- font-size: 14px;
29
- font-weight: 400;
30
- line-height: 20px;
31
- display: inline-block;
32
- white-space: nowrap;
33
- overflow: hidden;
34
- text-overflow: ellipsis;
35
- }
36
- }
37
- }
@@ -1,10 +0,0 @@
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;