@tesouro/embedded-components-react 0.9.39 → 0.9.40
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/experimental/ApprovalRequests.d.ts +2 -0
- package/dist/experimental/index.d.ts +2 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +40 -35
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/permissions.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsTable.js +28 -27
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index3.js +31 -28
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -7,54 +7,59 @@ import { useEmbedApi as t } from "../../../../../shared/data-access/dist/lib/Emb
|
|
|
7
7
|
import "../../../../../shared/data-access/dist/index.js";
|
|
8
8
|
import { useAnalyticsTrack as n } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
9
9
|
import { WidgetProvider as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
10
|
-
import { useRefetchWidget as i, useWidgetConfig as a, useWidgetError as o, useWidgetInitStaleForToken as s } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
+
import { useRefetchWidget as i, useWidgetConfig as a, useWidgetError as o, useWidgetInitStaleForToken as s, useWidgetLoading as c } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
11
11
|
import "../../../../../shared/feature/dist/index.js";
|
|
12
|
-
import { ApprovalRequestsWidgetAnalyticsEvent as
|
|
13
|
-
import { APPROVAL_REQUESTS_LIST_LABELS_EN as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { ApprovalRequestsWidgetAnalyticsEvent as l, WIDGET_NAME as u } from "../analytics/events.js";
|
|
13
|
+
import { APPROVAL_REQUESTS_LIST_LABELS_EN as d } from "./labels.js";
|
|
14
|
+
import { getApprovalRequestPermissions as f } from "./permissions.js";
|
|
15
|
+
import { useApprovalRequestsTable as p } from "./useApprovalRequestsTable.js";
|
|
16
|
+
import { ApprovalRequestsScreen as m } from "../../../../ui/dist/index3.js";
|
|
16
17
|
import "../../../../ui/dist/index.js";
|
|
17
|
-
import { useEffect as
|
|
18
|
-
import { jsx as
|
|
18
|
+
import { useEffect as h, useMemo as g } from "react";
|
|
19
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
19
20
|
//#region ../../libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js
|
|
20
|
-
function
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
let
|
|
21
|
+
function v({ screenLabels: r, listLabels: u }) {
|
|
22
|
+
let v = n();
|
|
23
|
+
h(() => {
|
|
24
|
+
v(l.Mounted);
|
|
25
|
+
}, [v]);
|
|
26
|
+
let y = g(() => ({
|
|
27
|
+
...d,
|
|
26
28
|
...u,
|
|
27
|
-
...l,
|
|
28
29
|
status: {
|
|
29
|
-
...
|
|
30
|
-
...
|
|
30
|
+
...d.status,
|
|
31
|
+
...u?.status
|
|
31
32
|
}
|
|
32
|
-
}), [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
}), [u]), { initResponse: b, widgetToken: x } = a(), S = c(), C = o(), w = s(), T = i(), { organizationStatus: E } = t(), D = g(() => f(w ? void 0 : b?.scopes), [w, b?.scopes]), O = !(!x || b || C) || S && !b || w, k = !!C && (!b || w), A = p({
|
|
34
|
+
labels: y,
|
|
35
|
+
enabled: D.canRead
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ _(m, {
|
|
38
|
+
rows: A.rows,
|
|
39
|
+
isLoading: A.isLoading || (O || e(E)) && A.rows.length === 0,
|
|
40
|
+
isError: k || A.isError,
|
|
41
|
+
isAccessRestricted: !O && !k && !D.canRead,
|
|
42
|
+
pageSize: A.pageSize,
|
|
43
|
+
onPageSizeChange: A.onPageSizeChange,
|
|
44
|
+
pageSizeOptions: A.pageSizeOptions,
|
|
45
|
+
hasNextPage: A.hasNextPage,
|
|
46
|
+
hasPrevPage: A.hasPrevPage,
|
|
47
|
+
onNextPage: A.onNextPage,
|
|
48
|
+
onPrevPage: A.onPrevPage,
|
|
49
|
+
emptyState: A.emptyState,
|
|
50
|
+
onRetry: k ? T : A.onRetry,
|
|
46
51
|
labels: r
|
|
47
52
|
});
|
|
48
53
|
}
|
|
49
|
-
function
|
|
50
|
-
return /* @__PURE__ */
|
|
54
|
+
function y({ screenLabels: e, listLabels: t, ...n }) {
|
|
55
|
+
return /* @__PURE__ */ _(r, {
|
|
51
56
|
...n,
|
|
52
|
-
widgetName:
|
|
53
|
-
children: /* @__PURE__ */
|
|
57
|
+
widgetName: u,
|
|
58
|
+
children: /* @__PURE__ */ _(v, {
|
|
54
59
|
screenLabels: e,
|
|
55
60
|
listLabels: t
|
|
56
61
|
})
|
|
57
62
|
});
|
|
58
63
|
}
|
|
59
64
|
//#endregion
|
|
60
|
-
export {
|
|
65
|
+
export { y as ApprovalRequestsWidget, y as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Scope as e } from "../../../../../shared/data-access/dist/lib/scopes.js";
|
|
2
|
+
import "../../../../../shared/data-access/dist/index.js";
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/permissions.js
|
|
4
|
+
function t(t) {
|
|
5
|
+
let n = new Set(t ?? []);
|
|
6
|
+
return { canRead: n.has(e.ApprovalRequestReadOrg) && n.has(e.PayableReadOrg) };
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as getApprovalRequestPermissions };
|
|
@@ -20,38 +20,39 @@ function c(e, t) {
|
|
|
20
20
|
description: t.emptyDescription
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function l({ labels: l }) {
|
|
24
|
-
let [
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
limit:
|
|
28
|
-
pagination_token:
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
function l({ labels: l, enabled: u = !0 }) {
|
|
24
|
+
let [d, f] = s(t[0]), [p, m] = s(), { organizationId: h } = e(), [g, _] = s(h);
|
|
25
|
+
h && h !== g && (_(h), m(void 0));
|
|
26
|
+
let v = n({
|
|
27
|
+
limit: d,
|
|
28
|
+
pagination_token: p,
|
|
29
|
+
enabled: u
|
|
30
|
+
}), y = o(() => v.data?.data ?? [], [v.data]), b = r({ items: y }), x = o(() => i(y, b, l), [
|
|
31
31
|
y,
|
|
32
|
+
b,
|
|
32
33
|
l
|
|
33
|
-
]),
|
|
34
|
-
|
|
35
|
-
}, []),
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
}, [
|
|
34
|
+
]), S = v.isPlaceholderData ? void 0 : v.data, C = S?.next_pagination_token ?? void 0, w = S?.prev_pagination_token ?? void 0, T = a((e) => {
|
|
35
|
+
f(e), m(void 0);
|
|
36
|
+
}, []), E = a(() => {
|
|
37
|
+
C && m(C);
|
|
38
|
+
}, [C]), D = a(() => {
|
|
39
|
+
w && m(w);
|
|
40
|
+
}, [w]), { refetch: O } = v, k = a(() => {
|
|
41
|
+
O();
|
|
42
|
+
}, [O]);
|
|
42
43
|
return {
|
|
43
|
-
rows:
|
|
44
|
-
isLoading:
|
|
45
|
-
isError:
|
|
46
|
-
pageSize:
|
|
44
|
+
rows: x,
|
|
45
|
+
isLoading: v.isLoading,
|
|
46
|
+
isError: v.isError,
|
|
47
|
+
pageSize: d,
|
|
47
48
|
pageSizeOptions: t,
|
|
48
|
-
onPageSizeChange:
|
|
49
|
-
hasNextPage: !!
|
|
50
|
-
hasPrevPage: !!
|
|
51
|
-
onNextPage:
|
|
52
|
-
onPrevPage:
|
|
49
|
+
onPageSizeChange: T,
|
|
50
|
+
hasNextPage: !!C,
|
|
51
|
+
hasPrevPage: !!w,
|
|
52
|
+
onNextPage: E,
|
|
53
|
+
onPrevPage: D,
|
|
53
54
|
emptyState: c(!1, l),
|
|
54
|
-
onRetry:
|
|
55
|
+
onRetry: k
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
//#endregion
|
package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js
CHANGED
|
@@ -10,7 +10,9 @@ var e = {
|
|
|
10
10
|
loadingValue: "Loading",
|
|
11
11
|
errorTitle: "Couldn't load approval requests",
|
|
12
12
|
errorDescription: "Try again.",
|
|
13
|
-
errorRetry: "Try again"
|
|
13
|
+
errorRetry: "Try again",
|
|
14
|
+
accessRestrictedTitle: "Access restricted",
|
|
15
|
+
accessRestrictedDescription: "You don't have permission to view approval requests."
|
|
14
16
|
};
|
|
15
17
|
//#endregion
|
|
16
18
|
export { e as APPROVAL_REQUESTS_SCREEN_LABELS_EN };
|
package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index3.js
CHANGED
|
@@ -15,34 +15,34 @@ function d({ name: e, loadingLabel: t }) {
|
|
|
15
15
|
children: t
|
|
16
16
|
})] }) : /* @__PURE__ */ s(o, { children: e });
|
|
17
17
|
}
|
|
18
|
-
function f({ rows: n, isLoading: o, isError: c,
|
|
19
|
-
let
|
|
18
|
+
function f({ rows: n, isLoading: o, isError: c, isAccessRestricted: f, pageSize: p, onPageSizeChange: m, pageSizeOptions: h, hasNextPage: g, hasPrevPage: _, onNextPage: v, onPrevPage: y, emptyState: b, onRetry: x, labels: S }) {
|
|
19
|
+
let C = {
|
|
20
20
|
...a,
|
|
21
|
-
...
|
|
22
|
-
},
|
|
21
|
+
...S
|
|
22
|
+
}, w = [
|
|
23
23
|
{
|
|
24
24
|
accessorKey: "invoiceNumber",
|
|
25
|
-
header:
|
|
25
|
+
header: C.columnInvoiceNumber
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
accessorKey: "vendor",
|
|
29
|
-
header:
|
|
29
|
+
header: C.columnVendor,
|
|
30
30
|
cell: ({ row: e }) => /* @__PURE__ */ s(d, {
|
|
31
31
|
name: e.original.vendor,
|
|
32
|
-
loadingLabel:
|
|
32
|
+
loadingLabel: C.loadingValue
|
|
33
33
|
})
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
accessorKey: "issueDate",
|
|
37
|
-
header:
|
|
37
|
+
header: C.columnIssueDate
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
accessorKey: "dueDate",
|
|
41
|
-
header:
|
|
41
|
+
header: C.columnDueDate
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
accessorKey: "statusLabel",
|
|
45
|
-
header:
|
|
45
|
+
header: C.columnStatus,
|
|
46
46
|
cell: ({ row: t }) => /* @__PURE__ */ s(e, {
|
|
47
47
|
tone: t.original.statusTone,
|
|
48
48
|
children: t.original.statusLabel
|
|
@@ -52,7 +52,7 @@ function f({ rows: n, isLoading: o, isError: c, pageSize: f, onPageSizeChange: p
|
|
|
52
52
|
accessorKey: "amount",
|
|
53
53
|
header: () => /* @__PURE__ */ s("div", {
|
|
54
54
|
className: "ttw:text-right",
|
|
55
|
-
children:
|
|
55
|
+
children: C.columnAmount
|
|
56
56
|
}),
|
|
57
57
|
cell: ({ row: e }) => /* @__PURE__ */ s("div", {
|
|
58
58
|
className: "ttw:text-right ttw:tabular-nums",
|
|
@@ -61,34 +61,37 @@ function f({ rows: n, isLoading: o, isError: c, pageSize: f, onPageSizeChange: p
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
accessorKey: "addedBy",
|
|
64
|
-
header:
|
|
64
|
+
header: C.columnAddedBy,
|
|
65
65
|
cell: ({ row: e }) => /* @__PURE__ */ s(d, {
|
|
66
66
|
name: e.original.addedBy,
|
|
67
|
-
loadingLabel:
|
|
67
|
+
loadingLabel: C.loadingValue
|
|
68
68
|
})
|
|
69
69
|
}
|
|
70
70
|
];
|
|
71
|
-
return
|
|
72
|
-
title:
|
|
73
|
-
description:
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
return f ? /* @__PURE__ */ s(i, {
|
|
72
|
+
title: C.accessRestrictedTitle,
|
|
73
|
+
description: C.accessRestrictedDescription
|
|
74
|
+
}) : c ? /* @__PURE__ */ s(i, {
|
|
75
|
+
title: C.errorTitle,
|
|
76
|
+
description: C.errorDescription,
|
|
77
|
+
retryLabel: x ? C.errorRetry : void 0,
|
|
78
|
+
onRetry: x
|
|
76
79
|
}) : /* @__PURE__ */ s(t, {
|
|
77
|
-
columns:
|
|
80
|
+
columns: w,
|
|
78
81
|
data: n,
|
|
79
82
|
isLoading: o,
|
|
80
83
|
sorting: l,
|
|
81
84
|
onSortingChange: u,
|
|
82
|
-
pageSize:
|
|
83
|
-
onPageSizeChange:
|
|
84
|
-
pageSizeOptions:
|
|
85
|
-
hasNextPage:
|
|
86
|
-
hasPrevPage:
|
|
87
|
-
onNextPage:
|
|
88
|
-
onPrevPage:
|
|
85
|
+
pageSize: p,
|
|
86
|
+
onPageSizeChange: m,
|
|
87
|
+
pageSizeOptions: h,
|
|
88
|
+
hasNextPage: g,
|
|
89
|
+
hasPrevPage: _,
|
|
90
|
+
onNextPage: v,
|
|
91
|
+
onPrevPage: y,
|
|
89
92
|
children: /* @__PURE__ */ s(r, {
|
|
90
|
-
title:
|
|
91
|
-
description:
|
|
93
|
+
title: b.title,
|
|
94
|
+
description: b.description
|
|
92
95
|
})
|
|
93
96
|
});
|
|
94
97
|
}
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.9.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.9.40", n = "f9977fa659d9b5a376c67729dd2762d7e065f98c", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|