@voyantjs/suppliers-ui 0.30.6 → 0.31.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.
@@ -1,48 +1,82 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { statusVariant } from "@voyantjs/suppliers-react";
3
- import { Badge, Button, Input } from "@voyantjs/ui/components";
4
- import { DataTable } from "@voyantjs/ui/components/data-table";
5
- import { DataTableColumnHeader } from "@voyantjs/ui/components/data-table-column-header";
6
- import { Loader2, Plus, Search } from "lucide-react";
3
+ import { SUPPLIER_STATUSES, SUPPLIER_TYPES, statusVariant, useSuppliers, } from "@voyantjs/suppliers-react";
4
+ import { Badge, Button, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@voyantjs/ui/components";
5
+ import { ArrowDown, ArrowUp, Plus, Search, SlidersHorizontal } from "lucide-react";
6
+ import * as React from "react";
7
7
  import { useSuppliersUiMessagesOrDefault } from "../i18n/index.js";
8
- function useSupplierColumns() {
8
+ import { formatMessage } from "./message-format.js";
9
+ import { SupplierDialog } from "./supplier-dialog.js";
10
+ const ALL = "__all__";
11
+ export function SuppliersPage({ pageSize = 25, onSupplierOpen, onSupplierCreated, initialSearch = "", } = {}) {
9
12
  const messages = useSuppliersUiMessagesOrDefault();
10
- return [
11
- {
12
- accessorKey: "name",
13
- header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.suppliersPage.columns.name })),
14
- },
15
- {
16
- accessorKey: "type",
17
- header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.suppliersPage.columns.type })),
18
- cell: ({ row }) => (_jsx(Badge, { variant: "outline", children: messages.common.supplierTypeLabels[row.original.type] })),
19
- },
20
- {
21
- accessorKey: "status",
22
- header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.suppliersPage.columns.status })),
23
- cell: ({ row }) => (_jsx(Badge, { variant: statusVariant[row.original.status] ?? "secondary", children: messages.common.supplierStatusLabels[row.original.status] })),
24
- },
25
- {
26
- accessorKey: "city",
27
- header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.suppliersPage.columns.city })),
28
- cell: ({ row }) => row.original.city ?? messages.common.none,
29
- },
30
- {
31
- accessorKey: "country",
32
- header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.suppliersPage.columns.country })),
33
- cell: ({ row }) => row.original.country ?? messages.common.none,
34
- },
35
- {
36
- accessorKey: "defaultCurrency",
37
- header: ({ column }) => (_jsx(DataTableColumnHeader, { column: column, title: messages.suppliersPage.columns.currency })),
38
- cell: ({ row }) => row.original.defaultCurrency ?? messages.common.none,
39
- },
40
- ];
13
+ const [search, setSearch] = React.useState(initialSearch);
14
+ const [type, setType] = React.useState(ALL);
15
+ const [status, setStatus] = React.useState(ALL);
16
+ const [country, setCountry] = React.useState("");
17
+ const [currency, setCurrency] = React.useState("");
18
+ const [sortBy, setSortBy] = React.useState("name");
19
+ const [sortDir, setSortDir] = React.useState("asc");
20
+ const [pageIndex, setPageIndex] = React.useState(0);
21
+ const [dialogOpen, setDialogOpen] = React.useState(false);
22
+ const query = useSuppliers({
23
+ limit: pageSize,
24
+ offset: pageIndex * pageSize,
25
+ search: search || undefined,
26
+ type: type === ALL ? undefined : type,
27
+ status: status === ALL ? undefined : status,
28
+ country: country || undefined,
29
+ defaultCurrency: currency || undefined,
30
+ sortBy,
31
+ sortDir,
32
+ });
33
+ const rows = query.data?.data ?? [];
34
+ const total = query.data?.total ?? 0;
35
+ const pageCount = Math.max(1, Math.ceil(total / pageSize));
36
+ function toggleSort(field) {
37
+ if (sortBy === field) {
38
+ setSortDir((current) => (current === "asc" ? "desc" : "asc"));
39
+ setPageIndex(0);
40
+ return;
41
+ }
42
+ setSortBy(field);
43
+ setSortDir("asc");
44
+ setPageIndex(0);
45
+ }
46
+ function clearFilters() {
47
+ setSearch("");
48
+ setType(ALL);
49
+ setStatus(ALL);
50
+ setCountry("");
51
+ setCurrency("");
52
+ }
53
+ return (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex flex-col gap-4 md:flex-row md:items-start md:justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-semibold tracking-tight", children: messages.suppliersPage.title }), _jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: messages.suppliersPage.description })] }), _jsxs(Button, { onClick: () => setDialogOpen(true), children: [_jsx(Plus, {}), messages.suppliersPage.create] })] }), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "relative", children: [_jsx(Search, { className: "pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { value: search, onChange: (event) => {
54
+ setSearch(event.target.value);
55
+ setPageIndex(0);
56
+ }, placeholder: messages.suppliersPage.searchPlaceholder, className: "pl-9" })] }), _jsxs("div", { className: "grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_10rem_10rem_auto]", children: [_jsxs(Select, { value: type, onValueChange: (value) => {
57
+ setType(value ?? ALL);
58
+ setPageIndex(0);
59
+ }, children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ALL, children: messages.suppliersPage.allTypes }), SUPPLIER_TYPES.map((item) => (_jsx(SelectItem, { value: item.value, children: messages.common.supplierTypeLabels[item.value] }, item.value)))] })] }), _jsxs(Select, { value: status, onValueChange: (value) => {
60
+ setStatus(value ?? ALL);
61
+ setPageIndex(0);
62
+ }, children: [_jsx(SelectTrigger, { className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ALL, children: messages.suppliersPage.allStatuses }), SUPPLIER_STATUSES.map((item) => (_jsx(SelectItem, { value: item.value, children: messages.common.supplierStatusLabels[item.value] }, item.value)))] })] }), _jsx(Input, { value: country, onChange: (event) => {
63
+ setCountry(event.target.value.toUpperCase());
64
+ setPageIndex(0);
65
+ }, placeholder: messages.suppliersPage.countryPlaceholder, maxLength: 2 }), _jsx(Input, { value: currency, onChange: (event) => {
66
+ setCurrency(event.target.value.toUpperCase());
67
+ setPageIndex(0);
68
+ }, placeholder: messages.suppliersPage.currencyPlaceholder, maxLength: 3 }), _jsxs(Button, { type: "button", variant: "outline", onClick: clearFilters, children: [_jsx(SlidersHorizontal, {}), messages.suppliersPage.clearFilters] })] })] }), _jsx("div", { className: "overflow-hidden rounded-md border", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "bg-muted/40 text-left text-muted-foreground", children: _jsxs("tr", { children: [_jsx(SortableHeader, { label: messages.suppliersPage.columns.name, field: "name", sortBy: sortBy, sortDir: sortDir, onSort: toggleSort }), _jsx(SortableHeader, { label: messages.suppliersPage.columns.type, field: "type", sortBy: sortBy, sortDir: sortDir, onSort: toggleSort }), _jsx(SortableHeader, { label: messages.suppliersPage.columns.status, field: "status", sortBy: sortBy, sortDir: sortDir, onSort: toggleSort }), _jsx("th", { className: "px-4 py-3 font-medium", children: messages.suppliersPage.columns.country }), _jsx(SortableHeader, { label: messages.suppliersPage.columns.currency, field: "defaultCurrency", sortBy: sortBy, sortDir: sortDir, onSort: toggleSort })] }) }), _jsx("tbody", { children: query.isPending ? (_jsx(LoadingRows, { columns: 5, rows: 8 })) : query.isError ? (_jsx(MessageRow, { columns: 5, children: messages.suppliersPage.loadFailed })) : rows.length === 0 ? (_jsx(MessageRow, { columns: 5, children: messages.suppliersPage.empty })) : (rows.map((supplier) => (_jsxs("tr", { className: "border-t transition-colors hover:bg-muted/40", onClick: () => onSupplierOpen?.(supplier), children: [_jsxs("td", { className: "px-4 py-3", children: [_jsx("div", { className: "font-medium", children: supplier.name }), supplier.city && (_jsx("div", { className: "text-xs text-muted-foreground", children: supplier.city }))] }), _jsx("td", { className: "px-4 py-3", children: messages.common.supplierTypeLabels[supplier.type] }), _jsx("td", { className: "px-4 py-3", children: _jsx(Badge, { variant: statusVariant[supplier.status], children: messages.common.supplierStatusLabels[supplier.status] }) }), _jsx("td", { className: "px-4 py-3", children: supplier.country ?? messages.common.none }), _jsx("td", { className: "px-4 py-3", children: supplier.defaultCurrency ?? messages.common.none })] }, supplier.id)))) })] }) }), _jsxs("div", { className: "flex flex-col gap-3 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between", children: [_jsx("div", { children: formatMessage(messages.suppliersPage.summary, { shown: rows.length, total }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: pageIndex === 0 || query.isPending, onClick: () => setPageIndex((current) => Math.max(0, current - 1)), children: messages.suppliersPage.previous }), _jsx("span", { children: formatMessage(messages.suppliersPage.page, {
69
+ page: pageIndex + 1,
70
+ pageCount,
71
+ }) }), _jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: pageIndex + 1 >= pageCount || query.isPending, onClick: () => setPageIndex((current) => current + 1), children: messages.suppliersPage.next })] })] }), _jsx(SupplierDialog, { open: dialogOpen, onOpenChange: setDialogOpen, onSuccess: onSupplierCreated })] }));
41
72
  }
