@voyantjs/availability-ui 0.28.1 → 0.28.3
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/availability-overview.d.ts +12 -2
- package/dist/components/availability-overview.d.ts.map +1 -1
- package/dist/components/availability-overview.js +35 -4
- package/dist/components/availability-tabs.d.ts +6 -0
- package/dist/components/availability-tabs.d.ts.map +1 -1
- package/dist/components/availability-tabs.js +5 -5
- package/package.json +5 -5
|
@@ -18,16 +18,24 @@ export interface AvailabilityOverviewMessages extends AvailabilityColumnsMessage
|
|
|
18
18
|
coverageGapsTitle: string;
|
|
19
19
|
coverageGapsEmpty: string;
|
|
20
20
|
coverageGapDescription: string;
|
|
21
|
+
actionRequiredTitle: string;
|
|
22
|
+
actionRequiredBody: string;
|
|
23
|
+
actionRequiredCta: string;
|
|
24
|
+
attentionTitle: string;
|
|
25
|
+
attentionEmpty: string;
|
|
26
|
+
severityCoverageGap: string;
|
|
27
|
+
severityClosed: string;
|
|
28
|
+
severitySoldOut: string;
|
|
21
29
|
};
|
|
22
30
|
}
|
|
23
|
-
export declare function AvailabilityOverview({ messages, products, constrainedSlots, openSlotsCount: providedOpenSlotsCount, filteredRules, filteredPickupPoints,
|
|
31
|
+
export declare function AvailabilityOverview({ messages, products, constrainedSlots, openSlotsCount: providedOpenSlotsCount, filteredRules, filteredPickupPoints, productsWithoutUpcomingDepartures, search, setSearch, productFilter, setProductFilter, hasFilters, onClearFilters, onOpenSlot, onOpenProduct, onJumpToSlots, showFilters, }: {
|
|
24
32
|
messages: AvailabilityOverviewMessages;
|
|
25
33
|
products: ProductOption[];
|
|
26
34
|
constrainedSlots: AvailabilitySlotRow[];
|
|
27
35
|
openSlotsCount?: number;
|
|
28
36
|
filteredRules: AvailabilityRuleRow[];
|
|
29
37
|
filteredPickupPoints: AvailabilityPickupPointRow[];
|
|
30
|
-
|
|
38
|
+
productsWithoutUpcomingDepartures: ProductOption[];
|
|
31
39
|
search: string;
|
|
32
40
|
setSearch: (value: string) => void;
|
|
33
41
|
productFilter: string;
|
|
@@ -36,5 +44,7 @@ export declare function AvailabilityOverview({ messages, products, constrainedSl
|
|
|
36
44
|
onClearFilters: () => void;
|
|
37
45
|
onOpenSlot: (slotId: string) => void;
|
|
38
46
|
onOpenProduct: (productId: string) => void;
|
|
47
|
+
onJumpToSlots?: () => void;
|
|
48
|
+
showFilters?: boolean;
|
|
39
49
|
}): import("react/jsx-runtime").JSX.Element;
|
|
40
50
|
//# sourceMappingURL=availability-overview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"availability-overview.d.ts","sourceRoot":"","sources":["../../src/components/availability-overview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACd,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"availability-overview.d.ts","sourceRoot":"","sources":["../../src/components/availability-overview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACd,MAAM,8BAA8B,CAAA;AA4BrC,OAAO,EAAE,KAAK,2BAA2B,EAAsB,MAAM,2BAA2B,CAAA;AAShG,MAAM,WAAW,4BAA6B,SAAQ,2BAA2B;IAC/E,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE;QACR,cAAc,EAAE,MAAM,CAAA;QACtB,oBAAoB,EAAE,MAAM,CAAA;QAC5B,qBAAqB,EAAE,MAAM,CAAA;QAC7B,2BAA2B,EAAE,MAAM,CAAA;QACnC,gBAAgB,EAAE,MAAM,CAAA;QACxB,sBAAsB,EAAE,MAAM,CAAA;QAC9B,iBAAiB,EAAE,MAAM,CAAA;QACzB,uBAAuB,EAAE,MAAM,CAAA;QAC/B,sBAAsB,EAA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,KAAK,IAAI,CAAA;IACpC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,2CAsKA"}
|
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { formatDateTime, productNameById } from "@voyantjs/availability-react";
|
|
4
|
-
import { Button, Card, CardContent, CardHeader, CardTitle, Input, OverviewMetric, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@voyantjs/ui/components";
|
|
5
|
-
import { CalendarDays, Clock3, Package, Search, Truck } from "lucide-react";
|
|
4
|
+
import { Badge, Button, Card, CardContent, CardHeader, CardTitle, cn, Input, OverviewMetric, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@voyantjs/ui/components";
|
|
5
|
+
import { AlertTriangle, ArrowRight, CalendarDays, CheckCircle2, Clock3, Package, Search, Truck, } from "lucide-react";
|
|
6
6
|
import { getSlotStatusLabel } from "./availability-columns.js";
|
|
7
|
-
|
|
7
|
+
function interpolate(template, values) {
|
|
8
|
+
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
9
|
+
const value = values[key];
|
|
10
|
+
return value === undefined ? "" : String(value);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export function AvailabilityOverview({ messages, products, constrainedSlots, openSlotsCount: providedOpenSlotsCount, filteredRules, filteredPickupPoints, productsWithoutUpcomingDepartures, search, setSearch, productFilter, setProductFilter, hasFilters, onClearFilters, onOpenSlot, onOpenProduct, onJumpToSlots, showFilters = true, }) {
|
|
8
14
|
const openSlotsCount = providedOpenSlotsCount ?? constrainedSlots.filter((slot) => slot.status === "open").length;
|
|
9
15
|
const activeRulesCount = filteredRules.filter((rule) => rule.active).length;
|
|
10
16
|
const activePickupPointsCount = filteredPickupPoints.filter((pickupPoint) => pickupPoint.active).length;
|
|
11
|
-
|
|
17
|
+
const noDeparturesCount = productsWithoutUpcomingDepartures.length;
|
|
18
|
+
const hasNoDeparturesProducts = noDeparturesCount > 0;
|
|
19
|
+
const hasConstrainedSlots = constrainedSlots.length > 0;
|
|
20
|
+
const hasAttention = hasNoDeparturesProducts || hasConstrainedSlots;
|
|
21
|
+
return (_jsxs(_Fragment, { children: [hasNoDeparturesProducts ? (_jsxs("div", { className: "flex flex-col gap-3 rounded-lg border border-amber-300 bg-amber-50 p-4 text-amber-900 sm:flex-row sm:items-center sm:justify-between dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-100", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-5 w-5 shrink-0" }), _jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "font-medium", children: messages.overview.actionRequiredTitle }), _jsx("p", { className: "text-sm text-amber-900/80 dark:text-amber-100/80", children: interpolate(messages.overview.actionRequiredBody, { count: noDeparturesCount }) })] })] }), onJumpToSlots ? (_jsx(Button, { size: "sm", className: "self-start sm:self-auto", onClick: onJumpToSlots, children: messages.overview.actionRequiredCta })) : null] })) : null, _jsxs("div", { className: "grid gap-3 grid-cols-2 xl:grid-cols-4", children: [_jsx(OverviewMetric, { title: messages.overview.openSlotsTitle, value: openSlotsCount, description: messages.overview.openSlotsDescription, icon: CalendarDays }), _jsx(OverviewMetric, { title: messages.overview.constrainedSlotsTitle, value: constrainedSlots.length, description: messages.overview.constrainedSlotsDescription, icon: Clock3 }), _jsx(OverviewMetric, { title: messages.overview.activeRulesTitle, value: activeRulesCount, description: messages.overview.activeRulesDescription, icon: Package }), _jsx(OverviewMetric, { title: messages.overview.pickupPointsTitle, value: activePickupPointsCount, description: messages.overview.pickupPointsDescription, icon: Truck })] }), _jsxs(Card, { size: "sm", children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between gap-3", children: [_jsxs(CardTitle, { className: "flex items-center gap-2 text-sm", children: [messages.overview.attentionTitle, hasAttention ? (_jsx(Badge, { variant: "secondary", className: "tabular-nums", children: noDeparturesCount + constrainedSlots.length })) : null] }), !hasAttention ? (_jsxs("span", { className: "flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400", children: [_jsx(CheckCircle2, { className: "h-4 w-4" }), messages.overview.attentionEmpty.split(".")[0]] })) : null] }), _jsx(CardContent, { className: "grid gap-3 lg:grid-cols-2", children: hasAttention ? (_jsxs(_Fragment, { children: [_jsx(AttentionColumn, { title: messages.overview.coverageGapsTitle, count: noDeparturesCount, items: productsWithoutUpcomingDepartures.slice(0, 4).map((product) => ({
|
|
22
|
+
id: product.id,
|
|
23
|
+
primary: product.name,
|
|
24
|
+
secondary: messages.overview.coverageGapDescription,
|
|
25
|
+
severityLabel: messages.overview.severityCoverageGap,
|
|
26
|
+
severityTone: "destructive",
|
|
27
|
+
onClick: () => onOpenProduct(product.id),
|
|
28
|
+
})), emptyMessage: messages.overview.coverageGapsEmpty }), _jsx(AttentionColumn, { title: messages.overview.capacityWatchlistTitle, count: constrainedSlots.length, items: constrainedSlots.slice(0, 4).map((slot) => ({
|
|
29
|
+
id: slot.id,
|
|
30
|
+
primary: `${productNameById(products, slot.productId, slot.productName)} · ${slot.dateLocal}`,
|
|
31
|
+
secondary: `${formatDateTime(slot.startsAt)} · ${messages.remainingPaxLabel}: ${slot.remainingPax ?? messages.details.noValue}`,
|
|
32
|
+
severityLabel: slot.status === "sold_out"
|
|
33
|
+
? messages.overview.severitySoldOut
|
|
34
|
+
: slot.status === "closed"
|
|
35
|
+
? messages.overview.severityClosed
|
|
36
|
+
: getSlotStatusLabel(slot.status, messages),
|
|
37
|
+
severityTone: slot.status === "sold_out" ? "default" : "outline",
|
|
38
|
+
onClick: () => onOpenSlot(slot.id),
|
|
39
|
+
})), emptyMessage: messages.overview.capacityWatchlistEmpty })] })) : (_jsx("p", { className: "col-span-full py-6 text-center text-sm text-muted-foreground", children: messages.overview.attentionEmpty })) })] }), showFilters ? (_jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [_jsxs("div", { className: "flex flex-1 flex-col gap-3 md:flex-row md:items-center", children: [_jsxs("div", { className: "relative w-full max-w-sm", children: [_jsx(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { placeholder: messages.searchPlaceholder, value: search, onChange: (event) => setSearch(event.target.value), className: "pl-9" })] }), _jsxs(Select, { value: productFilter, onValueChange: (value) => setProductFilter(value ?? "all"), children: [_jsx(SelectTrigger, { className: "w-full md:w-56", children: _jsx(SelectValue, { placeholder: messages.allProducts }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: messages.allProducts }), products.map((product) => (_jsx(SelectItem, { value: product.id, children: product.name }, product.id)))] })] })] }), hasFilters ? (_jsx(Button, { variant: "outline", onClick: onClearFilters, children: messages.clearFilters })) : null] })) : null] }));
|
|
40
|
+
}
|
|
41
|
+
function AttentionColumn({ title, count, items, emptyMessage, }) {
|
|
42
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center gap-2 px-1", children: [_jsx("span", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: title }), count > 0 ? (_jsx(Badge, { variant: "outline", className: "tabular-nums", children: count })) : null] }), items.length === 0 ? (_jsx("p", { className: "rounded-md border border-dashed px-3 py-4 text-center text-xs text-muted-foreground", children: emptyMessage })) : (_jsx("ul", { className: "flex flex-col gap-1.5", children: items.map((item) => (_jsx("li", { children: _jsxs("button", { type: "button", onClick: item.onClick, className: cn("group flex w-full items-start justify-between gap-3 rounded-md border bg-card px-3 py-2 text-left transition-colors", "hover:border-foreground/30 hover:bg-muted/40", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: [_jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Badge, { variant: item.severityTone, className: "text-[10px] uppercase", children: item.severityLabel }), _jsx("span", { className: "truncate text-sm font-medium", children: item.primary })] }), _jsx("p", { className: "truncate text-xs text-muted-foreground", children: item.secondary })] }), _jsx(ArrowRight, { className: "mt-1 h-4 w-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5" })] }) }, item.id))) }))] }));
|
|
12
43
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OnChangeFn, RowSelectionState } from "@tanstack/react-table";
|
|
2
2
|
import type { AvailabilityCloseoutRow, AvailabilityPickupPointRow, AvailabilityRuleRow, AvailabilitySlotRow, AvailabilityStartTimeRow, ProductOption } from "@voyantjs/availability-react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
3
4
|
import { type AvailabilityColumnsMessages } from "./availability-columns.js";
|
|
4
5
|
export interface AvailabilityTabMessages extends AvailabilityColumnsMessages {
|
|
5
6
|
nouns: {
|
|
@@ -87,6 +88,7 @@ export declare function AvailabilitySlotsTab(props: {
|
|
|
87
88
|
onCreate: () => void;
|
|
88
89
|
onOpenRoute: (slotId: string) => void;
|
|
89
90
|
onEdit: (row: AvailabilitySlotRow) => void;
|
|
91
|
+
toolbar?: ReactNode;
|
|
90
92
|
}): import("react/jsx-runtime").JSX.Element;
|
|
91
93
|
export declare function AvailabilityRulesTab(props: {
|
|
92
94
|
messages: AvailabilityTabMessages;
|
|
@@ -100,6 +102,7 @@ export declare function AvailabilityRulesTab(props: {
|
|
|
100
102
|
onCreate: () => void;
|
|
101
103
|
onOpenRoute: (ruleId: string) => void;
|
|
102
104
|
onEdit: (row: AvailabilityRuleRow) => void;
|
|
105
|
+
toolbar?: ReactNode;
|
|
103
106
|
}): import("react/jsx-runtime").JSX.Element;
|
|
104
107
|
export declare function AvailabilityStartTimesTab(props: {
|
|
105
108
|
messages: AvailabilityTabMessages;
|
|
@@ -113,6 +116,7 @@ export declare function AvailabilityStartTimesTab(props: {
|
|
|
113
116
|
onCreate: () => void;
|
|
114
117
|
onOpenRoute: (startTimeId: string) => void;
|
|
115
118
|
onEdit: (row: AvailabilityStartTimeRow) => void;
|
|
119
|
+
toolbar?: ReactNode;
|
|
116
120
|
}): import("react/jsx-runtime").JSX.Element;
|
|
117
121
|
export declare function AvailabilityCloseoutsTab(props: {
|
|
118
122
|
messages: AvailabilityTabMessages;
|
|
@@ -124,6 +128,7 @@ export declare function AvailabilityCloseoutsTab(props: {
|
|
|
124
128
|
handleBulkDelete: AvailabilityBulkDeleteFn;
|
|
125
129
|
onCreate: () => void;
|
|
126
130
|
onEdit: (row: AvailabilityCloseoutRow) => void;
|
|
131
|
+
toolbar?: ReactNode;
|
|
127
132
|
}): import("react/jsx-runtime").JSX.Element;
|
|
128
133
|
export declare function AvailabilityPickupPointsTab(props: {
|
|
129
134
|
messages: AvailabilityTabMessages;
|
|
@@ -136,6 +141,7 @@ export declare function AvailabilityPickupPointsTab(props: {
|
|
|
136
141
|
handleBulkDelete: AvailabilityBulkDeleteFn;
|
|
137
142
|
onCreate: () => void;
|
|
138
143
|
onEdit: (row: AvailabilityPickupPointRow) => void;
|
|
144
|
+
toolbar?: ReactNode;
|
|
139
145
|
}): import("react/jsx-runtime").JSX.Element;
|
|
140
146
|
export {};
|
|
141
147
|
//# sourceMappingURL=availability-tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"availability-tabs.d.ts","sourceRoot":"","sources":["../../src/components/availability-tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,KAAK,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EACd,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"availability-tabs.d.ts","sourceRoot":"","sources":["../../src/components/availability-tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,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iB,CAAA;IACvC,uBAAuB,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACtD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,gBAAgB,EAAE,wBAAwB,CAAA;IAC1C,gBAAgB,EAAE,wBAAwB,CAAA;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,EAAE,CAAC,GAAG,EAAE,0BAA0B,KAAK,IAAI,CAAA;IACjD,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,2CAgGA"}
|
|
@@ -14,7 +14,7 @@ function formatTemplate(template, values) {
|
|
|
14
14
|
}
|
|
15
15
|
export function AvailabilitySlotsTab(props) {
|
|
16
16
|
const selection = (count) => formatLocalizedSelectionLabel(count, props.messages.nouns.slotSingular, props.messages.nouns.slotPlural);
|
|
17
|
-
return (_jsxs(TabsContent, { value: "slots", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.slots.title, description: props.messages.tabs.slots.description, actionLabel: props.messages.tabs.slots.actionLabel, onAction: props.onCreate }), _jsx(DataTable, { columns: availabilitySlotColumns(props.products, props.onOpenRoute, props.messages), data: props.filteredSlots, emptyMessage: props.messages.tabs.slots.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.slotSelection, onRowSelectionChange: props.setSlotSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.slots.bulkOpenButton, confirmLabel: props.messages.tabs.slots.bulkOpenConfirm, title: formatTemplate(props.messages.tabs.slots.bulkOpenTitle, {
|
|
17
|
+
return (_jsxs(TabsContent, { value: "slots", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.slots.title, description: props.messages.tabs.slots.description, actionLabel: props.messages.tabs.slots.actionLabel, onAction: props.onCreate }), props.toolbar, _jsx(DataTable, { columns: availabilitySlotColumns(props.products, props.onOpenRoute, props.messages), data: props.filteredSlots, emptyMessage: props.messages.tabs.slots.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.slotSelection, onRowSelectionChange: props.setSlotSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.slots.bulkOpenButton, confirmLabel: props.messages.tabs.slots.bulkOpenConfirm, title: formatTemplate(props.messages.tabs.slots.bulkOpenTitle, {
|
|
18
18
|
selection: selection(selectedRows.length),
|
|
19
19
|
}), description: props.messages.tabs.slots.bulkOpenDescription, disabled: props.bulkActionTarget === "slots-open", onConfirm: () => props.handleBulkUpdate({
|
|
20
20
|
ids: selectedRows.map((row) => row.original.id),
|
|
@@ -49,7 +49,7 @@ export function AvailabilitySlotsTab(props) {
|
|
|
49
49
|
}
|
|
50
50
|
export function AvailabilityRulesTab(props) {
|
|
51
51
|
const selection = (count) => formatLocalizedSelectionLabel(count, props.messages.nouns.ruleSingular, props.messages.nouns.rulePlural);
|
|
52
|
-
return (_jsxs(TabsContent, { value: "rules", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.rules.title, description: props.messages.tabs.rules.description, actionLabel: props.messages.tabs.rules.actionLabel, onAction: props.onCreate }), _jsx(DataTable, { columns: availabilityRuleColumns(props.products, props.onOpenRoute, props.messages), data: props.filteredRules, emptyMessage: props.messages.tabs.rules.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.ruleSelection, onRowSelectionChange: props.setRuleSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.rules.bulkActivateButton, confirmLabel: props.messages.tabs.rules.bulkActivateConfirm, title: formatTemplate(props.messages.tabs.rules.bulkActivateTitle, {
|
|
52
|
+
return (_jsxs(TabsContent, { value: "rules", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.rules.title, description: props.messages.tabs.rules.description, actionLabel: props.messages.tabs.rules.actionLabel, onAction: props.onCreate }), props.toolbar, _jsx(DataTable, { columns: availabilityRuleColumns(props.products, props.onOpenRoute, props.messages), data: props.filteredRules, emptyMessage: props.messages.tabs.rules.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.ruleSelection, onRowSelectionChange: props.setRuleSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.rules.bulkActivateButton, confirmLabel: props.messages.tabs.rules.bulkActivateConfirm, title: formatTemplate(props.messages.tabs.rules.bulkActivateTitle, {
|
|
53
53
|
selection: selection(selectedRows.length),
|
|
54
54
|
}), description: props.messages.tabs.rules.bulkActivateDescription, disabled: props.bulkActionTarget === "rules-activate", onConfirm: () => props.handleBulkUpdate({
|
|
55
55
|
ids: selectedRows.map((row) => row.original.id),
|
|
@@ -84,7 +84,7 @@ export function AvailabilityRulesTab(props) {
|
|
|
84
84
|
}
|
|
85
85
|
export function AvailabilityStartTimesTab(props) {
|
|
86
86
|
const selection = (count) => formatLocalizedSelectionLabel(count, props.messages.nouns.startTimeSingular, props.messages.nouns.startTimePlural);
|
|
87
|
-
return (_jsxs(TabsContent, { value: "start-times", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.startTimes.title, description: props.messages.tabs.startTimes.description, actionLabel: props.messages.tabs.startTimes.actionLabel, onAction: props.onCreate }), _jsx(DataTable, { columns: availabilityStartTimeColumns(props.products, props.onOpenRoute, props.messages), data: props.filteredStartTimes, emptyMessage: props.messages.tabs.startTimes.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.startTimeSelection, onRowSelectionChange: props.setStartTimeSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.startTimes.bulkActivateButton, confirmLabel: props.messages.tabs.startTimes.bulkActivateConfirm, title: formatTemplate(props.messages.tabs.startTimes.bulkActivateTitle, {
|
|
87
|
+
return (_jsxs(TabsContent, { value: "start-times", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.startTimes.title, description: props.messages.tabs.startTimes.description, actionLabel: props.messages.tabs.startTimes.actionLabel, onAction: props.onCreate }), props.toolbar, _jsx(DataTable, { columns: availabilityStartTimeColumns(props.products, props.onOpenRoute, props.messages), data: props.filteredStartTimes, emptyMessage: props.messages.tabs.startTimes.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.startTimeSelection, onRowSelectionChange: props.setStartTimeSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.startTimes.bulkActivateButton, confirmLabel: props.messages.tabs.startTimes.bulkActivateConfirm, title: formatTemplate(props.messages.tabs.startTimes.bulkActivateTitle, {
|
|
88
88
|
selection: selection(selectedRows.length),
|
|
89
89
|
}), description: props.messages.tabs.startTimes.bulkActivateDescription, disabled: props.bulkActionTarget === "start-times-activate", onConfirm: () => props.handleBulkUpdate({
|
|
90
90
|
ids: selectedRows.map((row) => row.original.id),
|
|
@@ -119,7 +119,7 @@ export function AvailabilityStartTimesTab(props) {
|
|
|
119
119
|
}
|
|
120
120
|
export function AvailabilityCloseoutsTab(props) {
|
|
121
121
|
const selection = (count) => formatLocalizedSelectionLabel(count, props.messages.nouns.closeoutSingular, props.messages.nouns.closeoutPlural);
|
|
122
|
-
return (_jsxs(TabsContent, { value: "closeouts", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.closeouts.title, description: props.messages.tabs.closeouts.description, actionLabel: props.messages.tabs.closeouts.actionLabel, onAction: props.onCreate }), _jsx(DataTable, { columns: availabilityCloseoutColumns(props.products, props.messages), data: props.filteredCloseouts, emptyMessage: props.messages.tabs.closeouts.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.closeoutSelection, onRowSelectionChange: props.setCloseoutSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsx(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: _jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.closeouts.bulkDeleteButton, confirmLabel: props.messages.tabs.closeouts.bulkDeleteConfirm, title: formatTemplate(props.messages.tabs.closeouts.bulkDeleteTitle, {
|
|
122
|
+
return (_jsxs(TabsContent, { value: "closeouts", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.closeouts.title, description: props.messages.tabs.closeouts.description, actionLabel: props.messages.tabs.closeouts.actionLabel, onAction: props.onCreate }), props.toolbar, _jsx(DataTable, { columns: availabilityCloseoutColumns(props.products, props.messages), data: props.filteredCloseouts, emptyMessage: props.messages.tabs.closeouts.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.closeoutSelection, onRowSelectionChange: props.setCloseoutSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsx(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: _jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.closeouts.bulkDeleteButton, confirmLabel: props.messages.tabs.closeouts.bulkDeleteConfirm, title: formatTemplate(props.messages.tabs.closeouts.bulkDeleteTitle, {
|
|
123
123
|
selection: selection(selectedRows.length),
|
|
124
124
|
}), description: props.messages.tabs.closeouts.bulkDeleteDescription, disabled: props.bulkActionTarget === "closeouts-delete", variant: "destructive", confirmVariant: "destructive", onConfirm: () => props.handleBulkDelete({
|
|
125
125
|
ids: selectedRows.map((row) => row.original.id),
|
|
@@ -132,7 +132,7 @@ export function AvailabilityCloseoutsTab(props) {
|
|
|
132
132
|
}
|
|
133
133
|
export function AvailabilityPickupPointsTab(props) {
|
|
134
134
|
const selection = (count) => formatLocalizedSelectionLabel(count, props.messages.nouns.pickupPointSingular, props.messages.nouns.pickupPointPlural);
|
|
135
|
-
return (_jsxs(TabsContent, { value: "pickup-points", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.pickupPoints.title, description: props.messages.tabs.pickupPoints.description, actionLabel: props.messages.tabs.pickupPoints.actionLabel, onAction: props.onCreate }), _jsx(DataTable, { columns: availabilityPickupPointColumns(props.products, props.messages), data: props.filteredPickupPoints, emptyMessage: props.messages.tabs.pickupPoints.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.pickupPointSelection, onRowSelectionChange: props.setPickupPointSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.pickupPoints.bulkActivateButton, confirmLabel: props.messages.tabs.pickupPoints.bulkActivateConfirm, title: formatTemplate(props.messages.tabs.pickupPoints.bulkActivateTitle, {
|
|
135
|
+
return (_jsxs(TabsContent, { value: "pickup-points", className: "space-y-4", children: [_jsx(AvailabilitySectionHeader, { title: props.messages.tabs.pickupPoints.title, description: props.messages.tabs.pickupPoints.description, actionLabel: props.messages.tabs.pickupPoints.actionLabel, onAction: props.onCreate }), props.toolbar, _jsx(DataTable, { columns: availabilityPickupPointColumns(props.products, props.messages), data: props.filteredPickupPoints, emptyMessage: props.messages.tabs.pickupPoints.emptyMessage, enableRowSelection: true, getRowId: (row) => row.id, rowSelection: props.pickupPointSelection, onRowSelectionChange: props.setPickupPointSelection, renderSelectionActions: ({ selectedRows, clearSelection }) => (_jsxs(SelectionActionBar, { selectedCount: selectedRows.length, onClear: clearSelection, children: [_jsx(ConfirmActionButton, { buttonLabel: props.messages.tabs.pickupPoints.bulkActivateButton, confirmLabel: props.messages.tabs.pickupPoints.bulkActivateConfirm, title: formatTemplate(props.messages.tabs.pickupPoints.bulkActivateTitle, {
|
|
136
136
|
selection: selection(selectedRows.length),
|
|
137
137
|
}), description: props.messages.tabs.pickupPoints.bulkActivateDescription, disabled: props.bulkActionTarget === "pickup-points-activate", onConfirm: () => props.handleBulkUpdate({
|
|
138
138
|
ids: selectedRows.map((row) => row.original.id),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/availability-ui",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"react-dom": "^19.0.0",
|
|
37
37
|
"react-hook-form": "^7.72.1",
|
|
38
38
|
"zod": "^4.3.6",
|
|
39
|
-
"@voyantjs/availability-react": "0.28.
|
|
40
|
-
"@voyantjs/ui": "0.28.
|
|
39
|
+
"@voyantjs/availability-react": "0.28.3",
|
|
40
|
+
"@voyantjs/ui": "0.28.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@tanstack/react-table": "^8.21.3",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"typescript": "^6.0.2",
|
|
51
51
|
"vitest": "^4.1.2",
|
|
52
52
|
"zod": "^4.3.6",
|
|
53
|
-
"@voyantjs/availability-react": "0.28.
|
|
54
|
-
"@voyantjs/ui": "0.28.
|
|
53
|
+
"@voyantjs/availability-react": "0.28.3",
|
|
54
|
+
"@voyantjs/ui": "0.28.3",
|
|
55
55
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
56
56
|
},
|
|
57
57
|
"files": [
|