@pisell/materials 6.11.264 → 6.11.265

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 (71) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +1 -1
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +1 -1
  9. package/es/components/PisellCards/index.d.ts +1 -0
  10. package/es/components/PisellFields/index.d.ts +1 -0
  11. package/es/components/PisellLayouts/index.d.ts +1 -0
  12. package/es/components/PisellMetrics/index.d.ts +1 -0
  13. package/es/components/appVersionControl/types.d.ts +1 -0
  14. package/es/components/calendar/index.d.ts +1 -0
  15. package/es/components/checkbox/index.d.ts +1 -0
  16. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
  17. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
  18. package/es/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
  19. package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
  20. package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
  21. package/es/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
  22. package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
  23. package/es/components/date-picker/index.d.ts +1 -0
  24. package/es/components/drag-sort-tree/types.d.ts +1 -0
  25. package/es/components/filter/components/FilterButton/types.d.ts +1 -0
  26. package/es/components/input/index.d.ts +1 -0
  27. package/es/components/pisell-config-provider/context.d.ts +1 -0
  28. package/es/components/pisellDatePicker/index.d.ts +1 -0
  29. package/es/components/pisellGridPro/ToolBar/type.d.ts +1 -0
  30. package/es/components/pisellMenu/types.d.ts +1 -0
  31. package/es/components/pisellQuickFilter/type.d.ts +1 -0
  32. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +10 -4
  33. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +0 -6
  34. package/es/components/radio/index.d.ts +1 -0
  35. package/es/components/section-footers/index.d.ts +1 -0
  36. package/es/components/skeleton/index.d.ts +1 -0
  37. package/es/components/time-picker/index.d.ts +1 -0
  38. package/es/components/upload/index.d.ts +1 -0
  39. package/es/components/virtual-keyboard/Amount/types.d.ts +1 -0
  40. package/lib/components/PisellCards/index.d.ts +1 -0
  41. package/lib/components/PisellFields/index.d.ts +1 -0
  42. package/lib/components/PisellLayouts/index.d.ts +1 -0
  43. package/lib/components/PisellMetrics/index.d.ts +1 -0
  44. package/lib/components/appVersionControl/types.d.ts +1 -0
  45. package/lib/components/calendar/index.d.ts +1 -0
  46. package/lib/components/checkbox/index.d.ts +1 -0
  47. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
  48. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
  49. package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
  50. package/lib/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
  51. package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
  52. package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
  53. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
  54. package/lib/components/date-picker/index.d.ts +1 -0
  55. package/lib/components/drag-sort-tree/types.d.ts +1 -0
  56. package/lib/components/filter/components/FilterButton/types.d.ts +1 -0
  57. package/lib/components/input/index.d.ts +1 -0
  58. package/lib/components/pisell-config-provider/context.d.ts +1 -0
  59. package/lib/components/pisellDatePicker/index.d.ts +1 -0
  60. package/lib/components/pisellGridPro/ToolBar/type.d.ts +1 -0
  61. package/lib/components/pisellMenu/types.d.ts +1 -0
  62. package/lib/components/pisellQuickFilter/type.d.ts +1 -0
  63. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +10 -4
  64. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +0 -6
  65. package/lib/components/radio/index.d.ts +1 -0
  66. package/lib/components/section-footers/index.d.ts +1 -0
  67. package/lib/components/skeleton/index.d.ts +1 -0
  68. package/lib/components/time-picker/index.d.ts +1 -0
  69. package/lib/components/upload/index.d.ts +1 -0
  70. package/lib/components/virtual-keyboard/Amount/types.d.ts +1 -0
  71. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellBasicCardProps } from "./types.js";
2
3
  import { ImageDataSource, ImageFillMode, PisellImageCardProps } from "./components/PisellImageCard/types.js";
3
4
  import { GraphicConfig, GraphicTextCardProps, GraphicTextCardSize, GraphicTextCardVariant } from "./components/GraphicTextCard/types.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellSingleLineTextProps } from "../pisellSingleLineText/types.js";
2
3
  import { PisellLongTextProps } from "../pisellLongText/types.js";
3
4
  import { PisellNumberProps } from "../pisellNumber/types.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellBasicGridProps } from "../PisellBasicGrid/types.js";