42
- export function SuppliersPage({ search, onSearchChange, onCreate, onRowClick, rows, total, isPending, }) {
43
- const messages = useSuppliersUiMessagesOrDefault();
44
- const columns = useSupplierColumns();
45
- return (_jsxs("div", { className: "flex flex-col gap-6 p-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold tracking-tight", children: messages.suppliersPage.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.suppliersPage.description })] }), _jsxs(Button, { onClick: onCreate, children: [_jsx(Plus, { className: "mr-2 h-4 w-4" }), messages.suppliersPage.create] })] }), _jsxs("div", { className: "relative 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.suppliersPage.searchPlaceholder, value: search, onChange: (event) => onSearchChange(event.target.value), className: "pl-9" })] }), isPending ? (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx(Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }) })) : (_jsx(DataTable, { columns: columns, data: rows, onRowClick: (row) => onRowClick(row.original) })), _jsx("p", { className: "text-sm text-muted-foreground", children: messages.suppliersPage.summary
46
- .replace("{shown}", String(rows.length))
47
- .replace("{total}", String(total)) })] }));
73
+ function SortableHeader({ label, field, sortBy, sortDir, onSort, }) {
74
+ return (_jsx("th", { className: "px-4 py-3 font-medium", children: _jsxs(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => onSort(field), children: [label, sortBy === field &&
75
+ (sortDir === "asc" ? _jsx(ArrowUp, { "aria-hidden": "true" }) : _jsx(ArrowDown, { "aria-hidden": "true" }))] }) }));
76
+ }
77
+ function LoadingRows({ rows, columns }) {
78
+ return Array.from({ length: rows }, (_, rowIndex) => `row-${rowIndex}`).map((rowKey) => (_jsx("tr", { className: "border-t", children: Array.from({ length: columns }, (__, columnIndex) => `${rowKey}-cell-${columnIndex}`).map((columnKey) => (_jsx("td", { className: "px-4 py-3", children: _jsx("div", { className: "h-4 w-full max-w-32 animate-pulse rounded bg-muted" }) }, columnKey))) }, rowKey)));
79
+ }
80
+ function MessageRow({ columns, children }) {
81
+ return (_jsx("tr", { children: _jsx("td", { colSpan: columns, className: "px-4 py-10 text-center text-muted-foreground", children: children }) }));
48
82
  }
