@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,4 +1,4 @@
|
|
|
1
|
-
import { EVENTS, ARIA } from
|
|
1
|
+
import { EVENTS, ARIA } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Tabs module which handles rendering field labels inline on a form.
|
|
@@ -52,7 +52,9 @@ export default class Tabs {
|
|
|
52
52
|
* The button for toggling Read More state
|
|
53
53
|
* @type {Object}
|
|
54
54
|
*/
|
|
55
|
-
this.tabButtons = this.element.querySelectorAll(
|
|
55
|
+
this.tabButtons = this.element.querySelectorAll(
|
|
56
|
+
`.${this.prefix}--tabs--selection--button`
|
|
57
|
+
);
|
|
56
58
|
this.tabPanels = this.element.querySelectorAll('[role="tabpanel"]');
|
|
57
59
|
this.firstTab;
|
|
58
60
|
|
|
@@ -81,7 +83,7 @@ export default class Tabs {
|
|
|
81
83
|
* @chainable
|
|
82
84
|
*/
|
|
83
85
|
enable() {
|
|
84
|
-
this.element.classList.add(
|
|
86
|
+
this.element.classList.add("tabs--js");
|
|
85
87
|
|
|
86
88
|
Array.from(this.tabButtons).forEach((button) => {
|
|
87
89
|
button.addEventListener(EVENTS.CLICK, (e) => this.OnClickHandler(e));
|
|
@@ -122,22 +124,22 @@ export default class Tabs {
|
|
|
122
124
|
console.log(e.key);
|
|
123
125
|
|
|
124
126
|
switch (e.key) {
|
|
125
|
-
case
|
|
127
|
+
case "ArrowLeft":
|
|
126
128
|
this.setSelectedToPreviousTab(tabid);
|
|
127
129
|
flag = true;
|
|
128
130
|
break;
|
|
129
131
|
|
|
130
|
-
case
|
|
132
|
+
case "ArrowRight":
|
|
131
133
|
this.setSelectedToNextTab(tabid);
|
|
132
134
|
flag = true;
|
|
133
135
|
break;
|
|
134
136
|
|
|
135
|
-
case
|
|
137
|
+
case "Home":
|
|
136
138
|
this.selectTab(this.firstTab.id);
|
|
137
139
|
flag = true;
|
|
138
140
|
break;
|
|
139
141
|
|
|
140
|
-
case
|
|
142
|
+
case "End":
|
|
141
143
|
this.selectTab(this.lastTab.id);
|
|
142
144
|
flag = true;
|
|
143
145
|
break;
|
|
@@ -161,7 +163,9 @@ export default class Tabs {
|
|
|
161
163
|
* @chainable
|
|
162
164
|
*/
|
|
163
165
|
selectTab(tabid) {
|
|
164
|
-
const selectedTab = this.element.querySelector(
|
|
166
|
+
const selectedTab = this.element.querySelector(
|
|
167
|
+
`[${ARIA.CONTROLS}="${tabid}"]`
|
|
168
|
+
);
|
|
165
169
|
Array.from(this.tabPanels).forEach((panel) => {
|
|
166
170
|
panel.setAttribute(ARIA.EXPANDED, false);
|
|
167
171
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./tabs.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
|
tabs:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/tabs/tabs.twig"
|
|
3
3
|
label: Tabs
|
|
4
4
|
description: The Tabs component displays content that is subdivided into sections, providing an interface for toggling visually between sections
|
|
5
5
|
fields:
|
|
@@ -8,23 +8,23 @@ tabs:
|
|
|
8
8
|
label: Items
|
|
9
9
|
description: The items and labels for each tab
|
|
10
10
|
preview:
|
|
11
|
-
- label:
|
|
12
|
-
component:
|
|
11
|
+
- label: "Tab Label With A Really Really Lenghty Title Even Though We Do Not Recommend Such A Lengthy Title"
|
|
12
|
+
component: "image"
|
|
13
13
|
componentdata:
|
|
14
|
-
alt:
|
|
15
|
-
caption:
|
|
16
|
-
credit:
|
|
14
|
+
alt: "My alt text"
|
|
15
|
+
caption: "my image caption"
|
|
16
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
17
17
|
url:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- label:
|
|
27
|
-
component:
|
|
18
|
+
- breakpoint: 0
|
|
19
|
+
src: "https://place-hold.it/400x300?text=SmallBreakpointImage"
|
|
20
|
+
- breakpoint: 800
|
|
21
|
+
src: "https://place-hold.it/800x600?text=MediumBreakpointImage"
|
|
22
|
+
- breakpoint: 1200
|
|
23
|
+
src: "https://place-hold.it/1200x900?text=LargeBreakpointImage"
|
|
24
|
+
- breakpoint: 1440
|
|
25
|
+
src: "https://place-hold.it/1600x1200?text=LargestBreakpointImage"
|
|
26
|
+
- label: "Tab Label 2"
|
|
27
|
+
component: "richtext"
|
|
28
28
|
componentdata:
|
|
29
29
|
content: "<h1>Apollo 11</h1><p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href='http://en.wikipedia.org/wiki/Neil_Armstrong'>Neil Armstrong</a> and <a href='http://en.wikipedia.org/wiki/Buzz_Aldrin'>Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p><p>Armstrong spent about <s>three and a half</s> two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, <a href='http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)'>Michael Collins</a>, piloted the <a href='http://en.wikipedia.org/wiki/Apollo_Command/Service_Module'>command</a> spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth. <figure><img alt='placeholder image' class='right' src='https://place-hold.it/400x300?text=Placeholder Image'><figcaption>The caption for this image</figcaption></figure></p><h2>Broadcasting and <em>quotes</em> <a id='quotes' name='quotes'></a></h2><p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p><blockquote><p>One small step for [a] man, one giant leap for mankind</p><cite>Neil Armstrong</cite></blockquote><h2>Technical details <a id='tech-details' name='tech-details'></a></h2><p>Launched by a <strong>Saturn V</strong> rocket from <a href='http://en.wikipedia.org/wiki/Kennedy_Space_Center'>Kennedy Space Center</a> in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href='http://en.wikipedia.org/wiki/NASA'>NASA</a>'s Apollo program. The Apollo spacecraft had three parts:</p><ol><li><strong>Command Module</strong> with a cabin for the three astronauts which was the only part which landed back on Earth</li><li><strong>Service Module</strong> which supported the Command Module with propulsion, electrical power, oxygen and water</li><li><strong>Lunar Module</strong> for landing on the Moon.</li></ol><p>After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the <a href='http://en.wikipedia.org/wiki/Mare_Tranquillitatis'>Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href='http://en.wikipedia.org/wiki/Pacific_Ocean'>Pacific Ocean</a> on July 24.</p><hr><p><small>Source: <a href='http://en.wikipedia.org/wiki/Apollo_11'>Wikipedia.org</a></small></p>"
|
|
30
30
|
required: true
|
|
@@ -37,132 +37,132 @@ tabs:
|
|
|
37
37
|
description: Tabs with Icons
|
|
38
38
|
fields:
|
|
39
39
|
items:
|
|
40
|
-
- label:
|
|
41
|
-
component:
|
|
40
|
+
- label: "Tab One"
|
|
41
|
+
component: "image"
|
|
42
42
|
componentdata:
|
|
43
|
-
alt:
|
|
44
|
-
caption:
|
|
45
|
-
credit:
|
|
43
|
+
alt: "My alt text"
|
|
44
|
+
caption: "my image caption"
|
|
45
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
46
46
|
url:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
- breakpoint: 0
|
|
48
|
+
src: "https://place-hold.it/400x300?text=Tab One Image"
|
|
49
|
+
- breakpoint: 800
|
|
50
|
+
src: "https://place-hold.it/800x600?text=Tab One tImage"
|
|
51
|
+
- breakpoint: 1200
|
|
52
|
+
src: "https://place-hold.it/1200x900?text=Tab One Image"
|
|
53
|
+
- breakpoint: 1440
|
|
54
|
+
src: "https://place-hold.it/1600x1200?text=Tab One Image"
|
|
55
55
|
icon: error
|
|
56
|
-
- label:
|
|
57
|
-
component:
|
|
56
|
+
- label: "Tab Two"
|
|
57
|
+
component: "image"
|
|
58
58
|
componentdata:
|
|
59
|
-
alt:
|
|
60
|
-
caption:
|
|
61
|
-
credit:
|
|
59
|
+
alt: "My alt text"
|
|
60
|
+
caption: "my image caption"
|
|
61
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
62
62
|
url:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
- breakpoint: 0
|
|
64
|
+
src: "https://place-hold.it/400x300?text=Tab Two Image"
|
|
65
|
+
- breakpoint: 800
|
|
66
|
+
src: "https://place-hold.it/800x600?text=Tab Two Image"
|
|
67
|
+
- breakpoint: 1200
|
|
68
|
+
src: "https://place-hold.it/1200x900?text=Tab Two Image"
|
|
69
|
+
- breakpoint: 1440
|
|
70
|
+
src: "https://place-hold.it/1600x1200?text=Tab Two Image"
|
|
71
71
|
icon: error
|
|
72
|
-
- label:
|
|
73
|
-
component:
|
|
72
|
+
- label: "Tab Three"
|
|
73
|
+
component: "image"
|
|
74
74
|
componentdata:
|
|
75
|
-
alt:
|
|
76
|
-
caption:
|
|
77
|
-
credit:
|
|
75
|
+
alt: "My alt text"
|
|
76
|
+
caption: "my image caption"
|
|
77
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
78
78
|
url:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
- breakpoint: 0
|
|
80
|
+
src: "https://place-hold.it/400x300?text=Tab Three Image"
|
|
81
|
+
- breakpoint: 800
|
|
82
|
+
src: "https://place-hold.it/800x600?text=Tab Three Image"
|
|
83
|
+
- breakpoint: 1200
|
|
84
|
+
src: "https://place-hold.it/1200x900?text=Tab Three Image"
|
|
85
|
+
- breakpoint: 1440
|
|
86
|
+
src: "https://place-hold.it/1600x1200?text=Tab Three Image"
|
|
87
87
|
icon: error
|
|
88
88
|
fiveitems:
|
|
89
89
|
label: Five Items
|
|
90
90
|
description: Tab component with five items
|
|
91
91
|
fields:
|
|
92
92
|
items:
|
|
93
|
-
- label:
|
|
94
|
-
component:
|
|
93
|
+
- label: "Tab One"
|
|
94
|
+
component: "image"
|
|
95
95
|
componentdata:
|
|
96
|
-
alt:
|
|
97
|
-
caption:
|
|
98
|
-
credit:
|
|
96
|
+
alt: "My alt text"
|
|
97
|
+
caption: "my image caption"
|
|
98
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
99
99
|
url:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- label:
|
|
109
|
-
component:
|
|
100
|
+
- breakpoint: 0
|
|
101
|
+
src: "https://place-hold.it/400x300?text=Tab One Image"
|
|
102
|
+
- breakpoint: 800
|
|
103
|
+
src: "https://place-hold.it/800x600?text=Tab One tImage"
|
|
104
|
+
- breakpoint: 1200
|
|
105
|
+
src: "https://place-hold.it/1200x900?text=Tab One Image"
|
|
106
|
+
- breakpoint: 1440
|
|
107
|
+
src: "https://place-hold.it/1600x1200?text=Tab One Image"
|
|
108
|
+
- label: "Tab Two"
|
|
109
|
+
component: "image"
|
|
110
110
|
componentdata:
|
|
111
|
-
alt:
|
|
112
|
-
caption:
|
|
113
|
-
credit:
|
|
111
|
+
alt: "My alt text"
|
|
112
|
+
caption: "my image caption"
|
|
113
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
114
114
|
url:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
- label:
|
|
124
|
-
component:
|
|
115
|
+
- breakpoint: 0
|
|
116
|
+
src: "https://place-hold.it/400x300?text=Tab Two Image"
|
|
117
|
+
- breakpoint: 800
|
|
118
|
+
src: "https://place-hold.it/800x600?text=Tab Two Image"
|
|
119
|
+
- breakpoint: 1200
|
|
120
|
+
src: "https://place-hold.it/1200x900?text=Tab Two Image"
|
|
121
|
+
- breakpoint: 1440
|
|
122
|
+
src: "https://place-hold.it/1600x1200?text=Tab Two Image"
|
|
123
|
+
- label: "Tab Three"
|
|
124
|
+
component: "image"
|
|
125
125
|
componentdata:
|
|
126
|
-
alt:
|
|
127
|
-
caption:
|
|
128
|
-
credit:
|
|
126
|
+
alt: "My alt text"
|
|
127
|
+
caption: "my image caption"
|
|
128
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
129
129
|
url:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
- label:
|
|
139
|
-
component:
|
|
130
|
+
- breakpoint: 0
|
|
131
|
+
src: "https://place-hold.it/400x300?text=Tab Three Image"
|
|
132
|
+
- breakpoint: 800
|
|
133
|
+
src: "https://place-hold.it/800x600?text=Tab Three Image"
|
|
134
|
+
- breakpoint: 1200
|
|
135
|
+
src: "https://place-hold.it/1200x900?text=Tab Three Image"
|
|
136
|
+
- breakpoint: 1440
|
|
137
|
+
src: "https://place-hold.it/1600x1200?text=Tab Three Image"
|
|
138
|
+
- label: "Tab Four Has A Really Lenghthy Title Which Might Get Truncated"
|
|
139
|
+
component: "image"
|
|
140
140
|
componentdata:
|
|
141
|
-
alt:
|
|
142
|
-
caption:
|
|
143
|
-
credit:
|
|
141
|
+
alt: "My alt text"
|
|
142
|
+
caption: "my image caption"
|
|
143
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
144
144
|
url:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
- label:
|
|
154
|
-
component:
|
|
145
|
+
- breakpoint: 0
|
|
146
|
+
src: "https://place-hold.it/400x300?text=Tab Four Image"
|
|
147
|
+
- breakpoint: 800
|
|
148
|
+
src: "https://place-hold.it/800x600?text=Tab Four Image"
|
|
149
|
+
- breakpoint: 1200
|
|
150
|
+
src: "https://place-hold.it/1200x900?text=Tab Four Image"
|
|
151
|
+
- breakpoint: 1440
|
|
152
|
+
src: "https://place-hold.it/1600x1200?text=Tab Four Image"
|
|
153
|
+
- label: "Tab Five"
|
|
154
|
+
component: "image"
|
|
155
155
|
componentdata:
|
|
156
|
-
alt:
|
|
157
|
-
caption:
|
|
158
|
-
credit:
|
|
156
|
+
alt: "My alt text"
|
|
157
|
+
caption: "my image caption"
|
|
158
|
+
credit: "Photo: copyright 2022 Person S. Name"
|
|
159
159
|
url:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
160
|
+
- breakpoint: 0
|
|
161
|
+
src: "https://place-hold.it/400x300?text=Tab Five Image"
|
|
162
|
+
- breakpoint: 800
|
|
163
|
+
src: "https://place-hold.it/800x600?text=Tab Five Image"
|
|
164
|
+
- breakpoint: 1200
|
|
165
|
+
src: "https://place-hold.it/1200x900?text=Tab Five Image"
|
|
166
|
+
- breakpoint: 1440
|
|
167
|
+
src: "https://place-hold.it/1600x1200?text=Tab Five Image"
|
|
168
168
|
visibility: storybook
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Tag from
|
|
1
|
+
import Tag from "./tag";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.tag = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.tag = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="Tag"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading Tag component....");
|
|
10
10
|
new Tag(element);
|
|
11
11
|
}
|
|
12
12
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getUpdatedItems, EVENTS
|
|
1
|
+
import { getUpdatedItems, EVENTS } from "@ilo-org/utils";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Tag module which handles rendering field labels inline on a form.
|
|
@@ -50,13 +50,13 @@ export default class Tag {
|
|
|
50
50
|
* The field that a user interacts with on a form
|
|
51
51
|
* @type {Object}
|
|
52
52
|
*/
|
|
53
|
-
this.buttonTags = this.element.querySelectorAll(
|
|
54
|
-
this.multipleActive = this.element.getAttribute(
|
|
53
|
+
this.buttonTags = this.element.querySelectorAll(".ilo--tag--button");
|
|
54
|
+
this.multipleActive = this.element.getAttribute("data-multipleactive");
|
|
55
55
|
|
|
56
56
|
this.buttonTags.forEach((button, i) => {
|
|
57
|
-
const expanded = button.dataset[
|
|
58
|
-
const id = this.buttonTags[i].getAttribute(
|
|
59
|
-
if (expanded ===
|
|
57
|
+
const expanded = button.dataset["active"];
|
|
58
|
+
const id = this.buttonTags[i].getAttribute("id");
|
|
59
|
+
if (expanded === "true") {
|
|
60
60
|
this.itemStatuses = getUpdatedItems({
|
|
61
61
|
id,
|
|
62
62
|
itemStatuses: this.itemStatuses,
|
|
@@ -104,7 +104,7 @@ export default class Tag {
|
|
|
104
104
|
* @chainable
|
|
105
105
|
*/
|
|
106
106
|
onClick(i) {
|
|
107
|
-
const id = this.buttonTags[i].getAttribute(
|
|
107
|
+
const id = this.buttonTags[i].getAttribute("id");
|
|
108
108
|
|
|
109
109
|
this.itemStatuses = getUpdatedItems({
|
|
110
110
|
id,
|
|
@@ -144,14 +144,14 @@ export default class Tag {
|
|
|
144
144
|
*/
|
|
145
145
|
updateTagItems() {
|
|
146
146
|
this.tags.forEach((item, i) => {
|
|
147
|
-
const id = item.getAttribute(
|
|
147
|
+
const id = item.getAttribute("id");
|
|
148
148
|
const open = this.itemStatuses.indexOf(id) > -1;
|
|
149
149
|
if (open) {
|
|
150
|
-
this.tags[i].classList.add(
|
|
151
|
-
this.tags[i].setAttribute(
|
|
150
|
+
this.tags[i].classList.add("ilo--tag--active");
|
|
151
|
+
this.tags[i].setAttribute("data-active", "true");
|
|
152
152
|
} else {
|
|
153
|
-
this.tags[i].classList.remove(
|
|
154
|
-
this.tags[i].setAttribute(
|
|
153
|
+
this.tags[i].classList.remove("ilo--tag--active");
|
|
154
|
+
this.tags[i].setAttribute("data-active", "true");
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./index";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default {};
|
|
4
|
+
const patternDefinition = require("./tags.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
|
tag:
|
|
2
|
-
use:
|
|
2
|
+
use: "@components/tags/tag.twig"
|
|
3
3
|
label: Tag
|
|
4
4
|
description: A display or interactable tag
|
|
5
5
|
fields:
|
|
@@ -18,10 +18,10 @@ tag:
|
|
|
18
18
|
url:
|
|
19
19
|
type: text
|
|
20
20
|
label: URL
|
|
21
|
-
description: The tag's url reference
|
|
21
|
+
description: The tag's url reference
|
|
22
22
|
preview:
|
|
23
23
|
faker: https://www.google.com/
|
|
24
|
-
settings:
|
|
24
|
+
settings:
|
|
25
25
|
defaultActive:
|
|
26
26
|
type: select
|
|
27
27
|
label: Default Active
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Tooltip from
|
|
1
|
+
import Tooltip from "./tooltip";
|
|
2
2
|
|
|
3
3
|
Drupal.behaviors.tooltip = {
|
|
4
4
|
attach() {
|
|
@@ -6,7 +6,7 @@ Drupal.behaviors.tooltip = {
|
|
|
6
6
|
document.querySelectorAll(`[data-loadcomponent="Tooltip"]`),
|
|
7
7
|
(element) => {
|
|
8
8
|
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(
|
|
9
|
+
console.log("loading Tooltip component....");
|
|
10
10
|
new Tooltip(element);
|
|
11
11
|
}
|
|
12
12
|
);
|