@icij/murmur-next 4.0.1 → 4.0.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/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 +119 -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
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
<div class="container">
|
|
4
4
|
<div class="row">
|
|
5
5
|
<div class="col-12 col-lg-5">
|
|
6
|
-
<h5
|
|
7
|
-
|
|
6
|
+
<h5
|
|
7
|
+
class="text-uppercase text-white clearfix generic-footer__icij mb-3"
|
|
8
|
+
>
|
|
9
|
+
<a
|
|
10
|
+
href="https://icij.org"
|
|
11
|
+
target="_blank"
|
|
12
|
+
class="generic-footer__icij__logo text-decoration-none"
|
|
13
|
+
>
|
|
8
14
|
<brand-expansion :mode="mode" dark />
|
|
9
|
-
<span class="sr-only"
|
|
15
|
+
<span class="sr-only"
|
|
16
|
+
>International Consortium of Investigative Journalists</span
|
|
17
|
+
>
|
|
10
18
|
</a>
|
|
11
19
|
</h5>
|
|
12
20
|
<p>
|
|
@@ -30,22 +38,46 @@
|
|
|
30
38
|
<h5 class="text-uppercase mb-3">About Us</h5>
|
|
31
39
|
<ul class="list-unstyled">
|
|
32
40
|
<li class="list-unstyled-item">
|
|
33
|
-
<a
|
|
41
|
+
<a
|
|
42
|
+
href="https://www.icij.org/about/our-team/"
|
|
43
|
+
target="_blank"
|
|
44
|
+
>
|
|
45
|
+
Our team
|
|
46
|
+
</a>
|
|
34
47
|
</li>
|
|
35
48
|
<li class="list-unstyled-item">
|
|
36
|
-
<a
|
|
49
|
+
<a
|
|
50
|
+
href="https://www.icij.org/about/our-supporters/"
|
|
51
|
+
target="_blank"
|
|
52
|
+
>
|
|
53
|
+
Our supporters
|
|
54
|
+
</a>
|
|
37
55
|
</li>
|
|
38
56
|
<li class="list-unstyled-item">
|
|
39
|
-
<a href="https://www.icij.org/about/awards/" target="_blank">
|
|
57
|
+
<a href="https://www.icij.org/about/awards/" target="_blank">
|
|
58
|
+
ICIJ's Awards
|
|
59
|
+
</a>
|
|
40
60
|
</li>
|
|
41
61
|
<li class="list-unstyled-item">
|
|
42
|
-
<a
|
|
62
|
+
<a
|
|
63
|
+
href="https://www.icij.org/about/corporate/"
|
|
64
|
+
target="_blank"
|
|
65
|
+
>
|
|
66
|
+
Corportate
|
|
67
|
+
</a>
|
|
43
68
|
</li>
|
|
44
69
|
<li class="list-unstyled-item">
|
|
45
|
-
<a
|
|
70
|
+
<a
|
|
71
|
+
href="https://www.icij.org/about/work-with-us/"
|
|
72
|
+
target="_blank"
|
|
73
|
+
>
|
|
74
|
+
Work with us
|
|
75
|
+
</a>
|
|
46
76
|
</li>
|
|
47
77
|
<li class="list-unstyled-item">
|
|
48
|
-
<a href="https://www.icij.org/journalists/" target="_blank">
|
|
78
|
+
<a href="https://www.icij.org/journalists/" target="_blank">
|
|
79
|
+
Journalists
|
|
80
|
+
</a>
|
|
49
81
|
</li>
|
|
50
82
|
</ul>
|
|
51
83
|
</div>
|
|
@@ -58,22 +90,52 @@
|
|
|
58
90
|
<slot name="investigations">
|
|
59
91
|
<ul class="list-unstyled">
|
|
60
92
|
<li class="list-unstyled-item">
|
|
61
|
-
<a
|
|
93
|
+
<a
|
|
94
|
+
href="https://www.icij.org/investigations/uber-files/"
|
|
95
|
+
target="_blank"
|
|
96
|
+
>
|
|
97
|
+
The Uber Files
|
|
98
|
+
</a>
|
|
62
99
|
</li>
|
|
63
100
|
<li class="list-unstyled-item">
|
|
64
|
-
<a
|
|
101
|
+
<a
|
|
102
|
+
href="https://www.icij.org/investigations/russia-archive/"
|
|
103
|
+
target="_blank"
|
|
104
|
+
>
|
|
105
|
+
Russia Archive
|
|
106
|
+
</a>
|
|
65
107
|
</li>
|
|
66
108
|
<li class="list-unstyled-item">
|
|
67
|
-
<a
|
|
109
|
+
<a
|
|
110
|
+
href="https://www.icij.org/investigations/ericsson-list/"
|
|
111
|
+
target="_blank"
|
|
112
|
+
>
|
|
113
|
+
The Ericsson List
|
|
114
|
+
</a>
|
|
68
115
|
</li>
|
|
69
116
|
<li class="list-unstyled-item">
|
|
70
|
-
<a
|
|
117
|
+
<a
|
|
118
|
+
href="https://www.icij.org/investigations/pandora-papers/"
|
|
119
|
+
target="_blank"
|
|
120
|
+
>
|
|
121
|
+
Pandora Papers
|
|
122
|
+
</a>
|
|
71
123
|
</li>
|
|
72
124
|
<li class="list-unstyled-item">
|
|
73
|
-
<a
|
|
125
|
+
<a
|
|
126
|
+
href="https://www.icij.org/investigations/fincen-files/"
|
|
127
|
+
target="_blank"
|
|
128
|
+
>
|
|
129
|
+
FinCEN Files
|
|
130
|
+
</a>
|
|
74
131
|
</li>
|
|
75
132
|
<li class="list-unstyled-item">
|
|
76
|
-
<a
|
|
133
|
+
<a
|
|
134
|
+
href="https://www.icij.org/investigations/"
|
|
135
|
+
target="_blank"
|
|
136
|
+
>
|
|
137
|
+
More investigations
|
|
138
|
+
</a>
|
|
77
139
|
</li>
|
|
78
140
|
</ul>
|
|
79
141
|
</slot>
|
|
@@ -84,19 +146,32 @@
|
|
|
84
146
|
</h5>
|
|
85
147
|
<ul class="list-unstyled">
|
|
86
148
|
<li class="list-unstyled-item">
|
|
87
|
-
<a href="https://www.facebook.com/ICIJ.org" target="_blank">
|
|
149
|
+
<a href="https://www.facebook.com/ICIJ.org" target="_blank">
|
|
150
|
+
Facebook
|
|
151
|
+
</a>
|
|
88
152
|
</li>
|
|
89
153
|
<li class="list-unstyled-item">
|
|
90
|
-
<a
|
|
154
|
+
<a
|
|
155
|
+
href="https://www.linkedin.com/company/1732242/"
|
|
156
|
+
target="_blank"
|
|
157
|
+
>
|
|
158
|
+
LinkedIn
|
|
159
|
+
</a>
|
|
91
160
|
</li>
|
|
92
161
|
<li class="list-unstyled-item">
|
|
93
|
-
<a href="https://twitter.com/ICIJorg" target="_blank">
|
|
162
|
+
<a href="https://twitter.com/ICIJorg" target="_blank">
|
|
163
|
+
Twitter
|
|
164
|
+
</a>
|
|
94
165
|
</li>
|
|
95
166
|
<li class="list-unstyled-item">
|
|
96
|
-
<a href="https://instagram.com/icijorg" target="_blank">
|
|
167
|
+
<a href="https://instagram.com/icijorg" target="_blank">
|
|
168
|
+
Instagram
|
|
169
|
+
</a>
|
|
97
170
|
</li>
|
|
98
171
|
<li class="list-unstyled-item">
|
|
99
|
-
<a href="https://www.icij.org/signup/" target="_blank">
|
|
172
|
+
<a href="https://www.icij.org/signup/" target="_blank">
|
|
173
|
+
Sign-up
|
|
174
|
+
</a>
|
|
100
175
|
</li>
|
|
101
176
|
</ul>
|
|
102
177
|
</div>
|
|
@@ -105,8 +180,8 @@
|
|
|
105
180
|
</div>
|
|
106
181
|
<p class="text-white text-md-right small mt-5">
|
|
107
182
|
<strong>
|
|
108
|
-
© <span class="generic-footer__year">{{ year }}</span> — The
|
|
109
|
-
Journalists.
|
|
183
|
+
© <span class="generic-footer__year">{{ year }}</span> — The
|
|
184
|
+
International Consortium of Investigative Journalists.
|
|
110
185
|
</strong>
|
|
111
186
|
{{ $t('generic-footer.all-rights') }}
|
|
112
187
|
<br />
|
|
@@ -130,7 +205,7 @@ import { BrandMode } from '@/enums'
|
|
|
130
205
|
* GenericFooter
|
|
131
206
|
*/
|
|
132
207
|
export default defineComponent({
|
|
133
|
-
name: 'GenericFooter',
|
|
208
|
+
name: 'GenericFooter',
|
|
134
209
|
components: { BrandExpansion },
|
|
135
210
|
props: {
|
|
136
211
|
/**
|
|
@@ -8,53 +8,90 @@
|
|
|
8
8
|
:offset="100"
|
|
9
9
|
:z-index="1020"
|
|
10
10
|
:on-unpin="closeFollowUsPopover"
|
|
11
|
-
:class="{
|
|
11
|
+
:class="{
|
|
12
|
+
'headroom--frozen': !collapseNavbar,
|
|
13
|
+
'generic-header--collapsed': collapseNavbar
|
|
14
|
+
}"
|
|
12
15
|
:style="{ position: position }"
|
|
13
16
|
>
|
|
14
17
|
<!-- @slot Redefines brand -->
|
|
15
18
|
<slot name="brand">
|
|
16
19
|
<a :href="homeUrl" class="navbar-brand generic-header__brand">
|
|
17
|
-
<brand-expansion
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
<brand-expansion
|
|
21
|
+
:size="45"
|
|
22
|
+
:mode="shortMode"
|
|
23
|
+
class="d-inline-block d-sm-none"
|
|
24
|
+
/>
|
|
25
|
+
<brand-expansion
|
|
26
|
+
:size="45"
|
|
27
|
+
:mode="longMode"
|
|
28
|
+
class="d-none d-sm-inline-block"
|
|
29
|
+
/>
|
|
30
|
+
<span class="sr-only"
|
|
31
|
+
>International Consortium of Investigative Journalists</span
|
|
32
|
+
>
|
|
20
33
|
</a>
|
|
21
34
|
</slot>
|
|
22
|
-
<button
|
|
35
|
+
<button
|
|
36
|
+
class="navbar-toggler border-0"
|
|
37
|
+
type="button"
|
|
38
|
+
aria-label="Toggle navigation"
|
|
39
|
+
@click="toggleNavbar"
|
|
40
|
+
>
|
|
23
41
|
<fa icon="bars" size="xl" class="text-primary" />
|
|
24
42
|
</button>
|
|
25
43
|
<div class="navbar-collapse" :class="{ collapse: collapseNavbar }">
|
|
26
44
|
<ul class="navbar-nav ms-auto">
|
|
27
45
|
<li class="nav-item">
|
|
28
|
-
<a
|
|
46
|
+
<a
|
|
47
|
+
href="https://www.icij.org/investigations/"
|
|
48
|
+
target="_blank"
|
|
49
|
+
class="nav-link text-uppercase"
|
|
50
|
+
>
|
|
29
51
|
{{ t('generic-header.navbar.investigations') }}
|
|
30
52
|
</a>
|
|
31
53
|
</li>
|
|
32
54
|
<li class="nav-item">
|
|
33
|
-
<a
|
|
55
|
+
<a
|
|
56
|
+
href="https://www.icij.org/leak/"
|
|
57
|
+
target="_blank"
|
|
58
|
+
class="nav-link text-uppercase"
|
|
59
|
+
>
|
|
34
60
|
{{ t('generic-header.navbar.leak') }}
|
|
35
61
|
</a>
|
|
36
62
|
</li>
|
|
37
63
|
<li class="nav-item">
|
|
38
|
-
<a
|
|
64
|
+
<a
|
|
65
|
+
id="follow-us-toggler"
|
|
66
|
+
class="nav-link text-uppercase"
|
|
67
|
+
@mouseenter="showFollowUsPopover = true"
|
|
68
|
+
>
|
|
39
69
|
{{ t('generic-header.navbar.follow') }}
|
|
40
70
|
</a>
|
|
41
71
|
</li>
|
|
42
72
|
<li class="nav-item me-lg-3">
|
|
43
73
|
<slot name="donate-link">
|
|
44
|
-
<a
|
|
74
|
+
<a
|
|
75
|
+
class="text-uppercase btn btn-primary fw-bold"
|
|
76
|
+
target="_blank"
|
|
77
|
+
:href="donateUrl"
|
|
78
|
+
>
|
|
45
79
|
{{ t('generic-header.navbar.support') }}
|
|
46
80
|
</a>
|
|
47
81
|
</slot>
|
|
48
82
|
</li>
|
|
49
83
|
</ul>
|
|
50
84
|
<b-popover
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
85
|
+
v-model="showFollowUsPopover"
|
|
86
|
+
target="follow-us-toggler"
|
|
87
|
+
placement="bottom-start"
|
|
88
|
+
ref="followUsPopover"
|
|
89
|
+
click
|
|
56
90
|
>
|
|
57
|
-
<follow-us-popover
|
|
91
|
+
<follow-us-popover
|
|
92
|
+
@update:close="closeFollowUsPopover"
|
|
93
|
+
@keydown.esc="closeFollowUsPopover"
|
|
94
|
+
/>
|
|
58
95
|
</b-popover>
|
|
59
96
|
</div>
|
|
60
97
|
</component>
|
|
@@ -63,7 +100,7 @@
|
|
|
63
100
|
|
|
64
101
|
<script lang="ts">
|
|
65
102
|
import { faBars } from '@fortawesome/free-solid-svg-icons/faBars'
|
|
66
|
-
import headroom
|
|
103
|
+
import headroom from 'vue-headroom/src/headroom.vue'
|
|
67
104
|
import {
|
|
68
105
|
computed,
|
|
69
106
|
defineComponent,
|
|
@@ -78,9 +115,9 @@ import config from '@/config'
|
|
|
78
115
|
import Fa, { library } from '@/components/Fa'
|
|
79
116
|
import BrandExpansion from '@/components/BrandExpansion.vue'
|
|
80
117
|
import FollowUsPopover from '@/components/FollowUsPopover.vue'
|
|
81
|
-
import {BrandMode} from '@/enums'
|
|
82
|
-
import {useI18n} from
|
|
83
|
-
import {BPopover} from
|
|
118
|
+
import { BrandMode } from '@/enums'
|
|
119
|
+
import { useI18n } from 'vue-i18n'
|
|
120
|
+
import { BPopover } from 'bootstrap-vue-next'
|
|
84
121
|
|
|
85
122
|
type BrandOptions = {
|
|
86
123
|
noBorder: boolean
|
|
@@ -114,7 +151,7 @@ export default defineComponent({
|
|
|
114
151
|
*/
|
|
115
152
|
noHeadroom: {
|
|
116
153
|
type: Boolean,
|
|
117
|
-
default:false
|
|
154
|
+
default: false
|
|
118
155
|
},
|
|
119
156
|
/**
|
|
120
157
|
* Target link of the ICIJ logo and project name.
|
|
@@ -139,13 +176,14 @@ export default defineComponent({
|
|
|
139
176
|
}
|
|
140
177
|
},
|
|
141
178
|
setup(props) {
|
|
142
|
-
|
|
143
|
-
onBeforeMount((): void =>{
|
|
179
|
+
onBeforeMount((): void => {
|
|
144
180
|
library.add(faBars)
|
|
145
181
|
})
|
|
146
182
|
|
|
147
|
-
const {t}= useI18n()
|
|
148
|
-
const followUsPopover = ref<ComponentPublicInstance<
|
|
183
|
+
const { t } = useI18n()
|
|
184
|
+
const followUsPopover = ref<ComponentPublicInstance<
|
|
185
|
+
typeof BPopover
|
|
186
|
+
> | null>(null)
|
|
149
187
|
const closable = ref(false)
|
|
150
188
|
const showFollowUsPopover = ref<boolean>(false)
|
|
151
189
|
const collapseNavbar = ref(true)
|
|
@@ -155,9 +193,9 @@ export default defineComponent({
|
|
|
155
193
|
return props.noHeadroom ? 'div' : 'headroom'
|
|
156
194
|
})
|
|
157
195
|
const appliedBrandOptions = computed((): BrandOptions => {
|
|
158
|
-
return {...defaultBrandOptions.value
|
|
196
|
+
return { ...defaultBrandOptions.value, ...props.brandOptions }
|
|
159
197
|
})
|
|
160
|
-
const
|
|
198
|
+
const defaultBrandOptions = computed((): BrandOptions => {
|
|
161
199
|
return {
|
|
162
200
|
noBorder: true,
|
|
163
201
|
size: 50,
|
|
@@ -166,10 +204,10 @@ export default defineComponent({
|
|
|
166
204
|
}
|
|
167
205
|
})
|
|
168
206
|
function closeFollowUsPopover() {
|
|
169
|
-
if(followUsPopover.value?.hide){
|
|
207
|
+
if (followUsPopover.value?.hide) {
|
|
170
208
|
followUsPopover.value?.hide(new Event('forceHide'))
|
|
171
209
|
}
|
|
172
|
-
showFollowUsPopover.value=false
|
|
210
|
+
showFollowUsPopover.value = false
|
|
173
211
|
}
|
|
174
212
|
function toggleNavbar(): void {
|
|
175
213
|
collapseNavbar.value = !collapseNavbar.value
|
|
@@ -203,7 +241,6 @@ export default defineComponent({
|
|
|
203
241
|
width: 100%;
|
|
204
242
|
z-index: $zindex-sticky;
|
|
205
243
|
|
|
206
|
-
|
|
207
244
|
.popover {
|
|
208
245
|
width: 100%;
|
|
209
246
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {FontAwesomeLayers} from '@fortawesome/vue-fontawesome'
|
|
3
|
-
import {faClipboard} from '@fortawesome/free-solid-svg-icons/faClipboard'
|
|
4
|
-
import {faClipboardCheck} from '@fortawesome/free-solid-svg-icons/faClipboardCheck'
|
|
5
|
-
import {BTooltip, PopoverPlacement} from 'bootstrap-vue-next'
|
|
2
|
+
import { FontAwesomeLayers } from '@fortawesome/vue-fontawesome'
|
|
3
|
+
import { faClipboard } from '@fortawesome/free-solid-svg-icons/faClipboard'
|
|
4
|
+
import { faClipboardCheck } from '@fortawesome/free-solid-svg-icons/faClipboardCheck'
|
|
5
|
+
import { BTooltip, PopoverPlacement } from 'bootstrap-vue-next'
|
|
6
6
|
|
|
7
7
|
import noop from 'lodash/noop'
|
|
8
8
|
import {
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
PropType,
|
|
16
16
|
ref
|
|
17
17
|
} from 'vue'
|
|
18
|
-
import {TranslateResult, useI18n} from 'vue-i18n'
|
|
18
|
+
import { TranslateResult, useI18n } from 'vue-i18n'
|
|
19
19
|
|
|
20
|
-
import {default as Fa, library} from './Fa'
|
|
20
|
+
import { default as Fa, library } from './Fa'
|
|
21
21
|
|
|
22
|
-
import {copyHtml, copyText} from '@/utils/clipboard'
|
|
22
|
+
import { copyHtml, copyText } from '@/utils/clipboard'
|
|
23
23
|
|
|
24
24
|
type HapticCopyData = {
|
|
25
25
|
mounted: boolean
|
|
@@ -92,8 +92,8 @@ export default defineComponent({
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
emits: ['attempt', 'success', 'error', 'hideClipboardTooltip'],
|
|
95
|
-
setup(props, {emit, expose}) {
|
|
96
|
-
const {t, te} = useI18n()
|
|
95
|
+
setup(props, { emit, expose }) {
|
|
96
|
+
const { t, te } = useI18n()
|
|
97
97
|
const tooltip = ref<ComponentPublicInstance | null>(null)
|
|
98
98
|
const el = ref<ComponentPublicInstance<HTMLElement> | null>(null)
|
|
99
99
|
const tooltipContent = ref<string>('')
|
|
@@ -108,7 +108,7 @@ export default defineComponent({
|
|
|
108
108
|
// id (if any) because BootstrapVue doesn't like HTMLElement for some
|
|
109
109
|
// reasons.
|
|
110
110
|
|
|
111
|
-
return el.value?.id.length ? `#${el.value.id}` : null
|
|
111
|
+
return el.value?.id.length ? `#${el.value.id}` : null
|
|
112
112
|
})
|
|
113
113
|
|
|
114
114
|
function copyTextToClipboard(): Promise<void> {
|
|
@@ -167,7 +167,6 @@ export default defineComponent({
|
|
|
167
167
|
showClipboardTooltip.value = false
|
|
168
168
|
tooltipTimeout.value = undefined
|
|
169
169
|
emit('hideClipboardTooltip')
|
|
170
|
-
|
|
171
170
|
}
|
|
172
171
|
|
|
173
172
|
function nextTimeout(fn = noop, delay = 0) {
|
|
@@ -175,15 +174,15 @@ export default defineComponent({
|
|
|
175
174
|
return new Promise((resolve) => {
|
|
176
175
|
tooltipTimeout.value = setTimeout(resolve, delay)
|
|
177
176
|
})
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
.finally(nextTick)
|
|
178
|
+
.then(fn)
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
onUnmounted(() => {
|
|
183
182
|
closeTooltip()
|
|
184
183
|
})
|
|
185
184
|
expose({
|
|
186
|
-
hide: closeTooltip
|
|
185
|
+
hide: closeTooltip
|
|
187
186
|
})
|
|
188
187
|
return {
|
|
189
188
|
t,
|
|
@@ -196,41 +195,54 @@ export default defineComponent({
|
|
|
196
195
|
copy,
|
|
197
196
|
closeTooltip,
|
|
198
197
|
openTooltip,
|
|
199
|
-
nextTimeout
|
|
198
|
+
nextTimeout
|
|
200
199
|
}
|
|
201
|
-
}
|
|
200
|
+
}
|
|
202
201
|
})
|
|
203
202
|
</script>
|
|
204
203
|
|
|
205
204
|
<template>
|
|
206
|
-
<button
|
|
205
|
+
<button
|
|
206
|
+
id="hapticCopy"
|
|
207
|
+
ref="el"
|
|
208
|
+
class="btn haptic-copy"
|
|
209
|
+
@mouseleave="closeTooltip"
|
|
210
|
+
@click.stop="copy"
|
|
211
|
+
>
|
|
207
212
|
<!-- @slot Main content of the button (including the icon) -->
|
|
208
213
|
<slot>
|
|
209
214
|
<font-awesome-layers>
|
|
210
215
|
<transition name="spin">
|
|
211
|
-
<fa
|
|
216
|
+
<fa
|
|
217
|
+
v-if="!tooltipTimeout"
|
|
218
|
+
class="haptic-copy__icon"
|
|
219
|
+
icon="clipboard"
|
|
220
|
+
/>
|
|
212
221
|
</transition>
|
|
213
222
|
<transition name="spin">
|
|
214
|
-
<fa
|
|
223
|
+
<fa
|
|
224
|
+
v-if="tooltipTimeout"
|
|
225
|
+
class="haptic-copy__icon"
|
|
226
|
+
icon="clipboard-check"
|
|
227
|
+
/>
|
|
215
228
|
</transition>
|
|
216
229
|
</font-awesome-layers>
|
|
217
230
|
<span :class="{ 'sr-only': hideLabel }" class="ms-1 haptic-copy__label">
|
|
218
|
-
|
|
219
|
-
|
|
231
|
+
{{ label || t('haptic-copy.label') }}
|
|
232
|
+
</span>
|
|
220
233
|
</slot>
|
|
221
234
|
<b-tooltip
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
v-if="!noTooltip"
|
|
236
|
+
ref="tooltip"
|
|
237
|
+
:model-value="showClipboardTooltip"
|
|
238
|
+
:placement="tooltipPlacement"
|
|
239
|
+
manual
|
|
240
|
+
noninteractive
|
|
241
|
+
target="hapticCopy"
|
|
229
242
|
>
|
|
230
243
|
{{ tooltipContent }}
|
|
231
244
|
</b-tooltip>
|
|
232
245
|
</button>
|
|
233
|
-
|
|
234
246
|
</template>
|
|
235
247
|
<style lang="scss">
|
|
236
248
|
.haptic-copy {
|