2
3
  import { PisellScrollViewProps, PisellScrollViewRef } from "../PisellScrollView/types.js";
3
4
  import { FloorMapFullscreenMode, FloorMapItemBase, FloorMapLayoutContextValue, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef } from "../pisellFloorMapLayout/types.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellMetricCardProps } from "../pisellMetricCard/types.js";
2
3
  import { PisellStatisticListProps } from "../pisellStatisticList/index.js";
3
4
  import { PisellStatisticProps } from "../cardMetricItem/index.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  //#region src/components/appVersionControl/types.d.ts
2
3
  interface Version {
3
4
  id: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/calendar/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/checkbox/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { LocalSettingsType } from "../../table/types.js";
2
3
  import { DataSourceType } from "../provider/dataSource/DataSourceContext.js";
3
4
  import { ColumnType } from "antd/es/table";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CheckboxGroupProps } from "./type.js";
2
3
  import { WithModeProps } from "../../dataSourceForm/utils.js";
3
4
  import * as _$react from "react";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { WithModeProps } from "../../dataSourceForm/utils.js";
2
3
  import { RadioGroupProps } from "./type.js";
3
4
  import * as _$react from "react";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
2
3
  import { TabsProps } from "./type.js";
3
4
  import * as _$react from "react";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ModeType } from "../../dataSourceForm/type.js";
2
3
 
3
4
  //#region src/components/dataSourceComponents/fields/Translation/type.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ActionsItem } from "../../dataSourceForm/serve.js";
2
3
  import { Result } from "ahooks/es/useRequest/src/types";
3
4
 
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/date-picker/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  //#region src/components/drag-sort-tree/types.d.ts
2
3
  type IdType = string | number;
3
4
  type ValueProps = {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FilterItemProps } from "../../types.js";
2
3
 
3
4
  //#region src/components/filter/components/FilterButton/types.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
  import { InputProps, InputRef } from "antd";
3
4
  import * as _$antd_es_input0 from "antd/es/input";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/pisell-config-provider/context.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/pisellDatePicker/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  //#region src/components/pisellGridPro/ToolBar/type.d.ts
2
3
  interface ToolBarProps {
3
4
  className?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MenuProps } from "antd";
2
3
 
3
4
  //#region src/components/pisellMenu/types.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FilterItemProps } from "../filter/types.js";
2
3
  import { FormInstance } from "antd";
3
4
 
@@ -10,6 +10,7 @@ import "./index.less";
10
10
  const Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
11
11
  const { total, origin_total, symbol, tip, num, discount_reason, amountFormatter } = item;
12
12
  const weighingInfo = resolveWeighingSnapshot(item);
