@kiva/kv-components 8.7.5 → 8.9.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
- .loan-card-use[data-v-c9a32dfb]:hover,.loan-card-use[data-v-c9a32dfb]:focus{--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1))}.loan-card-active-hover:hover .loan-card-use[data-v-c9a32dfb]{text-decoration-line:underline}.loan-card-progress[data-v-c9a32dfb]:hover,.loan-card-progress[data-v-c9a32dfb]:focus{text-decoration-line:none}.loan-card-use-text[data-v-c9a32dfb] p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-clamp:4;overflow:hidden;text-overflow:ellipsis}.loan-card-cta[data-v-c9a32dfb] form,.loan-card-cta[data-v-c9a32dfb] fieldset,.loan-card-cta[data-v-c9a32dfb] .tw-w-full,.loan-card-cta[data-v-c9a32dfb] button{height:40px!important;max-height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-c9a32dfb] .tw-inline-flex{height:40px!important;max-height:40px!important;min-height:40px!important}
1
+ .loan-card-use[data-v-b1272f83]:hover,.loan-card-use[data-v-b1272f83]:focus{--tw-text-opacity: 1;color:rgba(var(--text-primary),var(--tw-text-opacity, 1))}.loan-card-active-hover:hover .loan-card-use[data-v-b1272f83]{text-decoration-line:underline}.loan-card-progress[data-v-b1272f83]:hover,.loan-card-progress[data-v-b1272f83]:focus{text-decoration-line:none}.loan-card-use-text[data-v-b1272f83] p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-clamp:4;overflow:hidden;text-overflow:ellipsis}.loan-card-cta[data-v-b1272f83] form,.loan-card-cta[data-v-b1272f83] fieldset,.loan-card-cta[data-v-b1272f83] .tw-w-full,.loan-card-cta[data-v-b1272f83] button{height:40px!important;max-height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important}.loan-card-cta[data-v-b1272f83] .tw-inline-flex{height:40px!important;max-height:40px!important;min-height:40px!important}
@@ -2,8 +2,8 @@ import N from "./KvCompactLoanCard2.js";
2
2
  import { KV_COMPACT_LOAN_CARD_FRAGMENT as p, KV_COMPACT_LOAN_CARD_USER_FRAGMENT as $ } from "./KvCompactLoanCard2.js";
3
3
  import { resolveComponent as w, openBlock as a, createElementBlock as l, normalizeClass as c, createVNode as i, createCommentVNode as d, createElementVNode as r, normalizeStyle as T, createBlock as s, resolveDynamicComponent as u, withCtx as f, toDisplayString as k, withModifiers as P, Fragment as g, renderList as A } from "vue";
4
4
  import "./KvCompactLoanCard.css";
