@icij/murmur-next 4.0.15 → 4.0.18
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/dist/lib/murmur.css +1 -1
- package/dist/lib/murmur.js +32 -27
- package/dist/lib/murmur.js.map +1 -1
- package/dist/lib/murmur.umd.cjs +2 -2
- package/dist/lib/murmur.umd.cjs.map +1 -1
- package/lib/components/ConfirmButton.vue +15 -4
- package/lib/components/CustomPagination.vue +3 -5
- package/lib/components/SignUpForm.vue +11 -4
- package/lib/composables/sendEmail.ts +3 -1
- package/lib/datavisualisations/ColumnChart.vue +3 -0
- package/lib/styles/variables.scss +2 -2
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:model-value="showTooltip"
|
|
13
13
|
:placement="placement"
|
|
14
14
|
:target="uniqComponentId"
|
|
15
|
+
teleport-to="body"
|
|
15
16
|
manual
|
|
16
17
|
>
|
|
17
18
|
<div class="confirm-button__tooltip">
|
|
@@ -148,9 +149,19 @@ export default defineComponent({
|
|
|
148
149
|
emit('toggled', showTooltip.value)
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
function hideConfirmationTooltip(): void {
|
|
153
|
+
showTooltip.value = false
|
|
154
|
+
/**
|
|
155
|
+
* Emitted when the confirmation is toggled.
|
|
156
|
+
* @event toggled
|
|
157
|
+
* @param Boolean True if the button is shown.
|
|
158
|
+
*/
|
|
159
|
+
emit('toggled', false)
|
|
160
|
+
}
|
|
161
|
+
|
|
151
162
|
function cancel(): void {
|
|
152
|
-
|
|
153
|
-
props.cancelled()
|
|
163
|
+
hideConfirmationTooltip()
|
|
164
|
+
props.cancelled?.()
|
|
154
165
|
/**
|
|
155
166
|
* Emitted when the confirmation is cancelled.
|
|
156
167
|
* @event cancelled
|
|
@@ -159,8 +170,8 @@ export default defineComponent({
|
|
|
159
170
|
}
|
|
160
171
|
|
|
161
172
|
function confirm(): void {
|
|
162
|
-
|
|
163
|
-
props.confirmed()
|
|
173
|
+
hideConfirmationTooltip()
|
|
174
|
+
props.confirmed?.()
|
|
164
175
|
/**
|
|
165
176
|
* Emitted when the confirmation is confirmed.
|
|
166
177
|
* @event confirmed
|
|
@@ -173,11 +173,9 @@ export default defineComponent({
|
|
|
173
173
|
:placeholder="inputPlaceholder"
|
|
174
174
|
aria-label="Jump to page"
|
|
175
175
|
/>
|
|
176
|
-
<
|
|
177
|
-
<
|
|
178
|
-
|
|
179
|
-
</button>
|
|
180
|
-
</div>
|
|
176
|
+
<button v-if="!compact" class="btn btn-secondary btn-sm" type="submit">
|
|
177
|
+
<span class="px-1 py-3"> Go </span>
|
|
178
|
+
</button>
|
|
181
179
|
</b-input-group>
|
|
182
180
|
</form>
|
|
183
181
|
<template v-if="!compact">
|
|
@@ -141,11 +141,12 @@ export default defineComponent({
|
|
|
141
141
|
const variantColorClass = computed(() => {
|
|
142
142
|
return `btn-${props.variant}`
|
|
143
143
|
})
|
|
144
|
+
|
|
144
145
|
async function subscribe() {
|
|
145
146
|
resetMessages()
|
|
146
147
|
freeze()
|
|
147
148
|
// Send the data, catch the result no matter what and unfreeze the form
|
|
148
|
-
await send().then(done,
|
|
149
|
+
await send().then(done, error).finally(unfreeze)
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
function done({ result, msg }: any): void {
|
|
@@ -153,18 +154,24 @@ export default defineComponent({
|
|
|
153
154
|
email.value = ''
|
|
154
155
|
successMessage.value = msg
|
|
155
156
|
} else {
|
|
156
|
-
|
|
157
|
-
errorMessage.value =
|
|
158
|
-
last((msg || "Something's wrong").split('0 -')) ?? null
|
|
157
|
+
error({ msg })
|
|
159
158
|
}
|
|
160
159
|
}
|
|
160
|
+
|
|
161
|
+
// Mailchimp formats errors in list
|
|
162
|
+
function error({ msg }: any): void {
|
|
163
|
+
errorMessage.value = last((msg || "Something's wrong").split('0 -')) ?? null
|
|
164
|
+
}
|
|
165
|
+
|
|
161
166
|
function resetMessages() {
|
|
162
167
|
errorMessage.value = null
|
|
163
168
|
successMessage.value = null
|
|
164
169
|
}
|
|
170
|
+
|
|
165
171
|
function freeze() {
|
|
166
172
|
frozen.value = true
|
|
167
173
|
}
|
|
174
|
+
|
|
168
175
|
function unfreeze() {
|
|
169
176
|
frozen.value = false
|
|
170
177
|
}
|
|
@@ -13,7 +13,6 @@ export function useSendEmail(
|
|
|
13
13
|
referrer?: string | null,
|
|
14
14
|
defaultGroups?: string[] | string
|
|
15
15
|
) {
|
|
16
|
-
const emailValue = toValue(email)
|
|
17
16
|
|
|
18
17
|
const groups = computed(() => {
|
|
19
18
|
return flatten(castArray(defaultGroups).map((g) => g.split(',')))
|
|
@@ -22,6 +21,7 @@ export function useSendEmail(
|
|
|
22
21
|
const urlFromAction = computed(() => {
|
|
23
22
|
return action?.replace('/post?', '/post-json?').concat('&c=?')
|
|
24
23
|
})
|
|
24
|
+
|
|
25
25
|
const parentReferrer = computed(() => {
|
|
26
26
|
if (referrer) {
|
|
27
27
|
return referrer
|
|
@@ -36,6 +36,7 @@ export function useSendEmail(
|
|
|
36
36
|
throw new Error('Missing url Info')
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const emailValue = toValue(email)
|
|
39
40
|
const url = new URL(urlFromAction.value)
|
|
40
41
|
url.searchParams.set('SIGNUP', tracker)
|
|
41
42
|
url.searchParams.set('MMERGE24', parentReferrer.value)
|
|
@@ -44,6 +45,7 @@ export function useSendEmail(
|
|
|
44
45
|
|
|
45
46
|
return url.href
|
|
46
47
|
})
|
|
48
|
+
|
|
47
49
|
function send() {
|
|
48
50
|
return new Promise((resolve, reject) => {
|
|
49
51
|
jsonp(
|
|
@@ -529,6 +529,8 @@ export default defineComponent({
|
|
|
529
529
|
left: 0;
|
|
530
530
|
|
|
531
531
|
&__item {
|
|
532
|
+
$tooltip-bg: $body-emphasis-color;
|
|
533
|
+
|
|
532
534
|
display: inline-flex;
|
|
533
535
|
text-align: center;
|
|
534
536
|
flex-direction: row;
|
|
@@ -545,6 +547,7 @@ export default defineComponent({
|
|
|
545
547
|
color: $tooltip-color;
|
|
546
548
|
margin: 0;
|
|
547
549
|
padding: $tooltip-padding-y $tooltip-padding-x;
|
|
550
|
+
|
|
548
551
|
&.fade-enter-active,
|
|
549
552
|
&.fade-leave-active {
|
|
550
553
|
transition: $transition-fade;
|
|
@@ -91,10 +91,10 @@ $tooltip-opacity: 1 !default;
|
|
|
91
91
|
|
|
92
92
|
$alert-border-width: 0;
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
/* Bootstrap variables and functions must be available everywhere */
|
|
95
95
|
@import 'node_modules/bootstrap/scss/_functions.scss';
|
|
96
96
|
@import 'node_modules/bootstrap/scss/_variables.scss';
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
/* Get theses variables to make them available in the doc */
|
|
99
99
|
$theme-colors: none !default;
|
|
100
100
|
$font-family-monospace: none !default;
|