@tesouro/embedded-components-react 0.4.10 → 0.4.12

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.
@@ -115,8 +115,8 @@ function C({ cardId: r, cardProgram: u, onClose: C, labels: w, activateLabels: m
115
115
  }, []), Q = _(() => {
116
116
  V(void 0), C?.();
117
117
  }, [C]), xe = _(() => {
118
- J.close(), Q();
119
- }, [J.close, Q]), Se = y(() => W.isForbidden ? {
118
+ J.finish(), Q();
119
+ }, [J.finish, Q]), Se = y(() => W.isForbidden ? {
120
120
  ...w,
121
121
  credentials: {
122
122
  ...w?.credentials,
@@ -34,23 +34,25 @@ function _({ cardId: _, cardProgram: v, card: y, scopes: b, conflictToast: x })
34
34
  }), [O, L.errors]), z = p(() => {
35
35
  C(!0);
36
36
  }, []), B = p(() => {
37
- C(!1), j(), T(d), D("idle"), k(!1);
38
- }, [j]), V = p((e) => {
37
+ j(), T(d), k(!1);
38
+ }, [j]), V = p(() => {
39
+ C(!1), D("idle"), B();
40
+ }, [B]), H = p((e) => {
39
41
  T((t) => ({
40
42
  ...t,
41
43
  ...e
42
44
  }));
43
45
  }, []);
44
46
  m(() => {
45
- !S || I || E !== "succeeded" && E !== "submitting" && (e.error(x), B());
47
+ !S || I || E !== "succeeded" && E !== "submitting" && (e.error(x), V());
46
48
  }, [
47
49
  I,
48
- B,
50
+ V,
49
51
  x,
50
52
  S,
51
53
  E
52
54
  ]);
53
- let H = p(async () => {
55
+ let U = p(async () => {
54
56
  if (!I || !f(w).isValid) return;
55
57
  let i = v === r.Credit, o = v === r.Debit;
56
58
  if (!i && !o) return;
@@ -76,7 +78,7 @@ function _({ cardId: _, cardProgram: v, card: y, scopes: b, conflictToast: x })
76
78
  } catch (r) {
77
79
  if (M(s)) return;
78
80
  if (t(r)) {
79
- e.error(x), B();
81
+ e.error(x), V();
80
82
  return;
81
83
  }
82
84
  n(r) && k(!0), D("errored");
@@ -88,25 +90,26 @@ function _({ cardId: _, cardProgram: v, card: y, scopes: b, conflictToast: x })
88
90
  _,
89
91
  v,
90
92
  A,
91
- B,
93
+ V,
92
94
  x,
93
95
  M,
94
96
  w,
95
97
  N
96
- ]), U = p(() => {
97
- H();
98
- }, [H]);
98
+ ]), W = p(() => {
99
+ U();
100
+ }, [U]);
99
101
  return {
100
102
  canActivate: I,
101
103
  isOpen: S,
102
104
  open: z,
103
- close: B,
105
+ close: V,
106
+ finish: B,
104
107
  values: w,
105
108
  errors: R,
106
109
  state: E,
107
110
  isSubmitDisabled: !I || !L.isValid || E === "submitting",
108
- onValuesChange: V,
109
- onSubmit: U
111
+ onValuesChange: H,
112
+ onSubmit: W
110
113
  };
111
114
  }
112
115
  //#endregion