5
- import B from "../_virtual/_plugin-vue_export-helper.js";
6
- const V = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, R = { class: "tw-flex-shrink-0 tw-overflow-hidden" }, D = { class: "tw-flex tw-flex-col tw-items-start tw-gap-1 tw-flex-1 tw-min-w-0" }, S = {
5
+ import R from "../_virtual/_plugin-vue_export-helper.js";
6
+ const B = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, V = { class: "tw-flex-shrink-0 tw-overflow-hidden" }, D = { class: "tw-flex tw-flex-col tw-items-start tw-gap-1 tw-flex-1 tw-min-w-0" }, S = {
7
7
  key: 0,
8
8
  class: "tw-mb-0.5 tw-w-full"
9
9
  }, F = { class: "tw-text-primary !tw-font-medium tw-text-base tw-leading-normal tw-truncate" }, W = ["href"], j = { class: "tw-truncate" }, E = {
@@ -13,24 +13,24 @@ const V = { class: "tw-flex tw-flex-col tw-items-start tw-w-full" }, R = { class
13
13
  function z(h, o, t, e, G, H) {
14
14
  const b = w("kv-material-icon"), v = w("kv-borrower-image"), x = w("kv-loan-tag"), m = w("kv-loading-placeholder"), _ = w("kv-loan-use"), y = w("kv-loan-callouts"), L = w("kv-loan-progress-group"), C = w("kv-lend-cta");
15
15
  return a(), l("div", {
16
- class: c(["tw-flex tw-flex-col tw-items-start tw-justify-between tw-p-1 tw-bg-white tw-rounded-md tw-shadow-lg tw-w-full", { "tw-relative": t.showCloseButton, "!tw-p-1.5": t.showLightView }])
16
+ class: c(["tw-flex tw-flex-col tw-items-start tw-justify-between tw-p-1 tw-bg-white tw-rounded-md tw-shadow-lg tw-w-full", { "tw-relative": t.showRefreshButton, "!tw-p-1.5": t.showLightView }])
17
17
  }, [
18
- t.showCloseButton ? (a(), l("button", {
18
+ t.showRefreshButton ? (a(), l("button", {
19
19
  key: 0,
20
- class: "tw-absolute tw--top-1 tw--right-1 tw-p-0.5 tw-bg-white tw-rounded-full tw-w-2.5 tw-h-2.5 tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-drop-shadow-sm",
21
- onClick: o[0] || (o[0] = (...n) => e.handleCloseButton && e.handleCloseButton(...n))
20
+ class: "tw-absolute tw--top-1 tw--right-1 tw-bg-white tw-rounded-full tw-w-2.5 tw-h-2.5 tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-drop-shadow-sm",
21
+ onClick: o[0] || (o[0] = (...n) => e.handleRefreshButton && e.handleRefreshButton(...n))
22
22
  }, [
23
23
  i(b, {
24
- icon: e.mdiClose,
25
- class: "tw-w-1.5 tw-h-1.5"
24
+ icon: e.mdiCached,
25
+ class: "tw-w-2.5 tw-h-2.5 tw--scale-x-100 tw-text-gray-500"
26
26
  }, null, 8, ["icon"])
27
27
  ])) : d("", !0),
28
- r("div", V, [
28
+ r("div", B, [
29
29
  r("div", {
30
30
  class: c(["tw-flex tw-items-start tw-gap-2 tw-w-full loan-card-active-hover", { "!tw-gap-1": t.showLightView }]),
31
31
  style: T(e.customStyle)
32
32
  }, [
33
- r("div", R, [
33
+ r("div", V, [
34
34
  (a(), s(u(e.tag), {
35
35
  to: e.readMorePath,
36
36
  href: e.readMorePath,
@@ -240,7 +240,7 @@ function z(h, o, t, e, G, H) {
240
240
  ], 2)
241
241
  ], 2);
242
242
  }
243
- const Q = /* @__PURE__ */ B(N, [["render", z], ["__scopeId", "data-v-c9a32dfb"]]);
243
+ const Q = /* @__PURE__ */ R(N, [["render", z], ["__scopeId", "data-v-b1272f83"]]);
244
244
  export {
245
245
  p as KV_COMPACT_LOAN_CARD_FRAGMENT,
246
246
  $ as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
@@ -127,7 +127,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
127
127
  type: NumberConstructor;
128
128
  default: number;
129
129
  };
130
- showCloseButton: {
130
+ showRefreshButton: {
131
131
  type: BooleanConstructor;
132
132
  default: boolean;
133
133
  };
@@ -155,7 +155,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
155
155
  mdiMapMarker: string;
156
156
  mdiHome: string;
157
157
  mdiLink: string;
158
- mdiClose: string;
158
+ mdiCached: string;
159
159
  readMorePath: import('vue').ComputedRef<any>;
160
160
  state: import('vue').ComputedRef<any>;
161
161
  tag: import('vue').ComputedRef<"router-link" | "a">;
@@ -168,11 +168,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
168
168
  loanUseLoadingRows: import('vue').ComputedRef<3 | 4>;
169
169
  clickReadMore: (target: string, event: Event) => void;
170
170
  trackWebsiteClick: () => void;
171
- handleCloseButton: (event: any) => void;
171
+ handleRefreshButton: (event: any) => void;
172
172
  }, {}, {
173
173
  lendersNumber(): any;
174
174
  amountLent(): any;
175
- }, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("add-to-basket" | "remove-from-basket" | "jump-filter-page" | "close-button")[], "add-to-basket" | "remove-from-basket" | "jump-filter-page" | "close-button", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
175
+ }, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("add-to-basket" | "remove-from-basket" | "jump-filter-page" | "refresh-button")[], "add-to-basket" | "remove-from-basket" | "jump-filter-page" | "refresh-button", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
176
176
  loanId: {
177
177
  type: NumberConstructor;
178
178
  default: any;
@@ -297,7 +297,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
297
297
  type: NumberConstructor;
298
298
  default: number;
299
299
  };
300
- showCloseButton: {
300
+ showRefreshButton: {
301
301
  type: BooleanConstructor;
302
302
  default: boolean;
303
303
  };
@@ -309,7 +309,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
309
309
  "onAdd-to-basket"?: (...args: any[]) => any;
310
310
  "onRemove-from-basket"?: (...args: any[]) => any;
311
311
  "onJump-filter-page"?: (...args: any[]) => any;
312
- "onClose-button"?: (...args: any[]) => any;
312
+ "onRefresh-button"?: (...args: any[]) => any;
313
313
  }>, {
314
314
  loan: Record<string, any>;
315
315
  externalLinks: boolean;
@@ -340,7 +340,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
340
340
  website: string;
341
341
  showLoanUse: boolean;
342
342
  showLightView: boolean;
343
- showCloseButton: boolean;
343
+ showRefreshButton: boolean;
344
344
  customAmountLent: string;
345
345
  }, {}, {
346
346
  KvBorrowerImage: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
@@ -1,7 +1,7 @@
1
1
  import r from "graphql-tag";
2
- import F from "numeral";
2
+ import R from "numeral";
3
3
  import { computed as n } from "vue";
4
- import { mdiMapMarker as M, mdiHome as S, mdiLink as E, mdiClose as R } from "@mdi/js";
4
+ import { mdiMapMarker as F, mdiHome as M, mdiLink as S, mdiCached as E } from "@mdi/js";
5
5
  import { LOAN_CALLOUTS_FRAGMENT as O, LOAN_GEOCODE_FRAGMENT as G, LOAN_PROGRESS_FRAGMENT as P, loanCardComputedProperties as V, loanCardMethods as U } from "../utils/loanCard.js";
6
6
  import D from "./KvLoanUse.js";
7
7
  import $ from "./KvBorrowerImage.js";
@@ -15,7 +15,7 @@ import z from "./KvLoanTeamPick.js";
15
15
  import { KV_LEND_CTA_FRAGMENT as J, KV_LEND_CTA_USER_FRAGMENT as Q } from "./KvLendCta2.js";
16
16
  import { KV_LOAN_TAG_FRAGMENT as X } from "./KvLoanTag2.js";
17
17
  import { KV_LOAN_USE_FRAGMENT as Y } from "./KvLoanUse2.js";
18
- const Ce = r`
18
+ const ge = r`
19
19
  fragment KvCompactLoanCard on LoanBasic {
20
20
  id
21
21
  image {
@@ -43,7 +43,7 @@ const Ce = r`
43
43
  ${O}
44
44
  ${G}
45
45
  ${P}
46
- `, he = r`
46
+ `, Ce = r`
47
47
  fragment KvCompactLoanCardUser on LoanBasic {
48
48
  id
49
49
  ...KvLendCtaUser
@@ -187,7 +187,7 @@ const Ce = r`
187
187
  type: Number,
188
188
  default: 0
189
189
  },
190
- showCloseButton: {
190
+ showRefreshButton: {
191
191
  type: Boolean,
192
192
  default: !1
193
193
  },
@@ -197,7 +197,7 @@ const Ce = r`
197
197
  }
198
198
  },
199
199
  emits: [
200
- "close-button",
200
+ "refresh-button",
201
201
  "jump-filter-page",
202
202
  "add-to-basket",
203
203
  "remove-from-basket"
@@ -206,8 +206,8 @@ const Ce = r`
206
206
  const {
207
207
  allDataLoaded: a,
208
208
  borrowerName: i,
209
- city: l,
210
- countryName: s,
209
+ city: s,
210
+ countryName: l,
211
211
  distributionModel: u,
212
212
  formattedLocation: d,
213
213
  fundraisingPercent: m,
@@ -215,10 +215,10 @@ const Ce = r`
215
215
  imageHash: c,
216
216
  isLoading: p,
217
217
  loanAmount: L,
218
- loanBorrowerCount: y,
219
- loanCallouts: g,
220
- loanStatus: C,
221
- loanUse: h,
218
+ loanBorrowerCount: h,
219
+ loanCallouts: y,
220
+ loanStatus: g,
221
+ loanUse: C,
222
222
  readMorePath: A,
223
223
  state: _,
224
224
  tag: N,
@@ -238,8 +238,8 @@ const Ce = r`
238
238
  return {
239
239
  allDataLoaded: a,
240
240
  borrowerName: i,
241
- city: l,
242
- countryName: s,
241
+ city: s,
242
+ countryName: l,
243
243
  distributionModel: u,
244
244
  formattedLocation: d,
245
245
  formattedWebsite: v,
@@ -248,14 +248,14 @@ const Ce = r`
248
248
  imageHash: c,
249
249
  isLoading: p,
250
250
  loanAmount: L,
251
- loanBorrowerCount: y,
252
- loanCallouts: g,
253
- loanStatus: C,
254
- loanUse: h,
255
- mdiMapMarker: M,
256
- mdiHome: S,
257
- mdiLink: E,
258
- mdiClose: R,
251
+ loanBorrowerCount: h,
252
+ loanCallouts: y,
253
+ loanStatus: g,
254
+ loanUse: C,
255
+ mdiMapMarker: F,
256
+ mdiHome: M,
257
+ mdiLink: S,
258
+ mdiCached: E,
259
259
  readMorePath: A,
260
260
  state: _,
261
261
  tag: N,
@@ -267,8 +267,8 @@ const Ce = r`
267
267
  trackWebsiteClick: () => {
268
268
  e.kvTrackFunction("Lending", "click-Business Website", "Website", e.loanId);
269
269
  },
270
- handleCloseButton: (o) => {
271
- t("close-button", o);
270
+ handleRefreshButton: (o) => {
271
+ t("refresh-button", o);
272
272
  }
273
273
  };
274
274
  },
@@ -280,12 +280,12 @@ const Ce = r`
280
280
  amountLent() {
281
281
  var t, a;
282
282
  const e = ((a = (t = this.loan) == null ? void 0 : t.loanFundraisingInfo) == null ? void 0 : a.fundedAmount) ?? 0;
283
- return F(e).format("$0,0");
283
+ return R(e).format("$0,0");
284
284
  }
285
285
  }
286
286
  };
287
287
  export {
288
- Ce as KV_COMPACT_LOAN_CARD_FRAGMENT,
289
- he as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
288
+ ge as KV_COMPACT_LOAN_CARD_FRAGMENT,
289
+ Ce as KV_COMPACT_LOAN_CARD_USER_FRAGMENT,
290
290
  Ae as default
291
291
  };
@@ -1,94 +1,95 @@
1
- import u from "./KvContentfulImg2.js";
2
- import { openBlock as e, createElementBlock as h, createElementVNode as f, Fragment as c, renderList as w, createCommentVNode as n, normalizeStyle as o, createTextVNode as r, toDisplayString as m } from "vue";
3
- import x from "../_virtual/_plugin-vue_export-helper.js";
1
+ import w from "./KvContentfulImg2.js";
2
+ import { openBlock as e, createElementBlock as a, createElementVNode as h, Fragment as c, renderList as o, createCommentVNode as r, normalizeStyle as f, createTextVNode as m, toDisplayString as s } from "vue";
3
+ import u from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const b = {
5
5
  key: 0,
6
6
  class: "tw-inline-block tw-not-prose"
7
- }, g = {
7
+ }, x = {
8
8
  class: "tw-h-full tw-w-full",
9
9
  style: { "object-fit": "inherit" }
10
- }, y = ["media", "width", "height", "srcset"], s = ["media", "width", "height", "srcset"], _ = ["src", "alt", "loading"], k = ["srcset"], q = ["srcset", "src", "width", "height", "alt", "loading"], Q = {
10
+ }, F = ["media", "width", "height", "srcset"], y = ["media", "width", "height", "srcset"], g = ["src", "alt", "loading"], k = ["srcset"], _ = ["srcset", "src", "width", "height", "alt", "loading"], P = {
11
11
  key: 0,
12
12
  class: "tw-inline-block tw-mr-0.5 tw-align-middle",
13
13
  "aria-hidden": "true",
14
14
  role: "img"
15
15
  };
16
- function U(F, a, t, i, S, v) {
17
- return (t.width || t.height) && t.contentfulSrc ? (e(), h("figure", b, [
18
- f("picture", g, [
19
- t.sourceSizes.length > 0 ? (e(), h(c, { key: 0 }, [
20
- (e(!0), h(c, null, w(t.sourceSizes, (l, d) => (e(), h("source", {
16
+ function v(Q, n, i, t, U, S) {
17
+ return (i.width || i.height) && i.contentfulSrc ? (e(), a("figure", b, [
18
+ h("picture", x, [
19
+ i.sourceSizes.length > 0 ? (e(), a(c, { key: 0 }, [
20
+ t.isAnimatedGif ? r("", !0) : (e(!0), a(c, { key: 0 }, o(i.sourceSizes, (l, d) => (e(), a("source", {
21
21
  key: "webp-image" + d,
22
22
  media: "(" + l.media + ")",
23
23
  type: "image/webp",
24
24
  width: l.width ? l.width : null,
25
25
  height: l.height ? l.height : null,
26
26
  srcset: `
27
- ${i.buildUrl(l, 2)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(l.width, "2x")} 2x,
28
- ${i.buildUrl(l)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(l.width, "1x")} 1x`
29
- }, null, 8, y))), 128)),
30
- (e(!0), h(c, null, w(t.sourceSizes, (l, d) => (e(), h("source", {
27
+ ${t.buildUrl(l, 2)}${t.fitFocusParams}&fm=webp&q=${t.setQuality(l.width, "2x")} 2x,
28
+ ${t.buildUrl(l)}${t.fitFocusParams}&fm=webp&q=${t.setQuality(l.width, "1x")} 1x`
29
+ }, null, 8, F))), 128)),
30
+ (e(!0), a(c, null, o(i.sourceSizes, (l, d) => (e(), a("source", {
31
31
  key: "fallback-image" + d,
32
32
  media: "(" + l.media + ")",
33
33
  width: l.width ? l.width : null,
34
34
  height: l.height ? l.height : null,
35
35
  srcset: `
36
- ${i.buildUrl(l, 2)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(l.width, "2x")} 2x,
37
- ${i.buildUrl(l)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(l.width, "1x")} 1x`
38
- }, null, 8, s))), 128)),
39
- f("img", {
36
+ ${t.buildUrl(l, 2)}${t.fitFocusParams}${t.buildFormatQualityParams(t.effectiveFallbackFormat, l.width, "2x")} 2x,
37
+ ${t.buildUrl(l)}${t.fitFocusParams}${t.buildFormatQualityParams(t.effectiveFallbackFormat, l.width, "1x")} 1x`
38
+ }, null, 8, y))), 128)),
39
+ h("img", {
40
40
  class: "tw-max-w-full tw-max-h-full",
41
41
  style: { width: "inherit", height: "inherit", "object-fit": "inherit" },
42
- src: `${i.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "1x")}`,
43
- alt: i.caption || t.alt,
44
- loading: t.loading
45
- }, null, 8, _)
46
- ], 64)) : n("", !0),
47
- t.sourceSizes.length === 0 ? (e(), h(c, { key: 1 }, [
48
- f("source", {
42
+ src: `${t.buildUrl()}${t.fitFocusParams}${t.buildFormatQualityParams(t.effectiveFallbackFormat, i.width, "1x")}`,
43
+ alt: t.caption || i.alt,
44
+ loading: i.loading
45
+ }, null, 8, g)
46
+ ], 64)) : r("", !0),
47
+ i.sourceSizes.length === 0 ? (e(), a(c, { key: 1 }, [
48
+ t.isAnimatedGif ? r("", !0) : (e(), a("source", {
49
+ key: 0,
49
50
  type: "image/webp",
50
51
  srcset: `
51
- ${i.buildUrl(null, 2)}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(t.width, "2x")} 2x,
52
- ${i.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=webp&q=${i.setQuality(t.width, "1x")} 1x`
53
- }, null, 8, k),
54
- f("img", {
52
+ ${t.buildUrl(null, 2)}${t.fitFocusParams}&fm=webp&q=${t.setQuality(i.width, "2x")} 2x,
53
+ ${t.buildUrl()}${t.fitFocusParams}&fm=webp&q=${t.setQuality(i.width, "1x")} 1x`
54
+ }, null, 8, k)),
55
+ h("img", {
55
56
  class: "tw-max-w-full tw-max-h-full",
56
57
  style: { width: "inherit", height: "inherit", "object-fit": "inherit" },
57
58
  srcset: `
58
- ${i.buildUrl(null, 2)}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "2x")} 2x,
59
- ${i.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "1x")} 1x`,
60
- src: `${i.buildUrl()}&fit=${t.fit}&f=${t.focus}&fm=${t.fallbackFormat}&q=${i.setQuality(t.width, "1x")}`,
61
- width: t.width ? t.width : null,
62
- height: t.height ? t.height : null,
63
- alt: i.caption || t.alt,
64
- loading: t.loading
65
- }, null, 8, q)
66
- ], 64)) : n("", !0)
59
+ ${t.buildUrl(null, 2)}${t.fitFocusParams}${t.buildFormatQualityParams(t.effectiveFallbackFormat, i.width, "2x")} 2x,
60
+ ${t.buildUrl()}${t.fitFocusParams}${t.buildFormatQualityParams(t.effectiveFallbackFormat, i.width, "1x")} 1x`,
61
+ src: `${t.buildUrl()}${t.fitFocusParams}${t.buildFormatQualityParams(t.effectiveFallbackFormat, i.width, "1x")}`,
62
+ width: i.width ? i.width : null,
63
+ height: i.height ? i.height : null,
64
+ alt: t.caption || i.alt,
65
+ loading: i.loading
66
+ }, null, 8, _)
67
+ ], 64)) : r("", !0)
67
68
  ]),
68
- i.caption ? (e(), h("figcaption", {
69
+ t.caption ? (e(), a("figcaption", {
69
70
  key: 0,
70
71
  class: "tw-italic tw-my-1.5 tw-break-words tw-max-w-full tw-font-book tw-text-action-highlight",
71
- style: o({ maxWidth: t.width ? `${t.width}px` : void 0 })
72
+ style: f({ maxWidth: i.width ? `${i.width}px` : void 0 })
72
73
  }, [
73
- i.removeLeafIcon ? n("", !0) : (e(), h("span", Q, a[0] || (a[0] = [
74
- f("svg", {
74
+ t.removeLeafIcon ? r("", !0) : (e(), a("span", P, n[0] || (n[0] = [
75
+ h("svg", {
75
76
  width: "16",
76
77
  height: "12",
77
78
  viewBox: "0 0 16 12",
78
79
  fill: "none",
79
80
  xmlns: "http://www.w3.org/2000/svg"
80
81
  }, [
81
- f("path", {
82
+ h("path", {
82
83
  d: "M1.04689 11.2079C13.06 11.2079 15.8778 1.63084 15.8778 -1.6347e-07L14.831 -1.52692e-07C2.82661 -2.91013e-08 9.85148e-08 9.56873 1.15391e-07 11.2079L1.04689 11.2079Z",
83
84
  fill: "currentColor"
84
85
  })
85
86
  ], -1)
86
87
  ]))),
87
- r(" " + m(i.caption), 1)
88
- ], 4)) : n("", !0)
89
- ])) : n("", !0);
88
+ m(" " + s(t.caption), 1)
89
+ ], 4)) : r("", !0)
90
+ ])) : r("", !0);
90
91
  }
91
- const j = /* @__PURE__ */ x(u, [["render", U]]);
92
+ const L = /* @__PURE__ */ u(w, [["render", v]]);
92
93
  export {
93
- j as default
94
+ L as default
94
95
  };
@@ -12,7 +12,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
12
12
  };
13
13
  fallbackFormat: {
14
14
  type: StringConstructor;
15
- default: string;
15
+ default: any;
16
16
  validator(value: string): boolean;
17
17
  };
18
18
  width: {
@@ -48,8 +48,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
48
48
  default: () => any[];
49
49
  };
50
50
  }>, {
51
- buildUrl: (image?: any, multiplier?: number) => string;
51
+ buildFormatQualityParams: (format: string, imgWidth: string | number, scale: string) => string;
52
+ buildUrl: (image?: any, multiplier?: number) => any;
52
53
  caption: import('vue').ComputedRef<string>;
54
+ effectiveFallbackFormat: import('vue').ComputedRef<string>;
55
+ fitFocusParams: import('vue').ComputedRef<string>;
56
+ isAnimatedGif: import('vue').ComputedRef<boolean>;
53
57
  removeLeafIcon: import('vue').ComputedRef<boolean>;
54
58
  setQuality: (imgWidth: string | number, imgScale: string) => 65 | 95 | 80;
55
59
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -59,7 +63,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
59
63
  };
60
64
  fallbackFormat: {
61
65
  type: StringConstructor;
62
- default: string;
66
+ default: any;
63
67
  validator(value: string): boolean;
64
68
  };
65
69
  width: {
@@ -1,5 +1,5 @@
1
- import { toRefs as v, computed as f } from "vue";
2
- const S = {
1
+ import { toRefs as x, computed as i } from "vue";
2
+ const F = {
3
3
  props: {
4
4
  /**
5
5
  * Large, uncompressed image url that you get back from contentful.
@@ -10,11 +10,12 @@ const S = {
10
10
  },
11
11
  /**
12
12
  * If the browser can't support webp we fallback to this image format.
13
- * `jpg, png, webp`
13
+ * Defaults to the format derived from the source URL: gif→gif, png→png, jpg→jpg, webp→jpg.
14
+ * `jpg, png, gif`
14
15
  * */
15
16
  fallbackFormat: {
16
17
  type: String,
17
- default: "jpg",
18
+ default: null,
18
19
  validator(e) {
19
20
  return e === null || ["jpg", "png", "gif"].indexOf(e) !== -1;
20
21
  }
@@ -92,28 +93,42 @@ const S = {
92
93
  },
93
94
  setup(e) {
94
95
  const {
95
- alt: n,
96
- contentfulSrc: o,
97
- width: c,
98
- height: d
99
- } = v(e), p = (t = null, u = 1) => {
100
- let i = t && t.url ? `${t.url}?` : `${o.value}?`, r = t ? t.width : c.value, l = t ? t.height : d.value, a;
101
- return r >= 2e3 && (a = r / 1999, r = 1999, l = Math.round(l / a)), l >= 2e3 && (a = l / 1999, l = 1999, r = Math.round(r / a)), r && (i += `w=${r * u}`), r && l && (i += "&"), l && (i += `h=${l * u}`), i;
102
- }, s = (t, u) => u === "2x" ? 65 : t && parseInt(t.toString(), 10) < 200 ? 95 : 80, h = f(() => {
103
- if (n.value && n.value.charAt(0) === "^") {
104
- const t = n.value.charAt(1) === "#" ? 2 : 1;
105
- return n.value.slice(t).trim();
96
+ alt: a,
97
+ contentfulSrc: s,
98
+ width: p,
99
+ height: h
100
+ } = x(e), f = i(() => {
101
+ var r;
102
+ return (((r = s.value) == null ? void 0 : r.split("?")[0]) ?? "").toLowerCase().endsWith(".gif");
103
+ }), g = i(() => {
104
+ var r, u;
105
+ if (e.fallbackFormat) return e.fallbackFormat;
106
+ const t = (u = (r = s.value) == null ? void 0 : r.split("?")[0].split(".").pop()) == null ? void 0 : u.toLowerCase();
107
+ return t === "png" ? "png" : t === "gif" ? "gif" : "jpg";
108
+ }), v = i(() => f.value ? "" : `&fit=${e.fit}&f=${e.focus}`), m = (t = null, r = 1) => {
109
+ const u = t && t.url ? t.url : s.value;
110
+ if (f.value) return u;
111
+ let o = `${u}?`, l = t ? t.width : p.value, n = t ? t.height : h.value, c;
112
+ return l >= 2e3 && (c = l / 1999, l = 1999, n = Math.round(n / c)), n >= 2e3 && (c = n / 1999, n = 1999, l = Math.round(l / c)), l && (o += `w=${l * r}`), l && n && (o += "&"), n && (o += `h=${n * r}`), o;
113
+ }, d = (t, r) => r === "2x" ? 65 : t && parseInt(t.toString(), 10) < 200 ? 95 : 80, b = (t, r, u) => f.value ? "" : `&fm=${t}&q=${d(r, u)}`, y = i(() => {
114
+ if (a.value && a.value.charAt(0) === "^") {
115
+ const t = a.value.charAt(1) === "#" ? 2 : 1;
116
+ return a.value.slice(t).trim();
106
117
  }
107
118
  return "";
108
- }), g = f(() => !!(n.value && n.value.charAt(1) === "#"));
119
+ }), S = i(() => !!(a.value && a.value.charAt(1) === "#"));
109
120
  return {
110
- buildUrl: p,
111
- caption: h,
112
- removeLeafIcon: g,
113
- setQuality: s
121
+ buildFormatQualityParams: b,
122
+ buildUrl: m,
123
+ caption: y,
124
+ effectiveFallbackFormat: g,
125
+ fitFocusParams: v,
126
+ isAnimatedGif: f,
127
+ removeLeafIcon: S,
128
+ setQuality: d
114
129
  };
115
130
  }
116
131
  };
117
132
  export {
118
- S as default
133
+ F as default
119
134
  };
@@ -182,7 +182,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
182
182
  };
183
183
  fallbackFormat: {
184
184
  type: StringConstructor;
185
- default: string;
185
+ default: any;
186
186
  validator(value: string): boolean;
187
187
  };
188
188
  width: {
@@ -218,8 +218,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
218
218
  default: () => any[];
219
219
  };
220
220
  }>, {
221
- buildUrl: (image?: any, multiplier?: number) => string;
221
+ buildFormatQualityParams: (format: string, imgWidth: string | number, scale: string) => string;
222
+ buildUrl: (image?: any, multiplier?: number) => any;
222
223
  caption: import('vue').ComputedRef<string>;
224
+ effectiveFallbackFormat: import('vue').ComputedRef<string>;
225
+ fitFocusParams: import('vue').ComputedRef<string>;
226
+ isAnimatedGif: import('vue').ComputedRef<boolean>;
223
227
  removeLeafIcon: import('vue').ComputedRef<boolean>;
224
228
  setQuality: (imgWidth: string | number, imgScale: string) => 65 | 95 | 80;
225
229
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -229,7 +233,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
229
233
  };
230
234
  fallbackFormat: {
231
235
  type: StringConstructor;
232
- default: string;
236
+ default: any;
233
237
  validator(value: string): boolean;
234
238
  };
235
239
  width: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "8.7.5",
3
+ "version": "8.9.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": "205b6ec176cf4cbf5d8028e9ded54a67c56cb767"
128
+ "gitHead": "8e1a9900d6e8e1c8307875aad711ffa5080e1dd9"
129
129
  }