@kiva/kv-components 10.6.0 → 10.6.1

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.
Files changed (223) hide show
  1. package/dist/index.js +20 -20
  2. package/dist/vue/KvAccordionItem.js +1 -1
  3. package/dist/vue/KvActivityRow.js +1 -1
  4. package/dist/vue/KvAtbModal.js +1 -1
  5. package/dist/vue/KvBorrowerImage.js +1 -1
  6. package/dist/vue/KvButton.js +1 -1
  7. package/dist/vue/KvCardFrame.js +1 -1
  8. package/dist/vue/KvCarousel.js +1 -1
  9. package/dist/vue/KvCartModal.js +1 -1
  10. package/dist/vue/KvCartPill.js +1 -1
  11. package/dist/vue/KvCheckbox.js +1 -1
  12. package/dist/vue/KvCheckoutReceipt.js +1 -1
  13. package/dist/vue/KvChip.js +1 -1
  14. package/dist/vue/KvClassicLoanCard.js +252 -295
  15. package/dist/vue/KvClassicLoanCard.script.js +298 -0
  16. package/dist/vue/KvCommentsAdd.js +2 -2
  17. package/dist/vue/KvCommentsContainer.js +2 -2
  18. package/dist/vue/KvCommentsHeartButton.js +1 -1
  19. package/dist/vue/KvCommentsList.js +1 -1
  20. package/dist/vue/KvCommentsListItem.js +2 -2
  21. package/dist/vue/KvCommentsReplyButton.js +1 -1
  22. package/dist/vue/KvCompactLoanCard.js +416 -380
  23. package/dist/vue/KvCompactLoanCard.script.js +382 -0
  24. package/dist/vue/KvContentfulImg.js +1 -1
  25. package/dist/vue/KvCountdownTimer.js +1 -1
  26. package/dist/vue/KvDatePicker.js +1 -1
  27. package/dist/vue/KvExpandable.js +1 -1
  28. package/dist/vue/KvExpandableQuestion.js +1 -1
  29. package/dist/vue/KvFlag.js +1 -1
  30. package/dist/vue/KvFormAssemblyForm.js +2 -95
  31. package/dist/vue/KvFormAssemblyForm.script.js +97 -0
  32. package/dist/vue/KvGrid.js +1 -1
  33. package/dist/vue/KvIconBag.js +1 -1
  34. package/dist/vue/KvIconButton.js +2 -116
  35. package/dist/vue/KvIconButton.script.js +118 -0
  36. package/dist/vue/KvImageUpload.js +1 -1
  37. package/dist/vue/KvImpactVerticalSelector.js +1 -1
  38. package/dist/vue/KvInlineActivityCard.js +1 -1
  39. package/dist/vue/KvInlineActivityFeed.js +1 -1
  40. package/dist/vue/KvIntroductionLoanCard.js +247 -220
  41. package/dist/vue/KvIntroductionLoanCard.script.js +223 -0
  42. package/dist/vue/KvLendAmountButton.js +1 -1
  43. package/dist/vue/KvLendCta.js +355 -389
  44. package/dist/vue/KvLendCta.script.js +391 -0
  45. package/dist/vue/KvLightbox.js +1 -1
  46. package/dist/vue/KvLineGraph.js +1 -1
  47. package/dist/vue/KvLoadingSpinner.js +1 -1
  48. package/dist/vue/KvLoanActivities.js +75 -149
  49. package/dist/vue/KvLoanActivities.script.js +151 -0
  50. package/dist/vue/KvLoanBookmark.js +22 -33
  51. package/dist/vue/KvLoanBookmark.script.js +35 -0
  52. package/dist/vue/KvLoanCallouts.js +1 -1
  53. package/dist/vue/KvLoanInfoCard.js +2 -2
  54. package/dist/vue/KvLoanProgressGroup.js +1 -1
  55. package/dist/vue/KvLoanTag.js +44 -123
  56. package/dist/vue/KvLoanTag.script.js +125 -0
  57. package/dist/vue/KvLoanUse.js +14 -111
  58. package/dist/vue/KvLoanUse.script.js +113 -0
  59. package/dist/vue/KvMap.js +1 -1
  60. package/dist/vue/KvMaterialIcon.js +1 -1
  61. package/dist/vue/KvPageContainer.js +1 -1
  62. package/dist/vue/KvPagination.js +1 -1
  63. package/dist/vue/KvPieChart.js +1 -1
  64. package/dist/vue/KvPieChartV2.js +1 -1
  65. package/dist/vue/KvPill.js +1 -1
  66. package/dist/vue/KvPopper.js +1 -1
  67. package/dist/vue/KvProgressBar.js +1 -1
  68. package/dist/vue/KvProgressCircle.js +1 -1
  69. package/dist/vue/KvPulsingDot.js +1 -1
  70. package/dist/vue/KvRadio.js +1 -1
  71. package/dist/vue/KvSecondaryNav.js +1 -1
  72. package/dist/vue/KvSelect.js +1 -1
  73. package/dist/vue/KvSideSheet.js +1 -1
  74. package/dist/vue/KvSimpleMap.js +1 -1
  75. package/dist/vue/KvStackedBarGraph.js +1 -1
  76. package/dist/vue/KvSwitch.js +1 -1
  77. package/dist/vue/KvTab.js +1 -1
  78. package/dist/vue/KvTabPanel.js +1 -1
  79. package/dist/vue/KvTabs.js +1 -1
  80. package/dist/vue/KvTextInput.js +1 -1
  81. package/dist/vue/KvTextLink.js +1 -1
  82. package/dist/vue/KvThemeProvider.js +1 -1
  83. package/dist/vue/KvToast.js +1 -1
  84. package/dist/vue/KvTooltip.js +1 -1
  85. package/dist/vue/KvTreeMapChart.js +1 -1
  86. package/dist/vue/KvUserAvatar.js +1 -1
  87. package/dist/vue/KvUtilityMenu.js +1 -1
  88. package/dist/vue/KvVerticalCarousel.js +1 -1
  89. package/dist/vue/KvVotingCard.js +1 -1
  90. package/dist/vue/KvVotingCardV2.js +1 -1
  91. package/dist/vue/KvWideLoanCard.js +206 -232
  92. package/dist/vue/KvWideLoanCard.script.js +235 -0
  93. package/dist/vue/KvWwwHeader/KvHeaderAboutMenu.js +1 -1
  94. package/dist/vue/KvWwwHeader/KvHeaderDropdownLink.js +1 -1
  95. package/dist/vue/KvWwwHeader/KvHeaderLinkBar.js +1 -1
  96. package/dist/vue/KvWwwHeader/KvHeaderLogo.js +1 -1
  97. package/dist/vue/KvWwwHeader/KvHeaderMobileMenu.js +1 -1
  98. package/dist/vue/KvWwwHeader/KvHeaderMyKivaMenu.js +1 -1
  99. package/dist/vue/KvWwwHeader/KvHeaderTakeActionMenu.js +1 -1
  100. package/dist/vue/KvWwwHeader/LendMenu/KvLendListMenu.js +1 -1
  101. package/dist/vue/KvWwwHeader/LendMenu/KvLendMegaMenu.js +1 -1
  102. package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu.js +1 -1
  103. package/dist/vue/KvWwwHeader/LendMenu/KvLendMenuCountryList.js +1 -1
  104. package/dist/vue/KvWwwHeader/LendMenu/KvLendMenuSearchList.js +1 -1
  105. package/dist/vue/KvWwwHeader.js +1 -1
  106. package/dist/vue/KvWwwHeaderBasic/AboutMenu.js +1 -1
  107. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.js +1 -1
  108. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.js +1 -1
  109. package/dist/vue/KvWwwHeaderBasic/LinkBar.js +1 -1
  110. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/CategoriesPanel.js +1 -1
  111. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.js +1 -1
  112. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MyKivaPanel.js +1 -1
  113. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/RegionsPanel.js +1 -1
  114. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.js +1 -1
  115. package/dist/vue/KvWwwHeaderBasic/MobileMenu.js +1 -1
  116. package/dist/vue/KvWwwHeaderBasic/MyKivaMenu.js +1 -1
  117. package/dist/vue/KvWwwHeaderBasic/SearchBar.js +1 -1
  118. package/package.json +2 -2
  119. package/vite.config.ts +16 -13
  120. package/dist/vue/KvClassicLoanCard2.js +0 -255
  121. package/dist/vue/KvCompactLoanCard2.js +0 -418
  122. package/dist/vue/KvFormAssemblyForm2.js +0 -4
  123. package/dist/vue/KvIconButton2.js +0 -4
  124. package/dist/vue/KvIntroductionLoanCard2.js +0 -250
  125. package/dist/vue/KvLendCta2.js +0 -357
  126. package/dist/vue/KvLoanActivities2.js +0 -77
  127. package/dist/vue/KvLoanBookmark2.js +0 -24
  128. package/dist/vue/KvLoanTag2.js +0 -46
  129. package/dist/vue/KvLoanUse2.js +0 -16
  130. package/dist/vue/KvWideLoanCard2.js +0 -209
  131. /package/dist/vue/{KvAccordionItem2.js → KvAccordionItem.script.js} +0 -0
  132. /package/dist/vue/{KvActivityRow2.js → KvActivityRow.script.js} +0 -0
  133. /package/dist/vue/{KvAtbModal2.js → KvAtbModal.script.js} +0 -0
  134. /package/dist/vue/{KvBorrowerImage2.js → KvBorrowerImage.script.js} +0 -0
  135. /package/dist/vue/{KvButton2.js → KvButton.script.js} +0 -0
  136. /package/dist/vue/{KvCardFrame2.js → KvCardFrame.script.js} +0 -0
  137. /package/dist/vue/{KvCarousel2.js → KvCarousel.script.js} +0 -0
  138. /package/dist/vue/{KvCartModal2.js → KvCartModal.script.js} +0 -0
  139. /package/dist/vue/{KvCartPill2.js → KvCartPill.script.js} +0 -0
  140. /package/dist/vue/{KvCheckbox2.js → KvCheckbox.script.js} +0 -0
  141. /package/dist/vue/{KvCheckoutReceipt2.js → KvCheckoutReceipt.script.js} +0 -0
  142. /package/dist/vue/{KvChip2.js → KvChip.script.js} +0 -0
  143. /package/dist/vue/{KvCommentsAdd2.js → KvCommentsAdd.script.js} +0 -0
  144. /package/dist/vue/{KvCommentsContainer2.js → KvCommentsContainer.script.js} +0 -0
  145. /package/dist/vue/{KvCommentsHeartButton2.js → KvCommentsHeartButton.script.js} +0 -0
  146. /package/dist/vue/{KvCommentsList2.js → KvCommentsList.script.js} +0 -0
  147. /package/dist/vue/{KvCommentsListItem2.js → KvCommentsListItem.script.js} +0 -0
  148. /package/dist/vue/{KvCommentsReplyButton2.js → KvCommentsReplyButton.script.js} +0 -0
  149. /package/dist/vue/{KvContentfulImg2.js → KvContentfulImg.script.js} +0 -0
  150. /package/dist/vue/{KvCountdownTimer2.js → KvCountdownTimer.script.js} +0 -0
  151. /package/dist/vue/{KvDatePicker2.js → KvDatePicker.script.js} +0 -0
  152. /package/dist/vue/{KvExpandable2.js → KvExpandable.script.js} +0 -0
  153. /package/dist/vue/{KvExpandableQuestion2.js → KvExpandableQuestion.script.js} +0 -0
  154. /package/dist/vue/{KvFlag2.js → KvFlag.script.js} +0 -0
  155. /package/dist/vue/{KvGrid2.js → KvGrid.script.js} +0 -0
  156. /package/dist/vue/{KvIconBag2.js → KvIconBag.script.js} +0 -0
  157. /package/dist/vue/{KvImageUpload2.js → KvImageUpload.script.js} +0 -0
  158. /package/dist/vue/{KvImpactVerticalSelector2.js → KvImpactVerticalSelector.script.js} +0 -0
  159. /package/dist/vue/{KvInlineActivityCard2.js → KvInlineActivityCard.script.js} +0 -0
  160. /package/dist/vue/{KvInlineActivityFeed2.js → KvInlineActivityFeed.script.js} +0 -0
  161. /package/dist/vue/{KvLendAmountButton2.js → KvLendAmountButton.script.js} +0 -0
  162. /package/dist/vue/{KvLightbox2.js → KvLightbox.script.js} +0 -0
  163. /package/dist/vue/{KvLineGraph2.js → KvLineGraph.script.js} +0 -0
  164. /package/dist/vue/{KvLoadingSpinner2.js → KvLoadingSpinner.script.js} +0 -0
  165. /package/dist/vue/{KvLoanCallouts2.js → KvLoanCallouts.script.js} +0 -0
  166. /package/dist/vue/{KvLoanProgressGroup2.js → KvLoanProgressGroup.script.js} +0 -0
  167. /package/dist/vue/{KvMap2.js → KvMap.script.js} +0 -0
  168. /package/dist/vue/{KvMaterialIcon2.js → KvMaterialIcon.script.js} +0 -0
  169. /package/dist/vue/{KvPageContainer2.js → KvPageContainer.script.js} +0 -0
  170. /package/dist/vue/{KvPagination2.js → KvPagination.script.js} +0 -0
  171. /package/dist/vue/{KvPieChart2.js → KvPieChart.script.js} +0 -0
  172. /package/dist/vue/{KvPieChartV22.js → KvPieChartV2.script.js} +0 -0
  173. /package/dist/vue/{KvPill2.js → KvPill.script.js} +0 -0
  174. /package/dist/vue/{KvPopper2.js → KvPopper.script.js} +0 -0
  175. /package/dist/vue/{KvProgressBar2.js → KvProgressBar.script.js} +0 -0
  176. /package/dist/vue/{KvProgressCircle2.js → KvProgressCircle.script.js} +0 -0
  177. /package/dist/vue/{KvPulsingDot2.js → KvPulsingDot.script.js} +0 -0
  178. /package/dist/vue/{KvRadio2.js → KvRadio.script.js} +0 -0
  179. /package/dist/vue/{KvSecondaryNav2.js → KvSecondaryNav.script.js} +0 -0
  180. /package/dist/vue/{KvSelect2.js → KvSelect.script.js} +0 -0
  181. /package/dist/vue/{KvSideSheet2.js → KvSideSheet.script.js} +0 -0
  182. /package/dist/vue/{KvSimpleMap2.js → KvSimpleMap.script.js} +0 -0
  183. /package/dist/vue/{KvStackedBarGraph2.js → KvStackedBarGraph.script.js} +0 -0
  184. /package/dist/vue/{KvSwitch2.js → KvSwitch.script.js} +0 -0
  185. /package/dist/vue/{KvTab2.js → KvTab.script.js} +0 -0
  186. /package/dist/vue/{KvTabPanel2.js → KvTabPanel.script.js} +0 -0
  187. /package/dist/vue/{KvTabs2.js → KvTabs.script.js} +0 -0
  188. /package/dist/vue/{KvTextInput2.js → KvTextInput.script.js} +0 -0
  189. /package/dist/vue/{KvTextLink2.js → KvTextLink.script.js} +0 -0
  190. /package/dist/vue/{KvThemeProvider2.js → KvThemeProvider.script.js} +0 -0
  191. /package/dist/vue/{KvToast2.js → KvToast.script.js} +0 -0
  192. /package/dist/vue/{KvTooltip2.js → KvTooltip.script.js} +0 -0
  193. /package/dist/vue/{KvTreeMapChart2.js → KvTreeMapChart.script.js} +0 -0
  194. /package/dist/vue/{KvUserAvatar2.js → KvUserAvatar.script.js} +0 -0
  195. /package/dist/vue/{KvUtilityMenu2.js → KvUtilityMenu.script.js} +0 -0
  196. /package/dist/vue/{KvVerticalCarousel2.js → KvVerticalCarousel.script.js} +0 -0
  197. /package/dist/vue/{KvVotingCard2.js → KvVotingCard.script.js} +0 -0
  198. /package/dist/vue/{KvVotingCardV22.js → KvVotingCardV2.script.js} +0 -0
  199. /package/dist/vue/KvWwwHeader/{KvHeaderAboutMenu2.js → KvHeaderAboutMenu.script.js} +0 -0
  200. /package/dist/vue/KvWwwHeader/{KvHeaderDropdownLink2.js → KvHeaderDropdownLink.script.js} +0 -0
  201. /package/dist/vue/KvWwwHeader/{KvHeaderLinkBar2.js → KvHeaderLinkBar.script.js} +0 -0
  202. /package/dist/vue/KvWwwHeader/{KvHeaderLogo2.js → KvHeaderLogo.script.js} +0 -0
  203. /package/dist/vue/KvWwwHeader/{KvHeaderMobileMenu2.js → KvHeaderMobileMenu.script.js} +0 -0
  204. /package/dist/vue/KvWwwHeader/{KvHeaderMyKivaMenu2.js → KvHeaderMyKivaMenu.script.js} +0 -0
  205. /package/dist/vue/KvWwwHeader/{KvHeaderTakeActionMenu2.js → KvHeaderTakeActionMenu.script.js} +0 -0
  206. /package/dist/vue/KvWwwHeader/LendMenu/{KvLendListMenu2.js → KvLendListMenu.script.js} +0 -0
  207. /package/dist/vue/KvWwwHeader/LendMenu/{KvLendMegaMenu2.js → KvLendMegaMenu.script.js} +0 -0
  208. /package/dist/vue/KvWwwHeader/LendMenu/{KvLendMenu2.js → KvLendMenu.script.js} +0 -0
  209. /package/dist/vue/KvWwwHeader/LendMenu/{KvLendMenuCountryList2.js → KvLendMenuCountryList.script.js} +0 -0
  210. /package/dist/vue/KvWwwHeader/LendMenu/{KvLendMenuSearchList2.js → KvLendMenuSearchList.script.js} +0 -0
  211. /package/dist/vue/{KvWwwHeader2.js → KvWwwHeader.script.js} +0 -0
  212. /package/dist/vue/KvWwwHeaderBasic/{AboutMenu2.js → AboutMenu.script.js} +0 -0
  213. /package/dist/vue/KvWwwHeaderBasic/{HeaderMenuGroup2.js → HeaderMenuGroup.script.js} +0 -0
  214. /package/dist/vue/KvWwwHeaderBasic/{KvWwwHeaderBasic2.js → KvWwwHeaderBasic.script.js} +0 -0
  215. /package/dist/vue/KvWwwHeaderBasic/{LinkBar2.js → LinkBar.script.js} +0 -0
  216. /package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/{CategoriesPanel2.js → CategoriesPanel.script.js} +0 -0
  217. /package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/{MobileLendMenu2.js → MobileLendMenu.script.js} +0 -0
  218. /package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/{MyKivaPanel2.js → MyKivaPanel.script.js} +0 -0
  219. /package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/{RegionsPanel2.js → RegionsPanel.script.js} +0 -0
  220. /package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/{SearchPanel2.js → SearchPanel.script.js} +0 -0
  221. /package/dist/vue/KvWwwHeaderBasic/{MobileMenu2.js → MobileMenu.script.js} +0 -0
  222. /package/dist/vue/KvWwwHeaderBasic/{MyKivaMenu2.js → MyKivaMenu.script.js} +0 -0
  223. /package/dist/vue/KvWwwHeaderBasic/{SearchBar2.js → SearchBar.script.js} +0 -0
