@kiva/kv-components 8.6.2 → 8.7.0

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.
@@ -1 +1 @@
1
- @media (min-width: 45.875rem){.cart-modal[data-v-51208d3d] div.container{right:var(--modal-right)!important;top:var(--modal-top)!important}}
1
+ @media (min-width: 45.875rem){.cart-modal[data-v-d09c5109] div.container{right:var(--modal-right)!important;top:var(--modal-top)!important}}
@@ -228,7 +228,7 @@ function _(g, l, e, C, v, y) {
228
228
  _: 1
229
229
  }, 8, ["style", "visible", "photo-path", "basket-count", "category-name", "onCartModalClosed"])) : i("", !0);
230
230
  }
231
- const q = /* @__PURE__ */ m(d, [["render", _], ["__scopeId", "data-v-51208d3d"]]);
231
+ const q = /* @__PURE__ */ m(d, [["render", _], ["__scopeId", "data-v-d09c5109"]]);
232
232
  export {
233
233
  q as default
234
234
  };
@@ -27,10 +27,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
27
27
  type: BooleanConstructor;
28
28
  default: boolean;
29
29
  };
30
- myKivaExperimentEnabled: {
31
- type: BooleanConstructor;
32
- default: boolean;
33
- };
34
30
  oneLoanAwayCategory: {
35
31
  type: StringConstructor;
36
32
  default: string;
@@ -95,10 +91,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
95
91
  type: BooleanConstructor;
96
92
  default: boolean;
97
93
  };
