@tesouro/embedded-components-react 0.4.31 → 0.5.1
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 +17 -47
- package/dist/index.d.ts +2 -27
- package/dist/index.js +21 -27
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/ExpenseManagementWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +14 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +8 -96
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +91 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +96 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +49 -35
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +129 -180
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +32 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +186 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +70 -226
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -219
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +221 -109
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +220 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +119 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +13 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +43 -198
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +29 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +186 -222
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +37 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +229 -420
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +429 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -224
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +222 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +44 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -110
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +12 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +109 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +45 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +28 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +76 -243
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +48 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -196
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +115 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +207 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +3 -114
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +106 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +74 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +11 -247
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +34 -57
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index14.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +253 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +2 -48
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ReceiptMatchWidget/lib/labels.js +4 -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/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +0 -639
- package/dist/lib/ExpenseApprovalPoliciesWidget.js +0 -3
- package/dist/lib/ExpenseRequirementsWidget.d.ts +0 -639
- package/dist/lib/ExpenseRequirementsWidget.js +0 -3
- package/dist/lib/ReceiptMatchWidget.d.ts +0 -640
- package/dist/lib/ReceiptMatchWidget.js +0 -3
package/README.md
CHANGED
|
@@ -355,30 +355,29 @@ A composite expense widget for receipt upload, matching slots, approval policies
|
|
|
355
355
|
|
|
356
356
|
#### Props
|
|
357
357
|
|
|
358
|
-
| Prop | Type | Default | Description
|
|
359
|
-
| --------------------- | -------------------------- | ------------------------ |
|
|
360
|
-
| `labels` | `Partial<Labels>` | English labels | Overrides tab and heading copy.
|
|
361
|
-
| `receiptUpload` | `UploadReceiptWidgetProps` | `undefined` | Enables the default receipt upload control.
|
|
362
|
-
| `receiptsContent` | `ReactNode` | Upload widget or empty | Replaces the receipts tab content.
|
|
363
|
-
| `matchingContent` | `ReactNode` |
|
|
364
|
-
| `policiesContent` | `ReactNode` | Approval policies widget | Replaces the policies tab content.
|
|
365
|
-
| `requirementsContent` | `ReactNode` | Requirements widget | Replaces the requirements tab content.
|
|
358
|
+
| Prop | Type | Default | Description |
|
|
359
|
+
| --------------------- | -------------------------- | ------------------------ | --------------------------------------------- |
|
|
360
|
+
| `labels` | `Partial<Labels>` | English labels | Overrides tab and heading copy. |
|
|
361
|
+
| `receiptUpload` | `UploadReceiptWidgetProps` | `undefined` | Enables the default receipt upload control. |
|
|
362
|
+
| `receiptsContent` | `ReactNode` | Upload widget or empty | Replaces the receipts tab content. |
|
|
363
|
+
| `matchingContent` | `ReactNode` | Receipt matching | Replaces the matching tab content. |
|
|
364
|
+
| `policiesContent` | `ReactNode` | Approval policies widget | Replaces the policies tab content. |
|
|
365
|
+
| `requirementsContent` | `ReactNode` | Requirements widget | Replaces the requirements tab content. |
|
|
366
366
|
|
|
367
|
-
###
|
|
368
|
-
|
|
369
|
-
Lets an organization view and manage its expense approval rules — each rule maps an amount range to an outcome (auto-approve or require approval) and, where approval is required, the approving roles. It is backed by the embedded REST API.
|
|
370
|
-
|
|
371
|
-
#### Props
|
|
372
|
-
|
|
373
|
-
_No props beyond the shared [auth/scope props](#providers)._
|
|
367
|
+
### UploadReceiptWidget
|
|
374
368
|
|
|
375
|
-
|
|
369
|
+
A self-contained "Upload receipts" control: a toggle button that opens a popover with a drag-and-drop / click-to-browse file picker plus a copyable forwarding email address. It is a controlled, presentational widget — the host owns the actual upload via `onFileUpload` and toasts batch progress, success, and failure.
|
|
376
370
|
|
|
377
|
-
|
|
371
|
+
_Standalone presentational widget — it does not take the shared auth/scope props._
|
|
378
372
|
|
|
379
373
|
#### Props
|
|
380
374
|
|
|
381
|
-
|
|
375
|
+
| Prop | Type | Default | Description |
|
|
376
|
+
| ----------------- | --------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
377
|
+
| `emailAddress` | `string` | _required_ | Forwarding email address shown in the popover with a copy button; receipts emailed here are processed automatically. |
|
|
378
|
+
| `onFileUpload` | `(file: File) => unknown \| Promise<unknown>` | `undefined` | Called once per selected file. The widget awaits each call and counts resolutions vs. rejections to drive its toasts. Omit to disable uploading. |
|
|
379
|
+
| `onAwaitMatching` | `(uploadedCount: number) => Promise<ReceiptMatchSummary>` | `undefined` | Awaited after every file in a batch has uploaded. Resolve once the backend has finished OCR and auto-matching, and the widget reports the aggregate outcome in its batch toast. Omit to stop at the upload confirmation. |
|
|
380
|
+
| `isUploading` | `boolean` | `false` | Host-controlled loading flag. While `true` (or while a batch is in flight) the popover shows a processing state and blocks new uploads. |
|
|
382
381
|
|
|
383
382
|
### BalancesWidget
|
|
384
383
|
|
|
@@ -500,20 +499,6 @@ A self-contained native widget for listing, creating, editing, and acting on cus
|
|
|
500
499
|
| `productMessageLabels` | `Partial<ProductMessageLabels>` | English defaults | Overrides product flow validation and error messages. |
|
|
501
500
|
| `counterpartMessageLabels` | `Partial<CounterpartMessageLabels>` | English defaults | Overrides customer flow validation and error messages. |
|
|
502
501
|
|
|
503
|
-
### ReceiptMatchWidget
|
|
504
|
-
|
|
505
|
-
A slide-out wizard for attaching uploaded receipts to bank-card transactions. It lists the signed-in user's unmatched receipts, lets them pick a transaction per receipt, and persists each match against the embedded REST API.
|
|
506
|
-
|
|
507
|
-
#### Props
|
|
508
|
-
|
|
509
|
-
| Prop | Type | Default | Description |
|
|
510
|
-
| --------------------------- | ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
511
|
-
| `isOpen` | `boolean` | `false` | Controls sidebar visibility. The widget renders `null` while falsy and opens when true; it also closes itself when a flow finishes. |
|
|
512
|
-
| `onClose` | `() => void` | `undefined` | Called on every dismissal (Done, attach, Esc, overlay). Provide it to keep your `isOpen` state in sync — the widget still self-closes if omitted. |
|
|
513
|
-
| `preSelectedReceiptIds` | `string[]` | `[]` | Receipt ids checked when the wizard opens, seeding the batch selection. |
|
|
514
|
-
| `targetTransactionId` | `string` | `undefined` | Attach mode: when set, the user picks one receipt and it is attached directly to this transaction (single-select, no transaction-search step). |
|
|
515
|
-
| `onSingleTransactionUpdate` | `() => void` | `undefined` | Called after a successful attach in `targetTransactionId` mode, before the widget closes. Use to refresh the host's view of that transaction. |
|
|
516
|
-
|
|
517
502
|
### SettingsWidget
|
|
518
503
|
|
|
519
504
|
A composite settings widget that combines Monite document settings, tags, GL codes, and expense configuration.
|
|
@@ -556,21 +541,6 @@ A self-contained banking widget for creating book or ACH transfers and reviewing
|
|
|
556
541
|
| `defaultIsTransferMoneyOpen` | `boolean` | `false` | The modal's state on first render, for a host that only wants to seed it. Ignored when `isTransferMoneyOpen` is supplied. |
|
|
557
542
|
| `onTransferMoneyOpenChange` | `(open: boolean) => void` | `undefined` | Called on every open and close — the **Transfer money** CTA, the modal's own dismissals (Esc, overlay, close), and the close after a completed transfer. |
|
|
558
543
|
|
|
559
|
-
### UploadReceiptWidget
|
|
560
|
-
|
|
561
|
-
A self-contained "Upload receipts" control: a toggle button that opens a popover with a drag-and-drop / click-to-browse file picker plus a copyable forwarding email address. It is a controlled, presentational widget — the host owns the actual upload via `onFileUpload` and toasts batch progress, success, and failure.
|
|
562
|
-
|
|
563
|
-
_Standalone presentational widget — it does not take the shared auth/scope props._
|
|
564
|
-
|
|
565
|
-
#### Props
|
|
566
|
-
|
|
567
|
-
| Prop | Type | Default | Description |
|
|
568
|
-
| ----------------- | --------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
569
|
-
| `emailAddress` | `string` | _required_ | Forwarding email address shown in the popover with a copy button; receipts emailed here are processed automatically. |
|
|
570
|
-
| `onFileUpload` | `(file: File) => unknown \| Promise<unknown>` | `undefined` | Called once per selected file. The widget awaits each call and counts resolutions vs. rejections to drive its toasts. Omit to disable uploading. |
|
|
571
|
-
| `onAwaitMatching` | `(uploadedCount: number) => Promise<ReceiptMatchSummary>` | `undefined` | Awaited after every file in a batch has uploaded. Resolve once the backend has finished OCR and auto-matching, and the widget reports the aggregate outcome in its batch toast. Omit to stop at the upload confirmation. |
|
|
572
|
-
| `isUploading` | `boolean` | `false` | Host-controlled loading flag. While `true` (or while a batch is in flight) the popover shows a processing state and blocks new uploads. |
|
|
573
|
-
|
|
574
544
|
<!-- END GENERATED REFERENCE -->
|
|
575
545
|
|
|
576
546
|
## UI frameworks (shadcn default, Tecton optional)
|
package/dist/index.d.ts
CHANGED
|
@@ -3748,31 +3748,6 @@ interface ExpenseManagementWidgetProps extends WidgetProviderProps {
|
|
|
3748
3748
|
}
|
|
3749
3749
|
declare function ExpenseManagementWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: ExpenseManagementWidgetProps): React.JSX.Element;
|
|
3750
3750
|
|
|
3751
|
-
type ReceiptMatchWidgetProps = WidgetProviderProps & {
|
|
3752
|
-
isOpen?: boolean;
|
|
3753
|
-
preSelectedReceiptIds?: string[];
|
|
3754
|
-
onClose?: () => void;
|
|
3755
|
-
targetTransactionId?: string;
|
|
3756
|
-
onSingleTransactionUpdate?: () => void;
|
|
3757
|
-
};
|
|
3758
|
-
declare function ReceiptMatchWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, disclosuresAcceptance, providerLabels, isOpen, preSelectedReceiptIds, onClose, targetTransactionId, onSingleTransactionUpdate, }: ReceiptMatchWidgetProps): React.JSX.Element;
|
|
3759
|
-
|
|
3760
|
-
type ExpenseApprovalPoliciesWidgetProps = WidgetProviderProps & {
|
|
3761
|
-
/** @deprecated Use `widgetToken` instead */
|
|
3762
|
-
token?: string | null;
|
|
3763
|
-
/** @deprecated Use `organizationId` instead */
|
|
3764
|
-
orgId?: string | null;
|
|
3765
|
-
};
|
|
3766
|
-
declare function ExpenseApprovalPoliciesWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, disclosuresAcceptance, providerLabels, }?: ExpenseApprovalPoliciesWidgetProps): React.JSX.Element;
|
|
3767
|
-
|
|
3768
|
-
type ExpenseRequirementsWidgetProps = WidgetProviderProps & {
|
|
3769
|
-
/** @deprecated Use `widgetToken` instead */
|
|
3770
|
-
token?: string | null;
|
|
3771
|
-
/** @deprecated Use `organizationId` instead */
|
|
3772
|
-
orgId?: string | null;
|
|
3773
|
-
};
|
|
3774
|
-
declare function ExpenseRequirementsWidget({ token, orgId, widgetToken, organizationId, baseUrl, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, disclosuresAcceptance, providerLabels, }?: ExpenseRequirementsWidgetProps): React.JSX.Element;
|
|
3775
|
-
|
|
3776
3751
|
type ReceivablesWidgetMoniteProps = MoniteRegionProviderProps & Omit<ReceivablesProps, 'pageTitleComponent' | 'initialView' | 'initialCounterpartId'> & {
|
|
3777
3752
|
pageTitleComponent?: ReceivablesProps['pageTitleComponent'];
|
|
3778
3753
|
};
|
|
@@ -4695,5 +4670,5 @@ interface CheckAmountAndDetailScreenProps {
|
|
|
4695
4670
|
|
|
4696
4671
|
type PendingFeatureStyleSources = CheckAmountAndDetailScreenProps | GapCoverageAlertProps | NoPolicyBannerProps;
|
|
4697
4672
|
|
|
4698
|
-
export { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, ADDITIONAL_OWNERS_LABELS_EN, AcceptDisclosuresWidget, BALANCES_WIDGET_LABELS_EN, BUSINESS_DETAILS_LABELS_EN, BalancesWidget, BankAccountOnboardingWidget, BankAccountsWidget, BillPayWidget, CardDetailsWidget, CounterpartsWidget, CreditCardsWidget, DebitCardsWidget, ERROR_STATE_ID,
|
|
4699
|
-
export type { AcceptDisclosuresWidgetLabels, AcceptDisclosuresWidgetProps, Labels$3 as AccountDetailsWidgetLabels, ActivateCardPanelLabels, AdditionalOwner, AdditionalOwnersLabels, AddressFormSheetLabels, BalancesWidgetLabels, BalancesWidgetProps, BankAccountFormSheetLabels, BankAccountOnboardingWidgetLabels, BankAccountOnboardingWidgetProps, FeatureLabels$3 as BankAccountsWidgetFeatureLabels, Labels$4 as BankAccountsWidgetLabels, BankAccountsWidgetProps, BillPayWidgetProps, BusinessDetailsLabels, BusinessDetailsValues, CardDetailsFeatureLabels, CardDetailsPanelLabels as CardDetailsWidgetLabels, CardDetailsWidgetProps, CardsFeatureLabels, CardsListLabels as CardsLabels, CardsPagination, CompanyStructureValue, ConfirmDeleteDialogLabels, CounterpartDetailsSheetLabels, CounterpartFormSheetLabels, CounterpartMessageLabels, CounterpartMode, CounterpartsScreenLabels, CounterpartsWidgetProps, CreditCardsWidgetProps, DebitCardsWidgetProps, DisclosureLinks, EmbeddedClient,
|
|
4673
|
+
export { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, ADDITIONAL_OWNERS_LABELS_EN, AcceptDisclosuresWidget, BALANCES_WIDGET_LABELS_EN, BUSINESS_DETAILS_LABELS_EN, BalancesWidget, BankAccountOnboardingWidget, BankAccountsWidget, BillPayWidget, CardDetailsWidget, CounterpartsWidget, CreditCardsWidget, DebitCardsWidget, ERROR_STATE_ID, ExpenseManagementWidget, HELP_FAQ_EN, INSIGHTS_FEATURE_LABELS_EN, INSIGHTS_WIDGET_LABELS_EN, Implementation, InsightsWidget, ReceivablesWidgetMonite as InvoicingWidget, LinkedAccountsWidget, PERSONAL_DETAILS_LABELS_EN, ProductsWidget, RESULT_LABELS_EN, ReceivablesWidget, RefreshingRootWidgetProvider, RootWidgetProvider, SINGLE_INSIGHT_LABELS_EN, SettingsSection, SettingsWidget, DEFAULT_FEATURE_LABELS as TRANSFERS_FEATURE_LABELS_EN, TRANSFERS_WIDGET_LABELS_EN, TransfersWidget, UIFramework, UploadReceiptWidget, WIDGET_SUITE_DEFAULT_SECTIONS, WIDGET_SUITE_LABELS_EN, WidgetProvider, WidgetSuite, WidgetSuiteSectionId, WidgetTokenRefreshProvider, cloneEmbeddedClient, getGlobalWidgetConfig, getGlobalWidgetInitState, registerDesignSystemEnsurer, registerUIRenderers, setGlobalWidgetConfig, subscribeToGlobalWidgetInitState, updateGlobalWidgetConfig, useDisclosuresAcceptanceSurface, useOwnWidgetConfig, useRefetchWidget, useWidgetConfig, useWidgetError, useWidgetInitStaleForToken, useWidgetLoading, useWidgetToken };
|
|
4674
|
+
export type { AcceptDisclosuresWidgetLabels, AcceptDisclosuresWidgetProps, Labels$3 as AccountDetailsWidgetLabels, ActivateCardPanelLabels, AdditionalOwner, AdditionalOwnersLabels, AddressFormSheetLabels, BalancesWidgetLabels, BalancesWidgetProps, BankAccountFormSheetLabels, BankAccountOnboardingWidgetLabels, BankAccountOnboardingWidgetProps, FeatureLabels$3 as BankAccountsWidgetFeatureLabels, Labels$4 as BankAccountsWidgetLabels, BankAccountsWidgetProps, BillPayWidgetProps, BusinessDetailsLabels, BusinessDetailsValues, CardDetailsFeatureLabels, CardDetailsPanelLabels as CardDetailsWidgetLabels, CardDetailsWidgetProps, CardsFeatureLabels, CardsListLabels as CardsLabels, CardsPagination, CompanyStructureValue, ConfirmDeleteDialogLabels, CounterpartDetailsSheetLabels, CounterpartFormSheetLabels, CounterpartMessageLabels, CounterpartMode, CounterpartsScreenLabels, CounterpartsWidgetProps, CreditCardsWidgetProps, DebitCardsWidgetProps, DisclosureLinks, EmbeddedClient, Labels$1 as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps, HelpFaqAnswer, HelpFaqBullet, HelpFaqBulletType, HelpFaqItem, HelpFaqSection, InsightsFeatureLabels, InsightsWidgetLabels, InsightsWidgetProps, ReceivablesWidgetMoniteProps as InvoicingWidgetProps, LinkComponent, LinkComponentProps, FeatureLabels as LinkedAccountsWidgetFeatureLabels, Labels as LinkedAccountsWidgetLabels, LinkedAccountsWidgetProps, MarketingWidgetContent, MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, PendingFeatureStyleSources, PersonalDetailsLabels, PersonalDetailsValues, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps, ReceiptMatchSummary, ReceivableActionDialogLabels, ReceivableDetailsSheetLabelOverrides, ReceivableDetailsSheetLabels, ReceivableDocumentType, ReceivableFormSheetLabels, ReceivableMessageLabels, ReceivablePaymentDialogLabels, ReceivableSendDialogLabels, ReceivableStatusBadgeLabels, ReceivablesScreenLabelOverrides, ReceivablesScreenLabels, ReceivablesWidgetProps, ReceivablesWidgetTab, RefreshingRootWidgetProviderProps, ResultLabels, RootWidgetProviderProps, SettingsWidgetAdditionalSection, FeatureLabels$2 as SettingsWidgetFeatureLabels, Labels$2 as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId, SingleInsightLabels, FeatureLabels$1 as TransfersWidgetFeatureLabels, TransfersWidgetLabels, TransfersWidgetProps, UploadReceiptWidgetProps, WidgetConfig, WidgetConfigInput, WidgetInitResponse, WidgetInitState, WidgetProviderLabels, WidgetProviderProps, WidgetSuiteCardsLabels, WidgetSuiteDashboardLabels, WidgetSuiteDisclosureLabels, WidgetSuiteExpensesLabels, WidgetSuiteLabelOverrides, WidgetSuiteLabels, WidgetSuiteMenuLabels, WidgetSuiteProps, WidgetSuiteSectionContentLabels, WidgetSuiteSectionTitleLabels, WidgetTokenFetcher, WidgetTokenManager, WidgetTokenRefreshProviderProps, WidgetTokenState };
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { RefreshingRootWidgetProvider as _ } from "./libs/tesouro-embedded-compo
|
|
|
14
14
|
import { useDisclosuresAcceptanceSurface as v, useOwnWidgetConfig as y, useRefetchWidget as b, useWidgetConfig as x, useWidgetError as S, useWidgetInitStaleForToken as C, useWidgetLoading as w } from "./libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
15
15
|
import { BankAccountsWidget as T } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
|
|
16
16
|
import { CounterpartsWidget as E } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
|
|
17
|
-
import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
17
|
+
import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js";
|
|
18
18
|
import { CardDetailsWidget as O } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
|
|
19
19
|
import { CreditCardsWidget as k } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
|
|
20
20
|
import { DebitCardsWidget as A } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
|
|
@@ -27,19 +27,16 @@ import { InsightsWidget as I } from "./libs/tesouro-embedded-components-react/in
|
|
|
27
27
|
import { InvoicingWidget as L } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js";
|
|
28
28
|
import { ReceivablesWidget as R } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js";
|
|
29
29
|
import { SettingsSection as z } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN as X } from "./libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js";
|
|
41
|
-
import { AcceptDisclosuresWidget as Z } from "./libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js";
|
|
42
|
-
import { WidgetSuite as Q } from "./libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js";
|
|
30
|
+
import { UploadReceiptWidget as B } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js";
|
|
31
|
+
import { ExpenseManagementWidget as V } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js";
|
|
32
|
+
import { HELP_FAQ_EN as H } from "./libs/tesouro-embedded-components-react/help-widget/ui/contract/dist/index3.js";
|
|
33
|
+
import { SettingsWidget as U } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js";
|
|
34
|
+
import { DEFAULT_FEATURE_LABELS as W } from "./libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index3.js";
|
|
35
|
+
import { TRANSFERS_WIDGET_LABELS_EN as G } from "./libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js";
|
|
36
|
+
import { TransfersWidget as K } from "./libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index7.js";
|
|
37
|
+
import { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN as q } from "./libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js";
|
|
38
|
+
import { AcceptDisclosuresWidget as J } from "./libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js";
|
|
39
|
+
import { WidgetSuite as Y } from "./libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js";
|
|
43
40
|
import "./lib/WidgetSuite.js";
|
|
44
41
|
import "./lib/AcceptDisclosuresWidget.js";
|
|
45
42
|
import "./lib/BankAccountsWidget.js";
|
|
@@ -49,26 +46,23 @@ import "./lib/DebitCardsWidget.js";
|
|
|
49
46
|
import "./lib/CardDetailsWidget.js";
|
|
50
47
|
import "./lib/CounterpartsWidget.js";
|
|
51
48
|
import "./lib/ExpenseManagementWidget.js";
|
|
52
|
-
import "./lib/
|
|
53
|
-
import "./lib/ExpenseRequirementsWidget.js";
|
|
49
|
+
import "./lib/UploadReceiptWidget.js";
|
|
54
50
|
import "./lib/BalancesWidget.js";
|
|
55
51
|
import "./lib/InsightsWidget.js";
|
|
56
52
|
import "./lib/InvoicingWidget.js";
|
|
57
|
-
import { LinkedAccountsWidget as
|
|
53
|
+
import { LinkedAccountsWidget as X } from "./libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index10.js";
|
|
58
54
|
import "./lib/LinkedAccountsWidget.js";
|
|
59
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
60
|
-
import { BUSINESS_DETAILS_LABELS_EN as
|
|
61
|
-
import { PERSONAL_DETAILS_LABELS_EN as
|
|
62
|
-
import { RESULT_LABELS_EN as
|
|
63
|
-
import { BankAccountOnboardingWidget as
|
|
55
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as Z } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js";
|
|
56
|
+
import { BUSINESS_DETAILS_LABELS_EN as Q } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js";
|
|
57
|
+
import { PERSONAL_DETAILS_LABELS_EN as $ } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
|
|
58
|
+
import { RESULT_LABELS_EN as ee } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js";
|
|
59
|
+
import { BankAccountOnboardingWidget as te } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js";
|
|
64
60
|
import "./lib/BankAccountOnboardingWidget.js";
|
|
65
|
-
import { ProductsWidget as
|
|
61
|
+
import { ProductsWidget as ne } from "./libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js";
|
|
66
62
|
import "./lib/ProductsWidget.js";
|
|
67
63
|
import "./lib/ReceivablesWidget.js";
|
|
68
|
-
import "./lib/ReceiptMatchWidget.js";
|
|
69
64
|
import "./lib/SettingsWidget.js";
|
|
70
65
|
import "./lib/TransfersWidget.js";
|
|
71
|
-
import "./lib/
|
|
72
|
-
import { WidgetProvider as oe } from "./lib/WidgetProviderPublic.js";
|
|
66
|
+
import { WidgetProvider as re } from "./lib/WidgetProviderPublic.js";
|
|
73
67
|
import "./lib/WidgetProvider.js";
|
|
74
|
-
export {
|
|
68
|
+
export { q as ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, Z as ADDITIONAL_OWNERS_LABELS_EN, J as AcceptDisclosuresWidget, j as BALANCES_WIDGET_LABELS_EN, Q as BUSINESS_DETAILS_LABELS_EN, M as BalancesWidget, te as BankAccountOnboardingWidget, T as BankAccountsWidget, D as BillPayWidget, O as CardDetailsWidget, E as CounterpartsWidget, k as CreditCardsWidget, A as DebitCardsWidget, s as ERROR_STATE_ID, V as ExpenseManagementWidget, H as HELP_FAQ_EN, N as INSIGHTS_FEATURE_LABELS_EN, P as INSIGHTS_WIDGET_LABELS_EN, c as Implementation, I as InsightsWidget, L as InvoicingWidget, X as LinkedAccountsWidget, $ as PERSONAL_DETAILS_LABELS_EN, ne as ProductsWidget, ee as RESULT_LABELS_EN, R as ReceivablesWidget, _ as RefreshingRootWidgetProvider, m as RootWidgetProvider, F as SINGLE_INSIGHT_LABELS_EN, z as SettingsSection, U as SettingsWidget, W as TRANSFERS_FEATURE_LABELS_EN, G as TRANSFERS_WIDGET_LABELS_EN, K as TransfersWidget, i as UIFramework, B as UploadReceiptWidget, t as WIDGET_SUITE_DEFAULT_SECTIONS, e as WIDGET_SUITE_LABELS_EN, re as WidgetProvider, Y as WidgetSuite, n as WidgetSuiteSectionId, h as WidgetTokenRefreshProvider, r as cloneEmbeddedClient, l as getGlobalWidgetConfig, f as getGlobalWidgetInitState, a as registerDesignSystemEnsurer, o as registerUIRenderers, u as setGlobalWidgetConfig, p as subscribeToGlobalWidgetInitState, d as updateGlobalWidgetConfig, v as useDisclosuresAcceptanceSurface, y as useOwnWidgetConfig, b as useRefetchWidget, x as useWidgetConfig, S as useWidgetError, C as useWidgetInitStaleForToken, w as useWidgetLoading, g as useWidgetToken };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/
|
|
1
|
+
import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
|
|
3
3
|
export { e as BillPayWidget };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExpenseManagementWidget as e } from "../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/
|
|
1
|
+
import { ExpenseManagementWidget as e } from "../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js";
|
|
3
3
|
export { e as ExpenseManagementWidget };
|
|
@@ -10,22 +10,23 @@ import "./index15.js";
|
|
|
10
10
|
import "./index27.js";
|
|
11
11
|
import "./index28.js";
|
|
12
12
|
import "./index40.js";
|
|
13
|
-
import "./
|
|
14
|
-
import "./
|
|
13
|
+
import "./index42.js";
|
|
14
|
+
import "./index48.js";
|
|
15
15
|
import "./index57.js";
|
|
16
16
|
import "./index59.js";
|
|
17
|
-
import "./index60.js";
|
|
18
17
|
import "./index61.js";
|
|
19
18
|
import "./index62.js";
|
|
20
19
|
import "./index63.js";
|
|
21
|
-
import "./
|
|
22
|
-
import "./
|
|
20
|
+
import "./index64.js";
|
|
21
|
+
import "./index65.js";
|
|
23
22
|
import "./index69.js";
|
|
24
23
|
import "./index70.js";
|
|
25
24
|
import "./index71.js";
|
|
26
|
-
import "./
|
|
27
|
-
import "./
|
|
28
|
-
import "./
|
|
25
|
+
import "./index72.js";
|
|
26
|
+
import "./index73.js";
|
|
27
|
+
import "./index76.js";
|
|
29
28
|
import "./index82.js";
|
|
30
|
-
import
|
|
29
|
+
import "./index83.js";
|
|
30
|
+
import "./index84.js";
|
|
31
|
+
import { BillPayWidget as e } from "./index88.js";
|
|
31
32
|
export { e as BillPayWidget };
|
|
@@ -1,93 +1,19 @@
|
|
|
1
|
-
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
-
import { derivePayableStatus as t } from "./index8.js";
|
|
3
|
-
import { resolveVendor as n, resolveVendorName as r } from "./index9.js";
|
|
4
|
-
import { formatBillMoney as i } from "./index2.js";
|
|
5
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
secondaryValue: g?.email ?? void 0
|
|
17
|
-
}], x = g?.bank_account?.account_number;
|
|
18
|
-
x && b.push({
|
|
19
|
-
label: l.bankAccountRow,
|
|
20
|
-
value: l.bankAccountValue(x.slice(-4))
|
|
21
|
-
});
|
|
22
|
-
let S = [
|
|
23
|
-
{
|
|
24
|
-
label: l.invoiceNumberRow,
|
|
25
|
-
value: a.document_id || l.notProvided
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: l.issueDateRow,
|
|
29
|
-
value: v
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: l.dueDateRow,
|
|
33
|
-
value: y
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: l.poNumberRow,
|
|
37
|
-
value: l.notProvided
|
|
38
|
-
}
|
|
39
|
-
], C = new Map(c.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), w = s.map((e) => {
|
|
40
|
-
let t = m(e.unit_price);
|
|
41
|
-
return {
|
|
42
|
-
id: e.id,
|
|
43
|
-
description: e.name ?? e.description ?? "",
|
|
44
|
-
glCodeLabel: (e.ledger_account_id ? C.get(e.ledger_account_id) : void 0) || l.glCodeMissing,
|
|
45
|
-
quantityLabel: e.quantity != null && t ? l.quantityValue(String(e.quantity), t) : "",
|
|
46
|
-
amountLabel: m(e.subtotal) ?? ""
|
|
47
|
-
};
|
|
48
|
-
}), T = [
|
|
49
|
-
{
|
|
50
|
-
label: l.subtotalRow,
|
|
51
|
-
value: a.subtotal
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: l.discountsRow,
|
|
55
|
-
value: a.discount
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: l.taxRow,
|
|
59
|
-
value: a.tax_amount
|
|
60
|
-
}
|
|
61
|
-
].map(({ label: e, value: t }) => ({
|
|
62
|
-
label: e,
|
|
63
|
-
value: m(t)
|
|
64
|
-
})).filter((e) => !!e.value), E = m(a.total_amount);
|
|
65
|
-
E && T.push({
|
|
66
|
-
label: l.totalRow,
|
|
67
|
-
value: E,
|
|
68
|
-
emphasis: !0
|
|
69
|
-
});
|
|
70
|
-
let D = o(a);
|
|
2
|
+
var e = 1e4;
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
let n = t(e), r = Math.round(Number(Math.abs(n).toFixed(6)));
|
|
8
|
+
return n < 0 ? -r || 0 : r;
|
|
9
|
+
}
|
|
10
|
+
function r({ quantity: r, unitPrice: i, tax: a }) {
|
|
11
|
+
let o = n(t(r) * t(i)), s = n(o * t(a) / e);
|
|
71
12
|
return {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
statusTone: h.tone,
|
|
76
|
-
amountDueLabel: m(a.amount_due) ?? m(a.total_amount) ?? "",
|
|
77
|
-
amountPaidLabel: D ? m(a.amount_paid) : void 0,
|
|
78
|
-
paidOnLabel: D ? l.paidOnLabel(D) : void 0,
|
|
79
|
-
invoiceDateLabel: v,
|
|
80
|
-
dueDateLabel: y,
|
|
81
|
-
dueDateTone: h.isOverdue ? "danger" : "default",
|
|
82
|
-
payToItems: b,
|
|
83
|
-
invoiceItems: S,
|
|
84
|
-
lineItems: w,
|
|
85
|
-
totals: T,
|
|
86
|
-
rejection: f
|
|
13
|
+
subtotal: o,
|
|
14
|
+
taxAmount: s,
|
|
15
|
+
total: o + s
|
|
87
16
|
};
|
|
88
17
|
}
|
|
89
|
-
function o(t) {
|
|
90
|
-
return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
|
|
91
|
-
}
|
|
92
18
|
//#endregion
|
|
93
|
-
export {
|
|
19
|
+
export { e as TAX_RATE_SCALE, r as calculateLineItemTotals, n as roundToMinorUnits };
|
|
@@ -1,99 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { derivePayableStatus as t } from "./index8.js";
|
|
3
|
-
import { resolveVendor as n } from "./index9.js";
|
|
4
|
-
import { resolveAmountDueMinorUnits as r } from "./index21.js";
|
|
5
|
-
import { maskAccountNumber as i } from "./index23.js";
|
|
6
|
-
import { formatBillMoney as a } from "./index2.js";
|
|
7
|
-
import { getPaidAtLabel as o } from "./index40.js";
|
|
1
|
+
import { calculateLineItemTotals as e } from "./index40.js";
|
|
8
2
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}), x = n(s), S = v ? _ : x?.bank_account, C = S?.account_number, w = !!(S?.account_holder_name && S.routing_number && S.account_number), T = e(s.issued_at) || m.notProvided, E = e(s.due_date) || m.notProvided, D = new Map(l.map((e) => [e.value, e.label])), O = [
|
|
16
|
-
{
|
|
17
|
-
label: m.subtotalRow,
|
|
18
|
-
minorUnits: s.subtotal
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
label: m.discountRow,
|
|
22
|
-
minorUnits: s.discount
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: m.taxRow,
|
|
26
|
-
minorUnits: s.tax_amount
|
|
27
|
-
}
|
|
28
|
-
].map((e) => ({
|
|
29
|
-
label: e.label,
|
|
30
|
-
value: a(e.minorUnits, y)
|
|
31
|
-
})).filter((e) => !!e.value), k = a(s.total_amount, y);
|
|
32
|
-
k && O.push({
|
|
33
|
-
label: m.totalRow,
|
|
34
|
-
value: k,
|
|
35
|
-
emphasis: !0
|
|
36
|
-
});
|
|
37
|
-
let A = o(s);
|
|
38
|
-
return {
|
|
39
|
-
amountDue: a(r(s), y) ?? "",
|
|
40
|
-
amountPaid: A ? a(s.amount_paid, y) : void 0,
|
|
41
|
-
paidOnLabel: A ? m.paidOnLabel(A) : void 0,
|
|
42
|
-
invoiceDateLabel: T,
|
|
43
|
-
dueDateLabel: E,
|
|
44
|
-
dueDateTone: b.isOverdue ? "danger" : "default",
|
|
45
|
-
status: b.status,
|
|
46
|
-
statusTone: b.tone,
|
|
47
|
-
payTo: {
|
|
48
|
-
name: x?.name || m.notProvided,
|
|
49
|
-
email: x?.email ?? "",
|
|
50
|
-
methodLabel: w ? m.paymentInstructionsValue(C?.slice(-4) ?? "") : m.paymentInstructionsNotSet,
|
|
51
|
-
fields: w ? [
|
|
52
|
-
{
|
|
53
|
-
label: m.accountHolderFieldLabel,
|
|
54
|
-
value: S?.account_holder_name ?? ""
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
label: m.routingNumberFieldLabel,
|
|
58
|
-
value: S?.routing_number ?? ""
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
label: m.accountNumberFieldLabel,
|
|
62
|
-
value: C ?? "",
|
|
63
|
-
maskedValue: i(C ?? void 0)
|
|
64
|
-
}
|
|
65
|
-
] : []
|
|
66
|
-
},
|
|
67
|
-
invoiceFields: [
|
|
68
|
-
{
|
|
69
|
-
label: m.invoiceDateRow,
|
|
70
|
-
value: T
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
label: m.dueDateRow,
|
|
74
|
-
value: E
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: m.invoiceNumberRow,
|
|
78
|
-
value: s.document_id || m.notProvided
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
lineItems: c.map((e) => {
|
|
82
|
-
let t = a(e.unit_price, y);
|
|
83
|
-
return {
|
|
84
|
-
id: e.id,
|
|
85
|
-
description: e.name ?? e.description ?? "",
|
|
86
|
-
glCodeLabel: e.ledger_account_id ? D.get(e.ledger_account_id) ?? (u ? m.glCodeMissing : m.glCodeUnavailable) : m.glCodeMissing,
|
|
87
|
-
qtyPriceLabel: e.quantity != null && t ? m.qtyPriceValue(String(e.quantity), t) : "",
|
|
88
|
-
amount: a(e.subtotal, y) ?? ""
|
|
89
|
-
};
|
|
90
|
-
}),
|
|
91
|
-
amountRows: O,
|
|
92
|
-
approvalPolicy: p,
|
|
93
|
-
paymentHistory: f,
|
|
94
|
-
history: d,
|
|
95
|
-
rejection: g
|
|
96
|
-
};
|
|
3
|
+
function t(t) {
|
|
4
|
+
if (typeof t.subtotal == "number") return t.subtotal;
|
|
5
|
+
if (typeof t.quantity == "number" && typeof t.unit_price == "number") return e({
|
|
6
|
+
quantity: t.quantity,
|
|
7
|
+
unitPrice: t.unit_price
|
|
8
|
+
}).subtotal;
|
|
97
9
|
}
|
|
98
10
|
//#endregion
|
|
99
|
-
export {
|
|
11
|
+
export { t as resolveLineItemAmountMinorUnits };
|
|
@@ -1,6 +1,94 @@
|
|
|
1
|
+
import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
2
|
+
import { derivePayableStatus as t } from "./index8.js";
|
|
3
|
+
import { resolveVendor as n, resolveVendorName as r } from "./index9.js";
|
|
4
|
+
import { formatBillMoney as i } from "./index2.js";
|
|
5
|
+
import { resolveLineItemAmountMinorUnits as a } from "./index41.js";
|
|
1
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js
|
|
2
|
-
function
|
|
3
|
-
|
|
7
|
+
function o({ payable: o, lineItems: c, ledgerAccounts: l, labels: u, hasScheduledPayment: d, now: f, rejection: p }) {
|
|
8
|
+
let m = o.currency, h = (e) => i(e, m), g = t({
|
|
9
|
+
apiStatus: o.status,
|
|
10
|
+
dueDate: o.due_date,
|
|
11
|
+
scheduledPaymentDate: o.scheduled_payment_date,
|
|
12
|
+
hasScheduledPayment: d,
|
|
13
|
+
now: f
|
|
14
|
+
}), _ = n(o), v = r(o), y = e(o.issued_at) || u.notProvided, b = e(o.due_date) || u.notProvided, x = [{
|
|
15
|
+
label: u.vendorRow,
|
|
16
|
+
value: v || u.notProvided,
|
|
17
|
+
secondaryValue: _?.email ?? void 0
|
|
18
|
+
}], S = _?.bank_account?.account_number;
|
|
19
|
+
S && x.push({
|
|
20
|
+
label: u.bankAccountRow,
|
|
21
|
+
value: u.bankAccountValue(S.slice(-4))
|
|
22
|
+
});
|
|
23
|
+
let C = [
|
|
24
|
+
{
|
|
25
|
+
label: u.invoiceNumberRow,
|
|
26
|
+
value: o.document_id || u.notProvided
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: u.issueDateRow,
|
|
30
|
+
value: y
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: u.dueDateRow,
|
|
34
|
+
value: b
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: u.poNumberRow,
|
|
38
|
+
value: u.notProvided
|
|
39
|
+
}
|
|
40
|
+
], w = new Map(l.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), T = c.map((e) => {
|
|
41
|
+
let t = h(e.unit_price);
|
|
42
|
+
return {
|
|
43
|
+
id: e.id,
|
|
44
|
+
description: e.name ?? e.description ?? "",
|
|
45
|
+
glCodeLabel: (e.ledger_account_id ? w.get(e.ledger_account_id) : void 0) || u.glCodeMissing,
|
|
46
|
+
quantityLabel: e.quantity != null && t ? u.quantityValue(String(e.quantity), t) : "",
|
|
47
|
+
amountLabel: h(a(e)) ?? ""
|
|
48
|
+
};
|
|
49
|
+
}), E = [
|
|
50
|
+
{
|
|
51
|
+
label: u.subtotalRow,
|
|
52
|
+
value: o.subtotal
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: u.discountsRow,
|
|
56
|
+
value: o.discount
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: u.taxRow,
|
|
60
|
+
value: o.tax_amount
|
|
61
|
+
}
|
|
62
|
+
].map(({ label: e, value: t }) => ({
|
|
63
|
+
label: e,
|
|
64
|
+
value: h(t)
|
|
65
|
+
})).filter((e) => !!e.value), D = h(o.total_amount);
|
|
66
|
+
D && E.push({
|
|
67
|
+
label: u.totalRow,
|
|
68
|
+
value: D,
|
|
69
|
+
emphasis: !0
|
|
70
|
+
});
|
|
71
|
+
let O = s(o);
|
|
72
|
+
return {
|
|
73
|
+
title: v,
|
|
74
|
+
subtitle: u.subtitle,
|
|
75
|
+
status: g.status,
|
|
76
|
+
statusTone: g.tone,
|
|
77
|
+
amountDueLabel: h(o.amount_due) ?? h(o.total_amount) ?? "",
|
|
78
|
+
amountPaidLabel: O ? h(o.amount_paid) : void 0,
|
|
79
|
+
paidOnLabel: O ? u.paidOnLabel(O) : void 0,
|
|
80
|
+
invoiceDateLabel: y,
|
|
81
|
+
dueDateLabel: b,
|
|
82
|
+
dueDateTone: g.isOverdue ? "danger" : "default",
|
|
83
|
+
payToItems: x,
|
|
84
|
+
invoiceItems: C,
|
|
85
|
+
lineItems: T,
|
|
86
|
+
totals: E,
|
|
87
|
+
rejection: p
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function s(t) {
|
|
91
|
+
return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
|
|
4
92
|
}
|
|
5
93
|
//#endregion
|
|
6
|
-
export {
|
|
94
|
+
export { s as getPaidAtLabel, o as mapPayableToBillDetails };
|