@itcenteratunihelsinki/huds-lib 0.5.22 → 0.5.23
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/cjs/huds-lib.cjs.js +1 -1
- package/dist/cjs/hy-accordion-container_5.cjs.entry.js +578 -0
- package/dist/cjs/{hy-menu-language_2.cjs.entry.js → hy-menu-language.cjs.entry.js} +0 -19
- package/dist/cjs/hy-menu-mobile-breadcrumb.cjs.entry.js +25 -0
- package/dist/cjs/hy-menu.cjs.entry.js +2 -2
- package/dist/cjs/hy-paragraph-text.cjs.entry.js +1 -1
- package/dist/cjs/hy-person-profile.cjs.entry.js +61 -0
- package/dist/cjs/hy-site-header_3.cjs.entry.js +4 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/accordion-item/accordion-item.css +5 -4
- package/dist/collection/components/accordion-item/accordion-item.js +20 -20
- package/dist/collection/components/navigation/menu/menu.js +23 -8
- package/dist/collection/components/paragraph-text/paragraph-text.css +9 -7
- package/dist/collection/components/person-profile/person-profile-listing/person-profile-listing.css +188 -0
- package/dist/collection/components/person-profile/person-profile-listing/person-profile.listing.js +124 -0
- package/dist/collection/components/person-profile/person-profile.css +506 -0
- package/dist/collection/components/person-profile/person-profile.js +199 -0
- package/dist/collection/components/site-header/site-header.css +12 -0
- package/dist/collection/components/site-header/site-header.js +21 -2
- package/dist/esm/huds-lib.js +1 -1
- package/dist/esm/hy-accordion-container_5.entry.js +570 -0
- package/dist/esm/{hy-menu-language_2.entry.js → hy-menu-language.entry.js} +1 -19
- package/dist/esm/hy-menu-mobile-breadcrumb.entry.js +21 -0
- package/dist/esm/hy-menu.entry.js +2 -2
- package/dist/esm/hy-paragraph-text.entry.js +1 -1
- package/dist/esm/hy-person-profile.entry.js +57 -0
- package/dist/esm/hy-site-header_3.entry.js +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/huds-lib/huds-lib.esm.js +1 -1
- package/dist/huds-lib/p-0b2e3057.entry.js +1 -0
- package/dist/huds-lib/p-3d35d226.entry.js +1 -0
- package/dist/huds-lib/{p-b526249a.entry.js → p-4252e76e.entry.js} +1 -1
- package/dist/huds-lib/p-45c60364.entry.js +1 -0
- package/dist/huds-lib/p-4c56d8d7.entry.js +1 -0
- package/dist/huds-lib/{p-bf84b857.entry.js → p-557d5e62.entry.js} +1 -1
- package/dist/huds-lib/p-ac362729.entry.js +1 -0
- package/dist/types/components/navigation/menu/menu.d.ts +2 -1
- package/dist/types/components/person-profile/person-profile-listing/person-profile.listing.d.ts +14 -0
- package/dist/types/components/person-profile/person-profile.d.ts +12 -0
- package/dist/types/components/site-header/site-header.d.ts +1 -0
- package/dist/types/components.d.ts +51 -0
- package/package.json +1 -1
- package/dist/cjs/hy-accordion-container.cjs.entry.js +0 -29
- package/dist/cjs/hy-accordion-item.cjs.entry.js +0 -216
- package/dist/cjs/hy-tabs-item.cjs.entry.js +0 -20
- package/dist/cjs/hy-tabs.cjs.entry.js +0 -308
- package/dist/esm/hy-accordion-container.entry.js +0 -25
- package/dist/esm/hy-accordion-item.entry.js +0 -212
- package/dist/esm/hy-tabs-item.entry.js +0 -16
- package/dist/esm/hy-tabs.entry.js +0 -304
- package/dist/huds-lib/p-0a3ee940.entry.js +0 -1
- package/dist/huds-lib/p-63334950.entry.js +0 -1
- package/dist/huds-lib/p-8eb879d5.entry.js +0 -1
- package/dist/huds-lib/p-9c2f38a6.entry.js +0 -1
- package/dist/huds-lib/p-d4a8d85f.entry.js +0 -1
- package/dist/huds-lib/p-df368663.entry.js +0 -1
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-dd5e5023.js');
|
|
6
|
+
const utils = require('./utils-3692dcdb.js');
|
|
7
|
+
|
|
8
|
+
const accordionContainerCss = ":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}:host{display:block}.hy-accordion-container{width:100%}";
|
|
9
|
+
|
|
10
|
+
const AccordionContainer = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
}
|
|
14
|
+
/*
|
|
15
|
+
* data-allow-toggle
|
|
16
|
+
Allow for each toggle to both open and close individually
|
|
17
|
+
|
|
18
|
+
data-allow-multiple
|
|
19
|
+
Allow for multiple accordion sections to be expanded at the same time.
|
|
20
|
+
Assumes data-allow-toggle otherwise you would not be able to close any of the accordions
|
|
21
|
+
*/
|
|
22
|
+
render() {
|
|
23
|
+
const classAttributes = ['hy-accordion-container', 'js-hy-accordion'];
|
|
24
|
+
const id = this.accordionid.toLowerCase().replace(/\W/g, '-');
|
|
25
|
+
return (index.h(index.Host, null, index.h("div", { id: id, class: classAttributes.join(' '), "data-allow-multiple": "true", "data-allow-toggle": "true" }, index.h("slot", null)), index.h("hy-box", { mb: "1.75, 1.75, 2, 2.5" })));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
AccordionContainer.style = accordionContainerCss;
|
|
29
|
+
|
|
30
|
+
const accordionItemCss = ":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}:host{display:block}.hy-accordion__item{margin-bottom:12px}.hy-accordion__item__is-open{border:1px solid var(--grayscale-dark)}.hy-accordion__item__is-open .hy-accordion--heading{margin:0 auto}.hy-accordion__item__is-open .hy-accordion--heading .hy-accordion--heading__icon{-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}.hy-accordion__item.mini{margin-bottom:1rem;margin-top:1rem}.hy-accordion__item__is-open.mini{margin-bottom:0;margin-top:0}.hy-accordion__item__is-open.mini .hy-accordion__item--container{border-bottom:1px solid var(--grayscale-medium-dark);border-top:1px solid var(--grayscale-medium-dark);padding-top:16px;padding-bottom:32px;margin-top:-1px;-webkit-transition:padding 0.5s ease-in-out;transition:padding 0.5s ease-in-out}@media (min-width: 30rem){.hy-accordion__item__is-open.mini .hy-accordion__item--container{padding-top:28px;padding-bottom:30px}}@media (min-width: 60rem){.hy-accordion__item__is-open.mini .hy-accordion__item--container{padding-top:32px;padding-bottom:40px}}.hy-accordion__item.hy-accordion__item__is-open.mini{background-color:var(--grayscale-white);border:none;-webkit-box-shadow:0 -10px 10px -10px rgba(0, 49, 70, 0.05);box-shadow:0 -10px 10px -10px rgba(0, 49, 70, 0.05)}.hy-accordion--heading{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;letter-spacing:-0.69px;line-height:28px;margin:0 auto;-webkit-transition:all 0.25s ease-in-out;transition:all 0.25s ease-in-out;width:100%}.hy-accordion--heading .hy-accordion__link{text-decoration:none}.hy-accordion--heading .hy-accordion__link:hover{text-decoration:none}.hy-accordion--heading .hy-accordion__button{font-size:1.125rem;line-height:22px;font-weight:700;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;background-color:var(--grayscale-background-box);border:none;color:var(--brand-main-nearly-black);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;font-family:var(--main-font-family);height:100%;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;letter-spacing:-0.45px;padding:13px 20px 13px 16px;-webkit-transition:all 0.35s ease-in;transition:all 0.35s ease-in;width:100%}.hy-accordion--heading .hy-accordion__button:hover{cursor:pointer}@media (min-width: 30rem){.hy-accordion--heading .hy-accordion__button{padding:1rem 2rem 1rem 1.25rem}}@media (min-width: 1601px){.hy-accordion--heading .hy-accordion__button{font-size:1.25rem;line-height:24px;letter-spacing:-0.5px}}@media (min-width: 75.0625rem){.hy-accordion--heading .hy-accordion__button--large{font-size:1.25rem;line-height:24px;letter-spacing:-0.5px}}@media (min-width: 75.0625rem){.hy-accordion--heading .hy-accordion__button--large .hy-accordion--heading__icon svg{height:20px;width:20px}}.hy-accordion--heading .hy-accordion__button span{text-align:left}.hy-accordion--heading .hy-accordion__button[aria-expanded=true]{background:none;position:relative}.hy-accordion--heading .hy-accordion__button[aria-expanded=true]:after{background-color:var(--grayscale-medium-dark);bottom:0;content:\"\";height:1px;left:16px;position:absolute;right:20px}.hy-accordion--heading .hy-accordion__button *{pointer-events:none}.hy-accordion--heading .hy-accordion--heading__icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:22px;margin-right:8px;z-index:0}.hy-accordion--heading .hy-accordion--heading__icon svg{fill:var(--brand-main)}@media (min-width: 30rem){.hy-accordion--heading .hy-accordion--heading__icon svg{height:18px;width:18px}}@media (min-width: 1601px){.hy-accordion--heading .hy-accordion--heading__icon svg{height:20px;width:20px}}.hy-accordion--heading.mini .hy-accordion__button{font-size:1.125rem;line-height:22px;background-color:var(--grayscale-white);color:var(--link-blue);letter-spacing:-0.56px;padding:0}@media (min-width: 30rem){.hy-accordion--heading.mini .hy-accordion__button{font-size:1.375rem;line-height:28px;letter-spacing:-0.69px;padding:0}}.hy-accordion--heading.mini .hy-accordion__button[aria-expanded=true]{color:var(--grayscale-black);margin-bottom:20px}@media (min-width: 30rem){.hy-accordion--heading.mini .hy-accordion__button[aria-expanded=true]{margin-bottom:28px}}@media (min-width: 60rem){.hy-accordion--heading.mini .hy-accordion__button[aria-expanded=true]{margin-bottom:32px}}.hy-accordion--heading.mini .hy-accordion--heading__icon{margin-right:0.5rem;z-index:0}@media (min-width: 30rem){.hy-accordion--heading.mini .hy-accordion--heading__icon{margin-right:10px}}.hy-accordion--heading.mini .hy-accordion--heading__icon svg{fill:var(--brand-main-light);height:14px;width:14px}@media (min-width: 30rem){.hy-accordion--heading.mini .hy-accordion--heading__icon svg{height:16px;width:16px}}.hy-accordion__content{display:block;height:0;padding:0;overflow:hidden;-webkit-transition:all 0.25s ease-in-out;transition:all 0.25s ease-in-out}.hy-accordion__content--inner-wrapper{display:block;padding:16px 12px}@media (min-width: 30rem){.hy-accordion__content--inner-wrapper{padding:15px 16px}}@media (min-width: 60rem){.hy-accordion__content--inner-wrapper{padding:16px}}@media (min-width: 75.0625rem){.hy-accordion__content--inner-wrapper--large{padding:24px 20px}}@media (min-width: 1601px){.hy-accordion__content--inner-wrapper{padding:24px 20px}}.hy-accordion__content--inner-wrapper--mini{padding:0}.hy-accordion__content--inner-wrapper--mini .course-heading h4{padding-top:0 !important}";
|
|
31
|
+
|
|
32
|
+
let keys$1 = {
|
|
33
|
+
enter: 'Enter',
|
|
34
|
+
tab: 'Tab',
|
|
35
|
+
pageUp: 'PageUp',
|
|
36
|
+
pageDown: 'PageDown',
|
|
37
|
+
arrowUp: 'ArrowUp',
|
|
38
|
+
arrowDown: 'ArrowDown',
|
|
39
|
+
home: 'Home',
|
|
40
|
+
end: 'End', //35
|
|
41
|
+
};
|
|
42
|
+
const AccordionItem = class {
|
|
43
|
+
constructor(hostRef) {
|
|
44
|
+
index.registerInstance(this, hostRef);
|
|
45
|
+
this.variant = utils.AccordionVariants.default;
|
|
46
|
+
this.headerstyle = 'common';
|
|
47
|
+
this.showOpen = false;
|
|
48
|
+
this.ready = false;
|
|
49
|
+
}
|
|
50
|
+
componentDidLoad() {
|
|
51
|
+
this.ready = true;
|
|
52
|
+
let hyMainDiv = this.el.closest('.hy-main');
|
|
53
|
+
if (hyMainDiv) {
|
|
54
|
+
if (!hyMainDiv.classList.contains('with-sidebar')) {
|
|
55
|
+
this.headerstyle = 'large';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
componentDidRender() {
|
|
60
|
+
if (window.location.hash) {
|
|
61
|
+
this.expandPanelByAnchor(window.location.hash);
|
|
62
|
+
}
|
|
63
|
+
document.querySelectorAll('.hy-accordion__content').forEach(function (accordion) {
|
|
64
|
+
let showOpen = accordion.classList.contains('open');
|
|
65
|
+
let element = accordion;
|
|
66
|
+
if (showOpen) {
|
|
67
|
+
element.style.display = 'block';
|
|
68
|
+
element.style.height = element.scrollHeight + 'px';
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
element.style.height = 0 + 'px';
|
|
72
|
+
element.style.display = 'none';
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
onHashChange() {
|
|
77
|
+
if (window.location.hash) {
|
|
78
|
+
this.expandPanelByAnchor(window.location.hash);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
handleKeyDown(event) {
|
|
82
|
+
const containerId = this.el.parentElement.id;
|
|
83
|
+
let accordion = document.querySelectorAll(`#${containerId}`)[0];
|
|
84
|
+
const triggers = Array.prototype.slice.call(accordion.querySelectorAll('.hy-accordion__button'));
|
|
85
|
+
let target = event.target;
|
|
86
|
+
const key = event.code;
|
|
87
|
+
const ctrlModifier = event.ctrlKey && [keys$1.pageDown, keys$1.pageUp].includes(key); //key.match(/33|34/);
|
|
88
|
+
if (target.classList.contains('hy-accordion__button')) {
|
|
89
|
+
// Up/ Down arrow and Control + Page Up/ Page Down keyboard operations
|
|
90
|
+
if ([keys$1.arrowDown, keys$1.arrowUp].includes(key) || ctrlModifier) {
|
|
91
|
+
const index = triggers.indexOf(target);
|
|
92
|
+
const direction = [keys$1.arrowDown, keys$1.pageDown].includes(key) ? 1 : -1;
|
|
93
|
+
const length = triggers.length;
|
|
94
|
+
const newIndex = (index + length + direction) % length;
|
|
95
|
+
triggers[newIndex].focus();
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
}
|
|
98
|
+
else if ([keys$1.home, keys$1.end].includes(key)) {
|
|
99
|
+
switch (key) {
|
|
100
|
+
// Go to first accordion
|
|
101
|
+
case keys$1.home:
|
|
102
|
+
triggers[0].focus();
|
|
103
|
+
break;
|
|
104
|
+
// Go to last accordion
|
|
105
|
+
case keys$1.end:
|
|
106
|
+
triggers[triggers.length - 1].focus();
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
handleClick(event) {
|
|
114
|
+
const target = event.target;
|
|
115
|
+
const accordionContainer = this.el.parentElement;
|
|
116
|
+
const allowMultiple = accordionContainer.hasAttribute('data-allow-multiple');
|
|
117
|
+
const allowToggle = allowMultiple ? allowMultiple : accordionContainer.hasAttribute('data-allow-toggle');
|
|
118
|
+
if (target && target.tagName.toLowerCase() === 'button') {
|
|
119
|
+
let targetParent = target.closest('.hy-accordion__item');
|
|
120
|
+
let targetContent = targetParent.getElementsByClassName('hy-accordion__content')[0];
|
|
121
|
+
const isExpanded = target.getAttribute('aria-expanded') === 'true';
|
|
122
|
+
const activeButtonElement = accordionContainer.querySelector('[aria-expanded="true"]');
|
|
123
|
+
if (!allowMultiple && activeButtonElement && activeButtonElement !== target) {
|
|
124
|
+
activeButtonElement.setAttribute('aria-expanded', 'false');
|
|
125
|
+
this.collapseSection(targetContent);
|
|
126
|
+
if (targetParent.classList.contains('hy-accordion__item__is-open')) {
|
|
127
|
+
targetParent.classList.remove('hy-accordion__item__is-open');
|
|
128
|
+
}
|
|
129
|
+
accordionContainer
|
|
130
|
+
.querySelector(`#${activeButtonElement.getAttribute('aria-controls')}`)
|
|
131
|
+
.setAttribute('aria-hidden', 'true');
|
|
132
|
+
if (!allowToggle) {
|
|
133
|
+
activeButtonElement.removeAttribute('aria-disabled');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (!isExpanded) {
|
|
137
|
+
this.expandSection(targetContent);
|
|
138
|
+
target.setAttribute('aria-expanded', 'true');
|
|
139
|
+
targetParent.classList.add('hy-accordion__item__is-open');
|
|
140
|
+
accordionContainer
|
|
141
|
+
.querySelector(`#${target.getAttribute('aria-controls')}`)
|
|
142
|
+
.setAttribute('aria-hidden', 'false');
|
|
143
|
+
if (!allowToggle) {
|
|
144
|
+
target.setAttribute('aria-disabled', 'true');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (allowToggle && isExpanded) {
|
|
148
|
+
target.setAttribute('aria-expanded', 'false');
|
|
149
|
+
this.collapseSection(targetContent);
|
|
150
|
+
if (targetParent.classList.contains('hy-accordion__item__is-open')) {
|
|
151
|
+
targetParent.classList.remove('hy-accordion__item__is-open');
|
|
152
|
+
}
|
|
153
|
+
accordionContainer
|
|
154
|
+
.querySelector(`#${target.getAttribute('aria-controls')}`)
|
|
155
|
+
.setAttribute('aria-hidden', 'true');
|
|
156
|
+
}
|
|
157
|
+
event.preventDefault();
|
|
158
|
+
event.stopImmediatePropagation();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
expandPanelByAnchor(anchor) {
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
if (anchor.length > 0) {
|
|
164
|
+
anchor = anchor.substr(1);
|
|
165
|
+
let target = document.querySelectorAll(`[id=${anchor}]`)[0];
|
|
166
|
+
if (target && target.classList.contains('hy-accordion__button')) {
|
|
167
|
+
let targetParent = target.closest('.hy-accordion__item');
|
|
168
|
+
let targetContent = targetParent.querySelectorAll('.hy-accordion__content')[0];
|
|
169
|
+
this.expandSection(targetContent);
|
|
170
|
+
target.setAttribute('aria-expanded', 'true');
|
|
171
|
+
targetParent.classList.add('hy-accordion__item__is-open');
|
|
172
|
+
const targetElementRect = target.getBoundingClientRect();
|
|
173
|
+
window.scrollTo({ top: window.scrollY + targetElementRect.top - 200, behavior: 'smooth' });
|
|
174
|
+
const containerId = targetParent.parentElement.parentElement.id;
|
|
175
|
+
if (containerId.length > 0) {
|
|
176
|
+
let accordion = document.querySelectorAll(`#${containerId}`)[0];
|
|
177
|
+
accordion.querySelector(`#${target.getAttribute('aria-controls')}`).setAttribute('aria-hidden', 'false');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}, 200);
|
|
182
|
+
}
|
|
183
|
+
collapseSection(element) {
|
|
184
|
+
element.style.height = 0 + 'px';
|
|
185
|
+
element.setAttribute('data-collapsed', 'true');
|
|
186
|
+
setTimeout(() => {
|
|
187
|
+
element.style.display = 'none';
|
|
188
|
+
}, 250);
|
|
189
|
+
}
|
|
190
|
+
expandSection(element) {
|
|
191
|
+
element.style.display = 'block';
|
|
192
|
+
element.style.height = element.scrollHeight + 'px';
|
|
193
|
+
element.setAttribute('data-collapsed', 'false');
|
|
194
|
+
}
|
|
195
|
+
render() {
|
|
196
|
+
const containerId = this.el.parentElement.id;
|
|
197
|
+
if (this.ready && containerId.length > 0) {
|
|
198
|
+
document.querySelectorAll(`#${containerId}`).forEach(function (accordion) {
|
|
199
|
+
if (accordion) {
|
|
200
|
+
accordion.querySelectorAll('.hy-accordion__button').forEach(function (trigger) {
|
|
201
|
+
trigger.addEventListener('focus', function () {
|
|
202
|
+
trigger.classList.add('focus');
|
|
203
|
+
});
|
|
204
|
+
trigger.addEventListener('blur', function () {
|
|
205
|
+
trigger.classList.remove('focus');
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
const classIsOpen = this.showOpen ? 'hy-accordion__item__is-open' : '';
|
|
212
|
+
const classContentIsOpen = this.showOpen ? 'open' : '';
|
|
213
|
+
const classAttributes = ['hy-accordion__item', this.variant, classIsOpen].join(' ');
|
|
214
|
+
const classInnerWrapper = ['hy-accordion__item--container', this.variant].join(' ');
|
|
215
|
+
const classHeadingAttributes = ['hy-accordion--heading', this.variant].join(' ');
|
|
216
|
+
const classContentAttributes = [
|
|
217
|
+
'hy-accordion__content',
|
|
218
|
+
`hy-accordion__content--${this.variant}`,
|
|
219
|
+
this.variant,
|
|
220
|
+
classContentIsOpen,
|
|
221
|
+
].join(' ');
|
|
222
|
+
const classContentInnerWrapper = [
|
|
223
|
+
'hy-accordion__content--inner-wrapper',
|
|
224
|
+
`hy-accordion__content--inner-wrapper--${this.headerstyle}`,
|
|
225
|
+
`hy-accordion__content--inner-wrapper--${this.variant}`,
|
|
226
|
+
].join(' ');
|
|
227
|
+
const titleAsId = this.accordiontitle.toLowerCase().replace(/\W/g, '-');
|
|
228
|
+
const accordionItemHref = '#' + titleAsId + '--title';
|
|
229
|
+
const ariaExpanded = this.showOpen ? 'true' : 'false';
|
|
230
|
+
const ariaHidden = this.showOpen ? 'false' : 'true';
|
|
231
|
+
const dataCollapsed = this.showOpen ? 'false' : 'true';
|
|
232
|
+
return (index.h("div", { class: classAttributes }, index.h("div", { class: classInnerWrapper }, index.h("div", { class: classHeadingAttributes }, index.h("a", { href: accordionItemHref, class: "hy-accordion__link", tabindex: "-1" }, index.h("button", { "aria-expanded": ariaExpanded, "aria-controls": `${titleAsId}--content`, class: `hy-accordion__button hy-accordion__button--${this.headerstyle}`, id: `${titleAsId}--title` }, index.h("span", { class: "hy-accordion--heading__icon" }, index.h("hy-icon", { icon: 'hy-icon-caret-down', size: 16 })), index.h("span", null, this.accordiontitle)))), index.h("div", { "aria-labelledBy": `${titleAsId}--title`, class: classContentAttributes, id: `${titleAsId}--content`, role: "region", "aria-hidden": ariaHidden, "data-collapsed": dataCollapsed, style: { display: 'none' } }, index.h("div", { class: classContentInnerWrapper }, index.h("slot", null))))));
|
|
233
|
+
}
|
|
234
|
+
get el() { return index.getElement(this); }
|
|
235
|
+
};
|
|
236
|
+
AccordionItem.style = accordionItemCss;
|
|
237
|
+
|
|
238
|
+
const personProfileListingCss = ":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}.hy-person-profile-listing{font-family:var(--main-font-family);padding:0;margin:0;list-style:none;display:grid;gap:24px}@media (min-width: 48rem){.hy-person-profile-listing{gap:32px 24px}}@media (min-width: 120.0625rem){.hy-person-profile-listing.col-2{grid-template-columns:repeat(2, 50%)}}.hy-person-profile-listing.col-4{gap:32px 24px}@media (min-width: 48rem){.hy-person-profile-listing.col-4{grid-template-columns:repeat(2, 50%)}}@media (min-width: 60rem){.hy-person-profile-listing.col-4{grid-template-columns:repeat(3, calc(100% / 3))}}@media (min-width: 120.0625rem){.hy-person-profile-listing.col-4{grid-template-columns:repeat(4, 25%)}}.hy-person-profile-listing__label{font-size:0.9375rem;line-height:18px;font-weight:700;letter-spacing:-0.28px;color:var(--grayscale-black);margin:0 0 8px}@media (min-width: 48rem){.hy-person-profile-listing__label{font-size:1.0625rem;line-height:20px;letter-spacing:-0.32px}}.hy-person-profile-listing__items{margin:0;padding:0;list-style:none;display:grid;gap:8px}.is-inline .hy-person-profile-listing__items{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:0}.text-tight .hy-person-profile-listing__items{gap:0}.hy-person-profile-listing__item{font-size:0.9375rem;line-height:22px;font-weight:400;color:var(--grayscale-black);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}@media (min-width: 48rem){.hy-person-profile-listing__item{font-size:1.0625rem;line-height:26px}}.hy-person-profile-listing__item a{text-decoration:none;color:var(--link-blue)}.hy-person-profile-listing__item a:hover{text-decoration:underline}.hy-person-profile-listing__item hy-icon{display:none !important;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:28px;width:28px}@media (min-width: 48rem){.hy-person-profile-listing__item hy-icon{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}.without-icons .hy-person-profile-listing__item hy-icon{display:none !important}";
|
|
239
|
+
|
|
240
|
+
const PersonProfile = class {
|
|
241
|
+
constructor(hostRef) {
|
|
242
|
+
index.registerInstance(this, hostRef);
|
|
243
|
+
this.col = 'col-2';
|
|
244
|
+
}
|
|
245
|
+
render() {
|
|
246
|
+
return (index.h(index.Host, null, index.h("ul", { class: `hy-person-profile-listing ${this.col} ${this.inline ? 'is-inline' : ''} ${this.withoutIcons ? 'without-icons' : ''} ${this.textSpacingTight ? 'text-tight' : ''}` }, this.items.map(({ label, items }) => {
|
|
247
|
+
if (items.filter(({ label, url }) => label !== '' && url !== '').length > 0) {
|
|
248
|
+
return (index.h("li", null, index.h("h3", { class: "hy-person-profile-listing__label" }, label), index.h("ul", { class: "hy-person-profile-listing__items" }, items.map(({ label, url }, index$1) => {
|
|
249
|
+
if (url) {
|
|
250
|
+
return (index.h("li", { class: "hy-person-profile-listing__item" }, index.h("a", { href: url }, index$1 !== 0 && index.h("hy-icon", { icon: 'hy-icon-caret-right', size: 10 }), index.h("span", null, label))));
|
|
251
|
+
}
|
|
252
|
+
return (index.h("li", { class: "hy-person-profile-listing__item" }, index$1 !== 0 && index.h("hy-icon", { icon: 'hy-icon-caret-right', size: 10 }), index.h("span", null, label)));
|
|
253
|
+
}))));
|
|
254
|
+
}
|
|
255
|
+
}))));
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
PersonProfile.style = personProfileListingCss;
|
|
259
|
+
|
|
260
|
+
const hyTabsCss = ":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}:host{display:block}.hy-tabs__container .hy-tablist-container{border-bottom:1px solid var(--grayscale-tabs-border);position:relative}.hy-tabs__container .hy-tab-scroll{background-color:rgba(255, 255, 255, 0.8);border:0;height:100%;margin:0;padding:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);z-index:4}.hy-tabs__container .hy-tab-scroll.is-hidden{display:none;visibility:hidden}.hy-tabs__container .hy-tab-scroll.is-disabled{background-color:var(--grayscale-medium)}.hy-tabs__container .hy-tab-scroll.is-disabled:hover{cursor:none}.hy-tabs__container .hy-tab-scroll:focus,.hy-tabs__container .hy-tab-scroll:hover{outline:none;cursor:pointer}.hy-tabs__container .hy-tab-scroll span{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--grayscale-black);border-radius:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:32px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:32px}.hy-tabs__container .hy-tab-scroll span svg{fill:var(--grayscale-white);height:16px;width:16px}.hy-tabs__container .hy-tab-scroll__left{left:0;padding-right:8px}.hy-tabs__container .hy-tab-scroll__left svg{-webkit-transform:translateX(-1px);transform:translateX(-1px)}.hy-tabs__container .hy-tab-scroll__right{padding-left:8px;right:0}.hy-tabs__container .hy-tab-scroll__right svg{-webkit-transform:translateX(1px);transform:translateX(1px)}.hy-tabs__container [role=tablist]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;margin:0 0 -0.1em;overflow:scroll;position:relative;scrollbar-width:none;white-space:nowrap}.hy-tabs__container [role=tablist]::-webkit-scrollbar{display:none}.hy-tabs__container [role=tablist] a{display:-webkit-box;display:-ms-flexbox;display:flex;max-width:47.56%;text-decoration:none;-ms-flex-negative:0;flex-shrink:0}.hy-tabs__container [role=tablist] a:not(:first-of-type){margin-left:6px}@media (min-width: 30rem){.hy-tabs__container [role=tablist] a{max-width:35.37%}}@media (min-width: 60rem){.hy-tabs__container [role=tablist] a{max-width:23.13%}}@media (min-width: 75.0625rem){.hy-tabs__container [role=tablist] a{max-width:23.03%}}.hy-tabs__container [role=tab]{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;background-color:transparent;border:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:6px;padding:0}.hy-tabs__container [role=tab]>span{font-size:0.875rem;line-height:14px;font-weight:700;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--grayscale-background-box);border:0;color:var(--link-blue);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--main-font-family);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;letter-spacing:-0.5px;padding:8px 8px 7px;pointer-events:none;position:relative;text-align:left;white-space:normal;word-break:break-word;overflow-wrap:break-word;overflow-wrap:break-word}@media (min-width: 30rem){.hy-tabs__container [role=tab]>span{font-size:1rem;line-height:18px;padding:16px 12px 10px}}@media (min-width: 75.0625rem){.hy-tabs__container [role=tab]>span{font-size:1.125rem;line-height:20px;letter-spacing:-0.6px;padding:16px 16px 14px}}@supports (overflow-wrap: anywhere){.hy-tabs__container [role=tab]>span{overflow-wrap:anywhere}}@supports (overflow-wrap: anywhere){.hy-tabs__container [role=tab]>span{overflow-wrap:anywhere}}@media (min-width: 75.0625rem){.hy-tabs__container [role=tab].large{margin:0 12px 0 0}}.hy-tabs__container [role=tab][aria-selected=true]{border-bottom-width:0;border:1px solid var(--grayscale-dark);margin-bottom:0;z-index:3}.hy-tabs__container [role=tab][aria-selected=true]>span{background-color:var(--grayscale-white);color:var(--grayscale-black);padding-bottom:13px}@media (min-width: 30rem){.hy-tabs__container [role=tab][aria-selected=true]>span{padding-bottom:16px}}@media (min-width: 75.0625rem){.hy-tabs__container [role=tab][aria-selected=true]>span{padding-bottom:20px}}.hy-tabs__container [role=tab][aria-selected=true]>span:before{background-color:var(--grayscale-white);bottom:0;content:\"\";height:4px;left:0;position:absolute;right:0;-webkit-transform:translateY(50%);transform:translateY(50%)}.hy-tabs__container [role=tab][aria-selected=true]>span:after{background-color:var(--grayscale-black);bottom:0;content:\"\";height:4px;left:8px;position:absolute;right:8px}.hy-tabs__container [role=tab]:hover{border-radius:0;color:inherit;cursor:pointer;text-decoration:none}.hy-tabs__container [role=tab]:hover span{background-color:var(--hover-gray);color:var(--brand-main-active)}.hy-tabs__container [role=tabpanel]{border:1px solid var(--grayscale-dark);padding:28px 12px;position:relative;z-index:2}@media (min-width: 30rem){.hy-tabs__container [role=tabpanel]{padding:38px 15px}}@media (min-width: 60rem){.hy-tabs__container [role=tabpanel]{padding:40px 20px}}.hy-tabs__container [role=tabpanel]:focus{outline:0}";
|
|
261
|
+
|
|
262
|
+
// For easy reference
|
|
263
|
+
let keys = {
|
|
264
|
+
end: 35,
|
|
265
|
+
home: 36,
|
|
266
|
+
left: 37,
|
|
267
|
+
up: 38,
|
|
268
|
+
right: 39,
|
|
269
|
+
down: 40,
|
|
270
|
+
delete: 46,
|
|
271
|
+
};
|
|
272
|
+
// Add or substract depending on key pressed
|
|
273
|
+
let direction = {
|
|
274
|
+
37: -1,
|
|
275
|
+
38: -1,
|
|
276
|
+
39: 1,
|
|
277
|
+
40: 1,
|
|
278
|
+
};
|
|
279
|
+
let checkTimeout;
|
|
280
|
+
let focusTimeout;
|
|
281
|
+
let scrollTimeout;
|
|
282
|
+
const HyTabs = class {
|
|
283
|
+
constructor(hostRef) {
|
|
284
|
+
index.registerInstance(this, hostRef);
|
|
285
|
+
this.tabListLabel = '';
|
|
286
|
+
this.focusTimeoutCleared = true;
|
|
287
|
+
this.headerstyle = 'common';
|
|
288
|
+
}
|
|
289
|
+
componentWillLoad() {
|
|
290
|
+
const tabItems = this.el.querySelectorAll('hy-tabs-item');
|
|
291
|
+
if (tabItems) {
|
|
292
|
+
this.tabButtonTitles = Array.from(tabItems).map((panel) => {
|
|
293
|
+
return {
|
|
294
|
+
title: panel.getAttribute('tab-title'),
|
|
295
|
+
id: panel.getAttribute('tab-title').toLowerCase().replace(/\W/g, '-'),
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
componentDidLoad() {
|
|
301
|
+
let hyMainDiv = this.el.closest('.hy-main');
|
|
302
|
+
if (hyMainDiv) {
|
|
303
|
+
if (!hyMainDiv.classList.contains('with-sidebar')) {
|
|
304
|
+
this.headerstyle = 'large';
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const tabContainer = this.el.querySelector('.hy-tabs__container');
|
|
308
|
+
if (tabContainer) {
|
|
309
|
+
this.generateArrays(tabContainer);
|
|
310
|
+
const leftButton = this.el.querySelectorAll('.hy-tab-scroll__left')[0];
|
|
311
|
+
const rightButton = this.el.querySelectorAll('.hy-tab-scroll__right')[0];
|
|
312
|
+
const tabList = this.tabList;
|
|
313
|
+
this.checkScrollHidden(tabList, leftButton, rightButton);
|
|
314
|
+
tabList.addEventListener('scroll', () => {
|
|
315
|
+
scrollTimeout = setTimeout(() => {
|
|
316
|
+
window.clearTimeout(scrollTimeout);
|
|
317
|
+
this.checkScrollHidden(tabList, leftButton, rightButton);
|
|
318
|
+
}, 250);
|
|
319
|
+
}, false);
|
|
320
|
+
if (tabList.offSetWidth <= document.body.scrollWidth) {
|
|
321
|
+
leftButton.classList.add('is-hidden');
|
|
322
|
+
rightButton.classList.add('is-hidden');
|
|
323
|
+
}
|
|
324
|
+
const oneTabWidth = 250;
|
|
325
|
+
rightButton.addEventListener('click', (e) => {
|
|
326
|
+
e.preventDefault();
|
|
327
|
+
rightButton.classList.add('is-disabled');
|
|
328
|
+
tabList.scrollBy({
|
|
329
|
+
top: 0,
|
|
330
|
+
left: +oneTabWidth,
|
|
331
|
+
behavior: 'smooth',
|
|
332
|
+
});
|
|
333
|
+
checkTimeout = window.setTimeout(() => {
|
|
334
|
+
window.clearTimeout(checkTimeout);
|
|
335
|
+
this.checkScrollHidden(tabList, leftButton, rightButton);
|
|
336
|
+
rightButton.classList.remove('is-disabled');
|
|
337
|
+
}, 250);
|
|
338
|
+
});
|
|
339
|
+
leftButton.addEventListener('click', (e) => {
|
|
340
|
+
e.preventDefault();
|
|
341
|
+
leftButton.classList.add('is-disabled');
|
|
342
|
+
tabList.scrollBy({
|
|
343
|
+
top: 0,
|
|
344
|
+
left: -oneTabWidth,
|
|
345
|
+
behavior: 'smooth',
|
|
346
|
+
});
|
|
347
|
+
checkTimeout = window.setTimeout(() => {
|
|
348
|
+
window.clearTimeout(checkTimeout);
|
|
349
|
+
this.checkScrollHidden(tabList, leftButton, rightButton);
|
|
350
|
+
leftButton.classList.remove('is-disabled');
|
|
351
|
+
}, 250);
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
generateArrays(tc) {
|
|
356
|
+
this.tabList = tc.querySelectorAll('[role="tablist"]')[0];
|
|
357
|
+
this.tabButtons = tc.querySelectorAll('[role="tab"]');
|
|
358
|
+
this.tabPanelsState = [tc.querySelectorAll('[role="tabpanel"]')];
|
|
359
|
+
if (this.tabButtons.length > 0) {
|
|
360
|
+
this.addListeners(this.tabButtons, 1);
|
|
361
|
+
this.activateTab(this.tabButtons[0], true);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
addListeners(tabs, index) {
|
|
365
|
+
if (tabs.length > 1) {
|
|
366
|
+
for (let i = 0; i < tabs.length; ++i) {
|
|
367
|
+
tabs[index].addEventListener('click', this.clickEventListener);
|
|
368
|
+
tabs[index].addEventListener('keydown', this.keydownEventListener);
|
|
369
|
+
//tabs[index].addEventListener('keyup', this.keyupEventListener);
|
|
370
|
+
tabs[index].index = index;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
checkScrollHidden(tablist, leftButton, rightButton) {
|
|
375
|
+
if (tablist.scrollLeft === 0) {
|
|
376
|
+
leftButton.classList.add('is-hidden');
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
leftButton.classList.remove('is-hidden');
|
|
380
|
+
}
|
|
381
|
+
if (tablist.scrollLeft + tablist.clientWidth >= tablist.scrollWidth - 1) {
|
|
382
|
+
rightButton.classList.add('is-hidden');
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
rightButton.classList.remove('is-hidden');
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
// When a tab is clicked, activateTab is fired to activate it
|
|
389
|
+
clickEventListener(event) {
|
|
390
|
+
if (event) {
|
|
391
|
+
const target = event.target;
|
|
392
|
+
const tabs = this.tabButtonTitles;
|
|
393
|
+
if (tabs) {
|
|
394
|
+
tabs.forEach((tab) => {
|
|
395
|
+
const id = Object.values(tab)[1];
|
|
396
|
+
if (id === target.id) {
|
|
397
|
+
this.activateTab(target, true);
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
event.stopPropagation();
|
|
401
|
+
event.stopImmediatePropagation();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
keydownEventListener(event) {
|
|
406
|
+
const key = event.keyCode;
|
|
407
|
+
const tabs = this.tabButtonTitles;
|
|
408
|
+
switch (key) {
|
|
409
|
+
case keys.end:
|
|
410
|
+
event.preventDefault();
|
|
411
|
+
// Activate last tab
|
|
412
|
+
this.activateTab(tabs[tabs.length - 1], true);
|
|
413
|
+
break;
|
|
414
|
+
case keys.home:
|
|
415
|
+
event.preventDefault();
|
|
416
|
+
// Activate first tab
|
|
417
|
+
this.activateTab(tabs[0], true);
|
|
418
|
+
break;
|
|
419
|
+
// Up and down are in keydown
|
|
420
|
+
// because we need to prevent page scroll >:)
|
|
421
|
+
case keys.up:
|
|
422
|
+
case keys.down:
|
|
423
|
+
if (this.focusTimeoutCleared) {
|
|
424
|
+
this.determineOrientation(event);
|
|
425
|
+
}
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
keyupEventListener(event) {
|
|
430
|
+
const key = event.keyCode;
|
|
431
|
+
switch (key) {
|
|
432
|
+
case keys.left:
|
|
433
|
+
case keys.right:
|
|
434
|
+
event.preventDefault();
|
|
435
|
+
if (this.focusTimeoutCleared) {
|
|
436
|
+
this.determineOrientation(event);
|
|
437
|
+
}
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
event.stopPropagation();
|
|
441
|
+
event.stopImmediatePropagation();
|
|
442
|
+
}
|
|
443
|
+
determineOrientation(event) {
|
|
444
|
+
const leftButton = this.el.querySelectorAll('.hy-tab-scroll__left')[0];
|
|
445
|
+
const rightButton = this.el.querySelectorAll('.hy-tab-scroll__right')[0];
|
|
446
|
+
const tabList = this.tabList;
|
|
447
|
+
this.checkScrollHidden(tabList, leftButton, rightButton);
|
|
448
|
+
const key = event.keyCode;
|
|
449
|
+
const vertical = tabList.getAttribute('aria-orientation') == 'vertical';
|
|
450
|
+
let proceed = false;
|
|
451
|
+
if (vertical) {
|
|
452
|
+
if (key === keys.up || key === keys.down) {
|
|
453
|
+
event.preventDefault();
|
|
454
|
+
proceed = true;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
if (key === keys.left || key === keys.right) {
|
|
459
|
+
proceed = true;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (proceed) {
|
|
463
|
+
this.switchTabOnArrowPress(event);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
switchTabOnArrowPress(event) {
|
|
467
|
+
const pressed = event.keyCode;
|
|
468
|
+
if (direction[pressed]) {
|
|
469
|
+
const target = event.target;
|
|
470
|
+
const tabs = this.tabButtons;
|
|
471
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
472
|
+
if (tabs[i].id === target.id) {
|
|
473
|
+
if (i > 0) {
|
|
474
|
+
if (direction[pressed] === -1) {
|
|
475
|
+
tabs[i - 1].focus();
|
|
476
|
+
this.focusEventHandler(tabs[i - 1]);
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
if (i < tabs.length - 1) {
|
|
481
|
+
if (direction[pressed] === 1) {
|
|
482
|
+
tabs[i + 1].focus();
|
|
483
|
+
this.focusEventHandler(tabs[i + 1]);
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
// Activates any given tab panel
|
|
492
|
+
activateTab(tab, setFocus) {
|
|
493
|
+
setFocus = setFocus || true;
|
|
494
|
+
// Deactivate all other tabs
|
|
495
|
+
this.deactivateTabs(this.tabButtons);
|
|
496
|
+
// Remove tabindex attribute
|
|
497
|
+
tab.removeAttribute('tabindex');
|
|
498
|
+
tab.setAttribute('aria-selected', 'true');
|
|
499
|
+
const controls = tab.getAttribute('aria-controls');
|
|
500
|
+
this.el.querySelector(`#${controls}`).removeAttribute('hidden');
|
|
501
|
+
if (setFocus) {
|
|
502
|
+
tab.focus();
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
// Deactivate all tabs and tab panels
|
|
506
|
+
deactivateTabs(tabs) {
|
|
507
|
+
for (let t = 0; t < tabs.length; t++) {
|
|
508
|
+
tabs[t].setAttribute('tabindex', '-1');
|
|
509
|
+
tabs[t].setAttribute('aria-selected', 'false');
|
|
510
|
+
tabs[t].removeEventListener('focus', this.focusEventHandler);
|
|
511
|
+
}
|
|
512
|
+
const panels = this.tabPanelsState[0];
|
|
513
|
+
for (let p = 0; p < panels.length; p++) {
|
|
514
|
+
panels[p].setAttribute('hidden', 'hidden');
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
focusEventHandler(tab) {
|
|
518
|
+
const target = tab;
|
|
519
|
+
this.focusTimeoutCleared = false;
|
|
520
|
+
focusTimeout = window.setTimeout(() => {
|
|
521
|
+
window.clearTimeout(focusTimeout);
|
|
522
|
+
this.focusTimeoutCleared = true;
|
|
523
|
+
const focused = document.activeElement;
|
|
524
|
+
if (target === focused) {
|
|
525
|
+
this.activateTab(target, false);
|
|
526
|
+
}
|
|
527
|
+
}, 250);
|
|
528
|
+
}
|
|
529
|
+
render() {
|
|
530
|
+
const classComponentAttributes = ['hy-tabs__container', `hy-tabs__container__${this.headerstyle}`].join(' ');
|
|
531
|
+
const id = this.tabId.toLowerCase().replace(/\W/g, '-');
|
|
532
|
+
if (window.location.hash) {
|
|
533
|
+
const tabHash = window.location.hash.substring(1);
|
|
534
|
+
const isUrlHashed = this.tabButtonTitles.some((tab) => tab['id'] === tabHash);
|
|
535
|
+
if (isUrlHashed) {
|
|
536
|
+
const hashElement = document.getElementById(tabHash);
|
|
537
|
+
if (hashElement) {
|
|
538
|
+
this.activateTab(hashElement, true);
|
|
539
|
+
const hashElementRect = hashElement.getBoundingClientRect();
|
|
540
|
+
window.scrollTo({ top: window.scrollY + hashElementRect.top - 200, behavior: 'smooth' });
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return [
|
|
545
|
+
index.h("hy-box", { pt: "1.25, 1.25, 1.5, 2.5" }),
|
|
546
|
+
index.h("div", { id: id, class: classComponentAttributes }, index.h("div", { class: "hy-tablist-container" }, index.h("button", { tabindex: "-1", class: "hy-tab-scroll hy-tab-scroll__left is-hidden", "aria-hidden": "true" }, index.h("span", null, index.h("hy-icon", { icon: 'hy-icon-caret-left', size: 16 }))), index.h("div", { role: "tablist", "aria-label": this.tabListLabel }, this.tabButtonTitles &&
|
|
547
|
+
this.tabButtonTitles.map((item) => {
|
|
548
|
+
const title = Object.values(item)[0];
|
|
549
|
+
const id = title.toLowerCase().replace(/\W/g, '-');
|
|
550
|
+
const titleAsId = title.toLowerCase().replace(/\W/g, '-');
|
|
551
|
+
const tabItemHref = '#' + titleAsId;
|
|
552
|
+
return (index.h("a", { href: tabItemHref, tabindex: "-1" }, index.h("button", { "aria-selected": "false", "aria-controls": `${id}-tab`, class: this.headerstyle, role: "tab", id: id }, index.h("span", null, title))));
|
|
553
|
+
})), index.h("button", { tabindex: "-1", class: "hy-tab-scroll hy-tab-scroll__right", "aria-hidden": "true" }, index.h("span", null, index.h("hy-icon", { icon: 'hy-icon-caret-right', size: 16 })))), index.h("slot", null)),
|
|
554
|
+
index.h("hy-box", { mb: "1.75, 1.75, 2, 2.5" }),
|
|
555
|
+
];
|
|
556
|
+
}
|
|
557
|
+
get el() { return index.getElement(this); }
|
|
558
|
+
};
|
|
559
|
+
HyTabs.style = hyTabsCss;
|
|
560
|
+
|
|
561
|
+
const hyTabsItemCss = ":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}:host{display:block}";
|
|
562
|
+
|
|
563
|
+
const HyTabsItem = class {
|
|
564
|
+
constructor(hostRef) {
|
|
565
|
+
index.registerInstance(this, hostRef);
|
|
566
|
+
}
|
|
567
|
+
render() {
|
|
568
|
+
const id = this.tabTitle.toLowerCase().replace(/\W/g, '-');
|
|
569
|
+
return (index.h("div", { tabindex: "0", role: "tabpanel", id: `${id}-tab`, "aria-labelledby": id, hidden: true }, index.h("slot", null)));
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
HyTabsItem.style = hyTabsItemCss;
|
|
573
|
+
|
|
574
|
+
exports.hy_accordion_container = AccordionContainer;
|
|
575
|
+
exports.hy_accordion_item = AccordionItem;
|
|
576
|
+
exports.hy_person_profile_listing = PersonProfile;
|
|
577
|
+
exports.hy_tabs = HyTabs;
|
|
578
|
+
exports.hy_tabs_item = HyTabsItem;
|
|
@@ -88,23 +88,4 @@ const MenuLanguage = class {
|
|
|
88
88
|
};
|
|
89
89
|
MenuLanguage.style = menuLanguageCss;
|
|
90
90
|
|
|
91
|
-
const menuMobileBreadcrumbCss = ":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}.hy-menu-mobile-breadcrumb{font-size:0.9375rem;line-height:22px;font-weight:400;color:var(--brand-main-light);-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;border:0 none;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-family:var(--main-font-family);text-decoration:none;padding:11px 0;text-align:left}.hy-menu-mobile-breadcrumb:focus{outline:solid 2px var(--additional-yellow);outline-offset:2px}.hy-menu-mobile-breadcrumb hy-icon{margin-right:8px}.hy-menu-mobile-breadcrumb hy-icon svg{fill:var(--grayscale-black)}";
|
|
92
|
-
|
|
93
|
-
const MenuMobileBreadcrumb = class {
|
|
94
|
-
constructor(hostRef) {
|
|
95
|
-
index.registerInstance(this, hostRef);
|
|
96
|
-
this.removeBreadcrumb = index.createEvent(this, "removeBreadcrumb", 7);
|
|
97
|
-
this.isFirst = false;
|
|
98
|
-
}
|
|
99
|
-
// Listener for a click. The current breadcrumb will be remove from the list.
|
|
100
|
-
handleClick() {
|
|
101
|
-
this.removeBreadcrumb.emit({ bid: this.bid });
|
|
102
|
-
}
|
|
103
|
-
render() {
|
|
104
|
-
return this.isFirst ? (index.h("a", { "aria-label": `${this.labelBack}: ${this.labelFrontPage}`, class: 'hy-menu-mobile-breadcrumb', href: this.logoUrl }, index.h("span", { class: 'hy-menu-mobile-breadcrumb__label' }, this.label))) : (index.h("button", { "aria-label": `${this.labelBack}: ${this.label}`, class: 'hy-menu-mobile-breadcrumb', onClick: () => this.handleClick() }, index.h("hy-icon", { icon: 'hy-icon-caret-left', size: 10 }), index.h("span", { class: 'hy-menu-mobile-breadcrumb__label' }, this.label)));
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
MenuMobileBreadcrumb.style = menuMobileBreadcrumbCss;
|
|
108
|
-
|
|
109
91
|
exports.hy_menu_language = MenuLanguage;
|
|
110
|
-
exports.hy_menu_mobile_breadcrumb = MenuMobileBreadcrumb;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-dd5e5023.js');
|
|
6
|
+
|
|
7
|
+
const menuMobileBreadcrumbCss = ":root{--brand-main:#0e688b;--brand-main-soft:#b1e7ff;--brand-main-bright:#48c5f8;--brand-main-light:#107eab;--brand-main-active:#005379;--brand-main-dark:#003146;--brand-main-nearly-black:#000222;--link-blue:#0479a4;--link-disabled:#767676;--grayscale-white:#fff;--grayscale-slightly-gray:#fefefe;--grayscale-light:#f8f8f8;--grayscale-medium:#d2d2d2;--grayscale-background-box:#f5f5f5;--grayscale-tabs-border:#e6e6e6;--grayscale-background-arrow:#dfdfdf;--grayscale-medium-dark:#979797;--grayscale-dark:#555555;--grayscale-dark-text:#222222;--grayscale-black:#000000;--additional-red-light:#e5053a;--additional-red-dark:#a31621;--additional-purple-light:#420039;--additional-yellow:#f9a21a;--additional-skyblue:#48c5f8;--additional-orange:#d14600;--additional-green-light:#96ba3c;--additional-green-dark:#006400;--hover-gray:#eaeaea}*{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--gutter-mobile:16px;--gutter-narrow:24px;--gutter-medium:24px;--gutter-wide:24px;--gutter-extrawide:32px}:root{--breakpoint-extrawide:75.0625rem;--breakpoint-max-width:75.0625rem;--breakpoint-medium:48rem;--breakpoint-narrow:30rem;--breakpoint-wide:60rem}.hy-menu-mobile-breadcrumb{font-size:0.9375rem;line-height:22px;font-weight:400;color:var(--brand-main-light);-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;border:0 none;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-family:var(--main-font-family);text-decoration:none;padding:11px 0;text-align:left}.hy-menu-mobile-breadcrumb:focus{outline:solid 2px var(--additional-yellow);outline-offset:2px}.hy-menu-mobile-breadcrumb hy-icon{margin-right:8px}.hy-menu-mobile-breadcrumb hy-icon svg{fill:var(--grayscale-black)}";
|
|
8
|
+
|
|
9
|
+
const MenuMobileBreadcrumb = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.removeBreadcrumb = index.createEvent(this, "removeBreadcrumb", 7);
|
|
13
|
+
this.isFirst = false;
|
|
14
|
+
}
|
|
15
|
+
// Listener for a click. The current breadcrumb will be remove from the list.
|
|
16
|
+
handleClick() {
|
|
17
|
+
this.removeBreadcrumb.emit({ bid: this.bid });
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return this.isFirst ? (index.h("a", { "aria-label": `${this.labelBack}: ${this.labelFrontPage}`, class: 'hy-menu-mobile-breadcrumb', href: this.logoUrl }, index.h("span", { class: 'hy-menu-mobile-breadcrumb__label' }, this.label))) : (index.h("button", { "aria-label": `${this.labelBack}: ${this.label}`, class: 'hy-menu-mobile-breadcrumb', onClick: () => this.handleClick() }, index.h("hy-icon", { icon: 'hy-icon-caret-left', size: 10 }), index.h("span", { class: 'hy-menu-mobile-breadcrumb__label' }, this.label)));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
MenuMobileBreadcrumb.style = menuMobileBreadcrumbCss;
|
|
24
|
+
|
|
25
|
+
exports.hy_menu_mobile_breadcrumb = MenuMobileBreadcrumb;
|