@tesouro/embedded-components-react 0.7.72 → 0.7.74
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/README.md +1 -1
- package/dist/index.css +9 -0
- package/dist/index.d.ts +12 -6
- package/dist/lib/ProductsWidget.d.ts +12 -6
- package/dist/lib/ReceivablesWidget.d.ts +1 -5
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +23 -24
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/constants.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsTable.js +112 -51
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsWidget.js +80 -56
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +15 -6
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +170 -135
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +49 -150
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index6.js +152 -24
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index7.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/labels.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/policyViewModel.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +127 -141
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/util/dist/lib/validatePolicyDraft.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +41 -27
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +70 -52
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +19 -8
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index3.js +171 -218
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +52 -180
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js +188 -46
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +47 -124
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index7.js +128 -0
- package/package.json +1 -1
|
@@ -11,22 +11,22 @@ import { nextPolicyPriority as r } from "../../../util/dist/lib/policyPriority.j
|
|
|
11
11
|
import { buildApprovalPolicyScript as i, parseApprovalPolicyScript as a } from "../../../util/dist/lib/policyScript.js";
|
|
12
12
|
import { buildApprovalPolicyTrigger as o, parseApprovalPolicyTrigger as s } from "../../../util/dist/lib/policyTrigger.js";
|
|
13
13
|
import { validatePolicyDraft as c } from "../../../util/dist/lib/validatePolicyDraft.js";
|
|
14
|
-
import { buildPolicySentence as l, buildPolicyTitle as u, buildUnlistedPoliciesHeading as ee, gapId as te, lockUnavailableApprovers as ne, toAmountConditionErrors as d, toAmountConditionValue as f, toApproverErrors as re, toApproverGroupRefs as ie, toApproverSteps as ae, toGapRanges as
|
|
15
|
-
import { useApproverOptions as
|
|
16
|
-
import { approvalPolicyTestIds as
|
|
17
|
-
import { ApprovalPolicyObjectType as
|
|
18
|
-
import { useDeleteApprovalPoliciesIdMutation as
|
|
14
|
+
import { buildPolicySentence as l, buildPolicyTitle as u, buildUnlistedPoliciesHeading as ee, gapId as te, lockUnavailableApprovers as ne, toAmountConditionErrors as d, toAmountConditionValue as f, toApproverErrors as re, toApproverGroupRefs as ie, toApproverSteps as ae, toGapRanges as p } from "./policyViewModel.js";
|
|
15
|
+
import { useApproverOptions as oe } from "./useApproverOptions.js";
|
|
16
|
+
import { approvalPolicyTestIds as m } from "./testIds.js";
|
|
17
|
+
import { ApprovalPolicyObjectType as se } from "../../../data-access/dist/lib/queryKeys.js";
|
|
18
|
+
import { useDeleteApprovalPoliciesIdMutation as ce, useGetApprovalPoliciesQuery as le, usePatchApprovalPoliciesIdMutation as ue, usePostApprovalPoliciesMutation as h } from "../../../data-access/dist/lib/approvalPoliciesApi.js";
|
|
19
19
|
import "../../../data-access/dist/index.js";
|
|
20
|
-
import { useCallback as
|
|
20
|
+
import { useCallback as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
21
21
|
//#region ../../libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js
|
|
22
|
-
var
|
|
22
|
+
var x = "draft", de = {
|
|
23
23
|
lower: "",
|
|
24
24
|
upper: ""
|
|
25
|
-
},
|
|
25
|
+
}, S = {
|
|
26
26
|
lower: !1,
|
|
27
27
|
upper: !1
|
|
28
28
|
};
|
|
29
|
-
function
|
|
29
|
+
function fe(e) {
|
|
30
30
|
return e.map((e) => {
|
|
31
31
|
let t = s(e.trigger), n = a(e.script), r = t.currency === void 0 || t.currency === "USD", i = e.status === "active", o = t.hasKnownAmountBounds && r;
|
|
32
32
|
return {
|
|
@@ -41,18 +41,18 @@ function me(e) {
|
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function pe(e) {
|
|
45
45
|
return [...e].sort((e, t) => (e.condition.min ?? 0) - (t.condition.min ?? 0));
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
let
|
|
51
|
-
id: `group-new-${
|
|
47
|
+
function C({ labels: a, componentLabels: s }) {
|
|
48
|
+
let x = le(), C = h(), w = ue(), T = ce(), E = oe(), { organizationId: D } = t(), [O, k] = b(null), [A, j] = b(null), M = y(D);
|
|
49
|
+
D && D !== M.current && (M.current = D, k(null), j(null));
|
|
50
|
+
let N = y(0), P = g(() => (N.current += 1, {
|
|
51
|
+
id: `group-new-${N.current}`,
|
|
52
52
|
selectedItems: []
|
|
53
|
-
}), []),
|
|
53
|
+
}), []), F = v(() => fe(x.data?.data ?? []), [x.data]), I = v(() => E.isResolving ? [] : pe(F.flatMap((e) => {
|
|
54
54
|
if (!e.isRepresentable) return [];
|
|
55
|
-
let t = ae(e.groups,
|
|
55
|
+
let t = ae(e.groups, E.lookup);
|
|
56
56
|
return t === void 0 ? [] : [{
|
|
57
57
|
id: e.id,
|
|
58
58
|
priority: e.priority,
|
|
@@ -60,66 +60,55 @@ function x({ labels: a, componentLabels: s }) {
|
|
|
60
60
|
steps: t
|
|
61
61
|
}];
|
|
62
62
|
})), [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
]),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
]),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return e;
|
|
78
|
-
}, [P]), V = g(() => {
|
|
79
|
-
let e = /* @__PURE__ */ new Set();
|
|
80
|
-
for (let [t, n] of B) if (t !== E?.policyId) for (let t of n) e.add(t);
|
|
81
|
-
return e;
|
|
82
|
-
}, [B, E?.policyId]), H = g(() => {
|
|
83
|
-
if (!E) return;
|
|
84
|
-
let e = (e) => e.id !== E.policyId;
|
|
63
|
+
F,
|
|
64
|
+
E.isResolving,
|
|
65
|
+
E.lookup
|
|
66
|
+
]), L = O ? O.policyId ?? "draft" : null, R = !D && M.current != null || x.isResolving || E.isResolving, z = O?.policyId != null && O.policyId !== A && !R && !I.some((e) => e.id === O.policyId);
|
|
67
|
+
_(() => {
|
|
68
|
+
z && (k(null), e.error(a.approverUnavailable));
|
|
69
|
+
}, [z, a.approverUnavailable]);
|
|
70
|
+
let B = v(() => new Set(I.map((e) => e.id)), [I]), V = v(() => R ? [] : F.filter((e) => !B.has(e.id)), [
|
|
71
|
+
R,
|
|
72
|
+
F,
|
|
73
|
+
B
|
|
74
|
+
]), H = v(() => {
|
|
75
|
+
if (!O) return;
|
|
76
|
+
let e = (e) => e.id !== O.policyId;
|
|
85
77
|
return c({
|
|
86
|
-
amount:
|
|
87
|
-
groups:
|
|
78
|
+
amount: O.amount,
|
|
79
|
+
groups: O.steps.map((e) => ({
|
|
88
80
|
id: e.id,
|
|
89
81
|
approverIds: e.selectedItems.map((e) => e.id)
|
|
90
82
|
})),
|
|
91
|
-
otherConditions:
|
|
92
|
-
unlistedConditions:
|
|
93
|
-
approverIdsUsedByOtherRules: [...V].filter((e) => !E.originalApproverIds.has(e))
|
|
83
|
+
otherConditions: I.filter(e).map((e) => e.condition),
|
|
84
|
+
unlistedConditions: V.filter((t) => t.hasKnownCondition && e(t)).map((e) => e.condition)
|
|
94
85
|
});
|
|
95
86
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
z,
|
|
87
|
+
O,
|
|
88
|
+
I,
|
|
99
89
|
V
|
|
100
|
-
]), U =
|
|
101
|
-
|
|
90
|
+
]), U = v(() => n(F.filter((e) => e.coversNow).map((e) => e.condition)), [F]), W = v(() => F.filter((e) => e.hasKnownCondition).map((e) => e.condition), [F]), G = v(() => F.length === 0 ? [] : p(U, a, W), [
|
|
91
|
+
F.length,
|
|
102
92
|
U,
|
|
103
93
|
a,
|
|
104
94
|
W
|
|
105
|
-
]),
|
|
106
|
-
|
|
95
|
+
]), me = v(() => n(W), [W]), he = !R && F.length > 0 && me.length === 0 ? I.length === 0 ? a.addRuleFullyCoveredUnlisted : a.addRuleFullyCovered : void 0, [K, ge] = b(0), q = y(null);
|
|
96
|
+
_(() => {
|
|
107
97
|
K !== 0 && q.current?.scrollIntoView({
|
|
108
98
|
behavior: globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth",
|
|
109
99
|
block: "nearest"
|
|
110
100
|
});
|
|
111
101
|
}, [K]);
|
|
112
|
-
let J =
|
|
113
|
-
|
|
102
|
+
let J = g((e) => {
|
|
103
|
+
k({
|
|
114
104
|
policyId: null,
|
|
115
105
|
amount: e,
|
|
116
|
-
steps: [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}, [J]), be = m((e) => {
|
|
106
|
+
steps: [P()],
|
|
107
|
+
touchedAmount: S
|
|
108
|
+
}), ge((e) => e + 1);
|
|
109
|
+
}, [P]), _e = g(() => {
|
|
110
|
+
J(de);
|
|
111
|
+
}, [J]), ve = g((e) => {
|
|
123
112
|
let t = U.find((t) => te(t) === e);
|
|
124
113
|
t && G.find((t) => t.id === e)?.blockedReason === void 0 && J(f({
|
|
125
114
|
type: "between",
|
|
@@ -130,65 +119,65 @@ function x({ labels: a, componentLabels: s }) {
|
|
|
130
119
|
U,
|
|
131
120
|
G,
|
|
132
121
|
J
|
|
133
|
-
]), Y =
|
|
134
|
-
|
|
135
|
-
}, []), X =
|
|
136
|
-
if (!
|
|
137
|
-
let t = H.condition, n = ie(
|
|
122
|
+
]), Y = g(() => {
|
|
123
|
+
k(null);
|
|
124
|
+
}, []), X = C.isPending || w.isPending || T.isPending, Z = g(async () => {
|
|
125
|
+
if (!O || !H || !H.isValid) return;
|
|
126
|
+
let t = H.condition, n = ie(O.steps, E.lookup);
|
|
138
127
|
if (!n) {
|
|
139
128
|
e.error(a.approverUnavailable);
|
|
140
129
|
return;
|
|
141
130
|
}
|
|
142
131
|
let s = o(t), c = i(n), l = u(t, a);
|
|
143
132
|
try {
|
|
144
|
-
|
|
145
|
-
object_type:
|
|
133
|
+
O.policyId === null ? await C.mutateAsync({ body: {
|
|
134
|
+
object_type: se.Payable,
|
|
146
135
|
name: l,
|
|
147
136
|
trigger: s,
|
|
148
137
|
script: c,
|
|
149
|
-
priority: r(
|
|
150
|
-
} }) : await
|
|
151
|
-
path: { approval_policy_id:
|
|
138
|
+
priority: r(F.map((e) => e.priority))
|
|
139
|
+
} }) : await w.mutateAsync({
|
|
140
|
+
path: { approval_policy_id: O.policyId },
|
|
152
141
|
body: {
|
|
153
142
|
name: l,
|
|
154
143
|
trigger: s,
|
|
155
144
|
script: c
|
|
156
145
|
}
|
|
157
|
-
}),
|
|
146
|
+
}), k(null), e.success(a.ruleSaved);
|
|
158
147
|
} catch {
|
|
159
148
|
e.error(a.ruleSaveFailed);
|
|
160
149
|
}
|
|
161
150
|
}, [
|
|
162
|
-
|
|
151
|
+
O,
|
|
163
152
|
H,
|
|
164
|
-
|
|
153
|
+
E.lookup,
|
|
165
154
|
a,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
]),
|
|
170
|
-
if (
|
|
171
|
-
await
|
|
155
|
+
F,
|
|
156
|
+
C,
|
|
157
|
+
w
|
|
158
|
+
]), ye = g(async () => {
|
|
159
|
+
if (A) try {
|
|
160
|
+
await T.mutateAsync({ path: { approval_policy_id: A } }), j(null), k(null), e.success(a.ruleDeleted);
|
|
172
161
|
} catch {
|
|
173
|
-
|
|
162
|
+
j(null), e.error(a.ruleDeleteFailed);
|
|
174
163
|
}
|
|
175
164
|
}, [
|
|
176
|
-
|
|
177
|
-
|
|
165
|
+
A,
|
|
166
|
+
T,
|
|
178
167
|
a
|
|
179
|
-
]),
|
|
180
|
-
if (!
|
|
168
|
+
]), be = R || X, Q = v(() => {
|
|
169
|
+
if (!O || !H || X) return;
|
|
181
170
|
let e = d(H.amountErrors, a);
|
|
182
171
|
if (e) return {
|
|
183
|
-
lower:
|
|
184
|
-
upper:
|
|
172
|
+
lower: O.touchedAmount.lower ? e.lower : void 0,
|
|
173
|
+
upper: O.touchedAmount.upper ? e.upper : void 0
|
|
185
174
|
};
|
|
186
175
|
}, [
|
|
187
|
-
|
|
176
|
+
O,
|
|
188
177
|
H,
|
|
189
178
|
X,
|
|
190
179
|
a
|
|
191
|
-
]), $ =
|
|
180
|
+
]), $ = v(() => {
|
|
192
181
|
if (!H || H.isValid) return;
|
|
193
182
|
let e = re(H.groupErrors, a), t = d(H.amountErrors, a), n = [
|
|
194
183
|
...Object.values(e?.steps ?? {}),
|
|
@@ -198,28 +187,28 @@ function x({ labels: a, componentLabels: s }) {
|
|
|
198
187
|
return r.length > 0 ? r : void 0;
|
|
199
188
|
}, [H, a]);
|
|
200
189
|
return {
|
|
201
|
-
items:
|
|
190
|
+
items: v(() => {
|
|
202
191
|
let e = {
|
|
203
|
-
onAmountConditionChange: (e) =>
|
|
192
|
+
onAmountConditionChange: (e) => k((t) => t && {
|
|
204
193
|
...t,
|
|
205
194
|
amount: e
|
|
206
195
|
}),
|
|
207
|
-
onAmountFieldBlur: (e) =>
|
|
196
|
+
onAmountFieldBlur: (e) => k((t) => t && {
|
|
208
197
|
...t,
|
|
209
198
|
touchedAmount: {
|
|
210
199
|
...t.touchedAmount,
|
|
211
200
|
[e]: !0
|
|
212
201
|
}
|
|
213
202
|
}),
|
|
214
|
-
onApproverStepsChange: (e) =>
|
|
203
|
+
onApproverStepsChange: (e) => k((t) => t && {
|
|
215
204
|
...t,
|
|
216
205
|
steps: e
|
|
217
206
|
}),
|
|
218
|
-
onAddApproverStep: () =>
|
|
207
|
+
onAddApproverStep: () => k((e) => e && {
|
|
219
208
|
...e,
|
|
220
|
-
steps: [...e.steps,
|
|
209
|
+
steps: [...e.steps, P()]
|
|
221
210
|
}),
|
|
222
|
-
onRemoveApproverStep: (e) =>
|
|
211
|
+
onRemoveApproverStep: (e) => k((t) => t && {
|
|
223
212
|
...t,
|
|
224
213
|
steps: t.steps.filter((t) => t.id !== e)
|
|
225
214
|
})
|
|
@@ -228,22 +217,20 @@ function x({ labels: a, componentLabels: s }) {
|
|
|
228
217
|
title: u(n, a),
|
|
229
218
|
sentence: l(n, a),
|
|
230
219
|
approverSteps: r.map((e) => ne(e, {
|
|
231
|
-
lookup:
|
|
220
|
+
lookup: E.lookup,
|
|
232
221
|
labels: a,
|
|
233
|
-
usedByOtherRules: i ? V : void 0,
|
|
234
222
|
usedByOtherSteps: i ? new Set(r.filter((t) => t.id !== e.id).flatMap((e) => e.selectedItems.map((e) => e.id))) : void 0
|
|
235
223
|
})),
|
|
236
224
|
addApproverStepDisabled: r.some((e) => e.selectedItems.length === 0),
|
|
237
|
-
approverOptions:
|
|
225
|
+
approverOptions: E.options,
|
|
238
226
|
amountCondition: f(n),
|
|
239
227
|
amountConditionErrors: i ? Q : void 0,
|
|
240
228
|
onEdit: () => {
|
|
241
|
-
|
|
229
|
+
k({
|
|
242
230
|
policyId: t,
|
|
243
231
|
amount: f(n),
|
|
244
232
|
steps: r,
|
|
245
|
-
|
|
246
|
-
touchedAmount: b
|
|
233
|
+
touchedAmount: S
|
|
247
234
|
});
|
|
248
235
|
},
|
|
249
236
|
onCancel: Y,
|
|
@@ -254,72 +241,71 @@ function x({ labels: a, componentLabels: s }) {
|
|
|
254
241
|
labels: s?.policyCard,
|
|
255
242
|
testIds: {
|
|
256
243
|
amountConditionBuilder: {
|
|
257
|
-
root:
|
|
258
|
-
lowerInput:
|
|
259
|
-
upperInput:
|
|
244
|
+
root: m.amountConditionBuilder,
|
|
245
|
+
lowerInput: m.amountConditionLowerInput,
|
|
246
|
+
upperInput: m.amountConditionUpperInput
|
|
260
247
|
},
|
|
261
248
|
approverGroupsBuilder: {
|
|
262
|
-
root:
|
|
263
|
-
loading:
|
|
264
|
-
error:
|
|
265
|
-
description:
|
|
266
|
-
empty:
|
|
267
|
-
addStepButton:
|
|
249
|
+
root: m.approverGroupsBuilder,
|
|
250
|
+
loading: m.approverGroupsLoading,
|
|
251
|
+
error: m.approverGroupsError,
|
|
252
|
+
description: m.approverGroupsDescription,
|
|
253
|
+
empty: m.approverGroupsEmpty,
|
|
254
|
+
addStepButton: m.approverGroupsAddStep
|
|
268
255
|
}
|
|
269
256
|
},
|
|
270
257
|
...e
|
|
271
|
-
}), n =
|
|
272
|
-
let n =
|
|
273
|
-
return n &&
|
|
258
|
+
}), n = I.map((e) => {
|
|
259
|
+
let n = L === e.id, r = t(e.id, e.condition, n && O ? O.steps : e.steps, n, () => j(e.id));
|
|
260
|
+
return n && O ? {
|
|
274
261
|
...r,
|
|
275
|
-
amountCondition:
|
|
262
|
+
amountCondition: O.amount
|
|
276
263
|
} : r;
|
|
277
264
|
});
|
|
278
|
-
return
|
|
279
|
-
...t("draft", { type: "between" },
|
|
280
|
-
amountCondition:
|
|
265
|
+
return O?.policyId === null && n.unshift({
|
|
266
|
+
...t("draft", { type: "between" }, O.steps, !0, void 0),
|
|
267
|
+
amountCondition: O.amount,
|
|
281
268
|
ref: q
|
|
282
269
|
}), n;
|
|
283
270
|
}, [
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
271
|
+
I,
|
|
272
|
+
O,
|
|
273
|
+
L,
|
|
287
274
|
Q,
|
|
288
275
|
$,
|
|
289
276
|
H,
|
|
290
277
|
a,
|
|
291
278
|
s?.policyCard,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
V,
|
|
279
|
+
E.options,
|
|
280
|
+
E.lookup,
|
|
295
281
|
Y,
|
|
296
|
-
|
|
282
|
+
P,
|
|
297
283
|
Z
|
|
298
284
|
]),
|
|
299
|
-
editingId:
|
|
285
|
+
editingId: L,
|
|
300
286
|
gaps: G,
|
|
301
|
-
unlistedPoliciesHeading: ee(
|
|
302
|
-
unlistedPoliciesBlockAmounts:
|
|
303
|
-
unlistedPoliciesStillApply:
|
|
304
|
-
onAddRule:
|
|
305
|
-
addRuleDisabledReason:
|
|
306
|
-
onSelectGap:
|
|
307
|
-
isBusy:
|
|
308
|
-
isLoading:
|
|
309
|
-
isError:
|
|
287
|
+
unlistedPoliciesHeading: ee(V.length, a),
|
|
288
|
+
unlistedPoliciesBlockAmounts: V.some((e) => e.hasKnownCondition),
|
|
289
|
+
unlistedPoliciesStillApply: V.some((e) => e.isActive),
|
|
290
|
+
onAddRule: _e,
|
|
291
|
+
addRuleDisabledReason: he,
|
|
292
|
+
onSelectGap: ve,
|
|
293
|
+
isBusy: be,
|
|
294
|
+
isLoading: R,
|
|
295
|
+
isError: x.isError || E.isError,
|
|
310
296
|
onRetry: () => {
|
|
311
|
-
|
|
297
|
+
x.refetch(), E.refetch();
|
|
312
298
|
},
|
|
313
299
|
deleteDialog: {
|
|
314
|
-
open:
|
|
315
|
-
isDeleting:
|
|
300
|
+
open: A !== null,
|
|
301
|
+
isDeleting: T.isPending,
|
|
316
302
|
onOpenChange: (e) => {
|
|
317
|
-
e ||
|
|
303
|
+
e || j(null);
|
|
318
304
|
},
|
|
319
|
-
onConfirm: () => void
|
|
320
|
-
onCancel: () =>
|
|
305
|
+
onConfirm: () => void ye(),
|
|
306
|
+
onCancel: () => j(null)
|
|
321
307
|
}
|
|
322
308
|
};
|
|
323
309
|
}
|
|
324
310
|
//#endregion
|
|
325
|
-
export {
|
|
311
|
+
export { x as DRAFT_POLICY_ID, C as useApprovalPolicyRules };
|
|
@@ -19,7 +19,7 @@ function a(a) {
|
|
|
19
19
|
let t = (t) => t.some((t) => e(d, t)), n = t(a.otherConditions) ? r.Overlap : t(a.unlistedConditions ?? []) ? r.OverlapUnlisted : void 0;
|
|
20
20
|
n && (c.lower = n, c.upper = n);
|
|
21
21
|
}
|
|
22
|
-
let f = {}, p = new Set(
|
|
22
|
+
let f = {}, p = /* @__PURE__ */ new Set();
|
|
23
23
|
for (let e of a.groups) {
|
|
24
24
|
if (e.approverIds.length === 0) {
|
|
25
25
|
f[e.id] = i.Empty;
|
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.7.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.7.74", n = "d23dff761f62b81b42e673496e0b7f74793bc606", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { extractApiErrorMessage as e } from "../../../util/dist/lib/apiErrors.js";
|
|
2
2
|
import { PRODUCT_MESSAGE_LABELS_EN as t } from "./lib/labels.js";
|
|
3
3
|
import { buildProductDetailsView as n, buildProductRows as r, formatPrice as i, hasSelectedText as a } from "./lib/helpers.js";
|
|
4
|
-
import {
|
|
5
|
-
import "../../ui/dist/index4.js";
|
|
4
|
+
import { PRODUCT_FORM_SHEET_LABELS_EN as o } from "../../ui/dist/index2.js";
|
|
5
|
+
import { ProductFormSheet as s } from "../../ui/dist/index4.js";
|
|
6
6
|
import "../../ui/dist/index5.js";
|
|
7
|
+
import "../../ui/dist/index6.js";
|
|
7
8
|
import "../../ui/dist/index.js";
|
|
8
|
-
import { useProductsQuery as
|
|
9
|
+
import { useProductsQuery as c } from "../../data-access/dist/index2.js";
|
|
9
10
|
import "../../data-access/dist/index3.js";
|
|
10
|
-
import { useProductQuery as
|
|
11
|
-
import { useCreateProductMutation as
|
|
11
|
+
import { useProductQuery as l } from "../../data-access/dist/index4.js";
|
|
12
|
+
import { useCreateProductMutation as u } from "../../data-access/dist/index6.js";
|
|
12
13
|
import "../../data-access/dist/index7.js";
|
|
13
|
-
import { useDeleteProductMutation as
|
|
14
|
-
import { useMeasureUnitsQuery as
|
|
14
|
+
import { useDeleteProductMutation as d } from "../../data-access/dist/index8.js";
|
|
15
|
+
import { useMeasureUnitsQuery as f } from "../../data-access/dist/index9.js";
|
|
15
16
|
import "../../data-access/dist/index10.js";
|
|
16
17
|
import "../../data-access/dist/index11.js";
|
|
17
18
|
import "../../data-access/dist/index12.js";
|
|
18
19
|
import "../../data-access/dist/index13.js";
|
|
19
20
|
import "../../data-access/dist/index.js";
|
|
20
|
-
import { MeasureUnitsManagerContainer as
|
|
21
|
-
import { useMeasureUnits as
|
|
22
|
-
import { useProductForm as
|
|
21
|
+
import { MeasureUnitsManagerContainer as p } from "./lib/MeasureUnitsManagerContainer.js";
|
|
22
|
+
import { useMeasureUnits as m } from "./lib/useMeasureUnits.js";
|
|
23
|
+
import { useProductForm as h } from "./lib/useProductForm.js";
|
|
23
24
|
import "./lib/useProductSelector.js";
|
|
24
|
-
import { ProductSelector as
|
|
25
|
-
export {
|
|
25
|
+
import { ProductSelector as g } from "./lib/ProductSelector.js";
|
|
26
|
+
export { p as MeasureUnitsManagerContainer, o as PRODUCT_FORM_SHEET_LABELS_EN, t as PRODUCT_MESSAGE_LABELS_EN, s as ProductFormSheet, g as ProductSelector, n as buildProductDetailsView, r as buildProductRows, e as extractApiErrorMessage, i as formatPrice, a as hasSelectedText, u as useCreateProductMutation, d as useDeleteProductMutation, m as useMeasureUnits, f as useMeasureUnitsQuery, h as useProductForm, l as useProductQuery, c as useProductsQuery };
|
|
@@ -8,8 +8,8 @@ import "../../../../ui/dist/index.js";
|
|
|
8
8
|
import { PRODUCT_MESSAGE_LABELS_EN as n } from "./labels.js";
|
|
9
9
|
import { formatPrice as r, validateMeasureUnit as i } from "./helpers.js";
|
|
10
10
|
import { toastSuccessWithName as a } from "./toasts.js";
|
|
11
|
-
import { MeasureUnitsManager as o } from "../../../ui/dist/
|
|
12
|
-
import { MeasureUnitDeleteDialog as s } from "../../../ui/dist/
|
|
11
|
+
import { MeasureUnitsManager as o } from "../../../ui/dist/index5.js";
|
|
12
|
+
import { MeasureUnitDeleteDialog as s } from "../../../ui/dist/index6.js";
|
|
13
13
|
import "../../../ui/dist/index.js";
|
|
14
14
|
import { useMeasureUnitsQuery as c } from "../../../data-access/dist/index9.js";
|
|
15
15
|
import { useProductsByMeasureUnitQuery as l } from "../../../data-access/dist/index10.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { ProductSelector as e } from "../../../ui/dist/
|
|
5
|
+
import { ProductSelector as e } from "../../../ui/dist/index7.js";
|
|
6
6
|
import "../../../ui/dist/index.js";
|
|
7
7
|
import { useProductSelector as t } from "./useProductSelector.js";
|
|
8
8
|
import { jsx as n } from "react/jsx-runtime";
|