@icij/murmur-next 4.0.10 → 4.0.13
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/AdvancedLinkForm.vue.d.ts +4 -5
- 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/DonateForm.vue.d.ts +4 -5
- package/dist/lib/components/EmbedForm.vue.d.ts +4 -5
- package/dist/lib/components/FollowUsPopover.vue.d.ts +4 -5
- package/dist/lib/components/GenericFooter.vue.d.ts +1 -2
- package/dist/lib/components/GenericHeader.vue.d.ts +231 -232
- package/dist/lib/components/HapticCopy.vue.d.ts +8 -10
- package/dist/lib/components/ImddbHeader.vue.d.ts +230 -231
- package/dist/lib/components/OrdinalLegend.vue.d.ts +1 -2
- package/dist/lib/components/RangePicker.vue.d.ts +2 -3
- package/dist/lib/components/ResponsiveIframe.vue.d.ts +2 -4
- package/dist/lib/components/ScaleLegend.vue.d.ts +1 -1
- package/dist/lib/components/SelectableDropdown.vue.d.ts +3 -3
- package/dist/lib/components/SharingOptions.vue.d.ts +1 -2
- package/dist/lib/components/SharingOptionsLink.vue.d.ts +1 -2
- package/dist/lib/components/SignUpForm.vue.d.ts +5 -6
- 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 +8 -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 +35 -21
- package/dist/lib/datavisualisations/ColumnChart.vue.d.ts +1 -2
- package/dist/lib/datavisualisations/LineChart.vue.d.ts +1 -1
- package/dist/lib/datavisualisations/StackedBarChart.vue.d.ts +1 -1
- package/dist/lib/datavisualisations/StackedColumnChart.vue.d.ts +1 -1
- package/dist/lib/i18n.d.ts +1 -0
- package/dist/lib/main.d.ts +3 -4
- package/dist/lib/maps/ChoroplethMap.vue.d.ts +2 -2
- package/dist/lib/maps/SymbolMap.vue.d.ts +1 -2
- package/dist/lib/murmur.css +1 -1
- package/dist/lib/murmur.js +16466 -13059
- package/dist/lib/murmur.js.map +1 -1
- package/dist/lib/murmur.umd.cjs +60 -34
- 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/components/HapticCopy.vue +1 -1
- package/lib/components/SelectableDropdown.vue +24 -18
- package/lib/datavisualisations/BarChart.vue +15 -10
- package/package.json +1 -1
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[];
|
|
@@ -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>
|
|
@@ -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
|
|