@tesouro/embedded-components-react 0.9.41 → 0.9.43
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 +15 -1
- package/dist/experimental/index.d.ts +15 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index2.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index4.js +29 -2
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index5.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +45 -35
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/buildApprovalRequestRows.js +17 -14
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/canDecideApprovalRequest.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js +76 -0
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsFilters.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsTable.js +53 -44
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js +91 -58
- package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js +44 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +3432 -3332
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js
CHANGED
|
@@ -1,104 +1,137 @@
|
|
|
1
|
-
import { Badge as e,
|
|
2
|
-
import { EmptyState as
|
|
3
|
-
import { ErrorState as
|
|
1
|
+
import { Badge as e, ContextMenuItem as t, DataTable as n, DataTableRowActions as r, DropdownMenuItem as i, Skeleton as a } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { EmptyState as o } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
3
|
+
import { ErrorState as s } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
4
4
|
import "../../../shared/ui/dist/index.js";
|
|
5
|
-
import { APPROVAL_REQUESTS_SCREEN_LABELS_EN as
|
|
6
|
-
import { ApprovalRequestsFilterBar as
|
|
7
|
-
import { Fragment as
|
|
5
|
+
import { APPROVAL_REQUESTS_SCREEN_LABELS_EN as c } from "./index2.js";
|
|
6
|
+
import { ApprovalRequestsFilterBar as l } from "./index3.js";
|
|
7
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
return e === void 0 ? /* @__PURE__ */
|
|
9
|
+
var p = [], m = () => void 0;
|
|
10
|
+
function h({ name: e, loadingLabel: t }) {
|
|
11
|
+
return e === void 0 ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(a, {
|
|
12
12
|
className: "ttw:h-4 ttw:w-32",
|
|
13
13
|
"aria-hidden": !0
|
|
14
|
-
}), /* @__PURE__ */
|
|
14
|
+
}), /* @__PURE__ */ d("span", {
|
|
15
15
|
className: "ttw:sr-only",
|
|
16
16
|
children: t
|
|
17
|
-
})] }) : /* @__PURE__ */
|
|
17
|
+
})] }) : /* @__PURE__ */ d(u, { children: e });
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
...
|
|
22
|
-
...
|
|
23
|
-
},
|
|
19
|
+
function g({ rows: a, isLoading: g, isError: _, isAccessRestricted: v, pageSize: y, onPageSizeChange: b, pageSizeOptions: x, hasNextPage: S, hasPrevPage: C, onNextPage: w, onPrevPage: T, emptyState: E, filters: D, onRetry: O, onApprove: k, onReject: A, labels: j }) {
|
|
20
|
+
let M = c, { filterBar: N, ...P } = j ?? {}, F = {
|
|
21
|
+
...M,
|
|
22
|
+
...P
|
|
23
|
+
}, I = [
|
|
24
24
|
{
|
|
25
25
|
accessorKey: "invoiceNumber",
|
|
26
|
-
header:
|
|
26
|
+
header: F.columnInvoiceNumber
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
accessorKey: "vendor",
|
|
30
|
-
header:
|
|
31
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
30
|
+
header: F.columnVendor,
|
|
31
|
+
cell: ({ row: e }) => /* @__PURE__ */ d(h, {
|
|
32
32
|
name: e.original.vendor,
|
|
33
|
-
loadingLabel:
|
|
33
|
+
loadingLabel: F.loadingValue
|
|
34
34
|
})
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
accessorKey: "issueDate",
|
|
38
|
-
header:
|
|
38
|
+
header: F.columnIssueDate
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
accessorKey: "dueDate",
|
|
42
|
-
header:
|
|
42
|
+
header: F.columnDueDate
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
accessorKey: "statusLabel",
|
|
46
|
-
header:
|
|
47
|
-
cell: ({ row: t }) => /* @__PURE__ */
|
|
46
|
+
header: F.columnStatus,
|
|
47
|
+
cell: ({ row: t }) => /* @__PURE__ */ d(e, {
|
|
48
48
|
tone: t.original.statusTone,
|
|
49
49
|
children: t.original.statusLabel
|
|
50
50
|
})
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
accessorKey: "amount",
|
|
54
|
-
header: () => /* @__PURE__ */
|
|
54
|
+
header: () => /* @__PURE__ */ d("div", {
|
|
55
55
|
className: "ttw:text-right",
|
|
56
|
-
children:
|
|
56
|
+
children: F.columnAmount
|
|
57
57
|
}),
|
|
58
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
58
|
+
cell: ({ row: e }) => /* @__PURE__ */ d("div", {
|
|
59
59
|
className: "ttw:text-right ttw:tabular-nums",
|
|
60
60
|
children: e.original.amount
|
|
61
61
|
})
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
accessorKey: "addedBy",
|
|
65
|
-
header:
|
|
66
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
65
|
+
header: F.columnAddedBy,
|
|
66
|
+
cell: ({ row: e }) => /* @__PURE__ */ d(h, {
|
|
67
67
|
name: e.original.addedBy,
|
|
68
|
-
loadingLabel:
|
|
68
|
+
loadingLabel: F.loadingValue
|
|
69
69
|
})
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "actions",
|
|
73
|
+
header: () => /* @__PURE__ */ d("div", {
|
|
74
|
+
className: "ttw:text-right",
|
|
75
|
+
children: F.columnActions
|
|
76
|
+
}),
|
|
77
|
+
cell: ({ row: e }) => e.original.canDecide ? /* @__PURE__ */ d("div", {
|
|
78
|
+
className: "ttw:flex ttw:justify-end",
|
|
79
|
+
children: /* @__PURE__ */ f(r, {
|
|
80
|
+
labels: { rowActions: F.rowActions },
|
|
81
|
+
children: [/* @__PURE__ */ d(i, {
|
|
82
|
+
disabled: e.original.isDecisionPending,
|
|
83
|
+
onClick: () => k(e.original.id),
|
|
84
|
+
children: F.approve
|
|
85
|
+
}), /* @__PURE__ */ d(i, {
|
|
86
|
+
variant: "destructive",
|
|
87
|
+
disabled: e.original.isDecisionPending,
|
|
88
|
+
onClick: () => A(e.original.id),
|
|
89
|
+
children: F.reject
|
|
90
|
+
})]
|
|
91
|
+
})
|
|
92
|
+
}) : null
|
|
70
93
|
}
|
|
71
94
|
];
|
|
72
|
-
return
|
|
73
|
-
title:
|
|
74
|
-
description:
|
|
75
|
-
}) :
|
|
76
|
-
title:
|
|
77
|
-
description:
|
|
78
|
-
retryLabel:
|
|
79
|
-
onRetry:
|
|
80
|
-
}) : /* @__PURE__ */
|
|
81
|
-
columns:
|
|
82
|
-
data:
|
|
83
|
-
isLoading:
|
|
84
|
-
sorting:
|
|
85
|
-
onSortingChange:
|
|
86
|
-
pageSize:
|
|
87
|
-
onPageSizeChange:
|
|
88
|
-
pageSizeOptions:
|
|
89
|
-
hasNextPage:
|
|
90
|
-
hasPrevPage:
|
|
91
|
-
onNextPage:
|
|
92
|
-
onPrevPage:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
return v ? /* @__PURE__ */ d(s, {
|
|
96
|
+
title: F.accessRestrictedTitle,
|
|
97
|
+
description: F.accessRestrictedDescription
|
|
98
|
+
}) : _ ? /* @__PURE__ */ d(s, {
|
|
99
|
+
title: F.errorTitle,
|
|
100
|
+
description: F.errorDescription,
|
|
101
|
+
retryLabel: O ? F.errorRetry : void 0,
|
|
102
|
+
onRetry: O
|
|
103
|
+
}) : /* @__PURE__ */ d(n, {
|
|
104
|
+
columns: I,
|
|
105
|
+
data: a,
|
|
106
|
+
isLoading: g,
|
|
107
|
+
sorting: p,
|
|
108
|
+
onSortingChange: m,
|
|
109
|
+
pageSize: y,
|
|
110
|
+
onPageSizeChange: b,
|
|
111
|
+
pageSizeOptions: x,
|
|
112
|
+
hasNextPage: S,
|
|
113
|
+
hasPrevPage: C,
|
|
114
|
+
onNextPage: w,
|
|
115
|
+
onPrevPage: T,
|
|
116
|
+
rowContextMenu: (e) => e.canDecide ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(t, {
|
|
117
|
+
disabled: e.isDecisionPending,
|
|
118
|
+
onClick: () => k(e.id),
|
|
119
|
+
children: F.approve
|
|
120
|
+
}), /* @__PURE__ */ d(t, {
|
|
121
|
+
variant: "destructive",
|
|
122
|
+
disabled: e.isDecisionPending,
|
|
123
|
+
onClick: () => A(e.id),
|
|
124
|
+
children: F.reject
|
|
125
|
+
})] }) : void 0,
|
|
126
|
+
filterComponent: /* @__PURE__ */ d(l, {
|
|
127
|
+
filters: D,
|
|
128
|
+
labels: N
|
|
96
129
|
}),
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
-
title:
|
|
99
|
-
description:
|
|
130
|
+
children: /* @__PURE__ */ d(o, {
|
|
131
|
+
title: E.title,
|
|
132
|
+
description: E.description
|
|
100
133
|
})
|
|
101
134
|
});
|
|
102
135
|
}
|
|
103
136
|
//#endregion
|
|
104
|
-
export {
|
|
137
|
+
export { g as ApprovalRequestsScreen, g as default };
|
package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ConfirmDialog as e, FieldRequirement as t, Label as n, Textarea as r } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { REJECT_APPROVAL_REQUEST_DIALOG_LABELS_EN as i } from "./index2.js";
|
|
3
|
+
import { useId as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js
|
|
6
|
+
function c({ open: c, reason: l, onReasonChange: u, onConfirm: d, onCancel: f, isPending: p, isConfirmDisabled: m, labels: h }) {
|
|
7
|
+
let g = {
|
|
8
|
+
...i,
|
|
9
|
+
...h
|
|
10
|
+
}, _ = a();
|
|
11
|
+
return /* @__PURE__ */ o(e, {
|
|
12
|
+
open: c,
|
|
13
|
+
onOpenChange: (e) => {
|
|
14
|
+
e || f();
|
|
15
|
+
},
|
|
16
|
+
title: g.title,
|
|
17
|
+
description: g.description,
|
|
18
|
+
onConfirm: d,
|
|
19
|
+
destructive: !0,
|
|
20
|
+
confirmDisabled: m,
|
|
21
|
+
loading: p,
|
|
22
|
+
labels: {
|
|
23
|
+
confirm: g.confirm,
|
|
24
|
+
cancel: g.cancel,
|
|
25
|
+
close: g.close
|
|
26
|
+
},
|
|
27
|
+
children: /* @__PURE__ */ s("div", {
|
|
28
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ o(n, {
|
|
30
|
+
htmlFor: _,
|
|
31
|
+
requirement: t.Optional,
|
|
32
|
+
labels: { optionalNote: g.optionalNote },
|
|
33
|
+
children: g.reason
|
|
34
|
+
}), /* @__PURE__ */ o(r, {
|
|
35
|
+
id: _,
|
|
36
|
+
value: l,
|
|
37
|
+
onChange: (e) => u(e.target.value),
|
|
38
|
+
disabled: p
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { c as RejectApprovalRequestDialog, c as default };
|
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.43", n = "9668341fe5f04f3088135bcce7a51a576e5b6661", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|