@icij/murmur-next 4.0.12 → 4.0.14
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/components/AccordionStep.vue.d.ts +1 -2
- package/dist/lib/components/AccordionWrapper.vue.d.ts +1 -2
- package/dist/lib/components/ActiveTextTruncate.vue.d.ts +0 -2
- package/dist/lib/components/AdvancedLinkForm.vue.d.ts +6 -8
- package/dist/lib/components/Brand.vue.d.ts +1 -3
- package/dist/lib/components/BrandExpansion.vue.d.ts +2 -3
- package/dist/lib/components/ConfirmButton.vue.d.ts +1 -2
- package/dist/lib/components/ContentPlaceholder.vue.d.ts +2 -3
- package/dist/lib/components/CustomPagination.vue.d.ts +5 -6
- package/dist/lib/components/DigitsInput.vue.d.ts +0 -2
- package/dist/lib/components/DonateForm.vue.d.ts +4 -6
- package/dist/lib/components/EmbedForm.vue.d.ts +4 -6
- package/dist/lib/components/EmbeddableFooter.vue.d.ts +0 -2
- package/dist/lib/components/FollowUsPopover.vue.d.ts +4 -6
- package/dist/lib/components/GenericFooter.vue.d.ts +1 -2
- package/dist/lib/components/GenericHeader.vue.d.ts +399 -421
- package/dist/lib/components/HapticCopy.vue.d.ts +9 -10
- package/dist/lib/components/ImddbHeader.vue.d.ts +398 -420
- package/dist/lib/components/OrdinalLegend.vue.d.ts +1 -2
- package/dist/lib/components/RangePicker.vue.d.ts +6 -7
- package/dist/lib/components/ResponsiveIframe.vue.d.ts +2 -4
- package/dist/lib/components/ScaleLegend.vue.d.ts +3 -5
- package/dist/lib/components/SecretInput.vue.d.ts +0 -2
- package/dist/lib/components/SelectableDropdown.vue.d.ts +8 -8
- package/dist/lib/components/SharingOptions.vue.d.ts +2 -3
- package/dist/lib/components/SharingOptionsLink.vue.d.ts +1 -2
- package/dist/lib/components/SignUpForm.vue.d.ts +6 -7
- package/dist/lib/components/SlideUpDown.vue.d.ts +2 -3
- package/dist/lib/components/TexturedDeck.vue.d.ts +1 -2
- package/dist/lib/components/TinyPagination.vue.d.ts +9 -9
- package/dist/lib/composables/chart.d.ts +1 -2
- package/dist/lib/composables/resizeObserver.d.ts +1 -2
- package/dist/lib/composables/sendEmail.d.ts +1 -2
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/datavisualisations/BarChart.vue.d.ts +27 -21
- package/dist/lib/datavisualisations/ColumnChart.vue.d.ts +9 -14
- package/dist/lib/datavisualisations/LineChart.vue.d.ts +7 -17
- package/dist/lib/datavisualisations/StackedBarChart.vue.d.ts +7 -9
- package/dist/lib/datavisualisations/StackedColumnChart.vue.d.ts +5 -7
- package/dist/lib/i18n.d.ts +1 -0
- package/dist/lib/main.d.ts +4 -5
- package/dist/lib/maps/ChoroplethMap.vue.d.ts +6 -14
- package/dist/lib/maps/ChoroplethMapAnnotation.vue.d.ts +0 -2
- package/dist/lib/maps/SymbolMap.vue.d.ts +5 -6
- package/dist/lib/murmur.css +1 -1
- package/dist/lib/murmur.js +14002 -13433
- package/dist/lib/murmur.js.map +1 -1
- package/dist/lib/murmur.umd.cjs +46 -42
- package/dist/lib/murmur.umd.cjs.map +1 -1
- package/dist/lib/types.d.ts +3 -6
- package/dist/lib/utils/assets.d.ts +1 -1
- package/dist/lib/utils/iframe-resizer.d.ts +1 -1
- package/dist/lib/utils/placeholder.d.ts +1 -0
- package/dist/lib/utils/placeholderTypes.d.ts +2 -3
- package/lib/assets/images/murmur-textured.png +0 -0
- package/lib/components/AdvancedLinkForm.vue +22 -32
- package/lib/components/HapticCopy.vue +10 -3
- package/lib/components/SecretInput.vue +12 -15
- package/lib/components/SelectableDropdown.vue +24 -18
- package/lib/components/SharingOptions.vue +10 -20
- package/lib/datavisualisations/BarChart.vue +15 -10
- package/package.json +13 -14
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node_modules/vue-i18n/dist/vue-i18n" />
|
|
3
|
-
import type { StyleValue } from '../node_modules/vue';
|
|
1
|
+
import { StyleValue, ComputedRef, Ref } from '../node_modules/vue';
|
|
4
2
|
import { AccordionKey, ParentKey } from './keys';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { Ref } from '../node_modules/vue';
|
|
3
|
+
import { GeoProjection } from 'd3-geo';
|
|
4
|
+
|
|
8
5
|
export type Step = symbol | string;
|
|
9
6
|
export type Accordion = {
|
|
10
7
|
emitAccordionNextStepEvent: () => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const injectAsset: ((file: string, id?: string) => Promise<unknown>) & import(
|
|
1
|
+
export declare const injectAsset: ((file: string, id?: string) => Promise<unknown>) & import('lodash').MemoizedFunction;
|
|
2
2
|
export declare const injectAssets: (...args: string[]) => Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BoxStyle, ContentPlaceholderStyledRows, ContentPlaceholderRows } from './placeholderTypes';
|
|
2
|
+
|
|
2
3
|
export declare function isFlexBasis(value: string | number): boolean;
|
|
3
4
|
export declare function isWidth(value: string | number): boolean;
|
|
4
5
|
export declare function getBoxStyle(left: number, width: number, isLast: boolean, subClass?: string): BoxStyle[];
|
|
Binary file
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
BTabs,
|
|
5
5
|
BTab,
|
|
6
6
|
BInputGroup,
|
|
7
|
-
BInputGroupAppend,
|
|
8
7
|
BFormInput
|
|
9
8
|
} from 'bootstrap-vue-next'
|
|
10
9
|
|
|
@@ -35,7 +34,6 @@ export default defineComponent({
|
|
|
35
34
|
BTabs,
|
|
36
35
|
BTab,
|
|
37
36
|
BInputGroup,
|
|
38
|
-
BInputGroupAppend,
|
|
39
37
|
BFormInput,
|
|
40
38
|
HapticCopy
|
|
41
39
|
},
|
|
@@ -216,13 +214,11 @@ export default defineComponent({
|
|
|
216
214
|
class="advanced-link-form__raw__input"
|
|
217
215
|
@click="selectRaw"
|
|
218
216
|
/>
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
/>
|
|
225
|
-
</b-input-group-append>
|
|
217
|
+
<haptic-copy
|
|
218
|
+
class="btn-secondary"
|
|
219
|
+
:text="link"
|
|
220
|
+
@attempt="selectRaw"
|
|
221
|
+
/>
|
|
226
222
|
</b-input-group>
|
|
227
223
|
</div>
|
|
228
224
|
</b-tab>
|
|
@@ -236,15 +232,13 @@ export default defineComponent({
|
|
|
236
232
|
@click.prevent="selectRich"
|
|
237
233
|
>{{ titleOrLink }}</a
|
|
238
234
|
>
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
/>
|
|
247
|
-
</b-input-group-append>
|
|
235
|
+
<haptic-copy
|
|
236
|
+
class="btn-secondary"
|
|
237
|
+
html
|
|
238
|
+
:text="linkAsHtml"
|
|
239
|
+
:plain="link"
|
|
240
|
+
@attempt="selectRich"
|
|
241
|
+
/>
|
|
248
242
|
</b-input-group>
|
|
249
243
|
<p class="text-muted mt-2 mb-0">
|
|
250
244
|
{{ t('advanced-link-form.rich.description') }}
|
|
@@ -264,13 +258,11 @@ export default defineComponent({
|
|
|
264
258
|
class="advanced-link-form__markdown__input"
|
|
265
259
|
@click="selectMarkdown"
|
|
266
260
|
/>
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
/>
|
|
273
|
-
</b-input-group-append>
|
|
261
|
+
<haptic-copy
|
|
262
|
+
class="btn-secondary"
|
|
263
|
+
:text="linkAsMarkdown"
|
|
264
|
+
@attempt="selectMarkdown"
|
|
265
|
+
/>
|
|
274
266
|
</b-input-group>
|
|
275
267
|
<p class="text-muted mt-2 mb-0">
|
|
276
268
|
{{ t('advanced-link-form.markdown.description') }}
|
|
@@ -287,13 +279,11 @@ export default defineComponent({
|
|
|
287
279
|
class="advanced-link-form__html__input"
|
|
288
280
|
@click="selectHtml"
|
|
289
281
|
/>
|
|
290
|
-
<
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
/>
|
|
296
|
-
</b-input-group-append>
|
|
282
|
+
<haptic-copy
|
|
283
|
+
class="btn-secondary"
|
|
284
|
+
:text="linkAsHtml"
|
|
285
|
+
@attempt="selectHtml"
|
|
286
|
+
/>
|
|
297
287
|
</b-input-group>
|
|
298
288
|
</div>
|
|
299
289
|
</b-tab>
|
|
@@ -5,6 +5,7 @@ import { faClipboardCheck } from '@fortawesome/free-solid-svg-icons/faClipboardC
|
|
|
5
5
|
import { BTooltip, PopoverPlacement } from 'bootstrap-vue-next'
|
|
6
6
|
|
|
7
7
|
import noop from 'lodash/noop'
|
|
8
|
+
import uniqueId from 'lodash/uniqueId'
|
|
8
9
|
import {
|
|
9
10
|
ComponentPublicInstance,
|
|
10
11
|
computed,
|
|
@@ -39,7 +40,7 @@ export default defineComponent({
|
|
|
39
40
|
* Text to copy to the clipboard
|
|
40
41
|
*/
|
|
41
42
|
text: {
|
|
42
|
-
type: String,
|
|
43
|
+
type: [String, Number],
|
|
43
44
|
default: null
|
|
44
45
|
},
|
|
45
46
|
/**
|
|
@@ -99,10 +100,13 @@ export default defineComponent({
|
|
|
99
100
|
const tooltipContent = ref<string>('')
|
|
100
101
|
const tooltipTimeout = ref<NodeJS.Timeout | undefined>(undefined)
|
|
101
102
|
const showClipboardTooltip = ref(false)
|
|
103
|
+
const buttonId = computed(() => uniqueId('haptic-copy-'))
|
|
104
|
+
|
|
102
105
|
onBeforeMount(() => {
|
|
103
106
|
library.add(faClipboard)
|
|
104
107
|
library.add(faClipboardCheck)
|
|
105
108
|
})
|
|
109
|
+
|
|
106
110
|
const tooltipContainer = computed((): string | null => {
|
|
107
111
|
// By default we append the tooltip in the root container using its
|
|
108
112
|
// id (if any) because BootstrapVue doesn't like HTMLElement for some
|
|
@@ -181,13 +185,16 @@ export default defineComponent({
|
|
|
181
185
|
onUnmounted(() => {
|
|
182
186
|
closeTooltip()
|
|
183
187
|
})
|
|
188
|
+
|
|
184
189
|
expose({
|
|
185
190
|
hide: closeTooltip
|
|
186
191
|
})
|
|
192
|
+
|
|
187
193
|
return {
|
|
188
194
|
t,
|
|
189
195
|
tooltip,
|
|
190
196
|
el,
|
|
197
|
+
buttonId,
|
|
191
198
|
showClipboardTooltip,
|
|
192
199
|
tooltipContainer,
|
|
193
200
|
tooltipContent,
|
|
@@ -203,7 +210,7 @@ export default defineComponent({
|
|
|
203
210
|
|
|
204
211
|
<template>
|
|
205
212
|
<button
|
|
206
|
-
id="
|
|
213
|
+
:id="buttonId"
|
|
207
214
|
ref="el"
|
|
208
215
|
class="btn haptic-copy"
|
|
209
216
|
@mouseleave="closeTooltip"
|
|
@@ -236,9 +243,9 @@ export default defineComponent({
|
|
|
236
243
|
ref="tooltip"
|
|
237
244
|
:model-value="showClipboardTooltip"
|
|
238
245
|
:placement="tooltipPlacement"
|
|
246
|
+
:target="buttonId"
|
|
239
247
|
manual
|
|
240
248
|
noninteractive
|
|
241
|
-
target="hapticCopy"
|
|
242
249
|
>
|
|
243
250
|
{{ tooltipContent }}
|
|
244
251
|
</b-tooltip>
|
|
@@ -92,11 +92,9 @@ export default defineComponent({
|
|
|
92
92
|
|
|
93
93
|
<template>
|
|
94
94
|
<b-input-group :size="size" class="secret-input">
|
|
95
|
-
<b-
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
</b-button>
|
|
99
|
-
</b-input-group-prepend>
|
|
95
|
+
<b-button v-if="!noToggler" variant="link" class="secret-input__toggler" @click="toggle">
|
|
96
|
+
<fa fixed-width :icon="togglerIcon" />
|
|
97
|
+
</b-button>
|
|
100
98
|
<b-form-input
|
|
101
99
|
ref="secretInput"
|
|
102
100
|
class="text-monospace secret-input__input"
|
|
@@ -105,16 +103,15 @@ export default defineComponent({
|
|
|
105
103
|
:modelValue="value"
|
|
106
104
|
@click="selectInput"
|
|
107
105
|
/>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
</b-input-group-append>
|
|
106
|
+
<haptic-copy
|
|
107
|
+
v-if="!noHapticCopy"
|
|
108
|
+
class="secret-input__copy"
|
|
109
|
+
hide-label
|
|
110
|
+
:class="hapticCopyClassList"
|
|
111
|
+
:text="value"
|
|
112
|
+
@success="selectInput"
|
|
113
|
+
@error="selectInput"
|
|
114
|
+
/>
|
|
118
115
|
</b-input-group>
|
|
119
116
|
</template>
|
|
120
117
|
|
|
@@ -7,6 +7,7 @@ import identity from 'lodash/identity'
|
|
|
7
7
|
import isEqual from 'lodash/isEqual'
|
|
8
8
|
import uniqueId from 'lodash/uniqueId'
|
|
9
9
|
import { faCheckSquare, faSquare } from '@fortawesome/free-regular-svg-icons'
|
|
10
|
+
//@ts-expect-error no typings available
|
|
10
11
|
import { RecycleScroller } from 'vue-virtual-scroller'
|
|
11
12
|
|
|
12
13
|
import Fa from './Fa'
|
|
@@ -132,9 +133,6 @@ export default defineComponent({
|
|
|
132
133
|
'--scroller-height': props.scrollerHeight
|
|
133
134
|
}
|
|
134
135
|
})
|
|
135
|
-
const keyField = computed(() => {
|
|
136
|
-
return typeof items_.value[0] === 'string' ? null : 'recycle_scroller_id'
|
|
137
|
-
})
|
|
138
136
|
const items_ = computed((): Item[] => {
|
|
139
137
|
if (typeof props.items[0] === 'string') {
|
|
140
138
|
return props.items
|
|
@@ -144,6 +142,9 @@ export default defineComponent({
|
|
|
144
142
|
recycle_scroller_id: `id-${uniqueId()}`
|
|
145
143
|
}))
|
|
146
144
|
})
|
|
145
|
+
const keyField = computed(() => {
|
|
146
|
+
return typeof items_.value[0] === 'string' ? null : 'recycle_scroller_id'
|
|
147
|
+
})
|
|
147
148
|
const firstActiveItemIndex = computed(() => {
|
|
148
149
|
return activeItems.value.length
|
|
149
150
|
? items_.value.indexOf(activeItems.value[0])
|
|
@@ -167,9 +168,19 @@ export default defineComponent({
|
|
|
167
168
|
toggleKeys()
|
|
168
169
|
}
|
|
169
170
|
)
|
|
171
|
+
watch(
|
|
172
|
+
() => props.modelValue,
|
|
173
|
+
(itemOrItems) => {
|
|
174
|
+
const items = castArray(itemOrItems)
|
|
175
|
+
if (!isEqual(activeItems.value, items)) {
|
|
176
|
+
activateItemOrItems(itemOrItems)
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{ deep: true, immediate: true}
|
|
180
|
+
)
|
|
170
181
|
watch(
|
|
171
182
|
() => activeItems.value,
|
|
172
|
-
() => {
|
|
183
|
+
(itemOrItems) => {
|
|
173
184
|
/**
|
|
174
185
|
* Fired when the selected value change. It will pass a canonical value
|
|
175
186
|
* or an array of values if the property `multiple` is set to true.
|
|
@@ -179,18 +190,9 @@ export default defineComponent({
|
|
|
179
190
|
*/
|
|
180
191
|
emit(
|
|
181
192
|
'update:modelValue',
|
|
182
|
-
props.multiple ?
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
{ deep: true }
|
|
186
|
-
)
|
|
187
|
-
watch(
|
|
188
|
-
() => props.modelValue,
|
|
189
|
-
(itemOrItems) => {
|
|
190
|
-
const items = castArray(itemOrItems)
|
|
191
|
-
if (!isEqual(activeItems.value, items)) {
|
|
192
|
-
activateItemOrItems(items)
|
|
193
|
-
}
|
|
193
|
+
props.multiple ? itemOrItems : itemOrItems[0]
|
|
194
|
+
)
|
|
195
|
+
|
|
194
196
|
},
|
|
195
197
|
{ deep: true }
|
|
196
198
|
)
|
|
@@ -251,7 +253,7 @@ export default defineComponent({
|
|
|
251
253
|
if (itemActivated(item)) {
|
|
252
254
|
activeItems.value = filter(activeItems.value, (i) => !props.eq(item, i))
|
|
253
255
|
} else {
|
|
254
|
-
activeItems.value.
|
|
256
|
+
activeItems.value = [...activeItems.value, item]
|
|
255
257
|
}
|
|
256
258
|
}
|
|
257
259
|
function selectRangeToItem(item: Item) {
|
|
@@ -329,6 +331,9 @@ export default defineComponent({
|
|
|
329
331
|
function itemId(item: Item) {
|
|
330
332
|
return `dropdown-item-${item.recycle_scroller_id ?? item.toLowerCase()}`
|
|
331
333
|
}
|
|
334
|
+
function serialize(item: Item) {
|
|
335
|
+
return props.serializer?.(item)
|
|
336
|
+
}
|
|
332
337
|
|
|
333
338
|
return {
|
|
334
339
|
cssProps,
|
|
@@ -340,6 +345,7 @@ export default defineComponent({
|
|
|
340
345
|
clickToAddItem,
|
|
341
346
|
clickToSelectRangeToItem,
|
|
342
347
|
indexIcon,
|
|
348
|
+
serialize,
|
|
343
349
|
scroller,
|
|
344
350
|
activeItems,
|
|
345
351
|
itemId
|
|
@@ -384,7 +390,7 @@ export default defineComponent({
|
|
|
384
390
|
>
|
|
385
391
|
<!-- @slot Item's label content -->
|
|
386
392
|
<slot name="item-label" :item="item">
|
|
387
|
-
|
|
393
|
+
{{ serialize(item) }}
|
|
388
394
|
</slot>
|
|
389
395
|
</div>
|
|
390
396
|
</slot>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import get from 'lodash/get'
|
|
3
3
|
import reduce from 'lodash/reduce'
|
|
4
|
+
import uniqueId from 'lodash/uniqueId'
|
|
4
5
|
import { faCode } from '@fortawesome/free-solid-svg-icons/faCode'
|
|
5
6
|
import {
|
|
6
7
|
computed,
|
|
@@ -117,9 +118,9 @@ export default defineComponent({
|
|
|
117
118
|
onBeforeMount(() => {
|
|
118
119
|
library.add(faCode)
|
|
119
120
|
})
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
const { show } = useModal(
|
|
121
|
+
|
|
122
|
+
const embedFormId = uniqueId('embed-form-')
|
|
123
|
+
const { show } = useModal(embedFormId)
|
|
123
124
|
const style = computed((): CSSProperties => {
|
|
124
125
|
return {
|
|
125
126
|
'flex-direction': props.direction
|
|
@@ -183,7 +184,7 @@ export default defineComponent({
|
|
|
183
184
|
return {
|
|
184
185
|
style,
|
|
185
186
|
show,
|
|
186
|
-
|
|
187
|
+
embedFormId,
|
|
187
188
|
valuesFor
|
|
188
189
|
}
|
|
189
190
|
}
|
|
@@ -212,22 +213,11 @@ export default defineComponent({
|
|
|
212
213
|
network="email"
|
|
213
214
|
v-bind="valuesFor('email')"
|
|
214
215
|
/>
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
class="
|
|
218
|
-
>
|
|
219
|
-
|
|
220
|
-
<fa icon="code" />
|
|
221
|
-
<span class="sr-only">Embed</span>
|
|
222
|
-
</a>
|
|
223
|
-
</div>
|
|
224
|
-
<b-modal
|
|
225
|
-
id="embedForm"
|
|
226
|
-
ref="embedForm"
|
|
227
|
-
class="text-dark"
|
|
228
|
-
hide-footer
|
|
229
|
-
title="Embed on your website"
|
|
230
|
-
>
|
|
216
|
+
<a class="sharing-options__link sharing-options__link--embed" @click="show" v-show="!noEmbed">
|
|
217
|
+
<fa icon="code" />
|
|
218
|
+
<span class="sr-only">Embed</span>
|
|
219
|
+
</a>
|
|
220
|
+
<b-modal :id="embedFormId" class="text-dark" hide-footer title="Embed on your website">
|
|
231
221
|
<embed-form
|
|
232
222
|
:min-height="iframeMinHeight"
|
|
233
223
|
:min-width="iframeMinWidth"
|
|
@@ -4,7 +4,10 @@ import identity from 'lodash/identity'
|
|
|
4
4
|
import sortBy from 'lodash/sortBy'
|
|
5
5
|
import { defineComponent, computed, ref, watch } from 'vue'
|
|
6
6
|
import { chartProps, getChartProps, useChart } from '@/composables/chart'
|
|
7
|
+
import { ComponentPublicInstance } from 'vue'
|
|
7
8
|
|
|
9
|
+
type Datum = {value:number|number[],highlight?:boolean,label?:string}
|
|
10
|
+
type Bar = {width:number,height:number, x:number,y:number} & Datum;
|
|
8
11
|
export default defineComponent({
|
|
9
12
|
name: 'BarChart',
|
|
10
13
|
props: {
|
|
@@ -81,13 +84,12 @@ export default defineComponent({
|
|
|
81
84
|
},
|
|
82
85
|
...chartProps()
|
|
83
86
|
},
|
|
84
|
-
emits: ['loaded', 'resized'],
|
|
85
87
|
setup(props, { emit }) {
|
|
86
|
-
const el = ref(null)
|
|
88
|
+
const el = ref<ComponentPublicInstance<HTMLElement> |null>(null)
|
|
87
89
|
const width = ref(0)
|
|
88
90
|
const isLoaded = ref(false)
|
|
89
91
|
const { loadedData, elementsMaxBBox, dataHasHighlights, d3Formatter } =
|
|
90
|
-
useChart(el, getChartProps(props), { emit }, isLoaded, onResize
|
|
92
|
+
useChart(el, getChartProps(props), { emit }, isLoaded, onResize)
|
|
91
93
|
// onMounted(() => {
|
|
92
94
|
// window.addEventListener('resize', onResize)
|
|
93
95
|
// onResize()
|
|
@@ -96,7 +98,7 @@ export default defineComponent({
|
|
|
96
98
|
// window.removeEventListener('resize', onResize)
|
|
97
99
|
// })
|
|
98
100
|
|
|
99
|
-
const sortedData = computed(() => {
|
|
101
|
+
const sortedData = computed(():[] => {
|
|
100
102
|
if (!loadedData.value) {
|
|
101
103
|
return []
|
|
102
104
|
}
|
|
@@ -137,13 +139,15 @@ export default defineComponent({
|
|
|
137
139
|
const scale = computed(() => {
|
|
138
140
|
const x = d3
|
|
139
141
|
.scaleLinear()
|
|
140
|
-
|
|
142
|
+
//@ts-expect-error D3 api
|
|
143
|
+
.domain([0, d3.max(sortedData.value, (d:Datum) => d.value)])
|
|
141
144
|
.range([0, padded.value.width - valueWidth.value])
|
|
142
145
|
return { x }
|
|
143
146
|
})
|
|
144
|
-
const bars = computed(() => {
|
|
145
|
-
return sortedData.value.map((d, i) => {
|
|
147
|
+
const bars = computed(():Bar[] => {
|
|
148
|
+
return sortedData.value.map((d:Datum, i) => {
|
|
146
149
|
return {
|
|
150
|
+
//@ts-expect-error D3 api
|
|
147
151
|
width: Math.abs(scale.value.x(d.value)),
|
|
148
152
|
height: Math.abs(props.barHeight),
|
|
149
153
|
value: d.value,
|
|
@@ -154,7 +158,7 @@ export default defineComponent({
|
|
|
154
158
|
})
|
|
155
159
|
})
|
|
156
160
|
const labels = computed(() => {
|
|
157
|
-
return sortedData.value.map((d, i) => {
|
|
161
|
+
return sortedData.value.map((d:Datum, i) => {
|
|
158
162
|
return {
|
|
159
163
|
label: d.label,
|
|
160
164
|
x: labelWidth.value,
|
|
@@ -166,15 +170,16 @@ export default defineComponent({
|
|
|
166
170
|
return (props.barHeight + props.barGap) * sortedData.value.length
|
|
167
171
|
})
|
|
168
172
|
|
|
169
|
-
function formatXDatum(d) {
|
|
173
|
+
function formatXDatum(d:number|number[]) {
|
|
170
174
|
return d3Formatter(d, props.xAxisTickFormat)
|
|
171
175
|
}
|
|
172
176
|
function onResize() {
|
|
173
177
|
if (el.value) {
|
|
174
|
-
width.value = el.value
|
|
178
|
+
width.value = el.value?.offsetWidth
|
|
175
179
|
}
|
|
176
180
|
}
|
|
177
181
|
function initialize() {
|
|
182
|
+
// @ts-expect-error D3 api
|
|
178
183
|
d3.axisBottom().scale(scale.value.x)
|
|
179
184
|
}
|
|
180
185
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icij/murmur-next",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Murmur is ICIJ's Design System for Bootstrap 5 and Vue.js",
|
|
6
6
|
"author": "promera@icij.org",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
49
49
|
"@fortawesome/vue-fontawesome": "^3.0.8",
|
|
50
50
|
"@storybook/preset-scss": "^1.0.3",
|
|
51
|
-
"@storybook/test": "^8.1.
|
|
51
|
+
"@storybook/test": "^8.1.10",
|
|
52
52
|
"@types/topojson": "^3.2.6",
|
|
53
53
|
"@types/vue-i18n": "^7.0.0",
|
|
54
54
|
"@vue/compat": "^3.4.27",
|
|
55
55
|
"bootstrap": "^5.3.3",
|
|
56
|
-
"bootstrap-vue-next": "^0.
|
|
56
|
+
"bootstrap-vue-next": "^0.22.1",
|
|
57
57
|
"canvas": "^2.11.2",
|
|
58
58
|
"clipboard": "^2.0.11",
|
|
59
59
|
"d3": "^7.9.0",
|
|
@@ -70,19 +70,18 @@
|
|
|
70
70
|
"vue-virtual-scroller": "^2.0.0-beta.8"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@chromatic-com/storybook": "^1",
|
|
74
73
|
"@eslint/js": "^9.3.0",
|
|
75
74
|
"@icij/eslint-config": "^2.0.0",
|
|
76
75
|
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
|
77
76
|
"@rushstack/eslint-patch": "^1.8.0",
|
|
78
|
-
"@storybook/addon-essentials": "^8.1.
|
|
79
|
-
"@storybook/addon-interactions": "^8.1.
|
|
80
|
-
"@storybook/addon-links": "^8.1.
|
|
81
|
-
"@storybook/addon-mdx-gfm": "^8.1.
|
|
82
|
-
"@storybook/addon-themes": "^8.1.
|
|
83
|
-
"@storybook/blocks": "^8.1.
|
|
84
|
-
"@storybook/vue3": "^8.1.
|
|
85
|
-
"@storybook/vue3-vite": "^8.1.
|
|
77
|
+
"@storybook/addon-essentials": "^8.1.10",
|
|
78
|
+
"@storybook/addon-interactions": "^8.1.10",
|
|
79
|
+
"@storybook/addon-links": "^8.1.10",
|
|
80
|
+
"@storybook/addon-mdx-gfm": "^8.1.10",
|
|
81
|
+
"@storybook/addon-themes": "^8.1.10",
|
|
82
|
+
"@storybook/blocks": "^8.1.10",
|
|
83
|
+
"@storybook/vue3": "^8.1.10",
|
|
84
|
+
"@storybook/vue3-vite": "^8.1.10",
|
|
86
85
|
"@types/d3": "^7.4.3",
|
|
87
86
|
"@types/d3-geo": "^3.1.0",
|
|
88
87
|
"@types/eslint__js": "^8.42.3",
|
|
@@ -100,14 +99,14 @@
|
|
|
100
99
|
"msw-storybook-addon": "^2.0.2",
|
|
101
100
|
"prettier": "^3.2.5",
|
|
102
101
|
"sass": "^1.77.2",
|
|
103
|
-
"storybook": "^8.1.
|
|
102
|
+
"storybook": "^8.1.10",
|
|
104
103
|
"typescript": "^5.4.5",
|
|
105
104
|
"typescript-eslint": "^7.11.0",
|
|
106
105
|
"unplugin-vue-components": "^0.27.0",
|
|
107
106
|
"vite": "^5.2.12",
|
|
108
107
|
"vite-plugin-dts": "^3.9.1",
|
|
109
108
|
"vitest": "^1.6.0",
|
|
110
|
-
"vue-
|
|
109
|
+
"vue-component-meta": "^2.0.21",
|
|
111
110
|
"vue-headroom": "github:caro3801/vue-headroom"
|
|
112
111
|
},
|
|
113
112
|
"peerDependencies": {
|