13
+ const showOnlyTotal = isOnlyTotal || Boolean(weighingInfo);
13
14
  const formatFooterAmount = (amount, precision = 2) => {
14
15
  if (amountFormatter) return amountFormatter(amount, precision);
15
16
  if (!weighingInfo) return _formatAmount(amount, symbol, precision);
@@ -27,9 +28,14 @@ const Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
27
28
  * @Date: 2024-11-22 13:50
28
29
  */
29
30
  const isDiscount = useMemo(() => {
31
+ if (weighingInfo) return origin_total != null && Number(total) !== Number(origin_total);
30
32
  if (!origin_total) return false;
31
33
  return Number(total) != Number(origin_total);
32
- }, [total, origin_total]);
34
+ }, [
35
+ total,
36
+ origin_total,
37
+ weighingInfo
38
+ ]);
33
39
  const renderDiscountReason = () => {
34
40
  if (isDiscount && discount_reason && type === "total") {
35
41
  if (Array.isArray(discount_reason)) return /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}_discount-reason` }, discount_reason.map((reason, index) => {
@@ -42,13 +48,13 @@ const Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
42
48
  }
43
49
  return null;
44
50
  };
45
- return /* @__PURE__ */ React.createElement(React.Fragment, null, !hideDivider ? /* @__PURE__ */ React.createElement(Divider, { style: { margin: 0 } }) : null, /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}__product-footer`, hideDivider && `pisell-cart-sku-card__hide-divider-footer`, isOnlyTotal && `pisell-cart-sku-card__only-total-footer`) }, /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}__footer-price-wrap`, weighingInfo && `pisell-cart-sku-card__footer-price-wrap--weighing`) }, !isOnlyTotal ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}__footer-price`) }, /* @__PURE__ */ React.createElement("span", null, formatFooterAmount(total)), weighingInfo ? /* @__PURE__ */ React.createElement("span", null, `×${num}`) : null, tip ? /* @__PURE__ */ React.createElement(Tooltip, {
51
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, !hideDivider ? /* @__PURE__ */ React.createElement(Divider, { style: { margin: 0 } }) : null, /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}__product-footer`, hideDivider && `pisell-cart-sku-card__hide-divider-footer`, showOnlyTotal && `pisell-cart-sku-card__only-total-footer`) }, /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}__footer-price-wrap`, weighingInfo && `pisell-cart-sku-card__footer-price-wrap--weighing`) }, !showOnlyTotal ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: classNames(`${PREFIX}__footer-price`) }, /* @__PURE__ */ React.createElement("span", null, formatFooterAmount(total)), tip ? /* @__PURE__ */ React.createElement(Tooltip, {
46
52
  title: locales.getText(tip),
47
53
  destroyTooltipOnHide: true
48
54
  }, /* @__PURE__ */ React.createElement(QuestionCircleOutlined, { style: {
49
- fontSize: weighingInfo && true ? "1em" : "16px",
55
+ fontSize: "16px",
50
56
  color: "#1570ef"
51
- } })) : null), !weighingInfo ? /* @__PURE__ */ React.createElement("span", null, `×${num}`) : null) : null, /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}__footer-total` }, isDiscount ? /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}__footer-origin-total` }, formatFooterAmount(origin_total * num)) : null, /* @__PURE__ */ React.createElement("span", null, formatFooterAmount(total * num))))), renderDiscountReason());
57
+ } })) : null), /* @__PURE__ */ React.createElement("span", null, `×${num}`)) : null, /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}__footer-total` }, isDiscount ? /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}__footer-origin-total` }, formatFooterAmount(origin_total * num)) : null, /* @__PURE__ */ React.createElement("span", null, formatFooterAmount(total * num))))), renderDiscountReason());
52
58
  };
53
59
  //#endregion
54
60
  export { Footer as default };
@@ -32,13 +32,11 @@
32
32
  line-height: 1.3;
33
33
  letter-spacing: -0.02em;
34
34
 
35
- > .pisell-cart-sku-card__footer-price,
36
35
  > span {
37
36
  flex-shrink: 0;
38
37
  white-space: nowrap;
39
38
  }
40
39
 
41
- .pisell-cart-sku-card__footer-price,
42
40
  .pisell-cart-sku-card__footer-total,
43
41
  .pisell-cart-sku-card__footer-origin-total,
44
42
  .pisell-cart-sku-card__footer-discount {
@@ -46,10 +44,6 @@
46
44
  line-height: inherit;
47
45
  }
48
46
 
