@pisell/materials 6.11.212 → 6.11.214
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 +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/PisellTabbar/PisellTabbar.js +35 -8
- package/es/components/PisellTabbar/template/Template1/PisellTabbar.js +35 -8
- package/es/components/PisellTabbar/types.d.ts +2 -0
- package/es/components/pisellFind/index.d.ts +9 -4
- package/es/components/pisellFind/index.js +46 -13
- package/es/components/pisellLookup/PisellLookup.js +7 -2
- package/es/components/pisellLookup/components/LookupTrigger.js +36 -9
- package/es/components/pisellLookup/types.d.ts +63 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +9 -2
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +33 -9
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +86 -11
- package/es/components/pisellRecordBoard/shellFrame/index.js +1 -0
- package/es/components/pisellRecordBoard/types.d.ts +7 -0
- package/es/components/pisellShellFrame/PisellShellFrame.less +5 -0
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +6 -1
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.js +53 -20
- package/es/components/productCard/lineItem/BookingLineItem.js +95 -32
- package/es/components/productCard/lineItem/index.js +9 -1
- package/es/components/productCard/lineItem/index.less +33 -0
- package/es/components/productCard/lineItem/locales.js +20 -5
- package/es/index.d.ts +1 -1
- package/lib/components/PisellTabbar/PisellTabbar.js +16 -4
- package/lib/components/PisellTabbar/template/Template1/PisellTabbar.js +16 -4
- package/lib/components/PisellTabbar/types.d.ts +2 -0
- package/lib/components/pisellFind/index.d.ts +9 -4
- package/lib/components/pisellFind/index.js +29 -10
- package/lib/components/pisellLookup/PisellLookup.js +9 -1
- package/lib/components/pisellLookup/components/LookupTrigger.js +17 -0
- package/lib/components/pisellLookup/types.d.ts +63 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +9 -2
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +21 -6
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +86 -11
- package/lib/components/pisellRecordBoard/shellFrame/index.js +1 -0
- package/lib/components/pisellRecordBoard/types.d.ts +7 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.less +5 -0
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +6 -1
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.js +37 -20
- package/lib/components/productCard/lineItem/BookingLineItem.js +93 -43
- package/lib/components/productCard/lineItem/index.js +9 -1
- package/lib/components/productCard/lineItem/index.less +33 -0
- package/lib/components/productCard/lineItem/locales.js +20 -5
- package/lib/index.d.ts +1 -1
- package/package.json +2 -2
- package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -30
- package/es/components/pisellTimeRangeDisplay/types.d.ts +0 -137
- package/es/components/productCard/lineItem/BookingLineItem.d.ts +0 -19
- package/es/components/productCard/lineItem/index.d.ts +0 -69
- package/es/components/productCard/lineItem/locales.d.ts +0 -23
- package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
- package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -30
- package/lib/components/pisellTimeRangeDisplay/types.d.ts +0 -137
- package/lib/components/productCard/lineItem/BookingLineItem.d.ts +0 -19
- package/lib/components/productCard/lineItem/index.d.ts +0 -69
- package/lib/components/productCard/lineItem/locales.d.ts +0 -23
|
@@ -20,17 +20,34 @@
|
|
|
20
20
|
padding-bottom: 0 !important;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/* 表格 /
|
|
23
|
+
/* 表格 / 资源墙:左右 16px;上下 6px(覆盖 GridPro 默认 padding-bottom: 16px) */
|
|
24
24
|
.pisell-grid-pro-toolbar.pisell-record-board-toolbar--grid,
|
|
25
25
|
.pisell-grid-pro-toolbar.pisell-record-board-toolbar--resource-wall {
|
|
26
|
-
padding
|
|
27
|
-
|
|
26
|
+
padding: 6px 16px !important;
|
|
27
|
+
gap: 4px;
|
|
28
|
+
|
|
29
|
+
> .pisell-grid-pro-toolbar-row.toolbar-row,
|
|
30
|
+
> .toolbar-row {
|
|
31
|
+
gap: 4px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.toolbar-row-left {
|
|
35
|
+
gap: 4px;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.toolbar-row-right {
|
|
40
|
+
gap: 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.record-board-toolbar-right-actions.ant-space {
|
|
44
|
+
gap: 4px !important;
|
|
45
|
+
}
|
|
28
46
|
}
|
|
29
47
|
|
|
30
48
|
#body .pisell-grid-pro-toolbar.pisell-record-board-toolbar--grid,
|
|
31
49
|
#body .pisell-grid-pro-toolbar.pisell-record-board-toolbar--resource-wall {
|
|
32
|
-
padding
|
|
33
|
-
padding-right: 16px;
|
|
50
|
+
padding: 6px 16px !important;
|
|
34
51
|
}
|
|
35
52
|
|
|
36
53
|
/**
|
|
@@ -126,29 +143,29 @@
|
|
|
126
143
|
*/
|
|
127
144
|
.pisell-grid-pro-toolbar.pisell-record-board-toolbar--compact {
|
|
128
145
|
// padding-bottom: 8px !important;
|
|
129
|
-
gap:
|
|
146
|
+
gap: 4px !important;
|
|
130
147
|
|
|
131
148
|
> .pisell-grid-pro-toolbar-row.toolbar-row,
|
|
132
149
|
> .toolbar-row {
|
|
133
|
-
gap:
|
|
150
|
+
gap: 4px !important;
|
|
134
151
|
align-items: center;
|
|
135
152
|
}
|
|
136
153
|
|
|
137
154
|
.toolbar-row-left {
|
|
138
155
|
align-items: center !important;
|
|
139
|
-
gap:
|
|
156
|
+
gap: 4px !important;
|
|
140
157
|
}
|
|
141
158
|
|
|
142
159
|
.toolbar-row-right {
|
|
143
|
-
gap:
|
|
160
|
+
gap: 4px !important;
|
|
144
161
|
}
|
|
145
162
|
|
|
146
163
|
.record-board-toolbar-right-actions.ant-space {
|
|
147
|
-
gap:
|
|
164
|
+
gap: 4px !important;
|
|
148
165
|
}
|
|
149
166
|
|
|
150
167
|
.record-board-toolbar-top-left {
|
|
151
|
-
gap:
|
|
168
|
+
gap: 4px;
|
|
152
169
|
}
|
|
153
170
|
|
|
154
171
|
.pisell-lookup-input-suffix {
|
|
@@ -510,6 +527,64 @@
|
|
|
510
527
|
}
|
|
511
528
|
}
|
|
512
529
|
|
|
530
|
+
/**
|
|
531
|
+
* 桌面 opt-in 收纳(collapseActions='gear'):按钮等宽撑满、收紧上下间距,
|
|
532
|
+
* 避免默认居中布局在 180px Popover 内两侧/上下留出大量空白。
|
|
533
|
+
*/
|
|
534
|
+
.record-board-toolbar-settings-gear-overlay--collapsed-actions {
|
|
535
|
+
.ant-popover-inner-content,
|
|
536
|
+
.pisell-lowcode-popover-inner-content {
|
|
537
|
+
box-sizing: border-box;
|
|
538
|
+
width: auto !important;
|
|
539
|
+
min-width: 120px !important;
|
|
540
|
+
padding: 6px !important;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.record-board-toolbar-settings-gear-popover {
|
|
544
|
+
gap: 6px;
|
|
545
|
+
width: 100%;
|
|
546
|
+
align-items: stretch;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.record-board-toolbar-settings-gear-row {
|
|
550
|
+
width: 100%;
|
|
551
|
+
gap: 6px;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/** Sort / Filter / Reset:等宽铺满,去掉两侧空白 */
|
|
555
|
+
.record-board-toolbar-settings-gear-row:has(.record-board-toolbar-filter-btn),
|
|
556
|
+
.record-board-toolbar-settings-gear-row:has(.record-board-toolbar-reset) {
|
|
557
|
+
justify-content: stretch;
|
|
558
|
+
|
|
559
|
+
> * {
|
|
560
|
+
display: block;
|
|
561
|
+
width: 100%;
|
|
562
|
+
min-width: 0;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.record-board-toolbar-filter-btn,
|
|
567
|
+
.record-board-toolbar-filter-btn.ant-btn,
|
|
568
|
+
.record-board-toolbar-filter-btn.pisell-lowcode-btn,
|
|
569
|
+
.record-board-toolbar-reset,
|
|
570
|
+
.record-board-toolbar-reset.ant-btn,
|
|
571
|
+
.record-board-toolbar-reset.pisell-lowcode-btn {
|
|
572
|
+
box-sizing: border-box;
|
|
573
|
+
width: 100% !important;
|
|
574
|
+
min-width: 0 !important;
|
|
575
|
+
min-height: 36px !important;
|
|
576
|
+
height: auto !important;
|
|
577
|
+
padding: 6px 10px !important;
|
|
578
|
+
justify-content: center;
|
|
579
|
+
|
|
580
|
+
&.pisell-lowcode-btn-lg,
|
|
581
|
+
&.ant-btn-lg {
|
|
582
|
+
min-height: 36px !important;
|
|
583
|
+
padding: 6px 10px !important;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
513
588
|
.record-board-toolbar-settings-gear-popover {
|
|
514
589
|
display: flex;
|
|
515
590
|
flex-direction: column;
|
|
@@ -315,6 +315,7 @@ var RecordBoardShellFrame = ({ children, className, style, belowToolbar }) => {
|
|
|
315
315
|
className: (0, import_classnames.default)(className, {
|
|
316
316
|
/** 非表格主区:工具栏与内容区无缝(与 PisellShellFrame.less body-subview 配对) */
|
|
317
317
|
"pisell-shell-frame--body-subview": !showGrid,
|
|
318
|
+
"pisell-shell-frame--grid-view": showGrid,
|
|
318
319
|
"pisell-shell-frame--floor-map-view": showFloorMap,
|
|
319
320
|
"pisell-shell-frame--calendar-view": showCalendar,
|
|
320
321
|
"pisell-shell-frame--resource-wall-view": showResourceWall
|
|
@@ -707,6 +707,13 @@ export interface RecordBoardToolBarProps {
|
|
|
707
707
|
* 以便快筛按钮换行后图标组与**最后一行**快筛右缘对齐(HUD 抽屉等极窄场景)。
|
|
708
708
|
*/
|
|
709
709
|
mergeCompactNarrowTrailingWithQuickFilterRow?: boolean;
|
|
710
|
+
/**
|
|
711
|
+
* 桌面(非 compact-narrow)下把右侧操作区(列显示 / 排序 / 筛选 / 重置)收进一个齿轮按钮的 Popover,
|
|
712
|
+
* 复用 compact-narrow 的齿轮机制以节省顶栏宽度。opt-in,默认平铺。
|
|
713
|
+
* `compact-narrow` 始终强制收纳,不受此项影响。
|
|
714
|
+
* @default undefined
|
|
715
|
+
*/
|
|
716
|
+
collapseActions?: 'gear';
|
|
710
717
|
}
|
|
711
718
|
/** Search 透传配置,与 PisellFind 的 props 对齐 */
|
|
712
719
|
export declare type RecordBoardSearchProps = Record<string, any>;
|
|
@@ -55,6 +55,8 @@ var PisellTimeRangeDisplay = (props) => {
|
|
|
55
55
|
durationFormat,
|
|
56
56
|
containerStyle,
|
|
57
57
|
timeStyle,
|
|
58
|
+
startTimeStyle,
|
|
59
|
+
endTimeStyle,
|
|
58
60
|
dateStyle,
|
|
59
61
|
weekdayStyle,
|
|
60
62
|
durationStyle,
|
|
@@ -114,8 +116,11 @@ var PisellTimeRangeDisplay = (props) => {
|
|
|
114
116
|
timeFormat,
|
|
115
117
|
dateFormat: effectiveDateFormat,
|
|
116
118
|
weekdayFormat,
|
|
119
|
+
showWeekdayInCrossDay: showWeekday,
|
|
117
120
|
referenceDate: (0, import_dayjs.default)(),
|
|
118
|
-
style: timeStyle
|
|
121
|
+
style: timeStyle,
|
|
122
|
+
startStyle: startTimeStyle,
|
|
123
|
+
endStyle: endTimeStyle
|
|
119
124
|
}
|
|
120
125
|
) : null;
|
|
121
126
|
case "date":
|
|
@@ -43,8 +43,11 @@ var TimeRangeBlock = ({
|
|
|
43
43
|
timeFormat,
|
|
44
44
|
dateFormat,
|
|
45
45
|
weekdayFormat,
|
|
46
|
+
showWeekdayInCrossDay = true,
|
|
46
47
|
referenceDate = (0, import_dayjs.default)(),
|
|
47
48
|
style,
|
|
49
|
+
startStyle,
|
|
50
|
+
endStyle,
|
|
48
51
|
className
|
|
49
52
|
}) => {
|
|
50
53
|
const inlineStyle = {
|
|
@@ -53,6 +56,20 @@ var TimeRangeBlock = ({
|
|
|
53
56
|
color: style == null ? void 0 : style.color,
|
|
54
57
|
lineHeight: style == null ? void 0 : style.lineHeight
|
|
55
58
|
};
|
|
59
|
+
const startInlineStyle = {
|
|
60
|
+
...inlineStyle,
|
|
61
|
+
fontSize: (startStyle == null ? void 0 : startStyle.fontSize) ?? inlineStyle.fontSize,
|
|
62
|
+
fontWeight: (startStyle == null ? void 0 : startStyle.fontWeight) ?? inlineStyle.fontWeight,
|
|
63
|
+
color: (startStyle == null ? void 0 : startStyle.color) ?? inlineStyle.color,
|
|
64
|
+
lineHeight: (startStyle == null ? void 0 : startStyle.lineHeight) ?? inlineStyle.lineHeight
|
|
65
|
+
};
|
|
66
|
+
const endInlineStyle = {
|
|
67
|
+
...inlineStyle,
|
|
68
|
+
fontSize: (endStyle == null ? void 0 : endStyle.fontSize) ?? inlineStyle.fontSize,
|
|
69
|
+
fontWeight: (endStyle == null ? void 0 : endStyle.fontWeight) ?? inlineStyle.fontWeight,
|
|
70
|
+
color: (endStyle == null ? void 0 : endStyle.color) ?? inlineStyle.color,
|
|
71
|
+
lineHeight: (endStyle == null ? void 0 : endStyle.lineHeight) ?? inlineStyle.lineHeight
|
|
72
|
+
};
|
|
56
73
|
if (isSameDay) {
|
|
57
74
|
const startStr = (0, import_utils.formatTime)(start, timeFormat);
|
|
58
75
|
const endStr = (0, import_utils.formatTime)(end, timeFormat);
|
|
@@ -62,35 +79,35 @@ var TimeRangeBlock = ({
|
|
|
62
79
|
className: `pisell-time-range-display-time ${className || ""}`.trim(),
|
|
63
80
|
style: inlineStyle
|
|
64
81
|
},
|
|
65
|
-
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-start" }, startStr),
|
|
66
|
-
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-end-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-sep", "aria-hidden": true }, " - "), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-end" }, endStr))
|
|
82
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-start", style: startInlineStyle }, startStr),
|
|
83
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-end-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-sep", style: inlineStyle, "aria-hidden": true }, " - "), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-end", style: endInlineStyle }, endStr))
|
|
67
84
|
);
|
|
68
85
|
}
|
|
69
86
|
const isCrossYear = start.year() !== end.year();
|
|
70
87
|
const dateFormatOverride = {
|
|
71
88
|
order: "DMY",
|
|
72
89
|
shortMonth: true,
|
|
73
|
-
showYear: isCrossYear,
|
|
90
|
+
showYear: (dateFormat == null ? void 0 : dateFormat.showYear) ?? isCrossYear,
|
|
74
91
|
showMonth: true,
|
|
75
92
|
showDay: true,
|
|
76
93
|
useCommaBeforeYear: false
|
|
77
94
|
};
|
|
78
95
|
const startTimeStr = (0, import_utils.formatTime)(start, timeFormat);
|
|
79
96
|
const endTimeStr = (0, import_utils.formatTime)(end, timeFormat);
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
const getCrossDayDatePart = (date) => {
|
|
98
|
+
if (!showWeekdayInCrossDay) {
|
|
99
|
+
return (0, import_utils.formatDate)(date, { ...dateFormat, ...dateFormatOverride });
|
|
100
|
+
}
|
|
101
|
+
return (0, import_utils.getDatePartDisplay)({
|
|
102
|
+
date,
|
|
103
|
+
dateFormat,
|
|
104
|
+
weekdayFormat,
|
|
105
|
+
referenceDate,
|
|
106
|
+
dateFormatOverride
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const startDatePart = getCrossDayDatePart(start);
|
|
110
|
+
const endDatePart = getCrossDayDatePart(end);
|
|
94
111
|
const startPart = `${startTimeStr} ${startDatePart}`;
|
|
95
112
|
const endPart = `${endTimeStr} ${endDatePart}`;
|
|
96
113
|
const timeClass = "pisell-time-range-display-time pisell-time-range-display-time-cross";
|
|
@@ -99,7 +116,7 @@ var TimeRangeBlock = ({
|
|
|
99
116
|
{
|
|
100
117
|
key: "time-start",
|
|
101
118
|
className: `${timeClass} ${className || ""}`.trim(),
|
|
102
|
-
style:
|
|
119
|
+
style: startInlineStyle
|
|
103
120
|
},
|
|
104
121
|
startPart
|
|
105
122
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -109,8 +126,8 @@ var TimeRangeBlock = ({
|
|
|
109
126
|
className: `${timeClass} ${className || ""}`.trim(),
|
|
110
127
|
style: inlineStyle
|
|
111
128
|
},
|
|
112
|
-
" - ",
|
|
113
|
-
endPart
|
|
129
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-cross-sep", style: inlineStyle, "aria-hidden": true }, " - "),
|
|
130
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-time-range-display-time-cross-end", style: endInlineStyle }, endPart)
|
|
114
131
|
));
|
|
115
132
|
};
|
|
116
133
|
var TimeRangeBlock_default = TimeRangeBlock;
|
|
@@ -52,6 +52,7 @@ var import_Holders = __toESM(require("./components/Holders"));
|
|
|
52
52
|
var import_iconfont = __toESM(require("../../iconfont"));
|
|
53
53
|
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
54
54
|
var PREFIX = "pisell-line-item";
|
|
55
|
+
var ADD_TIME_PRODUCTS_PREVIEW_COUNT = 2;
|
|
55
56
|
var DEFAULT_STATUS_COLOR = "#91caff";
|
|
56
57
|
var getStatusOption = (status, statusOptions = []) => {
|
|
57
58
|
return statusOptions.find((option) => option.key === status) || statusOptions[0] || {
|
|
@@ -68,6 +69,7 @@ var BookingLineItem = (props) => {
|
|
|
68
69
|
cartSkuType,
|
|
69
70
|
isShowBookingHeader,
|
|
70
71
|
relatedProductDataSource,
|
|
72
|
+
addTimeProductDataSources = [],
|
|
71
73
|
rightActions = [],
|
|
72
74
|
escapeDom,
|
|
73
75
|
isShowImage,
|
|
@@ -92,6 +94,7 @@ var BookingLineItem = (props) => {
|
|
|
92
94
|
...other
|
|
93
95
|
} = props;
|
|
94
96
|
const context = (0, import_useEngineContext.default)();
|
|
97
|
+
const [isAddTimeProductsExpanded, setIsAddTimeProductsExpanded] = (0, import_react.useState)(false);
|
|
95
98
|
const translationOriginal = context.appHelper.utils.translationOriginal;
|
|
96
99
|
const locale = ((_e = (_d = (_c = (_b = (_a = context.appHelper.utils) == null ? void 0 : _a.getApp) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.locales) == null ? void 0 : _d.getLocale) == null ? void 0 : _e.call(_d)) || ((_g = (_f = context.appHelper.utils) == null ? void 0 : _f.storage) == null ? void 0 : _g.get("umi_locale")) || "en-US";
|
|
97
100
|
const { isShowAction, actionText } = dataSource;
|
|
@@ -137,21 +140,26 @@ var BookingLineItem = (props) => {
|
|
|
137
140
|
},
|
|
138
141
|
/* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: "pisell2-trash-01" })
|
|
139
142
|
) : null;
|
|
140
|
-
const renderStatusButton = () =>
|
|
141
|
-
|
|
142
|
-
{
|
|
143
|
-
className: `${PREFIX}__status`,
|
|
144
|
-
htmlType: "button",
|
|
145
|
-
disabled: !canChangeStatus,
|
|
146
|
-
loading: statusLoading,
|
|
143
|
+
const renderStatusButton = () => {
|
|
144
|
+
const statusButtonProps = {
|
|
147
145
|
onClick: (e) => {
|
|
148
146
|
e.preventDefault();
|
|
149
147
|
e.stopPropagation();
|
|
150
148
|
}
|
|
151
|
-
}
|
|
152
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
};
|
|
150
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
151
|
+
import_antd.Button,
|
|
152
|
+
{
|
|
153
|
+
className: `${PREFIX}__status`,
|
|
154
|
+
htmlType: "button",
|
|
155
|
+
disabled: !canChangeStatus,
|
|
156
|
+
loading: statusLoading,
|
|
157
|
+
...statusButtonProps
|
|
158
|
+
},
|
|
159
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: `${PREFIX}__status-label` }, currentStatus.label),
|
|
160
|
+
canChangeStatus ? /* @__PURE__ */ import_react.default.createElement(import_icons.DownOutlined, null) : null
|
|
161
|
+
);
|
|
162
|
+
};
|
|
155
163
|
const renderPromotion = ((_h = dataSource == null ? void 0 : dataSource.promotions) == null ? void 0 : _h.length) ? /* @__PURE__ */ import_react.default.createElement(
|
|
156
164
|
import_Promotion.default,
|
|
157
165
|
{
|
|
@@ -159,6 +167,75 @@ var BookingLineItem = (props) => {
|
|
|
159
167
|
onClick: (item) => onPromotion == null ? void 0 : onPromotion(item)
|
|
160
168
|
}
|
|
161
169
|
) : null;
|
|
170
|
+
const renderProductCard = (productDataSource, source, options = {}) => {
|
|
171
|
+
var _a2;
|
|
172
|
+
if (!productDataSource || (productDataSource == null ? void 0 : productDataSource.isGift)) return null;
|
|
173
|
+
const { showProductPromotion = true } = options;
|
|
174
|
+
const productPromotion = ((_a2 = productDataSource == null ? void 0 : productDataSource.promotions) == null ? void 0 : _a2.length) ? /* @__PURE__ */ import_react.default.createElement(
|
|
175
|
+
import_Promotion.default,
|
|
176
|
+
{
|
|
177
|
+
promotions: productDataSource.promotions,
|
|
178
|
+
onClick: (item) => onPromotion == null ? void 0 : onPromotion(item)
|
|
179
|
+
}
|
|
180
|
+
) : null;
|
|
181
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
182
|
+
import_basicInfo.default,
|
|
183
|
+
{
|
|
184
|
+
isShowImage,
|
|
185
|
+
dataSource: productDataSource,
|
|
186
|
+
type: cartSkuType,
|
|
187
|
+
maxSpecsCount: props.maxSpecsCount || 1
|
|
188
|
+
}
|
|
189
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
190
|
+
import_packages.default,
|
|
191
|
+
{
|
|
192
|
+
dataSource: productDataSource,
|
|
193
|
+
isShowImage,
|
|
194
|
+
type: cartSkuType
|
|
195
|
+
}
|
|
196
|
+
), isShowAmountFooter ? /* @__PURE__ */ import_react.default.createElement(
|
|
197
|
+
import_AmountFooter.default,
|
|
198
|
+
{
|
|
199
|
+
item: productDataSource,
|
|
200
|
+
hideDivider: false,
|
|
201
|
+
type: "total"
|
|
202
|
+
}
|
|
203
|
+
) : null, showProductPromotion ? productPromotion : null, isShowNote ? /* @__PURE__ */ import_react.default.createElement(
|
|
204
|
+
import_Note.default,
|
|
205
|
+
{
|
|
206
|
+
...other,
|
|
207
|
+
item: productDataSource,
|
|
208
|
+
disabledEdit,
|
|
209
|
+
openNote: () => onNote == null ? void 0 : onNote(source)
|
|
210
|
+
}
|
|
211
|
+
) : null);
|
|
212
|
+
};
|
|
213
|
+
const renderAddTimeProducts = () => {
|
|
214
|
+
const displayAddTimeProducts = addTimeProductDataSources.filter(
|
|
215
|
+
(item) => item && !item.isGift
|
|
216
|
+
);
|
|
217
|
+
if (displayAddTimeProducts.length === 0) return null;
|
|
218
|
+
const shouldCollapse = displayAddTimeProducts.length > ADD_TIME_PRODUCTS_PREVIEW_COUNT;
|
|
219
|
+
const visibleAddTimeProducts = isAddTimeProductsExpanded ? displayAddTimeProducts : displayAddTimeProducts.slice(0, ADD_TIME_PRODUCTS_PREVIEW_COUNT);
|
|
220
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 0 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__add-time-products` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__section-title` }, import_utils.locales.getText("pisell2.line-item.add-time-products")), visibleAddTimeProducts.map((item, index) => {
|
|
221
|
+
const key = (item == null ? void 0 : item._id) ?? (item == null ? void 0 : item.id) ?? index;
|
|
222
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__add-time-product-card`, key: `${key}` }, renderProductCard(item, item));
|
|
223
|
+
}), shouldCollapse ? /* @__PURE__ */ import_react.default.createElement(
|
|
224
|
+
"button",
|
|
225
|
+
{
|
|
226
|
+
className: `${PREFIX}__add-time-products-toggle`,
|
|
227
|
+
type: "button",
|
|
228
|
+
onClick: (e) => {
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
e.stopPropagation();
|
|
231
|
+
setIsAddTimeProductsExpanded((expanded) => !expanded);
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
import_utils.locales.getText(
|
|
235
|
+
isAddTimeProductsExpanded ? "pisell2.line-item.collapse" : "pisell2.line-item.show-all"
|
|
236
|
+
)
|
|
237
|
+
) : null));
|
|
238
|
+
};
|
|
162
239
|
if (dataSource == null ? void 0 : dataSource.isGift) return null;
|
|
163
240
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-wrapper-container` }, /* @__PURE__ */ import_react.default.createElement(
|
|
164
241
|
import_swipeAction.SwipeAction,
|
|
@@ -220,43 +297,16 @@ var BookingLineItem = (props) => {
|
|
|
220
297
|
) : null),
|
|
221
298
|
!isShowBookingHeader ? renderDeleteButton(true) : null
|
|
222
299
|
),
|
|
223
|
-
isShowRelatedProduct && relatedProductDataSource ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 0 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__related-product` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__related-product-card` },
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
isShowImage,
|
|
227
|
-
dataSource: relatedProductDataSource,
|
|
228
|
-
type: cartSkuType,
|
|
229
|
-
maxSpecsCount: props.maxSpecsCount || 1
|
|
230
|
-
}
|
|
231
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
232
|
-
import_packages.default,
|
|
233
|
-
{
|
|
234
|
-
dataSource: relatedProductDataSource,
|
|
235
|
-
isShowImage,
|
|
236
|
-
type: cartSkuType
|
|
237
|
-
}
|
|
238
|
-
), isShowAmountFooter ? /* @__PURE__ */ import_react.default.createElement(
|
|
239
|
-
import_AmountFooter.default,
|
|
240
|
-
{
|
|
241
|
-
item: relatedProductDataSource,
|
|
242
|
-
hideDivider: false,
|
|
243
|
-
type: "total"
|
|
244
|
-
}
|
|
245
|
-
) : null, renderPromotion, isShowNote ? /* @__PURE__ */ import_react.default.createElement(
|
|
246
|
-
import_Note.default,
|
|
247
|
-
{
|
|
248
|
-
...other,
|
|
249
|
-
item: relatedProductDataSource,
|
|
250
|
-
disabledEdit,
|
|
251
|
-
openNote: () => onNote == null ? void 0 : onNote(dataSource)
|
|
252
|
-
}
|
|
253
|
-
) : null, isShowAction && actionText ? /* @__PURE__ */ import_react.default.createElement(
|
|
300
|
+
isShowRelatedProduct && relatedProductDataSource ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 0 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__related-product` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__related-product-card` }, renderProductCard(relatedProductDataSource, dataSource, {
|
|
301
|
+
showProductPromotion: false
|
|
302
|
+
}), renderPromotion, isShowAction && actionText ? /* @__PURE__ */ import_react.default.createElement(
|
|
254
303
|
import_Action.default,
|
|
255
304
|
{
|
|
256
305
|
item: dataSource,
|
|
257
306
|
onAction: () => onAction == null ? void 0 : onAction(dataSource)
|
|
258
307
|
}
|
|
259
|
-
) : null))) : null
|
|
308
|
+
) : null))) : null,
|
|
309
|
+
renderAddTimeProducts()
|
|
260
310
|
)
|
|
261
311
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
262
312
|
import_Gift.default,
|
|
@@ -179,7 +179,7 @@ var convertProductToLineItemProduct = (product, translationOriginal, symbol) =>
|
|
|
179
179
|
return mapped;
|
|
180
180
|
};
|
|
181
181
|
var LineItem = (props) => {
|
|
182
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
182
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
183
183
|
const {
|
|
184
184
|
dataSource = import_status.defaultValue.dataSource,
|
|
185
185
|
itemType,
|
|
@@ -230,6 +230,13 @@ var LineItem = (props) => {
|
|
|
230
230
|
if (!relatedProduct) return null;
|
|
231
231
|
return convertProductToLineItemProduct(relatedProduct, translationOriginal, symbol);
|
|
232
232
|
}, [relatedProduct, symbol, translationOriginal]);
|
|
233
|
+
const addTimeProductDataSources = (0, import_react.useMemo)(() => {
|
|
234
|
+
var _a2;
|
|
235
|
+
const addTimeProducts = Array.isArray((_a2 = dataSource == null ? void 0 : dataSource._extend) == null ? void 0 : _a2.addTimeProduct) ? dataSource._extend.addTimeProduct : [];
|
|
236
|
+
return addTimeProducts.map(
|
|
237
|
+
(item) => convertProductToLineItemProduct(item, translationOriginal, symbol)
|
|
238
|
+
);
|
|
239
|
+
}, [(_i = dataSource == null ? void 0 : dataSource._extend) == null ? void 0 : _i.addTimeProduct, symbol, translationOriginal]);
|
|
233
240
|
if (itemKind === "product") {
|
|
234
241
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
235
242
|
import_cartSkuCard.default,
|
|
@@ -263,6 +270,7 @@ var LineItem = (props) => {
|
|
|
263
270
|
cartSkuType: type,
|
|
264
271
|
isShowBookingHeader,
|
|
265
272
|
relatedProductDataSource,
|
|
273
|
+
addTimeProductDataSources,
|
|
266
274
|
rightActions,
|
|
267
275
|
escapeDom,
|
|
268
276
|
isShowImage,
|
|
@@ -223,6 +223,13 @@
|
|
|
223
223
|
gap: 6px;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
&__add-time-products {
|
|
227
|
+
display: flex;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
gap: 6px;
|
|
230
|
+
padding: 6px 8px 8px;
|
|
231
|
+
}
|
|
232
|
+
|
|
226
233
|
&__section-title {
|
|
227
234
|
color: #101828;
|
|
228
235
|
font-size: 12px;
|
|
@@ -240,4 +247,30 @@
|
|
|
240
247
|
padding: 0;
|
|
241
248
|
}
|
|
242
249
|
}
|
|
250
|
+
|
|
251
|
+
&__add-time-product-card {
|
|
252
|
+
padding: 4px;
|
|
253
|
+
border: 1px solid var(--Gray-300, #d0d5dd);
|
|
254
|
+
border-radius: 8px;
|
|
255
|
+
background: var(--Base-White, #fff);
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
gap: 4px;
|
|
259
|
+
|
|
260
|
+
.pisell-cart-sku-card__packages-wrap {
|
|
261
|
+
padding: 0;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&__add-time-products-toggle {
|
|
266
|
+
align-self: flex-start;
|
|
267
|
+
padding: 2px 0;
|
|
268
|
+
border: none;
|
|
269
|
+
background: transparent;
|
|
270
|
+
color: #1570ef;
|
|
271
|
+
font-size: 12px;
|
|
272
|
+
font-weight: 600;
|
|
273
|
+
line-height: 18px;
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
}
|
|
243
276
|
}
|
|
@@ -25,22 +25,37 @@ module.exports = __toCommonJS(locales_exports);
|
|
|
25
25
|
var locales_default = {
|
|
26
26
|
en: {
|
|
27
27
|
"pisell2.line-item.resource": "Resource",
|
|
28
|
-
"pisell2.line-item.time": "Time"
|
|
28
|
+
"pisell2.line-item.time": "Time",
|
|
29
|
+
"pisell2.line-item.add-time-products": "Add time products",
|
|
30
|
+
"pisell2.line-item.show-all": "Show all",
|
|
31
|
+
"pisell2.line-item.collapse": "Collapse"
|
|
29
32
|
},
|
|
30
33
|
"zh-CN": {
|
|
31
34
|
"pisell2.line-item.resource": "资源",
|
|
32
|
-
"pisell2.line-item.time": "时间"
|
|
35
|
+
"pisell2.line-item.time": "时间",
|
|
36
|
+
"pisell2.line-item.add-time-products": "加时商品",
|
|
37
|
+
"pisell2.line-item.show-all": "展示全部",
|
|
38
|
+
"pisell2.line-item.collapse": "收起"
|
|
33
39
|
},
|
|
34
40
|
"zh-HK": {
|
|
35
41
|
"pisell2.line-item.resource": "資源",
|
|
36
|
-
"pisell2.line-item.time": "時間"
|
|
42
|
+
"pisell2.line-item.time": "時間",
|
|
43
|
+
"pisell2.line-item.add-time-products": "加時商品",
|
|
44
|
+
"pisell2.line-item.show-all": "展示全部",
|
|
45
|
+
"pisell2.line-item.collapse": "收起"
|
|
37
46
|
},
|
|
38
47
|
ja: {
|
|
39
48
|
"pisell2.line-item.resource": "リソース",
|
|
40
|
-
"pisell2.line-item.time": "時間"
|
|
49
|
+
"pisell2.line-item.time": "時間",
|
|
50
|
+
"pisell2.line-item.add-time-products": "追加時間の商品",
|
|
51
|
+
"pisell2.line-item.show-all": "すべて表示",
|
|
52
|
+
"pisell2.line-item.collapse": "折りたたむ"
|
|
41
53
|
},
|
|
42
54
|
pt: {
|
|
43
55
|
"pisell2.line-item.resource": "Recurso",
|
|
44
|
-
"pisell2.line-item.time": "Tempo"
|
|
56
|
+
"pisell2.line-item.time": "Tempo",
|
|
57
|
+
"pisell2.line-item.add-time-products": "Produtos de horário adicional",
|
|
58
|
+
"pisell2.line-item.show-all": "Ver tudo",
|
|
59
|
+
"pisell2.line-item.collapse": "Recolher"
|
|
45
60
|
}
|
|
46
61
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ export { default as CustomSelect } from './components/customSelect';
|
|
|
122
122
|
export { default as PisellUpload } from './components/pisellUpload';
|
|
123
123
|
export { default as Translation } from './components/translation';
|
|
124
124
|
export { PisellLookup } from './components/pisellLookup';
|
|
125
|
-
export type { PisellLookupProps, PisellLookupRef, } from './components/pisellLookup';
|
|
125
|
+
export type { PisellLookupProps, PisellLookupRef, LookupInputRenderContext, } from './components/pisellLookup';
|
|
126
126
|
export { PisellFind } from './components/pisellFind';
|
|
127
127
|
export type { PisellFindProps, PisellFindRef } from './components/pisellFind';
|
|
128
128
|
export { default as DataSourceForm } from './components/dataSourceComponents/dataSourceForm';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.214",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"swiper": "^8.4.7",
|
|
99
99
|
"antd-mobile": "^5.38.1",
|
|
100
100
|
"vod-js-sdk-v6": "^1.4.11",
|
|
101
|
-
"@pisell/utils": "3.0.2",
|
|
102
101
|
"@pisell/date-picker": "3.0.8",
|
|
102
|
+
"@pisell/utils": "3.0.2",
|
|
103
103
|
"@pisell/icon": "0.0.11"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
@@ -1,32 +0,0 @@
|
|
|
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;
|