@kiva/kv-components 3.17.0 → 3.18.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.
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.18.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.17.0...@kiva/kv-components@3.18.0) (2023-05-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* "view loan" CTA ([aa10cf1](https://github.com/kiva/kv-ui-elements/commit/aa10cf17a1ca4978b97fc9541522f31d95cc886f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.17.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.16.0...@kiva/kv-components@3.17.0) (2023-05-05)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0",
|
|
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": "
|
|
78
|
+
"gitHead": "68db3fee0d19c1708e9ac97cf69e04ca97fadd62"
|
|
79
79
|
}
|
|
@@ -193,9 +193,12 @@
|
|
|
193
193
|
:is-adding="isAdding"
|
|
194
194
|
:enable-five-dollars-notes="enableFiveDollarsNotes"
|
|
195
195
|
:kv-track-function="kvTrackFunction"
|
|
196
|
+
:show-view-loan="showViewLoan"
|
|
197
|
+
:custom-loan-details="customLoanDetails"
|
|
196
198
|
class="tw-mt-auto"
|
|
197
199
|
:class="{ 'tw-w-full' : unreservedAmount <= 0 }"
|
|
198
200
|
@add-to-basket="$emit('add-to-basket', $event)"
|
|
201
|
+
@show-loan-details="clickReadMore('ViewLoan')"
|
|
199
202
|
/>
|
|
200
203
|
</div>
|
|
201
204
|
</div>
|
|
@@ -283,6 +286,10 @@ export default {
|
|
|
283
286
|
type: String,
|
|
284
287
|
required: true,
|
|
285
288
|
},
|
|
289
|
+
showViewLoan: {
|
|
290
|
+
type: Boolean,
|
|
291
|
+
default: false,
|
|
292
|
+
},
|
|
286
293
|
},
|
|
287
294
|
data() {
|
|
288
295
|
return {
|
package/vue/KvLendCta.vue
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<kv-ui-button
|
|
4
|
+
v-if="showViewLoan"
|
|
5
|
+
:state="`${allSharesReserved ? 'disabled' : ''}`"
|
|
6
|
+
:to="customLoanDetails ? '' : `/lend/${loanId}`"
|
|
7
|
+
class="tw-mb-0"
|
|
8
|
+
@click="$emit('show-loan-details')"
|
|
9
|
+
>
|
|
10
|
+
<span class="tw-flex">
|
|
11
|
+
View loan
|
|
12
|
+
<kv-material-icon
|
|
13
|
+
class="tw-w-3 tw-h-3 tw-align-middle"
|
|
14
|
+
:icon="mdiChevronRight"
|
|
15
|
+
/>
|
|
16
|
+
</span>
|
|
17
|
+
</kv-ui-button>
|
|
3
18
|
<form
|
|
4
|
-
v-if="useFormSubmit"
|
|
19
|
+
v-else-if="useFormSubmit"
|
|
5
20
|
class="tw-w-full tw-flex"
|
|
6
21
|
@submit.prevent="addToBasket"
|
|
7
22
|
>
|
|
@@ -45,7 +60,7 @@
|
|
|
45
60
|
|
|
46
61
|
<!-- Lend again/lent previously button -->
|
|
47
62
|
<kv-ui-button
|
|
48
|
-
v-if="showLendAgain"
|
|
63
|
+
v-else-if="showLendAgain"
|
|
49
64
|
key="lendAgainButton"
|
|
50
65
|
class="lend-again"
|
|
51
66
|
data-testid="bp-lend-cta-lend-again-button"
|
|
@@ -109,9 +124,11 @@
|
|
|
109
124
|
|
|
110
125
|
<script>
|
|
111
126
|
import numeral from 'numeral';
|
|
127
|
+
import { mdiChevronRight } from '@mdi/js';
|
|
112
128
|
import KvLendAmountButton from './KvLendAmountButton.vue';
|
|
113
129
|
import KvUiSelect from './KvSelect.vue';
|
|
114
130
|
import KvUiButton from './KvButton.vue';
|
|
131
|
+
import KvMaterialIcon from './KvMaterialIcon.vue';
|
|
115
132
|
|
|
116
133
|
export default {
|
|
117
134
|
name: 'KvLendCta',
|
|
@@ -119,6 +136,7 @@ export default {
|
|
|
119
136
|
KvLendAmountButton,
|
|
120
137
|
KvUiButton,
|
|
121
138
|
KvUiSelect,
|
|
139
|
+
KvMaterialIcon,
|
|
122
140
|
},
|
|
123
141
|
props: {
|
|
124
142
|
loan: {
|
|
@@ -145,9 +163,18 @@ export default {
|
|
|
145
163
|
type: Function,
|
|
146
164
|
required: true,
|
|
147
165
|
},
|
|
166
|
+
showViewLoan: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: false,
|
|
169
|
+
},
|
|
170
|
+
customLoanDetails: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: false,
|
|
173
|
+
},
|
|
148
174
|
},
|
|
149
175
|
data() {
|
|
150
176
|
return {
|
|
177
|
+
mdiChevronRight,
|
|
151
178
|
selectedOption: this.getSelectedOption(this.loan?.unreservedAmount),
|
|
152
179
|
};
|
|
153
180
|
},
|
|
@@ -26,6 +26,7 @@ const story = (args) => {
|
|
|
26
26
|
:is-bookmarked="isBookmarked"
|
|
27
27
|
:kv-track-function="kvTrackFunction"
|
|
28
28
|
:photo-path="photoPath"
|
|
29
|
+
:show-view-loan="showViewLoan"
|
|
29
30
|
/>
|
|
30
31
|
</div>
|
|
31
32
|
`,
|
|
@@ -204,3 +205,11 @@ export const FiveDollarNotes = story({
|
|
|
204
205
|
kvTrackFunction,
|
|
205
206
|
photoPath,
|
|
206
207
|
});
|
|
208
|
+
|
|
209
|
+
export const ViewLoan = story({
|
|
210
|
+
loanId: loan.id,
|
|
211
|
+
loan,
|
|
212
|
+
kvTrackFunction,
|
|
213
|
+
photoPath,
|
|
214
|
+
showViewLoan: true,
|
|
215
|
+
});
|
|
@@ -18,6 +18,8 @@ const story = (args) => {
|
|
|
18
18
|
:is-adding="isAdding"
|
|
19
19
|
:enable-five-dollars-notes="enableFiveDollarsNotes"
|
|
20
20
|
:kv-track-function="kvTrackFunction"
|
|
21
|
+
:show-view-loan="showViewLoan"
|
|
22
|
+
:custom-loan-details="customLoanDetails"
|
|
21
23
|
/>
|
|
22
24
|
</div>
|
|
23
25
|
`,
|
|
@@ -102,3 +104,13 @@ export const LendAgain = story({
|
|
|
102
104
|
},
|
|
103
105
|
kvTrackFunction,
|
|
104
106
|
});
|
|
107
|
+
|
|
108
|
+
export const ViewLoan = story({
|
|
109
|
+
isLoading: false,
|
|
110
|
+
loan: {
|
|
111
|
+
id: 1,
|
|
112
|
+
unreservedAmount: '150.00',
|
|
113
|
+
},
|
|
114
|
+
kvTrackFunction,
|
|
115
|
+
showViewLoan: true,
|
|
116
|
+
});
|