@tesouro/embedded-components-react 0.5.228 → 0.5.231
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 +22 -21
- package/dist/index.css +10 -0
- package/dist/index.d.ts +55 -21
- package/dist/index.js +3 -3
- package/dist/lib/ExpenseManagementWidget.d.ts +22 -21
- package/dist/lib/ExpenseManagementWidget.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +34 -1
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/lib/UploadReceiptWidget.d.ts +2 -2
- package/dist/lib/UploadReceiptWidget.js +2 -2
- package/dist/lib/WidgetSuite.d.ts +17 -15
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index2.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index24.js → approval-policies/feature/dist/index3.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index25.js → approval-policies/feature/dist/index4.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index26.js → approval-policies/feature/dist/index5.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index27.js → approval-policies/feature/dist/index6.js} +53 -53
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/types.js → approval-policies/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js → approval-policies/ui/dist/index3.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/conditionLabel.js → approval-policies/ui/dist/index4.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/EmptyApprovalRules.js → approval-policies/ui/dist/index5.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleCard.js → approval-policies/ui/dist/index6.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleForm.js → approval-policies/ui/dist/index7.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js → approval-policies/ui/dist/index8.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index.js +18 -19
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/invalidation.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index20.js → lib/invalidateTransactionViews.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index10.js → lib/queryKeys.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index5.js → lib/useEntityUsersByIdsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index8.js → lib/useExpenseHistoryQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index7.js → lib/useExpenseLedgerAccountsQuery.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index17.js → lib/useExpenseReceiptsCountQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index16.js → lib/useExpenseTransactionIdsQuery.js} +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index15.js → lib/useExpenseTransactionsCountQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index19.js → lib/useGetApprovalRequestsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index9.js → lib/useGetTransactionQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index3.js → lib/useGetTransactionsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/lib/useHasDirectReportsQuery.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index4.js → lib/useOrganizationDepartmentsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index6.js → lib/useOrganizationLocationsQuery.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index11.js → lib/usePatchReceiptMutation.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index14.js → lib/useTrackReceiptMatching.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index21.js → lib/useTransactionReviewMutations.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index18.js → lib/useTransactionValidationsQuery.js} +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index13.js → lib/useUploadReceiptMutation.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +77 -160
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +356 -63
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +36 -71
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +130 -344
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index14.js +223 -36
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index15.js +192 -137
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index16.js +11 -227
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index17.js +81 -186
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index18.js +37 -11
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index19.js +309 -82
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index2.js +30 -87
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index20.js +1 -39
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +23 -257
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js +160 -59
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +62 -28
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +28 -18
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{data-access → receipt-match/data-access}/dist/index2.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index3.js +40 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +256 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index3.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +65 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/labels.js → receipt-match/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxItem.js → receipt-match/ui/dist/index3.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxStep.js → receipt-match/ui/dist/index4.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/TransactionsMatchStep.js → receipt-match/ui/dist/index5.js} +27 -27
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/MatchConfirmationStep.js → receipt-match/ui/dist/index6.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchSidebar.js → receipt-match/ui/dist/index7.js} +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js → receipt-match/ui/dist/index8.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/index.js +9 -28
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +7 -12
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +1 -7
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +61 -55
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +42 -44
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +137 -138
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +82 -80
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui → util}/dist/lib/isPdf.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/util/dist/lib/widgetName.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +32 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +34 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +120 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +44 -100
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +93 -337
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +356 -211
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +225 -157
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +152 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +18 -221
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +224 -56
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -231
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +53 -298
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +232 -43
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +295 -118
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +38 -145
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +126 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +145 -117
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +38 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +113 -107
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +94 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +104 -619
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -41
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +635 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +39 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +34 -117
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +75 -318
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +139 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +340 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +55 -468
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +443 -97
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +24 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +32 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +205 -84
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +161 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +12 -20
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +23 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +90 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +3 -20
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +20 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +40 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +14 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +15 -301
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +73 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +17 -45
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +12 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +26 -490
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +294 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +48 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +72 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +496 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +121 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +97 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +2 -236
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +1 -249
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +89 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +23 -54
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +223 -340
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +249 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +100 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +59 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +353 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +35 -29
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +2 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +9 -159
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +27 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +216 -23
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatTimestampDate.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index2.js +91 -0
- package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/labels.js → upload-receipt-widget/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptButton.js → upload-receipt-widget/ui/dist/index3.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptModal.js → upload-receipt-widget/ui/dist/index4.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index11.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index12.js +0 -39
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index21.js +0 -297
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index22.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index23.js +0 -4
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/labels.js +0 -13
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +0 -28
|
@@ -1 +1,496 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { Alert as e, AlertDescription as t, Button as n, Checkbox as r, Field as i, FieldContent as a, FieldError as o, FieldLabel as s, Input as c, InputGroup as l, InputGroupAddon as u, InputGroupInput as d, Label as f, RadioGroup as p, RadioGroupItem as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Separator as b, Sheet as x, SheetContent as S, SheetDescription as C, SheetFooter as w, SheetHeader as T, SheetTitle as ee, Spinner as te, Typography as E, cn as D } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { RECEIVABLE_FORM_SHEET_LABELS_EN as ne } from "./index9.js";
|
|
3
|
+
import { ReceivableFormTotals as re } from "./index27.js";
|
|
4
|
+
import { ReceivableNotesSection as O } from "./index28.js";
|
|
5
|
+
import { useId as ie } from "react";
|
|
6
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
7
|
+
import { MinusIcon as j, PlusIcon as M, Trash2Icon as N } from "lucide-react";
|
|
8
|
+
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js
|
|
9
|
+
var P = "__none__", F = "__manage__";
|
|
10
|
+
function I({ message: e }) {
|
|
11
|
+
return e ? /* @__PURE__ */ k("p", {
|
|
12
|
+
className: "ttw:text-sm ttw:text-destructive",
|
|
13
|
+
children: e
|
|
14
|
+
}) : null;
|
|
15
|
+
}
|
|
16
|
+
function L({ formId: e, lineItem: t, errors: i, controls: a, focusOnMount: o, canRemove: s, unitOptions: c, currencySymbol: f, labels: p, renderProductSelector: m, onChange: b, onCommit: x, onQuantityStep: S, onManageUnits: C, onRemove: w }) {
|
|
17
|
+
let T = `${e}-line-${t.id}`;
|
|
18
|
+
return /* @__PURE__ */ A("li", {
|
|
19
|
+
className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ k("div", {
|
|
22
|
+
className: "ttw:min-w-30 ttw:flex-1",
|
|
23
|
+
children: m(t, {
|
|
24
|
+
inputId: `${T}-name`,
|
|
25
|
+
invalid: !!i?.name,
|
|
26
|
+
focusOnMount: o
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ A("div", {
|
|
30
|
+
className: D("ttw:flex ttw:h-9 ttw:w-26 ttw:min-w-26 ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs", i?.quantity && "ttw:border-destructive"),
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ k("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
"aria-label": p.decreaseQuantityButton,
|
|
35
|
+
disabled: a ? !a.canDecreaseQuantity : !1,
|
|
36
|
+
className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
|
|
37
|
+
onClick: () => S(-1),
|
|
38
|
+
children: /* @__PURE__ */ k(j, { className: "ttw:size-3.5" })
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ k("input", {
|
|
41
|
+
id: `${T}-quantity`,
|
|
42
|
+
"aria-label": p.quantityLabel,
|
|
43
|
+
"aria-invalid": !!i?.quantity || void 0,
|
|
44
|
+
type: "text",
|
|
45
|
+
inputMode: "decimal",
|
|
46
|
+
className: "ttw:h-full ttw:w-full ttw:min-w-0 ttw:bg-transparent ttw:px-0 ttw:text-center ttw:text-sm ttw:outline-none",
|
|
47
|
+
value: t.quantity,
|
|
48
|
+
onChange: (e) => b({ quantity: e.target.value }),
|
|
49
|
+
onBlur: () => x("quantity")
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ k("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
"aria-label": p.increaseQuantityButton,
|
|
54
|
+
disabled: a ? !a.canIncreaseQuantity : !1,
|
|
55
|
+
className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
|
|
56
|
+
onClick: () => S(1),
|
|
57
|
+
children: /* @__PURE__ */ k(M, { className: "ttw:size-3.5" })
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ A(h, {
|
|
62
|
+
value: t.unit || P,
|
|
63
|
+
onValueChange: (e) => {
|
|
64
|
+
if (e === F) {
|
|
65
|
+
C?.();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
b({ unit: e === P ? "" : e });
|
|
69
|
+
},
|
|
70
|
+
children: [/* @__PURE__ */ k(v, {
|
|
71
|
+
id: `${T}-unit`,
|
|
72
|
+
"aria-label": p.unitLabel,
|
|
73
|
+
"aria-invalid": !!i?.measureUnit || void 0,
|
|
74
|
+
className: "ttw:w-22",
|
|
75
|
+
children: /* @__PURE__ */ k(y, {
|
|
76
|
+
className: "ttw:truncate",
|
|
77
|
+
placeholder: p.unitPlaceholder
|
|
78
|
+
})
|
|
79
|
+
}), /* @__PURE__ */ A(g, { children: [
|
|
80
|
+
C && /* @__PURE__ */ A(_, {
|
|
81
|
+
value: F,
|
|
82
|
+
className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
|
|
83
|
+
children: [/* @__PURE__ */ k(M, { className: "ttw:text-primary" }), p.manageUnitsOption]
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ k(_, {
|
|
86
|
+
value: P,
|
|
87
|
+
children: p.unitNone
|
|
88
|
+
}),
|
|
89
|
+
c.map((e) => /* @__PURE__ */ k(_, {
|
|
90
|
+
value: e.value,
|
|
91
|
+
children: e.label
|
|
92
|
+
}, e.value))
|
|
93
|
+
] })]
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ A(l, {
|
|
96
|
+
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
97
|
+
children: [/* @__PURE__ */ k(u, {
|
|
98
|
+
align: "inline-start",
|
|
99
|
+
children: f
|
|
100
|
+
}), /* @__PURE__ */ k(d, {
|
|
101
|
+
id: `${T}-price`,
|
|
102
|
+
"aria-label": p.priceLabel,
|
|
103
|
+
"aria-invalid": !!i?.price || void 0,
|
|
104
|
+
"data-has-start-addon": !0,
|
|
105
|
+
type: "text",
|
|
106
|
+
inputMode: "decimal",
|
|
107
|
+
className: "ttw:text-right",
|
|
108
|
+
value: t.price,
|
|
109
|
+
onChange: (e) => b({ price: e.target.value }),
|
|
110
|
+
onBlur: () => x("price")
|
|
111
|
+
})]
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ k("div", {
|
|
114
|
+
className: "ttw:flex ttw:w-12 ttw:min-w-12 ttw:items-center ttw:justify-center",
|
|
115
|
+
children: /* @__PURE__ */ k(r, {
|
|
116
|
+
id: `${T}-taxable`,
|
|
117
|
+
"aria-label": p.taxableLabel,
|
|
118
|
+
checked: t.taxable,
|
|
119
|
+
onCheckedChange: (e) => b({ taxable: e === !0 })
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
s && /* @__PURE__ */ k(n, {
|
|
123
|
+
type: "button",
|
|
124
|
+
variant: "ghost",
|
|
125
|
+
size: "sm",
|
|
126
|
+
"aria-label": p.removeLineItemButton,
|
|
127
|
+
className: "ttw:w-10 ttw:rounded-none ttw:border-l ttw:border-border ttw:pl-4 ttw:text-muted-foreground ttw:hover:bg-transparent ttw:hover:text-destructive ttw:has-[>svg]:pr-0",
|
|
128
|
+
onClick: w,
|
|
129
|
+
children: /* @__PURE__ */ k(N, {})
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function ae({ inputId: e, discountType: t, value: n, error: r, currencySymbol: c, disabled: f, labels: p, onChange: m, onTypeChange: h, onFocus: g, onBlur: _ }) {
|
|
135
|
+
let v = `${e}-error`, y = [{
|
|
136
|
+
type: "amount",
|
|
137
|
+
label: c,
|
|
138
|
+
ariaLabel: p.discountAmountOptionAriaLabel
|
|
139
|
+
}, {
|
|
140
|
+
type: "percentage",
|
|
141
|
+
label: p.discountPercentageOption,
|
|
142
|
+
ariaLabel: p.discountPercentageOptionAriaLabel
|
|
143
|
+
}];
|
|
144
|
+
return /* @__PURE__ */ A(i, {
|
|
145
|
+
className: "ttw:flex-col",
|
|
146
|
+
children: [/* @__PURE__ */ A(a, {
|
|
147
|
+
className: "ttw:flex-row ttw:items-center ttw:justify-end",
|
|
148
|
+
children: [/* @__PURE__ */ k(s, {
|
|
149
|
+
htmlFor: e,
|
|
150
|
+
className: D(r && "ttw:text-destructive"),
|
|
151
|
+
children: p.discountLabel
|
|
152
|
+
}), /* @__PURE__ */ A(l, {
|
|
153
|
+
className: "ttw:w-40 ttw:overflow-hidden",
|
|
154
|
+
children: [/* @__PURE__ */ k(u, {
|
|
155
|
+
align: "inline-start",
|
|
156
|
+
className: "ttw:gap-0 ttw:self-stretch ttw:p-0 ttw:has-[>button]:ml-0",
|
|
157
|
+
children: y.map((e) => /* @__PURE__ */ k("button", {
|
|
158
|
+
type: "button",
|
|
159
|
+
"aria-label": e.ariaLabel,
|
|
160
|
+
"aria-pressed": t === e.type,
|
|
161
|
+
disabled: f,
|
|
162
|
+
className: D("ttw:pointer-events-auto ttw:h-full ttw:w-9 ttw:cursor-pointer ttw:border-r ttw:border-input ttw:text-sm ttw:transition-colors ttw:disabled:pointer-events-none ttw:disabled:opacity-50", t === e.type ? "ttw:bg-primary ttw:text-primary-foreground" : "ttw:text-muted-foreground ttw:hover:bg-muted ttw:hover:text-foreground"),
|
|
163
|
+
onClick: () => h(e.type),
|
|
164
|
+
children: e.label
|
|
165
|
+
}, e.type))
|
|
166
|
+
}), /* @__PURE__ */ k(d, {
|
|
167
|
+
id: e,
|
|
168
|
+
type: "text",
|
|
169
|
+
inputMode: "decimal",
|
|
170
|
+
className: "ttw:text-right",
|
|
171
|
+
"aria-invalid": !!r || void 0,
|
|
172
|
+
"aria-describedby": r ? v : void 0,
|
|
173
|
+
disabled: f,
|
|
174
|
+
value: n,
|
|
175
|
+
onChange: (e) => m(e.target.value),
|
|
176
|
+
onFocus: g,
|
|
177
|
+
onBlur: _
|
|
178
|
+
})]
|
|
179
|
+
})]
|
|
180
|
+
}), r && /* @__PURE__ */ k(o, {
|
|
181
|
+
id: v,
|
|
182
|
+
className: "ttw:text-right",
|
|
183
|
+
children: r
|
|
184
|
+
})]
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function R({ open: r, onOpenChange: j, mode: N = "create", values: P, errors: F, currencyOptions: R, unitOptions: oe, currencySymbol: z, lineItemControls: B, autoFocusLineItemId: V, lineItemsLoading: H, inProgress: U, customerSelector: W, renderProductSelector: G, onChange: K, onLineItemChange: q, onLineItemCommit: se, onLineItemQuantityStep: ce, onTaxRateCommit: J, onDiscountFocus: le, onDiscountCommit: ue, totals: de, onManageUnits: fe, onAddLineItem: pe, onRemoveLineItem: me, showDueDateField: Y, billingSection: he, remindersSection: ge, bankAccountSection: _e, attachmentsSection: ve, cancelDisabled: ye, draftButtonLabel: X, draftDisabled: be, primaryButtonLabel: xe, primaryDisabled: Se, scrollContainerRef: Ce, onSubmit: we, onDraftClick: Te, onPrimaryClick: Ee, onCancel: De, labels: Oe }) {
|
|
188
|
+
let Z = {
|
|
189
|
+
...ne,
|
|
190
|
+
...Oe
|
|
191
|
+
}, Q = ie(), $ = N === "edit", ke = D("ttw:grid ttw:gap-4", $ && Y ? "ttw:grid-cols-3" : "ttw:grid-cols-2");
|
|
192
|
+
return /* @__PURE__ */ k(x, {
|
|
193
|
+
open: r,
|
|
194
|
+
onOpenChange: j,
|
|
195
|
+
children: /* @__PURE__ */ A(S, {
|
|
196
|
+
ref: Ce,
|
|
197
|
+
className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ A(T, { children: [/* @__PURE__ */ k(ee, { children: N === "edit" ? Z.editTitle : Z.createTitle }), /* @__PURE__ */ k(C, {
|
|
200
|
+
className: "ttw:sr-only",
|
|
201
|
+
children: Z.hiddenDescription
|
|
202
|
+
})] }),
|
|
203
|
+
/* @__PURE__ */ A("form", {
|
|
204
|
+
id: Q,
|
|
205
|
+
onSubmit: (e) => {
|
|
206
|
+
e.preventDefault(), e.stopPropagation(), we();
|
|
207
|
+
},
|
|
208
|
+
children: [/* @__PURE__ */ k("button", {
|
|
209
|
+
type: "submit",
|
|
210
|
+
className: "ttw:sr-only",
|
|
211
|
+
tabIndex: -1,
|
|
212
|
+
"aria-hidden": "true"
|
|
213
|
+
}), /* @__PURE__ */ A("div", {
|
|
214
|
+
className: "ttw:flex ttw:flex-col ttw:gap-5 ttw:px-6 ttw:pb-6",
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ A("div", {
|
|
217
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ k(f, { children: Z.documentTypeLabel }),
|
|
220
|
+
/* @__PURE__ */ A(p, {
|
|
221
|
+
className: "ttw:flex ttw:flex-row ttw:gap-6",
|
|
222
|
+
disabled: N === "edit",
|
|
223
|
+
value: P.type,
|
|
224
|
+
onValueChange: (e) => K({ type: e }),
|
|
225
|
+
children: [/* @__PURE__ */ A("div", {
|
|
226
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
227
|
+
children: [/* @__PURE__ */ k(m, {
|
|
228
|
+
value: "invoice",
|
|
229
|
+
id: `${Q}-invoice`
|
|
230
|
+
}), /* @__PURE__ */ k(f, {
|
|
231
|
+
htmlFor: `${Q}-invoice`,
|
|
232
|
+
children: Z.typeInvoice
|
|
233
|
+
})]
|
|
234
|
+
}), /* @__PURE__ */ A("div", {
|
|
235
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
236
|
+
children: [/* @__PURE__ */ k(m, {
|
|
237
|
+
value: "quote",
|
|
238
|
+
id: `${Q}-quote`
|
|
239
|
+
}), /* @__PURE__ */ k(f, {
|
|
240
|
+
htmlFor: `${Q}-quote`,
|
|
241
|
+
children: Z.typeQuote
|
|
242
|
+
})]
|
|
243
|
+
})]
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ k(I, { message: F?.type })
|
|
246
|
+
]
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ A("div", {
|
|
249
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ k(f, { children: Z.customerLabel }),
|
|
252
|
+
W,
|
|
253
|
+
/* @__PURE__ */ k("p", {
|
|
254
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
255
|
+
children: Z.customerHint
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ k(I, { message: F?.customerId })
|
|
258
|
+
]
|
|
259
|
+
}),
|
|
260
|
+
/* @__PURE__ */ A("div", {
|
|
261
|
+
className: ke,
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ A("div", {
|
|
264
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ k(f, {
|
|
267
|
+
htmlFor: `${Q}-currency`,
|
|
268
|
+
children: Z.currencyLabel
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ A(h, {
|
|
271
|
+
value: P.currency,
|
|
272
|
+
onValueChange: (e) => K({ currency: e }),
|
|
273
|
+
children: [/* @__PURE__ */ k(v, {
|
|
274
|
+
id: `${Q}-currency`,
|
|
275
|
+
children: /* @__PURE__ */ k(y, {})
|
|
276
|
+
}), /* @__PURE__ */ k(g, { children: R.map((e) => /* @__PURE__ */ k(_, {
|
|
277
|
+
value: e.value,
|
|
278
|
+
children: e.label
|
|
279
|
+
}, e.value)) })]
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ k(I, { message: F?.currency })
|
|
282
|
+
]
|
|
283
|
+
}),
|
|
284
|
+
$ && /* @__PURE__ */ A("div", {
|
|
285
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ k(f, {
|
|
288
|
+
htmlFor: `${Q}-issue-date`,
|
|
289
|
+
children: Z.issueDateLabel
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ k(c, {
|
|
292
|
+
id: `${Q}-issue-date`,
|
|
293
|
+
type: "date",
|
|
294
|
+
value: P.issueDate,
|
|
295
|
+
onChange: (e) => K({ issueDate: e.target.value })
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ k(I, { message: F?.issueDate })
|
|
298
|
+
]
|
|
299
|
+
}),
|
|
300
|
+
Y && /* @__PURE__ */ A("div", {
|
|
301
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ k(f, {
|
|
304
|
+
htmlFor: `${Q}-due-date`,
|
|
305
|
+
children: Z.dueDateLabel
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ k(c, {
|
|
308
|
+
id: `${Q}-due-date`,
|
|
309
|
+
type: "date",
|
|
310
|
+
value: P.dueDate,
|
|
311
|
+
onChange: (e) => K({ dueDate: e.target.value })
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ k(I, { message: F?.dueDate })
|
|
314
|
+
]
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
}),
|
|
318
|
+
he,
|
|
319
|
+
ge,
|
|
320
|
+
/* @__PURE__ */ A("div", {
|
|
321
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ A("div", {
|
|
324
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
|
|
325
|
+
children: [/* @__PURE__ */ k(E, {
|
|
326
|
+
variant: "h4",
|
|
327
|
+
children: Z.lineItemsHeading
|
|
328
|
+
}), /* @__PURE__ */ k(E, {
|
|
329
|
+
variant: "body2",
|
|
330
|
+
color: "muted",
|
|
331
|
+
className: "ttw:font-medium",
|
|
332
|
+
children: Z.lineItemsDescription
|
|
333
|
+
})]
|
|
334
|
+
}),
|
|
335
|
+
F?.lineItemsSummary?.length ? /* @__PURE__ */ k(e, {
|
|
336
|
+
variant: "destructive",
|
|
337
|
+
className: "ttw:mb-2",
|
|
338
|
+
children: /* @__PURE__ */ k(t, { children: /* @__PURE__ */ k("ul", { children: F.lineItemsSummary.map((e) => /* @__PURE__ */ k("li", { children: e }, e)) }) })
|
|
339
|
+
}) : null,
|
|
340
|
+
/* @__PURE__ */ A("ul", {
|
|
341
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
342
|
+
children: [/* @__PURE__ */ A("li", {
|
|
343
|
+
"aria-hidden": !0,
|
|
344
|
+
className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ k("span", {
|
|
347
|
+
className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
|
|
348
|
+
children: Z.productLabel
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ k("span", {
|
|
351
|
+
className: "ttw:w-24 ttw:min-w-24",
|
|
352
|
+
children: Z.quantityLabel
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ k("span", {
|
|
355
|
+
className: "ttw:w-20.5 ttw:min-w-20.5",
|
|
356
|
+
children: Z.unitLabel
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ k("span", {
|
|
359
|
+
className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
|
|
360
|
+
children: Z.priceLabel
|
|
361
|
+
}),
|
|
362
|
+
/* @__PURE__ */ k("span", {
|
|
363
|
+
className: "ttw:w-12 ttw:min-w-12",
|
|
364
|
+
children: Z.taxableLabel
|
|
365
|
+
}),
|
|
366
|
+
P.lineItems.length > 1 && /* @__PURE__ */ k("span", { className: "ttw:w-10 ttw:min-w-10" })
|
|
367
|
+
]
|
|
368
|
+
}), H ? /* @__PURE__ */ k("li", {
|
|
369
|
+
className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
|
|
370
|
+
children: /* @__PURE__ */ k(te, { className: "ttw:size-5" })
|
|
371
|
+
}) : P.lineItems.map((e) => /* @__PURE__ */ k(L, {
|
|
372
|
+
formId: Q,
|
|
373
|
+
lineItem: e,
|
|
374
|
+
errors: F?.lineItems?.[e.id],
|
|
375
|
+
controls: B?.[e.id],
|
|
376
|
+
focusOnMount: e.id === V,
|
|
377
|
+
canRemove: P.lineItems.length > 1,
|
|
378
|
+
unitOptions: oe,
|
|
379
|
+
currencySymbol: z,
|
|
380
|
+
labels: Z,
|
|
381
|
+
renderProductSelector: G,
|
|
382
|
+
onChange: (t) => q(e.id, t),
|
|
383
|
+
onCommit: (t) => se(e.id, t),
|
|
384
|
+
onQuantityStep: (t) => ce(e.id, t),
|
|
385
|
+
onManageUnits: fe,
|
|
386
|
+
onRemove: () => me(e.id)
|
|
387
|
+
}, e.id))]
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ A(n, {
|
|
390
|
+
type: "button",
|
|
391
|
+
variant: "ghost",
|
|
392
|
+
className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
|
|
393
|
+
onClick: pe,
|
|
394
|
+
children: [/* @__PURE__ */ k(M, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
|
|
395
|
+
}),
|
|
396
|
+
/* @__PURE__ */ k(ae, {
|
|
397
|
+
inputId: `${Q}-discount`,
|
|
398
|
+
discountType: P.discountType,
|
|
399
|
+
value: P.discount,
|
|
400
|
+
error: F?.discount,
|
|
401
|
+
currencySymbol: z,
|
|
402
|
+
disabled: U,
|
|
403
|
+
labels: Z,
|
|
404
|
+
onChange: (e) => K({ discount: e }),
|
|
405
|
+
onTypeChange: (e) => K({ discountType: e }),
|
|
406
|
+
onFocus: le,
|
|
407
|
+
onBlur: ue
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ A(i, {
|
|
410
|
+
className: "ttw:flex-col",
|
|
411
|
+
children: [/* @__PURE__ */ A(a, {
|
|
412
|
+
className: "ttw:flex-row ttw:justify-end",
|
|
413
|
+
children: [/* @__PURE__ */ k(s, {
|
|
414
|
+
htmlFor: `${Q}-tax-rate`,
|
|
415
|
+
className: D(F?.taxRate && "ttw:text-destructive"),
|
|
416
|
+
children: Z.taxRateLabel
|
|
417
|
+
}), /* @__PURE__ */ A(l, {
|
|
418
|
+
className: "ttw:w-40 ttw:has-[>[data-align=inline-end]]:[&>input]:pr-0",
|
|
419
|
+
children: [/* @__PURE__ */ k(d, {
|
|
420
|
+
id: `${Q}-tax-rate`,
|
|
421
|
+
className: "ttw:text-right",
|
|
422
|
+
placeholder: Z.taxRatePlaceholder,
|
|
423
|
+
type: "text",
|
|
424
|
+
inputMode: "decimal",
|
|
425
|
+
"aria-invalid": !!F?.taxRate || void 0,
|
|
426
|
+
"aria-describedby": F?.taxRate ? `${Q}-tax-rate-error` : void 0,
|
|
427
|
+
value: P.taxRate,
|
|
428
|
+
onChange: (e) => K({ taxRate: e.target.value }),
|
|
429
|
+
onBlur: J
|
|
430
|
+
}), /* @__PURE__ */ k(u, {
|
|
431
|
+
align: "inline-end",
|
|
432
|
+
children: Z.taxRateSuffix
|
|
433
|
+
})]
|
|
434
|
+
})]
|
|
435
|
+
}), F?.taxRate && /* @__PURE__ */ k(o, {
|
|
436
|
+
id: `${Q}-tax-rate-error`,
|
|
437
|
+
className: "ttw:text-right",
|
|
438
|
+
children: F.taxRate
|
|
439
|
+
})]
|
|
440
|
+
}),
|
|
441
|
+
/* @__PURE__ */ k(b, {}),
|
|
442
|
+
/* @__PURE__ */ k(re, {
|
|
443
|
+
totals: de,
|
|
444
|
+
labels: Z
|
|
445
|
+
})
|
|
446
|
+
]
|
|
447
|
+
}),
|
|
448
|
+
_e,
|
|
449
|
+
/* @__PURE__ */ k(O, {
|
|
450
|
+
idPrefix: Q,
|
|
451
|
+
openingNote: P.openingNote,
|
|
452
|
+
closingNote: P.closingNote,
|
|
453
|
+
openingNoteError: F?.openingNote,
|
|
454
|
+
closingNoteError: F?.closingNote,
|
|
455
|
+
disabled: U,
|
|
456
|
+
onOpeningNoteChange: (e) => K({ openingNote: e }),
|
|
457
|
+
onClosingNoteChange: (e) => K({ closingNote: e }),
|
|
458
|
+
labels: Z
|
|
459
|
+
}),
|
|
460
|
+
ve
|
|
461
|
+
]
|
|
462
|
+
})]
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ k(w, { children: /* @__PURE__ */ A("div", {
|
|
465
|
+
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ k(n, {
|
|
468
|
+
type: "button",
|
|
469
|
+
variant: "ghost",
|
|
470
|
+
disabled: ye,
|
|
471
|
+
onClick: De,
|
|
472
|
+
children: Z.cancelButton
|
|
473
|
+
}),
|
|
474
|
+
X && /* @__PURE__ */ k(n, {
|
|
475
|
+
type: "submit",
|
|
476
|
+
form: Q,
|
|
477
|
+
variant: "secondary",
|
|
478
|
+
disabled: be,
|
|
479
|
+
onClick: Te,
|
|
480
|
+
children: X
|
|
481
|
+
}),
|
|
482
|
+
/* @__PURE__ */ k(n, {
|
|
483
|
+
type: "submit",
|
|
484
|
+
form: Q,
|
|
485
|
+
disabled: Se,
|
|
486
|
+
onClick: Ee,
|
|
487
|
+
children: xe
|
|
488
|
+
})
|
|
489
|
+
]
|
|
490
|
+
}) })
|
|
491
|
+
]
|
|
492
|
+
})
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
//#endregion
|
|
496
|
+
export { R as ReceivableFormSheet, R as default };
|
|
@@ -1,29 +1,123 @@
|
|
|
1
|
+
import { Button as e, DialogDescription as t, DialogFooter as n, DialogHeader as r, DialogTitle as i, Input as a, Label as o, Textarea as s, Typography as c } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import { Check as f } from "lucide-react";
|
|
1
4
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, t
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
function p({ idPrefix: p, view: m, onSubjectChange: h, onMessageChange: g, onSkip: _, onSend: v, labels: y }) {
|
|
6
|
+
let b = `${p}-subject`, x = `${p}-message`;
|
|
7
|
+
return /* @__PURE__ */ d(l, { children: [
|
|
8
|
+
/* @__PURE__ */ u(r, {
|
|
9
|
+
className: "ttw:border-b ttw:border-border ttw:p-6",
|
|
10
|
+
children: /* @__PURE__ */ d("div", {
|
|
11
|
+
className: "ttw:flex ttw:items-center ttw:gap-4",
|
|
12
|
+
children: [/* @__PURE__ */ u("span", {
|
|
13
|
+
className: "ttw:flex ttw:size-10 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-emerald-200 ttw:bg-emerald-50",
|
|
14
|
+
children: /* @__PURE__ */ u(f, { className: "ttw:size-6 ttw:text-green-700" })
|
|
15
|
+
}), /* @__PURE__ */ d("div", {
|
|
16
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
17
|
+
children: [/* @__PURE__ */ u(i, { children: m.title }), /* @__PURE__ */ u(t, {
|
|
18
|
+
className: "ttw:text-xs",
|
|
19
|
+
children: y.issueDescription
|
|
20
|
+
})]
|
|
21
|
+
})]
|
|
22
|
+
})
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ d("div", {
|
|
25
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:p-6",
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ d("div", {
|
|
28
|
+
className: "ttw:flex ttw:items-center ttw:gap-4",
|
|
29
|
+
children: [/* @__PURE__ */ u(c, {
|
|
30
|
+
variant: "body2",
|
|
31
|
+
color: "muted",
|
|
32
|
+
className: "ttw:w-16 ttw:shrink-0",
|
|
33
|
+
children: y.toLabel
|
|
34
|
+
}), /* @__PURE__ */ u(c, {
|
|
35
|
+
variant: "body2",
|
|
36
|
+
children: m.recipient
|
|
37
|
+
})]
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ d("div", {
|
|
40
|
+
className: "ttw:flex ttw:items-center ttw:gap-4",
|
|
41
|
+
children: [/* @__PURE__ */ u(o, {
|
|
42
|
+
htmlFor: b,
|
|
43
|
+
className: "ttw:w-16 ttw:shrink-0 ttw:font-normal ttw:text-muted-foreground",
|
|
44
|
+
children: y.subjectLabel
|
|
45
|
+
}), /* @__PURE__ */ u(a, {
|
|
46
|
+
id: b,
|
|
47
|
+
className: "ttw:flex-1",
|
|
48
|
+
value: m.subject,
|
|
49
|
+
onChange: (e) => h(e.target.value),
|
|
50
|
+
disabled: m.inProgress
|
|
51
|
+
})]
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ d("div", {
|
|
54
|
+
className: "ttw:flex ttw:items-start ttw:gap-4",
|
|
55
|
+
children: [/* @__PURE__ */ u(o, {
|
|
56
|
+
htmlFor: x,
|
|
57
|
+
className: "ttw:w-16 ttw:shrink-0 ttw:pt-2 ttw:font-normal ttw:text-muted-foreground",
|
|
58
|
+
children: y.messageLabel
|
|
59
|
+
}), /* @__PURE__ */ u(s, {
|
|
60
|
+
id: x,
|
|
61
|
+
className: "ttw:flex-1",
|
|
62
|
+
value: m.message,
|
|
63
|
+
onChange: (e) => g(e.target.value),
|
|
64
|
+
placeholder: y.messagePlaceholder,
|
|
65
|
+
disabled: m.inProgress
|
|
66
|
+
})]
|
|
67
|
+
}),
|
|
68
|
+
m.attachments.length > 0 && /* @__PURE__ */ d("div", {
|
|
69
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pl-20",
|
|
70
|
+
children: [/* @__PURE__ */ d("div", {
|
|
71
|
+
className: "ttw:flex ttw:flex-col",
|
|
72
|
+
children: [/* @__PURE__ */ u(c, {
|
|
73
|
+
variant: "body2",
|
|
74
|
+
color: "muted",
|
|
75
|
+
children: y.attachmentsLabel
|
|
76
|
+
}), /* @__PURE__ */ u(c, {
|
|
77
|
+
variant: "caption",
|
|
78
|
+
color: "muted",
|
|
79
|
+
children: y.attachmentsCaption
|
|
80
|
+
})]
|
|
81
|
+
}), /* @__PURE__ */ u("ul", {
|
|
82
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5",
|
|
83
|
+
children: m.attachments.map((e) => /* @__PURE__ */ d("li", {
|
|
84
|
+
className: "ttw:rounded-lg ttw:bg-muted ttw:px-2 ttw:py-1 ttw:text-sm ttw:font-medium",
|
|
85
|
+
children: [
|
|
86
|
+
e.name,
|
|
87
|
+
" ",
|
|
88
|
+
/* @__PURE__ */ d("span", {
|
|
89
|
+
className: "ttw:text-muted-foreground",
|
|
90
|
+
children: [
|
|
91
|
+
"(",
|
|
92
|
+
e.sizeLabel,
|
|
93
|
+
")"
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
}, e.id))
|
|
98
|
+
})]
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ d(n, {
|
|
103
|
+
className: "ttw:flex ttw:flex-row ttw:gap-4 ttw:border-t ttw:border-border ttw:p-6",
|
|
104
|
+
children: [/* @__PURE__ */ u(e, {
|
|
105
|
+
type: "button",
|
|
106
|
+
variant: "outline",
|
|
107
|
+
className: "ttw:flex-1 ttw:border-border",
|
|
108
|
+
disabled: m.inProgress,
|
|
109
|
+
onClick: _,
|
|
110
|
+
children: y.skipButton
|
|
111
|
+
}), /* @__PURE__ */ u(e, {
|
|
112
|
+
type: "button",
|
|
113
|
+
className: "ttw:flex-1",
|
|
114
|
+
disabled: m.sendDisabled,
|
|
115
|
+
loading: m.inProgress,
|
|
116
|
+
onClick: v,
|
|
117
|
+
children: y.sendButton
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
] });
|
|
121
|
+
}
|
|
28
122
|
//#endregion
|
|
29
|
-
export {
|
|
123
|
+
export { p as ReceivableActionsModalIssueStep };
|