@kiva/kv-components 3.82.0 → 3.82.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.82.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.82.0...@kiva/kv-components@3.82.1) (2024-06-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * loan card button secondary action and destination ([#411](https://github.com/kiva/kv-ui-elements/issues/411)) ([9cf20db](https://github.com/kiva/kv-ui-elements/commit/9cf20dbd9865a685ae19a5a4d553bb3345c680b8))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.82.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.81.0...@kiva/kv-components@3.82.0) (2024-06-03)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.82.0",
3
+ "version": "3.82.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -75,5 +75,5 @@
75
75
  "optional": true
76
76
  }
77
77
  },
78
- "gitHead": "013324187e1f8cf1639a3cc6d3e29495d26e69fe"
78
+ "gitHead": "cde8d379527232294da84dde985729ec92479c65"
79
79
  }
package/vue/KvLendCta.vue CHANGED
@@ -6,9 +6,9 @@
6
6
  variant="secondary"
7
7
  class="tw-inline-flex tw-flex-1"
8
8
  data-testid="bp-lend-cta-checkout-button"
9
- :to="!externalLinks || secondaryButtonHandler ? '/basket' : undefined"
10
- :href="externalLinks || secondaryButtonHandler ? '/basket' : undefined"
11
- @click.native="clickSecondaryButton"
9
+ :to="!externalLinks ? '/basket' : undefined"
10
+ :href="externalLinks ? '/basket' : undefined"
11
+ @click.native="clickSecondaryButton($event)"
12
12
  >
13
13
  {{ loanInBasketButtonText }}
14
14
  </kv-ui-button>
@@ -407,8 +407,10 @@ export default {
407
407
  clickDropdown() {
408
408
  this.kvTrackFunction('Lending', 'click-Modify loan amount', 'open dialog', this.loanId, this.loanId);
409
409
  },
410
- clickSecondaryButton() {
410
+ clickSecondaryButton(event) {
411
411
  if (this.secondaryButtonHandler) {
412
+ event.preventDefault();
413
+ event.stopPropagation();
412
414
  // Custom secondary button behavior
413
415
  this.secondaryButtonHandler();
414
416
  } else {
@@ -23,6 +23,8 @@ const story = (args) => {
23
23
  :custom-loan-details="customLoanDetails"
24
24
  :enable-huge-amount="enableHugeAmount"
25
25
  :is-visitor="isVisitor"
26
+ :secondary-button-handler="secondaryButtonHandler"
27
+ :external-links="externalLinks"
26
28
  />
27
29
  </div>
28
30
  `,
@@ -33,6 +35,8 @@ const story = (args) => {
33
35
 
34
36
  const kvTrackFunction = () => { };
35
37
 
38
+ const secondaryButtonHandler = () => { console.log('secondary button handler'); };
39
+
36
40
  export const Loading = story({ isLoading: true, kvTrackFunction });
37
41
 
38
42
  export const Adding = story({ isLoading: false, isAdding: true, kvTrackFunction });
@@ -49,6 +53,20 @@ export const Basketed = story({
49
53
  kvTrackFunction,
50
54
  });
51
55
 
56
+ export const BasketedWithSecondaryAction = story({
57
+ isLoading: false,
58
+ loan: { id: 1 },
59
+ basketItems: [
60
+ {
61
+ __typename: 'LoanReservation',
62
+ id: 1,
63
+ },
64
+ ],
65
+ externalLinks: true,
66
+ kvTrackFunction,
67
+ secondaryButtonHandler,
68
+ });
69
+
52
70
  export const Funded = story({
53
71
  isLoading: false,
54
72
  loan: { status: 'funded' },