@tesouro/embedded-components-react 0.11.179 → 0.11.181

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 (108) hide show
  1. package/dist/index.css +22 -0
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +71 -246
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +14 -17
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +82 -13
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +47 -83
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +261 -47
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +23 -251
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +450 -25
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +286 -442
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +4 -300
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +5 -4
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +37 -4
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +1 -38
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +11 -11
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +88 -7
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +17 -89
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index9.js +18 -18
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index10.js +4 -4
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +0 -1
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +263 -262
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  100. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
  101. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
  102. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
  103. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  105. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +29 -0
  106. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +33 -0
  107. package/package.json +1 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +0 -1
@@ -2,262 +2,34 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { formatMoneyExact as e } from "../../../../shared/util/dist/lib/formatMoneyExact.js";
6
- import "../../../../shared/util/dist/index.js";
5
+ import { resolveVendorName as e } from "../../../util/dist/lib/resolveVendor.js";
7
6
  import "../../../util/dist/index.js";
8
7
  import { getCounterpartName as t } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
9
- import { useCounterpartsQuery as n } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
8
+ import { useCounterpartsByIdsQuery as n } from "../../../../shared/counterpart-management/data-access/dist/index3.js";
10
9
  import "../../../../shared/counterpart-management/feature/dist/index.js";