98
- myKivaExperimentEnabled: {
99
- type: BooleanConstructor;
100
- default: boolean;
101
- };
102
94
  oneLoanAwayCategory: {
103
95
  type: StringConstructor;
104
96
  default: string;
@@ -134,7 +126,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
134
126
  userData: Record<string, any>;
135
127
  showModalContent: boolean;
136
128
  hasEverLoggedIn: boolean;
137
- myKivaExperimentEnabled: boolean;
138
129
  oneLoanAwayCategory: string;
139
130
  oneLoanAwayFilteredUrl: string;
140
131
  oneAwayText: string;
@@ -1,4 +1,4 @@
1
- import { toRefs as O, ref as E, computed as l, watch as P, onMounted as j, onUnmounted as K } from "vue";
1
+ import { toRefs as O, ref as S, computed as l, watch as P, onMounted as j, onUnmounted as x } from "vue";
2
2
  import { throttle as N } from "../utils/throttle.js";
3
3
  import R from "./KvCartModal.js";
4
4
  import z from "./KvCartPill.js";
@@ -57,13 +57,6 @@ const q = {
57
57
  type: Boolean,
58
58
  default: !1
59
59
  },
60
- /**
61
- * is under myKiva experiment
62
- * */
63
- myKivaExperimentEnabled: {
64
- type: Boolean,
65
- default: !1
66
- },
67
60
  /**
68
61
  * one loan away category name
69
62
  * */
@@ -118,37 +111,36 @@ const q = {
118
111
  modalVisible: h,
119
112
  addedLoan: s,
120
113
  userData: y,
121
- hasEverLoggedIn: S,
122
- myKivaExperimentEnabled: A,
123
- oneLoanAwayCategory: B,
114
+ hasEverLoggedIn: A,
115
+ oneLoanAwayCategory: $,
124
116
  oneLoanAwayFilteredUrl: m,
125
- milestonesProgress: $
126
- } = O(d), v = E(0), f = E(0), w = l(() => {
117
+ milestonesProgress: B
118
+ } = O(d), v = S(0), f = S(0), w = l(() => {
127
119
  var e;
128
120
  return ((e = s.value) == null ? void 0 : e.basketSize) ?? 0;
129
- }), x = l(() => {
121
+ }), E = l(() => {
130
122
  const e = window.innerWidth - f.value - 200, t = `${e > 0 ? e : 0}`, o = `${v.value}`;
131
123
  return { right: t, top: o };
132
124
  }), i = l(() => {
133
125
  var e;
134
126
  return (e = s.value) == null ? void 0 : e.name;
135
- }), b = l(() => {
127
+ }), L = l(() => {
136
128
  var e;
137
129
  return !((e = y.value) != null && e.my);
138
130
  }), p = l(() => {
139
131
  var e, t, o;
140
- return A.value && (b.value && !S.value || !b.value && !((o = (t = (e = y.value) == null ? void 0 : e.my) == null ? void 0 : t.loans) != null && o.totalCount)) && w.value === 1;
141
- }), L = l(() => B.value && m.value && !p.value), C = l(() => Object.values($.value).reduce((e, t) => e + (t > 0 ? t : 0), 0)), G = l(() => {
142
- var t, o, n;
132
+ return (L.value && !A.value || !L.value && !((o = (t = (e = y.value) == null ? void 0 : e.my) == null ? void 0 : t.loans) != null && o.totalCount)) && w.value === 1;
133
+ }), b = l(() => $.value && m.value && !p.value), C = l(() => Object.values(B.value).reduce((e, t) => e + (t > 0 ? t : 0), 0)), G = l(() => {
134
+ var t, o, a;
143
135
  if (d.isCompletingGoal)
144
136
  return `Supporting ${i.value} meets your annual goal!`;
145
137
  if (d.isLoanGoal)
146
138
  return "You’re closer to reaching your annual goal!";
147
139
  if (p.value) {
148
- const a = `Supporting ${i.value} helps`;
149
- return ((t = s.value) == null ? void 0 : t.borrowerCount) > 1 || (o = s.value) != null && o.themes.includes("Social Enterprise") ? `${a} them invest in themselves.` : ((n = s.value) == null ? void 0 : n.gender) === "male" ? `${a} him invest in himself.` : `${a} her invest in herself.`;
140
+ const n = `Supporting ${i.value} helps`;
141
+ return ((t = s.value) == null ? void 0 : t.borrowerCount) > 1 || (o = s.value) != null && o.themes.includes("Social Enterprise") ? `${n} them invest in themselves.` : ((a = s.value) == null ? void 0 : a.gender) === "male" ? `${n} him invest in himself.` : `${n} her invest in herself.`;
150
142
  }
151
- if (L.value)
143
+ if (b.value)
152
144
  return "You’re close to your next achievement!";
153
145
  const e = C.value > 1 ? `${C.value} achievements` : "your next achievement";
154
146
  return i.value ? `Supporting ${i.value} will reach ${e}!` : "Supporting this loan reaches an achievement!";
@@ -159,23 +151,23 @@ const q = {
159
151
  t && H(t), c("reset-modal");
160
152
  }, g = () => {
161
153
  const e = document.getElementsByTagName("header")[0], t = (e == null ? void 0 : e.getBoundingClientRect()) ?? null;
162
- let o = Array.from(document.querySelectorAll('[data-testid="header-basket"]')), n = o.find((r) => r == null ? void 0 : r.clientHeight);
163
- n || (o = Array.from(document.querySelectorAll('[data-testid="header-about"]')), n = o.find((r) => r == null ? void 0 : r.clientHeight));
164
- const a = (n == null ? void 0 : n.getBoundingClientRect()) ?? null;
165
- a && (a == null ? void 0 : a.right) !== f.value && (f.value = a == null ? void 0 : a.right), t && (t == null ? void 0 : t.bottom) !== v.value && (v.value = t == null ? void 0 : t.bottom);
154
+ let o = Array.from(document.querySelectorAll('[data-testid="header-basket"]')), a = o.find((r) => r == null ? void 0 : r.clientHeight);
155
+ a || (o = Array.from(document.querySelectorAll('[data-testid="header-about"]')), a = o.find((r) => r == null ? void 0 : r.clientHeight));
156
+ const n = (a == null ? void 0 : a.getBoundingClientRect()) ?? null;
157
+ n && (n == null ? void 0 : n.right) !== f.value && (f.value = n == null ? void 0 : n.right), t && (t == null ? void 0 : t.bottom) !== v.value && (v.value = t == null ? void 0 : t.bottom);
166
158
  }, u = N(g, 50);
167
159
  return P(h, () => {
168
160
  h.value && g();
169
161
  }, { immediate: !0 }), j(() => {
170
162
  g(), window.addEventListener("scroll", u), window.addEventListener("resize", u);
171
- }), K(() => {
163
+ }), x(() => {
172
164
  window.removeEventListener("scroll", u), window.removeEventListener("resize", u);
173
165
  }), {
174
- modalPosition: x,
166
+ modalPosition: E,
175
167
  basketCount: w,
176
168
  isFirstLoan: p,
177
169
  borrowerName: i,
178
- showOneAway: L,
170
+ showOneAway: b,
179
171
  pillMsg: G,
180
172
  closeCartModal: M
181
173
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "8.6.2",
3
+ "version": "8.7.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -125,5 +125,5 @@
125
125
  "embla-carousel-fade",
126
126
  "popper.js"
127
127
  ],
128
- "gitHead": "9e6157c3083e511708704a84b177fa924e1ec2c7"
128
+ "gitHead": "68ecce376f3bfb8c0f4bbc41bd4f5d9bf6214fb1"
129
129
  }