@pisell/materials 6.11.10 → 6.11.12
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/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +21 -21
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +18 -18
- package/es/components/PisellCards/components/MultilevelCard/components/PanelWrapper.d.ts +7 -0
- package/es/components/PisellProcedure/PisellProcedure.d.ts +22 -0
- package/es/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
- package/es/components/PisellProcedure/components/ProcedureBody.d.ts +41 -0
- package/es/components/PisellProcedure/components/ProcedureFooter.d.ts +38 -0
- package/es/components/PisellProcedure/components/ProcedureHeader.d.ts +34 -0
- package/es/components/PisellProcedure/components/index.d.ts +12 -0
- package/es/components/PisellProcedure/index.d.ts +5 -0
- package/es/components/PisellSuperTabs/PisellSuperTabs.d.ts +8 -0
- package/es/components/PisellSuperTabs/hooks/index.d.ts +1 -0
- package/es/components/PisellSuperTabs/hooks/useTabsState.d.ts +7 -0
- package/es/components/PisellSuperTabs/index.d.ts +3 -0
- package/es/components/PisellSuperTabs/types.d.ts +212 -0
- package/es/components/PisellTabbar/constants.d.ts +47 -0
- package/es/components/PisellTabbar/hooks/index.d.ts +2 -0
- package/es/components/PisellTabbar/hooks/useActiveKey.d.ts +55 -0
- package/es/components/PisellTabbar/hooks/useExpand.d.ts +42 -0
- package/es/components/PisellTabbar/template/Template1/constants.d.ts +10 -0
- package/es/components/PisellTabbar/template/Template1/utils/index.d.ts +35 -0
- package/es/components/PisellTabbar/types.d.ts +90 -0
- package/es/components/PisellTabbar/utils/index.d.ts +69 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +26 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +21 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +15 -15
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +15 -0
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +19 -0
- package/es/components/pisellAdjustPrice/status.d.ts +32 -0
- package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +0 -2
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +5 -5
- package/es/components/pisellGridPro/index.d.ts +4 -0
- package/es/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/es/components/pisellLookup/components/LookupTrigger.js +16 -13
- package/es/components/pisellMetricCard/PisellMetricCard.stories.d.ts +17 -0
- package/es/components/pisellMetricCard/components/index.d.ts +7 -0
- package/es/components/pisellMetricCard/index.d.ts +6 -0
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +15 -7
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +47 -14
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +8 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.js +482 -249
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +121 -16
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +38 -0
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.d.ts +4 -2
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +92 -13
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +7 -3
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -1
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +9 -3
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +6 -2
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.d.ts +21 -0
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +112 -15
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +15 -0
- package/es/components/pisellSort/index.d.ts +4 -0
- package/es/components/pisellStatisticList/index.d.ts +22 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +2 -2
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.d.ts +61 -0
- package/es/components/pisellTimeRangeDisplay/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/Gift/index.d.ts +5 -0
- package/es/components/productCard/cartSkuCard/components/Gift/index.js +60 -0
- package/es/components/productCard/cartSkuCard/components/Gift/index.less +84 -0
- package/es/components/productCard/cartSkuCard/components/Gift/types.d.ts +29 -0
- package/es/components/productCard/cartSkuCard/components/Gift/types.js +1 -0
- package/es/components/productCard/cartSkuCard/components/Promotion/index.d.ts +7 -0
- package/es/components/productCard/cartSkuCard/components/Promotion/index.js +24 -0
- package/es/components/productCard/cartSkuCard/components/Promotion/index.less +16 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +41 -6
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +66 -1
- package/es/components/productCard/cartSkuCard/components/packages/index.js +1 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/index.js +44 -7
- package/es/components/productCard/cartSkuCard/locales.d.ts +178 -0
- package/es/components/productCard/cartSkuCard/locales.js +30 -5
- package/es/components/productCard/components/Header/EditButton/index.d.ts +1 -1
- package/es/components/productCard/components/Header/EditButton/index.js +3 -1
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/status.js +3 -0
- package/es/components/productCard/types.d.ts +95 -0
- package/es/components/select/index.d.ts +9 -0
- package/es/components/select/index.less +18 -2
- package/es/components/table/Table/fields/image/index.d.ts +1 -0
- package/es/components/table/Table/fields/pSwitch/index.d.ts +1 -0
- package/es/components/table/Table/fields/select/Edit/index.d.ts +4 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/es/components/virtualInput/BaseVirtualInput/index.less +2 -2
- package/es/components/virtualInput/index.js +6 -2
- package/es/hooks/useThemeTokens.js +20 -0
- package/es/index.d.ts +1 -0
- package/es/locales/en-US.d.ts +2 -0
- package/es/locales/en-US.js +2 -0
- package/es/locales/ja.d.ts +2 -0
- package/es/locales/ja.js +2 -0
- package/es/locales/pt.d.ts +2 -0
- package/es/locales/pt.js +2 -0
- package/es/locales/zh-CN.d.ts +2 -0
- package/es/locales/zh-CN.js +2 -0
- package/es/locales/zh-TW.d.ts +2 -0
- package/es/locales/zh-TW.js +2 -0
- package/lib/components/PisellCards/components/MultilevelCard/components/PanelWrapper.d.ts +7 -0
- package/lib/components/PisellProcedure/PisellProcedure.d.ts +22 -0
- package/lib/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
- package/lib/components/PisellProcedure/components/ProcedureBody.d.ts +41 -0
- package/lib/components/PisellProcedure/components/ProcedureFooter.d.ts +38 -0
- package/lib/components/PisellProcedure/components/ProcedureHeader.d.ts +34 -0
- package/lib/components/PisellProcedure/components/index.d.ts +12 -0
- package/lib/components/PisellProcedure/index.d.ts +5 -0
- package/lib/components/PisellSuperTabs/PisellSuperTabs.d.ts +8 -0
- package/lib/components/PisellSuperTabs/hooks/index.d.ts +1 -0
- package/lib/components/PisellSuperTabs/hooks/useTabsState.d.ts +7 -0
- package/lib/components/PisellSuperTabs/index.d.ts +3 -0
- package/lib/components/PisellSuperTabs/types.d.ts +212 -0
- package/lib/components/PisellTabbar/constants.d.ts +47 -0
- package/lib/components/PisellTabbar/hooks/index.d.ts +2 -0
- package/lib/components/PisellTabbar/hooks/useActiveKey.d.ts +55 -0
- package/lib/components/PisellTabbar/hooks/useExpand.d.ts +42 -0
- package/lib/components/PisellTabbar/template/Template1/constants.d.ts +10 -0
- package/lib/components/PisellTabbar/template/Template1/utils/index.d.ts +35 -0
- package/lib/components/PisellTabbar/types.d.ts +90 -0
- package/lib/components/PisellTabbar/utils/index.d.ts +69 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +26 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +21 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +15 -15
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +15 -0
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +19 -0
- package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
- package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.js +0 -2
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +3 -3
- package/lib/components/pisellGridPro/index.d.ts +4 -0
- package/lib/components/pisellLookup/components/LookupTrigger.d.ts +3 -0
- package/lib/components/pisellLookup/components/LookupTrigger.js +8 -8
- package/lib/components/pisellMetricCard/PisellMetricCard.stories.d.ts +17 -0
- package/lib/components/pisellMetricCard/components/index.d.ts +7 -0
- package/lib/components/pisellMetricCard/index.d.ts +6 -0
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +15 -7
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +39 -9
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +8 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.js +159 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +94 -9
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +38 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.d.ts +4 -2
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/ColumnSettingPopover.js +88 -3
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +6 -2
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -1
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +9 -1
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +3 -2
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.d.ts +21 -0
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.js +60 -0
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +15 -0
- package/lib/components/pisellSort/index.d.ts +4 -0
- package/lib/components/pisellStatisticList/index.d.ts +22 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +1 -1
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.stories.d.ts +61 -0
- package/lib/components/pisellTimeRangeDisplay/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/index.d.ts +5 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/index.js +62 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/index.less +84 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/types.d.ts +29 -0
- package/lib/components/productCard/cartSkuCard/components/Gift/types.js +17 -0
- package/lib/components/productCard/cartSkuCard/components/Promotion/index.d.ts +7 -0
- package/lib/components/productCard/cartSkuCard/components/Promotion/index.js +63 -0
- package/lib/components/productCard/cartSkuCard/components/Promotion/index.less +16 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +20 -3
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +66 -1
- package/lib/components/productCard/cartSkuCard/components/packages/index.js +1 -1
- package/lib/components/productCard/cartSkuCard/index.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/index.js +42 -6
- package/lib/components/productCard/cartSkuCard/locales.d.ts +178 -0
- package/lib/components/productCard/cartSkuCard/locales.js +20 -5
- package/lib/components/productCard/components/Header/EditButton/index.d.ts +1 -1
- package/lib/components/productCard/components/Header/EditButton/index.js +2 -1
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/status.js +3 -0
- package/lib/components/productCard/types.d.ts +95 -0
- package/lib/components/select/index.d.ts +9 -0
- package/lib/components/select/index.less +18 -2
- package/lib/components/table/Table/fields/image/index.d.ts +1 -0
- package/lib/components/table/Table/fields/pSwitch/index.d.ts +1 -0
- package/lib/components/table/Table/fields/select/Edit/index.d.ts +4 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.less +2 -2
- package/lib/components/virtualInput/index.js +7 -1
- package/lib/hooks/useThemeTokens.js +40 -0
- package/lib/index.d.ts +1 -0
- package/lib/locales/en-US.d.ts +2 -0
- package/lib/locales/en-US.js +2 -0
- package/lib/locales/ja.d.ts +2 -0
- package/lib/locales/ja.js +2 -0
- package/lib/locales/pt.d.ts +2 -0
- package/lib/locales/pt.js +2 -0
- package/lib/locales/zh-CN.d.ts +2 -0
- package/lib/locales/zh-CN.js +2 -0
- package/lib/locales/zh-TW.d.ts +2 -0
- package/lib/locales/zh-TW.js +2 -0
- package/package.json +3 -3
- package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +0 -7
- package/es/components/pisellDateTimeDisplay/formats/index.d.ts +0 -1
- package/es/components/virtualInput/index.d.ts +0 -24
- package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.d.ts +0 -7
- package/lib/components/pisellDateTimeDisplay/formats/index.d.ts +0 -1
- package/lib/components/virtualInput/index.d.ts +0 -24
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/pisellRecordBoard/utils/recordBoardColumns.tsx
|
|
30
30
|
var recordBoardColumns_exports = {};
|
|
31
31
|
__export(recordBoardColumns_exports, {
|
|
32
|
+
computeUniformColumnSummary: () => computeUniformColumnSummary,
|
|
32
33
|
deriveFilterFromColumns: () => deriveFilterFromColumns,
|
|
33
34
|
deriveSortFromColumns: () => deriveSortFromColumns,
|
|
34
35
|
getRecordBoardColumnKey: () => getRecordBoardColumnKey,
|
|
@@ -109,6 +110,64 @@ function getColumnLabel(column) {
|
|
|
109
110
|
if (typeof title === "string") return title;
|
|
110
111
|
return getColumnKey(column) || "";
|
|
111
112
|
}
|
|
113
|
+
function getRecordValue(record, dataIndex) {
|
|
114
|
+
if (record == null || dataIndex == null) return void 0;
|
|
115
|
+
const path = Array.isArray(dataIndex) ? dataIndex : [dataIndex];
|
|
116
|
+
return path.reduce((r, k) => r != null && typeof r === "object" ? r[k] : void 0, record);
|
|
117
|
+
}
|
|
118
|
+
function isEmptyValue(v) {
|
|
119
|
+
return v == null || v === "";
|
|
120
|
+
}
|
|
121
|
+
function isComparablePrimitive(v) {
|
|
122
|
+
return typeof v === "string" || typeof v === "number";
|
|
123
|
+
}
|
|
124
|
+
function computeUniformColumnSummary(data, columns) {
|
|
125
|
+
const uniformHiddenColumnKeys = [];
|
|
126
|
+
const summaryItems = [];
|
|
127
|
+
if (!Array.isArray(data) || data.length === 0) return { uniformHiddenColumnKeys, summaryItems };
|
|
128
|
+
for (const column of columns) {
|
|
129
|
+
const collapseWhenUniform = column.collapseWhenUniform !== false;
|
|
130
|
+
if (!collapseWhenUniform) continue;
|
|
131
|
+
const columnKey = getColumnKey(column);
|
|
132
|
+
if (!columnKey) continue;
|
|
133
|
+
const dataIndex = column.dataIndex;
|
|
134
|
+
const getVal = typeof column.uniformCompare === "function" ? (record) => column.uniformCompare(
|
|
135
|
+
getRecordValue(record, Array.isArray(dataIndex) ? dataIndex : dataIndex),
|
|
136
|
+
record
|
|
137
|
+
) : (record) => getRecordValue(record, Array.isArray(dataIndex) ? dataIndex : dataIndex);
|
|
138
|
+
const values = data.map(getVal);
|
|
139
|
+
const first = values[0];
|
|
140
|
+
if (first === void 0 || first === null) continue;
|
|
141
|
+
const cellValue = getRecordValue(data[0], Array.isArray(dataIndex) ? dataIndex : dataIndex);
|
|
142
|
+
if (values.every((v) => isEmptyValue(v))) {
|
|
143
|
+
uniformHiddenColumnKeys.push(columnKey);
|
|
144
|
+
summaryItems.push({
|
|
145
|
+
columnKey,
|
|
146
|
+
title: getColumnLabel(column),
|
|
147
|
+
type: "empty",
|
|
148
|
+
value: void 0,
|
|
149
|
+
cellValue,
|
|
150
|
+
record: data[0]
|
|
151
|
+
});
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const comparable = isComparablePrimitive(first);
|
|
155
|
+
if (!comparable) continue;
|
|
156
|
+
const allSame = values.every((v) => isEmptyValue(v) && isEmptyValue(first) || v === first);
|
|
157
|
+
if (!allSame) continue;
|
|
158
|
+
uniformHiddenColumnKeys.push(columnKey);
|
|
159
|
+
summaryItems.push({
|
|
160
|
+
columnKey,
|
|
161
|
+
title: getColumnLabel(column),
|
|
162
|
+
type: "uniform",
|
|
163
|
+
displayValue: first != null && first !== "" ? String(first) : void 0,
|
|
164
|
+
value: first,
|
|
165
|
+
cellValue,
|
|
166
|
+
record: data[0]
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return { uniformHiddenColumnKeys, summaryItems };
|
|
170
|
+
}
|
|
112
171
|
function normalizeOptions(list) {
|
|
113
172
|
if (!Array.isArray(list)) return [];
|
|
114
173
|
return list.map(
|
|
@@ -298,6 +357,7 @@ function deriveFilterFromColumns(columns) {
|
|
|
298
357
|
}
|
|
299
358
|
// Annotate the CommonJS export names for ESM import in node:
|
|
300
359
|
0 && (module.exports = {
|
|
360
|
+
computeUniformColumnSummary,
|
|
301
361
|
deriveFilterFromColumns,
|
|
302
362
|
deriveSortFromColumns,
|
|
303
363
|
getRecordBoardColumnKey,
|
|
@@ -7,6 +7,21 @@
|
|
|
7
7
|
height: 48px !important;
|
|
8
8
|
width: 100%;
|
|
9
9
|
|
|
10
|
+
.pisell-lowcode-select-clear {
|
|
11
|
+
color: #667085;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
min-width: 44px;
|
|
16
|
+
min-height: 44px;
|
|
17
|
+
margin: -22px -8px;
|
|
18
|
+
padding: 10px 8px;
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
color: #344054;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
10
25
|
// Select 触发器(Figma 设计规范,与 Input 体系一致)
|
|
11
26
|
.pisell-lowcode-select:not(.pisell-lowcode-select-disabled):not(.pisell-lowcode-select-customize-input) {
|
|
12
27
|
.pisell-lowcode-select-selector {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PisellStatisticListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
isHasBorder?: boolean;
|
|
5
|
+
backgroundColors?: string[];
|
|
6
|
+
labelColor?: string;
|
|
7
|
+
valueColor?: string;
|
|
8
|
+
data: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
isLink?: boolean;
|
|
12
|
+
link?: string;
|
|
13
|
+
tip?: string;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
children?: {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[];
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
declare const PisellStatisticList: (props: PisellStatisticListProps) => React.JSX.Element;
|
|
22
|
+
export default PisellStatisticList;
|
|
@@ -83,7 +83,7 @@ var PisellTimeRangeDisplay = (props) => {
|
|
|
83
83
|
} = fields || {};
|
|
84
84
|
const showSeconds = (durationFormat == null ? void 0 : durationFormat.showSeconds) ?? false;
|
|
85
85
|
const effectiveDateFormat = (0, import_react.useMemo)(
|
|
86
|
-
() => ({ showRelativeDay:
|
|
86
|
+
() => ({ showRelativeDay: false, ...dateFormat }),
|
|
87
87
|
[dateFormat]
|
|
88
88
|
);
|
|
89
89
|
const referenceDate = (0, import_dayjs.default)();
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PisellTimeRangeDisplay } from './PisellTimeRangeDisplay';
|
|
3
|
+
/**
|
|
4
|
+
* PisellTimeRangeDisplay 组件 Storybook
|
|
5
|
+
* 用于时间区间 + 持续时长的展示(同一天 / 跨天)
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof PisellTimeRangeDisplay>;
|
|
8
|
+
export default meta;
|
|
9
|
+
declare type Story = StoryObj<typeof PisellTimeRangeDisplay>;
|
|
10
|
+
/**
|
|
11
|
+
* 默认:同一天时间区间 + 持续时长
|
|
12
|
+
*/
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
/**
|
|
15
|
+
* 同一天 + 显示日期与星期
|
|
16
|
+
*/
|
|
17
|
+
export declare const SameDayWithDate: Story;
|
|
18
|
+
/**
|
|
19
|
+
* 跨天时间区间
|
|
20
|
+
*/
|
|
21
|
+
export declare const CrossDay: Story;
|
|
22
|
+
/**
|
|
23
|
+
* 跨年
|
|
24
|
+
*/
|
|
25
|
+
export declare const CrossYear: Story;
|
|
26
|
+
/**
|
|
27
|
+
* 持续时间在中间(默认 fieldOrder)
|
|
28
|
+
*/
|
|
29
|
+
export declare const DurationInMiddle: Story;
|
|
30
|
+
/**
|
|
31
|
+
* 持续时长在前
|
|
32
|
+
*/
|
|
33
|
+
export declare const DurationFirst: Story;
|
|
34
|
+
/**
|
|
35
|
+
* 持续时长显示秒
|
|
36
|
+
*/
|
|
37
|
+
export declare const DurationWithSeconds: Story;
|
|
38
|
+
/**
|
|
39
|
+
* 仅时间区间 + 持续时长(不显示日期星期)
|
|
40
|
+
*/
|
|
41
|
+
export declare const TimeAndDurationOnly: Story;
|
|
42
|
+
/**
|
|
43
|
+
* 12 小时制
|
|
44
|
+
*/
|
|
45
|
+
export declare const Time12Hour: Story;
|
|
46
|
+
/**
|
|
47
|
+
* 中文(日期 + 持续时长「天/时/分/秒」i18n)
|
|
48
|
+
*/
|
|
49
|
+
export declare const LocaleZhCN: Story;
|
|
50
|
+
/**
|
|
51
|
+
* 英文(日期 + 持续时长 d/h/m/s)
|
|
52
|
+
*/
|
|
53
|
+
export declare const LocaleEn: Story;
|
|
54
|
+
/**
|
|
55
|
+
* 小宽度:容器较窄时按块换行
|
|
56
|
+
*/
|
|
57
|
+
export declare const NarrowWidth: Story;
|
|
58
|
+
/**
|
|
59
|
+
* 自定义容器样式
|
|
60
|
+
*/
|
|
61
|
+
export declare const CustomContainerStyle: Story;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { PisellTimeRangeDisplay, default } from './PisellTimeRangeDisplay';
|
|
2
|
+
export type { PisellTimeRangeDisplayProps, LayoutDirection, TimeRangeFieldType, TimeRangeFieldConfig, DurationFormatConfig, DayjsLike, } from './types';
|
|
3
|
+
export type { TimeFormatConfig, DateFormatConfig, WeekdayFormatConfig, ContainerStyleConfig, TextStyleConfig, TextAlign, } from './types';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/productCard/cartSkuCard/components/Gift/index.tsx
|
|
30
|
+
var Gift_exports = {};
|
|
31
|
+
__export(Gift_exports, {
|
|
32
|
+
default: () => Gift_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Gift_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_icon = __toESM(require("../../../../icon"));
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var prefixCls = "pisell-cart-sku-card__gift";
|
|
40
|
+
var Gift = (props) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const {
|
|
43
|
+
isShow = false,
|
|
44
|
+
totalCount = 0,
|
|
45
|
+
selectedGifts = [],
|
|
46
|
+
promptText = "",
|
|
47
|
+
onClick
|
|
48
|
+
} = props;
|
|
49
|
+
const selectedCount = (selectedGifts == null ? void 0 : selectedGifts.length) || 0;
|
|
50
|
+
const displayGifts = (0, import_react.useMemo)(() => (selectedGifts == null ? void 0 : selectedGifts.slice(0, 5)) || [], [selectedGifts]);
|
|
51
|
+
const renderImage = (0, import_react.useCallback)((item) => {
|
|
52
|
+
if (item == null ? void 0 : item.image) {
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement("img", { src: import_utils.imageAli.ali(item == null ? void 0 : item.image, 48), className: `product-cover` });
|
|
54
|
+
}
|
|
55
|
+
const displayText = (item == null ? void 0 : item.title) ? item == null ? void 0 : item.title.slice(0, 2) : "";
|
|
56
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `product-cover-text` }, displayText);
|
|
57
|
+
}, [displayGifts]);
|
|
58
|
+
if (!isShow) return null;
|
|
59
|
+
console.log("Gift777", props, selectedCount);
|
|
60
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}`, onClick }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}__label` }, import_utils.locales.getText("pisell2.cart.sku-card.gift.title")), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}__content` }, !selectedCount ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}__text` }, promptText || import_utils.locales.getText("pisell2.cart.sku-card.gift.select.title")) : /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}__images ${selectedCount === 1 ? `${prefixCls}__images-single` : ""}` }, displayGifts.map((gift, index) => /* @__PURE__ */ import_react.default.createElement("div", { key: (gift == null ? void 0 : gift.id) || index, className: `${prefixCls}__image` }, renderImage(gift))), selectedCount === 1 && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}__title` }, (_a = displayGifts[0]) == null ? void 0 : _a.title)), /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}__total` }, import_utils.locales.getText("pisell2.cart.sku-card.gift.total")(totalCount)), /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: "pisell2-chevron-right", className: `${prefixCls}__arrow` })));
|
|
61
|
+
};
|
|
62
|
+
var Gift_default = Gift;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@prefix: pisell-cart-sku-card__gift;
|
|
2
|
+
|
|
3
|
+
.@{prefix} {
|
|
4
|
+
padding: 8px;
|
|
5
|
+
background: #F2F4F7;
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 16px;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
margin-top: 4px;
|
|
12
|
+
color: #475467;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
line-height: 20px;
|
|
16
|
+
min-width: 0; // 确保内容可以正确缩小
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
|
|
20
|
+
// 标签
|
|
21
|
+
&__label {
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__content {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
flex: 1;
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__text {
|
|
34
|
+
color: #7F56D9;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__title {
|
|
39
|
+
color: #101828;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__images {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__images-single {
|
|
49
|
+
gap: 2px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__arrow {
|
|
53
|
+
color: #667085;
|
|
54
|
+
font-size: 20px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__total {
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.product-cover {
|
|
62
|
+
width: 24px;
|
|
63
|
+
height: 24px;
|
|
64
|
+
border-radius: 4px;
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.product-cover-text {
|
|
69
|
+
width: 24px;
|
|
70
|
+
height: 24px;
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
border-radius: 4px;
|
|
73
|
+
background-color: #DEDEDE;
|
|
74
|
+
color: #7E7E7E;
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
line-height: 1;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
text-overflow: ellipsis;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* 赠品项数据结构
|
|
4
|
+
*/
|
|
5
|
+
export interface IGiftItem {
|
|
6
|
+
/** 图片 URL */
|
|
7
|
+
image?: string;
|
|
8
|
+
/** 标题 */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** 唯一标识 */
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Gift 组件 Props
|
|
15
|
+
*/
|
|
16
|
+
export interface IGiftProps {
|
|
17
|
+
/** 是否显示赠品组件 */
|
|
18
|
+
isShow?: boolean;
|
|
19
|
+
/** 赠品总数量(可选择的总数) */
|
|
20
|
+
totalCount?: number;
|
|
21
|
+
/** 已选择的赠品列表 */
|
|
22
|
+
selectedGifts?: IGiftItem[];
|
|
23
|
+
/** 选择的赠品原始数据列表 */
|
|
24
|
+
_selectedOriginGifts?: any[];
|
|
25
|
+
/** 提示文本(未选择时显示) */
|
|
26
|
+
promptText?: string;
|
|
27
|
+
/** 点击事件回调 */
|
|
28
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/productCard/cartSkuCard/components/Gift/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/productCard/cartSkuCard/components/Promotion/index.tsx
|
|
30
|
+
var Promotion_exports = {};
|
|
31
|
+
__export(Promotion_exports, {
|
|
32
|
+
default: () => Promotion_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Promotion_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_pisellTags = __toESM(require("../../../../pisellTags"));
|
|
37
|
+
var prefixCls = "pisell-cart-sku-card__promotion";
|
|
38
|
+
var Promotion = (props) => {
|
|
39
|
+
const { promotions, onClick } = props;
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: prefixCls }, promotions == null ? void 0 : promotions.map((item, index) => {
|
|
41
|
+
if (!(item == null ? void 0 : item.text)) return null;
|
|
42
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
key: index,
|
|
46
|
+
onClick: (e) => {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
onClick == null ? void 0 : onClick(item);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
52
|
+
import_pisellTags.default,
|
|
53
|
+
{
|
|
54
|
+
type: "pill_color",
|
|
55
|
+
color: "error",
|
|
56
|
+
className: `${prefixCls}-tag-item`
|
|
57
|
+
},
|
|
58
|
+
item == null ? void 0 : item.text
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
var Promotion_default = Promotion;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.pisell-cart-sku-card__promotion {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
gap: 4px;
|
|
6
|
+
|
|
7
|
+
&-tag-item {
|
|
8
|
+
width: max-content;
|
|
9
|
+
border-radius: var(--Tag-borderRadiusSM, 4px);
|
|
10
|
+
border: 1px solid var(--red-3, #FFA39E);
|
|
11
|
+
background: var(--red-1, #FFF1F0);
|
|
12
|
+
color: var(--red-6, #F5222D);
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -27,6 +27,10 @@ interface IProps {
|
|
|
27
27
|
type?: 'a2' | 'a5' | 'a9';
|
|
28
28
|
isBundle?: boolean;
|
|
29
29
|
showFooter?: boolean;
|
|
30
|
+
isShowOriginalPrice?: boolean;
|
|
31
|
+
isShowEditProduct?: boolean;
|
|
32
|
+
onEditProduct?: (val: any) => void;
|
|
33
|
+
disabledEditClick?: boolean;
|
|
30
34
|
}
|
|
31
35
|
declare const BasicInfo: (props: IProps) => React.JSX.Element;
|
|
32
36
|
export default BasicInfo;
|
|
@@ -38,6 +38,7 @@ var import_utils = require("@pisell/utils");
|
|
|
38
38
|
var import_specs = __toESM(require("../specs"));
|
|
39
39
|
var import_holders = __toESM(require("../holders"));
|
|
40
40
|
var import__ = require("../../index");
|
|
41
|
+
var import_EditButton = __toESM(require("../../../components/Header/EditButton"));
|
|
41
42
|
var import_index = require("./index.less");
|
|
42
43
|
var BasicInfo = (props) => {
|
|
43
44
|
const {
|
|
@@ -48,7 +49,11 @@ var BasicInfo = (props) => {
|
|
|
48
49
|
type,
|
|
49
50
|
maxSpecsCount = 1,
|
|
50
51
|
isBundle,
|
|
51
|
-
showFooter
|
|
52
|
+
showFooter,
|
|
53
|
+
isShowOriginalPrice = false,
|
|
54
|
+
isShowEditProduct = false,
|
|
55
|
+
onEditProduct,
|
|
56
|
+
disabledEditClick = false
|
|
52
57
|
} = props;
|
|
53
58
|
const {
|
|
54
59
|
image,
|
|
@@ -85,20 +90,32 @@ var BasicInfo = (props) => {
|
|
|
85
90
|
const displayText = name ? name.slice(0, 2) : "";
|
|
86
91
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: `product-cover-text` }, displayText);
|
|
87
92
|
};
|
|
93
|
+
const renderEdit = (0, import_react.useMemo)(() => {
|
|
94
|
+
if (!isShowEditProduct) return null;
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement(import_EditButton.default, { onEdit: () => onEditProduct == null ? void 0 : onEditProduct(dataSource), disabledEditClick });
|
|
96
|
+
}, [disabledEditClick]);
|
|
97
|
+
const _isShowOriginalPrice = (0, import_react.useMemo)(() => {
|
|
98
|
+
if (!isShowOriginalPrice) return false;
|
|
99
|
+
if (hasSpecs) return false;
|
|
100
|
+
const _originalTotal = parseFloat(String(origin_total || 0));
|
|
101
|
+
const _total = parseFloat(String(total || 0));
|
|
102
|
+
if (isNaN(_originalTotal) || isNaN(total)) return false;
|
|
103
|
+
return _originalTotal !== 0 && _originalTotal != _total;
|
|
104
|
+
}, [isShowOriginalPrice, origin_total, total, hasSpecs]);
|
|
88
105
|
if (type === "a5") {
|
|
89
106
|
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 })));
|
|
90
107
|
}
|
|
91
108
|
if (type === "a9") {
|
|
92
109
|
const showAmount = isBundle && !showFooter;
|
|
93
110
|
const _price = showAmount ? Number(price ?? 0) * num : price;
|
|
94
|
-
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-basic-info ${isBundle ? "row" : ""}` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), /* @__PURE__ */ import_react.default.createElement("div", { className: `product-price` }, (0, import_utils.formatAmount)(_price, 2, symbol))), hasSpecs ? /* @__PURE__ */ import_react.default.createElement(
|
|
111
|
+
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 product-info-a9` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-basic-info-wrap` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-basic-info ${isBundle ? "row" : ""}` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name ${renderEdit ? "product-name-edit" : ""}` }, name), /* @__PURE__ */ import_react.default.createElement("div", { className: `product-price` }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils.formatAmount)(_price, 2, symbol)), _isShowOriginalPrice ? /* @__PURE__ */ import_react.default.createElement("span", { className: `original-price` }, (0, import_utils.formatAmount)(origin_total, 2, symbol)) : null)), hasSpecs ? /* @__PURE__ */ import_react.default.createElement(
|
|
95
112
|
import_specs.default,
|
|
96
113
|
{
|
|
97
114
|
dataSource,
|
|
98
115
|
maxSpecsCount,
|
|
99
116
|
type
|
|
100
117
|
}
|
|
101
|
-
) : null));
|
|
118
|
+
) : null), renderEdit));
|
|
102
119
|
}
|
|
103
120
|
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, maxSpecsCount }) : /* @__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));
|
|
104
121
|
};
|