@tesouro/embedded-components-react 0.5.230 → 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/dist/index.css +10 -0
- package/dist/index.d.ts +22 -21
- package/dist/index.js +2 -2
- package/dist/lib/ExpenseManagementWidget.d.ts +22 -21
- package/dist/lib/ExpenseManagementWidget.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/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/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/index.css
CHANGED
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
--ttw-container-sm: 24rem;
|
|
115
115
|
--ttw-container-md: 28rem;
|
|
116
116
|
--ttw-container-lg: 32rem;
|
|
117
|
+
--ttw-container-xl: 36rem;
|
|
117
118
|
--ttw-container-2xl: 42rem;
|
|
118
119
|
--ttw-container-3xl: 48rem;
|
|
119
120
|
--ttw-container-4xl: 56rem;
|
|
@@ -857,6 +858,9 @@
|
|
|
857
858
|
.ttw\:h-\[350px\] {
|
|
858
859
|
height: 350px;
|
|
859
860
|
}
|
|
861
|
+
.ttw\:h-\[480px\] {
|
|
862
|
+
height: 480px;
|
|
863
|
+
}
|
|
860
864
|
.ttw\:h-\[600px\] {
|
|
861
865
|
height: 600px;
|
|
862
866
|
}
|
|
@@ -1325,6 +1329,9 @@
|
|
|
1325
1329
|
.ttw\:w-\[300px\] {
|
|
1326
1330
|
width: 300px;
|
|
1327
1331
|
}
|
|
1332
|
+
.ttw\:w-\[360px\] {
|
|
1333
|
+
width: 360px;
|
|
1334
|
+
}
|
|
1328
1335
|
.ttw\:w-\[400px\] {
|
|
1329
1336
|
width: 400px;
|
|
1330
1337
|
}
|
|
@@ -1523,6 +1530,9 @@
|
|
|
1523
1530
|
.ttw\:max-w-sm {
|
|
1524
1531
|
max-width: var(--ttw-container-sm);
|
|
1525
1532
|
}
|
|
1533
|
+
.ttw\:max-w-xl {
|
|
1534
|
+
max-width: var(--ttw-container-xl);
|
|
1535
|
+
}
|
|
1526
1536
|
.ttw\:max-w-xs {
|
|
1527
1537
|
max-width: var(--ttw-container-xs);
|
|
1528
1538
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2975,21 +2975,6 @@ type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
|
|
|
2975
2975
|
*/
|
|
2976
2976
|
declare function DebitCardsWidget(props: DebitCardsWidgetProps): React.JSX.Element;
|
|
2977
2977
|
|
|
2978
|
-
/**
|
|
2979
|
-
* Mirrors the REST API's `ExpenseStatusEnum` (`new`, `approve_in_progress`,
|
|
2980
|
-
* `approved`, `rejected`, `canceled`). Kept as a local literal union rather
|
|
2981
|
-
* than importing the generated enum type: a `type:ui` library must not reach
|
|
2982
|
-
* into `rest/types.gen.ts`, only the caller (a feature layer) may, and then
|
|
2983
|
-
* pass the already-mapped display status down.
|
|
2984
|
-
*/
|
|
2985
|
-
type ExpenseBadgeStatus = 'new' | 'approve_in_progress' | 'approved' | 'rejected' | 'canceled';
|
|
2986
|
-
|
|
2987
|
-
type ExpenseStatusBadgeLabels = Record<ExpenseBadgeStatus, string> & {
|
|
2988
|
-
unknown: string;
|
|
2989
|
-
readyToSubmit: string;
|
|
2990
|
-
missingInfo: string;
|
|
2991
|
-
};
|
|
2992
|
-
|
|
2993
2978
|
interface ExpensesHeaderLabels {
|
|
2994
2979
|
bankingTaglinePrefix: string;
|
|
2995
2980
|
settingsButtonAriaLabel: string;
|
|
@@ -3040,6 +3025,8 @@ interface Labels$2 {
|
|
|
3040
3025
|
requirementsTab: string;
|
|
3041
3026
|
matchingTab: string;
|
|
3042
3027
|
tabCountAriaSuffix: string;
|
|
3028
|
+
/** Accessible name of the spinner shown while `isLoading`. */
|
|
3029
|
+
loading: string;
|
|
3043
3030
|
}
|
|
3044
3031
|
|
|
3045
3032
|
interface FileViewerLabels {
|
|
@@ -3091,6 +3078,10 @@ interface TransactionDetailsActionsLabels {
|
|
|
3091
3078
|
returnToExpenses: string;
|
|
3092
3079
|
cancel: string;
|
|
3093
3080
|
reject: string;
|
|
3081
|
+
/**
|
|
3082
|
+
* The primary-button pairs below are picked by the caller, which passes the
|
|
3083
|
+
* finished string in `actions`; the footer never chooses between them.
|
|
3084
|
+
*/
|
|
3094
3085
|
approve: string;
|
|
3095
3086
|
approveReviewNext: string;
|
|
3096
3087
|
confirmRejection: string;
|
|
@@ -3126,6 +3117,17 @@ interface TransactionDetailsLabels {
|
|
|
3126
3117
|
loadFailed: string;
|
|
3127
3118
|
}
|
|
3128
3119
|
|
|
3120
|
+
/**
|
|
3121
|
+
* The statuses the widget displays: the REST `ExpenseStatusEnum` minus
|
|
3122
|
+
* `deleted`, which `toExpenseDisplayStatus` folds into `canceled`.
|
|
3123
|
+
*/
|
|
3124
|
+
type ExpenseDisplayStatus = 'new' | 'approve_in_progress' | 'approved' | 'rejected' | 'canceled';
|
|
3125
|
+
type ExpenseStatusBadgeLabels = Record<ExpenseDisplayStatus, string> & {
|
|
3126
|
+
unknown: string;
|
|
3127
|
+
readyToSubmit: string;
|
|
3128
|
+
missingInfo: string;
|
|
3129
|
+
};
|
|
3130
|
+
|
|
3129
3131
|
/**
|
|
3130
3132
|
* Aggregate outcome of a receipt batch after the backend finishes OCR and
|
|
3131
3133
|
* auto-matching. `stillProcessing` counts receipts that never reached a terminal
|
|
@@ -3188,11 +3190,10 @@ type ExpenseManagementWidgetProps = WidgetProviderProps & ExpenseManagementWidge
|
|
|
3188
3190
|
* component, following the `WidgetProvider` "Feature Component Pattern" the
|
|
3189
3191
|
* same way `CustomersWidgetNative` does. Uses no Monite provider.
|
|
3190
3192
|
*
|
|
3191
|
-
*
|
|
3192
|
-
*
|
|
3193
|
-
*
|
|
3194
|
-
*
|
|
3195
|
-
* this rebuild does not yet cover.
|
|
3193
|
+
* Team tab visibility matches legacy: `ExpenseReadOrg`, or a direct-reports
|
|
3194
|
+
* probe for people-managers without org-wide read. The Team list, its count
|
|
3195
|
+
* and its Action Items share that one gate; the rows themselves are scoped by
|
|
3196
|
+
* the backend (ADR-0003), never by ids the widget collects.
|
|
3196
3197
|
*/
|
|
3197
3198
|
declare function ExpenseManagementWidget({ screenLabels, headerLabels, transactionsTableLabels, filterBarLabels, actionItemsLabels, statusBadgeLabels, transactionDetailsLabels, transactionDetailsCardLabels, transactionDetailsActionsLabels, fileViewerLabels, receiptUpload, bankDisplayName, bankLogoSrc, bankLogoAlt, isBankingTaglineVisible, onSettingsClick, ...widgetProviderProps }: ExpenseManagementWidgetProps): React.JSX.Element;
|
|
3198
3199
|
|
|
@@ -5804,4 +5805,4 @@ interface GapCoverageAlertProps {
|
|
|
5804
5805
|
type PendingFeatureStyleSources = CheckAmountAndDetailScreenProps | GapCoverageAlertProps | NoPolicyBannerProps;
|
|
5805
5806
|
|
|
5806
5807
|
export { ACCEPT_DISCLOSURES_WIDGET_LABELS_EN, ADDITIONAL_OWNERS_LABELS_EN, APPLICATION_STATUS_LABELS_EN, AcceptDisclosuresWidget, BALANCES_WIDGET_LABELS_EN, BUSINESS_DETAILS_LABELS_EN, BalancesWidget, BankAccountOnboardingWidget, BankAccountsWidget, BillPayWidget, CardDetailsWidget, CounterpartsWidget, CreditCardsWidget, CustomersWidget, DebitCardsWidget, ERROR_STATE_ID, ExpenseManagementWidget, HELP_FAQ_EN, INSIGHTS_FEATURE_LABELS_EN, INSIGHTS_WIDGET_LABELS_EN, Implementation, InsightsWidget, ReceivablesWidgetMonite as InvoicingWidget, LinkedAccountsWidget, MARKETING_WIDGET_LABELS_EN, MARKETING_WIDGET_STATUS_LABELS_EN, MarketingBenefitIcon, MarketingWidget, PERSONAL_DETAILS_LABELS_EN, ProductsWidget, RESULT_LABELS_EN, ReceivablesWidget, RefreshingRootWidgetProvider, RootWidgetProvider, SINGLE_INSIGHT_LABELS_EN, Scope, 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, isScope, registerDesignSystemEnsurer, registerUIRenderers, setGlobalWidgetConfig, subscribeToGlobalWidgetInitState, updateGlobalWidgetConfig, useDisclosuresAcceptanceSurface, useOwnWidgetConfig, useRefetchWidget, useWidgetConfig, useWidgetError, useWidgetInitStaleForToken, useWidgetLoading, useWidgetToken };
|
|
5807
|
-
export type { AcceptDisclosuresWidgetLabels, AcceptDisclosuresWidgetProps, AccordionItemCardLabels, Labels$3 as AccountDetailsWidgetLabels, ActivateCardPanelLabels, AdditionalOwner, AdditionalOwnersLabels, AddressFormSheetLabels, ApplicationStatusLabelValues, ApplicationStatusLabels, ApplicationStatusNoticeLabels, 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, CounterpartActionTarget, CounterpartDetailsSheetLabels, CounterpartFormSheetLabels, CounterpartMessageLabels, CounterpartMode, CounterpartsScreenLabels, CounterpartsWidgetProps, CreditCardsWidgetProps, CustomersWidgetOwnProps, CustomersWidgetProps, DebitCardsWidgetProps, DisclosureLinks, EmbeddedClient, Labels$2 as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps, FileViewerLabels, HelpFaqAnswer, HelpFaqBullet, HelpFaqBulletType, HelpFaqItem, HelpFaqSection, InsightsFeatureLabels, InsightsWidgetLabels, InsightsWidgetProps, ReceivablesWidgetMoniteProps as InvoicingWidgetProps, LinkComponent, LinkComponentProps, FeatureLabels$2 as LinkedAccountsWidgetFeatureLabels, Labels$1 as LinkedAccountsWidgetLabels, LinkedAccountsWidgetProps, MarketingStatusLabelValues, MarketingStatusNoticeLabels, MarketingWidgetAppearance, MarketingWidgetBenefit, MarketingWidgetContent, MarketingWidgetHowItWorksStep, MarketingWidgetImage, MarketingWidgetLabels, MarketingWidgetProps, MarketingWidgetStatusLabels, MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, PendingFeatureStyleSources, PersonalDetailsLabels, PersonalDetailsValues, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps, ReceiptMatchSummary, ReceivableActionDialogLabels, ReceivableActionsModalLabels, ReceivableDetailsPanelLabelOverrides, ReceivableDetailsPanelLabels, ReceivableDocumentType, ReceivableFormSheetLabels, ReceivableMessageLabels, ReceivablePaymentDialogLabels, ReceivableSendDialogLabels, ReceivableStatusBadgeLabels, ReceivablesScreenLabelOverrides, ReceivablesScreenLabels, ReceivablesWidgetProps, ReceivablesWidgetTab, RefreshingRootWidgetProviderProps, ResultLabels, RootWidgetProviderProps, SettingsWidgetAdditionalSection, FeatureLabels$1 as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId, SingleInsightLabels, TransactionDetailsActionsLabels, TransactionDetailsLabels, FeatureLabels as TransfersWidgetFeatureLabels, TransfersWidgetLabels, TransfersWidgetProps, UploadReceiptWidgetProps, WidgetConfig, WidgetConfigInput, WidgetInitResponse, WidgetInitState, WidgetProviderLabels, WidgetProviderProps, WidgetSuiteCardsLabels, WidgetSuiteDashboardLabels, WidgetSuiteDisclosureLabels, WidgetSuiteExpensesLabels, WidgetSuiteLabelOverrides, WidgetSuiteLabels, WidgetSuiteMenuLabels, WidgetSuiteOnboardingGateLabels, WidgetSuiteOnboardingLabels, WidgetSuiteProps, WidgetSuiteSectionContentLabels, WidgetSuiteSectionTitleLabels, WidgetTokenFetcher, WidgetTokenManager, WidgetTokenRefreshProviderProps, WidgetTokenState };
|
|
5808
|
+
export type { AcceptDisclosuresWidgetLabels, AcceptDisclosuresWidgetProps, AccordionItemCardLabels, Labels$3 as AccountDetailsWidgetLabels, ActivateCardPanelLabels, AdditionalOwner, AdditionalOwnersLabels, AddressFormSheetLabels, ApplicationStatusLabelValues, ApplicationStatusLabels, ApplicationStatusNoticeLabels, 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, CounterpartActionTarget, CounterpartDetailsSheetLabels, CounterpartFormSheetLabels, CounterpartMessageLabels, CounterpartMode, CounterpartsScreenLabels, CounterpartsWidgetProps, CreditCardsWidgetProps, CustomersWidgetOwnProps, CustomersWidgetProps, DebitCardsWidgetProps, DisclosureLinks, EmbeddedClient, Labels$2 as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps, ExpenseStatusBadgeLabels, FileViewerLabels, HelpFaqAnswer, HelpFaqBullet, HelpFaqBulletType, HelpFaqItem, HelpFaqSection, InsightsFeatureLabels, InsightsWidgetLabels, InsightsWidgetProps, ReceivablesWidgetMoniteProps as InvoicingWidgetProps, LinkComponent, LinkComponentProps, FeatureLabels$2 as LinkedAccountsWidgetFeatureLabels, Labels$1 as LinkedAccountsWidgetLabels, LinkedAccountsWidgetProps, MarketingStatusLabelValues, MarketingStatusNoticeLabels, MarketingWidgetAppearance, MarketingWidgetBenefit, MarketingWidgetContent, MarketingWidgetHowItWorksStep, MarketingWidgetImage, MarketingWidgetLabels, MarketingWidgetProps, MarketingWidgetStatusLabels, MeasureUnitDeleteDialogLabels, MeasureUnitsManagerLabels, PendingFeatureStyleSources, PersonalDetailsLabels, PersonalDetailsValues, ProductDeleteDialogLabels, ProductDetailsSheetLabels, ProductFormSheetLabels, ProductMessageLabels, ProductsScreenLabels, ProductsWidgetProps, ReceiptMatchSummary, ReceivableActionDialogLabels, ReceivableActionsModalLabels, ReceivableDetailsPanelLabelOverrides, ReceivableDetailsPanelLabels, ReceivableDocumentType, ReceivableFormSheetLabels, ReceivableMessageLabels, ReceivablePaymentDialogLabels, ReceivableSendDialogLabels, ReceivableStatusBadgeLabels, ReceivablesScreenLabelOverrides, ReceivablesScreenLabels, ReceivablesWidgetProps, ReceivablesWidgetTab, RefreshingRootWidgetProviderProps, ResultLabels, RootWidgetProviderProps, SettingsWidgetAdditionalSection, FeatureLabels$1 as SettingsWidgetFeatureLabels, Labels as SettingsWidgetLabels, SettingsWidgetProps, SettingsWidgetSection, SettingsWidgetSectionId, SingleInsightLabels, TransactionDetailsActionsLabels, TransactionDetailsLabels, FeatureLabels as TransfersWidgetFeatureLabels, TransfersWidgetLabels, TransfersWidgetProps, UploadReceiptWidgetProps, WidgetConfig, WidgetConfigInput, WidgetInitResponse, WidgetInitState, WidgetProviderLabels, WidgetProviderProps, WidgetSuiteCardsLabels, WidgetSuiteDashboardLabels, WidgetSuiteDisclosureLabels, WidgetSuiteExpensesLabels, WidgetSuiteLabelOverrides, WidgetSuiteLabels, WidgetSuiteMenuLabels, WidgetSuiteOnboardingGateLabels, WidgetSuiteOnboardingLabels, WidgetSuiteProps, WidgetSuiteSectionContentLabels, WidgetSuiteSectionTitleLabels, WidgetTokenFetcher, WidgetTokenManager, WidgetTokenRefreshProviderProps, WidgetTokenState };
|
package/dist/index.js
CHANGED
|
@@ -24,8 +24,8 @@ import { INSIGHTS_FEATURE_LABELS_EN as P } from "./libs/tesouro-embedded-compone
|
|
|
24
24
|
import { INSIGHTS_WIDGET_LABELS_EN as F } from "./libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/labels.js";
|
|
25
25
|
import { SINGLE_INSIGHT_LABELS_EN as I } from "./libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/SingleInsight/labels.js";
|
|
26
26
|
import { InsightsWidget as L } from "./libs/tesouro-embedded-components-react/insights-widget/feature/dist/index12.js";
|
|
27
|
-
import { UploadReceiptWidget as R } from "./libs/tesouro-embedded-components-react/
|
|
28
|
-
import { ExpenseManagementWidget as z } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/
|
|
27
|
+
import { UploadReceiptWidget as R } from "./libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index2.js";
|
|
28
|
+
import { ExpenseManagementWidget as z } from "./libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index19.js";
|
|
29
29
|
import { InvoicingWidget as B } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js";
|
|
30
30
|
import { ReceivablesWidget as V } from "./libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js";
|
|
31
31
|
import { SettingsSection as H } from "./libs/tesouro-embedded-components-react/settings-widget/feature/dist/index4.js";
|
|
@@ -2,21 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Mirrors the REST API's `ExpenseStatusEnum` (`new`, `approve_in_progress`,
|
|
7
|
-
* `approved`, `rejected`, `canceled`). Kept as a local literal union rather
|
|
8
|
-
* than importing the generated enum type: a `type:ui` library must not reach
|
|
9
|
-
* into `rest/types.gen.ts`, only the caller (a feature layer) may, and then
|
|
10
|
-
* pass the already-mapped display status down.
|
|
11
|
-
*/
|
|
12
|
-
type ExpenseBadgeStatus = 'new' | 'approve_in_progress' | 'approved' | 'rejected' | 'canceled';
|
|
13
|
-
|
|
14
|
-
type ExpenseStatusBadgeLabels = Record<ExpenseBadgeStatus, string> & {
|
|
15
|
-
unknown: string;
|
|
16
|
-
readyToSubmit: string;
|
|
17
|
-
missingInfo: string;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
5
|
interface ExpensesHeaderLabels {
|
|
21
6
|
bankingTaglinePrefix: string;
|
|
22
7
|
settingsButtonAriaLabel: string;
|
|
@@ -67,6 +52,8 @@ interface Labels {
|
|
|
67
52
|
requirementsTab: string;
|
|
68
53
|
matchingTab: string;
|
|
69
54
|
tabCountAriaSuffix: string;
|
|
55
|
+
/** Accessible name of the spinner shown while `isLoading`. */
|
|
56
|
+
loading: string;
|
|
70
57
|
}
|
|
71
58
|
|
|
72
59
|
interface FileViewerLabels {
|
|
@@ -118,6 +105,10 @@ interface TransactionDetailsActionsLabels {
|
|
|
118
105
|
returnToExpenses: string;
|
|
119
106
|
cancel: string;
|
|
120
107
|
reject: string;
|
|
108
|
+
/**
|
|
109
|
+
* The primary-button pairs below are picked by the caller, which passes the
|
|
110
|
+
* finished string in `actions`; the footer never chooses between them.
|
|
111
|
+
*/
|
|
121
112
|
approve: string;
|
|
122
113
|
approveReviewNext: string;
|
|
123
114
|
confirmRejection: string;
|
|
@@ -482,6 +473,17 @@ type EmbeddedClient = Client;
|
|
|
482
473
|
type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
|
|
483
474
|
type BaseUrl = ExtractLiterals<ClientOptions['baseUrl']>;
|
|
484
475
|
|
|
476
|
+
/**
|
|
477
|
+
* The statuses the widget displays: the REST `ExpenseStatusEnum` minus
|
|
478
|
+
* `deleted`, which `toExpenseDisplayStatus` folds into `canceled`.
|
|
479
|
+
*/
|
|
480
|
+
type ExpenseDisplayStatus = 'new' | 'approve_in_progress' | 'approved' | 'rejected' | 'canceled';
|
|
481
|
+
type ExpenseStatusBadgeLabels = Record<ExpenseDisplayStatus, string> & {
|
|
482
|
+
unknown: string;
|
|
483
|
+
readyToSubmit: string;
|
|
484
|
+
missingInfo: string;
|
|
485
|
+
};
|
|
486
|
+
|
|
485
487
|
type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
486
488
|
children?: ReactNode;
|
|
487
489
|
};
|
|
@@ -839,13 +841,12 @@ type ExpenseManagementWidgetProps = WidgetProviderProps & ExpenseManagementWidge
|
|
|
839
841
|
* component, following the `WidgetProvider` "Feature Component Pattern" the
|
|
840
842
|
* same way `CustomersWidgetNative` does. Uses no Monite provider.
|
|
841
843
|
*
|
|
842
|
-
*
|
|
843
|
-
*
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
* this rebuild does not yet cover.
|
|
844
|
+
* Team tab visibility matches legacy: `ExpenseReadOrg`, or a direct-reports
|
|
845
|
+
* probe for people-managers without org-wide read. The Team list, its count
|
|
846
|
+
* and its Action Items share that one gate; the rows themselves are scoped by
|
|
847
|
+
* the backend (ADR-0003), never by ids the widget collects.
|
|
847
848
|
*/
|
|
848
849
|
declare function ExpenseManagementWidget({ screenLabels, headerLabels, transactionsTableLabels, filterBarLabels, actionItemsLabels, statusBadgeLabels, transactionDetailsLabels, transactionDetailsCardLabels, transactionDetailsActionsLabels, fileViewerLabels, receiptUpload, bankDisplayName, bankLogoSrc, bankLogoAlt, isBankingTaglineVisible, onSettingsClick, ...widgetProviderProps }: ExpenseManagementWidgetProps): React.JSX.Element;
|
|
849
850
|
|
|
850
851
|
export { ExpenseManagementWidget };
|
|
851
|
-
export type { AccordionItemCardLabels, Labels as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps, FileViewerLabels, TransactionDetailsActionsLabels, TransactionDetailsLabels };
|
|
852
|
+
export type { AccordionItemCardLabels, Labels as ExpenseManagementWidgetLabels, ExpenseManagementWidgetProps, ExpenseStatusBadgeLabels, FileViewerLabels, TransactionDetailsActionsLabels, TransactionDetailsLabels };
|
|
@@ -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/index19.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js";
|
|
3
3
|
export { e as ExpenseManagementWidget };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Aggregate outcome of a receipt batch after the backend finishes OCR and
|
|
@@ -23,7 +23,7 @@ interface UploadReceiptWidgetProps {
|
|
|
23
23
|
onAwaitMatching?: (uploadedCount: number) => Promise<ReceiptMatchSummary>;
|
|
24
24
|
isUploading?: boolean;
|
|
25
25
|
}
|
|
26
|
-
declare function UploadReceiptWidget({ emailAddress, onFileUpload, onAwaitMatching, isUploading, }: UploadReceiptWidgetProps):
|
|
26
|
+
declare function UploadReceiptWidget({ emailAddress, onFileUpload, onAwaitMatching, isUploading, }: UploadReceiptWidgetProps): react.JSX.Element;
|
|
27
27
|
|
|
28
28
|
export { UploadReceiptWidget };
|
|
29
29
|
export type { ReceiptMatchSummary, UploadReceiptWidgetProps };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UploadReceiptWidget as e } from "../libs/tesouro-embedded-components-react/
|
|
2
|
-
import "../libs/tesouro-embedded-components-react/
|
|
1
|
+
import { UploadReceiptWidget as e } from "../libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index2.js";
|
|
2
|
+
import "../libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index.js";
|
|
3
3
|
export { e as UploadReceiptWidget };
|
|
@@ -2129,21 +2129,6 @@ type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc
|
|
|
2129
2129
|
*/
|
|
2130
2130
|
type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
|
|
2131
2131
|
|
|
2132
|
-
/**
|
|
2133
|
-
* Mirrors the REST API's `ExpenseStatusEnum` (`new`, `approve_in_progress`,
|
|
2134
|
-
* `approved`, `rejected`, `canceled`). Kept as a local literal union rather
|
|
2135
|
-
* than importing the generated enum type: a `type:ui` library must not reach
|
|
2136
|
-
* into `rest/types.gen.ts`, only the caller (a feature layer) may, and then
|
|
2137
|
-
* pass the already-mapped display status down.
|
|
2138
|
-
*/
|
|
2139
|
-
type ExpenseBadgeStatus = 'new' | 'approve_in_progress' | 'approved' | 'rejected' | 'canceled';
|
|
2140
|
-
|
|
2141
|
-
type ExpenseStatusBadgeLabels = Record<ExpenseBadgeStatus, string> & {
|
|
2142
|
-
unknown: string;
|
|
2143
|
-
readyToSubmit: string;
|
|
2144
|
-
missingInfo: string;
|
|
2145
|
-
};
|
|
2146
|
-
|
|
2147
2132
|
interface ExpensesHeaderLabels {
|
|
2148
2133
|
bankingTaglinePrefix: string;
|
|
2149
2134
|
settingsButtonAriaLabel: string;
|
|
@@ -2194,6 +2179,8 @@ interface Labels$2 {
|
|
|
2194
2179
|
requirementsTab: string;
|
|
2195
2180
|
matchingTab: string;
|
|
2196
2181
|
tabCountAriaSuffix: string;
|
|
2182
|
+
/** Accessible name of the spinner shown while `isLoading`. */
|
|
2183
|
+
loading: string;
|
|
2197
2184
|
}
|
|
2198
2185
|
|
|
2199
2186
|
interface FileViewerLabels {
|
|
@@ -2245,6 +2232,10 @@ interface TransactionDetailsActionsLabels {
|
|
|
2245
2232
|
returnToExpenses: string;
|
|
2246
2233
|
cancel: string;
|
|
2247
2234
|
reject: string;
|
|
2235
|
+
/**
|
|
2236
|
+
* The primary-button pairs below are picked by the caller, which passes the
|
|
2237
|
+
* finished string in `actions`; the footer never chooses between them.
|
|
2238
|
+
*/
|
|
2248
2239
|
approve: string;
|
|
2249
2240
|
approveReviewNext: string;
|
|
2250
2241
|
confirmRejection: string;
|
|
@@ -2280,6 +2271,17 @@ interface TransactionDetailsLabels {
|
|
|
2280
2271
|
loadFailed: string;
|
|
2281
2272
|
}
|
|
2282
2273
|
|
|
2274
|
+
/**
|
|
2275
|
+
* The statuses the widget displays: the REST `ExpenseStatusEnum` minus
|
|
2276
|
+
* `deleted`, which `toExpenseDisplayStatus` folds into `canceled`.
|
|
2277
|
+
*/
|
|
2278
|
+
type ExpenseDisplayStatus = 'new' | 'approve_in_progress' | 'approved' | 'rejected' | 'canceled';
|
|
2279
|
+
type ExpenseStatusBadgeLabels = Record<ExpenseDisplayStatus, string> & {
|
|
2280
|
+
unknown: string;
|
|
2281
|
+
readyToSubmit: string;
|
|
2282
|
+
missingInfo: string;
|
|
2283
|
+
};
|
|
2284
|
+
|
|
2283
2285
|
/**
|
|
2284
2286
|
* Aggregate outcome of a receipt batch after the backend finishes OCR and
|
|
2285
2287
|
* auto-matching. `stillProcessing` counts receipts that never reached a terminal
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EXPENSE_MANAGEMENT_WIDGET_NAME as e } from "../../../util/dist/lib/widgetName.js";
|
|
2
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index2.js
|
|
3
|
+
var t = `${e}.expense_approval_policies`, n = { Mounted: `${t}.mounted` };
|
|
4
|
+
//#endregion
|
|
5
|
+
export { n as ExpenseApprovalPoliciesAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useEmbedApi as e } from "
|
|
2
|
-
import "
|
|
3
|
-
import { ApprovalPolicyObjectType as t } from "
|
|
4
|
-
import { useDeleteApprovalPoliciesIdMutation as n, useGetApprovalPoliciesQuery as r, usePatchApprovalPoliciesIdMutation as i, usePostApprovalPoliciesMutation as a } from "
|
|
5
|
-
import "
|
|
6
|
-
import { AmountConditionType as o, ApprovalOutcomeType as s } from "../../ui/dist/
|
|
1
|
+
import { useEmbedApi as e } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
2
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
3
|
+
import { ApprovalPolicyObjectType as t } from "../../../../shared/approval-policy/data-access/dist/lib/queryKeys.js";
|
|
4
|
+
import { useDeleteApprovalPoliciesIdMutation as n, useGetApprovalPoliciesQuery as r, usePatchApprovalPoliciesIdMutation as i, usePostApprovalPoliciesMutation as a } from "../../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
|
|
5
|
+
import "../../../../shared/approval-policy/data-access/dist/index.js";
|
|
6
|
+
import { AmountConditionType as o, ApprovalOutcomeType as s } from "../../ui/dist/index2.js";
|
|
7
7
|
import "../../ui/dist/index.js";
|
|
8
8
|
import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
9
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/
|
|
9
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index3.js
|
|
10
10
|
var f = t.Transaction, p = "{event_name == 'submitted_for_approval'}";
|
|
11
11
|
function m(e, t, n) {
|
|
12
12
|
switch (e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index4.js
|
|
2
2
|
var e = {
|
|
3
3
|
AdminLabel: "Company admin",
|
|
4
4
|
AdminSublabel: "Any company admin can approve",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index5.js
|
|
2
2
|
var e = {
|
|
3
3
|
ruleCard: "expense-approval-rule-card",
|
|
4
4
|
ruleForm: "expense-approval-rule-form",
|
|
@@ -2,34 +2,34 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { toast as e } from "
|
|
6
|
-
import { isOrganizationOnItsWay as t } from "
|
|
7
|
-
import { useEmbedApi as n } from "
|
|
8
|
-
import { Scope as r } from "
|
|
9
|
-
import { useAllOrganizationRolesQuery as i } from "
|
|
10
|
-
import "
|
|
11
|
-
import { EmbeddedToaster as a } from "
|
|
12
|
-
import { ErrorState as o } from "
|
|
13
|
-
import "
|
|
14
|
-
import { useAnalyticsTrack as s } from "
|
|
15
|
-
import { WidgetProvider as c } from "
|
|
16
|
-
import { useWidgetConfig as
|
|
17
|
-
import "
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
5
|
+
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { isOrganizationOnItsWay as t } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
7
|
+
import { useEmbedApi as n } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { Scope as r } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
9
|
+
import { useAllOrganizationRolesQuery as i } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
10
|
+
import "../../../../shared/data-access/dist/index.js";
|
|
11
|
+
import { EmbeddedToaster as a } from "../../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
12
|
+
import { ErrorState as o } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
13
|
+
import "../../../../shared/ui/dist/index.js";
|
|
14
|
+
import { useAnalyticsTrack as s } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
15
|
+
import { WidgetProvider as c } from "../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
16
|
+
import { useWidgetConfig as l, useWidgetLoading as ee } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
17
|
+
import "../../../../shared/feature/dist/index.js";
|
|
18
|
+
import { ApproverOptionLabels as u, PermissionErrorLabels as d, ValidationErrorLabels as f } from "./index4.js";
|
|
19
|
+
import { ExpenseApprovalPoliciesAnalyticsEvent as p, WIDGET_NAME as m } from "./index2.js";
|
|
20
|
+
import { AmountConditionType as h, ApprovalOutcomeType as g } from "../../ui/dist/index2.js";
|
|
21
|
+
import { ApprovalRuleToastLabels as _ } from "../../ui/dist/index3.js";
|
|
22
|
+
import { ExpenseApprovalsPage as v } from "../../ui/dist/index8.js";
|
|
21
23
|
import "../../ui/dist/index.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { useApprovalPolicies as v } from "./index24.js";
|
|
25
|
-
import { expenseApprovalPoliciesTestIds as y } from "./index26.js";
|
|
24
|
+
import { useApprovalPolicies as te } from "./index3.js";
|
|
25
|
+
import { expenseApprovalPoliciesTestIds as y } from "./index5.js";
|
|
26
26
|
import { useEffect as b, useMemo as x, useState as S } from "react";
|
|
27
|
-
import { Fragment as
|
|
28
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/
|
|
27
|
+
import { Fragment as ne, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
28
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index6.js
|
|
29
29
|
var T = {
|
|
30
30
|
minAmount: "",
|
|
31
31
|
maxAmount: "",
|
|
32
|
-
outcome:
|
|
32
|
+
outcome: g.AutoApprove,
|
|
33
33
|
approvers: []
|
|
34
34
|
};
|
|
35
35
|
function E(e, t) {
|
|
@@ -53,18 +53,18 @@ function k(e) {
|
|
|
53
53
|
return [
|
|
54
54
|
...t ? [{
|
|
55
55
|
id: t.id,
|
|
56
|
-
label:
|
|
57
|
-
sublabel:
|
|
56
|
+
label: u.AdminLabel,
|
|
57
|
+
sublabel: u.AdminSublabel
|
|
58
58
|
}] : [],
|
|
59
59
|
{
|
|
60
60
|
id: "reporting_manager",
|
|
61
|
-
label:
|
|
62
|
-
sublabel:
|
|
61
|
+
label: u.ReportingManagerLabel,
|
|
62
|
+
sublabel: u.ReportingManagerSublabel
|
|
63
63
|
},
|
|
64
64
|
...n ? [{
|
|
65
65
|
id: n.id,
|
|
66
|
-
label:
|
|
67
|
-
sublabel:
|
|
66
|
+
label: u.CfoLabel,
|
|
67
|
+
sublabel: u.CfoSublabel
|
|
68
68
|
}] : [],
|
|
69
69
|
...r,
|
|
70
70
|
...i
|
|
@@ -72,10 +72,10 @@ function k(e) {
|
|
|
72
72
|
}
|
|
73
73
|
function A(e) {
|
|
74
74
|
let t = e.minAmount.trim() !== "", n = e.maxAmount.trim() !== "";
|
|
75
|
-
return t && n ?
|
|
75
|
+
return t && n ? h.InRange : t ? h.GreaterThanOrEqual : n ? h.LessThan : h.All;
|
|
76
76
|
}
|
|
77
77
|
function j(e) {
|
|
78
|
-
return [e.conditionType ===
|
|
78
|
+
return [e.conditionType === h.LessThan || e.conditionType === h.All ? 0 : e.minAmount ?? 0, e.conditionType === h.GreaterThanOrEqual || e.conditionType === h.All ? Infinity : e.maxAmount ?? 0];
|
|
79
79
|
}
|
|
80
80
|
function M(e) {
|
|
81
81
|
if (e.length === 0) return !1;
|
|
@@ -102,7 +102,7 @@ function N(e) {
|
|
|
102
102
|
}
|
|
103
103
|
function P(e) {
|
|
104
104
|
let t = Number(e.minAmount) || 0, n = Number(e.maxAmount) || 0, r = A(e);
|
|
105
|
-
return [r ===
|
|
105
|
+
return [r === h.LessThan || r === h.All ? 0 : t, r === h.GreaterThanOrEqual || r === h.All ? Infinity : n];
|
|
106
106
|
}
|
|
107
107
|
function F(e, t, n) {
|
|
108
108
|
let [r, i] = P(e);
|
|
@@ -113,17 +113,17 @@ function F(e, t, n) {
|
|
|
113
113
|
}
|
|
114
114
|
function I(e, t, n) {
|
|
115
115
|
let r = {}, i = e.minAmount.trim() !== "", a = e.maxAmount.trim() !== "", o = Number(e.minAmount.trim()), s = Number(e.maxAmount.trim());
|
|
116
|
-
return i && (!Number.isFinite(o) || o < 0) && (r.minAmount =
|
|
116
|
+
return i && (!Number.isFinite(o) || o < 0) && (r.minAmount = f.InvalidMinAmount), a && (!Number.isFinite(s) || s <= 0) && (r.maxAmount = f.InvalidMaxAmount), i && a && !r.minAmount && !r.maxAmount && o >= s && (r.maxAmount = f.MaxLessThanOrEqualToMin), e.outcome === g.RequireApproval && e.approvers.length === 0 && (r.approvers = f.ApproversRequired), !r.minAmount && !r.maxAmount && F(e, t, n) && (a ? r.maxAmount = f.ConflictsWithAnotherRule : r.minAmount = f.ConflictsWithAnotherRule), r;
|
|
117
117
|
}
|
|
118
118
|
function L(e, t) {
|
|
119
119
|
let n = A(t);
|
|
120
120
|
return {
|
|
121
121
|
id: e,
|
|
122
122
|
conditionType: n,
|
|
123
|
-
minAmount: n ===
|
|
124
|
-
maxAmount: n ===
|
|
123
|
+
minAmount: n === h.InRange || n === h.GreaterThanOrEqual ? Number(t.minAmount) : void 0,
|
|
124
|
+
maxAmount: n === h.LessThan || n === h.InRange ? Number(t.maxAmount) : void 0,
|
|
125
125
|
outcome: t.outcome,
|
|
126
|
-
approvers: t.outcome ===
|
|
126
|
+
approvers: t.outcome === g.RequireApproval ? t.approvers : []
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
function R(e) {
|
|
@@ -137,18 +137,18 @@ function R(e) {
|
|
|
137
137
|
function z() {
|
|
138
138
|
let c = s();
|
|
139
139
|
b(() => {
|
|
140
|
-
c(
|
|
140
|
+
c(p.Mounted);
|
|
141
141
|
}, [c]);
|
|
142
|
-
let { initResponse:
|
|
143
|
-
let e = D?.data ?? [], t = e.find((e) => e.isSystemRole === !0 && E(e.key, "admin")), n = e.find((e) => e.isSystemRole === !0 && O(e.key)), r = { reporting_manager:
|
|
144
|
-
t && (r[t.id] =
|
|
142
|
+
let { initResponse: f } = l(), m = ee(), h = t(n().organizationStatus), g = f?.scopes?.includes(r.RoleReadOrg) ?? !1, { data: D, isResolving: A, isError: j } = i({ enabled: g }), P = x(() => k(D?.data ?? []), [D]), F = x(() => {
|
|
143
|
+
let e = D?.data ?? [], t = e.find((e) => e.isSystemRole === !0 && E(e.key, "admin")), n = e.find((e) => e.isSystemRole === !0 && O(e.key)), r = { reporting_manager: u.ReportingManagerLabel };
|
|
144
|
+
t && (r[t.id] = u.AdminLabel), n && (r[n.id] = u.CfoLabel);
|
|
145
145
|
for (let t of e) r[t.id] || (r[t.id] = t.name);
|
|
146
146
|
return r;
|
|
147
|
-
}, [D]), { rules: z, isLoading: B, hasLoaded: re, saveStatus: V, createRule: ie, updateRule: H, deleteRule: U } =
|
|
147
|
+
}, [D]), { rules: z, isLoading: B, hasLoaded: re, saveStatus: V, createRule: ie, updateRule: H, deleteRule: U } = te(F), [W, G] = S(!1), [K, q] = S(T), [J, Y] = S(null), [X, Z] = S(null);
|
|
148
148
|
b(() => {
|
|
149
|
-
V === "success" && e.success(
|
|
149
|
+
V === "success" && e.success(_.Saved), V === "error" && e.error(_.FailedToSave);
|
|
150
150
|
}, [V]);
|
|
151
|
-
let Q = B ||
|
|
151
|
+
let Q = B || m && !f || h && !re, ae = M(z), oe = N(z), $ = Q || A || V === "saving", se = W ? I(K, z) : {}, ce = X && J ? I(X, z, J) : {}, le = () => {
|
|
152
152
|
G(!0), q(T);
|
|
153
153
|
}, ue = () => {
|
|
154
154
|
G(!1);
|
|
@@ -173,13 +173,13 @@ function z() {
|
|
|
173
173
|
}, _e = async (e) => {
|
|
174
174
|
await U(e), J === e && (Y(null), Z(null));
|
|
175
175
|
};
|
|
176
|
-
return
|
|
177
|
-
title:
|
|
178
|
-
description:
|
|
179
|
-
}) : j ? /* @__PURE__ */
|
|
180
|
-
title:
|
|
181
|
-
description:
|
|
182
|
-
}) : /* @__PURE__ */ ne
|
|
176
|
+
return f !== void 0 && !g ? /* @__PURE__ */ C(o, {
|
|
177
|
+
title: d.MissingRolePermissionTitle,
|
|
178
|
+
description: d.MissingRolePermissionDescription
|
|
179
|
+
}) : j ? /* @__PURE__ */ C(o, {
|
|
180
|
+
title: d.RolesUnavailableTitle,
|
|
181
|
+
description: d.RolesUnavailableDescription
|
|
182
|
+
}) : /* @__PURE__ */ w(ne, { children: [/* @__PURE__ */ C(a, {}), /* @__PURE__ */ C(v, {
|
|
183
183
|
rules: z,
|
|
184
184
|
isBusy: $,
|
|
185
185
|
isLoading: Q,
|
|
@@ -213,12 +213,12 @@ function z() {
|
|
|
213
213
|
})] });
|
|
214
214
|
}
|
|
215
215
|
function B({ token: e, orgId: t, widgetToken: n, organizationId: r, ...i } = {}) {
|
|
216
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ C(c, {
|
|
217
217
|
...i,
|
|
218
|
-
widgetName:
|
|
218
|
+
widgetName: m,
|
|
219
219
|
widgetToken: n === void 0 ? e : n,
|
|
220
220
|
organizationId: r === void 0 ? t : r,
|
|
221
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ C(z, {})
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
//#endregion
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AmountConditionType as e, ApprovalOutcomeType as t } from "./index2.js";
|
|
2
|
+
import { ApprovalRuleToastLabels as n } from "./index3.js";
|
|
3
|
+
import "./index4.js";
|
|
4
|
+
import "./index5.js";
|
|
5
|
+
import "./index6.js";
|
|
6
|
+
import "./index7.js";
|
|
7
|
+
import { ExpenseApprovalsPage as r } from "./index8.js";
|
|
8
|
+
export { e as AmountConditionType, t as ApprovalOutcomeType, n as ApprovalRuleToastLabels, r as ExpenseApprovalsPage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index2.js
|
|
2
2
|
var e = {
|
|
3
3
|
All: "all",
|
|
4
4
|
LessThan: "less_than",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js
|
|
2
2
|
var e = {
|
|
3
3
|
Title: "Expense approvals",
|
|
4
4
|
Description: "Configure who needs to approve expenses and under what conditions. A company admin can always approve a transaction even if the manager hasn't yet got to it.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index4.js
|
|
2
2
|
function e(e) {
|
|
3
3
|
return `$${e.toLocaleString(void 0, {
|
|
4
4
|
minimumFractionDigits: 0,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Button as e, Typography as t } from "
|
|
2
|
-
import { EmptyApprovalRulesLabels as n } from "./
|
|
1
|
+
import { Button as e, Typography as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { EmptyApprovalRulesLabels as n } from "./index3.js";
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { PlusIcon as a, ShieldCheck as o } from "lucide-react";
|
|
5
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js
|
|
6
6
|
var s = ({ onAddRule: s, onLearnMore: c }) => /* @__PURE__ */ i("div", {
|
|
7
7
|
className: "ttw:flex ttw:flex-col ttw:items-center ttw:py-12 ttw:gap-4 ttw:w-full ttw:max-w-[600px] ttw:mx-auto",
|
|
8
8
|
children: [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Badge as e, Button as t } from "
|
|
2
|
-
import { AmountConditionType as n, ApprovalOutcomeType as r } from "./
|
|
3
|
-
import { ApprovalRuleCardLabels as i } from "./
|
|
4
|
-
import { formatAmount as a } from "./
|
|
1
|
+
import { Badge as e, Button as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { AmountConditionType as n, ApprovalOutcomeType as r } from "./index2.js";
|
|
3
|
+
import { ApprovalRuleCardLabels as i } from "./index3.js";
|
|
4
|
+
import { formatAmount as a } from "./index4.js";
|
|
5
5
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
import { RefreshCw as l, SquarePen as u, Trash2 as d } from "lucide-react";
|
|
7
|
-
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/
|
|
7
|
+
//#region ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js
|
|
8
8
|
function f({ conditionType: e, minAmount: t, maxAmount: r }) {
|
|
9
9
|
let i = (e) => /* @__PURE__ */ s("strong", { children: a(e) });
|
|
10
10
|
switch (e) {
|