@kiva/kv-components 3.46.1 → 3.46.3
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,25 @@
|
|
|
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.46.3](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.46.2...@kiva/kv-components@3.46.3) (2023-10-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* kvcountdowtimer component updated to show the remaining hours correctly ([#307](https://github.com/kiva/kv-ui-elements/issues/307)) ([1ea593c](https://github.com/kiva/kv-ui-elements/commit/1ea593ce88339fff9e9bf2bcd1e33bed46a8b09a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [3.46.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.46.1...@kiva/kv-components@3.46.2) (2023-10-12)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @kiva/kv-components
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [3.46.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.46.0...@kiva/kv-components@3.46.1) (2023-10-04)
|
|
7
26
|
|
|
8
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-components",
|
|
3
|
-
"version": "3.46.
|
|
3
|
+
"version": "3.46.3",
|
|
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": "6fc84d328af54b57e6f9b9b1c409ce4a695d2b10"
|
|
79
79
|
}
|
package/vue/KvCountdownTimer.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span v-if="timeLeft">
|
|
3
|
-
{{
|
|
3
|
+
{{ remainingHours }}h {{ timeLeft.minutes() }}m {{ timeLeft.seconds() }}s
|
|
4
4
|
</span>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
toRefs,
|
|
11
11
|
onBeforeUnmount,
|
|
12
12
|
onMounted,
|
|
13
|
+
computed,
|
|
13
14
|
} from 'vue-demi';
|
|
14
15
|
import moment from 'moment';
|
|
15
16
|
|
|
@@ -26,6 +27,10 @@ export default {
|
|
|
26
27
|
const interval = ref(null);
|
|
27
28
|
const timeLeft = ref(null);
|
|
28
29
|
|
|
30
|
+
const remainingHours = computed(() => {
|
|
31
|
+
return Math.floor(timeLeft.value.asHours());
|
|
32
|
+
});
|
|
33
|
+
|
|
29
34
|
onMounted(() => {
|
|
30
35
|
timeLeft.value = moment.duration(msLeft.value > 0 ? msLeft.value : 0, 'milliseconds');
|
|
31
36
|
|
|
@@ -48,7 +53,7 @@ export default {
|
|
|
48
53
|
}
|
|
49
54
|
});
|
|
50
55
|
|
|
51
|
-
return { timeLeft };
|
|
56
|
+
return { timeLeft, remainingHours };
|
|
52
57
|
},
|
|
53
58
|
};
|
|
54
59
|
</script>
|
package/vue/KvLoanTag.vue
CHANGED
|
@@ -41,13 +41,18 @@ export default {
|
|
|
41
41
|
};
|
|
42
42
|
},
|
|
43
43
|
computed: {
|
|
44
|
+
isLseLoan() {
|
|
45
|
+
return this.loan?.partnerName?.toUpperCase().includes(LSE_LOAN_KEY) ?? false;
|
|
46
|
+
},
|
|
44
47
|
amountLeft() {
|
|
45
48
|
const loanFundraisingInfo = this.loan?.loanFundraisingInfo ?? { fundedAmount: 0, reservedAmount: 0 };
|
|
46
49
|
const { fundedAmount, reservedAmount } = loanFundraisingInfo;
|
|
47
50
|
return numeral(this.loan?.loanAmount).subtract(fundedAmount).subtract(reservedAmount).value();
|
|
48
51
|
},
|
|
49
52
|
variation() {
|
|
50
|
-
if (
|
|
53
|
+
if (this.isLseLoan) {
|
|
54
|
+
return 'lse-loan';
|
|
55
|
+
} if (differenceInDays(parseISO(this.loan?.plannedExpirationDate), Date.now()) <= 3) {
|
|
51
56
|
return 'ending-soon';
|
|
52
57
|
} if (this.amountLeft < 100 && this.amountLeft >= 0) {
|
|
53
58
|
return 'almost-funded';
|
|
@@ -57,11 +62,8 @@ export default {
|
|
|
57
62
|
return null;
|
|
58
63
|
},
|
|
59
64
|
tagText() {
|
|
60
|
-
const partnerName = this.loan?.partnerName ?? '';
|
|
61
|
-
if (partnerName.toUpperCase().includes(LSE_LOAN_KEY)) {
|
|
62
|
-
return 'High community impact';
|
|
63
|
-
}
|
|
64
65
|
switch (this.variation) {
|
|
66
|
+
case 'lse-loan': return 'High community impact';
|
|
65
67
|
case 'almost-funded': return 'Almost funded';
|
|
66
68
|
case 'matched-loan': return `${this.matchRatio + 1}x matching by ${this.loan?.matchingText}`;
|
|
67
69
|
default: return 'Ending soon: ';
|
|
@@ -23,7 +23,8 @@ const story = (args) => {
|
|
|
23
23
|
|
|
24
24
|
export const Seconds = story({ msLeft: 1000 * 10 });
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
export const Tomorrow = story({ msLeft: 1000 * 60 * 60 * 24 - 1000 });
|
|
26
|
+
export const Tomorrow = story({ msLeft: 1000 * 60 * 60 * 24 });
|
|
28
27
|
|
|
29
28
|
export const Expired = story({ msLeft: 0 });
|
|
29
|
+
|
|
30
|
+
export const Overmorrow = story({ msLeft: 1000 * 60 * 60 * 48 });
|