@kiva/kv-components 6.68.0 → 6.69.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-85b67e19] div.container{right:var(--modal-right)!important;top:var(--modal-top)!important}}
1
+ @media (min-width: 45.875rem){.cart-modal[data-v-5233d12c] div.container{right:var(--modal-right)!important;top:var(--modal-top)!important}}
@@ -1,13 +1,13 @@
1
- import { toRefs as N, ref as E, computed as C, watch as F, onMounted as O, onUnmounted as z, resolveComponent as B, openBlock as d, createBlock as D, normalizeStyle as R, withCtx as S, createElementBlock as h, createVNode as T, createElementVNode as e, normalizeClass as I, toDisplayString as U, createCommentVNode as y } from "vue";
2
- import { throttle as G } from "../utils/throttle.js";
3
- import W from "./KvCartModal.js";
4
- import Y from "./KvCartPill.js";
1
+ import { toRefs as N, ref as B, computed as C, watch as F, onMounted as O, onUnmounted as z, resolveComponent as E, openBlock as u, createBlock as D, normalizeStyle as G, withCtx as S, createElementBlock as m, createVNode as R, createElementVNode as e, normalizeClass as T, toDisplayString as I, createCommentVNode as b } from "vue";
2
+ import { throttle as U } from "../utils/throttle.js";
3
+ import Y from "./KvCartModal.js";
4
+ import W from "./KvCartPill.js";
5
5
  import "./KvAtbModal.css";
6
6
  import J from "../_virtual/_plugin-vue_export-helper.js";