@@ -1,113 +1,16 @@
1
- import u from "graphql-tag";
2
- import l from "numeral";
3
- import { truncateStringByWords as i } from "../utils/loanUtils.js";
4
- const r = "direct", o = (e) => e.charAt(0).toUpperCase() + e.slice(1), t = (e) => e.charAt(0).toLowerCase() + e.slice(1), m = u`
5
- fragment KvLoanUse on LoanBasic {
6
- id
7
- anonymizationLevel
8
- use
9
- loanAmount
10
- status
11
- borrowerCount
12
- name
13
- distributionModel
14
- whySpecial
15
- }
16
- `, f = {
17
- name: "KvLoanUse",
18
- props: {
19
- anonymizationLevel: {
20
- type: String,
21
- default: "none"
22
- },
23
- use: {
24
- type: String,
25
- default: ""
26
- },
27
- loanAmount: {
28
- type: String,
29
- default: ""
30
- },
31
- status: {
32
- type: String,
33
- default: ""
34
- },
35
- borrowerCount: {
36
- type: Number,
37
- default: 1
38
- },
39
- name: {
40
- type: String,
41
- default: ""
42
- },
43
- distributionModel: {
44
- type: String,
45
- default: r
46
- },
47
- whySpecial: {
48
- type: String,
49
- default: ""
50
- },
51
- hideLoanAmount: {
52
- type: Boolean,
53
- default: !1
54
- },
55
- // Unlike hideLoanAmount, this drops the name and country too and never shows a read-more link.
56
- hideBorrowerDetails: {
57
- type: Boolean,
58
- default: !1
59
- },
60
- boldName: {
61
- type: Boolean,
62
- default: !1
63
- },
64
- country: {
65
- type: String,
66
- default: ""
67
- },
68
- useIndicativeHelpText: {
69
- type: Boolean,
70
- default: !1
71
- },
72
- showReadMore: {
73
- type: Boolean,
74
- default: !1
75
- },
76
- truncateWordsNumber: {
77
- type: Number,
78
- default: 0
79
- }
80
- },
81
- computed: {
82
- helpLanguage() {
83
- return this.status === "fundraising" || this.status === "inactive" || this.status === "reviewed" ? "helps" : "helped";
84
- },
85
- isDirect() {
86
- return this.distributionModel === r;
87
- },
88
- whySpecialSentence() {
89
- return this.whySpecial ? ` This loan is special because ${t(this.whySpecial)}` : "";
90
- },
91
- nameSpan() {
92
- return this.boldName ? this.country ? `<span class="data-hj-suppress tw-font-medium">${this.name} in ${this.country}</span>` : `<span class="data-hj-suppress tw-font-medium">${this.name}</span>` : `<span class="data-hj-suppress">${this.name}</span>`;
93
- },
94
- loanUse() {
95
- if (this.anonymizationLevel === "full" || this.use.length === 0)
96
- return "For the borrower's privacy, this loan has been made anonymous.";
97
- if (this.hideBorrowerDetails)
98
- return `${o(this.helpLanguage)} ${t(this.use)}${this.whySpecialSentence}`;
99
- if (this.hideLoanAmount) {
100
- const n = this.useIndicativeHelpText ? this.helpLanguage : "Help";
101
- let a = `${o(n)} ${this.nameSpan} ${t(this.use)} ${this.whySpecialSentence}`;
102
- return this.showReadMore && (a = `${i(a, this.truncateWordsNumber)} <span class=" tw-text-action tw-underline">read more</span>`), a;
103
- }
104
- const e = this.borrowerCount > 1;
105
- let s = `${l(this.loanAmount).format("$0,0")} ${this.isDirect ? "to" : this.helpLanguage} ${e ? "a member of " : ""}${this.nameSpan} ${this.isDirect ? `${this.helpLanguage} ` : ""}${t(this.use)}${this.whySpecialSentence}`;
106
- return this.showReadMore && (s = `${i(s, this.truncateWordsNumber)} <span class=" tw-text-action tw-underline">read more</span>`), s;
107
- }
108
- }
109
- };
1
+ import o from "./KvLoanUse.script.js";
2
+ import { KV_LOAN_USE_FRAGMENT as E } from "./KvLoanUse.script.js";
3
+ import { openBlock as r, createElementBlock as n } from "vue";
4
+ import t from "../_virtual/_plugin-vue_export-helper.js";
5
+ const c = ["innerHTML"];
6
+ function s(_, p, a, l, m, e) {
7
+ return r(), n("p", {
8
+ class: "tw-line-clamp-4",
9
+ innerHTML: e.loanUse
10
+ }, null, 8, c);
11
+ }
12
+ const u = /* @__PURE__ */ t(o, [["render", s]]);
110
13
  export {
111
- m as KV_LOAN_USE_FRAGMENT,
112
- f as default
14
+ E as KV_LOAN_USE_FRAGMENT,
15
+ u as default
113
16
  };