49
- > .pisell-cart-sku-card__footer-price {
50
- gap: 8px;
51
- }
52
-
53
47
  .pisell-cart-sku-card__footer-total {
54
48
  display: flex;
55
49
  flex-wrap: wrap;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/radio/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/section-footers/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/skeleton/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/time-picker/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/upload/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { BaseNumberKeyboardProps } from "../BaseNumberKeyboard/index.js";
2
3
 
3
4
  //#region src/components/virtual-keyboard/Amount/types.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellBasicCardProps } from "./types.js";
2
3
  import { ImageDataSource, ImageFillMode, PisellImageCardProps } from "./components/PisellImageCard/types.js";
3
4
  import { GraphicConfig, GraphicTextCardProps, GraphicTextCardSize, GraphicTextCardVariant } from "./components/GraphicTextCard/types.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellSingleLineTextProps } from "../pisellSingleLineText/types.js";
2
3
  import { PisellLongTextProps } from "../pisellLongText/types.js";
3
4
  import { PisellNumberProps } from "../pisellNumber/types.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellBasicGridProps } from "../PisellBasicGrid/types.js";
2
3
  import { PisellScrollViewProps, PisellScrollViewRef } from "../PisellScrollView/types.js";
3
4
  import { FloorMapFullscreenMode, FloorMapItemBase, FloorMapLayoutContextValue, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef } from "../pisellFloorMapLayout/types.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PisellMetricCardProps } from "../pisellMetricCard/types.js";
2
3
  import { PisellStatisticListProps } from "../pisellStatisticList/index.js";
3
4
  import { PisellStatisticProps } from "../cardMetricItem/index.js";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  //#region src/components/appVersionControl/types.d.ts
2
3
  interface Version {
3
4
  id: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/calendar/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/checkbox/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { LocalSettingsType } from "../../table/types.js";
2
3
  import { DataSourceType } from "../provider/dataSource/DataSourceContext.js";
3
4
  import { ColumnType } from "antd/es/table";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CheckboxGroupProps } from "./type.js";
2
3
  import { WithModeProps } from "../../dataSourceForm/utils.js";
3
4
  import * as _$react from "react";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { WithModeProps } from "../../dataSourceForm/utils.js";
2
3
  import { RadioGroupProps } from "./type.js";
3
4
  import * as _$react from "react";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
2
3
  import { TabsProps } from "./type.js";
3
4
  import * as _$react from "react";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ModeType } from "../../dataSourceForm/type.js";
2
3
 
3
4
  //#region src/components/dataSourceComponents/fields/Translation/type.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ActionsItem } from "../../dataSourceForm/serve.js";
2
3
  import { Result } from "ahooks/es/useRequest/src/types";
3
4
 
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/date-picker/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  //#region src/components/drag-sort-tree/types.d.ts
2
3
  type IdType = string | number;
3
4
  type ValueProps = {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FilterItemProps } from "../../types.js";
2
3
 
3
4
  //#region src/components/filter/components/FilterButton/types.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
  import { InputProps, InputRef } from "antd";
3
4
  import * as _$antd_es_input0 from "antd/es/input";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/pisell-config-provider/context.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/pisellDatePicker/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  //#region src/components/pisellGridPro/ToolBar/type.d.ts
2
3
  interface ToolBarProps {
3
4
  className?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MenuProps } from "antd";
2
3
 
3
4
  //#region src/components/pisellMenu/types.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FilterItemProps } from "../filter/types.js";
2
3
  import { FormInstance } from "antd";
3
4
 
@@ -13,6 +13,7 @@ require("./index.less");
13
13
  const Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
14
14
  const { total, origin_total, symbol, tip, num, discount_reason, amountFormatter } = item;
15
15
  const weighingInfo = (0, _pisell_utils.resolveWeighingSnapshot)(item);
