@pisell/materials 6.11.241 → 6.11.242
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 +4 -4
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +24 -24
- package/es/components/PisellCards/index.d.ts +1 -0
- package/es/components/PisellFields/index.d.ts +1 -0
- package/es/components/PisellGroupView/PisellGroupView.d.ts +9 -0
- package/es/components/PisellGroupView/PisellGroupView.stories.d.ts +27 -0
- package/es/components/PisellGroupView/index.d.ts +6 -0
- package/es/components/PisellGroupView/types.d.ts +124 -0
- package/es/components/PisellGroupView/utils/index.d.ts +20 -0
- package/es/components/PisellLayouts/index.d.ts +1 -0
- package/es/components/PisellMetrics/index.d.ts +1 -0
- package/es/components/PisellTabbar/PisellTabbar.js +3 -4
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +5 -4
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +13 -0
- package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -0
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +89 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +14 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +64 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +49 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +13 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +84 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +20 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +94 -0
- package/es/components/pisellFloorMapLayout/index.d.ts +39 -0
- package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +10 -0
- package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +22 -0
- package/es/components/pisellFloorMapLayout/types.d.ts +769 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +27 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +24 -0
- package/es/components/pisellModal/components/index.d.ts +1 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +9 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +9 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +43 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +34 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +18 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +30 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +330 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +52 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +22 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +57 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +26 -0
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
- package/es/components/pisellRecordBoard/types.d.ts +899 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +36 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +2 -3
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +36 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +4 -5
- package/es/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +15 -0
- package/es/components/productCard/cartSkuCard/components/inlineActions/index.js +3 -1
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +22 -0
- package/es/components/productCard/cartSkuCard/components/weighing/index.d.ts +9 -0
- package/es/components/productCard/cartSkuCard/components/weighing/index.js +12 -14
- package/es/components/productCard/cartSkuCard/index.d.ts +15 -0
- package/es/components/productCard/cartSkuCard/index.less +8 -1
- package/es/components/productCard/lineItem/BookingLineItem.d.ts +23 -0
- package/es/components/productCard/lineItem/components/Holders/index.d.ts +10 -0
- package/es/components/productCard/lineItem/index.d.ts +72 -0
- package/es/components/table/Table/fields/date/index.d.ts +1 -0
- package/es/components/table/Table/fields/index.d.ts +3 -2
- package/es/components/table/Table/fields/link/index.d.ts +1 -0
- package/es/components/table/Table/fields/number/index.d.ts +1 -0
- package/es/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/search/index.d.ts +1 -0
- package/es/components/table/Table/fields/select/index.d.ts +1 -0
- package/es/components/table/Table/fields/text/index.d.ts +1 -0
- package/es/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/hooks/useTableSetting.d.ts +21 -0
- package/es/components/virtual-keyboard/Time/index.d.ts +14 -0
- package/es/components/virtual-keyboard/index.d.ts +25 -0
- package/es/hooks/useTranslationOriginal.d.ts +4 -0
- package/es/pisell-materials.tw.css +1 -1
- package/lib/components/PisellCards/index.d.ts +1 -0
- package/lib/components/PisellFields/index.d.ts +1 -0
- package/lib/components/PisellGroupView/PisellGroupView.d.ts +9 -0
- package/lib/components/PisellGroupView/PisellGroupView.stories.d.ts +27 -0
- package/lib/components/PisellGroupView/index.d.ts +6 -0
- package/lib/components/PisellGroupView/types.d.ts +124 -0
- package/lib/components/PisellGroupView/utils/index.d.ts +20 -0
- package/lib/components/PisellLayouts/index.d.ts +1 -0
- package/lib/components/PisellMetrics/index.d.ts +1 -0
- package/lib/components/PisellTabbar/PisellTabbar.js +2 -2
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +5 -4
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +13 -0
- package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -0
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +89 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +14 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +64 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +49 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +13 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +84 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +20 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +94 -0
- package/lib/components/pisellFloorMapLayout/index.d.ts +39 -0
- package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +10 -0
- package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +22 -0
- package/lib/components/pisellFloorMapLayout/types.d.ts +769 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +27 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +24 -0
- package/lib/components/pisellModal/components/index.d.ts +1 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +9 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +14 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +9 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +43 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +34 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +18 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +30 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +330 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +52 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +22 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +57 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +26 -0
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +14 -0
- package/lib/components/pisellRecordBoard/types.d.ts +899 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +32 -0
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +36 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +1 -2
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +36 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +3 -6
- package/lib/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +15 -0
- package/lib/components/productCard/cartSkuCard/components/inlineActions/index.js +2 -1
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +22 -0
- package/lib/components/productCard/cartSkuCard/components/weighing/index.d.ts +9 -0
- package/lib/components/productCard/cartSkuCard/components/weighing/index.js +11 -14
- package/lib/components/productCard/cartSkuCard/index.d.ts +15 -0
- package/lib/components/productCard/cartSkuCard/index.less +8 -1
- package/lib/components/productCard/lineItem/BookingLineItem.d.ts +23 -0
- package/lib/components/productCard/lineItem/components/Holders/index.d.ts +10 -0
- package/lib/components/productCard/lineItem/index.d.ts +72 -0
- package/lib/components/table/Table/fields/date/index.d.ts +1 -0
- package/lib/components/table/Table/fields/index.d.ts +3 -2
- package/lib/components/table/Table/fields/link/index.d.ts +1 -0
- package/lib/components/table/Table/fields/number/index.d.ts +1 -0
- package/lib/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/search/index.d.ts +1 -0
- package/lib/components/table/Table/fields/select/index.d.ts +1 -0
- package/lib/components/table/Table/fields/text/index.d.ts +1 -0
- package/lib/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/hooks/useTableSetting.d.ts +21 -0
- package/lib/components/virtual-keyboard/Time/index.d.ts +14 -0
- package/lib/components/virtual-keyboard/index.d.ts +25 -0
- package/lib/hooks/useTranslationOriginal.d.ts +4 -0
- package/lib/pisell-materials.tw.css +1 -1
- package/package.json +1 -1
- package/es/components/pisellLookup/PisellLookup.d.ts +0 -4
- package/es/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
- package/es/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
- package/es/components/pisellLookup/types.d.ts +0 -797
- package/es/components/pisellTimeRangeDisplay/index.d.ts +0 -3
- package/lib/components/pisellLookup/PisellLookup.d.ts +0 -4
- package/lib/components/pisellLookup/components/LookupResultHost.d.ts +0 -7
- package/lib/components/pisellLookup/components/LookupTrigger.d.ts +0 -3
- package/lib/components/pisellLookup/types.d.ts +0 -797
- package/lib/components/pisellTimeRangeDisplay/index.d.ts +0 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'dayjs/locale/zh-cn';
|
|
3
|
+
import 'dayjs/locale/en';
|
|
4
|
+
import type { PisellTimeRangeDisplayProps } from './types';
|
|
5
|
+
import './PisellTimeRangeDisplay.less';
|
|
6
|
+
/**
|
|
7
|
+
* PisellTimeRangeDisplay 组件
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* 纯展示型时间区间组件,将 startAt / endAt 格式化为「时间区间 + 持续时间」。
|
|
11
|
+
* - 同一天:HH:mm-HH:mm,可选显示日期/星期
|
|
12
|
+
* - 跨天:起止日期时间
|
|
13
|
+
* - 持续时间:d h m s 格式
|
|
14
|
+
* - 字段顺序由 fieldOrder 控制,可将 duration 放在中间
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <PisellTimeRangeDisplay
|
|
18
|
+
* startAt="2026-02-04 09:00"
|
|
19
|
+
* endAt="2026-02-04 18:00"
|
|
20
|
+
* />
|
|
21
|
+
* // => "09:00-18:00" + "9h"
|
|
22
|
+
*
|
|
23
|
+
* <PisellTimeRangeDisplay
|
|
24
|
+
* startAt={start}
|
|
25
|
+
* endAt={end}
|
|
26
|
+
* fields={{ fieldOrder: ['time', 'duration', 'date', 'weekday'] }}
|
|
27
|
+
* showDateForSameDay
|
|
28
|
+
* />
|
|
29
|
+
*/
|
|
30
|
+
export declare const PisellTimeRangeDisplay: React.FC<PisellTimeRangeDisplayProps>;
|
|
31
|
+
declare const _default: React.NamedExoticComponent<PisellTimeRangeDisplayProps>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Dayjs } from 'dayjs';
|
|
3
|
+
import type { TimeFormatConfig, DateFormatConfig, WeekdayFormatConfig, TextStyleConfig } from '../types';
|
|
4
|
+
export interface TimeRangeBlockProps {
|
|
5
|
+
/** 开始时间 */
|
|
6
|
+
start: Dayjs;
|
|
7
|
+
/** 结束时间 */
|
|
8
|
+
end: Dayjs;
|
|
9
|
+
/** 是否同一天 */
|
|
10
|
+
isSameDay: boolean;
|
|
11
|
+
/** 时间格式配置 */
|
|
12
|
+
timeFormat?: TimeFormatConfig;
|
|
13
|
+
/** 日期格式配置(跨天时用于起止日期,含 showRelativeDay) */
|
|
14
|
+
dateFormat?: DateFormatConfig;
|
|
15
|
+
/** 星期格式配置(跨天时用于「Sat, 22 Jan」) */
|
|
16
|
+
weekdayFormat?: WeekdayFormatConfig;
|
|
17
|
+
/** 跨天时是否展示星期 */
|
|
18
|
+
showWeekdayInCrossDay?: boolean;
|
|
19
|
+
/** 参考日期,用于相对日判定,默认 dayjs() */
|
|
20
|
+
referenceDate?: Dayjs;
|
|
21
|
+
/** 文本样式 */
|
|
22
|
+
style?: TextStyleConfig;
|
|
23
|
+
/** 开始时间文本样式,会覆盖 style 中的同名字段 */
|
|
24
|
+
startStyle?: TextStyleConfig;
|
|
25
|
+
/** 结束时间文本样式,会覆盖 style 中的同名字段 */
|
|
26
|
+
endStyle?: TextStyleConfig;
|
|
27
|
+
/** 自定义类名 */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 时间区间展示块
|
|
32
|
+
* - 同一天:HH:mm-HH:mm
|
|
33
|
+
* - 跨天:起止完整日期时间;若某端为相对日(今天/昨天/明天)则只显示「时间 相对日」,不显示星期+日期
|
|
34
|
+
*/
|
|
35
|
+
export declare const TimeRangeBlock: React.FC<TimeRangeBlockProps>;
|
|
36
|
+
export default TimeRangeBlock;
|
|
@@ -5,10 +5,9 @@ import { Tag, Tooltip } from 'antd';
|
|
|
5
5
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
6
6
|
import { _formatAmount } from "../packages/utils";
|
|
7
7
|
import "./index.less";
|
|
8
|
-
import { locales, formatAmountWithOptions } from '@pisell/utils';
|
|
8
|
+
import { locales, formatAmountWithOptions, resolveWeighingSnapshot } from '@pisell/utils';
|
|
9
9
|
import { PREFIX } from "../../index";
|
|
10
10
|
var Footer = function Footer(_ref) {
|
|
11
|
-
var _item$_origin;
|
|
12
11
|
var item = _ref.item,
|
|
13
12
|
hideDivider = _ref.hideDivider,
|
|
14
13
|
type = _ref.type,
|
|
@@ -19,7 +18,7 @@ var Footer = function Footer(_ref) {
|
|
|
19
18
|
tip = item.tip,
|
|
20
19
|
num = item.num,
|
|
21
20
|
discount_reason = item.discount_reason;
|
|
22
|
-
var weighingInfo =
|
|
21
|
+
var weighingInfo = resolveWeighingSnapshot(item);
|
|
23
22
|
var formatFooterAmount = function formatFooterAmount(amount) {
|
|
24
23
|
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
25
24
|
if (!weighingInfo) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface IProps {
|
|
4
|
+
isShowImage?: boolean;
|
|
5
|
+
dataSource: {
|
|
6
|
+
image?: string;
|
|
7
|
+
bundle?: any[];
|
|
8
|
+
options?: any[];
|
|
9
|
+
product_option_string?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
symbol?: string;
|
|
12
|
+
price?: string | number;
|
|
13
|
+
total?: number;
|
|
14
|
+
origin_total?: number;
|
|
15
|
+
num?: number;
|
|
16
|
+
holder_id?: any;
|
|
17
|
+
isFormSubject?: boolean;
|
|
18
|
+
totalDifference?: number;
|
|
19
|
+
};
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/** 作为主商品卡片展示
|
|
22
|
+
* 1. 影响商品数量 tag 的位置
|
|
23
|
+
* 2. isMain 且 type 为 a5,展示holder
|
|
24
|
+
*/
|
|
25
|
+
isMainProduct?: boolean;
|
|
26
|
+
maxSpecsCount?: number;
|
|
27
|
+
type?: 'a2' | 'a5' | 'a9';
|
|
28
|
+
isBundle?: boolean;
|
|
29
|
+
showFooter?: boolean;
|
|
30
|
+
isShowOriginalPrice?: boolean;
|
|
31
|
+
isShowEditProduct?: boolean;
|
|
32
|
+
onEditProduct?: (val: any) => void;
|
|
33
|
+
disabledEditClick?: boolean;
|
|
34
|
+
}
|
|
35
|
+
declare const BasicInfo: (props: IProps) => React.JSX.Element;
|
|
36
|
+
export default BasicInfo;
|
|
@@ -4,7 +4,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
4
4
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
5
|
import React, { useMemo } from 'react';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import { image as imageAli, formatAmount } from '@pisell/utils';
|
|
7
|
+
import { image as imageAli, formatAmount, resolveWeighingSnapshot } from '@pisell/utils';
|
|
8
8
|
import Specs from "../specs";
|
|
9
9
|
import Holders from "../holders";
|
|
10
10
|
import Weighing from "../weighing";
|
|
@@ -12,7 +12,6 @@ import { PREFIX } from "../../index";
|
|
|
12
12
|
import EditButton from "../../../components/Header/EditButton";
|
|
13
13
|
import "./index.less";
|
|
14
14
|
var BasicInfo = function BasicInfo(props) {
|
|
15
|
-
var _origin;
|
|
16
15
|
var isShowImage = props.isShowImage,
|
|
17
16
|
_props$dataSource = props.dataSource,
|
|
18
17
|
dataSource = _props$dataSource === void 0 ? {} : _props$dataSource,
|
|
@@ -55,8 +54,8 @@ var BasicInfo = function BasicInfo(props) {
|
|
|
55
54
|
}, num < 100 ? num : '99+');
|
|
56
55
|
};
|
|
57
56
|
var hasSpecs = (bundle === null || bundle === void 0 ? void 0 : bundle.length) || (options === null || options === void 0 ? void 0 : options.length) || product_option_string;
|
|
58
|
-
var weighingInfo =
|
|
59
|
-
var hasWeighingInfo = Boolean(weighingInfo
|
|
57
|
+
var weighingInfo = resolveWeighingSnapshot(dataSource);
|
|
58
|
+
var hasWeighingInfo = Boolean(weighingInfo);
|
|
60
59
|
var hasProductMeta = hasSpecs || hasWeighingInfo;
|
|
61
60
|
var basicInfoClassName = classNames("".concat(PREFIX, "__basic-info"), _defineProperty({}, "".concat(PREFIX, "__basic-info--weighing"), hasWeighingInfo));
|
|
62
61
|
var renderProductMeta = function renderProductMeta() {
|
|
@@ -75,7 +74,7 @@ var BasicInfo = function BasicInfo(props) {
|
|
|
75
74
|
}) : null);
|
|
76
75
|
};
|
|
77
76
|
var renderProductPrice = function renderProductPrice() {
|
|
78
|
-
if (
|
|
77
|
+
if (hasWeighingInfo) {
|
|
79
78
|
return null;
|
|
80
79
|
}
|
|
81
80
|
return formatAmount(price, 2, symbol);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface InlineActionItem {
|
|
5
|
+
key: string | number;
|
|
6
|
+
text: ReactNode;
|
|
7
|
+
color?: string;
|
|
8
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
interface InlineActionsProps {
|
|
12
|
+
actions: InlineActionItem[];
|
|
13
|
+
}
|
|
14
|
+
declare const InlineActions: ({ actions }: InlineActionsProps) => React.JSX.Element | null;
|
|
15
|
+
export default InlineActions;
|
|
@@ -21,7 +21,9 @@ var InlineActions = function InlineActions(_ref) {
|
|
|
21
21
|
}),
|
|
22
22
|
onClick: function onClick(event) {
|
|
23
23
|
var _action$onClick;
|
|
24
|
-
|
|
24
|
+
// 行内数量、删除等操作属于独立交互,不能继续触发外层商品卡片的编辑事件。
|
|
25
|
+
event.stopPropagation();
|
|
26
|
+
(_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action, event);
|
|
25
27
|
}
|
|
26
28
|
}, action.text);
|
|
27
29
|
}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface SpecsProps {
|
|
4
|
+
/** 数据源 */
|
|
5
|
+
dataSource?: {
|
|
6
|
+
bundle?: Array<{
|
|
7
|
+
title: string;
|
|
8
|
+
}>;
|
|
9
|
+
options?: Array<{
|
|
10
|
+
name: string;
|
|
11
|
+
price: number;
|
|
12
|
+
num: number;
|
|
13
|
+
}>;
|
|
14
|
+
product_option_string?: string;
|
|
15
|
+
symbol?: string;
|
|
16
|
+
};
|
|
17
|
+
/** 最大展示数量,默认为 1 */
|
|
18
|
+
maxSpecsCount?: number;
|
|
19
|
+
type?: 'a2' | 'a5' | 'a9';
|
|
20
|
+
}
|
|
21
|
+
declare const Specs: (props: SpecsProps) => React.JSX.Element | null;
|
|
22
|
+
export default Specs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WeighingSnapshot } from '@pisell/utils';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface WeighingProps {
|
|
5
|
+
dataSource?: WeighingSnapshot;
|
|
6
|
+
symbol?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Weighing: (props: WeighingProps) => React.JSX.Element | null;
|
|
9
|
+
export default Weighing;
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { locales } from '@pisell/utils';
|
|
2
|
+
import { STANDARD_WEIGHT_UNIT, formatWeightValue, getWeightUnitSymbol, locales } from '@pisell/utils';
|
|
3
3
|
import { PREFIX } from "../../index";
|
|
4
4
|
import "./index.less";
|
|
5
|
-
var UNIT_LABEL_MAP = {
|
|
6
|
-
KILOGRAMS: 'kg',
|
|
7
|
-
GRAMS: 'g',
|
|
8
|
-
POUNDS: 'lb',
|
|
9
|
-
OUNCES: 'oz'
|
|
10
|
-
};
|
|
11
5
|
var formatWeight = function formatWeight(value, unit) {
|
|
12
6
|
var parsedValue = Number(value);
|
|
13
7
|
var displayValue = Number.isFinite(parsedValue) ? parsedValue : 0;
|
|
14
|
-
var displayUnit =
|
|
15
|
-
return "".concat(displayValue
|
|
8
|
+
var displayUnit = getWeightUnitSymbol(unit);
|
|
9
|
+
return "".concat(formatWeightValue(displayValue), " ").concat(displayUnit);
|
|
16
10
|
};
|
|
17
11
|
var Weighing = function Weighing(props) {
|
|
12
|
+
var _ref, _tare$value, _tare$value2;
|
|
18
13
|
var dataSource = props.dataSource,
|
|
19
14
|
symbol = props.symbol;
|
|
20
15
|
if (!dataSource) {
|
|
21
16
|
return null;
|
|
22
17
|
}
|
|
23
18
|
var mode = dataSource.mode,
|
|
19
|
+
weight_source = dataSource.weight_source,
|
|
24
20
|
weight = dataSource.weight,
|
|
25
21
|
tare = dataSource.tare,
|
|
22
|
+
tare_weight = dataSource.tare_weight,
|
|
26
23
|
net_weight = dataSource.net_weight,
|
|
27
24
|
unit_price = dataSource.unit_price,
|
|
28
25
|
_dataSource$unit = dataSource.unit,
|
|
29
|
-
unit = _dataSource$unit === void 0 ?
|
|
30
|
-
var unitLabel =
|
|
31
|
-
var tareValue = Number((tare === null || tare === void 0 ? void 0 : tare.value)
|
|
32
|
-
var
|
|
26
|
+
unit = _dataSource$unit === void 0 ? STANDARD_WEIGHT_UNIT : _dataSource$unit;
|
|
27
|
+
var unitLabel = getWeightUnitSymbol(unit);
|
|
28
|
+
var tareValue = Number((_ref = (_tare$value = tare === null || tare === void 0 ? void 0 : tare.value) !== null && _tare$value !== void 0 ? _tare$value : tare_weight) !== null && _ref !== void 0 ? _ref : 0);
|
|
29
|
+
var tareUnit = (tare === null || tare === void 0 ? void 0 : tare.unit) || unit;
|
|
30
|
+
var isManualWeight = (mode !== null && mode !== void 0 ? mode : weight_source) === 'manual';
|
|
33
31
|
var grossLabel = locales.getText('pisell2.cart.sku-card.weighing.gross');
|
|
34
32
|
var tareLabel = locales.getText('pisell2.cart.sku-card.weighing.tare');
|
|
35
33
|
var netLabel = locales.getText('pisell2.cart.sku-card.weighing.net');
|
|
@@ -42,7 +40,7 @@ var Weighing = function Weighing(props) {
|
|
|
42
40
|
className: "".concat(PREFIX, "__weighing-row ").concat(PREFIX, "__weighing-row--large")
|
|
43
41
|
}, /*#__PURE__*/React.createElement("span", null, "".concat(manualPrefix).concat(grossLabel, ": ").concat(formatWeight(weight, unit)))) : null, tareValue > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
44
42
|
className: "".concat(PREFIX, "__weighing-row ").concat(PREFIX, "__weighing-row--large")
|
|
45
|
-
}, /*#__PURE__*/React.createElement("span", null, "".concat(tareLabel, ": ").concat(formatWeight(tare === null || tare === void 0 ? void 0 : tare.value
|
|
43
|
+
}, /*#__PURE__*/React.createElement("span", null, "".concat(tareLabel, ": ").concat(formatWeight((_tare$value2 = tare === null || tare === void 0 ? void 0 : tare.value) !== null && _tare$value2 !== void 0 ? _tare$value2 : tare_weight, tareUnit)))) : null, /*#__PURE__*/React.createElement("div", {
|
|
46
44
|
className: "".concat(PREFIX, "__weighing-row ").concat(PREFIX, "__weighing-row--large")
|
|
47
45
|
}, /*#__PURE__*/React.createElement("span", null, netWeightText), /*#__PURE__*/React.createElement("span", {
|
|
48
46
|
className: "".concat(PREFIX, "__weighing-unit-price")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
import { ProductCardTypes } from '../types';
|
|
4
|
+
interface ISKUCardProps extends Omit<ProductCardTypes, 'dataSource'> {
|
|
5
|
+
dataSource: any;
|
|
6
|
+
itemType?: 'booking' | 'product';
|
|
7
|
+
type: 'a2' | 'a5' | 'a9';
|
|
8
|
+
rightActions: any[];
|
|
9
|
+
rightActionsDisplay?: 'swipe' | 'inline';
|
|
10
|
+
escapeDom?: string;
|
|
11
|
+
isShowRelatedProduct?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const PREFIX = "pisell-cart-sku-card";
|
|
14
|
+
declare const CartSkuCard: (props: ISKUCardProps) => React.JSX.Element | null;
|
|
15
|
+
export default CartSkuCard;
|
|
@@ -28,7 +28,14 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.pisell-cart-sku-card {
|
|
31
|
-
|
|
31
|
+
// 浏览器无法可靠换算屏幕物理尺寸:保留设计基准,并允许按送检设备校准。
|
|
32
|
+
// 当前送检机 30px 实测约 3mm,因此默认系数为 4/3;设备侧可覆盖该系数。
|
|
33
|
+
--pisell-cart-sku-card-weighing-font-base: 30px;
|
|
34
|
+
--pisell-cart-sku-card-device-font-scale: 1.333333;
|
|
35
|
+
--pisell-cart-sku-card-physical-text-height: calc(
|
|
36
|
+
var(--pisell-cart-sku-card-weighing-font-base) *
|
|
37
|
+
var(--pisell-cart-sku-card-device-font-scale)
|
|
38
|
+
);
|
|
32
39
|
|
|
33
40
|
padding: 4px 8px 4px 4px;
|
|
34
41
|
border-radius: inherit;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProductCardTypes } from '../types';
|
|
3
|
+
import type { LineItemHolderOption, LineItemStatusOption, LineItemType } from './types';
|
|
4
|
+
interface BookingLineItemProps extends Omit<ProductCardTypes, 'dataSource'> {
|
|
5
|
+
dataSource: any;
|
|
6
|
+
type: LineItemType;
|
|
7
|
+
cartSkuType: 'a2' | 'a5' | 'a9';
|
|
8
|
+
isShowBookingHeader: boolean;
|
|
9
|
+
relatedProductDataSource?: any;
|
|
10
|
+
addTimeProductDataSources?: any[];
|
|
11
|
+
rightActions?: any[];
|
|
12
|
+
rightActionsDisplay?: 'swipe' | 'inline';
|
|
13
|
+
escapeDom?: string;
|
|
14
|
+
statusOptions?: LineItemStatusOption[];
|
|
15
|
+
statusLoading?: boolean;
|
|
16
|
+
statusDisabled?: boolean;
|
|
17
|
+
isShowRelatedProduct?: boolean;
|
|
18
|
+
holderOptions?: LineItemHolderOption[];
|
|
19
|
+
onBookingStatusChange?: (status: string, item: any) => void;
|
|
20
|
+
onAddTimeProductCard?: (item: any) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const BookingLineItem: (props: BookingLineItemProps) => React.JSX.Element | null;
|
|
23
|
+
export default BookingLineItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LineItemHolderOption } from '../../types';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface LineItemHoldersProps {
|
|
5
|
+
dataSource?: any;
|
|
6
|
+
holderOptions?: LineItemHolderOption[];
|
|
7
|
+
isFormSubject?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const LineItemHolders: (props: LineItemHoldersProps) => React.JSX.Element | null;
|
|
10
|
+
export default LineItemHolders;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProductCardTypes } from '../types';
|
|
3
|
+
import type { itemType, LineItemHolderOption, LineItemStatusOption, LineItemType } from './types';
|
|
4
|
+
import './index.less';
|
|
5
|
+
export declare const PREFIX = "pisell-line-item";
|
|
6
|
+
export type { itemType, LineItemHolderOption, LineItemStatusOption, LineItemType, } from './types';
|
|
7
|
+
declare type LocalizedText = string | Record<string, unknown> | null | undefined;
|
|
8
|
+
export interface LineItemProps extends Omit<ProductCardTypes, 'dataSource'> {
|
|
9
|
+
dataSource: any;
|
|
10
|
+
itemType?: itemType;
|
|
11
|
+
type?: LineItemType;
|
|
12
|
+
isShowBookingHeader: boolean;
|
|
13
|
+
rightActions?: any[];
|
|
14
|
+
rightActionsDisplay?: 'swipe' | 'inline';
|
|
15
|
+
escapeDom?: string;
|
|
16
|
+
statusOptions?: LineItemStatusOption[];
|
|
17
|
+
statusLoading?: boolean;
|
|
18
|
+
statusDisabled?: boolean;
|
|
19
|
+
isShowRelatedProduct?: boolean;
|
|
20
|
+
holderOptions?: LineItemHolderOption[];
|
|
21
|
+
onBookingStatusChange?: (status: string, item: any) => void;
|
|
22
|
+
onAddTimeProductCard?: (item: any) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const convertProductToLineItemProduct: (product: any, translationOriginal: (text: LocalizedText) => string, symbol: string) => {
|
|
25
|
+
_id: any;
|
|
26
|
+
id: any;
|
|
27
|
+
product_id: any;
|
|
28
|
+
product_variant_id: any;
|
|
29
|
+
title: string;
|
|
30
|
+
product_title: string;
|
|
31
|
+
name: string;
|
|
32
|
+
cover: any;
|
|
33
|
+
image: any;
|
|
34
|
+
num: any;
|
|
35
|
+
quantity: any;
|
|
36
|
+
price: any;
|
|
37
|
+
total: any;
|
|
38
|
+
origin_total: string | number | undefined;
|
|
39
|
+
original_total: string | number | undefined;
|
|
40
|
+
source_product_price: any;
|
|
41
|
+
selling_price: any;
|
|
42
|
+
payment_price: any;
|
|
43
|
+
tax_fee: any;
|
|
44
|
+
symbol: string;
|
|
45
|
+
note: any;
|
|
46
|
+
product_sku: any;
|
|
47
|
+
product_bundle: any;
|
|
48
|
+
bundle: any;
|
|
49
|
+
product_option_string: any;
|
|
50
|
+
options: any[];
|
|
51
|
+
discount_list: any;
|
|
52
|
+
promotions: any;
|
|
53
|
+
discount_reason: any;
|
|
54
|
+
isGift: boolean;
|
|
55
|
+
giftData: any;
|
|
56
|
+
_origin: any;
|
|
57
|
+
_extend: {
|
|
58
|
+
other: {
|
|
59
|
+
product_id: any;
|
|
60
|
+
option: any[];
|
|
61
|
+
bundle: any;
|
|
62
|
+
product_variant_id: any;
|
|
63
|
+
quantity: any;
|
|
64
|
+
};
|
|
65
|
+
note: any;
|
|
66
|
+
total: any;
|
|
67
|
+
origin_total: string | number | undefined;
|
|
68
|
+
payment_price: any;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
declare const LineItem: (props: LineItemProps) => React.JSX.Element;
|
|
72
|
+
export default LineItem;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const fieldMaps: {
|
|
2
3
|
text: {
|
|
3
4
|
field: {
|
|
@@ -197,12 +198,12 @@ export declare const fieldList: ({
|
|
|
197
198
|
field_icon: string;
|
|
198
199
|
field_name: string;
|
|
199
200
|
field_type: string;
|
|
200
|
-
default_value:
|
|
201
|
+
default_value: boolean;
|
|
201
202
|
} | {
|
|
202
203
|
field_icon: string;
|
|
203
204
|
field_name: string;
|
|
204
205
|
field_type: string;
|
|
205
|
-
default_value:
|
|
206
|
+
default_value: string;
|
|
206
207
|
} | {
|
|
207
208
|
field_icon: string;
|
|
208
209
|
field_name: string;
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("filters" | "
|
|
158
|
+
}) => ("filters" | "column_setting" | "gallery_setting" | "order_by" | "group_by" | "view_mode" | "filter_setting")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FilterType } from "../../filter/types";
|
|
2
|
+
import { ColumnSettingType, DataSourceGroupType, GallerySettingType, GridViewType, ModeType, SortType, ExportImportModeType, LocalSettingsType } from "../types";
|
|
3
|
+
declare type UseTableSettingProps = {
|
|
4
|
+
tableId?: string;
|
|
5
|
+
filter: FilterType;
|
|
6
|
+
columns: Record<string, any>[];
|
|
7
|
+
columnSetting?: ColumnSettingType;
|
|
8
|
+
dataSourceGroup?: DataSourceGroupType;
|
|
9
|
+
sort?: SortType;
|
|
10
|
+
view: GridViewType;
|
|
11
|
+
currentViewMode: ModeType;
|
|
12
|
+
gallery?: GallerySettingType;
|
|
13
|
+
currentSettingHash: string;
|
|
14
|
+
exportImport?: ExportImportModeType;
|
|
15
|
+
localSettings?: LocalSettingsType;
|
|
16
|
+
};
|
|
17
|
+
declare const useTableSetting: (params: UseTableSettingProps) => {
|
|
18
|
+
setTableSetting: (this: unknown, values: Record<string, any>) => void;
|
|
19
|
+
tableSetting: any;
|
|
20
|
+
};
|
|
21
|
+
export default useTableSetting;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Item } from "../Keyboard";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
export interface VirtualKeyboardTimeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
selectType?: 'light' | 'dark';
|
|
7
|
+
onChange?: (value?: any) => void;
|
|
8
|
+
value?: any;
|
|
9
|
+
items?: Item[];
|
|
10
|
+
onEnter?: (value: any) => void;
|
|
11
|
+
rightPanel?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const VirtualKeyboardTime: (props: VirtualKeyboardTimeProps) => React.JSX.Element;
|
|
14
|
+
export default VirtualKeyboardTime;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { KeyboardProps } from "./Keyboard";
|
|
3
|
+
import { VirtualKeyInputProps } from "./VirtualKeyInput";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
interface VirtualKeyboardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
keyboardProps?: KeyboardProps;
|
|
7
|
+
virtualKeyInputProps?: VirtualKeyInputProps;
|
|
8
|
+
rightPanel?: React.ReactNode;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
onChange?: (value?: any) => void;
|
|
11
|
+
value?: string;
|
|
12
|
+
selectType?: 'light' | 'dark';
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
containerBackgroundColor?: string;
|
|
15
|
+
buttonBackgroundColor?: string;
|
|
16
|
+
textColor?: string;
|
|
17
|
+
keyboardBackgroundColor?: string;
|
|
18
|
+
keyboardButtonBackgroundColor?: string;
|
|
19
|
+
keyboardButtonTextColor?: string;
|
|
20
|
+
keyboardButtonHoverColor?: string;
|
|
21
|
+
primaryButtonBackgroundColor?: string;
|
|
22
|
+
primaryButtonTextColor?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const VirtualKeyboard: (props: VirtualKeyboardProps) => React.JSX.Element;
|
|
25
|
+
export default VirtualKeyboard;
|