@@ -0,0 +1,113 @@
1
+ import u from "graphql-tag";
2
+ import l from "numeral";
3
+ import { truncateStringByWords as i } from "../utils/loanUtils.js";
4
+ const r = "direct", o = (e) => e.charAt(0).toUpperCase() + e.slice(1), t = (e) => e.charAt(0).toLowerCase() + e.slice(1), m = u`
5
+ fragment KvLoanUse on LoanBasic {
6
+ id
7
+ anonymizationLevel
8
+ use
9
+ loanAmount
10
+ status
11
+ borrowerCount
12
+ name
13
+ distributionModel
14
+ whySpecial
15
+ }
16
+ `, f = {
17
+ name: "KvLoanUse",
18
+ props: {
19
+ anonymizationLevel: {
20
+ type: String,
21
+ default: "none"
22
+ },
23
+ use: {
24
+ type: String,
25
+ default: ""
26
+ },
27
+ loanAmount: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ status: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ borrowerCount: {
36
+ type: Number,
37
+ default: 1
38
+ },
39
+ name: {
40
+ type: String,
41
+ default: ""
42
+ },
43
+ distributionModel: {
44
+ type: String,
45
+ default: r
46
+ },
47
+ whySpecial: {
48
+ type: String,
49
+ default: ""
50
+ },
51
+ hideLoanAmount: {
52
+ type: Boolean,
53
+ default: !1
54
+ },
55
+ // Unlike hideLoanAmount, this drops the name and country too and never shows a read-more link.
56
+ hideBorrowerDetails: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ boldName: {
61
+ type: Boolean,
62
+ default: !1
63
+ },
64
+ country: {
65
+ type: String,
66
+ default: ""
67
+ },
68
+ useIndicativeHelpText: {
69
+ type: Boolean,
70
+ default: !1
71
+ },
72
+ showReadMore: {
73
+ type: Boolean,
74
+ default: !1
75
+ },
76
+ truncateWordsNumber: {
77
+ type: Number,
78
+ default: 0
79
+ }
80
+ },
81
+ computed: {
82
+ helpLanguage() {
83
+ return this.status === "fundraising" || this.status === "inactive" || this.status === "reviewed" ? "helps" : "helped";
84
+ },
85
+ isDirect() {
86
+ return this.distributionModel === r;
87
+ },
88
+ whySpecialSentence() {
89
+ return this.whySpecial ? ` This loan is special because ${t(this.whySpecial)}` : "";
90
+ },
91
+ nameSpan() {
92
+ return this.boldName ? this.country ? `<span class="data-hj-suppress tw-font-medium">${this.name} in ${this.country}</span>` : `<span class="data-hj-suppress tw-font-medium">${this.name}</span>` : `<span class="data-hj-suppress">${this.name}</span>`;
93
+ },
94
+ loanUse() {
95
+ if (this.anonymizationLevel === "full" || this.use.length === 0)
96
+ return "For the borrower's privacy, this loan has been made anonymous.";
97
+ if (this.hideBorrowerDetails)
98
+ return `${o(this.helpLanguage)} ${t(this.use)}${this.whySpecialSentence}`;
99
+ if (this.hideLoanAmount) {
100
+ const n = this.useIndicativeHelpText ? this.helpLanguage : "Help";
101
+ let a = `${o(n)} ${this.nameSpan} ${t(this.use)} ${this.whySpecialSentence}`;
102
+ return this.showReadMore && (a = `${i(a, this.truncateWordsNumber)} <span class=" tw-text-action tw-underline">read more</span>`), a;
103
+ }
104
+ const e = this.borrowerCount > 1;
105
+ let s = `${l(this.loanAmount).format("$0,0")} ${this.isDirect ? "to" : this.helpLanguage} ${e ? "a member of " : ""}${this.nameSpan} ${this.isDirect ? `${this.helpLanguage} ` : ""}${t(this.use)}${this.whySpecialSentence}`;
106
+ return this.showReadMore && (s = `${i(s, this.truncateWordsNumber)} <span class=" tw-text-action tw-underline">read more</span>`), s;
107
+ }
108
+ }
109
+ };
110
+ export {
111
+ m as KV_LOAN_USE_FRAGMENT,
112
+ f as default
113
+ };
package/dist/vue/KvMap.js CHANGED
@@ -1,4 +1,4 @@
1
- import l from "./KvMap2.js";
1
+ import l from "./KvMap.script.js";
2
2
  import { openBlock as r, createElementBlock as o, normalizeStyle as a, createElementVNode as c } from "vue";
