@pisell/materials 6.2.24 → 6.2.26

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 (178) 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 +7 -7
  6. package/build/lowcode/preview.js +146 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +36 -27
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +41 -32
  11. package/es/components/DragSortList/index.js +6 -6
  12. package/es/components/classicLayout/index.js +4 -5
  13. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  14. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  15. package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
  16. package/es/components/icon/index.js +5 -5
  17. package/es/components/iconfont/index.js +1 -1
  18. package/es/components/list/index.js +6 -6
  19. package/es/components/pisellAdjustPrice/index.js +64 -8
  20. package/es/components/pisellAdjustPrice/index.less +35 -6
  21. package/es/components/pisellAdjustPrice/status.js +32 -0
  22. package/es/components/pisellAdjustPrice/type.js +1 -0
  23. package/es/components/pisellToast/index.js +3 -0
  24. package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +61 -0
  25. package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +98 -0
  26. package/es/components/productCard/cartSkuCard/components/discountReason/index.js +51 -0
  27. package/es/components/productCard/cartSkuCard/components/holders/index.js +32 -0
  28. package/es/components/productCard/cartSkuCard/components/holders/index.less +32 -0
  29. package/es/components/productCard/cartSkuCard/components/packages/index.js +52 -0
  30. package/es/components/productCard/cartSkuCard/components/packages/index.less +22 -0
  31. package/es/components/productCard/cartSkuCard/components/packages/utils.js +40 -0
  32. package/es/components/productCard/cartSkuCard/components/resources/index.js +44 -0
  33. package/es/components/productCard/cartSkuCard/components/resources/index.less +20 -0
  34. package/es/components/productCard/cartSkuCard/components/sales/index.js +55 -0
  35. package/es/components/productCard/cartSkuCard/components/sales/index.less +22 -0
  36. package/es/components/productCard/cartSkuCard/components/specs/index.js +43 -0
  37. package/es/components/productCard/cartSkuCard/components/specs/index.less +28 -0
  38. package/es/components/productCard/cartSkuCard/components/timeRange/index.js +53 -0
  39. package/es/components/productCard/cartSkuCard/components/timeRange/index.less +37 -0
  40. package/es/components/productCard/cartSkuCard/index.js +195 -0
  41. package/es/components/productCard/cartSkuCard/index.less +69 -0
  42. package/es/components/productCard/cartSkuCard/locales.js +30 -0
  43. package/es/components/productCard/components/Header/index.js +4 -3
  44. package/es/components/productCard/components/Sales/index.js +2 -2
  45. package/es/components/productCard/index.js +2 -0
  46. package/es/components/qrcode/index.js +1 -1
  47. package/es/components/sort/components/InlineMenu/index.js +1 -1
  48. package/es/components/table/Actions/component/ButtonIcon/index.js +5 -5
  49. package/es/components/table/Actions/component/ViewMode/index.js +1 -1
  50. package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.js +4 -5
  51. package/es/components/table/Header/Buttons/index.js +5 -5
  52. package/es/components/table/Table/AddFieldModal/index.js +6 -6
  53. package/es/components/table/Table/SelectField/index.js +4 -4
  54. package/es/components/table/Table/fields/date/Edit/index.js +1 -1
  55. package/es/components/table/Table/fields/link/Edit/index.js +5 -5
  56. package/es/components/table/Table/fields/rangePicker/filterUtil/index.js +1 -1
  57. package/es/components/table/Table/fields/search/filterUtil/index.js +0 -1
  58. package/es/components/table/Table/fields/text/Show/index.js +4 -4
  59. package/es/components/table/Table/fields/text/filterUtil/index.js +0 -1
  60. package/es/components/table/Table/tableConfig/SortRow/index.js +2 -2
  61. package/es/components/table/Table/tableConfig/body/CellContent/index.js +3 -3
  62. package/es/components/table/Table/tableConfig/body/CellProvider/index.js +8 -8
  63. package/es/components/table/Table/utils.d.ts +1 -1
  64. package/es/components/table/hooks/useMergeColumnSetting.js +1 -2
  65. package/es/components/table/hooks/useTransDataSourceGroupSetting.js +5 -5
  66. package/es/components/table/hooks/useTransFilterSetting.js +5 -5
  67. package/es/components/translation/utils.js +5 -5
  68. package/es/components/virtual-keyboard/Amount/index.js +79 -7
  69. package/es/components/virtual-keyboard/Amount/index.less +39 -0
  70. package/es/components/virtual-keyboard/Amount/themeConfig.js +32 -0
  71. package/es/components/virtual-keyboard/Amount/types.js +1 -0
  72. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +38 -10
  73. package/es/components/virtual-keyboard/Keyboard/index.js +2 -2
  74. package/es/components/virtual-keyboard/Number/index.js +77 -7
  75. package/es/components/virtual-keyboard/Number/index.less +39 -0
  76. package/es/components/virtual-keyboard/Number/themeConfig.js +32 -0
  77. package/es/components/virtual-keyboard/Number/types.js +1 -0
  78. package/es/components/virtual-keyboard/VirtualKeyInput/index.js +10 -3
  79. package/es/components/virtual-keyboard/index.js +88 -3
  80. package/es/components/virtual-keyboard/index.less +33 -1
  81. package/es/hooks/useResponsive.js +2 -2
  82. package/es/utils/hoc.js +1 -1
  83. package/es/utils/miniRedux.js +8 -9
  84. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  85. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  86. package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
  87. package/lib/components/iconfont/index.js +1 -1
  88. package/lib/components/lowCodePage/index.js +1 -2
  89. package/lib/components/pisellAdjustPrice/index.js +119 -57
  90. package/lib/components/pisellAdjustPrice/index.less +35 -6
  91. package/lib/components/pisellAdjustPrice/status.js +60 -0
  92. package/lib/components/pisellAdjustPrice/type.js +17 -0
  93. package/lib/components/pisellToast/index.js +3 -0
  94. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +71 -0
  95. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +98 -0
  96. package/lib/components/productCard/cartSkuCard/components/discountReason/index.js +70 -0
  97. package/lib/components/productCard/cartSkuCard/components/holders/index.js +52 -0
  98. package/lib/components/productCard/cartSkuCard/components/holders/index.less +32 -0
  99. package/lib/components/productCard/cartSkuCard/components/packages/index.js +73 -0
  100. package/lib/components/productCard/cartSkuCard/components/packages/index.less +22 -0
  101. package/lib/components/productCard/cartSkuCard/components/packages/utils.js +44 -0
  102. package/lib/components/productCard/cartSkuCard/components/resources/index.js +73 -0
  103. package/lib/components/productCard/cartSkuCard/components/resources/index.less +20 -0
  104. package/lib/components/productCard/cartSkuCard/components/sales/index.js +76 -0
  105. package/lib/components/productCard/cartSkuCard/components/sales/index.less +22 -0
  106. package/lib/components/productCard/cartSkuCard/components/specs/index.js +65 -0
  107. package/lib/components/productCard/cartSkuCard/components/specs/index.less +28 -0
  108. package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +67 -0
  109. package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +37 -0
  110. package/lib/components/productCard/cartSkuCard/index.js +216 -0
  111. package/lib/components/productCard/cartSkuCard/index.less +69 -0
  112. package/lib/components/productCard/cartSkuCard/locales.js +61 -0
  113. package/lib/components/productCard/components/Header/index.js +4 -3
  114. package/lib/components/productCard/components/Sales/index.js +2 -2
  115. package/lib/components/productCard/index.js +2 -0
  116. package/lib/components/table/Table/fields/date/filterUtil/index.js +3 -6
  117. package/lib/components/table/Table/fields/rangePicker/filterUtil/index.js +4 -8
  118. package/lib/components/table/Table/fields/utils/index.js +1 -2
  119. package/lib/components/table/Table/utils.d.ts +1 -1
  120. package/lib/components/virtual-keyboard/Amount/index.js +72 -16
  121. package/lib/components/virtual-keyboard/Amount/index.less +39 -0
  122. package/lib/components/virtual-keyboard/Amount/themeConfig.js +60 -0
  123. package/lib/components/virtual-keyboard/Amount/types.js +17 -0
  124. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +31 -8
  125. package/lib/components/virtual-keyboard/Keyboard/index.js +2 -1
  126. package/lib/components/virtual-keyboard/Number/index.js +65 -11
  127. package/lib/components/virtual-keyboard/Number/index.less +39 -0
  128. package/lib/components/virtual-keyboard/Number/themeConfig.js +60 -0
  129. package/lib/components/virtual-keyboard/Number/types.js +17 -0
  130. package/lib/components/virtual-keyboard/VirtualKeyInput/index.js +34 -20
  131. package/lib/components/virtual-keyboard/index.js +60 -2
  132. package/lib/components/virtual-keyboard/index.less +33 -1
  133. package/lib/hooks/useResponsive.js +3 -6
  134. package/lowcode/_setters/antd-icon-setter/index.tsx +3 -2
  135. package/lowcode/pisell-adjust-price/meta.ts +168 -0
  136. package/lowcode/pisell-adjust-price/snippets.ts +1 -0
  137. package/lowcode/pisell-number-keyboard/meta.ts +167 -0
  138. package/lowcode/pisell-price-keyboard/meta.ts +167 -0
  139. package/lowcode/virtual-keyboard/meta.ts +131 -0
  140. package/package.json +1 -1
  141. package/dist/umd/materials.min.css +0 -1
  142. package/dist/umd/materials.min.js +0 -1
  143. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  144. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  145. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  146. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  147. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  148. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
  149. package/es/components/iconfont/index.d.ts +0 -8
  150. package/es/components/pisellAdjustPrice/index.d.ts +0 -9
  151. package/es/components/pisellToast/index.d.ts +0 -16
  152. package/es/components/productCard/components/Header/index.d.ts +0 -3
  153. package/es/components/productCard/components/Sales/index.d.ts +0 -3
  154. package/es/components/productCard/index.d.ts +0 -5
  155. package/es/components/productCard/locales.d.ts +0 -84
  156. package/es/components/productCard/status.d.ts +0 -32
  157. package/es/components/productCard/types.d.ts +0 -84
  158. package/es/components/virtual-keyboard/Amount/index.d.ts +0 -22
  159. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -19
  160. package/es/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
  161. package/es/components/virtual-keyboard/Number/index.d.ts +0 -13
  162. package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -11
  163. package/es/components/virtual-keyboard/index.d.ts +0 -14
  164. package/lib/components/iconfont/index.d.ts +0 -8
  165. package/lib/components/pisellAdjustPrice/index.d.ts +0 -9
  166. package/lib/components/pisellToast/index.d.ts +0 -16
  167. package/lib/components/productCard/components/Header/index.d.ts +0 -3
  168. package/lib/components/productCard/components/Sales/index.d.ts +0 -3
  169. package/lib/components/productCard/index.d.ts +0 -5
  170. package/lib/components/productCard/locales.d.ts +0 -84
  171. package/lib/components/productCard/status.d.ts +0 -32
  172. package/lib/components/productCard/types.d.ts +0 -84
  173. package/lib/components/virtual-keyboard/Amount/index.d.ts +0 -22
  174. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -19
  175. package/lib/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
  176. package/lib/components/virtual-keyboard/Number/index.d.ts +0 -13
  177. package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -11
  178. package/lib/components/virtual-keyboard/index.d.ts +0 -14
