@kiva/kv-components 3.71.2 → 3.72.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 +11 -0
- package/package.json +2 -2
- package/vue/KvClassicLoanCard.vue +8 -0
- package/vue/KvLendCta.vue +35 -1
- package/vue/KvLoanActivities.vue +10 -0
- package/vue/KvWideLoanCard.vue +6 -0
- package/vue/stories/KvClassicLoanCard.stories.js +13 -0
- package/vue/stories/KvLendCta.stories.js +24 -0
- package/vue/stories/KvWideLoanCard.stories.js +13 -0
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.72.0](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.71.2...@kiva/kv-components@3.72.0) (2024-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* huge lent amount added to lend cta dropdown ([#387](https://github.com/kiva/kv-ui-elements/issues/387)) ([0874f5c](https://github.com/kiva/kv-ui-elements/commit/0874f5c888bb388fc9e9f7dc857f2c92b919c78b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [3.71.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.71.1...@kiva/kv-components@3.71.2) (2024-04-03)
|
|
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.72.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": "4948d2fb45e6c10fd6251788a8b1051a1761c9b8"
|
|
79
79
|
}
|
|
@@ -219,6 +219,8 @@
|
|
|
219
219
|
:user-balance="userBalance"
|
|
220
220
|
:get-cookie="getCookie"
|
|
221
221
|
:set-cookie="setCookie"
|
|
222
|
+
:enable-huge-amount="enableHugeAmount"
|
|
223
|
+
:is-visitor="isVisitor"
|
|
222
224
|
class="tw-mt-auto"
|
|
223
225
|
:class="{ 'tw-w-full' : unreservedAmount <= 0 }"
|
|
224
226
|
@add-to-basket="$emit('add-to-basket', $event)"
|
|
@@ -246,6 +248,8 @@
|
|
|
246
248
|
:get-cookie="getCookie"
|
|
247
249
|
:set-cookie="setCookie"
|
|
248
250
|
:error-msg="errorMsg"
|
|
251
|
+
:enable-huge-amount="enableHugeAmount"
|
|
252
|
+
:is-visitor="isVisitor"
|
|
249
253
|
@add-to-basket="$emit('add-to-basket', $event)"
|
|
250
254
|
/>
|
|
251
255
|
</div>
|
|
@@ -383,6 +387,10 @@ export default {
|
|
|
383
387
|
type: String,
|
|
384
388
|
default: '',
|
|
385
389
|
},
|
|
390
|
+
enableHugeAmount: {
|
|
391
|
+
type: Boolean,
|
|
392
|
+
default: false,
|
|
393
|
+
},
|
|
386
394
|
},
|
|
387
395
|
setup(props) {
|
|
388
396
|
const {
|
package/vue/KvLendCta.vue
CHANGED
|
@@ -199,6 +199,14 @@ export default {
|
|
|
199
199
|
type: Boolean,
|
|
200
200
|
default: false,
|
|
201
201
|
},
|
|
202
|
+
enableHugeAmount: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
default: false,
|
|
205
|
+
},
|
|
206
|
+
isVisitor: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: true,
|
|
209
|
+
},
|
|
202
210
|
},
|
|
203
211
|
data() {
|
|
204
212
|
return {
|
|
@@ -420,11 +428,37 @@ export default {
|
|
|
420
428
|
}
|
|
421
429
|
return priceArray;
|
|
422
430
|
},
|
|
431
|
+
buildHugePriceArray(amountLeft) {
|
|
432
|
+
const minAmount = 100;
|
|
433
|
+
const limitAmount = amountLeft > 1000 ? 1000 : amountLeft;
|
|
434
|
+
const N = limitAmount / minAmount;
|
|
435
|
+
|
|
436
|
+
const priceArray = [];
|
|
437
|
+
for (let i = 1; i <= N; i += 1) {
|
|
438
|
+
const price = minAmount * i + 500;
|
|
439
|
+
if (price > limitAmount) break;
|
|
440
|
+
priceArray.push(numeral(price).format('0,0'));
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
if (!priceArray.includes(numeral(limitAmount).format('0,0'))) {
|
|
444
|
+
priceArray.push(numeral(limitAmount).format('0,0'));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return priceArray;
|
|
448
|
+
},
|
|
423
449
|
getDropdownPriceArray(unreservedAmount, minAmount, enableFiveDollarsNotes, inPfp = false) {
|
|
424
450
|
const parsedAmountLeft = parseFloat(unreservedAmount);
|
|
425
|
-
|
|
451
|
+
let combinedPricesArray = [];
|
|
452
|
+
const priceArray = (enableFiveDollarsNotes && !inPfp)
|
|
426
453
|
? this.build5DollarsPriceArray(parsedAmountLeft).slice(0, 28)
|
|
427
454
|
: this.buildPriceArray(parsedAmountLeft, minAmount).slice(0, 20);
|
|
455
|
+
|
|
456
|
+
const showHugeAmount = this.enableHugeAmount && parsedAmountLeft > 500 && !this.isVisitor;
|
|
457
|
+
if (showHugeAmount) {
|
|
458
|
+
const hugePriceArray = this.buildHugePriceArray(parsedAmountLeft);
|
|
459
|
+
combinedPricesArray = priceArray.concat(hugePriceArray);
|
|
460
|
+
}
|
|
461
|
+
return showHugeAmount ? combinedPricesArray : priceArray;
|
|
428
462
|
},
|
|
429
463
|
},
|
|
430
464
|
};
|
package/vue/KvLoanActivities.vue
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
:basket-items="basketItems"
|
|
66
66
|
:route="route"
|
|
67
67
|
:is-adding="isAdding"
|
|
68
|
+
:enable-huge-amount="enableHugeAmount"
|
|
69
|
+
:is-visitor="isVisitor"
|
|
68
70
|
:enable-five-dollars-notes="enableFiveDollarsNotes"
|
|
69
71
|
@add-to-basket="$emit('add-to-basket', $event)"
|
|
70
72
|
/>
|
|
@@ -164,6 +166,14 @@ export default {
|
|
|
164
166
|
type: Boolean,
|
|
165
167
|
default: false,
|
|
166
168
|
},
|
|
169
|
+
enableHugeAmount: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: false,
|
|
172
|
+
},
|
|
173
|
+
isVisitor: {
|
|
174
|
+
type: Boolean,
|
|
175
|
+
default: true,
|
|
176
|
+
},
|
|
167
177
|
},
|
|
168
178
|
emits: [
|
|
169
179
|
'add-to-basket',
|
package/vue/KvWideLoanCard.vue
CHANGED
|
@@ -215,6 +215,8 @@
|
|
|
215
215
|
:user-balance="userBalance"
|
|
216
216
|
:get-cookie="getCookie"
|
|
217
217
|
:set-cookie="setCookie"
|
|
218
|
+
:enable-huge-amount="enableHugeAmount"
|
|
219
|
+
:is-visitor="isVisitor"
|
|
218
220
|
class="tw-mt-auto tw-self-end"
|
|
219
221
|
:class="{'tw-flex-grow' : unreservedAmount === 0, 'tw-flex-shrink-0' : unreservedAmount > 0}"
|
|
220
222
|
@add-to-basket="$emit('add-to-basket', $event)"
|
|
@@ -331,6 +333,10 @@ export default {
|
|
|
331
333
|
type: Array,
|
|
332
334
|
default: () => ([]),
|
|
333
335
|
},
|
|
336
|
+
enableHugeAmount: {
|
|
337
|
+
type: Boolean,
|
|
338
|
+
default: false,
|
|
339
|
+
},
|
|
334
340
|
},
|
|
335
341
|
setup(props) {
|
|
336
342
|
const {
|
|
@@ -31,6 +31,7 @@ const story = (args) => {
|
|
|
31
31
|
:custom-callouts="customCallouts"
|
|
32
32
|
:is-team-pick="isTeamPick"
|
|
33
33
|
:combined-activities="combinedActivities"
|
|
34
|
+
:enable-huge-amount="enableHugeAmount"
|
|
34
35
|
/>
|
|
35
36
|
</div>
|
|
36
37
|
`,
|
|
@@ -375,3 +376,15 @@ export const ActivityFeed = story({
|
|
|
375
376
|
photoPath,
|
|
376
377
|
combinedActivities,
|
|
377
378
|
});
|
|
379
|
+
|
|
380
|
+
export const HugeLentAmount = story({
|
|
381
|
+
loanId: loan.id,
|
|
382
|
+
loan: {
|
|
383
|
+
...loan,
|
|
384
|
+
unreservedAmount: '850.00',
|
|
385
|
+
},
|
|
386
|
+
kvTrackFunction,
|
|
387
|
+
photoPath,
|
|
388
|
+
isVisitor: false,
|
|
389
|
+
enableHugeAmount: true,
|
|
390
|
+
});
|
|
@@ -21,6 +21,8 @@ const story = (args) => {
|
|
|
21
21
|
:kv-track-function="kvTrackFunction"
|
|
22
22
|
:show-view-loan="showViewLoan"
|
|
23
23
|
:custom-loan-details="customLoanDetails"
|
|
24
|
+
:enable-huge-amount="enableHugeAmount"
|
|
25
|
+
:is-visitor="isVisitor"
|
|
24
26
|
/>
|
|
25
27
|
</div>
|
|
26
28
|
`,
|
|
@@ -68,6 +70,28 @@ export const Dropdown = story({
|
|
|
68
70
|
kvTrackFunction,
|
|
69
71
|
});
|
|
70
72
|
|
|
73
|
+
export const HugeLentAmount = story({
|
|
74
|
+
isLoading: false,
|
|
75
|
+
loan: {
|
|
76
|
+
id: 1,
|
|
77
|
+
unreservedAmount: '12850.00',
|
|
78
|
+
},
|
|
79
|
+
kvTrackFunction,
|
|
80
|
+
enableHugeAmount: true,
|
|
81
|
+
isVisitor: false,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export const Between500and1000 = story({
|
|
85
|
+
isLoading: false,
|
|
86
|
+
loan: {
|
|
87
|
+
id: 1,
|
|
88
|
+
unreservedAmount: '850.00',
|
|
89
|
+
},
|
|
90
|
+
kvTrackFunction,
|
|
91
|
+
enableHugeAmount: true,
|
|
92
|
+
isVisitor: false,
|
|
93
|
+
});
|
|
94
|
+
|
|
71
95
|
export const FiveDollar = story({
|
|
72
96
|
isLoading: false,
|
|
73
97
|
loan: {
|
|
@@ -27,6 +27,7 @@ const story = (args) => {
|
|
|
27
27
|
:photo-path="photoPath"
|
|
28
28
|
:show-view-loan="showViewLoan"
|
|
29
29
|
:custom-callouts="customCallouts"
|
|
30
|
+
:enable-huge-amount="enableHugeAmount"
|
|
30
31
|
/>
|
|
31
32
|
</div>
|
|
32
33
|
`,
|
|
@@ -277,3 +278,15 @@ export const LendAgain = story({
|
|
|
277
278
|
kvTrackFunction,
|
|
278
279
|
photoPath,
|
|
279
280
|
});
|
|
281
|
+
|
|
282
|
+
export const HugeLentAmount = story({
|
|
283
|
+
loanId: loan.id,
|
|
284
|
+
loan: {
|
|
285
|
+
...loan,
|
|
286
|
+
unreservedAmount: '850.00',
|
|
287
|
+
},
|
|
288
|
+
kvTrackFunction,
|
|
289
|
+
photoPath,
|
|
290
|
+
isVisitor: false,
|
|
291
|
+
enableHugeAmount: true,
|
|
292
|
+
});
|