package/dist/i18n/en.d.ts CHANGED
@@ -3,7 +3,12 @@ export declare const suppliersUiEn: {
3
3
  edit: string;
4
4
  delete: string;
5
5
  add: string;
6
+ save: string;
7
+ create: string;
8
+ cancel: string;
9
+ back: string;
6
10
  open: string;
11
+ active: string;
7
12
  inactive: string;
8
13
  none: string;
9
14
  unknown: string;
@@ -44,6 +49,17 @@ export declare const suppliersUiEn: {
44
49
  create: string;
45
50
  searchPlaceholder: string;
46
51
  summary: string;
52
+ previous: string;
53
+ next: string;
54
+ page: string;
55
+ filters: string;
56
+ clearFilters: string;
57
+ allTypes: string;
58
+ allStatuses: string;
59
+ countryPlaceholder: string;
60
+ currencyPlaceholder: string;
61
+ empty: string;
62
+ loadFailed: string;
47
63
  columns: {
48
64
  name: string;
49
65
  type: string;
@@ -53,6 +69,115 @@ export declare const suppliersUiEn: {
53
69
  currency: string;
54
70
  };
55
71
  };
72
+ supplierDetailPage: {
73
+ backToSuppliers: string;
74
+ notFound: string;
75
+ loadFailed: string;
76
+ details: string;
77
+ contact: string;
78
+ noContact: string;
79
+ services: string;
80
+ addService: string;
81
+ noServices: string;
82
+ notes: string;
83
+ notePlaceholder: string;
84
+ addNote: string;
85
+ noNotes: string;
86
+ deleteSupplierConfirm: string;
87
+ deleteServiceConfirm: string;
88
+ deleteRateConfirm: string;
89
+ labels: {
90
+ type: string;
91
+ status: string;
92
+ city: string;
93
+ country: string;
94
+ currency: string;
95
+ reservationTimeout: string;
96
+ email: string;
97
+ phone: string;
98
+ website: string;
99
+ address: string;
100
+ contactName: string;
101
+ contactEmail: string;
102
+ contactPhone: string;
103
+ created: string;
104
+ updated: string;
105
+ };
106
+ };
107
+ dialogs: {
108
+ supplier: {
109
+ newTitle: string;
110
+ editTitle: string;
111
+ nameLabel: string;
112
+ namePlaceholder: string;
113
+ typeLabel: string;
114
+ statusLabel: string;
115
+ descriptionLabel: string;
116
+ descriptionPlaceholder: string;
117
+ emailLabel: string;
118
+ emailPlaceholder: string;
119
+ phoneLabel: string;
120
+ phonePlaceholder: string;
121
+ websiteLabel: string;
122
+ websitePlaceholder: string;
123
+ addressLabel: string;
124
+ addressPlaceholder: string;
125
+ cityLabel: string;
126
+ cityPlaceholder: string;
127
+ countryLabel: string;
128
+ countryPlaceholder: string;
129
+ defaultCurrencyLabel: string;
130
+ defaultCurrencyPlaceholder: string;
131
+ reservationTimeoutLabel: string;
132
+ reservationTimeoutPlaceholder: string;
133
+ contactNameLabel: string;
134
+ contactNamePlaceholder: string;
135
+ contactEmailLabel: string;
136
+ contactEmailPlaceholder: string;
137
+ contactPhoneLabel: string;
138
+ contactPhonePlaceholder: string;
139
+ validationNameRequired: string;
140
+ validationIsoCurrency: string;
141
+ validationReservationTimeout: string;
142
+ };
143
+ service: {
144
+ newTitle: string;
145
+ editTitle: string;
146
+ serviceTypeLabel: string;
147
+ nameLabel: string;
148
+ namePlaceholder: string;
149
+ descriptionLabel: string;
150
+ descriptionPlaceholder: string;
151
+ durationLabel: string;
152
+ durationPlaceholder: string;
153
+ capacityLabel: string;
154
+ capacityPlaceholder: string;
155
+ activeLabel: string;
156
+ validationNameRequired: string;
157
+ };
158
+ rate: {
159
+ newTitle: string;
160
+ editTitle: string;
161
+ seasonNameLabel: string;
162
+ seasonNamePlaceholder: string;
163
+ currencyLabel: string;
164
+ currencyPlaceholder: string;
165
+ amountLabel: string;
166
+ amountPlaceholder: string;
167
+ unitLabel: string;
168
+ validFromLabel: string;
169
+ validToLabel: string;
170
+ minPaxLabel: string;
171
+ minPaxPlaceholder: string;
172
+ maxPaxLabel: string;
173
+ maxPaxPlaceholder: string;
174
+ notesLabel: string;
175
+ notesPlaceholder: string;
176
+ validationNameRequired: string;
177
+ validationIsoCurrency: string;
178
+ validationNonNegative: string;
179
+ };
180
+ };
56
181
  supplierServiceRow: {
57
182
  rates: string;
58
183
  addRate: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoEK,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiMK,CAAA"}
package/dist/i18n/en.js CHANGED
@@ -3,7 +3,12 @@ export const suppliersUiEn = {
3
3
  edit: "Edit",
4
4
  delete: "Delete",
5
5
  add: "Add",
6
+ save: "Save",
7
+ create: "Create",
8
+ cancel: "Cancel",
9
+ back: "Back",
6
10
  open: "Open",
11
+ active: "Active",
7
12
  inactive: "Inactive",
8
13
  none: "-",
9
14
  unknown: "?",
@@ -44,6 +49,17 @@ export const suppliersUiEn = {
44
49
  create: "New Supplier",
45
50
  searchPlaceholder: "Search suppliers...",
46
51
  summary: "Showing {shown} of {total} suppliers",
52
+ previous: "Previous",
53
+ next: "Next",
54
+ page: "Page {page} of {pageCount}",
55
+ filters: "Filters",
56
+ clearFilters: "Clear filters",
57
+ allTypes: "All types",
58
+ allStatuses: "All statuses",
59
+ countryPlaceholder: "Country code",
60
+ currencyPlaceholder: "Currency",
61
+ empty: "No suppliers match the current filters.",
62
+ loadFailed: "Suppliers could not be loaded.",
47
63
  columns: {
48
64
  name: "Name",
49
65
  type: "Type",
@@ -53,6 +69,115 @@ export const suppliersUiEn = {
53
69
  currency: "Currency",
54
70
  },
55
71
  },
72
+ supplierDetailPage: {
73
+ backToSuppliers: "Back to suppliers",
74
+ notFound: "Supplier not found.",
75
+ loadFailed: "Supplier could not be loaded.",
76
+ details: "Supplier details",
77
+ contact: "Primary contact",
78
+ noContact: "No contact details yet.",
79
+ services: "Services",
80
+ addService: "Add service",
81
+ noServices: "No services yet.",
82
+ notes: "Notes",
83
+ notePlaceholder: "Add an internal note...",
84
+ addNote: "Add note",
85
+ noNotes: "No notes yet.",
86
+ deleteSupplierConfirm: "Delete this supplier?",
87
+ deleteServiceConfirm: "Delete this service?",
88
+ deleteRateConfirm: "Delete this rate?",
89
+ labels: {
90
+ type: "Type",
91
+ status: "Status",
92
+ city: "City",
93
+ country: "Country",
94
+ currency: "Currency",
95
+ reservationTimeout: "Reservation timeout",
96
+ email: "Email",
97
+ phone: "Phone",
98
+ website: "Website",
99
+ address: "Address",
100
+ contactName: "Name",
101
+ contactEmail: "Email",
102
+ contactPhone: "Phone",
103
+ created: "Created",
104
+ updated: "Updated",
105
+ },
106
+ },
107
+ dialogs: {
108
+ supplier: {
109
+ newTitle: "New supplier",
110
+ editTitle: "Edit supplier",
111
+ nameLabel: "Name",
112
+ namePlaceholder: "Supplier name",
113
+ typeLabel: "Type",
114
+ statusLabel: "Status",
115
+ descriptionLabel: "Description",
116
+ descriptionPlaceholder: "Notes about this supplier",
117
+ emailLabel: "Email",
118
+ emailPlaceholder: "reservations@example.com",
119
+ phoneLabel: "Phone",
120
+ phonePlaceholder: "+40...",
121
+ websiteLabel: "Website",
122
+ websitePlaceholder: "https://example.com",
123
+ addressLabel: "Address",
124
+ addressPlaceholder: "Street, number",
125
+ cityLabel: "City",
126
+ cityPlaceholder: "Bucharest",
127
+ countryLabel: "Country",
128
+ countryPlaceholder: "Search countries...",
129
+ defaultCurrencyLabel: "Default currency",
130
+ defaultCurrencyPlaceholder: "EUR",
131
+ reservationTimeoutLabel: "Reservation timeout minutes",
132
+ reservationTimeoutPlaceholder: "1440",
133
+ contactNameLabel: "Contact name",
134
+ contactNamePlaceholder: "Name",
135
+ contactEmailLabel: "Contact email",
136
+ contactEmailPlaceholder: "contact@example.com",
137
+ contactPhoneLabel: "Contact phone",
138
+ contactPhonePlaceholder: "+40...",
139
+ validationNameRequired: "Supplier name is required.",
140
+ validationIsoCurrency: "Use a 3-letter currency code.",
141
+ validationReservationTimeout: "Use zero or a positive number of minutes.",
142
+ },
143
+ service: {
144
+ newTitle: "New service",
145
+ editTitle: "Edit service",
146
+ serviceTypeLabel: "Service type",
147
+ nameLabel: "Name",
148
+ namePlaceholder: "Service name",
149
+ descriptionLabel: "Description",
150
+ descriptionPlaceholder: "What this service includes",
151
+ durationLabel: "Duration",
152
+ durationPlaceholder: "2 hours",
153
+ capacityLabel: "Capacity",
154
+ capacityPlaceholder: "8",
155
+ activeLabel: "Active",
156
+ validationNameRequired: "Service name is required.",
157
+ },
158
+ rate: {
159
+ newTitle: "New rate",
160
+ editTitle: "Edit rate",
161
+ seasonNameLabel: "Rate name",
162
+ seasonNamePlaceholder: "High season",
163
+ currencyLabel: "Currency",
164
+ currencyPlaceholder: "EUR",
165
+ amountLabel: "Amount",
166
+ amountPlaceholder: "120.00",
167
+ unitLabel: "Unit",
168
+ validFromLabel: "Valid from",
169
+ validToLabel: "Valid to",
170
+ minPaxLabel: "Min pax",
171
+ minPaxPlaceholder: "1",
172
+ maxPaxLabel: "Max pax",
173
+ maxPaxPlaceholder: "8",
174
+ notesLabel: "Notes",
175
+ notesPlaceholder: "Internal pricing notes",
176
+ validationNameRequired: "Rate name is required.",
177
+ validationIsoCurrency: "Use a 3-letter currency code.",
178
+ validationNonNegative: "Amount must be zero or greater.",
179
+ },
180
+ },
56
181
  supplierServiceRow: {
57
182
  rates: "Rates",
58
183
  addRate: "Add Rate",
@@ -8,7 +8,12 @@ export type SuppliersUiMessages = {
8
8
  edit: string;
9
9
  delete: string;
10
10
  add: string;
11
+ save: string;
12
+ create: string;
13
+ cancel: string;
14
+ back: string;
11
15
  open: string;
16
+ active: string;
12
17
  inactive: string;
13
18
  none: string;
14
19
  unknown: string;
@@ -24,6 +29,17 @@ export type SuppliersUiMessages = {
24
29
  create: string;
25
30
  searchPlaceholder: string;
26
31
  summary: string;
32
+ previous: string;
33
+ next: string;
34
+ page: string;
35
+ filters: string;
36
+ clearFilters: string;
37
+ allTypes: string;
38
+ allStatuses: string;
39
+ countryPlaceholder: string;
40
+ currencyPlaceholder: string;
41
+ empty: string;
42
+ loadFailed: string;
27
43
  columns: {
28
44
  name: string;
29
45
  type: string;
@@ -33,6 +49,46 @@ export type SuppliersUiMessages = {
33
49
  currency: string;
34
50
  };
35
51
  };
52
+ supplierDetailPage: {
53
+ backToSuppliers: string;
54
+ notFound: string;
55
+ loadFailed: string;
56
+ details: string;
57
+ contact: string;
58
+ noContact: string;
59
+ services: string;
60
+ addService: string;
61
+ noServices: string;
62
+ notes: string;
63
+ notePlaceholder: string;
64
+ addNote: string;
65
+ noNotes: string;
66
+ deleteSupplierConfirm: string;
67
+ deleteServiceConfirm: string;
68
+ deleteRateConfirm: string;
69
+ labels: {
70
+ type: string;
71
+ status: string;
72
+ city: string;
73
+ country: string;
74
+ currency: string;
75
+ reservationTimeout: string;
76
+ email: string;
77
+ phone: string;
78
+ website: string;
79
+ address: string;
80
+ contactName: string;
81
+ contactEmail: string;
82
+ contactPhone: string;
83
+ created: string;
84
+ updated: string;
85
+ };
86
+ };
87
+ dialogs: {
88
+ supplier: SupplierFormMessages;
89
+ service: ServiceFormMessages;
90
+ rate: RateFormMessages;
91
+ };
36
92
  supplierServiceRow: {
37
93
  rates: string;
38
94
  addRate: string;
@@ -47,4 +103,76 @@ export type SuppliersUiMessages = {
47
103
  validFallback: string;
48
104
  };
49
105
  };
106
+ export type SupplierFormMessages = {
107
+ newTitle: string;
108
+ editTitle: string;
109
+ nameLabel: string;
110
+ namePlaceholder: string;
111
+ typeLabel: string;
112
+ statusLabel: string;
113
+ descriptionLabel: string;
114
+ descriptionPlaceholder: string;
115
+ emailLabel: string;
116
+ emailPlaceholder: string;
117
+ phoneLabel: string;
118
+ phonePlaceholder: string;
119
+ websiteLabel: string;
120
+ websitePlaceholder: string;
121
+ addressLabel: string;
122
+ addressPlaceholder: string;
123
+ cityLabel: string;
124
+ cityPlaceholder: string;
125
+ countryLabel: string;
126
+ countryPlaceholder: string;
127
+ defaultCurrencyLabel: string;
128
+ defaultCurrencyPlaceholder: string;
129
+ reservationTimeoutLabel: string;
130
+ reservationTimeoutPlaceholder: string;
131
+ contactNameLabel: string;
132
+ contactNamePlaceholder: string;
133
+ contactEmailLabel: string;
134
+ contactEmailPlaceholder: string;
135
+ contactPhoneLabel: string;
136
+ contactPhonePlaceholder: string;
137
+ validationNameRequired: string;
138
+ validationIsoCurrency: string;
139
+ validationReservationTimeout: string;
140
+ };
141
+ export type ServiceFormMessages = {
142
+ newTitle: string;
143
+ editTitle: string;
144
+ serviceTypeLabel: string;
145
+ nameLabel: string;
146
+ namePlaceholder: string;
147
+ descriptionLabel: string;
148
+ descriptionPlaceholder: string;
149
+ durationLabel: string;
150
+ durationPlaceholder: string;
151
+ capacityLabel: string;
152
+ capacityPlaceholder: string;
153
+ activeLabel: string;
154
+ validationNameRequired: string;
155
+ };
156
+ export type RateFormMessages = {
157
+ newTitle: string;
158
+ editTitle: string;
159
+ seasonNameLabel: string;
160
+ seasonNamePlaceholder: string;
161
+ currencyLabel: string;
162
+ currencyPlaceholder: string;
163
+ amountLabel: string;
164
+ amountPlaceholder: string;
165
+ unitLabel: string;
166
+ validFromLabel: string;
167
+ validToLabel: string;
168
+ minPaxLabel: string;
169
+ minPaxPlaceholder: string;
170
+ maxPaxLabel: string;
171
+ maxPaxPlaceholder: string;
172
+ notesLabel: string;
173
+ notesPlaceholder: string;
174
+ validationNameRequired: string;
175
+ validationIsoCurrency: string;
176
+ validationNonNegative: string;
177
+ };
50
178
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/i18n/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAExF,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAA;AAC3C,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAC/C,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAA;AAChE,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;AAEnD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QAC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