@@ -0,0 +1,51 @@
1
+ import React, { useMemo } from 'react';
2
+ import { Divider, Tag } from 'antd';
3
+ import { locales } from '@pisell/utils';
4
+ import { PREFIX } from "../../index";
5
+ var DiscountReason = function DiscountReason(props) {
6
+ var _props$dataSource = props.dataSource,
7
+ dataSource = _props$dataSource === void 0 ? {} : _props$dataSource,
8
+ hideDivider = props.hideDivider;
9
+ var total = dataSource.total,
10
+ origin_total = dataSource.origin_total,
11
+ symbol = dataSource.symbol,
12
+ tip = dataSource.tip,
13
+ num = dataSource.num,
14
+ discount_reason = dataSource.discount_reason;
15
+ var isDiscount = useMemo(function () {
16
+ // item中没有该属性则不展示
17
+ if (!origin_total) return false;
18
+ return Number(total) != Number(origin_total);
19
+ }, [total, origin_total]);
20
+ var renderDivider = function renderDivider() {
21
+ return isDiscount && discount_reason && !hideDivider ? /*#__PURE__*/React.createElement(Divider, {
22
+ style: {
23
+ margin: '4px 0'
24
+ }
25
+ }) : null;
26
+ };
27
+ var renderDiscountReason = function renderDiscountReason() {
28
+ if (isDiscount && discount_reason) {
29
+ if (Array.isArray(discount_reason)) {
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ className: "".concat(PREFIX, "_discount-reason"),
32
+ style: {
33
+ display: 'flex',
34
+ flexWrap: 'wrap',
35
+ gap: '4px'
36
+ }
37
+ }, discount_reason.map(function (reason, index) {
38
+ return /*#__PURE__*/React.createElement(Tag, {
39
+ key: index,
40
+ color: "red"
41
+ }, reason);
42
+ }));
43
+ }
44
+ return /*#__PURE__*/React.createElement("div", {
45
+ className: "".concat(PREFIX, "_discount-reason")
46
+ }, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat(discount_reason)));
47
+ }
48
+ };
49
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderDivider(), renderDiscountReason());
50
+ };
51
+ export default DiscountReason;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import Iconfont from "../../../../iconfont";
3
+ import { PREFIX } from "../../index";
4
+ import "./index.less";
5
+ var Holders = function Holders(props) {
6
+ var _props$dataSource = props.dataSource,
7
+ dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
8
+ var holders = dataSource.holders,
9
+ holder_id = dataSource.holder_id;
10
+ if (!holder_id) return null;
11
+ var renderHolder = function renderHolder(id) {
12
+ if (!id) return null;
13
+ var holder = holders.find(function (item) {
14
+ return item.id === id;
15
+ });
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ className: "holder-item",
18
+ key: id
19
+ }, /*#__PURE__*/React.createElement(Iconfont, {
20
+ className: "holder-icon",
21
+ type: "pisell2-user-check-01"
22
+ }), /*#__PURE__*/React.createElement("span", {
23
+ className: "holder-label"
24
+ }, (holder === null || holder === void 0 ? void 0 : holder.label) || id));
25
+ };
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ className: "".concat(PREFIX, "__holders")
28
+ }, Array.isArray(holder_id) ? holder_id === null || holder_id === void 0 ? void 0 : holder_id.map(function (id) {
29
+ return renderHolder(id);
30
+ }) : renderHolder(holder_id));
31
+ };
32
+ export default Holders;
@@ -0,0 +1,32 @@
1
+ .pisell-cart-sku-card__holders {
2
+ user-select: none;
3
+
4
+ display: flex;
5
+ gap: 16px;
6
+ overflow: hidden;
7
+
8
+ .holder-item {
9
+ overflow: hidden;
10
+ white-space: nowrap;
11
+ display: flex;
12
+ align-items: center;
13
+ min-width: 30px;
14
+
15
+ .holder-icon {
16
+ font-size: 16px;
17
+ color: #7f56da;
18
+ margin-right: 2;
19
+ }
20
+
21
+ .holder-label {
22
+ color: #667085;
23
+ font-size: 14px;
24
+ font-weight: 500;
25
+ line-height: 20px;
26
+ display: inline-block;
27
+ overflow: hidden;
28
+ text-overflow: ellipsis;
29
+ white-space: nowrap;
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,52 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ import React from 'react';
8
+ import { Divider } from 'antd';
9
+ import { locales } from '@pisell/utils';
10
+ import CollapsibleList from "../../../components/Packages/components/collapsibleList";
11
+ import BasicInfo from "../basicInfo";
12
+ import { PREFIX } from "../../index";
13
+ import "./index.less";
14
+ var Packages = function Packages(_ref) {
15
+ var isShowImage = _ref.isShowImage,
16
+ _ref$dataSource = _ref.dataSource,
17
+ dataSource = _ref$dataSource === void 0 ? {} : _ref$dataSource;
18
+ var _dataSource$bundle = dataSource.bundle,
19
+ bundle = _dataSource$bundle === void 0 ? [] : _dataSource$bundle,
20
+ _dataSource$symbol = dataSource.symbol,
21
+ symbol = _dataSource$symbol === void 0 ? '$' : _dataSource$symbol;
22
+ return (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
23
+ style: {
24
+ margin: '4px 0'
25
+ }
26
+ }), /*#__PURE__*/React.createElement("div", {
27
+ className: "".concat(PREFIX, "__packages-wrap")
28
+ }, /*#__PURE__*/React.createElement("div", {
29
+ className: "packages-title"
30
+ }, locales.getText('pisell2.cart.sku-card.packages.title')), /*#__PURE__*/React.createElement(CollapsibleList, {
31
+ style: {
32
+ marginTop: 4
33
+ },
34
+ list: bundle || [],
35
+ renderItem: function renderItem(item) {
36
+ return /*#__PURE__*/React.createElement(BasicInfo, {
37
+ isShowImage: isShowImage,
38
+ dataSource: _objectSpread(_objectSpread({}, item), {}, {
39
+ name: item.title,
40
+ image: item.cover,
41
+ symbol: symbol
42
+ }),
43
+ style: {
44
+ border: '1px solid #D0D5DD',
45
+ borderRadius: 4,
46
+ padding: 4
47
+ }
48
+ });
49
+ }
50
+ }))) : null;
51
+ };
52
+ export default Packages;
@@ -0,0 +1,22 @@
1
+ .pisell-cart-sku-card__packages-wrap {
2
+ padding: 0 4px;
3
+
4
+ .packages-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,40 @@
1
+ import { formatAmount } from '@pisell/utils';
2
+
3
+ /**
4
+ * @title: 金额是否是负
5
+ * @description:
6
+ * @param {string} type
7
+ * @return {*}
8
+ * @Author: WangHan
9
+ * @Date: 2024-11-22 10:01
10
+ */
11
+ export var minusSign = function minusSign(item, type) {
12
+ // 单个商品 + 单规格价格之后的价格
13
+ if (type === 'total') {
14
+ var _price2 = (item === null || item === void 0 ? void 0 : item.bundle_sum_price) || 0;
15
+ var _isMarkdown = (item === null || item === void 0 ? void 0 : item.bundle_sum_type) === 'markdown';
16
+ return _price2 > 0 && _isMarkdown ? '-' : '';
17
+ }
18
+
19
+ // 单个商品的价格
20
+ var _price = (item === null || item === void 0 ? void 0 : item.price) || 0;
21
+ var isMarkdown = (item === null || item === void 0 ? void 0 : item.price_type) === 'markdown';
22
+ return _price > 0 && isMarkdown ? '-' : '';
23
+ };
24
+
25
+ /**
26
+ * @title: 金额格式化
27
+ * @description:
28
+ * @param {number} price
29
+ * @param {string} amountSymbol
30
+ * @param {number} digit
31
+ * @return {*}
32
+ * @Author: WangHan
33
+ * @Date: 2024-11-22 10:58
34
+ */
35
+ export var _formatAmount = function _formatAmount() {
36
+ var price = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
37
+ var amountSymbol = arguments.length > 1 ? arguments[1] : undefined;
38
+ var digit = arguments.length > 2 ? arguments[2] : undefined;
39
+ return formatAmount(price, digit, amountSymbol);
40
+ };
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { Tag } from 'antd';
3
+ import "./index.less";
4
+ import { PREFIX } from "../../index";
5
+ var colors = ['magenta', 'volcano', 'orange', 'gold', 'green', 'cyan', 'blue', 'geekblue', 'purple'];
6
+ function getColor(n) {
7
+ // 用质数扰动 + 取余
8
+ return colors[n * 31 % colors.length];
9
+ }
10
+ var Resources = function Resources(props) {
11
+ var _props$dataSource = props.dataSource,
12
+ dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
13
+ var multiResources = dataSource.multiResources,
14
+ isMultipleResource = dataSource.isMultipleResource;
15
+ var renderResourceItem = function renderResourceItem(item, index) {
16
+ var ids = item.id,
17
+ lists = item.lists,
18
+ _id = item._id;
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ className: "resource-item",
21
+ key: _id
22
+ }, Array.isArray(ids) ? ids.map(function (id) {
23
+ var targetRes = lists.find(function (l) {
24
+ return l.id === id;
25
+ });
26
+ if (targetRes !== null && targetRes !== void 0 && targetRes.label) {
27
+ return /*#__PURE__*/React.createElement(Tag, {
28
+ color: getColor(_id),
29
+ className: "resource-tag"
30
+ }, targetRes.label);
31
+ }
32
+ return null;
33
+ }) : null);
34
+ };
35
+ var renderContent = function renderContent() {
36
+ if (isMultipleResource && (multiResources === null || multiResources === void 0 ? void 0 : multiResources.length) > 0) {
37
+ return multiResources.map(renderResourceItem);
38
+ }
39
+ };
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: "".concat(PREFIX, "__resources")
42
+ }, renderContent());
43
+ };
44
+ export default Resources;
@@ -0,0 +1,20 @@
1
+ .pisell-cart-sku-card__resources {
2
+ margin-top: 4px;
3
+ display: flex;
4
+ flex-wrap: wrap;
5
+ gap: 4px;
6
+
7
+ .resource-item {
8
+ min-width: calc(50% - 2px);
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ gap: 4px;
12
+
13
+ .resource-tag {
14
+ max-width: 120px;
15
+ overflow: hidden;
16
+ text-overflow: ellipsis;
17
+ margin: 0;
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,55 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ import React from 'react';
8
+ import { Divider } from 'antd';
9
+ import CollapsibleList from "../../../components/Packages/components/collapsibleList";
10
+ import BasicInfo from "../basicInfo";
11
+ import { locales } from '@pisell/utils';
12
+ import { PREFIX } from "../../index";
13
+ import "./index.less";
14
+ var Sales = function Sales(_ref) {
15
+ var hideDivider = _ref.hideDivider,
16
+ dataSource = _ref.dataSource;
17
+ var _ref2 = dataSource || {},
18
+ _ref2$relation_produc = _ref2.relation_products,
19
+ relation_products = _ref2$relation_produc === void 0 ? [] : _ref2$relation_produc,
20
+ _ref2$symbol = _ref2.symbol,
21
+ symbol = _ref2$symbol === void 0 ? '$' : _ref2$symbol;
22
+
23
+ // 格式化商品数据
24
+ var other_products = relation_products.map(function (p) {
25
+ return _objectSpread(_objectSpread({}, p), {}, {
26
+ name: p === null || p === void 0 ? void 0 : p.product_title,
27
+ price: p === null || p === void 0 ? void 0 : p.payment_price,
28
+ symbol: symbol,
29
+ num: p === null || p === void 0 ? void 0 : p.product_quantity,
30
+ total: p === null || p === void 0 ? void 0 : p.payment_price
31
+ });
32
+ });
33
+ return (other_products === null || other_products === void 0 ? void 0 : other_products.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, hideDivider ? null : /*#__PURE__*/React.createElement(Divider, {
34
+ style: {
35
+ margin: '4px 0'
36
+ }
37
+ }), /*#__PURE__*/React.createElement("div", {
38
+ className: "".concat(PREFIX, "_sales-wrap")
39
+ }, /*#__PURE__*/React.createElement("div", {
40
+ className: "sales-title"
41
+ }, locales.getText('pisell2.cart.sku-card.sales.title')), /*#__PURE__*/React.createElement(CollapsibleList, {
42
+ list: other_products || [],
43
+ renderItem: function renderItem(item) {
44
+ return /*#__PURE__*/React.createElement(BasicInfo, {
45
+ style: {
46
+ border: '1px solid #D0D5DD',
47
+ borderRadius: 4,
48
+ padding: 4
49
+ },
50
+ dataSource: _objectSpread({}, item)
51
+ });
52
+ }
53
+ }))) : null;
54
+ };
55
+ export default Sales;
@@ -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,43 @@
1
+ import React from 'react';
2
+ import { locales } from '@pisell/utils';
3
+ import "./index.less";
4
+ import { PREFIX } from "../../index";
5
+ var Specs = function Specs(props) {
6
+ var _props$dataSource = props.dataSource,
7
+ dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
8
+ var bundle = dataSource.bundle,
9
+ options = dataSource.options,
10
+ product_option_string = dataSource.product_option_string,
11
+ symbol = dataSource.symbol;
12
+ var more = /*#__PURE__*/React.createElement("div", {
13
+ style: {
14
+ color: '#667085',
15
+ fontSize: 10
16
+ }
17
+ }, locales.getText('pisell2.cart.sku-card.more'));
18
+ if (Array.isArray(bundle) && (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0) {
19
+ var first = bundle[0];
20
+ return /*#__PURE__*/React.createElement("div", {
21
+ className: "".concat(PREFIX, "__specs")
22
+ }, /*#__PURE__*/React.createElement("div", null, first.title), bundle.length > 1 ? more : null);
23
+ }
24
+ if (product_option_string) {
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ className: "".concat(PREFIX, "__specs")
27
+ }, /*#__PURE__*/React.createElement("div", null, product_option_string), options.length > 1 ? more : null);
28
+ }
29
+ if (options.length > 0) {
30
+ var _first = options[0];
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ className: "".concat(PREFIX, "__specs")
33
+ }, /*#__PURE__*/React.createElement("div", {
34
+ className: "spec-item"
35
+ }, /*#__PURE__*/React.createElement("span", {
36
+ className: "spec-name"
37
+ }, _first.name), /*#__PURE__*/React.createElement("span", {
38
+ className: "spec-num"
39
+ }, symbol, _first.price, "x", _first.num)), options.length > 1 ? more : null);
40
+ }
41
+ return null;
42
+ };
43
+ export default Specs;
@@ -0,0 +1,28 @@
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
+ }
@@ -0,0 +1,53 @@
1
+ import Iconfont from "../../../../iconfont";
2
+ import React, { useEffect, useMemo } from 'react';
3
+ import { Divider } from 'antd';
4
+ import dayjs from 'dayjs';
5
+ import 'dayjs/locale/zh-cn';
6
+ import 'dayjs/locale/en';
7
+ import 'dayjs/locale/zh-tw';
8
+ import "./index.less";
9
+ import { PREFIX } from "../../index";
10
+ var localeTypes = {
11
+ 'en-US': 'en',
12
+ 'zh-CN': 'zh-cn',
13
+ 'zh-HK': 'zh-tw'
14
+ };
15
+ var TimeRange = function TimeRange(props) {
16
+ var _props$dataSource = props.dataSource,
17
+ dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
18
+ var start_date = dataSource.start_date,
19
+ end_date = dataSource.end_date,
20
+ _dataSource$locale = dataSource.locale,
21
+ locale = _dataSource$locale === void 0 ? 'en-US' : _dataSource$locale;
22
+ if (!dayjs(start_date).isValid() || !dayjs(end_date).isValid()) return null;
23
+ useEffect(function () {
24
+ dayjs.locale(localeTypes[locale]);
25
+ }, [locale]);
26
+ var isEn = useMemo(function () {
27
+ return locale === 'en-US' || locale === 'en';
28
+ }, [locale]);
29
+ var _format = useMemo(function () {
30
+ return isEn ? 'HH:mm DD/MM/YYYY' : 'YYYY-MM-DD HH:mm';
31
+ }, [isEn]);
32
+ var renderTimeItem = function renderTimeItem(time) {
33
+ return /*#__PURE__*/React.createElement("div", {
34
+ className: "time-range-item"
35
+ }, /*#__PURE__*/React.createElement(Iconfont, {
36
+ className: "time-icon",
37
+ type: "pisell2-clock"
38
+ }), /*#__PURE__*/React.createElement("span", {
39
+ className: "time-str"
40
+ }, dayjs(time).format(_format)));
41
+ };
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
43
+ style: {
44
+ margin: '4px 0'
45
+ }
46
+ }), /*#__PURE__*/React.createElement("div", {
47
+ className: "".concat(PREFIX, "__time-range")
48
+ }, renderTimeItem(start_date), /*#__PURE__*/React.createElement(Iconfont, {
49
+ className: "joint-icon",
50
+ type: "pisell2-arrow-right"
51
+ }), renderTimeItem(end_date)));
52
+ };
53
+ export default TimeRange;
@@ -0,0 +1,37 @@
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
+ }