@onsvisual/svelte-components 0.0.3 → 0.0.5
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/README.md +5 -3
- package/dist/@types/datavis/Table/Table.svelte.d.ts +33 -0
- package/dist/@types/index.d.ts +27 -12
- package/dist/@types/js/docsPage.d.ts +25 -0
- package/dist/@types/js/withParams.d.ts +15 -0
- package/dist/@types/layout/Filler/Filler.svelte.d.ts +41 -0
- package/dist/@types/layout/Grid/Grid.svelte.d.ts +45 -0
- package/dist/@types/layout/Hero/Hero.svelte.d.ts +43 -0
- package/dist/@types/layout/List/List.svelte.d.ts +27 -0
- package/dist/@types/layout/NavSections/NavSection.svelte.d.ts +31 -0
- package/dist/@types/layout/NavSections/NavSections.svelte.d.ts +43 -0
- package/dist/@types/layout/NavSections/SectionBacklink.svelte.d.ts +23 -0
- package/dist/@types/layout/Scroller/Scroller.svelte.d.ts +51 -0
- package/dist/@types/layout/Scroller/ScrollerSection.svelte.d.ts +33 -0
- package/dist/@types/{components/layout → layout}/TitleBlock/Meta.svelte.d.ts +2 -2
- package/dist/@types/{components/layout → layout}/TitleBlock/TitleBlock.svelte.d.ts +24 -4
- package/dist/datavis/Table/Table.svelte +129 -0
- package/dist/{components/layout → decorators}/Divider/Divider.svelte +1 -1
- package/dist/index.js +31 -12
- package/dist/js/docsPage.js +13 -0
- package/dist/js/utils.js +3 -0
- package/dist/js/withParams.js +46 -0
- package/dist/{components/layout → layout}/Accordion/AccordionItem.svelte +1 -1
- package/dist/layout/Filler/Filler.svelte +66 -0
- package/dist/{components/layout → layout}/Footer/Footer.svelte +1 -1
- package/dist/layout/Grid/Grid.svelte +111 -0
- package/dist/{components/layout → layout}/Header/Header.svelte +1 -1
- package/dist/layout/Hero/Hero.svelte +74 -0
- package/dist/layout/List/List.svelte +32 -0
- package/dist/layout/NavSections/NavSection.svelte +51 -0
- package/dist/layout/NavSections/NavSections.svelte +92 -0
- package/dist/layout/NavSections/SectionBacklink.svelte +31 -0
- package/dist/layout/Scroller/Scroller.svelte +336 -0
- package/dist/layout/Scroller/ScrollerSection.svelte +61 -0
- package/dist/{components/layout → layout}/Section/Section.svelte +6 -6
- package/dist/layout/TitleBlock/Meta.svelte +26 -0
- package/dist/layout/TitleBlock/TitleBlock.svelte +97 -0
- package/dist/{components/wrappers → wrappers}/Embed/Embed.svelte +4 -2
- package/dist/{components/wrappers → wrappers}/Theme/Theme.svelte +1 -1
- package/package.json +37 -25
- package/dist/components/layout/TitleBlock/Meta.svelte +0 -0
- package/dist/components/layout/TitleBlock/TitleBlock.svelte +0 -0
- package/dist/@types/{components/decorators → decorators}/Blockquote/Blockquote.svelte.d.ts +0 -0
- package/dist/@types/{components/layout → decorators}/Divider/Divider.svelte.d.ts +0 -0
- package/dist/@types/{components/decorators → decorators}/Em/Em.svelte.d.ts +0 -0
- package/dist/@types/{components/inputs → inputs}/Button/Button.svelte.d.ts +0 -0
- package/dist/@types/{components/inputs → inputs}/Button/Icon.svelte.d.ts +0 -0
- package/dist/@types/{components/inputs → inputs}/Dropdown/Dropdown.svelte.d.ts +6 -6
- package/dist/@types/{components/inputs → inputs}/Input/Input.svelte.d.ts +6 -6
- package/dist/@types/{components/inputs → inputs}/Select/Select.svelte.d.ts +8 -8
- package/dist/@types/{components/inputs → inputs}/Textarea/Textarea.svelte.d.ts +4 -4
- package/dist/@types/{components/layout → layout}/Accordion/Accordion.svelte.d.ts +0 -0
- package/dist/@types/{components/layout → layout}/Accordion/AccordionItem.svelte.d.ts +2 -2
- package/dist/@types/{components/layout → layout}/Footer/Footer.svelte.d.ts +0 -0
- package/dist/@types/{components/layout → layout}/Footer/ONSLogo.svelte.d.ts +0 -0
- package/dist/@types/{components/layout → layout}/Header/Header.svelte.d.ts +0 -0
- package/dist/@types/{components/layout → layout}/Header/ONSLogo.svelte.d.ts +0 -0
- package/dist/@types/{components/layout → layout}/Section/Section.svelte.d.ts +2 -2
- /package/dist/@types/{components/layout → layout}/Twisty/Twisty.svelte.d.ts +0 -0
- /package/dist/@types/{components/wrappers → wrappers}/Container/Container.svelte.d.ts +0 -0
- /package/dist/@types/{components/wrappers → wrappers}/Embed/Embed.svelte.d.ts +0 -0
- /package/dist/@types/{components/wrappers → wrappers}/Main/Main.svelte.d.ts +0 -0
- /package/dist/@types/{components/wrappers → wrappers}/Theme/Theme.svelte.d.ts +0 -0
- /package/dist/@types/{components/wrappers → wrappers}/Theme/themes.d.ts +0 -0
- /package/dist/{components/decorators → decorators}/Blockquote/Blockquote.svelte +0 -0
- /package/dist/{components/decorators → decorators}/Em/Em.svelte +0 -0
- /package/dist/{components/inputs → inputs}/Button/Button.svelte +0 -0
- /package/dist/{components/inputs → inputs}/Button/Icon.svelte +0 -0
- /package/dist/{components/inputs → inputs}/Dropdown/Dropdown.svelte +0 -0
- /package/dist/{components/inputs → inputs}/Input/Input.svelte +0 -0
- /package/dist/{components/inputs → inputs}/Select/Select.svelte +0 -0
- /package/dist/{components/inputs → inputs}/Textarea/Textarea.svelte +0 -0
- /package/dist/{components/layout → layout}/Accordion/Accordion.svelte +0 -0
- /package/dist/{components/layout → layout}/Footer/ONSLogo.svelte +0 -0
- /package/dist/{components/layout → layout}/Header/ONSLogo.svelte +0 -0
- /package/dist/{components/layout → layout}/Twisty/Twisty.svelte +0 -0
- /package/dist/{components/wrappers → wrappers}/Container/Container.svelte +0 -0
- /package/dist/{components/wrappers → wrappers}/Main/Main.svelte +0 -0
- /package/dist/{components/wrappers → wrappers}/Theme/themes.js +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @onsvisual/svelte-components
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@onsvisual/svelte-components)
|
|
4
|
+
|
|
5
|
+
A library of ONS Svelte components for projects large and small. Its codebase and docs borrow **heavily** from Reuters' fantastic [graphics-components](https://github.com/reuters-graphics/graphics-components) library.
|
|
2
6
|
|
|
3
|
-
[](https://badge.fury.io/js/@reuters-graphics%2Fgraphics-components)
|
|
4
7
|
|
|
5
|
-
This is a fork of the Reuters [graphics-components](https://github.com/reuters-graphics/graphics-components) repo, for experimentation.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TableProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TableEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TableSlots */
|
|
4
|
+
export default class Table extends SvelteComponentTyped<{
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
responsive?: boolean;
|
|
8
|
+
rowHover?: boolean;
|
|
9
|
+
data?: any[];
|
|
10
|
+
columns?: any[];
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}> {
|
|
14
|
+
}
|
|
15
|
+
export type TableProps = typeof __propDef.props;
|
|
16
|
+
export type TableEvents = typeof __propDef.events;
|
|
17
|
+
export type TableSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
title?: string;
|
|
23
|
+
responsive?: boolean;
|
|
24
|
+
rowHover?: boolean;
|
|
25
|
+
data?: any[];
|
|
26
|
+
columns?: any[];
|
|
27
|
+
};
|
|
28
|
+
events: {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
};
|
|
31
|
+
slots: {};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as
|
|
1
|
+
export { default as Container } from "./wrappers/Container/Container.svelte";
|
|
2
|
+
export { default as Embed } from "./wrappers/Embed/Embed.svelte";
|
|
3
|
+
export { default as Main } from "./wrappers/Main/Main.svelte";
|
|
4
|
+
export { default as Theme } from "./wrappers/Theme/Theme.svelte";
|
|
5
|
+
export { default as Accordion } from "./layout/Accordion/Accordion.svelte";
|
|
6
|
+
export { default as Filler } from "./layout/Filler/Filler.svelte";
|
|
7
|
+
export { default as Footer } from "./layout/Footer/Footer.svelte";
|
|
8
|
+
export { default as Grid } from "./layout/Grid/Grid.svelte";
|
|
9
|
+
export { default as Header } from "./layout/Header/Header.svelte";
|
|
10
|
+
export { default as Hero } from "./layout/Hero/Hero.svelte";
|
|
11
|
+
export { default as List } from "./layout/List/List.svelte";
|
|
12
|
+
export { default as NavSection } from "./layout/NavSections/NavSection.svelte";
|
|
13
|
+
export { default as NavSections } from "./layout/NavSections/NavSections.svelte";
|
|
14
|
+
export { default as Scoller } from "./layout/Scoller/Scoller.svelte";
|
|
15
|
+
export { default as ScollerSection } from "./layout/Scoller/ScollerSection.svelte";
|
|
16
|
+
export { default as Section } from "./layout/Section/Section.svelte";
|
|
17
|
+
export { default as TitleBlock } from "./layout/TitleBlock/TitleBlock.svelte";
|
|
18
|
+
export { default as Twisty } from "./layout/Twisty/Twisty.svelte";
|
|
19
|
+
export { default as Button } from "./inputs/Button/Button.svelte";
|
|
20
|
+
export { default as Dropdown } from "./inputs/Dropdown/Dropdown.svelte";
|
|
21
|
+
export { default as Input } from "./inputs/Input/Input.svelte";
|
|
22
|
+
export { default as Select } from "./inputs/Select/Select.svelte";
|
|
23
|
+
export { default as Textarea } from "./inputs/Textarea/Textarea.svelte";
|
|
24
|
+
export { default as Blockquote } from "./decorators/Blockquote/Blockquote.svelte";
|
|
25
|
+
export { default as Divider } from "./decorators/Divider/Divider.svelte";
|
|
26
|
+
export { default as Em } from "./decorators/Em/Em.svelte";
|
|
27
|
+
export { default as Table } from "./datavis/Table/Table.svelte";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export namespace parameters {
|
|
2
|
+
let viewMode: string;
|
|
3
|
+
namespace previewTabs {
|
|
4
|
+
namespace canvas {
|
|
5
|
+
let hidden: boolean;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
let toolbar: {
|
|
9
|
+
zoom: {
|
|
10
|
+
hidden: boolean;
|
|
11
|
+
};
|
|
12
|
+
eject: {
|
|
13
|
+
hidden: boolean;
|
|
14
|
+
};
|
|
15
|
+
fullscreen: {
|
|
16
|
+
hidden: boolean;
|
|
17
|
+
};
|
|
18
|
+
"storybook/background": {
|
|
19
|
+
hidden: boolean;
|
|
20
|
+
};
|
|
21
|
+
"storybook/outline": {
|
|
22
|
+
hidden: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function withSource(source: object, otherOptions?: object): {
|
|
2
|
+
parameters: {
|
|
3
|
+
docs: any;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export function withStoryDocs(storyDocs: string, otherOptions?: object): {
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export function withComponentDocs(componentDocs: string, otherOptions?: object): {
|
|
12
|
+
parameters: {
|
|
13
|
+
docs: any;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} FillerProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} FillerEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} FillerSlots */
|
|
4
|
+
export default class Filler extends SvelteComponentTyped<{
|
|
5
|
+
theme?: "light" | "dark" | "lightblue";
|
|
6
|
+
background?: string;
|
|
7
|
+
width?: "narrow" | "medium" | "wide" | "full";
|
|
8
|
+
height?: "full" | "auto" | "tall";
|
|
9
|
+
marginTop?: boolean;
|
|
10
|
+
marginBottom?: boolean;
|
|
11
|
+
themeOverrides?: any;
|
|
12
|
+
id?: string;
|
|
13
|
+
}, {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
}, {
|
|
16
|
+
default: {};
|
|
17
|
+
}> {
|
|
18
|
+
}
|
|
19
|
+
export type FillerProps = typeof __propDef.props;
|
|
20
|
+
export type FillerEvents = typeof __propDef.events;
|
|
21
|
+
export type FillerSlots = typeof __propDef.slots;
|
|
22
|
+
import { SvelteComponentTyped } from "svelte";
|
|
23
|
+
declare const __propDef: {
|
|
24
|
+
props: {
|
|
25
|
+
theme?: "light" | "dark" | "lightblue";
|
|
26
|
+
background?: string;
|
|
27
|
+
width?: "narrow" | "medium" | "wide" | "full";
|
|
28
|
+
height?: "auto" | "tall" | "full";
|
|
29
|
+
marginTop?: boolean;
|
|
30
|
+
marginBottom?: boolean;
|
|
31
|
+
themeOverrides?: object;
|
|
32
|
+
id?: string;
|
|
33
|
+
};
|
|
34
|
+
events: {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
};
|
|
37
|
+
slots: {
|
|
38
|
+
default: {};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} GridProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} GridEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} GridSlots */
|
|
4
|
+
export default class Grid extends SvelteComponentTyped<{
|
|
5
|
+
theme?: "light" | "dark" | "lightblue";
|
|
6
|
+
width?: "narrow" | "medium" | "wide" | "full";
|
|
7
|
+
height?: string | number;
|
|
8
|
+
marginTop?: boolean;
|
|
9
|
+
marginBottom?: boolean;
|
|
10
|
+
themeOverrides?: any;
|
|
11
|
+
id?: string;
|
|
12
|
+
colwidth?: "narrow" | "medium" | "wide" | "full";
|
|
13
|
+
caption?: string;
|
|
14
|
+
gap?: number;
|
|
15
|
+
}, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {
|
|
18
|
+
default: {};
|
|
19
|
+
}> {
|
|
20
|
+
}
|
|
21
|
+
export type GridProps = typeof __propDef.props;
|
|
22
|
+
export type GridEvents = typeof __propDef.events;
|
|
23
|
+
export type GridSlots = typeof __propDef.slots;
|
|
24
|
+
import { SvelteComponentTyped } from "svelte";
|
|
25
|
+
declare const __propDef: {
|
|
26
|
+
props: {
|
|
27
|
+
theme?: "light" | "dark" | "lightblue";
|
|
28
|
+
width?: "narrow" | "medium" | "wide" | "full";
|
|
29
|
+
height?: number | string;
|
|
30
|
+
marginTop?: boolean;
|
|
31
|
+
marginBottom?: boolean;
|
|
32
|
+
themeOverrides?: object;
|
|
33
|
+
id?: string;
|
|
34
|
+
colwidth?: "narrow" | "medium" | "wide" | "full";
|
|
35
|
+
caption?: string;
|
|
36
|
+
gap?: number;
|
|
37
|
+
};
|
|
38
|
+
events: {
|
|
39
|
+
[evt: string]: CustomEvent<any>;
|
|
40
|
+
};
|
|
41
|
+
slots: {
|
|
42
|
+
default: {};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} HeroProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} HeroEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} HeroSlots */
|
|
4
|
+
export default class Hero extends SvelteComponentTyped<{
|
|
5
|
+
theme?: "light" | "dark" | "lightblue";
|
|
6
|
+
background?: string;
|
|
7
|
+
width?: "narrow" | "medium" | "wide" | "full";
|
|
8
|
+
height?: "full" | "auto" | "tall";
|
|
9
|
+
themeOverrides?: any;
|
|
10
|
+
id?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
lede?: string;
|
|
13
|
+
date?: string;
|
|
14
|
+
}, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {
|
|
17
|
+
default: {};
|
|
18
|
+
}> {
|
|
19
|
+
}
|
|
20
|
+
export type HeroProps = typeof __propDef.props;
|
|
21
|
+
export type HeroEvents = typeof __propDef.events;
|
|
22
|
+
export type HeroSlots = typeof __propDef.slots;
|
|
23
|
+
import { SvelteComponentTyped } from "svelte";
|
|
24
|
+
declare const __propDef: {
|
|
25
|
+
props: {
|
|
26
|
+
theme?: "light" | "dark" | "lightblue";
|
|
27
|
+
background?: string;
|
|
28
|
+
width?: "narrow" | "medium" | "wide" | "full";
|
|
29
|
+
height?: "auto" | "tall" | "full";
|
|
30
|
+
themeOverrides?: object;
|
|
31
|
+
id?: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
lede?: string;
|
|
34
|
+
date?: string;
|
|
35
|
+
};
|
|
36
|
+
events: {
|
|
37
|
+
[evt: string]: CustomEvent<any>;
|
|
38
|
+
};
|
|
39
|
+
slots: {
|
|
40
|
+
default: {};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ListProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ListEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ListSlots */
|
|
4
|
+
export default class List extends SvelteComponentTyped<{
|
|
5
|
+
mode?: "number" | "bullet" | "dash" | "bare";
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type ListProps = typeof __propDef.props;
|
|
13
|
+
export type ListEvents = typeof __propDef.events;
|
|
14
|
+
export type ListSlots = typeof __propDef.slots;
|
|
15
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
mode?: "bullet" | "dash" | "number" | "bare";
|
|
19
|
+
};
|
|
20
|
+
events: {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} NavSectionProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} NavSectionEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} NavSectionSlots */
|
|
4
|
+
export default class NavSection extends SvelteComponentTyped<{
|
|
5
|
+
id?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
hideTitle?: boolean;
|
|
8
|
+
}, {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {
|
|
11
|
+
default: {};
|
|
12
|
+
}> {
|
|
13
|
+
}
|
|
14
|
+
export type NavSectionProps = typeof __propDef.props;
|
|
15
|
+
export type NavSectionEvents = typeof __propDef.events;
|
|
16
|
+
export type NavSectionSlots = typeof __propDef.slots;
|
|
17
|
+
import { SvelteComponentTyped } from "svelte";
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
id?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
hideTitle?: boolean;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {
|
|
28
|
+
default: {};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} NavSectionsProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} NavSectionsEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} NavSectionsSlots */
|
|
4
|
+
export default class NavSections extends SvelteComponentTyped<{
|
|
5
|
+
tocId?: string;
|
|
6
|
+
contentsLabel?: string;
|
|
7
|
+
noContents?: boolean;
|
|
8
|
+
}, {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
}, {
|
|
11
|
+
header: {};
|
|
12
|
+
'before-nav': {};
|
|
13
|
+
'after-nav': {};
|
|
14
|
+
before: {};
|
|
15
|
+
default: {};
|
|
16
|
+
after: {};
|
|
17
|
+
footer: {};
|
|
18
|
+
}> {
|
|
19
|
+
}
|
|
20
|
+
export type NavSectionsProps = typeof __propDef.props;
|
|
21
|
+
export type NavSectionsEvents = typeof __propDef.events;
|
|
22
|
+
export type NavSectionsSlots = typeof __propDef.slots;
|
|
23
|
+
import { SvelteComponentTyped } from "svelte";
|
|
24
|
+
declare const __propDef: {
|
|
25
|
+
props: {
|
|
26
|
+
tocId?: string;
|
|
27
|
+
contentsLabel?: string;
|
|
28
|
+
noContents?: boolean;
|
|
29
|
+
};
|
|
30
|
+
events: {
|
|
31
|
+
[evt: string]: CustomEvent<any>;
|
|
32
|
+
};
|
|
33
|
+
slots: {
|
|
34
|
+
header: {};
|
|
35
|
+
'before-nav': {};
|
|
36
|
+
'after-nav': {};
|
|
37
|
+
before: {};
|
|
38
|
+
default: {};
|
|
39
|
+
after: {};
|
|
40
|
+
footer: {};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} SectionBacklinkProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} SectionBacklinkEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} SectionBacklinkSlots */
|
|
4
|
+
export default class SectionBacklink extends SvelteComponentTyped<{
|
|
5
|
+
tocId?: string;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {}> {
|
|
9
|
+
}
|
|
10
|
+
export type SectionBacklinkProps = typeof __propDef.props;
|
|
11
|
+
export type SectionBacklinkEvents = typeof __propDef.events;
|
|
12
|
+
export type SectionBacklinkSlots = typeof __propDef.slots;
|
|
13
|
+
import { SvelteComponentTyped } from "svelte";
|
|
14
|
+
declare const __propDef: {
|
|
15
|
+
props: {
|
|
16
|
+
tocId?: string;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ScrollerProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ScrollerEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ScrollerSlots */
|
|
4
|
+
export default class Scroller extends SvelteComponentTyped<{
|
|
5
|
+
marginBottom?: boolean;
|
|
6
|
+
id?: string;
|
|
7
|
+
progress?: number;
|
|
8
|
+
splitscreen?: boolean;
|
|
9
|
+
threshold?: number;
|
|
10
|
+
count?: number;
|
|
11
|
+
index?: number;
|
|
12
|
+
sectionId?: string;
|
|
13
|
+
offset?: number;
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
}, {
|
|
16
|
+
change: CustomEvent<any>;
|
|
17
|
+
} & {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {
|
|
20
|
+
background: {};
|
|
21
|
+
foreground: {};
|
|
22
|
+
}> {
|
|
23
|
+
}
|
|
24
|
+
export type ScrollerProps = typeof __propDef.props;
|
|
25
|
+
export type ScrollerEvents = typeof __propDef.events;
|
|
26
|
+
export type ScrollerSlots = typeof __propDef.slots;
|
|
27
|
+
import { SvelteComponentTyped } from "svelte";
|
|
28
|
+
declare const __propDef: {
|
|
29
|
+
props: {
|
|
30
|
+
marginBottom?: boolean;
|
|
31
|
+
id?: string;
|
|
32
|
+
progress?: number;
|
|
33
|
+
splitscreen?: boolean;
|
|
34
|
+
threshold?: number;
|
|
35
|
+
count?: number;
|
|
36
|
+
index?: number;
|
|
37
|
+
sectionId?: string;
|
|
38
|
+
offset?: number;
|
|
39
|
+
visible?: boolean;
|
|
40
|
+
};
|
|
41
|
+
events: {
|
|
42
|
+
change: CustomEvent<any>;
|
|
43
|
+
} & {
|
|
44
|
+
[evt: string]: CustomEvent<any>;
|
|
45
|
+
};
|
|
46
|
+
slots: {
|
|
47
|
+
background: {};
|
|
48
|
+
foreground: {};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ScrollerSectionProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ScrollerSectionEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ScrollerSectionSlots */
|
|
4
|
+
export default class ScrollerSection extends SvelteComponentTyped<{
|
|
5
|
+
theme?: "light" | "dark" | "lightblue";
|
|
6
|
+
id?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
hideTitle?: boolean;
|
|
9
|
+
}, {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
}, {
|
|
12
|
+
default: {};
|
|
13
|
+
}> {
|
|
14
|
+
}
|
|
15
|
+
export type ScrollerSectionProps = typeof __propDef.props;
|
|
16
|
+
export type ScrollerSectionEvents = typeof __propDef.events;
|
|
17
|
+
export type ScrollerSectionSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
theme?: "light" | "dark" | "lightblue";
|
|
22
|
+
id?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
hideTitle?: boolean;
|
|
25
|
+
};
|
|
26
|
+
events: {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {
|
|
30
|
+
default: {};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} MetaEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MetaSlots */
|
|
4
4
|
export default class Meta extends SvelteComponentTyped<{
|
|
5
|
-
|
|
5
|
+
meta?: any;
|
|
6
6
|
}, {
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
8
8
|
}, {}> {
|
|
@@ -13,7 +13,7 @@ export type MetaSlots = typeof __propDef.slots;
|
|
|
13
13
|
import { SvelteComponentTyped } from "svelte";
|
|
14
14
|
declare const __propDef: {
|
|
15
15
|
props: {
|
|
16
|
-
|
|
16
|
+
meta?: any;
|
|
17
17
|
};
|
|
18
18
|
events: {
|
|
19
19
|
[evt: string]: CustomEvent<any>;
|
|
@@ -2,10 +2,20 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} TitleBlockEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TitleBlockSlots */
|
|
4
4
|
export default class TitleBlock extends SvelteComponentTyped<{
|
|
5
|
-
|
|
5
|
+
theme?: "light" | "dark" | "lightblue";
|
|
6
|
+
background?: string;
|
|
7
|
+
themeOverrides?: any;
|
|
8
|
+
title?: string;
|
|
9
|
+
meta?: any[];
|
|
10
|
+
natStatBadge?: boolean;
|
|
11
|
+
censusLogo?: boolean;
|
|
6
12
|
}, {
|
|
7
13
|
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
14
|
+
}, {
|
|
15
|
+
before: {};
|
|
16
|
+
brand: {};
|
|
17
|
+
after: {};
|
|
18
|
+
}> {
|
|
9
19
|
}
|
|
10
20
|
export type TitleBlockProps = typeof __propDef.props;
|
|
11
21
|
export type TitleBlockEvents = typeof __propDef.events;
|
|
@@ -13,11 +23,21 @@ export type TitleBlockSlots = typeof __propDef.slots;
|
|
|
13
23
|
import { SvelteComponentTyped } from "svelte";
|
|
14
24
|
declare const __propDef: {
|
|
15
25
|
props: {
|
|
16
|
-
|
|
26
|
+
theme?: "light" | "dark" | "lightblue";
|
|
27
|
+
background?: string;
|
|
28
|
+
themeOverrides?: object;
|
|
29
|
+
title?: string;
|
|
30
|
+
meta?: any[];
|
|
31
|
+
natStatBadge?: boolean;
|
|
32
|
+
censusLogo?: boolean;
|
|
17
33
|
};
|
|
18
34
|
events: {
|
|
19
35
|
[evt: string]: CustomEvent<any>;
|
|
20
36
|
};
|
|
21
|
-
slots: {
|
|
37
|
+
slots: {
|
|
38
|
+
before: {};
|
|
39
|
+
brand: {};
|
|
40
|
+
after: {};
|
|
41
|
+
};
|
|
22
42
|
};
|
|
23
43
|
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { commas, ascending, descending } from "$lib/js/utils.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* An optional title for the table
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
export let title = "";
|
|
9
|
+
/**
|
|
10
|
+
* Make the chart smaller/more compact
|
|
11
|
+
* @type {boolean}
|
|
12
|
+
*/
|
|
13
|
+
export let compact = false;
|
|
14
|
+
/**
|
|
15
|
+
* Make the chart responsive (changes layout on narrow screens)
|
|
16
|
+
* @type {boolean}
|
|
17
|
+
*/
|
|
18
|
+
export let responsive = false;
|
|
19
|
+
/**
|
|
20
|
+
* Highlight rows on hover
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
*/
|
|
23
|
+
export let rowHover = false;
|
|
24
|
+
/**
|
|
25
|
+
* Rows of data
|
|
26
|
+
* @type {array}
|
|
27
|
+
*/
|
|
28
|
+
export let data = [];
|
|
29
|
+
/**
|
|
30
|
+
* Optional metadata for formatting columns. Array of {key, label, sortable?, numeric?} objects
|
|
31
|
+
* @type {array}
|
|
32
|
+
*/
|
|
33
|
+
export let columns =
|
|
34
|
+
Array.isArray(data) && data[0] ? Object.keys(data[0]).map((key) => ({ key, label: key })) : [];
|
|
35
|
+
let _data = [...data];
|
|
36
|
+
let sort = columns.map((c) => "none");
|
|
37
|
+
|
|
38
|
+
const format = (val, numeric) => (numeric ? commas(val) : val);
|
|
39
|
+
$: sortable = columns.map((d) => d.sortable).includes(true);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<table
|
|
43
|
+
class="ons-table"
|
|
44
|
+
class:ons-table--sortable="{sortable}"
|
|
45
|
+
class:ons-table--compact="{compact}"
|
|
46
|
+
class:ons-table--responsive="{responsive}"
|
|
47
|
+
class:ons-table--row-hover="{rowHover}"
|
|
48
|
+
data-aria-sort="{sortable ? 'Sort by' : null}"
|
|
49
|
+
data-aria-asc="{sortable ? 'ascending' : null}"
|
|
50
|
+
data-aria-desc="{sortable ? 'descending' : null}"
|
|
51
|
+
>
|
|
52
|
+
{#if title}<caption class="ons-table__caption">{title}</caption>{/if}
|
|
53
|
+
<thead class="ons-table__head">
|
|
54
|
+
<tr class="ons-table__row">
|
|
55
|
+
{#each columns as col, i}
|
|
56
|
+
{#if col.sortable}
|
|
57
|
+
<th
|
|
58
|
+
scope="col"
|
|
59
|
+
class="ons-table__header"
|
|
60
|
+
class:ons-table__header--numeric="{col.numeric}"
|
|
61
|
+
aria-sort="{sort[i]}"
|
|
62
|
+
>
|
|
63
|
+
<button
|
|
64
|
+
aria-label="Sort by {col.label}"
|
|
65
|
+
type="button"
|
|
66
|
+
data-index="{i}"
|
|
67
|
+
class="ons-table__sort-button"
|
|
68
|
+
on:click="{() => {
|
|
69
|
+
sort = sort.map((c, j) =>
|
|
70
|
+
j === i && c === 'ascending' ? 'descending' : j === i ? 'ascending' : 'none'
|
|
71
|
+
);
|
|
72
|
+
_data = _data.sort((a, b) =>
|
|
73
|
+
sort[i] === 'ascending'
|
|
74
|
+
? ascending(a[col.key], b[col.key])
|
|
75
|
+
: descending(a[col.key], b[col.key])
|
|
76
|
+
);
|
|
77
|
+
}}"
|
|
78
|
+
>
|
|
79
|
+
{col.label}<svg
|
|
80
|
+
class="ons-svg-icon"
|
|
81
|
+
viewBox="0 0 12 19"
|
|
82
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
83
|
+
focusable="false"
|
|
84
|
+
fill="currentColor"
|
|
85
|
+
>
|
|
86
|
+
<path
|
|
87
|
+
class="ons-topTriangle"
|
|
88
|
+
d="M6 0l6 7.2H0L6 0zm0 18.6l6-7.2H0l6 7.2zm0 3.6l6 7.2H0l6-7.2z"></path>
|
|
89
|
+
<path class="ons-bottomTriangle" d="M6 18.6l6-7.2H0l6 7.2zm0 3.6l6 7.2H0l6-7.2z"
|
|
90
|
+
></path>
|
|
91
|
+
</svg>
|
|
92
|
+
</button>
|
|
93
|
+
</th>
|
|
94
|
+
{:else}
|
|
95
|
+
<th
|
|
96
|
+
scope="col"
|
|
97
|
+
class="ons-table__header"
|
|
98
|
+
class:ons-table__header--numeric="{col.numeric}"
|
|
99
|
+
>
|
|
100
|
+
<span class="ons-table__header-text">{col.label}</span>
|
|
101
|
+
</th>
|
|
102
|
+
{/if}
|
|
103
|
+
{/each}
|
|
104
|
+
</tr>
|
|
105
|
+
</thead>
|
|
106
|
+
<tbody class="ons-table__body">
|
|
107
|
+
{#each _data as row}
|
|
108
|
+
<tr class="ons-table__row">
|
|
109
|
+
{#each columns as col}
|
|
110
|
+
<td
|
|
111
|
+
class="ons-table__cell"
|
|
112
|
+
class:ons-table__cell--numeric="{col.numeric}"
|
|
113
|
+
data-th="{col.label}">{format(row[col.key], col.numeric)}</td
|
|
114
|
+
>
|
|
115
|
+
{/each}
|
|
116
|
+
</tr>
|
|
117
|
+
{/each}
|
|
118
|
+
</tbody>
|
|
119
|
+
</table>
|
|
120
|
+
|
|
121
|
+
<style>
|
|
122
|
+
.ons-table__sort-button {
|
|
123
|
+
color: var(--link, --ons-color-text-link) !important;
|
|
124
|
+
}
|
|
125
|
+
.ons-table__sort-button:hover {
|
|
126
|
+
color: var(--link-hover, --ons-color-text-link-hover) !important;
|
|
127
|
+
-webkit-text-decoration: underline solid var(--link-hover, --ons-color-text-link-hover) 2px !important;
|
|
128
|
+
text-decoration: underline solid var(--link-hover, --ons-color-text-link-hover) 2px !important;
|
|
129
|
+
}</style>
|