@ilo-org/twig 0.2.11 → 0.2.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/.eslintrc.js +37 -49
- package/.stylelintrc +2 -6
- package/.turbo/turbo-build:lib.log +2 -2
- package/CHANGELOG.md +20 -0
- package/apps/storybook/assets.js +5 -0
- package/apps/storybook/main.js +17 -8
- package/apps/storybook/manager-head.html +1 -1
- package/apps/storybook/manager.js +2 -2
- package/apps/storybook/patterns/colors.stories.mdx +9 -4
- package/apps/storybook/patterns/intro.stories.mdx +47 -42
- package/apps/storybook/patterns/typeset.stories.mdx +10 -6
- package/apps/storybook/patterns/welcome.stories.mdx +21 -16
- package/apps/storybook/preview-body.html +1 -1
- package/apps/storybook/preview.js +16 -16
- package/apps/storybook/styles.scss +1 -1
- package/apps/storybook/theme.js +5 -5
- package/babel.config.js +3 -3
- package/importprefix.js +5 -5
- package/importsvgs.js +3 -3
- package/jest.config.js +8 -8
- package/outputtwigs.js +16 -13
- package/package.json +47 -56
- package/postcss.config.js +2 -2
- package/src/namespaces.js +5 -5
- package/src/patterns/components/accordion/accordion-item.wingsuit.yml +1 -1
- package/src/patterns/components/accordion/accordion.behavior.js +2 -2
- package/src/patterns/components/accordion/accordion.js +31 -21
- package/src/patterns/components/accordion/accordion.stories.jsx +4 -2
- package/src/patterns/components/accordion/accordion.wingsuit.yml +4 -3
- package/src/patterns/components/accordion/index.js +3 -3
- package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +2 -2
- package/src/patterns/components/breadcrumb/breadcrumb.js +14 -12
- package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +4 -2
- package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +1 -1
- package/src/patterns/components/breadcrumb/index.js +3 -3
- package/src/patterns/components/button/button.stories.jsx +4 -2
- package/src/patterns/components/button/button.wingsuit.yml +12 -12
- package/src/patterns/components/button/index.js +2 -2
- package/src/patterns/components/callout/callout.behavior.js +2 -2
- package/src/patterns/components/callout/callout.js +18 -13
- package/src/patterns/components/callout/callout.stories.jsx +4 -2
- package/src/patterns/components/callout/callout.wingsuit.yml +2 -2
- package/src/patterns/components/callout/index.js +3 -3
- package/src/patterns/components/card/card.stories.jsx +4 -2
- package/src/patterns/components/card/card.wingsuit.yml +8 -8
- package/src/patterns/components/card/index.js +2 -2
- package/src/patterns/components/cardgroup/cardgroup.stories.jsx +4 -2
- package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +31 -31
- package/src/patterns/components/cardgroup/index.js +2 -2
- package/src/patterns/components/contextmenu/contextmenu.stories.jsx +4 -2
- package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +7 -7
- package/src/patterns/components/contextmenu/index.js +2 -2
- package/src/patterns/components/dropdown/dropdown.stories.jsx +4 -2
- package/src/patterns/components/dropdown/dropdown.wingsuit.yml +4 -4
- package/src/patterns/components/dropdown/index.js +2 -2
- package/src/patterns/components/footer/footer.stories.jsx +4 -2
- package/src/patterns/components/footer/footer.wingsuit.yml +1 -1
- package/src/patterns/components/footer/index.js +2 -2
- package/src/patterns/components/form/fileupload.behavior.js +2 -2
- package/src/patterns/components/form/fileupload.js +6 -5
- package/src/patterns/components/form/form.stories.jsx +4 -2
- package/src/patterns/components/form/form.wingsuit.yml +92 -92
- package/src/patterns/components/form/index.js +3 -3
- package/src/patterns/components/hero/hero.stories.jsx +4 -2
- package/src/patterns/components/hero/hero.wingsuit.yml +4 -4
- package/src/patterns/components/hero/index.js +2 -2
- package/src/patterns/components/herocard/herocard.stories.jsx +4 -2
- package/src/patterns/components/herocard/herocard.wingsuit.yml +5 -5
- package/src/patterns/components/herocard/index.js +2 -2
- package/src/patterns/components/icon/index.js +2 -2
- package/src/patterns/components/image/image.stories.jsx +4 -2
- package/src/patterns/components/image/image.wingsuit.yml +9 -9
- package/src/patterns/components/image/index.js +2 -2
- package/src/patterns/components/link/index.js +2 -2
- package/src/patterns/components/link/link.stories.jsx +4 -2
- package/src/patterns/components/link/link.wingsuit.yml +3 -3
- package/src/patterns/components/linklist/index.js +2 -2
- package/src/patterns/components/linklist/linklist.stories.jsx +4 -2
- package/src/patterns/components/linklist/linklist.wingsuit.yml +15 -15
- package/src/patterns/components/list/index.js +2 -2
- package/src/patterns/components/list/list-item.wingsuit.yml +1 -1
- package/src/patterns/components/list/list.stories.jsx +4 -2
- package/src/patterns/components/list/list.wingsuit.yml +4 -4
- package/src/patterns/components/loading/index.js +3 -3
- package/src/patterns/components/loading/loading.behavior.js +2 -2
- package/src/patterns/components/loading/loading.js +2 -2
- package/src/patterns/components/loading/loading.stories.jsx +4 -2
- package/src/patterns/components/loading/loading.wingsuit.yml +5 -5
- package/src/patterns/components/localnav/index.js +3 -3
- package/src/patterns/components/localnav/localnav.stories.jsx +4 -2
- package/src/patterns/components/localnav/localnav.twig +3 -1
- package/src/patterns/components/localnav/localnav.wingsuit.yml +17 -19
- package/src/patterns/components/modal/index.js +3 -3
- package/src/patterns/components/modal/modal.behavior.js +2 -2
- package/src/patterns/components/modal/modal.js +9 -7
- package/src/patterns/components/modal/modal.stories.jsx +5 -2
- package/src/patterns/components/modal/modal.wingsuit.yml +20 -20
- package/src/patterns/components/navigation/index.js +3 -3
- package/src/patterns/components/navigation/navigation.behavior.js +2 -2
- package/src/patterns/components/navigation/navigation.js +110 -37
- package/src/patterns/components/navigation/navigation.stories.jsx +5 -2
- package/src/patterns/components/navigation/navigation.wingsuit.yml +7 -7
- package/src/patterns/components/notification/index.js +3 -3
- package/src/patterns/components/notification/notification.behavior.js +3 -3
- package/src/patterns/components/notification/notification.js +4 -2
- package/src/patterns/components/notification/notification.stories.jsx +5 -2
- package/src/patterns/components/notification/notification.wingsuit.yml +7 -7
- package/src/patterns/components/pagination/Pagination.stories.jsx +4 -2
- package/src/patterns/components/pagination/index.js +2 -2
- package/src/patterns/components/pagination/pagination.wingsuit.yml +12 -12
- package/src/patterns/components/polyfill/index.js +2 -2
- package/src/patterns/components/profile/index.js +2 -2
- package/src/patterns/components/profile/profile.stories.jsx +5 -2
- package/src/patterns/components/profile/profile.wingsuit.yml +3 -3
- package/src/patterns/components/readmore/index.js +3 -3
- package/src/patterns/components/readmore/readmore.behavior.js +2 -2
- package/src/patterns/components/readmore/readmore.js +4 -2
- package/src/patterns/components/readmore/readmore.stories.jsx +5 -2
- package/src/patterns/components/readmore/readmore.wingsuit.yml +4 -4
- package/src/patterns/components/richtext/index.js +2 -2
- package/src/patterns/components/richtext/richtext.stories.jsx +5 -2
- package/src/patterns/components/richtext/richtext.wingsuit.yml +1 -1
- package/src/patterns/components/searchfield/index.js +2 -2
- package/src/patterns/components/searchfield/searchfield.stories.jsx +5 -2
- package/src/patterns/components/searchfield/searchfield.wingsuit.yml +1 -1
- package/src/patterns/components/table/index.js +3 -3
- package/src/patterns/components/table/table.behavior.js +2 -2
- package/src/patterns/components/table/table.js +66 -44
- package/src/patterns/components/table/table.stories.jsx +5 -2
- package/src/patterns/components/table/table.wingsuit.yml +11 -21
- package/src/patterns/components/tableofcontents/index.js +3 -3
- package/src/patterns/components/tableofcontents/tableofcontents.behavior.js +2 -2
- package/src/patterns/components/tableofcontents/tableofcontents.js +27 -19
- package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +5 -2
- package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +14 -14
- package/src/patterns/components/tabs/index.js +3 -3
- package/src/patterns/components/tabs/tabs.behavior.js +4 -4
- package/src/patterns/components/tabs/tabs.js +12 -8
- package/src/patterns/components/tabs/tabs.stories.jsx +5 -2
- package/src/patterns/components/tabs/tabs.wingsuit.yml +120 -120
- package/src/patterns/components/tags/index.js +3 -3
- package/src/patterns/components/tags/tag.behavior.js +2 -2
- package/src/patterns/components/tags/tag.js +12 -12
- package/src/patterns/components/tags/tag.stories.jsx +5 -2
- package/src/patterns/components/tags/tag.wingsuit.yml +3 -3
- package/src/patterns/components/tags/tags.wingsuit.yml +1 -1
- package/src/patterns/components/tooltip/index.js +3 -3
- package/src/patterns/components/tooltip/tooltip.behavior.js +2 -2
- package/src/patterns/components/tooltip/tooltip.js +35 -25
- package/src/patterns/components/tooltip/tooltip.stories.jsx +5 -2
- package/src/patterns/components/tooltip/tooltip.wingsuit.yml +4 -4
- package/src/patterns/components/video/index.js +3 -3
- package/src/patterns/components/video/video.behavior.js +2 -2
- package/src/patterns/components/video/video.js +6 -5
- package/src/patterns/components/video/video.stories.jsx +5 -2
- package/src/patterns/components/video/video.wingsuit.yml +11 -11
- package/src/vendorjs/lib.vendor.js +1 -1
- package/wingsuit.config.js +14 -13
- package/.editorconfig +0 -12
- package/.eslintignore +0 -11
- package/.prettierignore +0 -16
- package/.prettierrc.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
linklist:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/linklist/linklist.twig"
|
|
3
3
|
label: Link List
|
|
4
4
|
description: The Link List receives a list of urls with labels and an optional prop indicating if this link is at the end of a 'section.'
|
|
5
5
|
fields:
|
|
@@ -17,30 +17,30 @@ linklist:
|
|
|
17
17
|
- headline: Section Headline
|
|
18
18
|
links:
|
|
19
19
|
- label: Link One
|
|
20
|
-
url:
|
|
20
|
+
url: "http://www.google.com"
|
|
21
21
|
- label: Link Two
|
|
22
|
-
url:
|
|
22
|
+
url: "http://www.google.com"
|
|
23
23
|
- label: Link Three
|
|
24
|
-
url:
|
|
24
|
+
url: "http://www.google.com"
|
|
25
25
|
- label: Link Four
|
|
26
|
-
url:
|
|
26
|
+
url: "http://www.google.com"
|
|
27
27
|
- label: Link Five Is Slightly Longer
|
|
28
|
-
url:
|
|
28
|
+
url: "http://www.google.com"
|
|
29
29
|
- headline: Section 2 (With Indents)
|
|
30
30
|
links:
|
|
31
31
|
- label: Section 2 Link One
|
|
32
|
-
url:
|
|
33
|
-
- indented:
|
|
32
|
+
url: "http://www.google.com"
|
|
33
|
+
- indented: "true"
|
|
34
34
|
label: Section 2 Link Two
|
|
35
|
-
url:
|
|
36
|
-
- indented:
|
|
35
|
+
url: "http://www.google.com"
|
|
36
|
+
- indented: "true"
|
|
37
37
|
label: Section 2 Link Three
|
|
38
|
-
url:
|
|
39
|
-
- indented:
|
|
38
|
+
url: "http://www.google.com"
|
|
39
|
+
- indented: "true"
|
|
40
40
|
label: Section 2 Link Four
|
|
41
|
-
url:
|
|
41
|
+
url: "http://www.google.com"
|
|
42
42
|
- label: Section 2 Link Five Is Slightly Longer
|
|
43
|
-
url:
|
|
43
|
+
url: "http://www.google.com"
|
|
44
44
|
settings:
|
|
45
45
|
theme:
|
|
46
46
|
type: select
|
|
@@ -50,5 +50,5 @@ linklist:
|
|
|
50
50
|
options:
|
|
51
51
|
light: Light
|
|
52
52
|
dark: Dark
|
|
53
|
-
preview:
|
|
53
|
+
preview: "light"
|
|
54
54
|
visibility: storybook
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./list.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
list:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/list/list.twig"
|
|
3
3
|
label: List
|
|
4
4
|
description: The list component
|
|
5
5
|
fields:
|
|
@@ -25,7 +25,7 @@ list:
|
|
|
25
25
|
id: item4
|
|
26
26
|
- content: Cappuccino. Made with espresso and milk that has been frothed up with pressurized steam.
|
|
27
27
|
id: item5
|
|
28
|
-
settings:
|
|
28
|
+
settings:
|
|
29
29
|
ordered:
|
|
30
30
|
type: select
|
|
31
31
|
label: Ordered
|
|
@@ -35,7 +35,7 @@ list:
|
|
|
35
35
|
ordered: Ordered
|
|
36
36
|
unordered: Unordered
|
|
37
37
|
unstyled: Unstyled
|
|
38
|
-
preview:
|
|
38
|
+
preview: "unstyled"
|
|
39
39
|
alignment:
|
|
40
40
|
type: select
|
|
41
41
|
label: Alignment
|
|
@@ -43,6 +43,6 @@ list:
|
|
|
43
43
|
options:
|
|
44
44
|
default: Default
|
|
45
45
|
horizontal: Horizontal
|
|
46
|
-
preview:
|
|
46
|
+
preview: "default"
|
|
47
47
|
required: false
|
|
48
48
|
visibility: storybook
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Loading from
|
|
1
|
+
import Loading from "./loading";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.loading = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.loading = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="Loading"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading Loading component....");
|
|
10
10
|
new Loading(element);
|
|
11
11
|
}
|
|
12
12
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EVENTS
|
|
1
|
+
import { EVENTS } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Loading module which handles rendering field labels inline on a form.
|
|
@@ -26,7 +26,7 @@ export default class Loading {
|
|
|
26
26
|
this.prefix = `${this.element.dataset.prefix}--loading`;
|
|
27
27
|
|
|
28
28
|
// set some values
|
|
29
|
-
this.status =
|
|
29
|
+
this.status = "idle";
|
|
30
30
|
|
|
31
31
|
// Initialize the view
|
|
32
32
|
this.init();
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./loading.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
loading:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/loading/loading.twig"
|
|
3
3
|
label: Loading
|
|
4
4
|
description: The Loading component displays a loading state. (See Javascript comments in loading.js for how to use this with vanilla JS).
|
|
5
5
|
fields:
|
|
@@ -7,13 +7,13 @@ loading:
|
|
|
7
7
|
type: string
|
|
8
8
|
label: Message
|
|
9
9
|
description: The loading message
|
|
10
|
-
preview:
|
|
10
|
+
preview: "Submitting"
|
|
11
11
|
required: true
|
|
12
12
|
loadedmessage:
|
|
13
13
|
type: string
|
|
14
14
|
label: LOaded Message
|
|
15
15
|
description: The loaded message
|
|
16
|
-
preview:
|
|
16
|
+
preview: "Completed"
|
|
17
17
|
required: true
|
|
18
18
|
settings:
|
|
19
19
|
size:
|
|
@@ -24,7 +24,7 @@ loading:
|
|
|
24
24
|
options:
|
|
25
25
|
small: Small
|
|
26
26
|
large: Large
|
|
27
|
-
preview:
|
|
27
|
+
preview: "large"
|
|
28
28
|
status:
|
|
29
29
|
type: select
|
|
30
30
|
label: Status
|
|
@@ -34,5 +34,5 @@ loading:
|
|
|
34
34
|
idle: Idle
|
|
35
35
|
loading: Loading
|
|
36
36
|
loaded: Loaded
|
|
37
|
-
preview:
|
|
37
|
+
preview: "loading"
|
|
38
38
|
visibility: storybook
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./localnav.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
5
7
|
export const wingsuit = {
|
|
6
8
|
patternDefinition,
|
|
7
9
|
};
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
<ul class="{{prefix}}--nav--local--set">
|
|
14
14
|
{% for item in primarynav.items %}
|
|
15
15
|
<li class="{{prefix}}--nav--local--item">
|
|
16
|
-
<a href="{{item.link}}" class="{{prefix}}--nav--local--link">
|
|
16
|
+
<a href="{{item.link}}" class="{{prefix}}--nav--local--link">
|
|
17
|
+
<span>{{item.label}}</span>
|
|
18
|
+
</a>
|
|
17
19
|
</li>
|
|
18
20
|
{% endfor %}
|
|
19
21
|
</ul>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
localnav:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/localnav/localnav.twig"
|
|
3
3
|
label: Local nav
|
|
4
4
|
description: The Local nav component
|
|
5
5
|
fields:
|
|
@@ -7,21 +7,21 @@ localnav:
|
|
|
7
7
|
type: string
|
|
8
8
|
label: Background
|
|
9
9
|
description: Override color for the background
|
|
10
|
-
preview: "#
|
|
10
|
+
preview: "#1E2DBE"
|
|
11
11
|
logo:
|
|
12
12
|
type: object
|
|
13
13
|
label: Logo
|
|
14
14
|
description: Logo for the nav
|
|
15
15
|
required: true
|
|
16
16
|
preview:
|
|
17
|
-
image: "
|
|
17
|
+
image: "/brand-assets/logo_en_horizontal_white.svg"
|
|
18
18
|
alt: Logo
|
|
19
19
|
siteurl:
|
|
20
20
|
type: string
|
|
21
21
|
label: Site url
|
|
22
22
|
description: home url for the website
|
|
23
23
|
required: true
|
|
24
|
-
preview: "https://www.
|
|
24
|
+
preview: "https://www.ilo.org/"
|
|
25
25
|
tagline:
|
|
26
26
|
type: object
|
|
27
27
|
label: Site tagline
|
|
@@ -47,23 +47,21 @@ localnav:
|
|
|
47
47
|
navlabel: Primary Local nav
|
|
48
48
|
mobilecloselabel: Close
|
|
49
49
|
items:
|
|
50
|
-
- link: "https://www.
|
|
50
|
+
- link: "https://www.ilo.org"
|
|
51
51
|
label: Menu Item 1
|
|
52
|
-
- link: "https://www.
|
|
52
|
+
- link: "https://www.ilo.org"
|
|
53
53
|
label: Menu Item 2
|
|
54
|
-
- link: "https://www.
|
|
54
|
+
- link: "https://www.ilo.org"
|
|
55
55
|
label: Menu Item 3
|
|
56
|
-
- link: "https://www.
|
|
56
|
+
- link: "https://www.ilo.org"
|
|
57
57
|
label: Menu Item 4
|
|
58
|
-
- link: "https://www.google.com/search?q=menu5"
|
|
59
|
-
label: Menu Item 5
|
|
60
58
|
mainlink:
|
|
61
59
|
type: object
|
|
62
60
|
label: Main link object
|
|
63
61
|
description: Link object for back to main site link
|
|
64
|
-
preview:
|
|
65
|
-
url:
|
|
66
|
-
label:
|
|
62
|
+
preview:
|
|
63
|
+
url: "https://www.ilo.org/"
|
|
64
|
+
label: "Go to main website"
|
|
67
65
|
languagelabel:
|
|
68
66
|
type: string
|
|
69
67
|
label: Language Label
|
|
@@ -76,14 +74,14 @@ localnav:
|
|
|
76
74
|
preview:
|
|
77
75
|
links:
|
|
78
76
|
- label: Link One
|
|
79
|
-
url:
|
|
77
|
+
url: "http://www.google.com"
|
|
80
78
|
- label: Link Two
|
|
81
|
-
url:
|
|
82
|
-
- endsection:
|
|
79
|
+
url: "http://www.google.com"
|
|
80
|
+
- endsection: "true"
|
|
83
81
|
label: Link Three Ends A Section
|
|
84
|
-
url:
|
|
82
|
+
url: "http://www.google.com"
|
|
85
83
|
- label: Link Four
|
|
86
|
-
url:
|
|
84
|
+
url: "http://www.google.com"
|
|
87
85
|
- label: Link Five Is Slightly Longer
|
|
88
|
-
url:
|
|
86
|
+
url: "http://www.google.com"
|
|
89
87
|
visibility: storybook
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Modal from
|
|
1
|
+
import Modal from "./modal";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.modal = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.modal = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="Modal"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading Modal component....");
|
|
10
10
|
new Modal(element);
|
|
11
11
|
}
|
|
12
12
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EVENTS } from
|
|
1
|
+
import { EVENTS } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Modal module which handles control and display of a modal dialog
|
|
@@ -76,7 +76,9 @@ export default class Modal {
|
|
|
76
76
|
* @chainable
|
|
77
77
|
*/
|
|
78
78
|
enable() {
|
|
79
|
-
this.OpenButton.addEventListener(EVENTS.CLICK, () =>
|
|
79
|
+
this.OpenButton.addEventListener(EVENTS.CLICK, () =>
|
|
80
|
+
this.OpenButtonHandler()
|
|
81
|
+
);
|
|
80
82
|
this.CloseButton.addEventListener(EVENTS.CLICK, () => this.CloseHandler());
|
|
81
83
|
|
|
82
84
|
return this;
|
|
@@ -89,9 +91,9 @@ export default class Modal {
|
|
|
89
91
|
* @chainable
|
|
90
92
|
*/
|
|
91
93
|
openButtonClick() {
|
|
92
|
-
this.element.classList.add(
|
|
94
|
+
this.element.classList.add("show");
|
|
93
95
|
setTimeout(() => {
|
|
94
|
-
this.element.classList.add(
|
|
96
|
+
this.element.classList.add("fadein");
|
|
95
97
|
}, 125);
|
|
96
98
|
window.addEventListener(EVENTS.KEY_DOWN, (e) => this.KeyPressHandler(e));
|
|
97
99
|
|
|
@@ -105,9 +107,9 @@ export default class Modal {
|
|
|
105
107
|
* @chainable
|
|
106
108
|
*/
|
|
107
109
|
closeButtonClick() {
|
|
108
|
-
this.element.classList.remove(
|
|
110
|
+
this.element.classList.remove("fadein");
|
|
109
111
|
setTimeout(() => {
|
|
110
|
-
this.element.classList.remove(
|
|
112
|
+
this.element.classList.remove("show");
|
|
111
113
|
}, 125);
|
|
112
114
|
window.removeEventListener(EVENTS.KEY_DOWN, (e) => this.KeyPressHandler(e));
|
|
113
115
|
|
|
@@ -121,7 +123,7 @@ export default class Modal {
|
|
|
121
123
|
* @chainable
|
|
122
124
|
*/
|
|
123
125
|
keyPress(e) {
|
|
124
|
-
if (e.key ===
|
|
126
|
+
if (e.key === "Escape") {
|
|
125
127
|
this.closeButtonClick();
|
|
126
128
|
}
|
|
127
129
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./modal.wingsuit.yml");
|
|
4
5
|
|
|
6
|
+
/* eslint-disable-next-line */
|
|
7
|
+
/* eslint-disable-next-line */
|
|
5
8
|
export const wingsuit = {
|
|
6
9
|
patternDefinition,
|
|
7
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
modal:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/modal/modal.twig"
|
|
3
3
|
label: Modal
|
|
4
4
|
description: The Modal displays a div containing a button which is visible on page load. On click of this button, a modal dialog is opened which displays a semitransparent fixed-position background and the contents of the chosen component.
|
|
5
5
|
fields:
|
|
@@ -8,13 +8,13 @@ modal:
|
|
|
8
8
|
label: Closee Button
|
|
9
9
|
description: Label and settings for the "close" button
|
|
10
10
|
preview:
|
|
11
|
-
size:
|
|
12
|
-
type:
|
|
13
|
-
label:
|
|
11
|
+
size: "medium"
|
|
12
|
+
type: "tertiary"
|
|
13
|
+
label: "Close Button"
|
|
14
14
|
icon: close
|
|
15
15
|
iconPos: center
|
|
16
16
|
icononly: true
|
|
17
|
-
className:
|
|
17
|
+
className: "modal--close"
|
|
18
18
|
required: true
|
|
19
19
|
component:
|
|
20
20
|
type: string
|
|
@@ -27,28 +27,28 @@ modal:
|
|
|
27
27
|
label: Modal Data
|
|
28
28
|
description: The fields needed to populate the component being displayed by the modal
|
|
29
29
|
preview:
|
|
30
|
-
alt:
|
|
31
|
-
caption:
|
|
32
|
-
credit:
|
|
30
|
+
alt: "My alt text"
|
|
31
|
+
caption: "my image caption"
|
|
32
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
33
33
|
url:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
- breakpoint: 0
|
|
35
|
+
src: "https://place-hold.it/400x300?text=SmallBreakpointImage"
|
|
36
|
+
- breakpoint: 800
|
|
37
|
+
src: "https://place-hold.it/800x600?text=MediumBreakpointImage"
|
|
38
|
+
- breakpoint: 1200
|
|
39
|
+
src: "https://place-hold.it/1200x900?text=LargeBreakpointImage"
|
|
40
|
+
- breakpoint: 1440
|
|
41
|
+
src: "https://place-hold.it/1600x1200?text=LargestBreakpointImage"
|
|
42
42
|
required: true
|
|
43
43
|
openbutton:
|
|
44
44
|
type: object
|
|
45
45
|
label: Open Button
|
|
46
46
|
description: The label and settings for the button that will open the modal
|
|
47
47
|
preview:
|
|
48
|
-
size:
|
|
49
|
-
type:
|
|
50
|
-
label:
|
|
51
|
-
className:
|
|
48
|
+
size: "large"
|
|
49
|
+
type: "primary"
|
|
50
|
+
label: "Open Button"
|
|
51
|
+
className: "modal--open"
|
|
52
52
|
opensmodal: true
|
|
53
53
|
required: true
|
|
54
54
|
visibility: storybook
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Navigation from
|
|
1
|
+
import Navigation from "./navigation";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.navigation = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.navigation = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="Navigation"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading Navigation component....");
|
|
10
10
|
new Navigation(element);
|
|
11
11
|
}
|
|
12
12
|
);
|