@voyantjs/availability-react 0.105.2 → 0.107.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/README.md +161 -1
- package/dist/admin/availability-index-host.d.ts +12 -0
- package/dist/admin/availability-index-host.d.ts.map +1 -0
- package/dist/admin/availability-index-host.js +125 -0
- package/dist/admin/availability-page-data.d.ts +9 -0
- package/dist/admin/availability-page-data.d.ts.map +1 -0
- package/dist/admin/availability-page-data.js +25 -0
- package/dist/admin/index.d.ts +69 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +73 -0
- package/dist/admin/option-resource-templates-panel.d.ts +22 -0
- package/dist/admin/option-resource-templates-panel.d.ts.map +1 -0
- package/dist/admin/option-resource-templates-panel.js +251 -0
- package/dist/admin/rule-detail-host.d.ts +14 -0
- package/dist/admin/rule-detail-host.d.ts.map +1 -0
- package/dist/admin/rule-detail-host.js +27 -0
- package/dist/admin/slot-detail-host.d.ts +29 -0
- package/dist/admin/slot-detail-host.d.ts.map +1 -0
- package/dist/admin/slot-detail-host.js +110 -0
- package/dist/admin/start-time-detail-host.d.ts +15 -0
- package/dist/admin/start-time-detail-host.d.ts.map +1 -0
- package/dist/admin/start-time-detail-host.js +37 -0
- package/dist/components/availability-columns.d.ts +42 -0
- package/dist/components/availability-columns.d.ts.map +1 -0
- package/dist/components/availability-columns.js +182 -0
- package/dist/components/availability-dialogs.d.ts +236 -0
- package/dist/components/availability-dialogs.d.ts.map +1 -0
- package/dist/components/availability-dialogs.js +369 -0
- package/dist/components/availability-overview.d.ts +54 -0
- package/dist/components/availability-overview.d.ts.map +1 -0
- package/dist/components/availability-overview.js +50 -0
- package/dist/components/availability-page.d.ts +32 -0
- package/dist/components/availability-page.d.ts.map +1 -0
- package/dist/components/availability-page.js +128 -0
- package/dist/components/availability-rule-detail-page.d.ts +251 -0
- package/dist/components/availability-rule-detail-page.d.ts.map +1 -0
- package/dist/components/availability-rule-detail-page.js +74 -0
- package/dist/components/availability-section-header.d.ts +8 -0
- package/dist/components/availability-section-header.d.ts.map +1 -0
- package/dist/components/availability-section-header.js +7 -0
- package/dist/components/availability-skeletons.d.ts +6 -0
- package/dist/components/availability-skeletons.d.ts.map +1 -0
- package/dist/components/availability-skeletons.js +34 -0
- package/dist/components/availability-slot-detail-page.d.ts +974 -0
- package/dist/components/availability-slot-detail-page.d.ts.map +1 -0
- package/dist/components/availability-slot-detail-page.js +383 -0
- package/dist/components/availability-start-time-detail-page.d.ts +246 -0
- package/dist/components/availability-start-time-detail-page.d.ts.map +1 -0
- package/dist/components/availability-start-time-detail-page.js +83 -0
- package/dist/components/availability-tabs.d.ts +152 -0
- package/dist/components/availability-tabs.d.ts.map +1 -0
- package/dist/components/availability-tabs.js +192 -0
- package/dist/components/slot-status-tone.d.ts +15 -0
- package/dist/components/slot-status-tone.d.ts.map +1 -0
- package/dist/components/slot-status-tone.js +18 -0
- package/dist/form-resolver.d.ts +4 -0
- package/dist/form-resolver.d.ts.map +1 -0
- package/dist/form-resolver.js +40 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/use-availability-batch-mutations.d.ts +193 -0
- package/dist/hooks/use-availability-batch-mutations.d.ts.map +1 -0
- package/dist/hooks/use-availability-batch-mutations.js +53 -0
- package/dist/hooks/use-availability-closeout-mutation.d.ts +34 -0
- package/dist/hooks/use-availability-closeout-mutation.d.ts.map +1 -0
- package/dist/hooks/use-availability-closeout-mutation.js +38 -0
- package/dist/hooks/use-availability-pickup-point-mutation.d.ts +35 -0
- package/dist/hooks/use-availability-pickup-point-mutation.d.ts.map +1 -0
- package/dist/hooks/use-availability-pickup-point-mutation.js +38 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/provider.d.ts +2003 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +102 -0
- package/dist/schemas.d.ts +63 -2
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +22 -2
- package/dist/ui.d.ts +13 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +12 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -0
- package/package.json +92 -9
- package/src/styles.css +11 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Badge, Button } from "@voyantjs/ui/components";
|
|
4
|
+
import { DataTableColumnHeader } from "@voyantjs/ui/components/data-table-column-header";
|
|
5
|
+
import { cn } from "@voyantjs/ui/lib/utils";
|
|
6
|
+
import { ExternalLink, Pencil } from "lucide-react";
|
|
7
|
+
import { useAvailabilityUiMessagesOrDefault } from "../i18n/index.js";
|
|
8
|
+
import { productNameById, slotLocalEnd, slotLocalStart, slotStatusTone, } from "../index.js";
|
|
9
|
+
import { slotStatusToneClass } from "./slot-status-tone.js";
|
|
10
|
+
export function getSlotStatusLabel(status, messages) {
|
|
11
|
+
switch (status) {
|
|
12
|
+
case "open":
|
|
13
|
+
return messages.statusOpen;
|
|
14
|
+
case "closed":
|
|
15
|
+
return messages.statusClosed;
|
|
16
|
+
case "sold_out":
|
|
17
|
+
return messages.statusSoldOut;
|
|
18
|
+
case "cancelled":
|
|
19
|
+
return messages.statusCancelled;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function formatSlotLocalDateTime(value) {
|
|
23
|
+
return `${value.date} ${value.time}`;
|
|
24
|
+
}
|
|
25
|
+
function ViewButton({ label, onClick }) {
|
|
26
|
+
useAvailabilityUiMessagesOrDefault();
|
|
27
|
+
return (_jsxs(Button, { variant: "ghost", size: "sm", onClick: (event) => {
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
onClick();
|
|
30
|
+
}, children: [_jsx(ExternalLink, { className: "mr-2 h-4 w-4" }), label] }));
|
|
31
|
+
}
|
|
32
|
+
function EditButton({ label, onClick }) {
|
|
33
|
+
useAvailabilityUiMessagesOrDefault();
|
|
34
|
+
return (_jsxs(Button, { variant: "ghost", size: "sm", onClick: (event) => {
|
|
35
|
+
event.stopPropagation();
|
|
36
|
+
onClick();
|
|
37
|
+
}, children: [_jsx(Pencil, { className: "mr-2 h-4 w-4" }), label] }));
|
|
38
|
+
}
|
|
39
|
+
export const availabilityRuleColumns = (products, onView, messages) => [
|
|
40
|
+
{
|
|
41
|
+
accessorKey: "productId",
|
|
42
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.productLabel }),
|
|
43
|
+
cell: ({ row }) => productNameById(products, row.original.productId, row.original.productName),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
accessorKey: "timezone",
|
|
47
|
+
header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.timezoneLabel })),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
accessorKey: "recurrenceRule",
|
|
51
|
+
header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.recurrenceLabel })),
|
|
52
|
+
cell: ({ row }) => (_jsx("span", { className: "max-w-[380px] truncate font-mono text-xs", children: row.original.recurrenceRule })),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
accessorKey: "maxCapacity",
|
|
56
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.maxPaxLabel }),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
accessorKey: "active",
|
|
60
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.activeLabel }),
|
|
61
|
+
cell: ({ row }) => (_jsx(Badge, { variant: row.original.active ? "default" : "secondary", children: row.original.active ? messages.statusActive : messages.statusInactive })),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "view",
|
|
65
|
+
header: messages.viewLabel,
|
|
66
|
+
cell: ({ row }) => (_jsx(ViewButton, { label: messages.openLabel, onClick: () => onView(row.original.id) })),
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
export const availabilityStartTimeColumns = (products, onView, messages) => [
|
|
70
|
+
{
|
|
71
|
+
accessorKey: "productId",
|
|
72
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.productLabel }),
|
|
73
|
+
cell: ({ row }) => productNameById(products, row.original.productId, row.original.productName),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
accessorKey: "label",
|
|
77
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.labelLabel }),
|
|
78
|
+
cell: ({ row }) => row.original.label ?? messages.details.noValue,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
accessorKey: "startTimeLocal",
|
|
82
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.startLabel }),
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
accessorKey: "durationMinutes",
|
|
86
|
+
header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.durationLabel })),
|
|
87
|
+
cell: ({ row }) => row.original.durationMinutes == null
|
|
88
|
+
? messages.details.noValue
|
|
89
|
+
: `${row.original.durationMinutes} min`,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
accessorKey: "active",
|
|
93
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.statusLabel }),
|
|
94
|
+
cell: ({ row }) => (_jsx(Badge, { variant: row.original.active ? "default" : "secondary", children: row.original.active ? messages.statusActive : messages.statusInactive })),
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "view",
|
|
98
|
+
header: messages.viewLabel,
|
|
99
|
+
cell: ({ row }) => (_jsx(ViewButton, { label: messages.openLabel, onClick: () => onView(row.original.id) })),
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
export const availabilitySlotColumns = (products, onView, messages, onEdit) => [
|
|
103
|
+
{
|
|
104
|
+
accessorKey: "productId",
|
|
105
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.productLabel }),
|
|
106
|
+
cell: ({ row }) => productNameById(products, row.original.productId, row.original.productName),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
accessorKey: "startsAt",
|
|
110
|
+
header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.startsAtLabel })),
|
|
111
|
+
cell: ({ row }) => formatSlotLocalDateTime(slotLocalStart(row.original)),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
accessorKey: "endsAt",
|
|
115
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.endsAtLabel }),
|
|
116
|
+
cell: ({ row }) => row.original.endsAt
|
|
117
|
+
? formatSlotLocalDateTime(slotLocalEnd(row.original) ?? slotLocalStart(row.original))
|
|
118
|
+
: messages.details.noValue,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
accessorKey: "initialPax",
|
|
122
|
+
header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.totalPaxLabel })),
|
|
123
|
+
cell: ({ row }) => row.original.initialPax ?? messages.details.noValue,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
accessorKey: "remainingPax",
|
|
127
|
+
header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.remainingPaxLabel })),
|
|
128
|
+
cell: ({ row }) => row.original.remainingPax ?? messages.details.noValue,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
accessorKey: "status",
|
|
132
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.statusLabel }),
|
|
133
|
+
cell: ({ row }) => (_jsx(Badge, { variant: "outline", className: cn("capitalize", slotStatusToneClass[slotStatusTone[row.original.status]]), children: getSlotStatusLabel(row.original.status, messages) })),
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "actions",
|
|
137
|
+
header: () => _jsx("span", { className: "sr-only", children: messages.viewLabel }),
|
|
138
|
+
cell: ({ row }) => (_jsxs("div", { className: "flex items-center justify-end gap-1", children: [onEdit ? (_jsx(EditButton, { label: messages.editLabel, onClick: () => onEdit(row.original) })) : null, _jsx(ViewButton, { label: messages.openLabel, onClick: () => onView(row.original.id) })] })),
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
export const availabilityCloseoutColumns = (products, messages) => [
|
|
142
|
+
{
|
|
143
|
+
accessorKey: "productId",
|
|
144
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.productLabel }),
|
|
145
|
+
cell: ({ row }) => productNameById(products, row.original.productId, row.original.productName),
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
accessorKey: "dateLocal",
|
|
149
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.dateLabel }),
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
accessorKey: "slotId",
|
|
153
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.slotLabel }),
|
|
154
|
+
cell: ({ row }) => row.original.slotId ?? messages.productLevelLabel,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
accessorKey: "reason",
|
|
158
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.reasonLabel }),
|
|
159
|
+
cell: ({ row }) => row.original.reason ?? messages.details.noValue,
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
export const availabilityPickupPointColumns = (products, messages) => [
|
|
163
|
+
{
|
|
164
|
+
accessorKey: "productId",
|
|
165
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.productLabel }),
|
|
166
|
+
cell: ({ row }) => productNameById(products, row.original.productId, row.original.productName),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
accessorKey: "name",
|
|
170
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.nameLabel }),
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
accessorKey: "locationText",
|
|
174
|
+
header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.locationLabel })),
|
|
175
|
+
cell: ({ row }) => row.original.locationText ?? messages.details.noValue,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
accessorKey: "active",
|
|
179
|
+
header: ({ column }) => _jsx(DataTableColumnHeader, { column: column, title: messages.statusLabel }),
|
|
180
|
+
cell: ({ row }) => (_jsx(Badge, { variant: row.original.active ? "default" : "secondary", children: row.original.active ? messages.statusActive : messages.statusInactive })),
|
|
181
|
+
},
|
|
182
|
+
];
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { AvailabilityCloseoutRow, AvailabilityPickupPointRow, AvailabilityRuleRow, AvailabilitySlotRow, AvailabilityStartTimeRow, ProductOption } from "../index.js";
|
|
2
|
+
interface RuleDialogMessages {
|
|
3
|
+
validationProductRequired: string;
|
|
4
|
+
validationTimezoneRequired: string;
|
|
5
|
+
validationRecurrenceRequired: string;
|
|
6
|
+
editTitle: string;
|
|
7
|
+
newTitle: string;
|
|
8
|
+
productLabel: string;
|
|
9
|
+
selectProductPlaceholder: string;
|
|
10
|
+
timezoneLabel: string;
|
|
11
|
+
timezonePlaceholder: string;
|
|
12
|
+
maxCapacityLabel: string;
|
|
13
|
+
recurrenceRuleLabel: string;
|
|
14
|
+
recurrenceRulePlaceholder: string;
|
|
15
|
+
maxPickupCapacityLabel: string;
|
|
16
|
+
minimumTotalPaxLabel: string;
|
|
17
|
+
cutoffMinutesLabel: string;
|
|
18
|
+
earlyBookingLimitMinutesLabel: string;
|
|
19
|
+
activeTitle: string;
|
|
20
|
+
activeDescription: string;
|
|
21
|
+
cancel: string;
|
|
22
|
+
save: string;
|
|
23
|
+
create: string;
|
|
24
|
+
}
|
|
25
|
+
interface StartTimeDialogMessages {
|
|
26
|
+
validationProductRequired: string;
|
|
27
|
+
validationStartTimeRequired: string;
|
|
28
|
+
editTitle: string;
|
|
29
|
+
newTitle: string;
|
|
30
|
+
productLabel: string;
|
|
31
|
+
selectProductPlaceholder: string;
|
|
32
|
+
labelLabel: string;
|
|
33
|
+
labelPlaceholder: string;
|
|
34
|
+
startTimeLabel: string;
|
|
35
|
+
durationMinutesLabel: string;
|
|
36
|
+
sortOrderLabel: string;
|
|
37
|
+
activeTitle: string;
|
|
38
|
+
activeDescription: string;
|
|
39
|
+
cancel: string;
|
|
40
|
+
save: string;
|
|
41
|
+
create: string;
|
|
42
|
+
}
|
|
43
|
+
interface SlotDialogMessages {
|
|
44
|
+
validationProductRequired: string;
|
|
45
|
+
validationDateRequired: string;
|
|
46
|
+
validationStartsAtRequired: string;
|
|
47
|
+
validationTimezoneRequired: string;
|
|
48
|
+
editTitle: string;
|
|
49
|
+
newTitle: string;
|
|
50
|
+
productLabel: string;
|
|
51
|
+
selectProductPlaceholder: string;
|
|
52
|
+
ruleLabel: string;
|
|
53
|
+
optionalRulePlaceholder: string;
|
|
54
|
+
noRule: string;
|
|
55
|
+
startTimeLabel: string;
|
|
56
|
+
optionalStartTimePlaceholder: string;
|
|
57
|
+
noStartTime: string;
|
|
58
|
+
dateLabel: string;
|
|
59
|
+
timezoneLabel: string;
|
|
60
|
+
timezonePlaceholder: string;
|
|
61
|
+
startsAtLabel: string;
|
|
62
|
+
endsAtLabel: string;
|
|
63
|
+
statusLabel: string;
|
|
64
|
+
unlimitedLabel: string;
|
|
65
|
+
yes: string;
|
|
66
|
+
no: string;
|
|
67
|
+
initialPaxLabel: string;
|
|
68
|
+
remainingPaxLabel: string;
|
|
69
|
+
remainingResourcesLabel: string;
|
|
70
|
+
initialPickupsLabel: string;
|
|
71
|
+
remainingPickupsLabel: string;
|
|
72
|
+
pastCutoffTitle: string;
|
|
73
|
+
pastCutoffDescription: string;
|
|
74
|
+
tooEarlyTitle: string;
|
|
75
|
+
tooEarlyDescription: string;
|
|
76
|
+
notesLabel: string;
|
|
77
|
+
notesPlaceholder: string;
|
|
78
|
+
cancel: string;
|
|
79
|
+
save: string;
|
|
80
|
+
create: string;
|
|
81
|
+
}
|
|
82
|
+
interface CloseoutDialogMessages {
|
|
83
|
+
validationProductRequired: string;
|
|
84
|
+
validationDateRequired: string;
|
|
85
|
+
editTitle: string;
|
|
86
|
+
newTitle: string;
|
|
87
|
+
productLabel: string;
|
|
88
|
+
selectProductPlaceholder: string;
|
|
89
|
+
slotLabel: string;
|
|
90
|
+
optionalSlotPlaceholder: string;
|
|
91
|
+
productLevelOption: string;
|
|
92
|
+
dateLabel: string;
|
|
93
|
+
datePlaceholder: string;
|
|
94
|
+
reasonLabel: string;
|
|
95
|
+
reasonPlaceholder: string;
|
|
96
|
+
cancel: string;
|
|
97
|
+
save: string;
|
|
98
|
+
create: string;
|
|
99
|
+
}
|
|
100
|
+
interface PickupPointDialogMessages {
|
|
101
|
+
validationProductRequired: string;
|
|
102
|
+
validationNameRequired: string;
|
|
103
|
+
editTitle: string;
|
|
104
|
+
newTitle: string;
|
|
105
|
+
productLabel: string;
|
|
106
|
+
selectProductPlaceholder: string;
|
|
107
|
+
nameLabel: string;
|
|
108
|
+
namePlaceholder: string;
|
|
109
|
+
locationTextLabel: string;
|
|
110
|
+
locationTextPlaceholder: string;
|
|
111
|
+
descriptionLabel: string;
|
|
112
|
+
descriptionPlaceholder: string;
|
|
113
|
+
activeTitle: string;
|
|
114
|
+
activeDescription: string;
|
|
115
|
+
cancel: string;
|
|
116
|
+
save: string;
|
|
117
|
+
create: string;
|
|
118
|
+
}
|
|
119
|
+
export interface AvailabilityDialogMessages {
|
|
120
|
+
dialogs: {
|
|
121
|
+
rule: RuleDialogMessages;
|
|
122
|
+
startTime: StartTimeDialogMessages;
|
|
123
|
+
slot: SlotDialogMessages;
|
|
124
|
+
closeout: CloseoutDialogMessages;
|
|
125
|
+
pickupPoint: PickupPointDialogMessages;
|
|
126
|
+
};
|
|
127
|
+
statusOpen: string;
|
|
128
|
+
statusClosed: string;
|
|
129
|
+
statusSoldOut: string;
|
|
130
|
+
statusCancelled: string;
|
|
131
|
+
}
|
|
132
|
+
type SubmitContext = {
|
|
133
|
+
isEditing: boolean;
|
|
134
|
+
id?: string;
|
|
135
|
+
};
|
|
136
|
+
export type AvailabilityRuleSubmitPayload = {
|
|
137
|
+
productId: string;
|
|
138
|
+
timezone: string;
|
|
139
|
+
recurrenceRule: string;
|
|
140
|
+
maxCapacity: number;
|
|
141
|
+
maxPickupCapacity: number | null;
|
|
142
|
+
minTotalPax: number | null;
|
|
143
|
+
cutoffMinutes: number | null;
|
|
144
|
+
earlyBookingLimitMinutes: number | null;
|
|
145
|
+
active: boolean;
|
|
146
|
+
};
|
|
147
|
+
export type AvailabilityStartTimeSubmitPayload = {
|
|
148
|
+
productId: string;
|
|
149
|
+
label: string | null;
|
|
150
|
+
startTimeLocal: string;
|
|
151
|
+
durationMinutes: number | null;
|
|
152
|
+
sortOrder: number;
|
|
153
|
+
active: boolean;
|
|
154
|
+
};
|
|
155
|
+
export type AvailabilitySlotSubmitPayload = {
|
|
156
|
+
productId: string;
|
|
157
|
+
availabilityRuleId: string | null;
|
|
158
|
+
startTimeId: string | null;
|
|
159
|
+
dateLocal: string;
|
|
160
|
+
startsAt: string;
|
|
161
|
+
endsAt: string | null;
|
|
162
|
+
timezone: string;
|
|
163
|
+
status: AvailabilitySlotRow["status"];
|
|
164
|
+
unlimited: boolean;
|
|
165
|
+
initialPax: number | null;
|
|
166
|
+
remainingPax: number | null;
|
|
167
|
+
initialPickups: number | null;
|
|
168
|
+
remainingPickups: number | null;
|
|
169
|
+
remainingResources: number | null;
|
|
170
|
+
pastCutoff: boolean;
|
|
171
|
+
tooEarly: boolean;
|
|
172
|
+
notes: string | null;
|
|
173
|
+
};
|
|
174
|
+
export type AvailabilityCloseoutSubmitPayload = {
|
|
175
|
+
productId: string;
|
|
176
|
+
slotId: string | null;
|
|
177
|
+
dateLocal: string;
|
|
178
|
+
reason: string | null;
|
|
179
|
+
};
|
|
180
|
+
export type AvailabilityPickupPointSubmitPayload = {
|
|
181
|
+
productId: string;
|
|
182
|
+
name: string;
|
|
183
|
+
description: string | null;
|
|
184
|
+
locationText: string | null;
|
|
185
|
+
active: boolean;
|
|
186
|
+
};
|
|
187
|
+
export declare function AvailabilityRuleDialog(props: {
|
|
188
|
+
messages: AvailabilityDialogMessages;
|
|
189
|
+
open: boolean;
|
|
190
|
+
onOpenChange: (open: boolean) => void;
|
|
191
|
+
rule?: AvailabilityRuleRow;
|
|
192
|
+
products: ProductOption[];
|
|
193
|
+
onSubmit: (payload: AvailabilityRuleSubmitPayload, context: SubmitContext) => Promise<void>;
|
|
194
|
+
onSuccess: () => void;
|
|
195
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
196
|
+
export declare function AvailabilityStartTimeDialog(props: {
|
|
197
|
+
messages: AvailabilityDialogMessages;
|
|
198
|
+
open: boolean;
|
|
199
|
+
onOpenChange: (open: boolean) => void;
|
|
200
|
+
startTime?: AvailabilityStartTimeRow;
|
|
201
|
+
products: ProductOption[];
|
|
202
|
+
onSubmit: (payload: AvailabilityStartTimeSubmitPayload, context: SubmitContext) => Promise<void>;
|
|
203
|
+
onSuccess: () => void;
|
|
204
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
205
|
+
export declare function AvailabilitySlotDialog(props: {
|
|
206
|
+
messages: AvailabilityDialogMessages;
|
|
207
|
+
open: boolean;
|
|
208
|
+
onOpenChange: (open: boolean) => void;
|
|
209
|
+
slot?: AvailabilitySlotRow;
|
|
210
|
+
products: ProductOption[];
|
|
211
|
+
rules: AvailabilityRuleRow[];
|
|
212
|
+
startTimes: AvailabilityStartTimeRow[];
|
|
213
|
+
onSubmit: (payload: AvailabilitySlotSubmitPayload, context: SubmitContext) => Promise<void>;
|
|
214
|
+
onSuccess: () => void;
|
|
215
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
216
|
+
export declare function AvailabilityCloseoutDialog(props: {
|
|
217
|
+
messages: AvailabilityDialogMessages;
|
|
218
|
+
open: boolean;
|
|
219
|
+
onOpenChange: (open: boolean) => void;
|
|
220
|
+
closeout?: AvailabilityCloseoutRow;
|
|
221
|
+
products: ProductOption[];
|
|
222
|
+
slots: AvailabilitySlotRow[];
|
|
223
|
+
onSubmit: (payload: AvailabilityCloseoutSubmitPayload, context: SubmitContext) => Promise<void>;
|
|
224
|
+
onSuccess: () => void;
|
|
225
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
226
|
+
export declare function AvailabilityPickupPointDialog(props: {
|
|
227
|
+
messages: AvailabilityDialogMessages;
|
|
228
|
+
open: boolean;
|
|
229
|
+
onOpenChange: (open: boolean) => void;
|
|
230
|
+
pickupPoint?: AvailabilityPickupPointRow;
|
|
231
|
+
products: ProductOption[];
|
|
232
|
+
onSubmit: (payload: AvailabilityPickupPointSubmitPayload, context: SubmitContext) => Promise<void>;
|
|
233
|
+
onSuccess: () => void;
|
|
234
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
235
|
+
export {};
|
|
236
|
+
//# sourceMappingURL=availability-dialogs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability-dialogs.d.ts","sourceRoot":"","sources":["../../src/components/availability-dialogs.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EACd,MAAM,aAAa,CAAA;AAYpB,UAAU,kBAAkB;IAC1B,yBAAyB,EAAE,MAAM,CAAA;IACjC,0BAA0B,EAAE,MAAM,CAAA;IAClC,4BAA4B,EAAE,MAAM,CAAA;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,wBAAwB,EAAE,MAAM,CAAA;IAChC,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBA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