@tesouro/embedded-components-react 0.3.45 → 0.3.48
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 +30 -8
- package/dist/index.d.ts +80 -35
- package/dist/index.js +47 -45
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/CreditCardsWidget.d.ts +1347 -0
- package/dist/lib/CreditCardsWidget.js +3 -0
- package/dist/lib/{CardsWidget.d.ts → DebitCardsWidget.d.ts} +46 -27
- package/dist/lib/DebitCardsWidget.js +3 -0
- package/dist/lib/WidgetSuite.d.ts +52 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +42 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +40 -55
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +56 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +5 -73
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +72 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +47 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +91 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +33 -160
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +163 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +75 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +23 -210
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +198 -202
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +197 -88
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +105 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +47 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +26 -182
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +187 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +32 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +102 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +16 -301
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +322 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +4 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +31 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +77 -159
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +167 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +2 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +46 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +14 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +59 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -128
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +125 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +8 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +41 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +20 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +27 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +83 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +47 -250
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +240 -101
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +107 -204
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +211 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +6 -113
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +115 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +28 -27
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js +17 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js +17 -0
- 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/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js +3 -10
- package/package.json +1 -1
- package/dist/lib/CardsWidget.js +0 -3
|
@@ -1152,25 +1152,45 @@ interface CardsFeatureLabels {
|
|
|
1152
1152
|
cardType: Record<CardType, string>;
|
|
1153
1153
|
}
|
|
1154
1154
|
|
|
1155
|
-
|
|
1155
|
+
/**
|
|
1156
|
+
* What `onPaginationChange` reports. One shared type across both programs — the
|
|
1157
|
+
* shape does not vary by program, so per-program aliases would be published
|
|
1158
|
+
* surface for nothing. Named without the `Widget` segment because no widget
|
|
1159
|
+
* called `CardsWidget` is published any more; `CreditCardsWidget` and
|
|
1160
|
+
* `DebitCardsWidget` both hand back this.
|
|
1161
|
+
*/
|
|
1162
|
+
interface CardsPagination {
|
|
1156
1163
|
/** Cursor for the page on screen. Omit for the first page. */
|
|
1157
1164
|
paginationToken?: string;
|
|
1158
1165
|
/** Number of rows requested per page. */
|
|
1159
1166
|
pageSize: number;
|
|
1160
1167
|
}
|
|
1168
|
+
/**
|
|
1169
|
+
* The wider shape `pagination` / `defaultPagination` accept. Internal: a
|
|
1170
|
+
* `CardsPagination` handed back by `onPaginationChange` satisfies it, which is
|
|
1171
|
+
* the round-trip the docs describe, so the package publishes only that one.
|
|
1172
|
+
* Keeps the `CardsWidget` segment because the internal component keeps the name.
|
|
1173
|
+
*/
|
|
1161
1174
|
interface CardsWidgetPaginationInput {
|
|
1162
1175
|
paginationToken?: string;
|
|
1163
1176
|
pageSize?: number;
|
|
1164
1177
|
}
|
|
1165
1178
|
|
|
1179
|
+
/**
|
|
1180
|
+
* The internal props. Not published: `CreditCardsWidgetProps` and
|
|
1181
|
+
* `DebitCardsWidgetProps` are derived from this by omission, which is what makes
|
|
1182
|
+
* `cardProgram` an implementation detail and the debit-only create props
|
|
1183
|
+
* unreachable on a credit list.
|
|
1184
|
+
*/
|
|
1166
1185
|
interface CardsWidgetProps extends WidgetProviderProps {
|
|
1167
1186
|
/**
|
|
1168
|
-
* Which issuing program the list shows — `'credit'` or `'debit'`.
|
|
1187
|
+
* Which issuing program the list shows — `'credit'` or `'debit'`. It selects
|
|
1188
|
+
* the endpoint that is read as well as which scopes gate the affordances.
|
|
1169
1189
|
*
|
|
1170
|
-
* **Required, with no default
|
|
1171
|
-
*
|
|
1172
|
-
*
|
|
1173
|
-
*
|
|
1190
|
+
* **Required, with no default**, and supplied by the wrapper rather than by a
|
|
1191
|
+
* consumer: `CreditCardsWidget` and `DebitCardsWidget` pin it. It was a public
|
|
1192
|
+
* prop until those two exports replaced it, and a default here would silently
|
|
1193
|
+
* pick a program, where an integrator on one route only ever wants one.
|
|
1174
1194
|
*/
|
|
1175
1195
|
cardProgram: CardProgram;
|
|
1176
1196
|
/**
|
|
@@ -1188,7 +1208,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
1188
1208
|
* controls or a cursor-invalidating reset such as page-size changes. Hosts that
|
|
1189
1209
|
* persist list position should store this whole object, not the token alone.
|
|
1190
1210
|
*/
|
|
1191
|
-
onPaginationChange?: (pagination:
|
|
1211
|
+
onPaginationChange?: (pagination: CardsPagination) => void;
|
|
1192
1212
|
/**
|
|
1193
1213
|
* Overrides for the list's own copy, merged per nested group. Typed with the
|
|
1194
1214
|
* `ui` lib's own deep-partial helper (each labels module declares one — the
|
|
@@ -1297,28 +1317,27 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
1297
1317
|
*/
|
|
1298
1318
|
onActivateCard?: (cardId: string) => void;
|
|
1299
1319
|
}
|
|
1320
|
+
|
|
1300
1321
|
/**
|
|
1301
|
-
*
|
|
1302
|
-
*
|
|
1303
|
-
*
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
*
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1322
|
+
* Derived from the internal props rather than restated, so the two cannot drift.
|
|
1323
|
+
* Only `cardProgram` is omitted — the built-in create sheet is debit's, so this
|
|
1324
|
+
* export keeps `cardArtSrc` and the two create-panel label props.
|
|
1325
|
+
*/
|
|
1326
|
+
type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
|
|
1327
|
+
/**
|
|
1328
|
+
* One page of an organization's **debit** cards, with scope-gated Show my cards,
|
|
1329
|
+
* Create card and per-row Activate affordances. Selecting a row opens that
|
|
1330
|
+
* card's read-only details in a sheet.
|
|
1310
1331
|
*
|
|
1311
|
-
*
|
|
1312
|
-
*
|
|
1313
|
-
* gesture
|
|
1314
|
-
*
|
|
1315
|
-
* new debit card so its details open.
|
|
1332
|
+
* With `cardArtSrc`, Create card opens the same sheet with the built-in
|
|
1333
|
+
* `CreateCardWidget` issuance flow; a host `onCreateCard` still takes the
|
|
1334
|
+
* gesture over. Credit is {@link CreditCardsWidget}, which accepts neither
|
|
1335
|
+
* `cardArtSrc` nor the create-panel labels.
|
|
1316
1336
|
*
|
|
1317
|
-
*
|
|
1318
|
-
*
|
|
1319
|
-
* their client, org and token from.
|
|
1337
|
+
* The program is pinned *after* the spread, so a JavaScript host still passing
|
|
1338
|
+
* the retired `cardProgram` cannot point this export at the credit endpoint.
|
|
1320
1339
|
*/
|
|
1321
|
-
declare function
|
|
1340
|
+
declare function DebitCardsWidget(props: DebitCardsWidgetProps): React.JSX.Element;
|
|
1322
1341
|
|
|
1323
|
-
export {
|
|
1324
|
-
export type {
|
|
1342
|
+
export { DebitCardsWidget };
|
|
1343
|
+
export type { DebitCardsWidgetProps };
|
|
@@ -1321,25 +1321,45 @@ interface CardsFeatureLabels {
|
|
|
1321
1321
|
cardType: Record<CardType, string>;
|
|
1322
1322
|
}
|
|
1323
1323
|
|
|
1324
|
-
|
|
1324
|
+
/**
|
|
1325
|
+
* What `onPaginationChange` reports. One shared type across both programs — the
|
|
1326
|
+
* shape does not vary by program, so per-program aliases would be published
|
|
1327
|
+
* surface for nothing. Named without the `Widget` segment because no widget
|
|
1328
|
+
* called `CardsWidget` is published any more; `CreditCardsWidget` and
|
|
1329
|
+
* `DebitCardsWidget` both hand back this.
|
|
1330
|
+
*/
|
|
1331
|
+
interface CardsPagination {
|
|
1325
1332
|
/** Cursor for the page on screen. Omit for the first page. */
|
|
1326
1333
|
paginationToken?: string;
|
|
1327
1334
|
/** Number of rows requested per page. */
|
|
1328
1335
|
pageSize: number;
|
|
1329
1336
|
}
|
|
1337
|
+
/**
|
|
1338
|
+
* The wider shape `pagination` / `defaultPagination` accept. Internal: a
|
|
1339
|
+
* `CardsPagination` handed back by `onPaginationChange` satisfies it, which is
|
|
1340
|
+
* the round-trip the docs describe, so the package publishes only that one.
|
|
1341
|
+
* Keeps the `CardsWidget` segment because the internal component keeps the name.
|
|
1342
|
+
*/
|
|
1330
1343
|
interface CardsWidgetPaginationInput {
|
|
1331
1344
|
paginationToken?: string;
|
|
1332
1345
|
pageSize?: number;
|
|
1333
1346
|
}
|
|
1334
1347
|
|
|
1348
|
+
/**
|
|
1349
|
+
* The internal props. Not published: `CreditCardsWidgetProps` and
|
|
1350
|
+
* `DebitCardsWidgetProps` are derived from this by omission, which is what makes
|
|
1351
|
+
* `cardProgram` an implementation detail and the debit-only create props
|
|
1352
|
+
* unreachable on a credit list.
|
|
1353
|
+
*/
|
|
1335
1354
|
interface CardsWidgetProps extends WidgetProviderProps {
|
|
1336
1355
|
/**
|
|
1337
|
-
* Which issuing program the list shows — `'credit'` or `'debit'`.
|
|
1356
|
+
* Which issuing program the list shows — `'credit'` or `'debit'`. It selects
|
|
1357
|
+
* the endpoint that is read as well as which scopes gate the affordances.
|
|
1338
1358
|
*
|
|
1339
|
-
* **Required, with no default
|
|
1340
|
-
*
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1359
|
+
* **Required, with no default**, and supplied by the wrapper rather than by a
|
|
1360
|
+
* consumer: `CreditCardsWidget` and `DebitCardsWidget` pin it. It was a public
|
|
1361
|
+
* prop until those two exports replaced it, and a default here would silently
|
|
1362
|
+
* pick a program, where an integrator on one route only ever wants one.
|
|
1343
1363
|
*/
|
|
1344
1364
|
cardProgram: CardProgram;
|
|
1345
1365
|
/**
|
|
@@ -1357,7 +1377,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
1357
1377
|
* controls or a cursor-invalidating reset such as page-size changes. Hosts that
|
|
1358
1378
|
* persist list position should store this whole object, not the token alone.
|
|
1359
1379
|
*/
|
|
1360
|
-
onPaginationChange?: (pagination:
|
|
1380
|
+
onPaginationChange?: (pagination: CardsPagination) => void;
|
|
1361
1381
|
/**
|
|
1362
1382
|
* Overrides for the list's own copy, merged per nested group. Typed with the
|
|
1363
1383
|
* `ui` lib's own deep-partial helper (each labels module declares one — the
|
|
@@ -1467,6 +1487,24 @@ interface CardsWidgetProps extends WidgetProviderProps {
|
|
|
1467
1487
|
onActivateCard?: (cardId: string) => void;
|
|
1468
1488
|
}
|
|
1469
1489
|
|
|
1490
|
+
/**
|
|
1491
|
+
* Derived from the internal props rather than restated, so the two cannot drift.
|
|
1492
|
+
*
|
|
1493
|
+
* Four omissions, not one. `cardProgram` is pinned below. The three create-sheet
|
|
1494
|
+
* props are debit-only: the built-in sheet issues against `POST /credit-cards`'s
|
|
1495
|
+
* sibling and `CreateCardWidget` covers debit alone, so credit's Create card
|
|
1496
|
+
* needs a host `onCreateCard` or the button hides. That was prose in the doc; the
|
|
1497
|
+
* type says it here.
|
|
1498
|
+
*/
|
|
1499
|
+
type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels'>;
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* Derived from the internal props rather than restated, so the two cannot drift.
|
|
1503
|
+
* Only `cardProgram` is omitted — the built-in create sheet is debit's, so this
|
|
1504
|
+
* export keeps `cardArtSrc` and the two create-panel label props.
|
|
1505
|
+
*/
|
|
1506
|
+
type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
|
|
1507
|
+
|
|
1470
1508
|
interface InsightsWidgetLabels {
|
|
1471
1509
|
widgetTitle: string;
|
|
1472
1510
|
activeTab: string;
|
|
@@ -1891,15 +1929,16 @@ interface WidgetSuiteDisclosureLabels {
|
|
|
1891
1929
|
* A widget's whole copy surface: every label prop it accepts, spread onto it so
|
|
1892
1930
|
* the props keep the names that widget's own doc gives them.
|
|
1893
1931
|
*
|
|
1894
|
-
* Derived rather than hand-listed:
|
|
1895
|
-
* list goes stale the next time one grows a panel. `providerLabels`
|
|
1896
|
-
* because the suite addresses the provider once, at the top level.
|
|
1932
|
+
* Derived rather than hand-listed: the debit card list alone has six, so a
|
|
1933
|
+
* written-out list goes stale the next time one grows a panel. `providerLabels`
|
|
1934
|
+
* is excluded because the suite addresses the provider once, at the top level.
|
|
1897
1935
|
*/
|
|
1898
1936
|
type WidgetLabelProps<T> = Omit<Pick<T, Extract<keyof T, 'labels' | `${string}Labels`>>, 'providerLabels'>;
|
|
1899
1937
|
type WidgetSuiteBalancesLabels = WidgetLabelProps<BalancesWidgetProps>;
|
|
1900
1938
|
type WidgetSuiteInsightsLabels = WidgetLabelProps<InsightsWidgetProps>;
|
|
1901
1939
|
type WidgetSuiteAccountsLabels = WidgetLabelProps<BankAccountsWidgetProps>;
|
|
1902
|
-
type
|
|
1940
|
+
type WidgetSuiteCreditCardsLabels = WidgetLabelProps<CreditCardsWidgetProps>;
|
|
1941
|
+
type WidgetSuiteDebitCardsLabels = WidgetLabelProps<DebitCardsWidgetProps>;
|
|
1903
1942
|
type WidgetSuiteTransfersLabels = WidgetLabelProps<TransfersWidgetProps>;
|
|
1904
1943
|
type WidgetSuiteSettingsLabels = WidgetLabelProps<SettingsWidgetProps>;
|
|
1905
1944
|
/** The two widgets the Dashboard section pairs, each taking its own copy. */
|
|
@@ -1915,8 +1954,8 @@ interface WidgetSuiteDashboardLabels {
|
|
|
1915
1954
|
* each is retitled by program.
|
|
1916
1955
|
*/
|
|
1917
1956
|
interface WidgetSuiteCardsLabels {
|
|
1918
|
-
creditCards:
|
|
1919
|
-
debitCards:
|
|
1957
|
+
creditCards: WidgetSuiteCreditCardsLabels;
|
|
1958
|
+
debitCards: WidgetSuiteDebitCardsLabels;
|
|
1920
1959
|
}
|
|
1921
1960
|
/** Expenses is only a placeholder until the suite wires a read/self surface. */
|
|
1922
1961
|
interface WidgetSuiteExpensesLabels {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import "./index13.js";
|
|
2
2
|
import "./index14.js";
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./index44.js";
|
|
3
|
+
import "./index26.js";
|
|
4
|
+
import "./index32.js";
|
|
5
|
+
import "./index41.js";
|
|
6
|
+
import "./index43.js";
|
|
8
7
|
import "./index45.js";
|
|
9
8
|
import "./index46.js";
|
|
10
9
|
import "./index47.js";
|
|
11
10
|
import "./index48.js";
|
|
12
11
|
import "./index49.js";
|
|
13
|
-
import "./
|
|
12
|
+
import "./index50.js";
|
|
14
13
|
import "./index54.js";
|
|
15
14
|
import "./index55.js";
|
|
16
15
|
import "./index56.js";
|
|
@@ -19,9 +18,10 @@ import "./index58.js";
|
|
|
19
18
|
import "./index59.js";
|
|
20
19
|
import "./index60.js";
|
|
21
20
|
import "./index61.js";
|
|
22
|
-
import "./
|
|
23
|
-
import "./
|
|
21
|
+
import "./index62.js";
|
|
22
|
+
import "./index64.js";
|
|
24
23
|
import "./index70.js";
|
|
25
24
|
import "./index71.js";
|
|
26
|
-
import
|
|
25
|
+
import "./index72.js";
|
|
26
|
+
import { BillPayWidget as e } from "./index76.js";
|
|
27
27
|
export { e as BillPayWidget };
|
|
@@ -13,10 +13,10 @@ import { getBillDetailActions as l } from "./index21.js";
|
|
|
13
13
|
import { useState as u } from "react";
|
|
14
14
|
import { HandIcon as d } from "lucide-react";
|
|
15
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
|
|
16
|
-
function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyApprover: _, hasWaitingRequest: v, arePendingApproversUnknown: y, hasScheduledPayment: b, scheduledPaymentIntentId: x, isScheduledPaymentUnknown: S, labels: C, isMarkAsPaidPending: w, pendingApprovers: T, onPayBillSelect: E, onMarkAsPaidSelect: D }) {
|
|
17
|
-
let { initResponse:
|
|
16
|
+
function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyApprover: _, hasWaitingRequest: v, arePendingApproversUnknown: y, hasScheduledPayment: b, scheduledPaymentIntentId: x, isScheduledPaymentUnknown: S, labels: C, isMarkAsPaidPending: w, pendingApprovers: T, onPayBillSelect: E, onMarkAsPaidSelect: D, onActionSucceeded: O }) {
|
|
17
|
+
let { initResponse: k } = t(), A = r(), j = n(), M = i(), N = a(), P = c(), F = o(), I = s(), L = w || A.isPending || j.isPending || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending, [R, z] = u(), B = R && (R.id !== "cancelScheduledPayment" || R.scheduledPaymentIntentId === x) ? R : void 0, V = d && f ? l({
|
|
18
18
|
status: f,
|
|
19
|
-
scopes:
|
|
19
|
+
scopes: k?.scopes,
|
|
20
20
|
canDecideApprovalRequest: !!m,
|
|
21
21
|
isPolicyApprover: _,
|
|
22
22
|
hasWaitingRequest: v,
|
|
@@ -24,53 +24,55 @@ function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyAppro
|
|
|
24
24
|
hasScheduledPayment: b || S,
|
|
25
25
|
scheduledPaymentIntentId: x,
|
|
26
26
|
labels: C
|
|
27
|
-
}) : [],
|
|
27
|
+
}) : [], H = (t) => ({
|
|
28
28
|
onError: () => e.error(C.actionError),
|
|
29
|
-
onSuccess: () =>
|
|
30
|
-
|
|
29
|
+
onSuccess: () => {
|
|
30
|
+
e.success(C.actionSuccess[t]), O?.();
|
|
31
|
+
}
|
|
32
|
+
}), U = {
|
|
31
33
|
reject: {
|
|
32
|
-
isPending:
|
|
33
|
-
run: (e) => m &&
|
|
34
|
+
isPending: A.isPending,
|
|
35
|
+
run: (e) => m && A.mutate({
|
|
34
36
|
path: { approval_request_id: m },
|
|
35
37
|
body: e ? { reject_reason: e } : void 0
|
|
36
|
-
},
|
|
38
|
+
}, H("reject"))
|
|
37
39
|
},
|
|
38
40
|
approve: {
|
|
39
|
-
isPending:
|
|
40
|
-
run: () => m &&
|
|
41
|
+
isPending: j.isPending,
|
|
42
|
+
run: () => m && j.mutate({ path: { approval_request_id: m } }, H("approve"))
|
|
41
43
|
},
|
|
42
44
|
cancel: {
|
|
43
|
-
isPending:
|
|
44
|
-
run: () => d &&
|
|
45
|
+
isPending: M.isPending,
|
|
46
|
+
run: () => d && M.mutate({ path: { payable_id: d } }, H("cancel"))
|
|
45
47
|
},
|
|
46
48
|
cancelScheduledPayment: {
|
|
47
|
-
isPending:
|
|
49
|
+
isPending: N.isPending,
|
|
48
50
|
run: () => {
|
|
49
|
-
let e =
|
|
50
|
-
!d || !e ||
|
|
51
|
+
let e = B?.scheduledPaymentIntentId;
|
|
52
|
+
!d || !e || N.mutate({
|
|
51
53
|
path: { payment_intent_id: e },
|
|
52
54
|
payableId: d
|
|
53
|
-
},
|
|
55
|
+
}, H("cancelScheduledPayment"));
|
|
54
56
|
}
|
|
55
57
|
},
|
|
56
58
|
reopen: {
|
|
57
|
-
isPending:
|
|
58
|
-
run: () => d &&
|
|
59
|
+
isPending: P.isPending,
|
|
60
|
+
run: () => d && P.mutate({ path: { payable_id: d } }, H("reopen"))
|
|
59
61
|
},
|
|
60
62
|
forceApprove: {
|
|
61
|
-
isPending:
|
|
62
|
-
run: () => d &&
|
|
63
|
+
isPending: F.isPending,
|
|
64
|
+
run: () => d && F.mutate({ path: { payable_id: d } }, H("forceApprove"))
|
|
63
65
|
},
|
|
64
66
|
forceReject: {
|
|
65
|
-
isPending:
|
|
66
|
-
run: () => d &&
|
|
67
|
+
isPending: I.isPending,
|
|
68
|
+
run: () => d && I.mutate({ path: { payable_id: d } }, H("forceReject"))
|
|
67
69
|
}
|
|
68
|
-
},
|
|
70
|
+
}, W = V.map((e) => ({
|
|
69
71
|
...e,
|
|
70
|
-
disabled:
|
|
71
|
-
loading: e.id === "markAsPaid" ? w :
|
|
72
|
+
disabled: L,
|
|
73
|
+
loading: e.id === "markAsPaid" ? w : U[e.id]?.isPending ?? !1,
|
|
72
74
|
onSelect: () => {
|
|
73
|
-
if (!(
|
|
75
|
+
if (!(L || !d)) {
|
|
74
76
|
if (e.id === "payBill") {
|
|
75
77
|
E();
|
|
76
78
|
return;
|
|
@@ -80,34 +82,35 @@ function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyAppro
|
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
84
|
if (h(e.id)) {
|
|
83
|
-
|
|
85
|
+
z({
|
|
84
86
|
id: e.id,
|
|
85
87
|
scheduledPaymentIntentId: x
|
|
86
88
|
});
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
U[e.id]?.run();
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
}));
|
|
93
95
|
return {
|
|
96
|
+
isActionPending: L,
|
|
94
97
|
actions: {
|
|
95
|
-
row:
|
|
96
|
-
menu:
|
|
98
|
+
row: W.filter((e) => e.surface === "row"),
|
|
99
|
+
menu: W.filter((e) => e.surface === "menu")
|
|
97
100
|
},
|
|
98
101
|
decisionDialog: {
|
|
99
|
-
open: !!
|
|
100
|
-
copy:
|
|
101
|
-
...C.decisionDialog[
|
|
102
|
-
presentation: g(
|
|
103
|
-
pendingApprovers: g(
|
|
102
|
+
open: !!B,
|
|
103
|
+
copy: B ? {
|
|
104
|
+
...C.decisionDialog[B.id],
|
|
105
|
+
presentation: g(B.id) ? p : void 0,
|
|
106
|
+
pendingApprovers: g(B.id) ? T ?? [] : void 0
|
|
104
107
|
} : void 0,
|
|
105
|
-
isPending:
|
|
108
|
+
isPending: B ? U[B.id]?.isPending ?? !1 : !1,
|
|
106
109
|
onCancel: () => {
|
|
107
|
-
|
|
110
|
+
L || z(void 0);
|
|
108
111
|
},
|
|
109
112
|
onConfirm: (e) => {
|
|
110
|
-
!
|
|
113
|
+
!B || L || (U[B.id]?.run(e), z(void 0));
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
};
|
|
@@ -1,44 +1,7 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
-
import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
-
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import "../../../shared/ui/dist/index.js";
|
|
10
|
-
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
-
import "../../../shared/feature/dist/index.js";
|
|
12
|
-
import { useDeletePayableMutation as i } from "../../data-access/dist/index11.js";
|
|
13
|
-
import "../../data-access/dist/index.js";
|
|
14
|
-
import { useState as a } from "react";
|
|
15
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
label: l.menuItem,
|
|
20
|
-
destructive: !0,
|
|
21
|
-
onSelect: () => m(!0)
|
|
22
|
-
}] : [], v = p && g;
|
|
23
|
-
return {
|
|
24
|
-
menuItems: _,
|
|
25
|
-
dialog: {
|
|
26
|
-
open: v,
|
|
27
|
-
copy: v ? l.dialog : void 0,
|
|
28
|
-
isPending: f.isPending,
|
|
29
|
-
onCancel: () => {
|
|
30
|
-
f.isPending || m(!1);
|
|
31
|
-
},
|
|
32
|
-
onConfirm: () => {
|
|
33
|
-
!g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
|
|
34
|
-
onError: () => e.error(l.error),
|
|
35
|
-
onSuccess: () => {
|
|
36
|
-
m(!1), u();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
2
|
+
var e = /* @__PURE__ */ new Set(["draft", "new"]);
|
|
3
|
+
function t(t) {
|
|
4
|
+
return !!(t && e.has(t));
|
|
42
5
|
}
|
|
43
6
|
//#endregion
|
|
44
|
-
export {
|
|
7
|
+
export { t as isEditablePayableStatus };
|
|
@@ -1,59 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import "../../../shared/ui/dist/index.js";
|
|
10
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
|
+
import "../../../shared/feature/dist/index.js";
|
|
12
|
+
import { useDeletePayableMutation as i } from "../../data-access/dist/index11.js";
|
|
13
|
+
import "../../data-access/dist/index.js";
|
|
14
|
+
import { useState as a } from "react";
|
|
1
15
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
|
|
17
|
+
let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
|
|
18
|
+
id: "deleteDraft",
|
|
19
|
+
label: l.menuItem,
|
|
20
|
+
destructive: !0,
|
|
21
|
+
onSelect: () => m(!0)
|
|
22
|
+
}] : [], v = p && g;
|
|
23
|
+
return {
|
|
24
|
+
menuItems: _,
|
|
25
|
+
dialog: {
|
|
26
|
+
open: v,
|
|
27
|
+
copy: v ? l.dialog : void 0,
|
|
28
|
+
isPending: f.isPending,
|
|
29
|
+
onCancel: () => {
|
|
30
|
+
f.isPending || m(!1);
|
|
31
|
+
},
|
|
32
|
+
onConfirm: () => {
|
|
33
|
+
!g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
|
|
34
|
+
onError: () => e.error(l.error),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
m(!1), u();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
17
41
|
};
|
|
18
|
-
let s = !!(e.has(n) && r && t(r, o));
|
|
19
|
-
switch (n) {
|
|
20
|
-
case "draft": return {
|
|
21
|
-
status: "draft",
|
|
22
|
-
tone: "neutral",
|
|
23
|
-
isOverdue: s
|
|
24
|
-
};
|
|
25
|
-
case "new":
|
|
26
|
-
case "approve_in_progress": return {
|
|
27
|
-
status: "pending_approval",
|
|
28
|
-
tone: "warning",
|
|
29
|
-
isOverdue: s
|
|
30
|
-
};
|
|
31
|
-
case "waiting_to_be_paid": return {
|
|
32
|
-
status: "ready_to_pay",
|
|
33
|
-
tone: "info",
|
|
34
|
-
isOverdue: s
|
|
35
|
-
};
|
|
36
|
-
case "partially_paid": return {
|
|
37
|
-
status: "partially_paid",
|
|
38
|
-
tone: "success",
|
|
39
|
-
isOverdue: s
|
|
40
|
-
};
|
|
41
|
-
case "paid": return {
|
|
42
|
-
status: "paid",
|
|
43
|
-
tone: "success",
|
|
44
|
-
isOverdue: s
|
|
45
|
-
};
|
|
46
|
-
case "canceled": return {
|
|
47
|
-
status: "canceled",
|
|
48
|
-
tone: "muted",
|
|
49
|
-
isOverdue: s
|
|
50
|
-
};
|
|
51
|
-
case "rejected": return {
|
|
52
|
-
status: "rejected",
|
|
53
|
-
tone: "danger",
|
|
54
|
-
isOverdue: s
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
42
|
}
|
|
58
43
|
//#endregion
|
|
59
|
-
export {
|
|
44
|
+
export { o as useDraftDelete };
|
|
@@ -1,8 +1,59 @@
|
|
|
1
|
-
import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
2
|
-
import "../../data-access/dist/index.js";
|
|
3
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var e = /* @__PURE__ */ new Set([
|
|
3
|
+
"new",
|
|
4
|
+
"approve_in_progress",
|
|
5
|
+
"waiting_to_be_paid",
|
|
6
|
+
"partially_paid"
|
|
7
|
+
]);
|
|
8
|
+
function t(e, t) {
|
|
9
|
+
let n = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`), r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
|
|
10
|
+
return n.getTime() < r;
|
|
11
|
+
}
|
|
12
|
+
function n({ apiStatus: n, dueDate: r, scheduledPaymentDate: i, hasScheduledPayment: a = !!i, now: o = /* @__PURE__ */ new Date() }) {
|
|
13
|
+
if (e.has(n) && a) return {
|
|
14
|
+
status: "scheduled",
|
|
15
|
+
tone: "accent",
|
|
16
|
+
isOverdue: !1
|
|
17
|
+
};
|
|
18
|
+
let s = !!(e.has(n) && r && t(r, o));
|
|
19
|
+
switch (n) {
|
|
20
|
+
case "draft": return {
|
|
21
|
+
status: "draft",
|
|
22
|
+
tone: "neutral",
|
|
23
|
+
isOverdue: s
|
|
24
|
+
};
|
|
25
|
+
case "new":
|
|
26
|
+
case "approve_in_progress": return {
|
|
27
|
+
status: "pending_approval",
|
|
28
|
+
tone: "warning",
|
|
29
|
+
isOverdue: s
|
|
30
|
+
};
|
|
31
|
+
case "waiting_to_be_paid": return {
|
|
32
|
+
status: "ready_to_pay",
|
|
33
|
+
tone: "info",
|
|
34
|
+
isOverdue: s
|
|
35
|
+
};
|
|
36
|
+
case "partially_paid": return {
|
|
37
|
+
status: "partially_paid",
|
|
38
|
+
tone: "success",
|
|
39
|
+
isOverdue: s
|
|
40
|
+
};
|
|
41
|
+
case "paid": return {
|
|
42
|
+
status: "paid",
|
|
43
|
+
tone: "success",
|
|
44
|
+
isOverdue: s
|
|
45
|
+
};
|
|
46
|
+
case "canceled": return {
|
|
47
|
+
status: "canceled",
|
|
48
|
+
tone: "muted",
|
|
49
|
+
isOverdue: s
|
|
50
|
+
};
|
|
51
|
+
case "rejected": return {
|
|
52
|
+
status: "rejected",
|
|
53
|
+
tone: "danger",
|
|
54
|
+
isOverdue: s
|
|
55
|
+
};
|
|
56
|
+
}
|
|
6
57
|
}
|
|
7
58
|
//#endregion
|
|
8
|
-
export {
|
|
59
|
+
export { n as derivePayableStatus };
|