@loczer/storefront-sdk 0.195.0 → 0.196.0
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/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +15 -14
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +15 -14
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +16 -17
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts +5 -2
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +209 -209
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +52 -46
- package/dist/index.d.ts +1 -0
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts +0 -2
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts.map +0 -1
- package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.js +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+CAqJ/B,CAAA"}
|
|
@@ -13,8 +13,8 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
13
13
|
minimumFractionDigits: 0,
|
|
14
14
|
maximumFractionDigits: 0
|
|
15
15
|
}).format(e / 100), f = () => {
|
|
16
|
-
let { labels: f, localeCode: p, currencyCode: m, endTime: h, selectEndTime: g, availableEndTimeSlots: _, endTimeSlotsStatus: v, isEndTimeSelectOpen: y, setIsEndTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w,
|
|
17
|
-
let t = !!
|
|
16
|
+
let { labels: f, localeCode: p, currencyCode: m, endTime: h, selectEndTime: g, availableEndTimeSlots: _, endTimeSlotsStatus: v, isEndTimeSelectOpen: y, setIsEndTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isMobile: T, isHydrated: E, startMinutesValue: D, isSameDaySelection: O, isEndToday: k, earliestMinutesForToday: A } = e(), j = _.map((e) => {
|
|
17
|
+
let t = !!O && D != null && e.startMinutes <= D, n = k && A != null && e.startMinutes < A, r = e.isDisabled || t || n, i = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, a = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, o = e.isDisabled && i ? i : null, u = a && o ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
18
18
|
className: "block",
|
|
19
19
|
children: a
|
|
20
20
|
}), /* @__PURE__ */ c("span", {
|
|
@@ -27,12 +27,12 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
27
27
|
disabled: r,
|
|
28
28
|
description: u
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), M = j.some((e) => !e.disabled), N = v !== "local" && (v !== "ready" || !M), P = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !M ? f.timeSlotsUnavailable : f.endTime, F = j.find((e) => !e.disabled)?.value, I = o(h ?? F ?? null), L = t();
|
|
31
31
|
return a(() => {
|
|
32
|
-
y || (
|
|
32
|
+
y || (I.current = h ?? F ?? null);
|
|
33
33
|
}, [
|
|
34
34
|
h,
|
|
35
|
-
|
|
35
|
+
F,
|
|
36
36
|
y
|
|
37
37
|
]), a(() => {
|
|
38
38
|
let e = document.getElementById("end-time-picker");
|
|
@@ -40,7 +40,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
40
40
|
let t = (e) => {
|
|
41
41
|
if (e.key !== "Enter" || !y) return;
|
|
42
42
|
e.preventDefault(), e.stopPropagation();
|
|
43
|
-
let t =
|
|
43
|
+
let t = I.current ?? h ?? F;
|
|
44
44
|
t && g(t);
|
|
45
45
|
};
|
|
46
46
|
return e.addEventListener("keydown", t, !0), () => {
|
|
@@ -48,7 +48,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
48
48
|
};
|
|
49
49
|
}, [
|
|
50
50
|
h,
|
|
51
|
-
|
|
51
|
+
F,
|
|
52
52
|
y,
|
|
53
53
|
g
|
|
54
54
|
]), /* @__PURE__ */ l("div", {
|
|
@@ -61,23 +61,24 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
61
61
|
}),
|
|
62
62
|
/* @__PURE__ */ c(i, {
|
|
63
63
|
id: "end-time-picker",
|
|
64
|
-
placeholder:
|
|
64
|
+
placeholder: P,
|
|
65
65
|
value: h ?? null,
|
|
66
66
|
onValueUpdate: (e) => {
|
|
67
|
-
e && (
|
|
67
|
+
e && (I.current = e);
|
|
68
68
|
},
|
|
69
69
|
onChange: (e) => {
|
|
70
|
-
e && (
|
|
70
|
+
e && (I.current = e, g(e));
|
|
71
71
|
},
|
|
72
|
-
options:
|
|
73
|
-
|
|
72
|
+
options: j,
|
|
73
|
+
compact: T,
|
|
74
|
+
disabled: N,
|
|
74
75
|
open: y,
|
|
75
76
|
onOpenChange: b,
|
|
76
77
|
triggerTestId: "end-time-trigger",
|
|
77
78
|
contentTestId: "end-time-select-content",
|
|
78
|
-
isHydrated:
|
|
79
|
+
isHydrated: E,
|
|
79
80
|
inputClassName: u(w.endTime && "border-destructive", S, C),
|
|
80
|
-
portalContainer:
|
|
81
|
+
portalContainer: L
|
|
81
82
|
}),
|
|
82
83
|
w.endTime && /* @__PURE__ */ c(r, { children: w.endTime })
|
|
83
84
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingStartTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingStartTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,qBAAqB,+
|
|
1
|
+
{"version":3,"file":"BookingStartTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingStartTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,qBAAqB,+CA+IjC,CAAA"}
|
|
@@ -13,8 +13,8 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
13
13
|
minimumFractionDigits: 0,
|
|
14
14
|
maximumFractionDigits: 0
|
|
15
15
|
}).format(e / 100), f = () => {
|
|
16
|
-
let { labels: f, localeCode: p, currencyCode: m, startTime: h, selectStartTime: g, startTimeSlots: _, startTimeSlotsStatus: v, isStartTimeSelectOpen: y, setIsStartTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w,
|
|
17
|
-
let t =
|
|
16
|
+
let { labels: f, localeCode: p, currencyCode: m, startTime: h, selectStartTime: g, startTimeSlots: _, startTimeSlotsStatus: v, isStartTimeSelectOpen: y, setIsStartTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isMobile: T, isHydrated: E, isStartToday: D, earliestMinutesForToday: O } = e(), k = _.map((e) => {
|
|
17
|
+
let t = D && O != null && e.startMinutes < O, n = e.isDisabled || t, r = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, i = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, a = e.isDisabled && r ? r : null, o = i && a ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
18
18
|
className: "block",
|
|
19
19
|
children: i
|
|
20
20
|
}), /* @__PURE__ */ c("span", {
|
|
@@ -27,11 +27,11 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
27
27
|
disabled: n,
|
|
28
28
|
description: o
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), A = k.some((e) => !e.disabled), j = v !== "local" && (v !== "ready" || !A), M = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !A ? f.timeSlotsUnavailable : f.startTime, N = k.find((e) => !e.disabled)?.value, P = o(h ?? N ?? null), F = t();
|
|
31
31
|
return a(() => {
|
|
32
|
-
y || (
|
|
32
|
+
y || (P.current = h ?? N ?? null);
|
|
33
33
|
}, [
|
|
34
|
-
|
|
34
|
+
N,
|
|
35
35
|
y,
|
|
36
36
|
h
|
|
37
37
|
]), a(() => {
|
|
@@ -41,14 +41,14 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
41
41
|
let t = (e) => {
|
|
42
42
|
if (e.key !== "Enter" || !y) return;
|
|
43
43
|
e.preventDefault(), e.stopPropagation();
|
|
44
|
-
let t =
|
|
44
|
+
let t = P.current ?? h ?? N;
|
|
45
45
|
t && g(t);
|
|
46
46
|
};
|
|
47
47
|
return e.addEventListener("keydown", t, !0), () => {
|
|
48
48
|
e.removeEventListener("keydown", t, !0);
|
|
49
49
|
};
|
|
50
50
|
}, [
|
|
51
|
-
|
|
51
|
+
N,
|
|
52
52
|
y,
|
|
53
53
|
g,
|
|
54
54
|
h
|
|
@@ -62,23 +62,24 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
62
62
|
}),
|
|
63
63
|
/* @__PURE__ */ c(i, {
|
|
64
64
|
id: "start-time-picker",
|
|
65
|
-
placeholder:
|
|
65
|
+
placeholder: M,
|
|
66
66
|
value: h ?? null,
|
|
67
67
|
onValueUpdate: (e) => {
|
|
68
|
-
e && (
|
|
68
|
+
e && (P.current = e);
|
|
69
69
|
},
|
|
70
70
|
onChange: (e) => {
|
|
71
|
-
e && (
|
|
71
|
+
e && (P.current = e, g(e));
|
|
72
72
|
},
|
|
73
|
-
options:
|
|
74
|
-
|
|
73
|
+
options: k,
|
|
74
|
+
compact: T,
|
|
75
|
+
disabled: j,
|
|
75
76
|
open: y,
|
|
76
77
|
onOpenChange: b,
|
|
77
78
|
triggerTestId: "start-time-trigger",
|
|
78
79
|
contentTestId: "start-time-select-content",
|
|
79
|
-
isHydrated:
|
|
80
|
+
isHydrated: E,
|
|
80
81
|
inputClassName: u(w.startTime && "border-destructive", S, C),
|
|
81
|
-
portalContainer:
|
|
82
|
+
portalContainer: F
|
|
82
83
|
}),
|
|
83
84
|
w.startTime && /* @__PURE__ */ c(r, { children: w.startTime })
|
|
84
85
|
]
|
package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,6BAA6B,CAAA;AAIpC,KAAK,2BAA2B,GAAG,oBAAoB,GAAG;IACxD,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,mEAMpC,2BAA2B,
|
|
1
|
+
{"version":3,"file":"BookingHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,6BAA6B,CAAA;AAIpC,KAAK,2BAA2B,GAAG,oBAAoB,GAAG;IACxD,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,mEAMpC,2BAA2B,4CAmB7B,CAAA"}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { cn as e } from "../../../../lib/utils.js";
|
|
2
2
|
import { HourPickerField as t } from "./StorefrontHourPickerField.js";
|
|
3
|
-
import {
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx
|
|
5
|
-
var
|
|
6
|
-
let
|
|
5
|
+
var r = ({ options: r, className: i, inputClassName: a, portalContainer: o, ...s }) => {
|
|
6
|
+
let c = r.map((e) => ({
|
|
7
7
|
...e,
|
|
8
|
-
selectedLabel: /* @__PURE__ */
|
|
9
|
-
"data-slot": "booking-hour-picker-mobile-selected-label",
|
|
10
|
-
className: "md:hidden",
|
|
11
|
-
children: e.value
|
|
12
|
-
}), /* @__PURE__ */ r("span", {
|
|
8
|
+
selectedLabel: /* @__PURE__ */ n("span", {
|
|
13
9
|
"data-slot": "booking-hour-picker-desktop-selected-label",
|
|
14
|
-
className: "hidden md:inline",
|
|
15
10
|
children: e.label
|
|
16
|
-
})
|
|
11
|
+
}),
|
|
12
|
+
compactSelectedLabel: /* @__PURE__ */ n("span", {
|
|
13
|
+
"data-slot": "booking-hour-picker-mobile-selected-label",
|
|
14
|
+
children: e.value
|
|
15
|
+
})
|
|
17
16
|
}));
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
...
|
|
20
|
-
options:
|
|
21
|
-
className: e("w-full min-w-0",
|
|
22
|
-
inputClassName: e("min-w-0",
|
|
23
|
-
portalContainer:
|
|
17
|
+
return /* @__PURE__ */ n(t, {
|
|
18
|
+
...s,
|
|
19
|
+
options: c,
|
|
20
|
+
className: e("w-full min-w-0", i),
|
|
21
|
+
inputClassName: e("min-w-0", a),
|
|
22
|
+
portalContainer: o
|
|
24
23
|
});
|
|
25
24
|
};
|
|
26
25
|
//#endregion
|
|
27
|
-
export {
|
|
26
|
+
export { r as BookingHourPickerField };
|
package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type HourPickerOption = {
|
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
5
|
selectedLabel?: React.ReactNode;
|
|
6
|
+
compactSelectedLabel?: React.ReactNode;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
description?: React.ReactNode;
|
|
8
9
|
};
|
|
@@ -28,8 +29,10 @@ export declare function HourPickerInput({ id, value, onChange, onValueUpdate, op
|
|
|
28
29
|
export declare namespace HourPickerInput {
|
|
29
30
|
var displayName: string;
|
|
30
31
|
}
|
|
31
|
-
export type HourPickerFieldProps = HourPickerInputProps
|
|
32
|
-
|
|
32
|
+
export type HourPickerFieldProps = HourPickerInputProps & {
|
|
33
|
+
compact?: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare function HourPickerField({ compact, ...props }: HourPickerFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
33
36
|
export declare namespace HourPickerField {
|
|
34
37
|
var displayName: string;
|
|
35
38
|
}
|
package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorefrontHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"StorefrontHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,MAAM,MAAM,gBAA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