@pisell/private-materials 6.12.257 → 6.12.259
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.js +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/components/HDLKiosk/runtime/application.js +12 -2
- package/es/components/HDLKiosk/runtime/triggers.js +52 -17
- package/es/components/bigSale/templates/HDLKiosk/BigSaleScaleRuntimeOwner.js +35 -7
- package/es/components/bigSale/templates/HDLKiosk/index.js +2 -1
- package/es/components/venueBooking/components/Checkout/index.js +1 -1
- package/es/components/venueBooking/components/Content/index.js +1 -1
- package/es/components/venueBooking/components/Header/index.js +5 -5
- package/es/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -1
- package/es/components/venueBooking/components/VenueSelection/components/DateNavigator.js +3 -3
- package/es/components/venueBooking/components/VenueSelection/components/DayTabs.js +2 -2
- package/es/components/venueBooking/components/VenueSelection/components/MonthPicker.js +4 -4
- package/es/components/venueBooking/components/VenueSelection/components/TimeGrid.js +14 -14
- package/es/components/venueBooking/components/VenueSelection/index.js +2 -2
- package/lib/components/HDLKiosk/runtime/application.js +12 -2
- package/lib/components/HDLKiosk/runtime/triggers.js +52 -17
- package/lib/components/bigSale/templates/HDLKiosk/BigSaleScaleRuntimeOwner.js +35 -7
- package/lib/components/bigSale/templates/HDLKiosk/index.js +2 -1
- package/lib/components/venueBooking/components/Checkout/index.js +1 -1
- package/lib/components/venueBooking/components/Content/index.js +1 -1
- package/lib/components/venueBooking/components/Header/index.js +5 -5
- package/lib/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -1
- package/lib/components/venueBooking/components/VenueSelection/components/DateNavigator.js +3 -3
- package/lib/components/venueBooking/components/VenueSelection/components/DayTabs.js +2 -2
- package/lib/components/venueBooking/components/VenueSelection/components/MonthPicker.js +4 -4
- package/lib/components/venueBooking/components/VenueSelection/components/TimeGrid.js +14 -14
- package/lib/components/venueBooking/components/VenueSelection/index.js +2 -2
- package/package.json +3 -3
|
@@ -46,8 +46,8 @@ function BigSaleScaleRuntimeOwner(props) {
|
|
|
46
46
|
occurredAt: Date.now()
|
|
47
47
|
}) }, /* @__PURE__ */ react.default.createElement(ActiveScaleRuntimeOwner, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props), {}, { useNativeScale })));
|
|
48
48
|
}
|
|
49
|
-
function ActiveScaleRuntimeOwner({ active, bridge, minimumWeightKg, useNativeScale }) {
|
|
50
|
-
const
|
|
49
|
+
function ActiveScaleRuntimeOwner({ active, bridge, minimumWeightKg, useNativeScale, telemetry }) {
|
|
50
|
+
const lastEmittedWeightRef = (0, react.useRef)(void 0);
|
|
51
51
|
const lastConnectionStateRef = (0, react.useRef)();
|
|
52
52
|
const eventSequenceRef = (0, react.useRef)(0);
|
|
53
53
|
const [sample, setSample] = (0, react.useState)({
|
|
@@ -73,6 +73,7 @@ function ActiveScaleRuntimeOwner({ active, bridge, minimumWeightKg, useNativeSca
|
|
|
73
73
|
}, [active, bridge]);
|
|
74
74
|
(0, react.useEffect)(() => {
|
|
75
75
|
if (!active) return;
|
|
76
|
+
const previous = bridge.runtime.getSnapshot();
|
|
76
77
|
bridge.runtime.publish(bridge.ownerId, {
|
|
77
78
|
grossWeightKg: scale.grossWeight,
|
|
78
79
|
status: scale.status,
|
|
@@ -82,6 +83,29 @@ function ActiveScaleRuntimeOwner({ active, bridge, minimumWeightKg, useNativeSca
|
|
|
82
83
|
error: scale.error,
|
|
83
84
|
sampleSequence: sample.sequence
|
|
84
85
|
});
|
|
86
|
+
const current = bridge.runtime.getSnapshot();
|
|
87
|
+
if (previous.grossWeightKg !== current.grossWeightKg || previous.status !== current.status || previous.connectionState !== current.connectionState || previous.hasLiveSample !== current.hasLiveSample) try {
|
|
88
|
+
var _scale$rawData$weight, _scale$rawData2, _previous$grossWeight, _current$grossWeightK, _current$status, _current$connectionSt;
|
|
89
|
+
telemetry === null || telemetry === void 0 || telemetry.emit({
|
|
90
|
+
name: "hdlKiosk.scale.readingChanged",
|
|
91
|
+
traceId: `${bridge.ownerId}:sample:${sample.sequence}`,
|
|
92
|
+
occurredAt: Date.now(),
|
|
93
|
+
attributes: {
|
|
94
|
+
ownerId: bridge.ownerId,
|
|
95
|
+
sampleSequence: sample.sequence,
|
|
96
|
+
receivedAt: sample.receivedAt,
|
|
97
|
+
rawWeightGrams: String((_scale$rawData$weight = (_scale$rawData2 = scale.rawData) === null || _scale$rawData2 === void 0 ? void 0 : _scale$rawData2.weight) !== null && _scale$rawData$weight !== void 0 ? _scale$rawData$weight : ""),
|
|
98
|
+
previousGrossWeightKg: String((_previous$grossWeight = previous.grossWeightKg) !== null && _previous$grossWeight !== void 0 ? _previous$grossWeight : ""),
|
|
99
|
+
grossWeightKg: String((_current$grossWeightK = current.grossWeightKg) !== null && _current$grossWeightK !== void 0 ? _current$grossWeightK : ""),
|
|
100
|
+
status: (_current$status = current.status) !== null && _current$status !== void 0 ? _current$status : "unknown",
|
|
101
|
+
connectionState: (_current$connectionSt = current.connectionState) !== null && _current$connectionSt !== void 0 ? _current$connectionSt : "unknown",
|
|
102
|
+
isListening: current.isListening,
|
|
103
|
+
hasLiveSample: current.hasLiveSample,
|
|
104
|
+
hasError: Boolean(current.error),
|
|
105
|
+
minimumWeightKg
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
} catch (_unused) {}
|
|
85
109
|
}, [
|
|
86
110
|
active,
|
|
87
111
|
bridge,
|
|
@@ -91,7 +115,10 @@ function ActiveScaleRuntimeOwner({ active, bridge, minimumWeightKg, useNativeSca
|
|
|
91
115
|
scale.isListening,
|
|
92
116
|
scale.rawData,
|
|
93
117
|
scale.status,
|
|
94
|
-
sample.sequence
|
|
118
|
+
sample.sequence,
|
|
119
|
+
sample.receivedAt,
|
|
120
|
+
minimumWeightKg,
|
|
121
|
+
telemetry
|
|
95
122
|
]);
|
|
96
123
|
(0, react.useEffect)(() => {
|
|
97
124
|
if (!active) {
|
|
@@ -114,15 +141,15 @@ function ActiveScaleRuntimeOwner({ active, bridge, minimumWeightKg, useNativeSca
|
|
|
114
141
|
]);
|
|
115
142
|
(0, react.useEffect)(() => {
|
|
116
143
|
if (!active) return;
|
|
117
|
-
if (inspection.belowTriggerThreshold) {
|
|
118
|
-
|
|
144
|
+
if (inspection.belowTriggerThreshold || scale.status === "negative" || scale.status === "overload") {
|
|
145
|
+
lastEmittedWeightRef.current = void 0;
|
|
119
146
|
return;
|
|
120
147
|
}
|
|
121
|
-
if (consumedReadingRef.current) return;
|
|
122
148
|
if (!bridge.runtime.getSnapshot().hasLiveSample) return;
|
|
123
149
|
const grossWeight = inspection.validGrossWeightKg;
|
|
124
150
|
if (grossWeight === void 0) return;
|
|
125
|
-
|
|
151
|
+
if (lastEmittedWeightRef.current === grossWeight) return;
|
|
152
|
+
lastEmittedWeightRef.current = grossWeight;
|
|
126
153
|
eventSequenceRef.current += 1;
|
|
127
154
|
const occurredAt = sample.receivedAt || Date.now();
|
|
128
155
|
bridge.publishWeightChange({
|
|
@@ -141,6 +168,7 @@ function ActiveScaleRuntimeOwner({ active, bridge, minimumWeightKg, useNativeSca
|
|
|
141
168
|
inspection.belowTriggerThreshold,
|
|
142
169
|
inspection.validGrossWeightKg,
|
|
143
170
|
sample.receivedAt,
|
|
171
|
+
sample.sequence,
|
|
144
172
|
scale.status
|
|
145
173
|
]);
|
|
146
174
|
return null;
|
|
@@ -130,7 +130,8 @@ function HDLKioskBigSaleTemplate({ isActive = true, context, businessCode, local
|
|
|
130
130
|
active: isActive && (config.enabledEntries.includes("scale") || config.enabledEntries.includes("quick") || config.enabledEntries.includes("barcode")) && Boolean(config.primaryWeightedProductId),
|
|
131
131
|
bridge: scaleBridge,
|
|
132
132
|
nativeScaleTools,
|
|
133
|
-
minimumWeightKg: config.scaleTriggerMinimumWeightKg
|
|
133
|
+
minimumWeightKg: config.scaleTriggerMinimumWeightKg,
|
|
134
|
+
telemetry: host.telemetry
|
|
134
135
|
}), /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
135
136
|
host,
|
|
136
137
|
config,
|
|
@@ -88,7 +88,7 @@ function Checkout() {
|
|
|
88
88
|
setNoteValue(nextNote);
|
|
89
89
|
lastNoteRef.current = nextNote;
|
|
90
90
|
}, [viewModel.note]);
|
|
91
|
-
return /* @__PURE__ */ react.default.createElement("div", { className: "space-y-3 md:space-y-5" }, /* @__PURE__ */ react.default.createElement("div", { className: "grid gap-3 md:gap-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-[22px] bg-white p-4
|
|
91
|
+
return /* @__PURE__ */ react.default.createElement("div", { className: "space-y-3 md:space-y-5" }, /* @__PURE__ */ react.default.createElement("div", { className: "grid gap-3 md:gap-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-[22px] bg-white p-4 md:rounded-[28px] md:p-6" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-center justify-between gap-3" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("div", { className: "mt-3 text-[22px] font-extrabold text-zinc-900" }, _pisell_utils.locales.getText("pisell2.venue.checkout.court.summary") || "场地预订摘要"))), /* @__PURE__ */ react.default.createElement("div", { className: "mt-5 grid gap-4 md:grid-cols-2" }, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-[22px] bg-[#faf7f4] p-4 md:col-span-2" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-sm font-semibold text-[#a69183]" }, _pisell_utils.locales.getText("pisell2.venue.checkout.selected.courts") || "已选场地"), /* @__PURE__ */ react.default.createElement("div", { className: "mt-3 space-y-2 text-[15px] font-semibold text-zinc-900" }, mergedCourtSessionLines.length ? mergedCourtSessionLines.map((line, idx) => /* @__PURE__ */ react.default.createElement("div", { key: `venue-session-line-${idx}` }, line)) : /* @__PURE__ */ react.default.createElement("div", null, _pisell_utils.locales.getText("pisell2.venue.checkout.sessions.empty") || "-"))), addonCartItems.length > 0 ? /* @__PURE__ */ react.default.createElement("div", { className: "rounded-[22px] bg-[#faf7f4] p-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-sm font-semibold text-[#a69183]" }, _pisell_utils.locales.getText("pisell2.venue.checkout.addons") || "附加项"), /* @__PURE__ */ react.default.createElement("div", { className: "mt-3 text-[15px] font-semibold text-zinc-900" }, addonCartItems.map((item, idx) => /* @__PURE__ */ react.default.createElement("div", { key: `addon-${item.id || idx}` }, item.title || item.name || "-")))) : null)), /* @__PURE__ */ react.default.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-[28px] bg-white p-5 md:p-6" }, /* @__PURE__ */ react.default.createElement("div", { className: "mt-5 rounded-[22px] bg-[#faf7f4] p-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-lg font-bold text-zinc-900" }, _pisell_utils.locales.getText("pisell2.venue.checkout.notice") || "备注"), /* @__PURE__ */ react.default.createElement("textarea", {
|
|
92
92
|
className: "mt-4 min-h-[120px] w-full rounded-[20px] border border-black/10 bg-white px-4 py-4 text-sm outline-none placeholder:text-zinc-400",
|
|
93
93
|
value: noteValue,
|
|
94
94
|
onChange: (e) => setNoteValue(e.target.value),
|
|
@@ -117,7 +117,7 @@ function Content() {
|
|
|
117
117
|
ref: stepHeaderRef,
|
|
118
118
|
className: "sticky top-0 z-40"
|
|
119
119
|
}, /* @__PURE__ */ react.default.createElement(require_index.default, null)), /* @__PURE__ */ react.default.createElement("div", { className: "grid max-w-full gap-2 md:gap-4 lg:grid-cols-[minmax(0,1fr)_390px] xl:grid-cols-[minmax(0,1fr)_420px]" }, /* @__PURE__ */ react.default.createElement("section", { className: "min-w-0 space-y-3 overscroll-none md:space-y-5" }, stepRegistry[currentStep]), /* @__PURE__ */ react.default.createElement("aside", {
|
|
120
|
-
className: "hidden lg:block sticky self-start z-10 rounded-[28px] bg-white
|
|
120
|
+
className: "hidden lg:block sticky self-start z-10 rounded-[28px] bg-white",
|
|
121
121
|
style: { top: "calc(var(--vb-grid-sticky-top, 0px) + 1.5rem)" }
|
|
122
122
|
}, /* @__PURE__ */ react.default.createElement(require_index$1.default, {
|
|
123
123
|
embedded: true,
|
|
@@ -96,7 +96,7 @@ function Header() {
|
|
|
96
96
|
});
|
|
97
97
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
98
98
|
ref: cardRef,
|
|
99
|
-
className: "relative bg-white p-3 md:rounded-[24px] md:p-4
|
|
99
|
+
className: "relative bg-white p-3 md:rounded-[24px] md:p-4"
|
|
100
100
|
}, /* @__PURE__ */ react.default.createElement(antd.Modal, {
|
|
101
101
|
open: confirmOpen,
|
|
102
102
|
onCancel: () => setConfirmOpen(false),
|
|
@@ -140,7 +140,7 @@ function Header() {
|
|
|
140
140
|
}, /* @__PURE__ */ react.default.createElement("p", { className: "text-sm text-zinc-500" }, String(_pisell_utils.locales.getText("pisell2.venue.leave.desc") || "Your selections will be lost if you leave now."))), popupOpen && backSteps.length > 0 ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", {
|
|
141
141
|
className: "fixed inset-0 z-40 md:hidden",
|
|
142
142
|
onClick: () => setPopupOpen(false)
|
|
143
|
-
}), /* @__PURE__ */ react.default.createElement("div", { className: "absolute left-4 right-4 top-full z-50 mt-2 overflow-hidden rounded-2xl bg-white shadow-[0_8px_30px_rgba(20,20,20,0.12)] ring-1 ring-black/
|
|
143
|
+
}), /* @__PURE__ */ react.default.createElement("div", { className: "absolute left-4 right-4 top-full z-50 mt-2 overflow-hidden rounded-2xl bg-white shadow-[0_8px_30px_rgba(20,20,20,0.12)] ring-1 ring-black/[0.06] md:hidden" }, backSteps.map((item, idx) => /* @__PURE__ */ react.default.createElement("button", {
|
|
144
144
|
key: item.key,
|
|
145
145
|
type: "button",
|
|
146
146
|
onClick: () => {
|
|
@@ -152,7 +152,7 @@ function Header() {
|
|
|
152
152
|
type: "button",
|
|
153
153
|
"aria-label": "Back",
|
|
154
154
|
onClick: handleBack,
|
|
155
|
-
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-zinc-50 text-zinc-700
|
|
155
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-zinc-50 text-zinc-700 transition hover:bg-zinc-100"
|
|
156
156
|
}, /* @__PURE__ */ react.default.createElement("svg", {
|
|
157
157
|
viewBox: "0 0 24 24",
|
|
158
158
|
className: "h-5 w-5",
|
|
@@ -193,7 +193,7 @@ function Header() {
|
|
|
193
193
|
className: `flex items-center gap-3 rounded-full px-3 py-2 transition ${status === "done" ? "bg-zinc-50" : status !== "active" ? "bg-zinc-50/80" : ""} ${clickable ? "cursor-pointer hover:bg-zinc-100" : "cursor-default"}`,
|
|
194
194
|
style: status === "active" ? { backgroundColor: "var(--vb-primary-light)" } : void 0
|
|
195
195
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
196
|
-
className: `flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold ${status === "done" ? "bg-[#111] text-white" : status === "active" ? "text-white" : "bg-white text-zinc-400
|
|
196
|
+
className: `flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold ${status === "done" ? "bg-[#111] text-white" : status === "active" ? "text-white" : "bg-white text-zinc-400"}`,
|
|
197
197
|
style: status === "active" ? { backgroundColor: "var(--vb-primary)" } : void 0
|
|
198
198
|
}, status === "done" ? /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
199
199
|
type: "pisell2-check",
|
|
@@ -206,7 +206,7 @@ function Header() {
|
|
|
206
206
|
type: "button",
|
|
207
207
|
"aria-label": "Close",
|
|
208
208
|
onClick: setConfirmOpen.bind(null, true),
|
|
209
|
-
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-zinc-50 text-zinc-700
|
|
209
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-zinc-50 text-zinc-700 transition hover:bg-zinc-100"
|
|
210
210
|
}, /* @__PURE__ */ react.default.createElement("svg", {
|
|
211
211
|
viewBox: "0 0 24 24",
|
|
212
212
|
className: "h-5 w-5",
|
|
@@ -26,7 +26,7 @@ function CourtFilter() {
|
|
|
26
26
|
return /* @__PURE__ */ react.default.createElement("div", { className: "mt-4 grid gap-3 md:mt-5 xl:grid-cols-[1fr_auto] xl:items-center" }, courtTypes.length > 1 ? /* @__PURE__ */ react.default.createElement("div", { className: "flex flex-wrap gap-2" }, filterOptions.map((opt) => /* @__PURE__ */ react.default.createElement("button", {
|
|
27
27
|
key: opt.value,
|
|
28
28
|
onClick: () => setFilter(opt.value),
|
|
29
|
-
className: `rounded-full px-4 py-2 text-sm font-semibold transition ${filter === opt.value ? "text-white" : "bg-[#fafafa] text-zinc-700
|
|
29
|
+
className: `rounded-full px-4 py-2 text-sm font-semibold transition ${filter === opt.value ? "text-white" : "bg-[#fafafa] text-zinc-700"}`,
|
|
30
30
|
style: filter === opt.value ? { backgroundColor: "var(--vb-primary)" } : void 0
|
|
31
31
|
}, opt.label))) : null);
|
|
32
32
|
}
|
|
@@ -30,16 +30,16 @@ function DateNavigator({ onPrevWeek, onNextWeek }) {
|
|
|
30
30
|
return _goToday.apply(this, arguments);
|
|
31
31
|
}
|
|
32
32
|
return /* @__PURE__ */ react.default.createElement("div", { className: "relative flex w-full items-center gap-2 xl:w-auto" }, /* @__PURE__ */ react.default.createElement("button", {
|
|
33
|
-
className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-[#fafafa]
|
|
33
|
+
className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-[#fafafa] md:h-12 md:w-12",
|
|
34
34
|
onClick: onPrevWeek
|
|
35
35
|
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
36
36
|
type: "pisell2-chevron-left",
|
|
37
37
|
style: { fontSize: 18 }
|
|
38
38
|
})), /* @__PURE__ */ react.default.createElement("button", {
|
|
39
|
-
className: "min-w-0 flex-1 rounded-2xl bg-[#fafafa] px-4 py-3 text-sm font-bold text-zinc-900
|
|
39
|
+
className: "min-w-0 flex-1 rounded-2xl bg-[#fafafa] px-4 py-3 text-sm font-bold text-zinc-900 xl:min-w-[200px] xl:flex-none",
|
|
40
40
|
onClick: () => setMonthPickerOpen(!monthPickerOpen)
|
|
41
41
|
}, require_utils.getMonthLabel(anchorDate)), /* @__PURE__ */ react.default.createElement("button", {
|
|
42
|
-
className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-[#fafafa]
|
|
42
|
+
className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-[#fafafa] md:h-12 md:w-12",
|
|
43
43
|
onClick: onNextWeek
|
|
44
44
|
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
45
45
|
type: "pisell2-chevron-right",
|
|
@@ -36,7 +36,7 @@ function DayTabs({ onPrevWeek, onNextWeek }) {
|
|
|
36
36
|
"aria-live": "polite"
|
|
37
37
|
}, Array.from({ length: 7 }).map((_, idx) => /* @__PURE__ */ react.default.createElement("div", {
|
|
38
38
|
key: `day-skeleton-${idx}`,
|
|
39
|
-
className: "relative min-h-[56px] overflow-hidden rounded-[12px] bg-zinc-100 px-2 py-2
|
|
39
|
+
className: "relative min-h-[56px] overflow-hidden rounded-[12px] bg-zinc-100 px-2 py-2 md:min-h-[60px] md:rounded-[16px] md:px-3 md:py-2"
|
|
40
40
|
}, /* @__PURE__ */ react.default.createElement("div", { className: "h-2 w-8 rounded bg-zinc-200/90 md:h-2.5 md:w-10" }), /* @__PURE__ */ react.default.createElement("div", { className: "mt-2 flex items-end justify-between gap-1" }, /* @__PURE__ */ react.default.createElement("div", { className: "h-3 w-5 rounded bg-zinc-200/90 md:h-4 md:w-6" }), /* @__PURE__ */ react.default.createElement("div", { className: "h-2 w-8 rounded bg-zinc-200/90 md:h-2.5 md:w-10" })), /* @__PURE__ */ react.default.createElement("span", {
|
|
41
41
|
className: "vb-skeleton-shimmer",
|
|
42
42
|
"aria-hidden": "true"
|
|
@@ -88,7 +88,7 @@ function DayTabs({ onPrevWeek, onNextWeek }) {
|
|
|
88
88
|
const active = key === currentKey;
|
|
89
89
|
const meta = require_utils.getDateMetaFromSummary(date, viewModel.dateSummary, symbol);
|
|
90
90
|
const showSelectedBadge = selectedDateKeySet.has(key) && !active;
|
|
91
|
-
const cardClass = meta.soldOut ? "bg-zinc-50 text-zinc-400
|
|
91
|
+
const cardClass = meta.soldOut ? "bg-zinc-50 text-zinc-400" : active ? "text-white shadow-sm" : "bg-white text-zinc-800 hover:bg-zinc-50";
|
|
92
92
|
const cardStyle = !meta.soldOut && active ? { backgroundColor: "var(--vb-primary)" } : void 0;
|
|
93
93
|
const tagClass = active ? "bg-white/15 text-white ring-white/20" : meta.topTag === "Promo" ? "bg-emerald-50 text-emerald-700 ring-emerald-200" : "bg-zinc-100 text-zinc-600 ring-zinc-200";
|
|
94
94
|
return /* @__PURE__ */ react.default.createElement("button", {
|
|
@@ -42,14 +42,14 @@ function MonthPicker() {
|
|
|
42
42
|
});
|
|
43
43
|
return _handleSelect.apply(this, arguments);
|
|
44
44
|
}
|
|
45
|
-
return /* @__PURE__ */ react.default.createElement("div", { className: "absolute right-0 top-[calc(100%+12px)] z-30 w-[320px] rounded-[24px] border border-black/
|
|
46
|
-
className: "flex h-10 w-10 items-center justify-center rounded-2xl bg-[#fafafa]
|
|
45
|
+
return /* @__PURE__ */ react.default.createElement("div", { className: "absolute right-0 top-[calc(100%+12px)] z-30 w-[320px] rounded-[24px] border border-black/[0.06] bg-white p-4 shadow-[0_20px_60px_rgba(20,20,20,0.14)]" }, /* @__PURE__ */ react.default.createElement("div", { className: "mb-4 flex items-center justify-between" }, /* @__PURE__ */ react.default.createElement("button", {
|
|
46
|
+
className: "flex h-10 w-10 items-center justify-center rounded-2xl bg-[#fafafa] hover:bg-zinc-50",
|
|
47
47
|
onClick: () => setMonthCursor(monthCursor.subtract(1, "month"))
|
|
48
48
|
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
49
49
|
type: "pisell2-chevron-left",
|
|
50
50
|
style: { fontSize: 16 }
|
|
51
51
|
})), /* @__PURE__ */ react.default.createElement("div", { className: "text-sm font-bold text-zinc-900" }, require_utils.getMonthLabel(monthCursor)), /* @__PURE__ */ react.default.createElement("button", {
|
|
52
|
-
className: "flex h-10 w-10 items-center justify-center rounded-2xl bg-[#fafafa]
|
|
52
|
+
className: "flex h-10 w-10 items-center justify-center rounded-2xl bg-[#fafafa] hover:bg-zinc-50",
|
|
53
53
|
onClick: () => setMonthCursor(monthCursor.add(1, "month"))
|
|
54
54
|
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
55
55
|
type: "pisell2-chevron-right",
|
|
@@ -74,7 +74,7 @@ function MonthPicker() {
|
|
|
74
74
|
const isPastDate = day.isBefore(todayStart, "day");
|
|
75
75
|
const isDisabledBySummary = !(!knownDateRange ? true : day.isBefore(knownDateRange.minDate, "day") || day.isAfter(knownDateRange.maxDate, "day")) && meta.soldOut;
|
|
76
76
|
const isDisabled = isPastDate || isDisabledBySummary;
|
|
77
|
-
const cellClass = isDisabled ? "bg-zinc-50 text-zinc-400
|
|
77
|
+
const cellClass = isDisabled ? "bg-zinc-50 text-zinc-400" : selected ? "text-white shadow-sm" : isToday ? "" : "bg-[#fafafa] text-zinc-700";
|
|
78
78
|
const cellStyle = selected && !meta.soldOut ? { backgroundColor: "var(--vb-primary)" } : isToday && !meta.soldOut ? {
|
|
79
79
|
backgroundColor: "var(--vb-primary-light)",
|
|
80
80
|
color: "var(--vb-primary)"
|
|
@@ -182,16 +182,16 @@ function TimeGrid() {
|
|
|
182
182
|
}
|
|
183
183
|
if (isGridLoading || !grid || !timeLabels.length) return /* @__PURE__ */ react.default.createElement(TimeGridSkeleton, null);
|
|
184
184
|
return /* @__PURE__ */ react.default.createElement("div", { className: "relative" }, /* @__PURE__ */ react.default.createElement("div", {
|
|
185
|
-
className: "sticky z-30 overflow-hidden bg-[#fff7f7]",
|
|
185
|
+
className: "sticky z-30 overflow-hidden rounded-t-[28px] bg-[#fff7f7]",
|
|
186
186
|
style: { top: "var(--vb-grid-sticky-top, 0px)" }
|
|
187
187
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
188
188
|
ref: headerInnerRef,
|
|
189
|
-
className: "grid border-b border-black/
|
|
189
|
+
className: "grid border-b border-black/[0.06]",
|
|
190
190
|
style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, tableGridStyle), {}, { willChange: "transform" }),
|
|
191
191
|
key: `${grid.date}-header`
|
|
192
192
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
193
193
|
ref: headerFixedColRef,
|
|
194
|
-
className: "relative z-20 row-span-2 flex items-center gap-2 border-r border-black/
|
|
194
|
+
className: "relative z-20 row-span-2 flex items-center gap-2 border-r border-black/[0.06] bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4",
|
|
195
195
|
style: { willChange: "transform" }
|
|
196
196
|
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
197
197
|
type: "pisell2-clock",
|
|
@@ -227,7 +227,7 @@ function TimeGrid() {
|
|
|
227
227
|
}))), /* @__PURE__ */ react.default.createElement("div", {
|
|
228
228
|
ref: scrollTableRef,
|
|
229
229
|
onScroll: syncHeader,
|
|
230
|
-
className: "max-w-full overflow-x-auto cursor-grab select-none touch-pan-y active:cursor-grabbing",
|
|
230
|
+
className: "max-w-full overflow-x-auto rounded-b-[28px] cursor-grab select-none touch-pan-y active:cursor-grabbing",
|
|
231
231
|
style: require_objectSpread2._objectSpread2({ WebkitOverflowScrolling: "touch" }, scrollerOverscrollStyle)
|
|
232
232
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
233
233
|
className: "w-full",
|
|
@@ -237,9 +237,9 @@ function TimeGrid() {
|
|
|
237
237
|
const isMultiProduct = !!resource.hasMultipleProducts && Array.isArray(resource.products);
|
|
238
238
|
const expanded = !!expandedResources[String(resource.resourceId)];
|
|
239
239
|
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, { key: `${resource.resourceId}-${grid.date}` }, /* @__PURE__ */ react.default.createElement("div", {
|
|
240
|
-
className: "grid border-b border-black/
|
|
240
|
+
className: "grid border-b border-black/[0.06]",
|
|
241
241
|
style: tableGridStyle
|
|
242
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: `sticky left-0 z-10 border-r border-black/
|
|
242
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: `sticky left-0 z-10 border-r border-black/[0.06] px-2 py-2 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 ${courtMeta.soldOut ? "bg-zinc-50" : "bg-white"}` }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-center gap-1.5" }, isMultiProduct ? /* @__PURE__ */ react.default.createElement("button", {
|
|
243
243
|
type: "button",
|
|
244
244
|
"data-cart-button": "true",
|
|
245
245
|
onClick: (e) => {
|
|
@@ -303,9 +303,9 @@ function TimeGrid() {
|
|
|
303
303
|
}), showPlusLabel ? /* @__PURE__ */ react.default.createElement("span", { className: `text-[13px] font-semibold leading-4 ${priceClass} md:text-sm` }, "+") : null), tag ? /* @__PURE__ */ react.default.createElement("div", { className: `inline-flex rounded-full px-1.5 py-0 text-[8px] font-semibold leading-4 ring-1 md:text-[9px] ${tag.className}` }, tagText) : null));
|
|
304
304
|
})), isMultiProduct && expanded && resource.products.map((subRow) => /* @__PURE__ */ react.default.createElement("div", {
|
|
305
305
|
key: `${resource.resourceId}-sub-${subRow.productId}`,
|
|
306
|
-
className: "grid border-b border-black/
|
|
306
|
+
className: "grid border-b border-black/[0.06] bg-zinc-50/60",
|
|
307
307
|
style: tableGridStyle
|
|
308
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/
|
|
308
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/[0.06] bg-zinc-50/60 px-2 py-2 pl-8 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 md:pl-10" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-[12px] font-semibold leading-5 text-zinc-700 md:text-[13px]" }, subRow.productTitle)), subRow.slots.map((slot, slotIndex) => {
|
|
309
309
|
const isAvailable = slot.status === "available";
|
|
310
310
|
const isUnavailable = slot.status === "occupied" || slot.status === "past" || slot.status === "unavailable";
|
|
311
311
|
const timeLabel = timeLabels[slotIndex] || "";
|
|
@@ -355,12 +355,12 @@ function TimeGridSkeleton() {
|
|
|
355
355
|
"aria-busy": "true",
|
|
356
356
|
"aria-live": "polite"
|
|
357
357
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
358
|
-
className: "sticky z-30 overflow-hidden bg-[#fff7f7]",
|
|
358
|
+
className: "sticky z-30 overflow-hidden rounded-t-[28px] bg-[#fff7f7]",
|
|
359
359
|
style: { top: "var(--vb-grid-sticky-top, 0px)" }
|
|
360
360
|
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
361
|
-
className: "grid border-b border-black/
|
|
361
|
+
className: "grid border-b border-black/[0.06]",
|
|
362
362
|
style: { gridTemplateColumns: `120px repeat(${SKELETON_COLS}, minmax(90px, 1fr))` }
|
|
363
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: "relative z-20 flex items-center gap-2 border-r border-black/
|
|
363
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: "relative z-20 flex items-center gap-2 border-r border-black/[0.06] bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
|
|
364
364
|
type: "pisell2-clock",
|
|
365
365
|
style: {
|
|
366
366
|
fontSize: 16,
|
|
@@ -373,11 +373,11 @@ function TimeGridSkeleton() {
|
|
|
373
373
|
}, /* @__PURE__ */ react.default.createElement("div", { className: "h-3 w-10 rounded bg-zinc-200/80" }), /* @__PURE__ */ react.default.createElement("span", {
|
|
374
374
|
className: "vb-skeleton-shimmer",
|
|
375
375
|
"aria-hidden": "true"
|
|
376
|
-
}))))), /* @__PURE__ */ react.default.createElement("div", { className: "w-full" }, Array.from({ length: SKELETON_ROWS }).map((_, rowIdx) => /* @__PURE__ */ react.default.createElement("div", {
|
|
376
|
+
}))))), /* @__PURE__ */ react.default.createElement("div", { className: "w-full max-w-full overflow-hidden rounded-b-[28px]" }, Array.from({ length: SKELETON_ROWS }).map((_, rowIdx) => /* @__PURE__ */ react.default.createElement("div", {
|
|
377
377
|
key: `sk-row-${rowIdx}`,
|
|
378
|
-
className: "grid border-b border-black/
|
|
378
|
+
className: "grid border-b border-black/[0.06]",
|
|
379
379
|
style: { gridTemplateColumns: `120px repeat(${SKELETON_COLS}, minmax(90px, 1fr))` }
|
|
380
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/
|
|
380
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/[0.06] bg-white px-2 py-4 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "relative overflow-hidden" }, /* @__PURE__ */ react.default.createElement("div", { className: "h-4 w-20 rounded bg-zinc-200/80 md:w-24" }), /* @__PURE__ */ react.default.createElement("div", { className: "mt-2 h-2.5 w-14 rounded bg-zinc-200/60 md:w-16" }), /* @__PURE__ */ react.default.createElement("span", {
|
|
381
381
|
className: "vb-skeleton-shimmer",
|
|
382
382
|
"aria-hidden": "true"
|
|
383
383
|
}))), Array.from({ length: SKELETON_COLS }).map((_, colIdx) => /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -39,7 +39,7 @@ function VenueSelection() {
|
|
|
39
39
|
function goNextWeek() {
|
|
40
40
|
navigateWeek(7);
|
|
41
41
|
}
|
|
42
|
-
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-b-[24px] bg-white p-3
|
|
42
|
+
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-b-[24px] bg-white p-3 md:rounded-[28px] md:p-6" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex flex-col gap-2 xl:flex-row xl:items-center xl:justify-between" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("h2", { className: "text-2xl font-extrabold leading-tight text-zinc-900 md:text-[30px]" }, _pisell_utils.locales.getText("pisell2.venue.step1.title") || "选择场地"), /* @__PURE__ */ react.default.createElement("p", { className: "mt-1 text-xs leading-5 text-zinc-500 md:mt-2 md:text-sm md:leading-6" }, _pisell_utils.locales.getText("pisell2.venue.step1.subtitle") || "仅显示可用时段和价格。")), /* @__PURE__ */ react.default.createElement(require_DateNavigator.default, {
|
|
43
43
|
onPrevWeek: goPrevWeek,
|
|
44
44
|
onNextWeek: goNextWeek
|
|
45
45
|
})), /* @__PURE__ */ react.default.createElement("div", { className: "mt-3 md:mt-5" }, /* @__PURE__ */ react.default.createElement(require_DayTabs.default, {
|
|
@@ -47,7 +47,7 @@ function VenueSelection() {
|
|
|
47
47
|
onNextWeek: goNextWeek
|
|
48
48
|
})), /* @__PURE__ */ react.default.createElement(require_CourtFilter.default, null)), /* @__PURE__ */ react.default.createElement("div", {
|
|
49
49
|
ref: tableSectionRef,
|
|
50
|
-
className: "w-full max-w-full isolate rounded-[28px] bg-white
|
|
50
|
+
className: "w-full max-w-full isolate rounded-[28px] bg-white"
|
|
51
51
|
}, /* @__PURE__ */ react.default.createElement(require_TimeGrid.default, null)));
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.259",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
71
71
|
"styled-components": "^6.0.0-rc.3",
|
|
72
72
|
"use-sync-external-store": "^1.6.0",
|
|
73
|
+
"@pisell/icon": "0.0.11",
|
|
73
74
|
"@pisell/materials": "6.12.74",
|
|
74
|
-
"@pisell/utils": "3.0.7",
|
|
75
75
|
"@pisell/pi-payment-sdk": "0.0.3",
|
|
76
76
|
"@pisell/date-picker": "3.0.12",
|
|
77
|
-
"@pisell/
|
|
77
|
+
"@pisell/utils": "3.0.7"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"react": "^18.0.0",
|