16
+ const showOnlyTotal = isOnlyTotal || Boolean(weighingInfo);
16
17
  const formatFooterAmount = (amount, precision = 2) => {
17
18
  if (amountFormatter) return amountFormatter(amount, precision);
18
19
  if (!weighingInfo) return require_utils._formatAmount(amount, symbol, precision);
@@ -30,9 +31,14 @@ const Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
30
31
  * @Date: 2024-11-22 13:50
31
32
  */
32
33
  const isDiscount = (0, react.useMemo)(() => {
34
+ if (weighingInfo) return origin_total != null && Number(total) !== Number(origin_total);
33
35
  if (!origin_total) return false;
34
36
  return Number(total) != Number(origin_total);
35
- }, [total, origin_total]);
37
+ }, [
38
+ total,
39
+ origin_total,
40
+ weighingInfo
41
+ ]);
36
42
  const renderDiscountReason = () => {
37
43
  if (isDiscount && discount_reason && type === "total") {
38
44
  if (Array.isArray(discount_reason)) return /* @__PURE__ */ react.default.createElement("div", { className: `${require_index.PREFIX}_discount-reason` }, discount_reason.map((reason, index) => {
@@ -45,13 +51,13 @@ const Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
45
51
  }
46
52
  return null;
47
53
  };
48
- return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, !hideDivider ? /* @__PURE__ */ react.default.createElement(antd.Divider, { style: { margin: 0 } }) : null, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${require_index.PREFIX}__product-footer`, hideDivider && `pisell-cart-sku-card__hide-divider-footer`, isOnlyTotal && `pisell-cart-sku-card__only-total-footer`) }, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${require_index.PREFIX}__footer-price-wrap`, weighingInfo && `pisell-cart-sku-card__footer-price-wrap--weighing`) }, !isOnlyTotal ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${require_index.PREFIX}__footer-price`) }, /* @__PURE__ */ react.default.createElement("span", null, formatFooterAmount(total)), weighingInfo ? /* @__PURE__ */ react.default.createElement("span", null, `×${num}`) : null, tip ? /* @__PURE__ */ react.default.createElement(antd.Tooltip, {
54
+ return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, !hideDivider ? /* @__PURE__ */ react.default.createElement(antd.Divider, { style: { margin: 0 } }) : null, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${require_index.PREFIX}__product-footer`, hideDivider && `pisell-cart-sku-card__hide-divider-footer`, showOnlyTotal && `pisell-cart-sku-card__only-total-footer`) }, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${require_index.PREFIX}__footer-price-wrap`, weighingInfo && `pisell-cart-sku-card__footer-price-wrap--weighing`) }, !showOnlyTotal ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${require_index.PREFIX}__footer-price`) }, /* @__PURE__ */ react.default.createElement("span", null, formatFooterAmount(total)), tip ? /* @__PURE__ */ react.default.createElement(antd.Tooltip, {
49
55
  title: _pisell_utils.locales.getText(tip),
50
56
  destroyTooltipOnHide: true
51
57
  }, /* @__PURE__ */ react.default.createElement(_ant_design_icons.QuestionCircleOutlined, { style: {
52
- fontSize: weighingInfo && true ? "1em" : "16px",
58
+ fontSize: "16px",
53
59
  color: "#1570ef"
54
- } })) : null), !weighingInfo ? /* @__PURE__ */ react.default.createElement("span", null, `×${num}`) : null) : null, /* @__PURE__ */ react.default.createElement("span", { className: `${require_index.PREFIX}__footer-total` }, isDiscount ? /* @__PURE__ */ react.default.createElement("span", { className: `${require_index.PREFIX}__footer-origin-total` }, formatFooterAmount(origin_total * num)) : null, /* @__PURE__ */ react.default.createElement("span", null, formatFooterAmount(total * num))))), renderDiscountReason());
60
+ } })) : null), /* @__PURE__ */ react.default.createElement("span", null, `×${num}`)) : null, /* @__PURE__ */ react.default.createElement("span", { className: `${require_index.PREFIX}__footer-total` }, isDiscount ? /* @__PURE__ */ react.default.createElement("span", { className: `${require_index.PREFIX}__footer-origin-total` }, formatFooterAmount(origin_total * num)) : null, /* @__PURE__ */ react.default.createElement("span", null, formatFooterAmount(total * num))))), renderDiscountReason());
55
61
  };
56
62
  //#endregion
57
63
  exports.default = Footer;
@@ -32,13 +32,11 @@
32
32
  line-height: 1.3;
33
33
  letter-spacing: -0.02em;
34
34
 
35
- > .pisell-cart-sku-card__footer-price,
36
35
  > span {
37
36
  flex-shrink: 0;
38
37
  white-space: nowrap;
39
38
  }
40
39
 
41
- .pisell-cart-sku-card__footer-price,
42
40
  .pisell-cart-sku-card__footer-total,
43
41
  .pisell-cart-sku-card__footer-origin-total,
44
42
  .pisell-cart-sku-card__footer-discount {
@@ -46,10 +44,6 @@
46
44
  line-height: inherit;
47
45
  }
48
46
 
49
- > .pisell-cart-sku-card__footer-price {
50
- gap: 8px;
51
- }
52
-
53
47
  .pisell-cart-sku-card__footer-total {
54
48
  display: flex;
55
49
  flex-wrap: wrap;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/radio/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/section-footers/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/skeleton/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/time-picker/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as _$react from "react";
2
3
 
3
4
  //#region src/components/upload/index.d.ts
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { BaseNumberKeyboardProps } from "../BaseNumberKeyboard/index.js";
2
3
 
3
4
  //#region src/components/virtual-keyboard/Amount/types.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.11.264",
3
+ "version": "6.11.265",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",