@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/PisellCards/index.d.ts +1 -0
- package/es/components/PisellFields/index.d.ts +1 -0
- package/es/components/PisellLayouts/index.d.ts +1 -0
- package/es/components/PisellMetrics/index.d.ts +1 -0
- package/es/components/appVersionControl/types.d.ts +1 -0
- package/es/components/calendar/index.d.ts +1 -0
- package/es/components/checkbox/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/drag-sort-tree/types.d.ts +1 -0
- package/es/components/filter/components/FilterButton/types.d.ts +1 -0
- package/es/components/input/index.d.ts +1 -0
- package/es/components/pisell-config-provider/context.d.ts +1 -0
- package/es/components/pisellDatePicker/index.d.ts +1 -0
- package/es/components/pisellGridPro/ToolBar/type.d.ts +1 -0
- package/es/components/pisellMenu/types.d.ts +1 -0
- package/es/components/pisellQuickFilter/type.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +10 -4
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +0 -6
- package/es/components/radio/index.d.ts +1 -0
- package/es/components/section-footers/index.d.ts +1 -0
- package/es/components/skeleton/index.d.ts +1 -0
- package/es/components/time-picker/index.d.ts +1 -0
- package/es/components/upload/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +1 -0
- package/lib/components/PisellCards/index.d.ts +1 -0
- package/lib/components/PisellFields/index.d.ts +1 -0
- package/lib/components/PisellLayouts/index.d.ts +1 -0
- package/lib/components/PisellMetrics/index.d.ts +1 -0
- package/lib/components/appVersionControl/types.d.ts +1 -0
- package/lib/components/calendar/index.d.ts +1 -0
- package/lib/components/checkbox/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/drag-sort-tree/types.d.ts +1 -0
- package/lib/components/filter/components/FilterButton/types.d.ts +1 -0
- package/lib/components/input/index.d.ts +1 -0
- package/lib/components/pisell-config-provider/context.d.ts +1 -0
- package/lib/components/pisellDatePicker/index.d.ts +1 -0
- package/lib/components/pisellGridPro/ToolBar/type.d.ts +1 -0
- package/lib/components/pisellMenu/types.d.ts +1 -0
- package/lib/components/pisellQuickFilter/type.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +10 -4
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +0 -6
- package/lib/components/radio/index.d.ts +1 -0
- package/lib/components/section-footers/index.d.ts +1 -0
- package/lib/components/skeleton/index.d.ts +1 -0
- package/lib/components/time-picker/index.d.ts +1 -0
- package/lib/components/upload/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +1 -0
- 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 { 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";
|
|
@@ -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
|
-
}, [
|
|
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`,
|
|
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:
|
|
55
|
+
fontSize: "16px",
|
|
50
56
|
color: "#1570ef"
|
|
51
|
-
} })) : null),
|
|
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 { 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 { 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";
|
|
@@ -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
|
-
}, [
|
|
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`,
|
|
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:
|
|
58
|
+
fontSize: "16px",
|
|
53
59
|
color: "#1570ef"
|
|
54
|
-
} })) : null),
|
|
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;
|