@pisell/materials 1.8.42 → 1.8.45

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.
@@ -4,7 +4,7 @@ import Holders from "../holders/index.js";
4
4
  import Weighing from "../weighing/index.js";
5
5
  import { PREFIX } from "../../index.js";
6
6
  import React, { useMemo } from "react";
7
- import { formatAmount, image } from "@pisell/utils";
7
+ import { formatAmount, formatAmountWithOptions, image } from "@pisell/utils";
8
8
  import classNames from "classnames";
9
9
  import "./index.less";
10
10
  //#region src/components/productCard/cartSkuCard/components/basicInfo/index.tsx
@@ -37,7 +37,10 @@ const BasicInfo = (props) => {
37
37
  const renderProductPrice = () => {
38
38
  if (weighingInfo) {
39
39
  const { unit, unit_price } = weighingInfo;
40
- return `${formatAmount(unit_price, 2, symbol)}/${UNIT_LABEL[unit]}`;
40
+ return `${formatAmountWithOptions(unit_price, symbol, {
41
+ precision: 2,
42
+ hideDecimalForWholeNumbers: false
43
+ })}/${UNIT_LABEL[unit]}`;
41
44
  }
42
45
  return formatAmount(price, 2, symbol);
43
46
  };
@@ -49,7 +49,7 @@ const BasicTable = (props) => {
49
49
  let _page = formPagination.page;
50
50
  let _size = formPagination.size || 10;
51
51
  let list = [];
52
- let _total = total;
52
+ let _total = (pagination === null || pagination === void 0 ? void 0 : pagination.total) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0;
53
53
  if (localPagination) {
54
54
  list = calcFilterSort({
55
55
  dataSource,
@@ -71,7 +71,8 @@ const BasicTable = (props) => {
71
71
  formPagination === null || formPagination === void 0 ? void 0 : formPagination.size,
72
72
  filter,
73
73
  sort,
74
- other.columns
74
+ other.columns,
75
+ pagination === null || pagination === void 0 ? void 0 : pagination.total
75
76
  ]);
76
77
  const total = useMemo(() => {
77
78
  if (localPagination) return (_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.total) || 0;
@@ -40,7 +40,10 @@ const BasicInfo = (props) => {
40
40
  const renderProductPrice = () => {
41
41
  if (weighingInfo) {
42
42
  const { unit, unit_price } = weighingInfo;
43
- return `${(0, _pisell_utils.formatAmount)(unit_price, 2, symbol)}/${UNIT_LABEL[unit]}`;
43
+ return `${(0, _pisell_utils.formatAmountWithOptions)(unit_price, symbol, {
44
+ precision: 2,
45
+ hideDecimalForWholeNumbers: false
46
+ })}/${UNIT_LABEL[unit]}`;
44
47
  }
45
48
  return (0, _pisell_utils.formatAmount)(price, 2, symbol);
46
49
  };
@@ -51,7 +51,7 @@ const BasicTable = (props) => {
51
51
  let _page = formPagination.page;
52
52
  let _size = formPagination.size || 10;
53
53
  let list = [];
54
- let _total = total;
54
+ let _total = (pagination === null || pagination === void 0 ? void 0 : pagination.total) || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || 0;
55
55
  if (localPagination) {
56
56
  list = require_utils.calcFilterSort({
57
57
  dataSource,
@@ -73,7 +73,8 @@ const BasicTable = (props) => {
73
73
  formPagination === null || formPagination === void 0 ? void 0 : formPagination.size,
74
74
  filter,
75
75
  sort,
76
- other.columns
76
+ other.columns,
77
+ pagination === null || pagination === void 0 ? void 0 : pagination.total
77
78
  ]);
78
79
  const total = (0, react.useMemo)(() => {
79
80
  if (localPagination) return (_dataSource === null || _dataSource === void 0 ? void 0 : _dataSource.total) || 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.8.42",
3
+ "version": "1.8.45",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -99,8 +99,8 @@
99
99
  "antd-mobile": "^5.38.1",
100
100
  "vod-js-sdk-v6": "^1.4.11",
101
101
  "@pisell/date-picker": "3.0.8",
102
- "@pisell/utils": "3.0.2",
103
- "@pisell/icon": "0.0.11"
102
+ "@pisell/icon": "0.0.11",
103
+ "@pisell/utils": "3.0.2"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "react": "^18.0.0",