@icij/murmur-next 4.0.5 → 4.0.7
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 +79 -0
- package/dist/lib/components/AccordionWrapper.vue.d.ts +33 -0
- package/dist/lib/components/ActiveTextTruncate.vue.d.ts +101 -0
- package/dist/lib/components/AdvancedLinkForm.vue.d.ts +168 -0
- package/dist/lib/components/Brand.vue.d.ts +55 -0
- package/dist/lib/components/BrandExpansion.vue.d.ts +105 -0
- package/dist/lib/components/ConfirmButton.vue.d.ts +158 -0
- package/dist/lib/components/ContentPlaceholder.vue.d.ts +44 -0
- package/dist/lib/components/CustomPagination.vue.d.ts +130 -0
- package/dist/lib/components/DigitsInput.vue.d.ts +66 -0
- package/dist/lib/components/DonateForm.vue.d.ts +46 -0
- package/dist/lib/components/EmbedForm.vue.d.ts +121 -0
- package/dist/lib/components/EmbeddableFooter.vue.d.ts +103 -0
- package/dist/lib/components/FollowUsPopover.vue.d.ts +16 -0
- package/dist/lib/components/GenericFooter.vue.d.ts +47 -0
- package/dist/lib/components/GenericHeader.vue.d.ts +928 -0
- package/dist/lib/components/HapticCopy.vue.d.ts +156 -0
- package/dist/lib/components/ImddbHeader.vue.d.ts +960 -0
- package/dist/lib/components/OrdinalLegend.vue.d.ts +87 -0
- package/dist/lib/components/RangePicker.vue.d.ts +193 -0
- package/dist/lib/components/ResponsiveIframe.vue.d.ts +46 -0
- package/dist/lib/components/ScaleLegend.vue.d.ts +101 -0
- package/dist/lib/components/SecretInput.vue.d.ts +99 -0
- package/dist/lib/components/SelectableDropdown.vue.d.ts +210 -0
- package/dist/lib/components/SharingOptions.vue.d.ts +153 -0
- package/dist/lib/components/SharingOptionsLink.vue.d.ts +200 -0
- package/dist/lib/components/SignUpForm.vue.d.ts +141 -0
- package/dist/lib/components/SlideUpDown.vue.d.ts +74 -0
- package/dist/lib/components/TexturedDeck.vue.d.ts +89 -0
- package/dist/lib/components/TinyPagination.vue.d.ts +188 -0
- package/dist/lib/composables/chart.d.ts +48 -0
- package/dist/lib/composables/resizeObserver.d.ts +22 -0
- package/dist/lib/composables/sendEmail.d.ts +6 -0
- package/dist/lib/config.d.ts +19 -0
- package/dist/lib/config.default.d.ts +34 -0
- package/dist/lib/datavisualisations/BarChart.vue.d.ts +232 -0
- package/dist/lib/datavisualisations/ColumnChart.vue.d.ts +408 -0
- package/dist/lib/datavisualisations/LineChart.vue.d.ts +208 -0
- package/dist/lib/datavisualisations/StackedBarChart.vue.d.ts +338 -0
- package/dist/lib/datavisualisations/StackedColumnChart.vue.d.ts +412 -0
- package/dist/lib/enums.d.ts +32 -0
- package/dist/lib/i18n.d.ts +5 -0
- package/dist/lib/keys.d.ts +2 -0
- package/dist/lib/main.d.ts +61 -0
- package/dist/lib/maps/ChoroplethMap.vue.d.ts +466 -0
- package/dist/lib/maps/ChoroplethMapAnnotation.vue.d.ts +188 -0
- package/dist/lib/maps/SymbolMap.vue.d.ts +277 -0
- package/dist/lib/murmur.css +1 -0
- package/dist/lib/murmur.js +44934 -0
- package/dist/lib/murmur.js.map +1 -0
- package/dist/lib/murmur.umd.cjs +837 -0
- package/dist/lib/murmur.umd.cjs.map +1 -0
- package/dist/lib/types.d.ts +44 -0
- package/dist/lib/utils/animation.d.ts +8 -0
- package/dist/lib/utils/assets.d.ts +2 -0
- package/dist/lib/utils/clipboard.d.ts +2 -0
- package/dist/lib/utils/iframe-resizer.d.ts +11 -0
- package/dist/lib/utils/placeholder.d.ts +12 -0
- package/dist/lib/utils/placeholderTypes.d.ts +18 -0
- package/dist/lib/utils/strings.d.ts +1 -0
- package/lib/components/RangePicker.vue +3 -4
- package/lib/i18n.ts +5 -4
- package/lib/main.ts +22 -6
- package/package.json +6 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="@/shims-vue" />
|
|
2
|
+
/// <reference types="node_modules/vue-i18n/dist/vue-i18n" />
|
|
3
|
+
import type { StyleValue } from '../node_modules/vue';
|
|
4
|
+
import { AccordionKey, ParentKey } from './keys';
|
|
5
|
+
import { ComputedRef } from '../node_modules/vue';
|
|
6
|
+
import type { GeoProjection } from 'd3-geo';
|
|
7
|
+
import { Ref } from '../node_modules/vue';
|
|
8
|
+
export type Step = symbol | string;
|
|
9
|
+
export type Accordion = {
|
|
10
|
+
emitAccordionNextStepEvent: () => void;
|
|
11
|
+
emitAccordionPreviousStepEvent: () => void;
|
|
12
|
+
isActiveStep: (step: Step) => boolean;
|
|
13
|
+
isPreviousStep: (step: Step) => boolean;
|
|
14
|
+
isFirstStep: (step: Step) => boolean;
|
|
15
|
+
isLastStep: (step: Step) => boolean;
|
|
16
|
+
step: Step;
|
|
17
|
+
steps: Step[];
|
|
18
|
+
};
|
|
19
|
+
export type AccordionProvide = {
|
|
20
|
+
[AccordionKey]: Accordion;
|
|
21
|
+
};
|
|
22
|
+
export type BrandStyle = StyleValue & {
|
|
23
|
+
'--monochrome-color': string;
|
|
24
|
+
color: string;
|
|
25
|
+
background: string;
|
|
26
|
+
width: string;
|
|
27
|
+
};
|
|
28
|
+
export type BrandExpansionStyle = Pick<BrandStyle, '--monochrome-color' | 'background'>;
|
|
29
|
+
export type Variant = 'primary' | 'secondary' | 'danger' | 'info' | 'warning' | 'success' | 'dark' | 'light';
|
|
30
|
+
export type MapTransform = {
|
|
31
|
+
k: number;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
rotateX: number;
|
|
35
|
+
rotateY: number;
|
|
36
|
+
};
|
|
37
|
+
export type ParentMap = {
|
|
38
|
+
mapRect: Ref<DOMRect>;
|
|
39
|
+
mapTransform: Ref<MapTransform>;
|
|
40
|
+
rotatingMapProjection: ComputedRef<GeoProjection | (() => number[])>;
|
|
41
|
+
};
|
|
42
|
+
export type ParentMapProvide = {
|
|
43
|
+
[ParentKey]: ParentMap;
|
|
44
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="@/shims-pym" />
|
|
2
|
+
import { Child as PymChild } from 'pym.js';
|
|
3
|
+
export default class IframeResizer {
|
|
4
|
+
initializer: Promise<PymChild>;
|
|
5
|
+
constructor();
|
|
6
|
+
sendHeight(): Promise<void>;
|
|
7
|
+
static create(): IframeResizer;
|
|
8
|
+
static template(url: string, id?: string): string;
|
|
9
|
+
static deletePymParams(href?: string): string;
|
|
10
|
+
static isEmbedded(href?: string): boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxStyle, ContentPlaceholderStyledRows, ContentPlaceholderRows } from './placeholderTypes';
|
|
2
|
+
export declare function isFlexBasis(value: string | number): boolean;
|
|
3
|
+
export declare function isWidth(value: string | number): boolean;
|
|
4
|
+
export declare function getBoxStyle(left: number, width: number, isLast: boolean, subClass?: string): BoxStyle[];
|
|
5
|
+
export declare function formatRows(rows: ContentPlaceholderRows, subClass?: string): ContentPlaceholderStyledRows;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
isFlexBasis: typeof isFlexBasis;
|
|
8
|
+
isWidth: typeof isWidth;
|
|
9
|
+
getBoxStyle: typeof getBoxStyle;
|
|
10
|
+
formatRows: typeof formatRows;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="@/shims-vue" />
|
|
2
|
+
/// <reference types="vue-i18n" />
|
|
3
|
+
import type { StyleValue } from '../../node_modules/vue';
|
|
4
|
+
export interface BoxStyle {
|
|
5
|
+
style: StyleValue;
|
|
6
|
+
subClass?: string;
|
|
7
|
+
}
|
|
8
|
+
export type ContentPlaceholderRowBoxes = Array<Array<number | string>>;
|
|
9
|
+
export interface ContentPlaceholderRow {
|
|
10
|
+
height: number | string;
|
|
11
|
+
boxes: ContentPlaceholderRowBoxes;
|
|
12
|
+
}
|
|
13
|
+
export interface ContentPlaceholderStyledRow {
|
|
14
|
+
height: number | string;
|
|
15
|
+
boxes: Array<BoxStyle>;
|
|
16
|
+
}
|
|
17
|
+
export type ContentPlaceholderStyledRows = Array<ContentPlaceholderStyledRow>;
|
|
18
|
+
export type ContentPlaceholderRows = Array<ContentPlaceholderRow>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isUrl(value: string): boolean;
|
|
@@ -11,12 +11,11 @@ import {
|
|
|
11
11
|
toRef
|
|
12
12
|
} from 'vue'
|
|
13
13
|
import { faGripLinesVertical } from '@fortawesome/free-solid-svg-icons/faGripLinesVertical'
|
|
14
|
-
import { clamp,
|
|
14
|
+
import { clamp, round } from 'lodash'
|
|
15
15
|
|
|
16
16
|
import Fa, { library } from './Fa'
|
|
17
17
|
|
|
18
18
|
import type { Variant } from '@/types'
|
|
19
|
-
import isEqual from "lodash/isEqual";
|
|
20
19
|
type DragDropValue = {detail:number}
|
|
21
20
|
/**
|
|
22
21
|
* A component to wrap an HTML element with a range picker overlay.
|
|
@@ -272,8 +271,8 @@ export default defineComponent({
|
|
|
272
271
|
}
|
|
273
272
|
|
|
274
273
|
watch(()=>props.range, (newRange) => {
|
|
275
|
-
start.value = newRange[0] ?? 0
|
|
276
|
-
end.value = newRange[1] ?? 0
|
|
274
|
+
start.value = newRange[0] ?? 0
|
|
275
|
+
end.value = newRange[1] ?? 0
|
|
277
276
|
})
|
|
278
277
|
|
|
279
278
|
return {
|
package/lib/i18n.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { createI18n, I18n } from 'vue-i18n'
|
|
1
|
+
import { createI18n, I18n, I18nOptions } from 'vue-i18n'
|
|
2
2
|
|
|
3
3
|
import fr from '@/locales/fr.json'
|
|
4
4
|
import en from '@/locales/en.json'
|
|
5
5
|
|
|
6
6
|
export const locale: string = 'en'
|
|
7
7
|
export const fallbackLocale: string = 'en'
|
|
8
|
-
|
|
9
|
-
export const i18n: I18n = createI18n({
|
|
8
|
+
export const options: I18nOptions = {
|
|
10
9
|
warnHtmlMessage: false,
|
|
10
|
+
// https://vue-i18n.intlify.dev/guide/advanced/composition.html#implicit-with-injected-properties-and-functions
|
|
11
11
|
globalInjection: true,
|
|
12
12
|
legacy: false,
|
|
13
13
|
locale,
|
|
14
14
|
fallbackLocale,
|
|
15
15
|
messages: { fr, en }
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
|
+
export const i18n: I18n = createI18n(options)
|
package/lib/main.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as components from './components'
|
|
|
4
4
|
import * as datavisualisations from './datavisualisations'
|
|
5
5
|
import * as maps from './maps'
|
|
6
6
|
import config from './config'
|
|
7
|
-
import { App,Component,DefineComponent } from 'vue'
|
|
7
|
+
import { App,Component, DefineComponent } from 'vue'
|
|
8
8
|
|
|
9
9
|
export { default as AccordionWrapper } from './components/AccordionWrapper.vue'
|
|
10
10
|
export { default as AccordionStep } from './components/AccordionStep.vue'
|
|
@@ -48,6 +48,11 @@ export { default as SymbolMap } from './maps/SymbolMap.vue'
|
|
|
48
48
|
|
|
49
49
|
type ComponentMap = {[name:string]:Component|DefineComponent}
|
|
50
50
|
|
|
51
|
+
type PluginOptions = {
|
|
52
|
+
useI18n?: boolean,
|
|
53
|
+
useBootstrap?: boolean,
|
|
54
|
+
useConfig?: boolean
|
|
55
|
+
}
|
|
51
56
|
|
|
52
57
|
const Murmur = {
|
|
53
58
|
get i18n() {
|
|
@@ -79,18 +84,29 @@ const Murmur = {
|
|
|
79
84
|
// @ts-expect-error not sure why typescript sees an error here
|
|
80
85
|
return Murmur.i18n.global.locale.value
|
|
81
86
|
},
|
|
82
|
-
install(app: App<Element
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
install(app: App<Element>, { useI18n = true, useBootstrap = true, useConfig = true }: PluginOptions = {}) {
|
|
88
|
+
|
|
89
|
+
if (useBootstrap) {
|
|
90
|
+
app.use(createBootstrap())
|
|
91
|
+
}
|
|
85
92
|
|
|
86
|
-
|
|
93
|
+
if (useI18n) {
|
|
94
|
+
app.use(Murmur.i18n)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (useConfig) {
|
|
98
|
+
app.config.globalProperties.$config = Murmur.config
|
|
99
|
+
}
|
|
100
|
+
|
|
87
101
|
Object.keys(this.components).forEach((key) =>
|
|
88
102
|
app.component(key, this.components[key])
|
|
89
103
|
)
|
|
90
104
|
Object.keys(this.datavisualisations).forEach((key) =>
|
|
91
105
|
app.component(key, this.datavisualisations[key])
|
|
92
106
|
)
|
|
93
|
-
Object.keys(this.maps).forEach((key) =>
|
|
107
|
+
Object.keys(this.maps).forEach((key) =>
|
|
108
|
+
app.component(key, this.maps[key])
|
|
109
|
+
)
|
|
94
110
|
}
|
|
95
111
|
}
|
|
96
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icij/murmur-next",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.7",
|
|
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",
|
|
@@ -14,14 +14,16 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "vite",
|
|
17
|
-
"build": "vite build",
|
|
17
|
+
"build:lib": "vite build",
|
|
18
18
|
"preview": "vite preview",
|
|
19
19
|
"lint": "eslint . --fix",
|
|
20
20
|
"format": "prettier --write lib/ stories/ .storybook/ tests/",
|
|
21
21
|
"storybook": "storybook dev -p 6006",
|
|
22
|
-
"build
|
|
22
|
+
"build:storybook": "storybook build",
|
|
23
23
|
"test": "vitest",
|
|
24
|
-
"test:unit": "vitest run"
|
|
24
|
+
"test:unit": "vitest run",
|
|
25
|
+
"prepublish": "yarn build:lib",
|
|
26
|
+
"predeploy": "yarn build:storybook"
|
|
25
27
|
},
|
|
26
28
|
"main": "./dist/lib/murmur.umd.cjs",
|
|
27
29
|
"module": "./dist/lib/murmur.js",
|