@tesouro/embedded-components-react 0.9.40 → 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.
Files changed (23) hide show
  1. package/dist/experimental/ApprovalRequests.d.ts +57 -2
  2. package/dist/experimental/index.d.ts +57 -2
  3. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index.js +5 -5
  4. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index2.js +9 -0
  5. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index4.js +29 -2
  6. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index5.js +30 -2
  7. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/data-access/dist/index6.js +22 -1
  8. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/ApprovalRequestsWidget.js +49 -34
  9. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/buildApprovalRequestRows.js +17 -14
  10. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/canDecideApprovalRequest.js +8 -0
  11. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/constants.js +7 -2
  12. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/labels.js +7 -0
  13. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestDecisions.js +76 -0
  14. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsFilters.js +149 -0
  15. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/feature/dist/lib/ApprovalRequestsWidget/useApprovalRequestsTable.js +53 -38
  16. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index.js +4 -2
  17. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index2.js +32 -2
  18. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index3.js +136 -92
  19. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js +137 -0
  20. package/dist/libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index5.js +44 -0
  21. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  22. package/dist/packages/shared-ui-shadcn/dist/index.js +3432 -3332
  23. package/package.json +1 -1
@@ -0,0 +1,137 @@
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
+ import "../../../shared/ui/dist/index.js";
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
+ //#region ../../libs/tesouro-embedded-components-react/approval-requests-widget/ui/dist/index4.js
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
+ className: "ttw:h-4 ttw:w-32",
13
+ "aria-hidden": !0
14
+ }), /* @__PURE__ */ d("span", {
15
+ className: "ttw:sr-only",
16
+ children: t
17
+ })] }) : /* @__PURE__ */ d(u, { children: e });
18
+ }
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
+ {
25
+ accessorKey: "invoiceNumber",
26
+ header: F.columnInvoiceNumber
27
+ },
28
+ {
29
+ accessorKey: "vendor",
30
+ header: F.columnVendor,
31
+ cell: ({ row: e }) => /* @__PURE__ */ d(h, {
32
+ name: e.original.vendor,
33
+ loadingLabel: F.loadingValue
34
+ })
35
+ },
36
+ {
37
+ accessorKey: "issueDate",
38
+ header: F.columnIssueDate
39
+ },
40
+ {
41
+ accessorKey: "dueDate",
42
+ header: F.columnDueDate
43
+ },
44
+ {
45
+ accessorKey: "statusLabel",
46
+ header: F.columnStatus,
47
+ cell: ({ row: t }) => /* @__PURE__ */ d(e, {
48
+ tone: t.original.statusTone,
49
+ children: t.original.statusLabel
50
+ })
51
+ },
52
+ {
53
+ accessorKey: "amount",
54
+ header: () => /* @__PURE__ */ d("div", {
55
+ className: "ttw:text-right",
56
+ children: F.columnAmount
57
+ }),
58
+ cell: ({ row: e }) => /* @__PURE__ */ d("div", {
59
+ className: "ttw:text-right ttw:tabular-nums",
60
+ children: e.original.amount
61
+ })
62
+ },
63
+ {
64
+ accessorKey: "addedBy",
65
+ header: F.columnAddedBy,
66
+ cell: ({ row: e }) => /* @__PURE__ */ d(h, {
67
+ name: e.original.addedBy,
68
+ loadingLabel: F.loadingValue
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
93
+ }
94
+ ];
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
129
+ }),
130
+ children: /* @__PURE__ */ d(o, {
131
+ title: E.title,
132
+ description: E.description
133
+ })
134
+ });
135
+ }
136
+ //#endregion
137
+ export { g as ApprovalRequestsScreen, g as default };
@@ -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 };
@@ -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.40", n = "f9977fa659d9b5a376c67729dd2762d7e065f98c", r = Object.freeze({
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