11
- import { BILL_STATUS_FILTER_ORDER as r, billStatusFilterApiValues as i } from "./index4.js";
12
- import { BillsFilterField as a } from "../../ui/dist/index9.js";
13
- import "../../ui/dist/index.js";
14
- import { BillsDatePreset as o, resolveDatePreset as s } from "./index12.js";
15
- import { BILLS_FILTER_LABELS_EN as c } from "./index13.js";
16
- import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
17
- import { format as p, formatISO as m } from "date-fns";
10
+ import { useMemo as r } from "react";
18
11
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js
19
- var h = {
20
- Date: "date",
21
- Status: "status",
22
- Amount: "amount",
23
- Vendor: "vendor",
24
- Attachment: "attachment"
25
- }, g = 50, _ = 300, v = "MMM d, yyyy", y = 864e5, b = {
26
- [a.IssueDate]: "issued_at",
27
- [a.DueDate]: "due_date",
28
- [a.AddedOn]: "created_at"
29
- }, x = {
30
- [o.Today]: "current",
31
- [o.ThisWeek]: "current",
32
- [o.ThisMonth]: "current",
33
- [o.ThisQuarter]: "current",
34
- [o.ThisYear]: "current",
35
- [o.Yesterday]: "past",
36
- [o.LastWeek]: "past",
37
- [o.LastMonth]: "past",
38
- [o.Last30Days]: "past",
39
- [o.Last90Days]: "past",
40
- [o.LastQuarter]: "past",
41
- [o.LastYear]: "past"
42
- };
43
- function S() {
12
+ var i = {
13
+ Resolving: "resolving",
14
+ Unavailable: "unavailable",
15
+ Settled: "settled"
16
+ }, a = /* @__PURE__ */ new Map();
17
+ function o({ payables: i, enabled: o, canReadVendors: c = !0, isPaused: l = !1 } = {}) {
18
+ let u = r(() => (i ?? []).filter((t) => !e(t)).map((e) => e.counterpart_id).filter((e) => !!e), [i]), d = n({
19
+ counterpartIds: u,
20
+ enabled: o !== !1 && c && !l
21
+ }), f = !c && !l;
44
22
  return {
45
- dateField: a.DueDate,
46
- statuses: [],
47
- amountMode: "any",
48
- amountMin: "",
49
- amountMax: "",
50
- vendorIds: []
23
+ vendorNames: r(() => f ? a : new Map((d.data?.data ?? []).map((e) => [e.id, t(e)]).filter((e) => !!e[1])), [d.data?.data, f]),
24
+ lookup: s({
25
+ hasUnresolvedIds: u.length > 0,
26
+ isScopeWithdrawn: f,
27
+ isFetching: d.isFetching,
28
+ isError: d.isError
29
+ })
51
30
  };
52
31
  }
53
- function C(e) {
54
- let t = Number.parseFloat(e);
55
- return Number.isFinite(t) ? Math.round(t * 100) : void 0;
32
+ function s({ hasUnresolvedIds: e, isScopeWithdrawn: t, isFetching: n, isError: r }) {
33
+ return e ? t ? i.Unavailable : n ? i.Resolving : r ? i.Unavailable : i.Settled : i.Settled;
56
34
  }
57
- function w({ offersStatusFilter: o = !1, offersVendorFilter: w = !0, isVendorFilterPaused: T = !1, onFiltersChange: E, labels: D } = {}) {
58
- let O = d(() => ({
59
- ...c,
60
- ...D,
61
- presets: {
62
- ...c.presets,
63
- ...D?.presets
64
- },
65
- statuses: {
66
- ...c.statuses,
67
- ...D?.statuses
68
- },
69
- dateFieldNames: {
70
- ...c.dateFieldNames,
71
- ...D?.dateFieldNames
72
- }
73
- }), [D]), [k, A] = f(S), [j, M] = f({}), [N, P] = f(""), [F, I] = f(""), L = l((e) => {
74
- A((t) => ({
75
- ...t,
76
- ...e
77
- })), E?.();
78
- }, [E]);
79
- u(() => {
80
- w || A((e) => e.vendorIds.length === 0 ? e : (E?.(), {
81
- ...e,
82
- vendorIds: []
83
- }));
84
- }, [w, E]), u(() => {
85
- o || A((e) => e.statuses.length === 0 ? e : (E?.(), {
86
- ...e,
87
- statuses: []
88
- }));
89
- }, [o, E]), u(() => {
90
- let e = setTimeout(() => I(N.trim()), _);
91
- return () => clearTimeout(e);
92
- }, [N]);
93
- let R = n({
94
- enabled: w && !T,
95
- is_vendor: !0,
96
- sort: "counterpart_name",
97
- order: "asc",
98
- limit: g,
99
- counterpart_name__icontains: F || void 0
100
- }), z = d(() => (R.data?.data ?? []).map((e) => ({
101
- value: e.id,
102
- label: t(e)
103
- })), [R.data?.data]), B = d(() => r.map((e) => ({
104
- value: e,
105
- label: O.statuses[e]
106
- })), [O.statuses]), V = d(() => Object.entries(x).map(([e, t]) => ({
107
- value: e,
108
- label: O.presets[e],
109
- group: t === "current" ? O.presetGroupCurrent : O.presetGroupPast
110
- })), [
111
- O.presetGroupCurrent,
112
- O.presetGroupPast,
113
- O.presets
114
- ]), H = d(() => {
115
- let e = {}, t = b[k.dateField], n = (e) => Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
116
- if (k.dateFrom && (e[`${t}__gte`] = t === "created_at" ? new Date(n(k.dateFrom)).toISOString() : m(k.dateFrom, { representation: "date" })), k.dateTo && (t === "created_at" ? e.created_at__lt = new Date(n(k.dateTo) + y).toISOString() : e[`${t}__lte`] = m(k.dateTo, { representation: "date" })), k.statuses.length > 0 && (e.status__in = i(k.statuses)), k.amountMode !== "any") {
117
- let t = "total_amount__gte", n = "total_amount__lte", r = C(k.amountMin), i = C(k.amountMax);
118
- k.amountMode === "exact" ? r !== void 0 && (e[t] = r, e[n] = r) : (r !== void 0 && (e[t] = r), i !== void 0 && (e[n] = i));
119
- }
120
- return k.vendorIds.length > 0 && (e.counterpart_id__in = [...k.vendorIds]), k.hasFile !== void 0 && (e.has_file = k.hasFile), e;
121
- }, [k]), U = d(() => {
122
- let t = [], n = (e) => p(e, v), r = (e) => {
123
- let [t, ...n] = e;
124
- return t ? n.length === 0 ? t : O.moreSelected(t, n.length) : "";
125
- };
126
- if (k.dateFrom || k.dateTo) {
127
- let e = (k.datePreset ? O.presets[k.datePreset] : void 0) ?? (k.dateFrom && k.dateTo ? O.dateRange(n(k.dateFrom), n(k.dateTo)) : k.dateFrom ? O.dateFrom(n(k.dateFrom)) : O.dateTo(n(k.dateTo)));
128
- t.push({
129
- key: h.Date,
130
- label: O.dateChip(O.dateFieldNames[k.dateField], e)
131
- });
132
- }
133
- if (k.statuses.length > 0 && t.push({
134
- key: h.Status,
135
- label: O.statusChip(r(k.statuses.map((e) => O.statuses[e] ?? e)))
136
- }), k.vendorIds.length > 0 && t.push({
137
- key: h.Vendor,
138
- label: O.vendorChip(r(k.vendorIds.map((e) => j[e] ?? e)))
139
- }), k.amountMode !== "any") {
140
- let n = (t) => {
141
- let n = Number.parseFloat(t);
142
- return Number.isFinite(n) ? e(n, { currencyCode: "USD" }) : "";
143
- }, r = n(k.amountMin), i = n(k.amountMax), a = k.amountMode === "exact" ? r : r && i ? O.amountBetween(r, i) : r ? O.amountAtLeast(r) : i ? O.amountAtMost(i) : "";
144
- a && t.push({
145
- key: h.Amount,
146
- label: O.amountChip(a)
147
- });
148
- }
149
- return k.hasFile !== void 0 && t.push({
150
- key: h.Attachment,
151
- label: k.hasFile ? O.attachmentChipHas : O.attachmentChipNone
152
- }), t;
153
- }, [
154
- O,
155
- k,
156
- j
157
- ]), W = l((e) => {
158
- switch (e) {
159
- case h.Date:
160
- L({
161
- datePreset: void 0,
162
- dateFrom: void 0,
163
- dateTo: void 0
164
- });
165
- break;
166
- case h.Status:
167
- L({ statuses: [] });
168
- break;
169
- case h.Vendor:
170
- L({ vendorIds: [] });
171
- break;
172
- case h.Amount:
173
- L({
174
- amountMode: "any",
175
- amountMin: "",
176
- amountMax: ""
177
- });
178
- break;
179
- case h.Attachment: L({ hasFile: void 0 });
180
- }
181
- }, [L]), G = l(() => {
182
- A(S()), E?.();
183
- }, [E]), K = l((e) => {
184
- M((t) => ({
185
- ...t,
186
- [e.id]: e.name
187
- })), A({
188
- ...S(),
189
- vendorIds: [e.id]
190
- }), E?.();
191
- }, [E]), q = l((e) => {
192
- M((t) => {
193
- let n = { ...t };
194
- for (let t of z) e.includes(t.value) && (n[t.value] = t.label);
195
- return n;
196
- }), L({ vendorIds: e });
197
- }, [L, z]);
198
- return {
199
- filterBarProps: {
200
- fields: [...d(() => [
201
- ...w ? [a.Vendor] : [],
202
- a.IssueDate,
203
- a.DueDate,
204
- ...o ? [a.Status] : [],
205
- a.TotalAmount,
206
- a.AddedOn,
207
- a.Attachment
208
- ], [o, w])],
209
- activeFilterCount: U.length,
210
- chips: U,
211
- onRemoveChip: W,
212
- onClearAll: G,
213
- dateField: k.dateField,
214
- onDateFieldChange: (e) => {
215
- let t = !!(k.dateFrom || k.dateTo);
216
- A((t) => ({
217
- ...t,
218
- dateField: e
219
- })), t && E?.();
220
- },
221
- datePresets: V,
222
- selectedDatePreset: k.datePreset,
223
- dateFrom: k.dateFrom,
224
- dateTo: k.dateTo,
225
- onDateRangeChange: ({ from: e, to: t }) => L({
226
- datePreset: void 0,
227
- dateFrom: e,
228
- dateTo: t
229
- }),
230
- onDatePresetChange: (e) => {
231
- let t = /* @__PURE__ */ new Date(), n = k.dateField === a.AddedOn ? new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()) : t, { from: r, to: i } = s(e, n);
232
- L({
233
- datePreset: e,
234
- dateFrom: r,
235
- dateTo: i
236
- });
237
- },
238
- statusOptions: B,
239
- selectedStatuses: k.statuses,
240
- onStatusChange: (e) => L({ statuses: e }),
241
- amountMode: k.amountMode,
242
- onAmountModeChange: (e) => L({ amountMode: e }),
243
- amountMin: k.amountMin,
244
- amountMax: k.amountMax,
245
- onAmountMinChange: (e) => L({ amountMin: e }),
246
- onAmountMaxChange: (e) => L({ amountMax: e }),
247
- vendorOptions: z,
248
- selectedVendors: k.vendorIds,
249
- onVendorChange: q,
250
- vendorSearchValue: N,
251
- onVendorSearchChange: P,
252
- isVendorLoading: R.isLoading || T,
253
- isVendorError: R.isError,
254
- hasAttachment: k.hasFile,
255
- onHasAttachmentChange: (e) => L({ hasFile: e })
256
- },
257
- query: H,
258
- isFilterActive: U.length > 0,
259
- clearAll: G,
260
- filterByVendor: K
261
- };
262
- }
263
- export { h as BillsFilterChipKey, w as useBillsFilters };
35
+ export { i as BillVendorLookup, o as useBillVendorNames };