@icij/murmur-next 4.0.1 → 4.0.4
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/lib/components/AccordionStep.vue +53 -42
- package/lib/components/AccordionWrapper.vue +25 -24
- package/lib/components/ActiveTextTruncate.vue +44 -22
- package/lib/components/AdvancedLinkForm.vue +96 -46
- package/lib/components/Brand.vue +30 -23
- package/lib/components/BrandExpansion.vue +12 -3
- package/lib/components/ConfirmButton.vue +30 -26
- package/lib/components/ContentPlaceholder.vue +11 -7
- package/lib/components/CustomPagination.vue +50 -32
- package/lib/components/DigitsInput.vue +64 -60
- package/lib/components/DonateForm.vue +112 -83
- package/lib/components/EmbedForm.vue +37 -21
- package/lib/components/EmbeddableFooter.vue +14 -10
- package/lib/components/FollowUsPopover.vue +42 -40
- package/lib/components/GenericFooter.vue +98 -23
- package/lib/components/GenericHeader.vue +66 -29
- package/lib/components/HapticCopy.vue +41 -29
- package/lib/components/ImddbHeader.vue +113 -92
- package/lib/components/OrdinalLegend.vue +43 -20
- package/lib/components/RangePicker.vue +63 -42
- package/lib/components/ResponsiveIframe.vue +9 -2
- package/lib/components/ScaleLegend.vue +56 -18
- package/lib/components/SecretInput.vue +7 -8
- package/lib/components/SelectableDropdown.vue +120 -74
- package/lib/components/SharingOptions.vue +93 -36
- package/lib/components/SharingOptionsLink.vue +11 -5
- package/lib/components/SignUpForm.vue +44 -23
- package/lib/components/SlideUpDown.vue +7 -2
- package/lib/components/TexturedDeck.vue +24 -14
- package/lib/components/TinyPagination.vue +35 -22
- package/lib/composables/chart.ts +174 -157
- package/lib/composables/resizeObserver.ts +29 -29
- package/lib/composables/sendEmail.ts +53 -42
- package/lib/config.default.ts +17 -10
- package/lib/config.ts +34 -27
- package/lib/datavisualisations/BarChart.vue +48 -42
- package/lib/datavisualisations/ColumnChart.vue +133 -89
- package/lib/datavisualisations/LineChart.vue +79 -57
- package/lib/datavisualisations/StackedBarChart.vue +116 -68
- package/lib/datavisualisations/StackedColumnChart.vue +196 -115
- package/lib/enums.ts +25 -15
- package/lib/i18n.ts +3 -3
- package/lib/keys.ts +2 -2
- package/lib/main.ts +14 -10
- package/lib/maps/ChoroplethMap.vue +299 -160
- package/lib/maps/ChoroplethMapAnnotation.vue +29 -18
- package/lib/maps/SymbolMap.vue +194 -123
- package/lib/shims-bootstrap-vue.d.ts +1 -1
- package/lib/shims-vue.d.ts +3 -3
- package/lib/styles/functions.scss +10 -6
- package/lib/styles/lib.scss +2 -4
- package/lib/styles/mixins.scss +8 -8
- package/lib/styles/utilities.scss +1 -1
- package/lib/styles/variables.scss +24 -18
- package/lib/types.ts +26 -10
- package/lib/utils/animation.ts +4 -4
- package/lib/utils/assets.ts +31 -28
- package/lib/utils/clipboard.ts +16 -10
- package/lib/utils/iframe-resizer.ts +18 -13
- package/lib/utils/placeholder.ts +54 -23
- package/lib/utils/placeholderTypes.ts +3 -3
- package/package.json +7 -2
package/lib/components/Brand.vue
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span class="brand" :style="style" :class="{ 'brand--animated': animated }">
|
|
3
|
-
<svg
|
|
3
|
+
<svg
|
|
4
|
+
:width="width"
|
|
5
|
+
:height="height"
|
|
6
|
+
viewBox="0 0 147.151 200"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
>
|
|
4
9
|
<path class="triangle" d="M101.997 200H45.155l28.42-46.427z" />
|
|
5
10
|
<path
|
|
6
11
|
class="globe"
|
|
@@ -20,60 +25,62 @@
|
|
|
20
25
|
/**
|
|
21
26
|
* A component to create variations of ICIJ logo
|
|
22
27
|
*/
|
|
23
|
-
import {computed, ref} from 'vue'
|
|
24
|
-
import isString from
|
|
28
|
+
import { computed, ref } from 'vue'
|
|
29
|
+
import isString from 'lodash/isString'
|
|
25
30
|
|
|
26
31
|
interface BrandProps {
|
|
27
32
|
/**
|
|
28
33
|
* Add a balancing effect to the globe
|
|
29
34
|
*/
|
|
30
|
-
animated?: boolean
|
|
35
|
+
animated?: boolean
|
|
31
36
|
/**
|
|
32
37
|
* Monochromatic logo's color
|
|
33
38
|
*/
|
|
34
|
-
color?: string | null
|
|
39
|
+
color?: string | null
|
|
35
40
|
/**
|
|
36
41
|
* Logo's background color
|
|
37
42
|
*/
|
|
38
|
-
background?: string | null
|
|
43
|
+
background?: string | null
|
|
39
44
|
/**
|
|
40
45
|
* Logo's size
|
|
41
46
|
*/
|
|
42
|
-
size?: number | string
|
|
47
|
+
size?: number | string
|
|
43
48
|
/**
|
|
44
49
|
* Force the width of the logo to be the same as the height
|
|
45
50
|
*/
|
|
46
|
-
square?: boolean
|
|
51
|
+
square?: boolean
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
interface BrandStyle {
|
|
50
|
-
'--monochrome-color': string | null
|
|
51
|
-
color: string | null
|
|
52
|
-
background: string | null
|
|
53
|
-
width: string | number
|
|
55
|
+
'--monochrome-color': string | null
|
|
56
|
+
color: string | null
|
|
57
|
+
background: string | null
|
|
58
|
+
width: string | number
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
const props = withDefaults(defineProps<BrandProps>(),{
|
|
61
|
+
const props = withDefaults(defineProps<BrandProps>(), {
|
|
57
62
|
color: null,
|
|
58
|
-
background:null,
|
|
63
|
+
background: null,
|
|
59
64
|
size: '70px'
|
|
60
|
-
})
|
|
61
|
-
const sizeAsNumber = ref(
|
|
65
|
+
})
|
|
66
|
+
const sizeAsNumber = ref(
|
|
67
|
+
isString(props.size) ? parseInt(props.size) : props.size
|
|
68
|
+
)
|
|
62
69
|
|
|
63
|
-
const width = computed(() => `${(147.151 / 200) * sizeAsNumber.value}px`)
|
|
64
|
-
const height = computed(() => `${sizeAsNumber.value}px`)
|
|
70
|
+
const width = computed(() => `${(147.151 / 200) * sizeAsNumber.value}px`)
|
|
71
|
+
const height = computed(() => `${sizeAsNumber.value}px`)
|
|
65
72
|
|
|
66
73
|
const style = computed<BrandStyle>(() => {
|
|
67
|
-
const {square} = props
|
|
68
|
-
const widthValue = square ? height.value : 'auto'
|
|
74
|
+
const { square } = props
|
|
75
|
+
const widthValue = square ? height.value : 'auto'
|
|
69
76
|
|
|
70
77
|
return {
|
|
71
78
|
'--monochrome-color': props.color,
|
|
72
79
|
color: props.color,
|
|
73
80
|
background: props.background,
|
|
74
|
-
width: widthValue
|
|
75
|
-
}
|
|
76
|
-
})
|
|
81
|
+
width: widthValue
|
|
82
|
+
}
|
|
83
|
+
})
|
|
77
84
|
</script>
|
|
78
85
|
|
|
79
86
|
<style scoped lang="scss">
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<span
|
|
3
3
|
class="brand-expansion"
|
|
4
4
|
:style="style"
|
|
5
|
-
:class="{
|
|
5
|
+
:class="{
|
|
6
|
+
'brand-expansion--dark': dark,
|
|
7
|
+
'brand-expansion--animated': animated
|
|
8
|
+
}"
|
|
6
9
|
>
|
|
7
10
|
<svg
|
|
8
11
|
v-if="mode === 'short'"
|
|
@@ -41,7 +44,10 @@
|
|
|
41
44
|
class="globe"
|
|
42
45
|
d="M 106.692 88.5051 C 107.819 82.8227 108.526 76.8189 108.786 70.6453 L 128.03 70.6453 C 127.431 76.8914 125.785 82.9146 123.168 88.5051 Z M 112.263 104.021 C 107.739 108.545 102.563 112.178 96.9466 114.835 C 97.8831 113.313 98.751 111.751 99.5476 110.152 C 101.244 106.76 102.725 103.064 103.979 99.1273 L 116.611 99.1273 C 115.259 100.842 113.807 102.476 112.263 104.021 M 78.8877 88.5051 L 78.8877 70.6453 L 98.1543 70.6453 C 97.8706 76.8889 97.0908 82.9061 95.8503 88.5051 Z M 90.0467 105.401 C 86.8083 111.879 82.915 116.431 78.8877 118.601 L 78.8877 99.1273 L 92.7543 99.1273 C 91.9656 101.266 91.0617 103.36 90.0467 105.401 M 57.1059 105.401 C 56.0908 103.36 55.187 101.266 54.3983 99.1273 L 68.2649 99.1273 L 68.2649 118.601 C 64.237 116.431 60.3442 111.879 57.1059 105.401 M 48.9983 70.6453 L 68.2649 70.6453 L 68.2649 88.5051 L 51.3023 88.5051 C 50.0617 82.9061 49.282 76.8889 48.9983 70.6453 M 34.8894 104.021 C 33.3454 102.476 31.8937 100.842 30.5419 99.1273 L 43.1735 99.1273 C 44.4274 103.064 45.9091 106.76 47.6043 110.152 C 48.4014 111.751 49.2695 113.313 50.206 114.835 C 44.5894 112.179 39.4128 108.545 34.8894 104.021 M 23.9842 88.5051 C 21.3679 82.9146 19.7213 76.8914 19.1229 70.6453 L 38.367 70.6453 C 38.6263 76.8189 39.3337 82.8227 40.4604 88.5051 Z M 40.4604 42.1627 C 39.3337 47.8451 38.6263 53.8489 38.367 60.0225 L 19.1229 60.0225 C 19.7213 53.7764 21.3679 47.7532 23.9842 42.1627 Z M 34.8894 26.647 C 39.4128 22.123 44.5894 18.4895 50.206 15.8331 C 49.2695 17.3545 48.4014 18.9171 47.6043 20.516 C 45.9091 23.9078 44.4274 27.6045 43.1735 31.5405 L 30.5419 31.5405 C 31.8938 29.8255 33.3455 28.1915 34.8894 26.647 M 68.2649 42.1627 L 68.2649 60.0225 L 48.9983 60.0225 C 49.282 53.7795 50.0617 47.7617 51.3023 42.1627 Z M 57.1059 25.267 C 60.3442 18.789 64.237 14.237 68.2649 12.0663 L 68.2649 31.5405 L 54.3983 31.5405 C 55.1869 29.402 56.0907 27.3078 57.1059 25.267 M 90.0467 25.267 C 91.0619 27.3078 91.9657 29.402 92.7543 31.5405 L 78.8877 31.5405 L 78.8877 12.0663 C 82.915 14.237 86.8083 18.789 90.0467 25.267 M 98.1543 60.0225 L 78.8877 60.0225 L 78.8877 42.1627 L 95.8503 42.1627 C 97.0908 47.7617 97.8706 53.7795 98.1543 60.0225 M 112.263 26.647 C 113.807 28.1916 115.259 29.8256 116.611 31.5405 L 103.979 31.5405 C 102.725 27.6045 101.244 23.9078 99.5476 20.516 C 98.751 18.9169 97.8831 17.3544 96.9466 15.8331 C 102.563 18.4895 107.739 22.1236 112.263 26.647 M 123.168 42.1627 C 125.785 47.7532 127.431 53.7764 128.03 60.0225 L 108.786 60.0225 C 108.526 53.8489 107.819 47.8451 106.692 42.1627 Z M 119.774 19.136 C 107.434 6.79604 91.0274 0.00028712 73.576 0.00028712 C 56.1246 0.00028712 39.7178 6.79604 27.3778 19.136 C 15.0384 31.476 8.24207 47.8828 8.24207 65.3336 C 8.24207 82.7856 15.0384 99.1924 27.3778 111.532 C 39.7178 123.872 56.1246 130.668 73.576 130.668 C 91.0274 130.668 107.434 123.872 119.774 111.532 C 132.114 99.1924 138.91 82.7856 138.91 65.3336 C 138.91 47.8828 132.114 31.476 119.774 19.136"
|
|
43
46
|
/>
|
|
44
|
-
<path
|
|
47
|
+
<path
|
|
48
|
+
class="plate"
|
|
49
|
+
d="M 2e-06 136.811 L 147.151 136.811 L 147.151 147.433 L 2e-06 147.433 Z"
|
|
50
|
+
/>
|
|
45
51
|
<path
|
|
46
52
|
class="main-text"
|
|
47
53
|
d="M187.413 29.944h27.076v140.112h-27.076zM233.817 161.737c-6.145-6.416-9.216-15.223-9.216-26.424V70.72c0-13.918 2.773-24.41 8.318-31.48 5.546-7.067 14.244-10.602 26.098-10.602 10.33 0 18.648 2.83 24.956 8.482 6.305 5.655 9.46 13.81 9.46 24.466v24.14h-27.892V65.013c0-4.021-.488-6.794-1.467-8.318-.98-1.522-2.666-2.284-5.057-2.284-2.502 0-4.215.872-5.138 2.61-.925 1.74-1.386 4.297-1.386 7.667v70.3c0 3.697.543 6.39 1.63 8.073 1.087 1.688 2.717 2.528 4.894 2.528 4.348 0 6.524-3.532 6.524-10.602v-25.282h28.218v26.424c0 23.488-11.8 35.232-35.394 35.232-10.223 0-18.406-3.206-24.548-9.623M301.752 29.944h27.076v140.112h-27.076zM353.782 167.609c-5.22-2.5-9.326-6.17-12.315-11.01-2.992-4.837-4.485-10.684-4.485-17.534l-.001-29.344h27.566v27.712c0 2.503.515 4.486 1.55 5.954 1.032 1.469 2.635 2.202 4.811 2.202 2.065 0 3.614-.678 4.65-2.039 1.03-1.358 1.548-3.287 1.548-5.79V29.944h28.219v105.043c0 7.286-1.443 13.676-4.323 19.166-2.882 5.491-6.906 9.732-12.07 12.722-5.166 2.992-11.066 4.485-17.697 4.485-6.418 0-12.233-1.251-17.453-3.751"
|
|
@@ -64,7 +70,10 @@
|
|
|
64
70
|
class="globe"
|
|
65
71
|
d="M 106.691 88.5051 C 107.818 82.8227 108.526 76.8189 108.785 70.6453 L 128.029 70.6453 C 127.431 76.8914 125.784 82.9146 123.168 88.5051 Z M 112.262 104.021 C 107.739 108.545 102.563 112.178 96.9465 114.835 C 97.883 113.313 98.7509 111.751 99.5475 110.152 C 101.243 106.76 102.725 103.064 103.978 99.1273 L 116.611 99.1273 C 115.259 100.842 113.807 102.476 112.263 104.021 M 78.887 88.5051 L 78.887 70.6453 L 98.1536 70.6453 C 97.8699 76.8889 97.0901 82.9061 95.8502 88.5051 Z M 90.046 105.401 C 86.8076 111.879 82.9143 116.431 78.887 118.601 L 78.887 99.1273 L 92.7536 99.1273 C 91.9649 101.266 91.061 103.36 90.046 105.401 M 57.1052 105.401 C 56.0901 103.36 55.1863 101.266 54.3976 99.1273 L 68.2642 99.1273 L 68.2642 118.601 C 64.2363 116.431 60.3435 111.879 57.1052 105.401 M 48.9976 70.6453 L 68.2642 70.6453 L 68.2642 88.5051 L 51.3028 88.5051 C 50.0623 82.9061 49.2819 76.8889 48.9988 70.6453 M 34.8899 104.021 C 33.3459 102.476 31.8942 100.842 30.5424 99.1273 L 43.1734 99.1273 C 44.4273 103.064 45.9096 106.76 47.6049 110.152 C 48.4019 111.751 49.27 113.313 50.2065 114.835 C 44.5899 112.179 39.4133 108.545 34.8899 104.021 M 23.9841 88.5051 C 21.3678 82.9146 19.7212 76.8914 19.1229 70.6453 L 38.3669 70.6453 C 38.6262 76.8189 39.3336 82.8227 40.4609 88.5051 Z M 40.4603 42.1627 C 39.3342 47.8451 38.6262 53.8489 38.3669 60.0225 L 19.1229 60.0225 C 19.7212 53.7764 21.3678 47.7532 23.9841 42.1627 Z M 34.8893 26.647 C 39.4127 22.123 44.5893 18.4895 50.2059 15.8331 C 49.2694 17.3545 48.4013 18.9171 47.6043 20.516 C 45.909 23.9078 44.4273 27.6045 43.1734 31.5405 L 30.5424 31.5405 C 31.8943 29.8255 33.346 28.1915 34.8899 26.647 M 68.2648 42.1627 L 68.2648 60.0225 L 48.9988 60.0225 C 49.2819 53.7795 50.0617 47.7617 51.3022 42.1627 Z M 57.1064 25.267 C 60.3448 18.789 64.2375 14.237 68.2654 12.0663 L 68.2654 31.5405 L 54.3988 31.5405 C 55.1872 29.402 56.0908 27.3078 57.1058 25.267 M 90.0466 25.267 C 91.0618 27.3078 91.9656 29.402 92.7542 31.5405 L 78.8876 31.5405 L 78.8876 12.0663 C 82.9149 14.237 86.8083 18.789 90.0466 25.267 M 98.1548 60.0225 L 78.8876 60.0225 L 78.8876 42.1627 L 95.8502 42.1627 C 97.0908 47.7617 97.8711 53.7795 98.1542 60.0225 M 112.263 26.647 C 113.807 28.1916 115.258 29.8256 116.611 31.5405 L 103.978 31.5405 C 102.725 27.6045 101.243 23.9078 99.5475 20.516 C 98.7509 18.9169 97.883 17.3544 96.9465 15.8331 C 102.563 18.4895 107.739 22.1236 112.263 26.647 M 123.169 42.1627 C 125.785 47.7532 127.431 53.7764 128.03 60.0225 L 108.786 60.0225 C 108.526 53.8489 107.819 47.8451 106.692 42.1627 Z M 119.775 19.136 C 107.434 6.79604 91.0273 0.00028712 73.5759 0.00028712 C 56.1245 0.00028712 39.7177 6.79604 27.3777 19.136 C 15.0389 31.476 8.24198 47.8828 8.24198 65.3336 C 8.24198 82.7856 15.0383 99.1924 27.3777 111.532 C 39.7177 123.872 56.1245 130.668 73.5759 130.668 C 91.0279 130.668 107.434 123.872 119.774 111.532 C 132.114 99.1924 138.91 82.7856 138.91 65.3336 C 138.91 47.8828 132.114 31.476 119.774 19.136"
|
|
66
72
|
/>
|
|
67
|
-
<path
|
|
73
|
+
<path
|
|
74
|
+
class="plate"
|
|
75
|
+
d="M -8.72e-05 136.811 L 147.151 136.811 L 147.151 147.433 L -8.72e-05 147.433 Z"
|
|
76
|
+
/>
|
|
68
77
|
<path
|
|
69
78
|
class="main-text"
|
|
70
79
|
d="M203.5 25.928h12.66v65.517H203.5zM220.118 91.445V25.928h13.5l6.026 31.348V25.928h12.661v65.517h-12.814l-6.559-32.796v32.796ZM263.073 91.445V38.513h-7.78V25.928h28.678v12.585h-7.78v52.932ZM286.96 91.445V25.928h26.237V38.59h-12.89v12.737h12.357v12.357h-12.357v15.024h13.73v12.738ZM333.813 50.183c1.83 0 2.745-1.984 2.745-5.95 0-1.728-.075-3.025-.228-3.89-.152-.864-.433-1.46-.839-1.792-.408-.33-.992-.495-1.755-.495h-3.05v12.127Zm-16.475-24.255h20.136c3.204 0 5.682.724 7.437 2.174 1.753 1.45 2.936 3.484 3.546 6.102.61 2.619.916 5.962.916 10.03 0 3.712-.485 6.61-1.45 8.694-.966 2.086-2.644 3.535-5.034 4.348 1.984.408 3.42 1.4 4.309 2.974.89 1.577 1.336 3.713 1.336 6.408l-.153 24.787h-12.814V65.818c0-1.83-.357-2.999-1.068-3.508-.712-.508-2.01-.763-3.89-.763v29.898h-13.271zM352.712 91.445V25.928h13.5l6.026 31.348V25.928H384.9v65.517h-12.815l-6.56-32.796v32.796ZM402.592 70.394h5.95l-2.898-33.33h-.61Zm-14.491 21.051 6.33-65.517h22.195l6.255 65.517h-12.433l-.915-10.601H401.6l-.762 10.601zM430.148 91.445V38.513h-7.78V25.928h28.678v12.585h-7.78v52.932ZM453.761 25.928h12.661v65.517h-12.66zM488.616 78.479c.407-1.017.611-2.441.611-4.27V42.173c0-1.423-.19-2.58-.572-3.47-.382-.89-1.158-1.335-2.327-1.335-2.187 0-3.279 1.653-3.279 4.957v31.958c0 1.881.228 3.306.687 4.272.457.966 1.296 1.448 2.517 1.448 1.168 0 1.956-.507 2.363-1.525m-14.414 8.733c-2.747-3.228-4.12-7.767-4.12-13.614V42.403c0-5.644 1.373-9.902 4.12-12.776 2.745-2.872 6.761-4.31 12.05-4.31 5.288 0 9.305 1.438 12.052 4.31 2.745 2.873 4.118 7.132 4.118 12.776v31.195c0 5.898-1.373 10.449-4.118 13.653-2.747 3.203-6.764 4.805-12.051 4.805-5.29 0-9.306-1.614-12.051-4.844M506.234 91.445V25.928h13.5l6.026 31.348V25.928h12.661v65.517h-12.814l-6.559-32.796v32.796ZM556.114 70.394h5.95l-2.898-33.33h-.61Zm-14.491 21.051 6.33-65.517h22.195l6.254 65.517H563.97l-.915-10.601h-7.932l-.763 10.601zM579.574 91.445V25.928h13.118V80.31h13.501v11.136ZM631.475 87.556c-2.873-3-4.308-7.119-4.308-12.356V44.996c0-6.508 1.296-11.414 3.89-14.72 2.592-3.305 6.659-4.958 12.202-4.958 4.83 0 8.72 1.323 11.67 3.966 2.949 2.645 4.424 6.458 4.424 11.44v11.289H646.31v-9.687c0-1.88-.23-3.176-.687-3.89-.458-.71-1.246-1.067-2.365-1.067-1.17 0-1.97.408-2.402 1.22-.433.814-.649 2.01-.649 3.585v32.873c0 1.73.255 2.988.764 3.775.507.79 1.27 1.183 2.287 1.183 2.033 0 3.052-1.652 3.052-4.958V63.225h13.194v12.356c0 10.983-5.517 16.475-16.55 16.475-4.78 0-8.607-1.5-11.48-4.5M681.097 78.479c.407-1.017.61-2.441.61-4.27V42.173c0-1.423-.19-2.58-.571-3.47-.382-.89-1.158-1.335-2.327-1.335-2.187 0-3.279 1.653-3.279 4.957v31.958c0 1.881.228 3.306.687 4.272.457.966 1.296 1.448 2.517 1.448 1.168 0 1.955-.507 2.363-1.525m-14.414 8.733c-2.747-3.228-4.12-7.767-4.12-13.614V42.403c0-5.644 1.373-9.902 4.12-12.776 2.745-2.872 6.76-4.31 12.05-4.31 5.288 0 9.305 1.438 12.051 4.31 2.746 2.873 4.118 7.132 4.118 12.776v31.195c0 5.898-1.372 10.449-4.118 13.653-2.746 3.203-6.762 4.805-12.05 4.805-5.29 0-9.306-1.614-12.051-4.844M698.716 91.445V25.928h13.5l6.025 31.348V25.928h12.661v65.517H718.09l-6.56-32.796v32.796ZM738.24 87.631c-2.645-2.947-3.967-7.703-3.967-14.262v-6.406h12.89v8.16c0 3.255 1.04 4.882 3.127 4.882 1.169 0 1.983-.343 2.44-1.03.459-.687.687-1.843.687-3.47 0-2.136-.256-3.902-.763-5.301-.508-1.398-1.157-2.567-1.945-3.509-.789-.94-2.2-2.402-4.232-4.385l-5.645-5.645c-4.373-4.27-6.56-9-6.56-14.186 0-5.592 1.284-9.85 3.851-12.776 2.568-2.922 6.319-4.385 11.25-4.385 5.9 0 10.145 1.563 12.738 4.691 2.594 3.127 3.89 8.021 3.89 14.682h-13.347l-.076-4.5c0-.864-.242-1.55-.725-2.06-.483-.507-1.156-.762-2.02-.762-1.018 0-1.782.28-2.288.84-.51.56-.764 1.322-.764 2.287 0 2.135 1.22 4.347 3.66 6.635l7.628 7.323c1.78 1.729 3.254 3.369 4.424 4.92 1.17 1.551 2.11 3.382 2.822 5.49.712 2.111 1.068 4.616 1.068 7.514 0 6.458-1.182 11.352-3.547 14.681-2.363 3.331-6.267 4.997-11.708 4.997-5.948 0-10.246-1.475-12.889-4.424M788.02 78.479c.407-1.017.611-2.441.611-4.27V42.173c0-1.423-.191-2.58-.572-3.47-.381-.89-1.158-1.335-2.326-1.335-2.187 0-3.28 1.653-3.28 4.957v31.958c0 1.881.229 3.306.686 4.272.456.966 1.296 1.448 2.517 1.448 1.169 0 1.957-.507 2.365-1.525m-14.416 8.733c-2.745-3.228-4.118-7.767-4.118-13.614V42.403c0-5.644 1.373-9.902 4.118-12.776 2.745-2.872 6.762-4.31 12.05-4.31s9.306 1.438 12.052 4.31c2.745 2.873 4.118 7.132 4.118 12.776v31.195c0 5.898-1.373 10.449-4.118 13.653-2.746 3.203-6.763 4.805-12.051 4.805-5.289 0-9.306-1.614-12.05-4.844M822.113 50.183c1.83 0 2.746-1.984 2.746-5.95 0-1.728-.076-3.025-.229-3.89-.153-.864-.432-1.46-.838-1.792-.408-.33-.993-.495-1.755-.495h-3.05v12.127Zm-16.475-24.255h20.136c3.203 0 5.682.724 7.436 2.174 1.755 1.45 2.937 3.484 3.547 6.102.61 2.619.915 5.962.915 10.03 0 3.712-.484 6.61-1.45 8.694-.965 2.086-2.643 3.535-5.033 4.348 1.983.408 3.419 1.4 4.31 2.974.888 1.577 1.334 3.713 1.334 6.408l-.152 24.787h-12.814V65.818c0-1.83-.356-2.999-1.068-3.508-.712-.508-2.009-.763-3.89-.763v29.898h-13.271zM847.709 91.445V38.513h-7.78V25.928h28.678v12.585h-7.78v52.932ZM871.322 25.928h12.66v65.517h-12.66zM891.472 87.479c-2.62-3.051-3.928-7.576-3.928-13.576V25.928h12.738v47.44c0 2.086.203 3.714.61 4.883.406 1.17 1.27 1.753 2.593 1.753s2.185-.571 2.593-1.716c.406-1.144.61-2.783.61-4.92v-47.44h12.737v47.975c0 6-1.31 10.525-3.928 13.576-2.62 3.051-6.623 4.576-12.012 4.576-5.39 0-9.395-1.525-12.013-4.576M923.17 91.445V25.928h19.983l5.493 39.966 5.49-39.966h20.136v65.517h-11.974V44.234l-7.551 47.211h-11.745l-8.01-47.212v47.212ZM222.11 153.69c.406-1.016.61-2.44.61-4.27v-32.035c0-1.422-.19-2.58-.573-3.47-.381-.89-1.157-1.334-2.326-1.334-2.187 0-3.28 1.652-3.28 4.957v31.958c0 1.881.229 3.306.687 4.271.457.966 1.296 1.45 2.517 1.45 1.17 0 1.956-.509 2.364-1.526m-14.414 8.733c-2.747-3.229-4.12-7.767-4.12-13.615v-31.194c0-5.644 1.373-9.902 4.12-12.777 2.745-2.871 6.76-4.308 12.05-4.308 5.288 0 9.305 1.437 12.051 4.308 2.746 2.875 4.118 7.133 4.118 12.777v31.194c0 5.9-1.372 10.449-4.118 13.653-2.746 3.203-6.763 4.805-12.05 4.805-5.29 0-9.306-1.613-12.051-4.843M239.728 166.657v-65.518h26.236v12.738h-13.04v10.45h12.355v12.584h-12.356v29.746ZM287.396 101.14h12.66v65.517h-12.66zM304.014 166.657v-65.518h13.5l6.026 31.35v-31.35h12.661v65.518h-12.814l-6.559-32.797v32.797ZM347.275 166.657l-8.085-65.593h12.508l4.805 44.619 4.272-44.62h12.508l-8.085 65.594ZM376.264 166.657v-65.518h26.238V113.8h-12.89v12.738h12.356v12.357h-12.356v15.024h13.73v12.738ZM409.937 162.843c-2.644-2.948-3.965-7.703-3.965-14.263v-6.406h12.89v8.161c0 3.254 1.04 4.882 3.126 4.882 1.17 0 1.983-.344 2.441-1.03.457-.686.686-1.843.686-3.47 0-2.136-.255-3.902-.762-5.3-.51-1.4-1.158-2.568-1.945-3.51-.79-.94-2.2-2.402-4.233-4.385l-5.644-5.644c-4.375-4.272-6.56-9-6.56-14.187 0-5.592 1.283-9.85 3.852-12.775 2.566-2.923 6.318-4.386 11.25-4.386 5.898 0 10.145 1.564 12.737 4.691 2.593 3.127 3.89 8.021 3.89 14.681h-13.347l-.077-4.498c0-.865-.242-1.551-.724-2.06-.484-.508-1.158-.763-2.021-.763-1.018 0-1.78.28-2.289.839-.508.56-.762 1.322-.762 2.288 0 2.136 1.22 4.348 3.661 6.636l7.627 7.323c1.78 1.727 3.253 3.367 4.424 4.918 1.169 1.552 2.11 3.383 2.822 5.492.712 2.11 1.067 4.614 1.067 7.512 0 6.458-1.182 11.353-3.546 14.683-2.365 3.33-6.268 4.996-11.708 4.996-5.949 0-10.246-1.474-12.89-4.425M447.867 166.657v-52.932h-7.78v-12.586h28.678v12.586h-7.779v52.932ZM471.48 101.14h12.661v65.517H471.48zM491.272 162.271c-2.314-3.33-3.47-8.377-3.47-15.14v-28.22c0-6.051 1.346-10.626 4.042-13.729 2.695-3.101 6.712-4.652 12.051-4.652 4.321 0 7.676.865 10.068 2.593 2.39 1.729 4.042 4.246 4.957 7.55.916 3.307 1.373 7.551 1.373 12.739h-12.814v-5.873c0-1.577-.216-2.797-.648-3.662-.433-.864-1.208-1.296-2.325-1.296-2.492 0-3.738 1.627-3.738 4.88v31.73c0 1.983.254 3.483.762 4.5.508 1.018 1.399 1.526 2.67 1.526 1.27 0 2.16-.508 2.67-1.526.507-1.017.763-2.517.763-4.5v-9.382h-3.51v-11.287h16.018v38.135h-5.263l-2.212-5.492c-2.34 4.069-5.949 6.102-10.831 6.102-4.728 0-8.25-1.665-10.563-4.996M537.56 145.606h5.949l-2.899-33.33H540Zm-14.492 21.05 6.33-65.516h22.195l6.255 65.517h-12.433l-.915-10.602h-7.932l-.763 10.602zM565.115 166.657v-52.932h-7.78v-12.586h28.679v12.586h-7.78v52.932ZM588.728 101.14h12.662v65.517h-12.662zM612.257 166.657l-8.084-65.593h12.509l4.805 44.619 4.27-44.62h12.51l-8.085 65.594ZM641.247 166.657v-65.518h26.238V113.8h-12.89v12.738h12.356v12.357h-12.357v15.024h13.73v12.738ZM696.924 165.513c-2.44-1.169-4.36-2.885-5.758-5.148-1.4-2.262-2.098-4.996-2.098-8.2v-16.398h12.89v15.635c0 1.17.241 2.099.725 2.785.482.686 1.232 1.03 2.25 1.03.965 0 1.69-.318 2.174-.954.482-.635.724-1.537.724-2.707V101.14h13.195v49.119c0 3.407-.675 6.395-2.021 8.961-1.349 2.569-3.23 4.552-5.645 5.95-2.415 1.4-5.174 2.097-8.275 2.097-3 0-5.72-.585-8.161-1.754M742.968 153.69c.407-1.016.61-2.44.61-4.27v-32.035c0-1.422-.191-2.58-.571-3.47-.382-.89-1.158-1.334-2.327-1.334-2.187 0-3.28 1.652-3.28 4.957v31.958c0 1.881.23 3.306.686 4.271.457.966 1.297 1.45 2.517 1.45 1.17 0 1.957-.509 2.365-1.526m-14.415 8.733c-2.746-3.229-4.12-7.767-4.12-13.615v-31.194c0-5.644 1.374-9.902 4.12-12.777 2.745-2.871 6.762-4.308 12.05-4.308 5.289 0 9.306 1.437 12.051 4.308 2.746 2.875 4.119 7.133 4.119 12.777v31.194c0 5.9-1.373 10.449-4.119 13.653-2.745 3.203-6.762 4.805-12.05 4.805s-9.306-1.613-12.051-4.843M764.126 162.691c-2.62-3.05-3.928-7.575-3.928-13.577V101.14h12.737v47.44c0 2.086.203 3.714.61 4.882.406 1.17 1.27 1.755 2.594 1.755 1.32 0 2.185-.573 2.593-1.717.406-1.144.61-2.783.61-4.92v-47.44h12.737v47.974c0 6.002-1.31 10.526-3.928 13.577-2.62 3.051-6.623 4.576-12.012 4.576-5.391 0-9.395-1.525-12.013-4.576M812.298 125.394c1.831 0 2.746-1.983 2.746-5.95 0-1.727-.076-3.024-.229-3.89-.152-.863-.432-1.46-.84-1.792-.406-.33-.99-.495-1.753-.495h-3.05v12.127Zm-16.474-24.255h20.135c3.205 0 5.683.726 7.438 2.175 1.753 1.448 2.935 3.483 3.545 6.101.61 2.62.917 5.962.917 10.03 0 3.713-.485 6.61-1.45 8.694-.967 2.086-2.644 3.535-5.034 4.349 1.983.407 3.42 1.398 4.309 2.974.89 1.576 1.335 3.712 1.335 6.407l-.153 24.788h-12.813V141.03c0-1.83-.357-3-1.068-3.508-.712-.509-2.01-.764-3.89-.764v29.899h-13.271zM831.197 166.657v-65.518h13.5l6.026 31.35v-31.35h12.662v65.518H850.57l-6.559-32.797v32.797ZM881.078 145.606h5.95l-2.899-33.33h-.61Zm-14.492 21.05 6.331-65.516h22.194l6.255 65.517h-12.432l-.915-10.602h-7.932l-.763 10.602zM904.538 166.657v-65.518h13.118v54.381h13.5v11.137ZM933.91 101.14h12.66v65.517h-12.66zM953.7 162.843c-2.644-2.948-3.965-7.703-3.965-14.263v-6.406h12.89v8.161c0 3.254 1.04 4.882 3.126 4.882 1.17 0 1.983-.344 2.441-1.03.457-.686.686-1.843.686-3.47 0-2.136-.255-3.902-.762-5.3-.51-1.4-1.158-2.568-1.945-3.51-.79-.94-2.2-2.402-4.233-4.385l-5.644-5.644c-4.375-4.272-6.56-9-6.56-14.187 0-5.592 1.283-9.85 3.852-12.775 2.566-2.923 6.318-4.386 11.25-4.386 5.898 0 10.145 1.564 12.737 4.691 2.593 3.127 3.89 8.021 3.89 14.681h-13.347l-.077-4.498c0-.865-.242-1.551-.724-2.06-.485-.508-1.158-.763-2.02-.763-1.02 0-1.782.28-2.29.839-.509.56-.762 1.322-.762 2.288 0 2.136 1.22 4.348 3.661 6.636l7.627 7.323c1.78 1.727 3.253 3.367 4.423 4.918 1.17 1.552 2.11 3.383 2.823 5.492.712 2.11 1.067 4.614 1.067 7.512 0 6.458-1.182 11.353-3.546 14.683-2.365 3.33-6.268 4.996-11.709 4.996-5.948 0-10.244-1.474-12.89-4.425M991.63 166.657v-52.932h-7.78v-12.586h28.678v12.586h-7.78v52.932ZM1018.866 162.843c-2.645-2.948-3.967-7.703-3.967-14.263v-6.406h12.89v8.161c0 3.254 1.042 4.882 3.128 4.882 1.168 0 1.983-.344 2.44-1.03.458-.686.687-1.843.687-3.47 0-2.136-.256-3.902-.764-5.3-.507-1.4-1.156-2.568-1.945-3.51-.788-.94-2.199-2.402-4.231-4.385l-5.645-5.644c-4.374-4.272-6.56-9-6.56-14.187 0-5.592 1.285-9.85 3.852-12.775 2.567-2.923 6.318-4.386 11.25-4.386 5.899 0 10.144 1.564 12.737 4.691 2.594 3.127 3.89 8.021 3.89 14.681h-13.348l-.075-4.498c0-.865-.242-1.551-.725-2.06-.484-.508-1.156-.763-2.02-.763-1.018 0-1.782.28-2.289.839-.509.56-.764 1.322-.764 2.288 0 2.136 1.221 4.348 3.662 6.636l7.627 7.323c1.78 1.727 3.254 3.367 4.424 4.918 1.17 1.552 2.109 3.383 2.822 5.492.712 2.11 1.068 4.614 1.068 7.512 0 6.458-1.182 11.353-3.547 14.683-2.364 3.33-6.267 4.996-11.708 4.996-5.949 0-10.246-1.474-12.89-4.425"
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
:is="tag"
|
|
4
|
+
:id="uniqComponentId"
|
|
5
|
+
class="confirm-button"
|
|
6
|
+
@click.stop="toggleConfirmationTooltip"
|
|
7
|
+
>
|
|
7
8
|
<!-- @slot Main content of the button -->
|
|
8
9
|
<slot>-</slot>
|
|
9
10
|
<b-tooltip
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
ref="confirmationTooltip"
|
|
12
|
+
:model-value="showTooltip"
|
|
13
|
+
:placement="placement"
|
|
14
|
+
:target="uniqComponentId"
|
|
15
|
+
manual
|
|
15
16
|
>
|
|
16
17
|
<div class="confirm-button__tooltip">
|
|
17
18
|
<button
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
v-if="!noCloseButton"
|
|
20
|
+
class="confirm-button__tooltip__cancel btn btn-sm btn-link text-light p-0 float-end"
|
|
21
|
+
@click="cancel"
|
|
21
22
|
>
|
|
22
|
-
<fa icon="times"/>
|
|
23
|
+
<fa icon="times" />
|
|
23
24
|
</button>
|
|
24
25
|
<p class="confirm-button__tooltip__label mb-2">
|
|
25
26
|
{{ label }}
|
|
@@ -28,12 +29,15 @@
|
|
|
28
29
|
{{ description }}
|
|
29
30
|
</p>
|
|
30
31
|
<div class="confirm-button__tooltip__actions text-end">
|
|
31
|
-
<button
|
|
32
|
+
<button
|
|
33
|
+
class="confirm-button__tooltip__actions__cancel btn btn-sm btn-link text-light"
|
|
34
|
+
@click="cancel"
|
|
35
|
+
>
|
|
32
36
|
{{ no }}
|
|
33
37
|
</button>
|
|
34
38
|
<button
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
class="confirm-button__tooltip__actions__confirm btn btn-sm btn-link text-light fw-bold"
|
|
40
|
+
@click="confirm"
|
|
37
41
|
>
|
|
38
42
|
{{ yes }}
|
|
39
43
|
</button>
|
|
@@ -46,12 +50,12 @@
|
|
|
46
50
|
<script lang="ts">
|
|
47
51
|
import noop from 'lodash/noop'
|
|
48
52
|
import uniqueId from 'lodash/uniqueId'
|
|
49
|
-
import {faTimes} from '@fortawesome/free-solid-svg-icons/faTimes'
|
|
50
|
-
import {BTooltip, PopoverPlacement} from 'bootstrap-vue-next'
|
|
51
|
-
import {ComponentPublicInstance, defineComponent, PropType, ref} from 'vue'
|
|
53
|
+
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes'
|
|
54
|
+
import { BTooltip, PopoverPlacement } from 'bootstrap-vue-next'
|
|
55
|
+
import { ComponentPublicInstance, defineComponent, PropType, ref } from 'vue'
|
|
52
56
|
|
|
53
|
-
import {default as Fa, library} from './Fa'
|
|
54
|
-
import {onBeforeMount} from
|
|
57
|
+
import { default as Fa, library } from './Fa'
|
|
58
|
+
import { onBeforeMount } from '@vue/runtime-core'
|
|
55
59
|
|
|
56
60
|
/**
|
|
57
61
|
* ConfirmButton
|
|
@@ -116,7 +120,7 @@ export default defineComponent({
|
|
|
116
120
|
*/
|
|
117
121
|
placement: {
|
|
118
122
|
type: String as PropType<PopoverPlacement>,
|
|
119
|
-
default:
|
|
123
|
+
default: 'top'
|
|
120
124
|
},
|
|
121
125
|
/**
|
|
122
126
|
* HTML tag to render this component to.
|
|
@@ -126,13 +130,13 @@ export default defineComponent({
|
|
|
126
130
|
default: 'button'
|
|
127
131
|
}
|
|
128
132
|
},
|
|
129
|
-
emits: ['toggled', 'cancelled',
|
|
130
|
-
setup(props, {emit}) {
|
|
133
|
+
emits: ['toggled', 'cancelled', 'confirmed'],
|
|
134
|
+
setup(props, { emit }) {
|
|
131
135
|
onBeforeMount(() => {
|
|
132
136
|
library.add(faTimes)
|
|
133
137
|
})
|
|
134
|
-
const showTooltip = ref<Boolean>(false)
|
|
135
|
-
const uniqComponentId = uniqueId('murmur-confirm-button-')
|
|
138
|
+
const showTooltip = ref<Boolean>(false)
|
|
139
|
+
const uniqComponentId = uniqueId('murmur-confirm-button-')
|
|
136
140
|
const confirmationTooltip = ref<ComponentPublicInstance | null>(null)
|
|
137
141
|
|
|
138
142
|
function toggleConfirmationTooltip(): void {
|
|
@@ -16,11 +16,14 @@
|
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<script lang="ts">
|
|
19
|
-
import {computed, defineComponent, PropType} from 'vue'
|
|
19
|
+
import { computed, defineComponent, PropType } from 'vue'
|
|
20
20
|
|
|
21
21
|
import config from '@/config'
|
|
22
22
|
import { formatRows } from '@/utils/placeholder'
|
|
23
|
-
import type {
|
|
23
|
+
import type {
|
|
24
|
+
ContentPlaceholderRows,
|
|
25
|
+
ContentPlaceholderStyledRows
|
|
26
|
+
} from '@/utils/placeholderTypes'
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* A component to fill empty spaces with animated placeholders until content is loaded.
|
|
@@ -43,12 +46,13 @@ export default defineComponent({
|
|
|
43
46
|
default: '250%'
|
|
44
47
|
}
|
|
45
48
|
},
|
|
46
|
-
setup(props){
|
|
47
|
-
const formattedRows = computed(():ContentPlaceholderStyledRows=>{
|
|
48
|
-
return props.rows
|
|
49
|
-
|
|
49
|
+
setup(props) {
|
|
50
|
+
const formattedRows = computed((): ContentPlaceholderStyledRows => {
|
|
51
|
+
return props.rows
|
|
52
|
+
? formatRows(props.rows, 'content-placeholder__wrapper__row__box')
|
|
53
|
+
: []
|
|
50
54
|
})
|
|
51
|
-
return {formattedRows}
|
|
55
|
+
return { formattedRows }
|
|
52
56
|
}
|
|
53
57
|
})
|
|
54
58
|
</script>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {computed, defineComponent,ref,PropType} from 'vue'
|
|
2
|
+
import { computed, defineComponent, ref, PropType } from 'vue'
|
|
3
3
|
import { useI18n } from 'vue-i18n'
|
|
4
4
|
|
|
5
5
|
import { Size } from '@/enums'
|
|
6
|
-
import {BPagination} from
|
|
6
|
+
import { BPagination } from 'bootstrap-vue-next'
|
|
7
7
|
|
|
8
8
|
export default defineComponent({
|
|
9
9
|
name: 'CustomPagination',
|
|
10
|
-
components: {BPagination},
|
|
10
|
+
components: { BPagination },
|
|
11
11
|
props: {
|
|
12
12
|
/**
|
|
13
13
|
* Total items to be stored in pages
|
|
@@ -59,10 +59,10 @@ export default defineComponent({
|
|
|
59
59
|
default: null
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
emits:[
|
|
63
|
-
setup(props, {emit}) {
|
|
64
|
-
const {t} = useI18n()
|
|
65
|
-
const customPaginationForm = ref<HTMLFormElement|null>(null)
|
|
62
|
+
emits: ['update:modelValue'],
|
|
63
|
+
setup(props, { emit }) {
|
|
64
|
+
const { t } = useI18n()
|
|
65
|
+
const customPaginationForm = ref<HTMLFormElement | null>(null)
|
|
66
66
|
const currentPageInput = ref('')
|
|
67
67
|
const invalidNumberError = t('custom-pagination.invalid-number-error')
|
|
68
68
|
const errors = ref<string[]>([])
|
|
@@ -81,7 +81,9 @@ export default defineComponent({
|
|
|
81
81
|
})
|
|
82
82
|
|
|
83
83
|
function applyJumpFormPage(): void {
|
|
84
|
-
const number = isNaN(parseInt(currentPageInput.value))
|
|
84
|
+
const number = isNaN(parseInt(currentPageInput.value))
|
|
85
|
+
? 0
|
|
86
|
+
: parseInt(currentPageInput.value)
|
|
85
87
|
errors.value = []
|
|
86
88
|
if (number > numberOfPages.value || number < 1) {
|
|
87
89
|
errors.value.push(invalidNumberError)
|
|
@@ -91,7 +93,7 @@ export default defineComponent({
|
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
function updateModelValue(value: string|number): void {
|
|
96
|
+
function updateModelValue(value: string | number): void {
|
|
95
97
|
emit('update:modelValue', value)
|
|
96
98
|
}
|
|
97
99
|
|
|
@@ -104,31 +106,36 @@ export default defineComponent({
|
|
|
104
106
|
paginationClassList,
|
|
105
107
|
t,
|
|
106
108
|
applyJumpFormPage,
|
|
107
|
-
updateModelValue
|
|
109
|
+
updateModelValue
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
|
-
|
|
111
112
|
})
|
|
112
113
|
</script>
|
|
113
114
|
|
|
114
115
|
<template>
|
|
115
116
|
<div
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
class="custom-pagination container-fluid"
|
|
118
|
+
:class="{
|
|
119
|
+
'custom-pagination--compact': compact,
|
|
120
|
+
'custom-pagination--pills': pills
|
|
121
|
+
}"
|
|
118
122
|
>
|
|
119
|
-
<div
|
|
123
|
+
<div
|
|
124
|
+
class="row justify-content-center align-items-stretch"
|
|
125
|
+
:class="{ 'no-gutters': compact && !pills }"
|
|
126
|
+
>
|
|
120
127
|
<div class="col-auto custom-pagination__pages">
|
|
121
128
|
<b-pagination
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
:total-rows="perPage * numberOfPages"
|
|
130
|
+
:per-page="perPage"
|
|
131
|
+
:model-value="modelValue"
|
|
132
|
+
:pills="pills"
|
|
133
|
+
:class="paginationClassList"
|
|
134
|
+
:size="size"
|
|
135
|
+
class="m-0"
|
|
136
|
+
first-number
|
|
137
|
+
last-number
|
|
138
|
+
@update:modelValue="updateModelValue"
|
|
132
139
|
>
|
|
133
140
|
<template #prev-text="{ disabled, index, page }">
|
|
134
141
|
<!-- @slot The 'Go to previous page' button content -->
|
|
@@ -140,7 +147,10 @@ export default defineComponent({
|
|
|
140
147
|
</template>
|
|
141
148
|
<template #page="{ active, content, disabled, index, page }">
|
|
142
149
|
<!-- @slot Page number button content -->
|
|
143
|
-
<slot
|
|
150
|
+
<slot
|
|
151
|
+
name="page"
|
|
152
|
+
v-bind="{ active, content, disabled, index, page }"
|
|
153
|
+
/>
|
|
144
154
|
</template>
|
|
145
155
|
<template #ellipsis-text>
|
|
146
156
|
<!-- @slot The '...' indicator content. Overrides the `ellipsis-text` prop -->
|
|
@@ -150,14 +160,18 @@ export default defineComponent({
|
|
|
150
160
|
</div>
|
|
151
161
|
<div class="col-auto">
|
|
152
162
|
<div class="custom-pagination__form">
|
|
153
|
-
<form
|
|
163
|
+
<form
|
|
164
|
+
ref="customPaginationForm"
|
|
165
|
+
class="input-group"
|
|
166
|
+
@submit.prevent="applyJumpFormPage"
|
|
167
|
+
>
|
|
154
168
|
<b-input-group :size="size">
|
|
155
169
|
<input
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
170
|
+
v-model="currentPageInput"
|
|
171
|
+
type="number"
|
|
172
|
+
class="form-control"
|
|
173
|
+
:placeholder="inputPlaceholder"
|
|
174
|
+
aria-label="Jump to page"
|
|
161
175
|
/>
|
|
162
176
|
<div v-if="!compact" class="input-group-append">
|
|
163
177
|
<button class="btn btn-secondary btn-sm" type="submit">
|
|
@@ -167,7 +181,11 @@ export default defineComponent({
|
|
|
167
181
|
</b-input-group>
|
|
168
182
|
</form>
|
|
169
183
|
<template v-if="!compact">
|
|
170
|
-
<small
|
|
184
|
+
<small
|
|
185
|
+
v-if="errors.length"
|
|
186
|
+
id="invalid-number-error"
|
|
187
|
+
class="float-start mt-1 ms-1 text-danger"
|
|
188
|
+
>
|
|
171
189
|
{{ errors[0] }}
|
|
172
190
|
</small>
|
|
173
191
|
<small v-else class="float-start mt-1 ms-1 text-muted">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { filter } from 'lodash'
|
|
3
|
-
import {computed, defineComponent, nextTick, onMounted, ref, watch} from 'vue'
|
|
3
|
+
import { computed, defineComponent, nextTick, onMounted, ref, watch } from 'vue'
|
|
4
4
|
|
|
5
5
|
type DigitsInputData = {
|
|
6
6
|
mounted: boolean
|
|
@@ -12,7 +12,7 @@ type DigitsInputData = {
|
|
|
12
12
|
*/
|
|
13
13
|
export default defineComponent({
|
|
14
14
|
name: 'DigitsInput',
|
|
15
|
-
emits: ['update:modelValue','update:values'],
|
|
15
|
+
emits: ['update:modelValue', 'update:values'],
|
|
16
16
|
props: {
|
|
17
17
|
/**
|
|
18
18
|
* Number of digits to display
|
|
@@ -36,20 +36,21 @@ export default defineComponent({
|
|
|
36
36
|
default: ''
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
setup(props, {emit}) {
|
|
40
|
-
|
|
41
|
-
const inputs = ref<HTMLInputElement[]>([]);
|
|
39
|
+
setup(props, { emit }) {
|
|
40
|
+
const inputs = ref<HTMLInputElement[]>([])
|
|
42
41
|
|
|
43
42
|
onMounted(async () => {
|
|
44
43
|
await nextTick()
|
|
45
44
|
})
|
|
46
45
|
|
|
47
|
-
const values = ref(
|
|
48
|
-
|
|
46
|
+
const values = ref(
|
|
47
|
+
String(props.modelValue).split('').slice(0, props.length)
|
|
48
|
+
)
|
|
49
|
+
const joinedValues = computed((): string => {
|
|
49
50
|
return filter(values.value, (v) => !isNaN(v as any)).join('')
|
|
50
51
|
})
|
|
51
52
|
|
|
52
|
-
const nextInput = computed((): HTMLInputElement | null =>{
|
|
53
|
+
const nextInput = computed((): HTMLInputElement | null => {
|
|
53
54
|
if (joinedValues.value.length === props.length) {
|
|
54
55
|
return null
|
|
55
56
|
}
|
|
@@ -58,18 +59,18 @@ export default defineComponent({
|
|
|
58
59
|
return inputs.value[joinedValues.value.length] || lastInput.value
|
|
59
60
|
})
|
|
60
61
|
|
|
61
|
-
const hasNextInput = computed((): boolean=> {
|
|
62
|
+
const hasNextInput = computed((): boolean => {
|
|
62
63
|
return !!nextInput.value
|
|
63
64
|
})
|
|
64
65
|
|
|
65
|
-
const lastInput = computed((): HTMLElement | null=> {
|
|
66
|
-
const index = inputs.value.length -1
|
|
66
|
+
const lastInput = computed((): HTMLElement | null => {
|
|
67
|
+
const index = inputs.value.length - 1
|
|
67
68
|
return inputs.value[index]
|
|
68
69
|
})
|
|
69
70
|
|
|
70
71
|
function focusToNextInput() {
|
|
71
72
|
if (hasNextInput.value) {
|
|
72
|
-
|
|
73
|
+
nextInput.value?.focus()
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
function focusToPreviousWhenEmpty(d: number) {
|
|
@@ -78,51 +79,55 @@ export default defineComponent({
|
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
watch(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// We update the values data attribute only if they changed
|
|
102
|
-
// to avoid an infinite update cycle
|
|
103
|
-
if (JSON.stringify(values.value) !== JSON.stringify(formattedValues)) {
|
|
104
|
-
values.value = formattedValues.slice(0, props.length)
|
|
82
|
+
() => values,
|
|
83
|
+
(values) => {
|
|
84
|
+
// Copy and remove values that are not numbers
|
|
85
|
+
const formattedValues = values.value.map((value) =>
|
|
86
|
+
String(value).replace(/\D/g, '')
|
|
87
|
+
)
|
|
88
|
+
// Iterate over the values to be sure
|
|
89
|
+
// they are not exceeding 10 and should
|
|
90
|
+
// be spread to the next inputs
|
|
91
|
+
formattedValues.forEach((value, d) => {
|
|
92
|
+
// The value must be spread to the next input only
|
|
93
|
+
// if it's higher than 9 (more than one digit)
|
|
94
|
+
if (value !== null && Number(value) > 9) {
|
|
95
|
+
// Split the number into an array of strings
|
|
96
|
+
String(value)
|
|
97
|
+
.split('')
|
|
98
|
+
.forEach((nextValue, n) => {
|
|
99
|
+
// Spread the value to the next inputs of the array
|
|
100
|
+
formattedValues[d + n] = String(Number(nextValue))
|
|
101
|
+
})
|
|
105
102
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
})
|
|
104
|
+
// We update the values data attribute only if they changed
|
|
105
|
+
// to avoid an infinite update cycle
|
|
106
|
+
if (JSON.stringify(values.value) !== JSON.stringify(formattedValues)) {
|
|
107
|
+
values.value = formattedValues.slice(0, props.length)
|
|
108
|
+
}
|
|
109
|
+
focusToNextInput()
|
|
110
|
+
},
|
|
111
|
+
{ deep: true }
|
|
112
|
+
)
|
|
110
113
|
|
|
111
114
|
watch(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
() => joinedValues,
|
|
116
|
+
() => {
|
|
117
|
+
emit('update:modelValue', joinedValues.value)
|
|
118
|
+
},
|
|
119
|
+
{ deep: true }
|
|
117
120
|
)
|
|
118
121
|
|
|
119
122
|
watch(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
() => props.modelValue,
|
|
124
|
+
() => {
|
|
125
|
+
const formattedValues = String(props.modelValue)
|
|
126
|
+
.split('')
|
|
127
|
+
.slice(0, props.length)
|
|
128
|
+
emit('update:values', formattedValues)
|
|
129
|
+
}
|
|
130
|
+
)
|
|
126
131
|
return {
|
|
127
132
|
values,
|
|
128
133
|
joinedValues,
|
|
@@ -132,8 +137,7 @@ export default defineComponent({
|
|
|
132
137
|
lastInput,
|
|
133
138
|
focusToPreviousWhenEmpty
|
|
134
139
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
140
|
+
}
|
|
137
141
|
})
|
|
138
142
|
</script>
|
|
139
143
|
|
|
@@ -141,13 +145,13 @@ export default defineComponent({
|
|
|
141
145
|
<div class="digits-input">
|
|
142
146
|
<div class="d-flex digits-input__container">
|
|
143
147
|
<input
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
ref="inputs"
|
|
149
|
+
v-for="d in length"
|
|
150
|
+
:key="d - 1"
|
|
151
|
+
v-model="values[d - 1]"
|
|
152
|
+
:class="`digits-input__container__input--${d - 1}`"
|
|
153
|
+
class="digits-input__container__input w-0 form-control"
|
|
154
|
+
@keyup.delete="focusToPreviousWhenEmpty(d - 1)"
|
|
151
155
|
/>
|
|
152
156
|
<input type="hidden" :value="joinedValues" :name="name" />
|
|
153
157
|
</div>
|