@voyantjs/bookings-ui 0.81.16 → 0.81.17
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.
|
@@ -186,5 +186,5 @@ export function PaymentScheduleSection({ value, onChange, totalAmountCents, depa
|
|
|
186
186
|
return (_jsxs("div", { className: "flex flex-col gap-2 rounded-md border border-dashed p-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { id: checkboxId, checked: installment.alreadyPaid, onCheckedChange: (next) => updateInstallment(idx, { alreadyPaid: next === true }) }), _jsx(Label, { htmlFor: checkboxId, className: "cursor-pointer text-xs", children: merged.alreadyPaid })] }), installment.alreadyPaid ? (_jsxs("div", { className: "grid gap-2 sm:grid-cols-3", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.paymentDate }), _jsx(DatePicker, { value: installment.paymentDate ?? "", onChange: (nextValue) => updateInstallment(idx, { paymentDate: nextValue }) })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.paymentMethod }), _jsxs(Select, { value: installment.paymentMethod, onValueChange: (nextValue) => updateInstallment(idx, { paymentMethod: nextValue ?? "bank_transfer" }), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: ["bank_transfer", "credit_card", "cash", "voucher", "other"].map((method) => (_jsx(SelectItem, { value: method, children: paymentMethodLabels[method === "credit_card" ? "card" : method] }, method))) })] })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.paymentReference }), _jsx(Input, { value: installment.paymentReference, onChange: (event) => updateInstallment(idx, { paymentReference: event.target.value }) })] })] })) : null] }));
|
|
187
187
|
};
|
|
188
188
|
const fullInstallment = value.installments[0] ?? createInstallment({ dueDate: todayIso() });
|
|
189
|
-
return (_jsxs("div", { className: "flex flex-col gap-3 rounded-md border p-3", children: [_jsx(Label, { children: merged.heading }), _jsxs("div", { className: "grid gap-2 rounded-md bg-muted/40 p-2 text-xs sm:grid-cols-3", children: [_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground", children: merged.totalDue }), _jsx("span", { className: "font-medium tabular-nums", children: formatAmount(total) })] }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground", children: merged.scheduledTotal }), _jsx("span", { className: "font-medium tabular-nums", children: formatAmount(scheduledTotal) })] }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground", children: merged.remaining }), _jsx("span", { className: "font-medium tabular-nums", children: formatAmount(remaining) })] })] }), _jsx("div", { className: "flex flex-wrap items-center gap-2", children: modes.map((mode) => (_jsx(Button, { type: "button", size: "sm", variant: value.mode === mode.id ? "default" : "ghost", onClick: () => switchMode(mode.id), children: mode.label }, mode.id))) }), value.mode === "full" && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.dueDate }), _jsx(DatePicker, { value: fullInstallment.dueDate ?? "", onChange: (nextValue) => updateInstallment(0, { dueDate: nextValue }) })] }), renderPaidFields(0, fullInstallment)] })), value.mode === "split" && (_jsxs("div", { className: "flex flex-col gap-3", children: [value.installments.map((installment, idx) => (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-xs font-medium", children: merged.firstInstallment.replace(/\b1\b|first|primul|1st/i, String(idx + 1)) }), value.installments.length > 2 ? (_jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": merged.removeInstallment
|
|
189
|
+
return (_jsxs("div", { className: "flex flex-col gap-3 rounded-md border p-3", children: [_jsx(Label, { children: merged.heading }), _jsxs("div", { className: "grid gap-2 rounded-md bg-muted/40 p-2 text-xs sm:grid-cols-3", children: [_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground", children: merged.totalDue }), _jsx("span", { className: "font-medium tabular-nums", children: formatAmount(total) })] }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground", children: merged.scheduledTotal }), _jsx("span", { className: "font-medium tabular-nums", children: formatAmount(scheduledTotal) })] }), _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground", children: merged.remaining }), _jsx("span", { className: "font-medium tabular-nums", children: formatAmount(remaining) })] })] }), _jsx("div", { className: "flex flex-wrap items-center gap-2", children: modes.map((mode) => (_jsx(Button, { type: "button", size: "sm", variant: value.mode === mode.id ? "default" : "ghost", onClick: () => switchMode(mode.id), children: mode.label }, mode.id))) }), value.mode === "full" && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { className: "text-xs", children: merged.dueDate }), _jsx(DatePicker, { value: fullInstallment.dueDate ?? "", onChange: (nextValue) => updateInstallment(0, { dueDate: nextValue }) })] }), renderPaidFields(0, fullInstallment)] })), value.mode === "split" && (_jsxs("div", { className: "flex flex-col gap-3", children: [value.installments.map((installment, idx) => (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-xs font-medium", children: merged.firstInstallment.replace(/\b1\b|first|primul|1st/i, String(idx + 1)) }), value.installments.length > 2 ? (_jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": merged.removeInstallment, onClick: () => removeInstallment(idx), children: _jsx(X, { className: "h-3.5 w-3.5" }) })) : null] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx(CurrencyInput, { placeholder: merged.amount, value: installment.amountCents, onChange: (next) => updateInstallment(idx, { amountCents: next }), currency: currency }), _jsx(DatePicker, { value: installment.dueDate ?? "", onChange: (nextValue) => updateInstallment(idx, { dueDate: nextValue }) })] }), renderPaidFields(idx, installment)] }, installment.id))), _jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: addInstallment, className: "self-start", children: [_jsx(Plus, { className: "mr-1 h-3.5 w-3.5" }), merged.addInstallment] })] }))] }));
|
|
190
190
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/bookings-ui",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.17",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,25 +52,25 @@
|
|
|
52
52
|
"react-dom": "^19.0.0",
|
|
53
53
|
"react-hook-form": "^7.60.0",
|
|
54
54
|
"zod": "^4.3.6",
|
|
55
|
-
"@voyantjs/availability-react": "0.81.
|
|
56
|
-
"@voyantjs/bookings": "0.81.
|
|
57
|
-
"@voyantjs/bookings-react": "0.81.
|
|
58
|
-
"@voyantjs/catalog": "0.81.
|
|
59
|
-
"@voyantjs/catalog-react": "0.81.
|
|
60
|
-
"@voyantjs/crm-react": "0.81.
|
|
61
|
-
"@voyantjs/crm-ui": "0.81.
|
|
62
|
-
"@voyantjs/extras-react": "0.81.
|
|
63
|
-
"@voyantjs/finance-react": "0.81.
|
|
64
|
-
"@voyantjs/identity-react": "0.81.
|
|
65
|
-
"@voyantjs/legal-react": "0.81.
|
|
66
|
-
"@voyantjs/pricing-react": "0.81.
|
|
67
|
-
"@voyantjs/products-react": "0.81.
|
|
68
|
-
"@voyantjs/suppliers-react": "0.81.
|
|
69
|
-
"@voyantjs/ui": "0.81.
|
|
55
|
+
"@voyantjs/availability-react": "0.81.17",
|
|
56
|
+
"@voyantjs/bookings": "0.81.17",
|
|
57
|
+
"@voyantjs/bookings-react": "0.81.17",
|
|
58
|
+
"@voyantjs/catalog": "0.81.17",
|
|
59
|
+
"@voyantjs/catalog-react": "0.81.17",
|
|
60
|
+
"@voyantjs/crm-react": "0.81.17",
|
|
61
|
+
"@voyantjs/crm-ui": "0.81.17",
|
|
62
|
+
"@voyantjs/extras-react": "0.81.17",
|
|
63
|
+
"@voyantjs/finance-react": "0.81.17",
|
|
64
|
+
"@voyantjs/identity-react": "0.81.17",
|
|
65
|
+
"@voyantjs/legal-react": "0.81.17",
|
|
66
|
+
"@voyantjs/pricing-react": "0.81.17",
|
|
67
|
+
"@voyantjs/products-react": "0.81.17",
|
|
68
|
+
"@voyantjs/suppliers-react": "0.81.17",
|
|
69
|
+
"@voyantjs/ui": "0.81.17"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"sonner": "^2.0.7",
|
|
73
|
-
"@voyantjs/i18n": "0.81.
|
|
73
|
+
"@voyantjs/i18n": "0.81.17"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@tanstack/react-query": "^5.100.11",
|
|
@@ -85,21 +85,21 @@
|
|
|
85
85
|
"typescript": "^6.0.2",
|
|
86
86
|
"vitest": "^4.1.2",
|
|
87
87
|
"zod": "^4.3.6",
|
|
88
|
-
"@voyantjs/availability-react": "0.81.
|
|
89
|
-
"@voyantjs/bookings": "0.81.
|
|
90
|
-
"@voyantjs/bookings-react": "0.81.
|
|
91
|
-
"@voyantjs/catalog": "0.81.
|
|
92
|
-
"@voyantjs/catalog-react": "0.81.
|
|
93
|
-
"@voyantjs/crm-react": "0.81.
|
|
94
|
-
"@voyantjs/crm-ui": "0.81.
|
|
95
|
-
"@voyantjs/extras-react": "0.81.
|
|
96
|
-
"@voyantjs/finance-react": "0.81.
|
|
97
|
-
"@voyantjs/identity-react": "0.81.
|
|
98
|
-
"@voyantjs/legal-react": "0.81.
|
|
99
|
-
"@voyantjs/pricing-react": "0.81.
|
|
100
|
-
"@voyantjs/products-react": "0.81.
|
|
101
|
-
"@voyantjs/suppliers-react": "0.81.
|
|
102
|
-
"@voyantjs/ui": "0.81.
|
|
88
|
+
"@voyantjs/availability-react": "0.81.17",
|
|
89
|
+
"@voyantjs/bookings": "0.81.17",
|
|
90
|
+
"@voyantjs/bookings-react": "0.81.17",
|
|
91
|
+
"@voyantjs/catalog": "0.81.17",
|
|
92
|
+
"@voyantjs/catalog-react": "0.81.17",
|
|
93
|
+
"@voyantjs/crm-react": "0.81.17",
|
|
94
|
+
"@voyantjs/crm-ui": "0.81.17",
|
|
95
|
+
"@voyantjs/extras-react": "0.81.17",
|
|
96
|
+
"@voyantjs/finance-react": "0.81.17",
|
|
97
|
+
"@voyantjs/identity-react": "0.81.17",
|
|
98
|
+
"@voyantjs/legal-react": "0.81.17",
|
|
99
|
+
"@voyantjs/pricing-react": "0.81.17",
|
|
100
|
+
"@voyantjs/products-react": "0.81.17",
|
|
101
|
+
"@voyantjs/suppliers-react": "0.81.17",
|
|
102
|
+
"@voyantjs/ui": "0.81.17",
|
|
103
103
|
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
104
104
|
},
|
|
105
105
|
"files": [
|