3
3
  import "./KvMap.css";
4
4
  import i from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import n from "./KvMaterialIcon2.js";
1
+ import n from "./KvMaterialIcon.script.js";
2
2
  import { openBlock as t, createElementBlock as e, createElementVNode as r } from "vue";
3
3
  import c from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const i = {
@@ -1,4 +1,4 @@
1
- import e from "./KvPageContainer2.js";
1
+ import e from "./KvPageContainer.script.js";
2
2
  import { openBlock as o, createElementBlock as r, renderSlot as s } from "vue";
3
3
  import n from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const p = {
@@ -1,4 +1,4 @@
1
- import d from "./KvPagination2.js";
1
+ import d from "./KvPagination.script.js";
2
2
  import { resolveComponent as k, openBlock as a, createElementBlock as s, createElementVNode as r, normalizeClass as i, createVNode as c, Fragment as u, renderList as g, createTextVNode as m, createCommentVNode as C, toDisplayString as _ } from "vue";
3
3
  import f from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const v = { "aria-label": "Pagination" }, x = {
@@ -1,4 +1,4 @@
1
- import f from "./KvPieChart2.js";
1
+ import f from "./KvPieChart.script.js";
2
2
  import { resolveComponent as x, openBlock as l, createElementBlock as n, createElementVNode as o, createVNode as g, Fragment as c, renderList as d, normalizeStyle as w, toDisplayString as s, createCommentVNode as m, createTextVNode as h } from "vue";
3
3
  import "./KvPieChart.css";
4
4
  import k from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import y from "./KvPieChartV22.js";
1
+ import y from "./KvPieChartV2.script.js";
2
2
  import { resolveComponent as x, openBlock as l, createElementBlock as o, normalizeStyle as s, createElementVNode as r, normalizeClass as k, createCommentVNode as n, Fragment as d, renderList as c, toDisplayString as w, createBlock as _, withCtx as b } from "vue";
3
3
  import "./KvPieChartV2.css";
4
4
  import u from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import o from "./KvPill2.js";
1
+ import o from "./KvPill.script.js";
2
2
  import { openBlock as r, createElementBlock as a, normalizeClass as l, renderSlot as s, createElementVNode as n } from "vue";
3
3
  import c from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const d = {
@@ -1,4 +1,4 @@
1
- import r from "./KvPopper2.js";
1
+ import r from "./KvPopper.script.js";
2
2
  import { openBlock as s, createBlock as i, Transition as n, withCtx as a, withDirectives as l, createElementVNode as c, normalizeStyle as d, renderSlot as f, vShow as m } from "vue";
3
3
  import p from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const _ = ["aria-hidden"];
@@ -1,4 +1,4 @@
1
- import t from "./KvProgressBar2.js";
1
+ import t from "./KvProgressBar.script.js";
2
2
  import { openBlock as r, createElementBlock as n, normalizeClass as l, createElementVNode as o, normalizeStyle as i } from "vue";
3
3
  import s from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const u = ["aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow"];
@@ -1,4 +1,4 @@
1
- import c from "./KvProgressCircle2.js";
1
+ import c from "./KvProgressCircle.script.js";
2
2
  import { openBlock as o, createElementBlock as a, createElementVNode as t, normalizeStyle as i, normalizeClass as s, Fragment as l, toDisplayString as n, createCommentVNode as d } from "vue";
3
3
  import "./KvProgressCircle.css";
4
4
  import f from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import t from "./KvPulsingDot2.js";
1
+ import t from "./KvPulsingDot.script.js";
2
2
  import { openBlock as l, createElementBlock as r, createElementVNode as e, normalizeClass as s } from "vue";
3
3
  import "./KvPulsingDot.css";
4
4
  import c from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import a from "./KvRadio2.js";
1
+ import a from "./KvRadio.script.js";
2
2
  import { openBlock as o, createElementBlock as d, normalizeStyle as c, normalizeClass as r, createElementVNode as i, mergeProps as w, toHandlers as f, withModifiers as m, createCommentVNode as h, renderSlot as u } from "vue";
3
3
  import v from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const b = ["for"], _ = ["id", "checked", "name", "value", "disabled"], g = {
@@ -1,4 +1,4 @@
1
- import x from "./KvSecondaryNav2.js";
1
+ import x from "./KvSecondaryNav.script.js";
2
2
  import { resolveComponent as d, openBlock as a, createBlock as c, withCtx as l, createElementVNode as r, normalizeClass as i, createVNode as s, createElementBlock as o, resolveDynamicComponent as v, Fragment as m, createTextVNode as g, toDisplayString as h, createCommentVNode as y, renderList as b } from "vue";
3
3
  import "./KvSecondaryNav.css";
4
4
  import C from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import s from "./KvSelect2.js";
1
+ import s from "./KvSelect.script.js";
2
2
  import { resolveComponent as d, openBlock as c, createElementBlock as w, normalizeStyle as m, normalizeClass as i, createElementVNode as l, withDirectives as f, mergeProps as p, renderSlot as u, vModelSelect as _, createVNode as v } from "vue";
3
3
  import "./KvSelect.css";
4
4
  import b from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import y from "./KvSideSheet2.js";
1
+ import y from "./KvSideSheet.script.js";
2
2
  import { resolveComponent as m, openBlock as n, createElementBlock as w, withModifiers as g, normalizeClass as a, createElementVNode as o, normalizeStyle as d, createVNode as f, createCommentVNode as r, toDisplayString as S, renderSlot as h } from "vue";
3
3
  import b from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const k = { class: "tw-flex tw-gap-1.5" }, v = {
@@ -1,4 +1,4 @@
1
- import o from "./KvSimpleMap2.js";
1
+ import o from "./KvSimpleMap.script.js";
2
2
  import "./KvSimpleMap.css";
3
3
  import p from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const a = /* @__PURE__ */ p(o, [["__scopeId", "data-v-8c42534e"]]);
@@ -1,4 +1,4 @@
1
- import g from "./KvStackedBarGraph2.js";
1
+ import g from "./KvStackedBarGraph.script.js";
2
2
  import { openBlock as a, createElementBlock as r, createElementVNode as l, toDisplayString as s, Fragment as o, renderList as n, normalizeStyle as y, createTextVNode as w, createCommentVNode as _, withKeys as x, withModifiers as k } from "vue";
3
3
  import "./KvStackedBarGraph.css";
4
4
  import m from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import n from "./KvSwitch2.js";
1
+ import n from "./KvSwitch.script.js";
2
2
  import { openBlock as a, createElementBlock as c, normalizeStyle as d, normalizeClass as i, createElementVNode as t, mergeProps as w, toHandlers as f, withModifiers as u, renderSlot as h } from "vue";
3
3
  import m from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const b = ["for"], v = ["id", "checked", "disabled"], g = { class: "tw-flex-1 peer-focus-visible:tw-ring-2 peer-focus-visible:tw-ring-action" };
package/dist/vue/KvTab.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./KvTab2.js";
1
+ import o from "./KvTab.script.js";
2
2
  import { openBlock as l, createElementBlock as n, normalizeClass as c, renderSlot as d } from "vue";
3
3
  import s from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const b = ["id", "aria-selected", "aria-controls", "tabindex"];
@@ -1,4 +1,4 @@
1
- import o from "./KvTabPanel2.js";
1
+ import o from "./KvTabPanel.script.js";
2
2
  import { openBlock as a, createBlock as l, Transition as r, withCtx as c, withDirectives as n, createElementBlock as s, renderSlot as d, vShow as v } from "vue";
3
3
  import f from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const b = ["id", "aria-hidden", "aria-labelledby"];
@@ -1,4 +1,4 @@
1
- import w from "./KvTabs2.js";
1
+ import w from "./KvTabs.script.js";
2
2
  import { openBlock as d, createElementBlock as s, normalizeClass as l, createElementVNode as o, renderSlot as i, normalizeStyle as m } from "vue";
3
3
  import c from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const f = { class: "tw-relative" };
@@ -1,4 +1,4 @@
1
- import u from "./KvTextInput2.js";
1
+ import u from "./KvTextInput.script.js";
2
2
  import { resolveComponent as m, openBlock as l, createElementBlock as w, normalizeStyle as f, normalizeClass as c, createElementVNode as i, mergeProps as g, toHandlers as v, createBlock as s, createCommentVNode as a, withDirectives as b, createVNode as h, vShow as y, renderSlot as x } from "vue";
3
3
  import "./KvTextInput.css";
4
4
  import _ from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import r from "./KvTextLink2.js";
1
+ import r from "./KvTextLink.script.js";
2
2
  import { resolveComponent as l, openBlock as o, createBlock as n, resolveDynamicComponent as c, normalizeClass as s, withCtx as m, renderSlot as w, createCommentVNode as d } from "vue";
3
3
  import f from "../_virtual/_plugin-vue_export-helper.js";
4
4
  function u(a, _, t, e, k, x) {
@@ -1,4 +1,4 @@
1
- import r from "./KvThemeProvider2.js";
1
+ import r from "./KvThemeProvider.script.js";
2
2
  import { openBlock as o, createBlock as a, resolveDynamicComponent as m, normalizeStyle as n, withCtx as l, renderSlot as c } from "vue";
3
3
  import "./KvThemeProvider.css";
4
4
  import i from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import d from "./KvToast2.js";
1
+ import d from "./KvToast.script.js";
2
2
  import { resolveComponent as l, openBlock as n, createElementBlock as s, createVNode as i, Transition as f, withCtx as r, createElementVNode as o, normalizeClass as g, createBlock as v, renderSlot as y, createCommentVNode as p } from "vue";
3
3
  import _ from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const x = {
@@ -1,4 +1,4 @@
1
- import f from "./KvTooltip2.js";
1
+ import f from "./KvTooltip.script.js";
2
2
  import { resolveComponent as c, openBlock as l, createBlock as v, normalizeClass as w, withCtx as u, createElementVNode as i, normalizeStyle as n, createElementBlock as p, renderSlot as s, createCommentVNode as a } from "vue";
3
3
  import "./KvTooltip.css";
4
4
  import k from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import h from "./KvTreeMapChart2.js";
1
+ import h from "./KvTreeMapChart.script.js";
2
2
  import { resolveComponent as i, openBlock as t, createElementBlock as c, Fragment as w, renderList as f, normalizeStyle as d, createBlock as m, createCommentVNode as n, normalizeClass as y, createElementVNode as _, toDisplayString as l, withCtx as u, createTextVNode as p } from "vue";
3
3
  import "./KvTreeMapChart.css";
4
4
  import g from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import w from "./KvUserAvatar2.js";
1
+ import w from "./KvUserAvatar.script.js";
2
2
  import { resolveComponent as s, openBlock as a, createElementBlock as t, normalizeClass as i, createBlock as h, createCommentVNode as r, createElementVNode as o, withDirectives as v, createVNode as f, vShow as _, normalizeStyle as c, toDisplayString as k } from "vue";
3
3
  import "./KvUserAvatar.css";
4
4
  import g from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import m from "./KvUtilityMenu2.js";
1
+ import m from "./KvUtilityMenu.script.js";
2
2
  import { resolveComponent as s, resolveDirective as d, openBlock as l, createElementBlock as o, normalizeClass as n, withDirectives as a, withModifiers as h, createVNode as v, createElementVNode as b, normalizeStyle as f, renderSlot as g, vShow as _ } from "vue";
3
3
  import k from "../_virtual/_plugin-vue_export-helper.js";
4
4
  function z(r, i, t, e, C, S) {
@@ -1,4 +1,4 @@
1
- import m from "./KvVerticalCarousel2.js";
1
+ import m from "./KvVerticalCarousel.script.js";
2
2
  import { resolveComponent as f, openBlock as r, createElementBlock as a, createElementVNode as l, normalizeStyle as u, Fragment as y, renderList as b, renderSlot as v, normalizeClass as h, createVNode as s, withModifiers as k, createBlock as d, createCommentVNode as x } from "vue";
3
3
  import p from "../_virtual/_plugin-vue_export-helper.js";
4
4
  const g = {
@@ -1,4 +1,4 @@
1
- import u from "./KvVotingCard2.js";
1
+ import u from "./KvVotingCard.script.js";
2
2
  import { resolveComponent as s, openBlock as o, createElementBlock as r, createElementVNode as t, renderSlot as v, toDisplayString as c, createBlock as a, createCommentVNode as n, withCtx as x, createTextVNode as g } from "vue";
3
3
  import "./KvVotingCard.css";
4
4
  import h from "../_virtual/_plugin-vue_export-helper.js";
@@ -1,4 +1,4 @@
1
- import x from "./KvVotingCardV22.js";
1
+ import x from "./KvVotingCardV2.script.js";
2
2
  import { resolveComponent as l, openBlock as s, createElementBlock as c, normalizeStyle as b, createElementVNode as o, toDisplayString as n, createTextVNode as w, createCommentVNode as r, createVNode as d, createBlock as h, withCtx as a } from "vue";
3
3
  import "./KvVotingCardV2.css";
4
4
  import g from "../_virtual/_plugin-vue_export-helper.js";