@tesouro/embedded-components-react 0.11.195 → 0.11.197
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/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +138 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index13.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -40,7 +40,8 @@ var n = {
|
|
|
40
40
|
attachmentChipNone: "No attachment",
|
|
41
41
|
pastDue: "Past due",
|
|
42
42
|
scheduledStatus: "Scheduled",
|
|
43
|
-
|
|
43
|
+
valueList: (e) => e.join(", "),
|
|
44
|
+
moreValues: (e) => `+${e}`,
|
|
44
45
|
amountAtLeast: (e) => `${e} or more`,
|
|
45
46
|
amountAtMost: (e) => `${e} or less`,
|
|
46
47
|
amountBetween: (e, t) => `${e} - ${t}`,
|
|
@@ -24,11 +24,11 @@ var _ = {
|
|
|
24
24
|
Amount: "amount",
|
|
25
25
|
Vendor: "vendor",
|
|
26
26
|
Attachment: "attachment"
|
|
27
|
-
}, v = [], y = 50, b = 300, x = "MMM d, yyyy", S =
|
|
27
|
+
}, v = [], y = 50, b = 300, x = "MMM d, yyyy", S = 2, C = 864e5, ee = {
|
|
28
28
|
[n.IssueDate]: "issued_at",
|
|
29
29
|
[n.DueDate]: "due_date",
|
|
30
30
|
[n.AddedOn]: "created_at"
|
|
31
|
-
},
|
|
31
|
+
}, te = {
|
|
32
32
|
[a.Today]: "current",
|
|
33
33
|
[a.ThisWeek]: "current",
|
|
34
34
|
[a.ThisMonth]: "current",
|
|
@@ -42,7 +42,7 @@ var _ = {
|
|
|
42
42
|
[a.LastQuarter]: "past",
|
|
43
43
|
[a.LastYear]: "past"
|
|
44
44
|
};
|
|
45
|
-
function
|
|
45
|
+
function w(e = null) {
|
|
46
46
|
return {
|
|
47
47
|
summaryCard: e,
|
|
48
48
|
dateField: n.DueDate,
|
|
@@ -53,250 +53,251 @@ function T(e = null) {
|
|
|
53
53
|
vendorIds: []
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function T(e) {
|
|
57
57
|
let t = Number.parseFloat(e);
|
|
58
58
|
return Number.isFinite(t) ? Math.round(t * 100) : void 0;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
let
|
|
60
|
+
function E({ statusOptions: a = v, offersVendorFilter: E = !0, isVendorFilterPaused: D = !1, onFiltersChange: O, initialSummaryCard: ne = null, onSummaryCardChange: k, today: A, labels: j } = {}) {
|
|
61
|
+
let M = f(() => ({
|
|
62
62
|
...s,
|
|
63
|
-
...
|
|
63
|
+
...j,
|
|
64
64
|
presets: {
|
|
65
65
|
...s.presets,
|
|
66
|
-
...
|
|
66
|
+
...j?.presets
|
|
67
67
|
},
|
|
68
68
|
statuses: {
|
|
69
69
|
...s.statuses,
|
|
70
|
-
...
|
|
70
|
+
...j?.statuses
|
|
71
71
|
},
|
|
72
72
|
dateFieldNames: {
|
|
73
73
|
...s.dateFieldNames,
|
|
74
|
-
...
|
|
74
|
+
...j?.dateFieldNames
|
|
75
75
|
}
|
|
76
|
-
}), [
|
|
77
|
-
e !==
|
|
78
|
-
}, [
|
|
79
|
-
|
|
76
|
+
}), [j]), [N, P] = m(() => w(ne)), F = a.length > 0 && !N.summaryCard, I = F ? a : v, L = u((e) => {
|
|
77
|
+
e !== N.summaryCard && k?.(e);
|
|
78
|
+
}, [k, N.summaryCard]), [R, z] = m({}), [B, V] = m(""), [H, U] = m(""), W = u((e) => {
|
|
79
|
+
P((t) => ({
|
|
80
80
|
...t,
|
|
81
81
|
...e
|
|
82
|
-
})),
|
|
83
|
-
}, [
|
|
82
|
+
})), O?.();
|
|
83
|
+
}, [O]);
|
|
84
84
|
d(() => {
|
|
85
|
-
|
|
85
|
+
E || P((e) => e.vendorIds.length === 0 ? e : (O?.(), {
|
|
86
86
|
...e,
|
|
87
87
|
vendorIds: []
|
|
88
88
|
}));
|
|
89
|
-
}, [
|
|
90
|
-
|
|
91
|
-
let t = e.statuses.filter((e) =>
|
|
92
|
-
return t.length === e.statuses.length ? e : (
|
|
89
|
+
}, [E, O]), d(() => {
|
|
90
|
+
P((e) => {
|
|
91
|
+
let t = e.statuses.filter((e) => I.includes(e));
|
|
92
|
+
return t.length === e.statuses.length ? e : (O?.(), {
|
|
93
93
|
...e,
|
|
94
94
|
statuses: t
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
|
-
}, [
|
|
98
|
-
let
|
|
97
|
+
}, [I, O]);
|
|
98
|
+
let G = f(() => N.statuses.filter((e) => I.includes(e)), [N.statuses, I]), K = N.summaryCard === r.Overdue ? A : void 0, q = p(K);
|
|
99
99
|
d(() => {
|
|
100
|
-
let e =
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
let e = setTimeout(() =>
|
|
100
|
+
let e = q.current;
|
|
101
|
+
q.current = K, e && K && e !== K && O?.();
|
|
102
|
+
}, [K, O]), d(() => {
|
|
103
|
+
let e = setTimeout(() => U(B.trim()), b);
|
|
104
104
|
return () => clearTimeout(e);
|
|
105
|
-
}, [
|
|
106
|
-
let
|
|
107
|
-
enabled:
|
|
105
|
+
}, [B]);
|
|
106
|
+
let J = l({
|
|
107
|
+
enabled: E && !D,
|
|
108
108
|
is_vendor: !0,
|
|
109
109
|
sort: "counterpart_name",
|
|
110
110
|
order: "asc",
|
|
111
111
|
limit: y,
|
|
112
|
-
counterpart_name__icontains:
|
|
113
|
-
}),
|
|
112
|
+
counterpart_name__icontains: H || void 0
|
|
113
|
+
}), Y = f(() => (J.data?.data ?? []).map((e) => ({
|
|
114
114
|
value: e.id,
|
|
115
115
|
label: c(e)
|
|
116
|
-
})), [
|
|
116
|
+
})), [J.data?.data]), X = f(() => a.map((e) => ({
|
|
117
117
|
value: e,
|
|
118
|
-
label:
|
|
119
|
-
})), [a,
|
|
118
|
+
label: M.statuses[e]
|
|
119
|
+
})), [a, M.statuses]), re = f(() => Object.entries(te).map(([e, t]) => ({
|
|
120
120
|
value: e,
|
|
121
|
-
label:
|
|
122
|
-
group: t === "current" ?
|
|
121
|
+
label: M.presets[e],
|
|
122
|
+
group: t === "current" ? M.presetGroupCurrent : M.presetGroupPast
|
|
123
123
|
})), [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
]),
|
|
128
|
-
let e = {}, n =
|
|
129
|
-
if (
|
|
130
|
-
let t = "total_amount__gte", n = "total_amount__lte", r =
|
|
131
|
-
|
|
124
|
+
M.presetGroupCurrent,
|
|
125
|
+
M.presetGroupPast,
|
|
126
|
+
M.presets
|
|
127
|
+
]), ie = f(() => {
|
|
128
|
+
let e = {}, n = ee[N.dateField], r = (e) => Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
129
|
+
if (N.dateFrom && (e[`${n}__gte`] = n === "created_at" ? new Date(r(N.dateFrom)).toISOString() : g(N.dateFrom, { representation: "date" })), N.dateTo && (n === "created_at" ? e.created_at__lt = new Date(r(N.dateTo) + C).toISOString() : e[`${n}__lte`] = g(N.dateTo, { representation: "date" })), G.length > 0 && (e.status__in = t(G)), N.amountMode !== "any") {
|
|
130
|
+
let t = "total_amount__gte", n = "total_amount__lte", r = T(N.amountMin), i = T(N.amountMax);
|
|
131
|
+
N.amountMode === "exact" ? r !== void 0 && (e[t] = r, e[n] = r) : (r !== void 0 && (e[t] = r), i !== void 0 && (e[n] = i));
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return N.vendorIds.length > 0 && (e.counterpart_id__in = [...N.vendorIds]), N.hasFile !== void 0 && (e.has_file = N.hasFile), N.summaryCard && Object.assign(e, i(N.summaryCard, A).query), e;
|
|
134
134
|
}, [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
N,
|
|
136
|
+
G,
|
|
137
|
+
A
|
|
138
138
|
]), Z = f(() => {
|
|
139
|
-
let t = [], a = (e) => h(e, x), o = (e) => {
|
|
140
|
-
let
|
|
141
|
-
return
|
|
139
|
+
let t = [], a = (e) => h(e, x), o = (e, t, n) => {
|
|
140
|
+
let r = t(M.valueList(n));
|
|
141
|
+
return n.length <= S ? {
|
|
142
|
+
key: e,
|
|
143
|
+
label: r
|
|
144
|
+
} : {
|
|
145
|
+
key: e,
|
|
146
|
+
label: t(M.valueList([...n.slice(0, S), M.moreValues(n.length - S)])),
|
|
147
|
+
fullLabel: r
|
|
148
|
+
};
|
|
142
149
|
};
|
|
143
|
-
if (
|
|
144
|
-
let { statuses: e } = i(
|
|
145
|
-
t.push({
|
|
150
|
+
if (N.summaryCard) {
|
|
151
|
+
let { statuses: e } = i(N.summaryCard, A);
|
|
152
|
+
t.push(N.summaryCard === r.Overdue ? {
|
|
146
153
|
key: _.SummaryCard,
|
|
147
|
-
label:
|
|
148
|
-
});
|
|
154
|
+
label: M.dateChip(M.dateFieldNames[n.DueDate], M.pastDue)
|
|
155
|
+
} : o(_.SummaryCard, M.statusChip, e ? e.map((e) => M.statuses[e]) : [M.scheduledStatus]));
|
|
149
156
|
}
|
|
150
|
-
if (
|
|
151
|
-
let e = (
|
|
157
|
+
if (N.dateFrom || N.dateTo) {
|
|
158
|
+
let e = (N.datePreset ? M.presets[N.datePreset] : void 0) ?? (N.dateFrom && N.dateTo ? M.dateRange(a(N.dateFrom), a(N.dateTo)) : N.dateFrom ? M.dateFrom(a(N.dateFrom)) : M.dateTo(a(N.dateTo)));
|
|
152
159
|
t.push({
|
|
153
160
|
key: _.Date,
|
|
154
|
-
label:
|
|
161
|
+
label: M.dateChip(M.dateFieldNames[N.dateField], e)
|
|
155
162
|
});
|
|
156
163
|
}
|
|
157
|
-
if (
|
|
158
|
-
key: _.Status,
|
|
159
|
-
label: N.statusChip(o(K.map((e) => N.statuses[e] ?? e)))
|
|
160
|
-
}), P.vendorIds.length > 0 && t.push({
|
|
161
|
-
key: _.Vendor,
|
|
162
|
-
label: N.vendorChip(o(P.vendorIds.map((e) => z[e] ?? e)))
|
|
163
|
-
}), P.amountMode !== "any") {
|
|
164
|
+
if (G.length > 0 && t.push(o(_.Status, M.statusChip, G.map((e) => M.statuses[e] ?? e))), N.vendorIds.length > 0 && t.push(o(_.Vendor, M.vendorChip, N.vendorIds.map((e) => R[e] ?? e))), N.amountMode !== "any") {
|
|
164
165
|
let n = (t) => {
|
|
165
166
|
let n = Number.parseFloat(t);
|
|
166
167
|
return Number.isFinite(n) ? e(n, { currencyCode: "USD" }) : "";
|
|
167
|
-
}, r = n(
|
|
168
|
+
}, r = n(N.amountMin), i = n(N.amountMax), a = N.amountMode === "exact" ? r : r && i ? M.amountBetween(r, i) : r ? M.amountAtLeast(r) : i ? M.amountAtMost(i) : "";
|
|
168
169
|
a && t.push({
|
|
169
170
|
key: _.Amount,
|
|
170
|
-
label:
|
|
171
|
+
label: M.amountChip(a)
|
|
171
172
|
});
|
|
172
173
|
}
|
|
173
|
-
return
|
|
174
|
+
return N.hasFile !== void 0 && t.push({
|
|
174
175
|
key: _.Attachment,
|
|
175
|
-
label:
|
|
176
|
+
label: N.hasFile ? M.attachmentChipHas : M.attachmentChipNone
|
|
176
177
|
}), t;
|
|
177
178
|
}, [
|
|
179
|
+
M,
|
|
178
180
|
N,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
]), ie = u((e) => {
|
|
181
|
+
G,
|
|
182
|
+
A,
|
|
183
|
+
R
|
|
184
|
+
]), ae = u((e) => {
|
|
184
185
|
switch (e) {
|
|
185
186
|
case _.SummaryCard:
|
|
186
|
-
|
|
187
|
+
L(null), W({ summaryCard: null });
|
|
187
188
|
break;
|
|
188
189
|
case _.Date:
|
|
189
|
-
|
|
190
|
+
W({
|
|
190
191
|
datePreset: void 0,
|
|
191
192
|
dateFrom: void 0,
|
|
192
193
|
dateTo: void 0
|
|
193
194
|
});
|
|
194
195
|
break;
|
|
195
196
|
case _.Status:
|
|
196
|
-
|
|
197
|
+
W({ statuses: [] });
|
|
197
198
|
break;
|
|
198
199
|
case _.Vendor:
|
|
199
|
-
|
|
200
|
+
W({ vendorIds: [] });
|
|
200
201
|
break;
|
|
201
202
|
case _.Amount:
|
|
202
|
-
|
|
203
|
+
W({
|
|
203
204
|
amountMode: "any",
|
|
204
205
|
amountMin: "",
|
|
205
206
|
amountMax: ""
|
|
206
207
|
});
|
|
207
208
|
break;
|
|
208
|
-
case _.Attachment:
|
|
209
|
+
case _.Attachment: W({ hasFile: void 0 });
|
|
209
210
|
}
|
|
210
|
-
}, [
|
|
211
|
-
|
|
212
|
-
}, [
|
|
213
|
-
|
|
211
|
+
}, [L, W]), Q = u(() => {
|
|
212
|
+
L(null), P(w()), O?.();
|
|
213
|
+
}, [O, L]), $ = u((e) => {
|
|
214
|
+
P((t) => t.summaryCard === e ? t : {
|
|
214
215
|
...t,
|
|
215
216
|
summaryCard: e
|
|
216
|
-
}),
|
|
217
|
-
}, [
|
|
218
|
-
|
|
219
|
-
}, [$,
|
|
220
|
-
|
|
217
|
+
}), O?.();
|
|
218
|
+
}, [O]), oe = u((e) => {
|
|
219
|
+
L(e), $(e);
|
|
220
|
+
}, [$, L]), se = u((e) => {
|
|
221
|
+
z((t) => ({
|
|
221
222
|
...t,
|
|
222
223
|
[e.id]: e.name
|
|
223
|
-
})),
|
|
224
|
-
...
|
|
224
|
+
})), L(null), P({
|
|
225
|
+
...w(),
|
|
225
226
|
vendorIds: [e.id]
|
|
226
|
-
}),
|
|
227
|
-
}, [
|
|
228
|
-
|
|
227
|
+
}), O?.();
|
|
228
|
+
}, [O, L]), ce = u((e) => {
|
|
229
|
+
z((t) => {
|
|
229
230
|
let n = { ...t };
|
|
230
|
-
for (let t of
|
|
231
|
+
for (let t of Y) e.includes(t.value) && (n[t.value] = t.label);
|
|
231
232
|
return n;
|
|
232
|
-
}),
|
|
233
|
-
}, [
|
|
233
|
+
}), W({ vendorIds: e });
|
|
234
|
+
}, [W, Y]);
|
|
234
235
|
return {
|
|
235
236
|
filterBarProps: {
|
|
236
237
|
fields: [...f(() => [
|
|
237
|
-
...
|
|
238
|
+
...E ? [n.Vendor] : [],
|
|
238
239
|
n.IssueDate,
|
|
239
240
|
n.DueDate,
|
|
240
|
-
...
|
|
241
|
+
...F ? [n.Status] : [],
|
|
241
242
|
n.TotalAmount,
|
|
242
243
|
n.AddedOn,
|
|
243
244
|
n.Attachment
|
|
244
|
-
], [
|
|
245
|
+
], [F, E])],
|
|
245
246
|
activeFilterCount: Z.length,
|
|
246
247
|
chips: Z,
|
|
247
|
-
onRemoveChip:
|
|
248
|
+
onRemoveChip: ae,
|
|
248
249
|
onClearAll: Q,
|
|
249
|
-
dateField:
|
|
250
|
+
dateField: N.dateField,
|
|
250
251
|
onDateFieldChange: (e) => {
|
|
251
|
-
let t = !!(
|
|
252
|
-
|
|
252
|
+
let t = !!(N.dateFrom || N.dateTo);
|
|
253
|
+
P((t) => ({
|
|
253
254
|
...t,
|
|
254
255
|
dateField: e
|
|
255
|
-
})), t &&
|
|
256
|
+
})), t && O?.();
|
|
256
257
|
},
|
|
257
|
-
datePresets:
|
|
258
|
-
selectedDatePreset:
|
|
259
|
-
dateFrom:
|
|
260
|
-
dateTo:
|
|
261
|
-
onDateRangeChange: ({ from: e, to: t }) =>
|
|
258
|
+
datePresets: re,
|
|
259
|
+
selectedDatePreset: N.datePreset,
|
|
260
|
+
dateFrom: N.dateFrom,
|
|
261
|
+
dateTo: N.dateTo,
|
|
262
|
+
onDateRangeChange: ({ from: e, to: t }) => W({
|
|
262
263
|
datePreset: void 0,
|
|
263
264
|
dateFrom: e,
|
|
264
265
|
dateTo: t
|
|
265
266
|
}),
|
|
266
267
|
onDatePresetChange: (e) => {
|
|
267
|
-
let t = /* @__PURE__ */ new Date(), r =
|
|
268
|
-
|
|
268
|
+
let t = /* @__PURE__ */ new Date(), r = N.dateField === n.AddedOn ? new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()) : t, { from: i, to: a } = o(e, r);
|
|
269
|
+
W({
|
|
269
270
|
datePreset: e,
|
|
270
271
|
dateFrom: i,
|
|
271
272
|
dateTo: a
|
|
272
273
|
});
|
|
273
274
|
},
|
|
274
|
-
statusOptions:
|
|
275
|
-
selectedStatuses:
|
|
276
|
-
onStatusChange: (e) =>
|
|
277
|
-
amountMode:
|
|
278
|
-
onAmountModeChange: (e) =>
|
|
279
|
-
amountMin:
|
|
280
|
-
amountMax:
|
|
281
|
-
onAmountMinChange: (e) =>
|
|
282
|
-
onAmountMaxChange: (e) =>
|
|
283
|
-
vendorOptions:
|
|
284
|
-
selectedVendors:
|
|
285
|
-
onVendorChange:
|
|
286
|
-
vendorSearchValue:
|
|
287
|
-
onVendorSearchChange:
|
|
288
|
-
isVendorLoading:
|
|
289
|
-
isVendorError:
|
|
290
|
-
hasAttachment:
|
|
291
|
-
onHasAttachmentChange: (e) =>
|
|
275
|
+
statusOptions: X,
|
|
276
|
+
selectedStatuses: G,
|
|
277
|
+
onStatusChange: (e) => W({ statuses: e }),
|
|
278
|
+
amountMode: N.amountMode,
|
|
279
|
+
onAmountModeChange: (e) => W({ amountMode: e }),
|
|
280
|
+
amountMin: N.amountMin,
|
|
281
|
+
amountMax: N.amountMax,
|
|
282
|
+
onAmountMinChange: (e) => W({ amountMin: e }),
|
|
283
|
+
onAmountMaxChange: (e) => W({ amountMax: e }),
|
|
284
|
+
vendorOptions: Y,
|
|
285
|
+
selectedVendors: N.vendorIds,
|
|
286
|
+
onVendorChange: ce,
|
|
287
|
+
vendorSearchValue: B,
|
|
288
|
+
onVendorSearchChange: V,
|
|
289
|
+
isVendorLoading: J.isLoading || D,
|
|
290
|
+
isVendorError: J.isError,
|
|
291
|
+
hasAttachment: N.hasFile,
|
|
292
|
+
onHasAttachmentChange: (e) => W({ hasFile: e })
|
|
292
293
|
},
|
|
293
|
-
query:
|
|
294
|
+
query: ie,
|
|
294
295
|
isFilterActive: Z.length > 0,
|
|
295
296
|
clearAll: Q,
|
|
296
|
-
filterByVendor:
|
|
297
|
-
summaryCard:
|
|
298
|
-
selectSummaryCard:
|
|
297
|
+
filterByVendor: se,
|
|
298
|
+
summaryCard: N.summaryCard,
|
|
299
|
+
selectSummaryCard: oe,
|
|
299
300
|
applySummaryCard: $
|
|
300
301
|
};
|
|
301
302
|
}
|
|
302
|
-
export { _ as BillsFilterChipKey,
|
|
303
|
+
export { _ as BillsFilterChipKey, E as useBillsFilters };
|
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index13.js
CHANGED
|
@@ -183,6 +183,7 @@ function v({ fields: d, activeFilterCount: v, chips: y, onRemoveChip: b, onClear
|
|
|
183
183
|
"data-testid": Y?.chips,
|
|
184
184
|
children: [y.map((e) => /* @__PURE__ */ f(ee, {
|
|
185
185
|
label: e.label,
|
|
186
|
+
fullLabel: e.fullLabel,
|
|
186
187
|
labels: Z.filterTag,
|
|
187
188
|
onDismiss: () => b(e.key)
|
|
188
189
|
}, e.key)), /* @__PURE__ */ f("button", {
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.197", n = "91c2d16805b212581b2ff35a5e016262f605288f", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|