@pisell/materials 6.6.7 → 6.6.8

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.
@@ -26,7 +26,9 @@ var BasicInfo = function BasicInfo(props) {
26
26
  _dataSource$num = dataSource.num,
27
27
  num = _dataSource$num === void 0 ? 1 : _dataSource$num,
28
28
  holder_id = dataSource.holder_id,
29
- isFormSubject = dataSource.isFormSubject;
29
+ isFormSubject = dataSource.isFormSubject,
30
+ _dataSource$totalDiff = dataSource.totalDifference,
31
+ totalDifference = _dataSource$totalDiff === void 0 ? 0 : _dataSource$totalDiff;
30
32
  var renderNumTag = function renderNumTag() {
31
33
  return /*#__PURE__*/React.createElement("div", {
32
34
  className: classNames("num-tag", {
@@ -87,7 +89,7 @@ var BasicInfo = function BasicInfo(props) {
87
89
  className: "product-amount"
88
90
  }, /*#__PURE__*/React.createElement("div", {
89
91
  className: "total-amont"
90
- }, formatAmount(total * num, 2, symbol)), origin_total && Number(total) !== Number(origin_total) ? /*#__PURE__*/React.createElement("div", {
92
+ }, formatAmount(total * num - (totalDifference !== null && totalDifference !== void 0 ? totalDifference : 0), 2, symbol)), origin_total && Number(total) !== Number(origin_total) ? /*#__PURE__*/React.createElement("div", {
91
93
  className: "origin-amount"
92
94
  }, formatAmount(origin_total * num, 2, symbol)) : null));
93
95
  };
@@ -17,7 +17,9 @@ var Footer = function Footer(_ref) {
17
17
  symbol = item.symbol,
18
18
  tip = item.tip,
19
19
  num = item.num,
20
- discount_reason = item.discount_reason;
20
+ discount_reason = item.discount_reason,
21
+ _item$totalDifference = item.totalDifference,
22
+ totalDifference = _item$totalDifference === void 0 ? 0 : _item$totalDifference;
21
23
  /**
22
24
  * @title: 折扣
23
25
  * @description:
@@ -69,6 +71,6 @@ var Footer = function Footer(_ref) {
69
71
  className: "".concat(prefix, "packages-product-footer-total")
70
72
  }, isDiscount ? /*#__PURE__*/React.createElement("span", {
71
73
  className: "".concat(prefix, "packages-product-footer-origin-total")
72
- }, _formatAmount(origin_total * num, symbol, 2)) : null, /*#__PURE__*/React.createElement("span", null, _formatAmount(total * num, symbol))))), renderDiscountReason());
74
+ }, _formatAmount(origin_total * num, symbol, 2)) : null, /*#__PURE__*/React.createElement("span", null, _formatAmount(total * num - (totalDifference !== null && totalDifference !== void 0 ? totalDifference : 0), symbol))))), renderDiscountReason());
73
75
  };
74
76
  export default Footer;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare type ColumnsSettingProps = {
2
3
  value?: Record<string, any>[];
3
4
  onChange?: (val: Record<string, any>[]) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: {
2
3
  field: {
3
4
  field_icon: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: {
2
3
  field: {
3
4
  field_icon: string;
@@ -53,7 +53,8 @@ var BasicInfo = (props) => {
53
53
  origin_total = 0,
54
54
  num = 1,
55
55
  holder_id,
56
- isFormSubject
56
+ isFormSubject,
57
+ totalDifference = 0
57
58
  } = dataSource;
58
59
  const renderNumTag = () => {
59
60
  return /* @__PURE__ */ import_react.default.createElement(
@@ -78,6 +79,6 @@ var BasicInfo = (props) => {
78
79
  if (type === "a5") {
79
80
  return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__basic-info`, style: style || {} }, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), (!holder_id || !(holder_id == null ? void 0 : holder_id.length)) && !isFormSubject ? /* @__PURE__ */ import_react.default.createElement("div", { className: `product-price` }, (0, import_utils.formatAmount)(price, 2, symbol)) : /* @__PURE__ */ import_react.default.createElement(import_holders.default, { dataSource })));
80
81
  }
81
- return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__basic-info`, style: style || {} }, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), hasSpecs ? /* @__PURE__ */ import_react.default.createElement(import_specs.default, { dataSource }) : /* @__PURE__ */ import_react.default.createElement("div", { className: `product-price` }, (0, import_utils.formatAmount)(price, 2, symbol))), /* @__PURE__ */ import_react.default.createElement("div", { className: `product-amount` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `total-amont` }, (0, import_utils.formatAmount)(total * num, 2, symbol)), origin_total && Number(total) !== Number(origin_total) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `origin-amount` }, (0, import_utils.formatAmount)(origin_total * num, 2, symbol)) : null));
82
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__basic-info`, style: style || {} }, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), hasSpecs ? /* @__PURE__ */ import_react.default.createElement(import_specs.default, { dataSource }) : /* @__PURE__ */ import_react.default.createElement("div", { className: `product-price` }, (0, import_utils.formatAmount)(price, 2, symbol))), /* @__PURE__ */ import_react.default.createElement("div", { className: `product-amount` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `total-amont` }, (0, import_utils.formatAmount)(total * num - (totalDifference ?? 0), 2, symbol)), origin_total && Number(total) !== Number(origin_total) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `origin-amount` }, (0, import_utils.formatAmount)(origin_total * num, 2, symbol)) : null));
82
83
  };
83
84
  var basicInfo_default = BasicInfo;
@@ -42,7 +42,7 @@ var import_index = require("./index.less");
42
42
  var import_utils2 = require("@pisell/utils");
43
43
  var prefix = "pisell-lowcode-";
44
44
  var Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
45
- const { total, origin_total, symbol, tip, num, discount_reason } = item;
45
+ const { total, origin_total, symbol, tip, num, discount_reason, totalDifference = 0 } = item;
46
46
  const isDiscount = (0, import_react.useMemo)(() => {
47
47
  if (!origin_total) return false;
48
48
  return Number(total) != Number(origin_total);
@@ -87,7 +87,7 @@ var Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
87
87
  }
88
88
  )) : null
89
89
  ), /* @__PURE__ */ import_react.default.createElement("span", null, `×${num}`)) : null,
90
- /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}packages-product-footer-total` }, isDiscount ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}packages-product-footer-origin-total` }, (0, import_utils._formatAmount)(origin_total * num, symbol, 2)) : null, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(total * num, symbol)))
90
+ /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}packages-product-footer-total` }, isDiscount ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}packages-product-footer-origin-total` }, (0, import_utils._formatAmount)(origin_total * num, symbol, 2)) : null, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(total * num - (totalDifference ?? 0), symbol)))
91
91
  )
92
92
  ), renderDiscountReason());
93
93
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare type ColumnsSettingProps = {
2
3
  value?: Record<string, any>[];
3
4
  onChange?: (val: Record<string, any>[]) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: {
2
3
  field: {
3
4
  field_icon: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: {
2
3
  field: {
3
4
  field_icon: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.6.7",
3
+ "version": "6.6.8",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- declare const Footer: ({ item, hideDivider, type, isOnlyTotal }: any) => JSX.Element;
4
- export default Footer;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- declare const Footer: ({ item, hideDivider, type, isOnlyTotal }: any) => JSX.Element;
4
- export default Footer;