7
7
  const Q = {
8
8
  components: {
9
- KvCartModal: W,
10
- KvCartPill: Y
9
+ KvCartModal: Y,
10
+ KvCartPill: W
11
11
  },
12
12
  props: {
13
13
  /**
@@ -93,6 +93,20 @@ const Q = {
93
93
  milestonesProgress: {
94
94
  type: Object,
95
95
  default: () => ({})
96
+ },
97
+ /**
98
+ * is loan goal modal
99
+ * */
100
+ isLoanGoal: {
101
+ type: Boolean,
102
+ default: !1
103
+ },
104
+ /**
105
+ * is completing goal modal
106
+ * */
107
+ isCompletingGoal: {
108
+ type: Boolean,
109
+ default: !1
96
110
  }
97
111
  },
98
112
  emits: [
@@ -101,41 +115,45 @@ const Q = {
101
115
  "close-redirect"
102
116
  // close and redirect to another page on parent component
103
117
  ],
104
- setup(b, { emit: i }) {
118
+ setup(c, { emit: i }) {
105
119
  const {
106
120
  modalVisible: r,
107
121
  addedLoan: l,
108
- userData: m,
122
+ userData: p,
109
123
  hasEverLoggedIn: A,
110
- myKivaExperimentEnabled: p,
111
- oneLoanAwayCategory: w,
124
+ myKivaExperimentEnabled: w,
125
+ oneLoanAwayCategory: f,
112
126
  oneLoanAwayFilteredUrl: v,
113
127
  milestonesProgress: P
114
- } = N(b), f = E(0), k = E(0), Z = C(() => {
128
+ } = N(c), g = B(0), k = B(0), Z = C(() => {
115
129
  var t;
116
130
  return ((t = l.value) == null ? void 0 : t.basketSize) ?? 0;
117
131
  }), q = C(() => {
118
- const t = window.innerWidth - k.value - 200, o = `${t > 0 ? t : 0}`, n = `${f.value}`;
132
+ const t = window.innerWidth - k.value - 200, o = `${t > 0 ? t : 0}`, n = `${g.value}`;
119
133
  return { right: o, top: n };
120
- }), u = C(() => {
134
+ }), d = C(() => {
121
135
  var t;
122
136
  return (t = l.value) == null ? void 0 : t.name;
123
137
  }), _ = C(() => {
124
138
  var t;
125
- return !((t = m.value) != null && t.my);
126
- }), g = C(() => {
139
+ return !((t = p.value) != null && t.my);
140
+ }), y = C(() => {
127
141
  var t, o, n;
128
- return p.value && (_.value && !A.value || !_.value && !((n = (o = (t = m.value) == null ? void 0 : t.my) == null ? void 0 : o.loans) != null && n.totalCount)) && Z.value === 1;
129
- }), x = C(() => w.value && v.value && !g.value), j = C(() => Object.values(P.value).reduce((t, o) => t + (o > 0 ? o : 0), 0)), H = C(() => {
142
+ return w.value && (_.value && !A.value || !_.value && !((n = (o = (t = p.value) == null ? void 0 : t.my) == null ? void 0 : o.loans) != null && n.totalCount)) && Z.value === 1;
143
+ }), x = C(() => f.value && v.value && !y.value), j = C(() => Object.values(P.value).reduce((t, o) => t + (o > 0 ? o : 0), 0)), H = C(() => {
130
144
  var o, n, s;
131
- if (g.value) {
132
- const a = `Supporting ${u.value} helps`;
145
+ if (c.isCompletingGoal)
146
+ return `Supporting ${d.value} meets your annual goal!`;
147
+ if (c.isLoanGoal)
148
+ return "You’re closer to reaching your annual goal!";
149
+ if (y.value) {
150
+ const a = `Supporting ${d.value} helps`;
133
151
  return ((o = l.value) == null ? void 0 : o.borrowerCount) > 1 || (n = l.value) != null && n.themes.includes("Social Enterprise") ? `${a} them invest in themselves.` : ((s = l.value) == null ? void 0 : s.gender) === "male" ? `${a} him invest in himself.` : `${a} her invest in herself.`;
134
152
  }
135
153
  if (x.value)
136
154
  return "You’re close to your next achievement!";
137
155
  const t = j.value > 1 ? `${j.value} achievements` : "your next achievement";
138
- return u.value ? `Supporting ${u.value} will reach ${t}!` : "Supporting this loan reaches an achievement!";
156
+ return d.value ? `Supporting ${d.value} will reach ${t}!` : "Supporting this loan reaches an achievement!";
139
157
  }), V = (t) => {
140
158
  t === "view-basket" ? i("close-redirect", { type: t, path: "/basket" }) : t === "support-another" && v.value && i("close-redirect", { type: t, path: v.value });
141
159
  }, K = (t) => {
@@ -146,19 +164,19 @@ const Q = {
146
164
  let n = [...document.querySelectorAll('[data-testid="header-basket"]')], s = n.find((L) => L == null ? void 0 : L.clientHeight);
147
165
  s || (n = [...document.querySelectorAll('[data-testid="header-about"]')], s = n.find((L) => L == null ? void 0 : L.clientHeight));
148
166
  const a = (s == null ? void 0 : s.getBoundingClientRect()) ?? null;
149
- a && (a == null ? void 0 : a.right) !== k.value && (k.value = a == null ? void 0 : a.right), o && (o == null ? void 0 : o.bottom) !== f.value && (f.value = o == null ? void 0 : o.bottom);
150
- }, c = G(M, 50);
167
+ a && (a == null ? void 0 : a.right) !== k.value && (k.value = a == null ? void 0 : a.right), o && (o == null ? void 0 : o.bottom) !== g.value && (g.value = o == null ? void 0 : o.bottom);
168
+ }, h = U(M, 50);
151
169
  return F(r, () => {
152
170
  r.value && M();
153
171
  }, { immediate: !0 }), O(() => {
154
- M(), window.addEventListener("scroll", c), window.addEventListener("resize", c);
172
+ M(), window.addEventListener("scroll", h), window.addEventListener("resize", h);
155
173
  }), z(() => {
156
- window.removeEventListener("scroll", c), window.removeEventListener("resize", c);
174
+ window.removeEventListener("scroll", h), window.removeEventListener("resize", h);
157
175
  }), {
158
176
  modalPosition: q,
159
177
  basketCount: Z,
160
- isFirstLoan: g,
161
- borrowerName: u,
178
+ isFirstLoan: y,
179
+ borrowerName: d,
162
180
  showOneAway: x,
163
181
  pillMsg: H,
164
182
  closeCartModal: K
@@ -187,11 +205,11 @@ const Q = {
187
205
  key: 2,
188
206
  class: "tw-text-h5"
189
207
  };
190
- function o1(b, i, r, l, m, A) {
191
- const p = B("KvCartPill"), w = B("KvCartModal");
192
- return r.modalVisible ? (d(), D(w, {
208
+ function o1(c, i, r, l, p, A) {
209
+ const w = E("KvCartPill"), f = E("KvCartModal");
210
+ return r.modalVisible ? (u(), D(f, {
193
211
  key: 0,
194
- style: R({
212
+ style: G({
195
213
  "--modal-right": `${l.modalPosition.right}px`,
196
214
  "--modal-top": `${l.modalPosition.top}px`
197
215
  }),
@@ -203,8 +221,8 @@ function o1(b, i, r, l, m, A) {
203
221
  onCartModalClosed: l.closeCartModal
204
222
  }, {
205
223
  content: S(() => [
206
- r.showModalContent || l.isFirstLoan ? (d(), h("div", X, [
207
- T(p, {
224
+ r.showModalContent || l.isFirstLoan ? (u(), m("div", X, [
225
+ R(w, {
208
226
  class: "!tw-w-full tw-justify-center",
209
227
  "borrower-name": l.borrowerName,
210
228
  "milestones-number": r.milestonesNumber,
@@ -213,12 +231,12 @@ function o1(b, i, r, l, m, A) {
213
231
  }, {
214
232
  icon: S(() => [
215
233
  e("div", {
216
- class: I({
234
+ class: T({
217
235
  // eslint-disable-next-line max-len
218
236
  "tw-flex tw-items-center tw-justify-center tw-bg-gray-100 tw-p-0.5 tw-rounded tw-whitespace-nowrap": l.showOneAway
219
237
  })
220
238
  }, [
221
- l.isFirstLoan ? (d(), h("svg", $, i[0] || (i[0] = [
239
+ l.isFirstLoan ? (u(), m("svg", $, i[0] || (i[0] = [
222
240
  e("path", {
223
241
  d: "M36.2676 17.5025C34.6519 30.5945 24.9878 35.8229 20.1847 38.0889C20.1496 38.1055 20.1099 38.1043 20.075 38.0873C8.60201 32.516 4.24979 22.9018 3.62911 17.5025C3.34064 14.6558 3.18678 8.5719 3.14406 5.7867C3.14315 5.72754 3.1847 5.67723 3.24194 5.66227C11.6312 3.46948 14.2758 3.52186 20.0937 1.86776C20.1175 1.86099 20.1437 1.86113 20.1673 1.86833C26.6496 3.83905 31.8224 4.23356 36.8613 5.66108C36.9176 5.67702 36.9559 5.72959 36.9546 5.78805C36.8227 11.47 36.4423 15.9605 36.2676 17.5025Z",
224
242
  fill: "#2AA967",
@@ -374,23 +392,23 @@ function o1(b, i, r, l, m, A) {
374
392
  })
375
393
  ])
376
394
  ], -1)
377
- ]))) : (d(), h("svg", e1, i[1] || (i[1] = [
395
+ ]))) : (u(), m("svg", e1, i[1] || (i[1] = [
378
396
  e("path", {
379
397
  d: "M9.0001 19L5.6251 20.125C5.50843 20.1583 5.4001 20.1833 5.3001 20.2C5.2001 20.2167 5.1001 20.225 5.0001 20.225C4.46676 20.225 4.0001 20.0375 3.6001 19.6625C3.2001 19.2875 3.0001 18.8083 3.0001 18.225V12.775L0.400098 8.55C0.300098 8.38333 0.225098 8.2125 0.175098 8.0375C0.125098 7.8625 0.100098 7.68333 0.100098 7.5C0.100098 7.31667 0.125098 7.1375 0.175098 6.9625C0.225098 6.7875 0.300098 6.61667 0.400098 6.45L3.8001 0.95C3.98343 0.65 4.2251 0.416667 4.5251 0.25C4.8251 0.0833333 5.1501 0 5.5001 0H12.5001C12.8501 0 13.1751 0.0833333 13.4751 0.25C13.7751 0.416667 14.0168 0.65 14.2001 0.95L17.6001 6.45C17.7001 6.61667 17.7751 6.7875 17.8251 6.9625C17.8751 7.1375 17.9001 7.31667 17.9001 7.5C17.9001 7.68333 17.8751 7.8625 17.8251 8.0375C17.7751 8.2125 17.7001 8.38333 17.6001 8.55L15.0001 12.775V18.225C15.0001 18.8083 14.8001 19.2875 14.4001 19.6625C14.0001 20.0375 13.5334 20.225 13.0001 20.225C12.9001 20.225 12.8001 20.2167 12.7001 20.2C12.6001 20.1833 12.4918 20.1583 12.3751 20.125L9.0001 19ZM5.5001 13H12.5001L15.9001 7.5L12.5001 2H5.5001L2.1001 7.5L5.5001 13ZM7.9501 8.75L11.4751 5.2C11.6584 5 11.8876 4.90417 12.1626 4.9125C12.4376 4.92083 12.6751 5.01667 12.8751 5.2C13.0751 5.4 13.1793 5.6375 13.1876 5.9125C13.1959 6.1875 13.1001 6.425 12.9001 6.625L8.6501 10.875C8.4501 11.075 8.21677 11.175 7.9501 11.175C7.68343 11.175 7.4501 11.075 7.2501 10.875L5.1251 8.75C4.9251 8.55 4.8251 8.3125 4.8251 8.0375C4.8251 7.7625 4.9251 7.525 5.1251 7.325C5.3251 7.125 5.5626 7.025 5.8376 7.025C6.1126 7.025 6.3501 7.125 6.5501 7.325L7.9501 8.75Z",
380
398
  fill: "#757575"
381
399
  }, null, -1)
382
400
  ]))),
383
- l.showOneAway ? (d(), h("div", t1, U(r.oneAwayText), 1)) : y("", !0)
401
+ l.showOneAway ? (u(), m("div", t1, I(r.oneAwayText), 1)) : b("", !0)
384
402
  ], 2)
385
403
  ]),
386
404
  _: 1
387
405
  }, 8, ["borrower-name", "milestones-number", "is-close-next-milestone", "custom-message"])
388
- ])) : y("", !0)
406
+ ])) : b("", !0)
389
407
  ]),
390
408
  _: 1
391
- }, 8, ["style", "visible", "photo-path", "basket-count", "category-name", "onCartModalClosed"])) : y("", !0);
409
+ }, 8, ["style", "visible", "photo-path", "basket-count", "category-name", "onCartModalClosed"])) : b("", !0);
392
410
  }
393
- const C1 = /* @__PURE__ */ J(Q, [["render", o1], ["__scopeId", "data-v-85b67e19"]]);
411
+ const C1 = /* @__PURE__ */ J(Q, [["render", o1], ["__scopeId", "data-v-5233d12c"]]);
394
412
  export {
395
413
  C1 as default
396
414
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.68.0",
3
+ "version": "6.69.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -114,5 +114,5 @@
114
114
  "embla-carousel-fade",
115
115
  "popper.js"
116
116
  ],
117
- "gitHead": "97959b8f544b02ef01dbf1a9b7b6d909da2d5cd1"
117
+ "gitHead": "222472dc213788d44e4f02686c4478ba70ec0b13"
118
118
  }