@aarhus-university/au-designsystem-delphinus 0.26.7 → 0.28.0
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/CHANGELOG.md +30 -0
- package/build/figma-tokens/breakpoint-styles.json +10 -0
- package/build/figma-tokens/color-themes.json +4 -0
- package/build/figma-tokens/design-file.json +24 -0
- package/build/figma-tokens/design-system.json +24 -0
- package/build/js/app.js +1 -1
- package/build/js/app.js.map +1 -1
- package/build/js/components/modal-view.ts +4 -2
- package/build/js/components/nav.ts +42 -12
- package/build/js/components/selection-list.ts +19 -5
- package/build/js/components/toolbar.ts +10 -2
- package/build/projects/bachelor-applications/js/app.js +1 -1
- package/build/projects/bachelor-applications/js/app.js.map +1 -1
- package/build/projects/bachelor-applications/style.css +1 -1
- package/build/projects/bachelor-applications/style.css.map +1 -1
- package/build/projects/brightspace/style.css +1 -1
- package/build/projects/brightspace/style.css.map +1 -1
- package/build/projects/medarbejdere/js/app.js +1 -1
- package/build/projects/medarbejdere/js/app.js.map +1 -1
- package/build/projects/medarbejdere/style.css +1 -1
- package/build/projects/medarbejdere/style.css.map +1 -1
- package/build/projects/mitstudie/js/app.js +1 -1
- package/build/projects/mitstudie/js/app.js.map +1 -1
- package/build/projects/mitstudie/style.css +1 -1
- package/build/projects/mitstudie/style.css.map +1 -1
- package/build/projects/typo3/style.css +1 -1
- package/build/projects/typo3/style.css.map +1 -1
- package/build/style.css +1 -1
- package/build/style.css.map +1 -1
- package/package.json +4 -3
- package/source/atoms/_atoms-settings.scss +3 -0
- package/source/atoms/spacing/_spacing.scss +23 -13
- package/source/figma-tokens/borders-widths.json +4 -0
- package/source/figma-tokens/cssvars/figma-tokens.scss +3 -0
- package/source/figma-tokens/sizes-default.json +5 -0
- package/source/figma-tokens/spacing.json +5 -0
- package/source/figma-tokens/styles/breakpoint.json +5 -0
- package/source/js/components/nav.ts +4 -4
- package/source/js/components/selection-list.ts +2 -2
- package/source/markup/sample-text.pug +6 -22
- package/source/markup/spacings.pug +1 -3
- package/source/projects/mitstudie/style/_timeline.scss +2 -2
- package/source/projects/mitstudie/style/_timetable-event-modal.scss +2 -2
- package/source/projects/mitstudie/timeline.pug +2 -0
- package/source/style/_sass-variables.scss +10 -2
- package/source/style/layout/_horizontal-scroll.scss +3 -3
- package/source/style/layout/_page.scss +1 -1
- package/source/style/module/_modal-view.scss +15 -11
- package/source/style/module/_nav.scss +4 -4
- package/source/style/module/_toast-notification.scss +9 -7
- package/source/style/module-demo/_demo.scss +14 -12
- package/tsconfig.json +5 -1
- package/types/common/interfaces.d.ts +0 -10
- package/types/common/main.d.ts +0 -3
- package/types/common/package.json +0 -5
- package/types/common/payloads.d.ts +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,36 @@
|
|
|
1
|
+
## 0.28.0 (June 24, 2022)
|
|
2
|
+
|
|
3
|
+
### Core Delphinus Updates
|
|
4
|
+
* Moved type definitions to seperate npm project.
|
|
5
|
+
|
|
6
|
+
### Delphinus Projects Updates
|
|
7
|
+
None
|
|
8
|
+
|
|
9
|
+
## 0.27.0 (June 23, 2022)
|
|
10
|
+
|
|
11
|
+
### Core Delphinus Updates
|
|
12
|
+
* Tweaked vertical page margins in narrow viewport. Now, mobile has a bit more room horizontally. NOTE: If your design uses things that "pop" over the pages margins, please check, that there is still room for that after updating.
|
|
13
|
+
|
|
14
|
+
### Delphinus Projects Updates
|
|
15
|
+
None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 0.26.8 (June 21, 2022)
|
|
19
|
+
|
|
20
|
+
### Core Delphinus Updates
|
|
21
|
+
* Correct typing of events i navigational scripts.
|
|
22
|
+
### Delphinus Projects Updates
|
|
23
|
+
None
|
|
24
|
+
|
|
25
|
+
|
|
1
26
|
## 0.26.7 (June 21, 2022)
|
|
2
27
|
|
|
3
28
|
### Core Delphinus Updates
|
|
4
29
|
* Return types on navigational functions for useEffect in React 18.
|
|
5
30
|
### Delphinus Projects Updates
|
|
6
31
|
None
|
|
32
|
+
|
|
33
|
+
|
|
7
34
|
## 0.26.6 (June 21, 2022)
|
|
8
35
|
|
|
9
36
|
### Core Delphinus Updates
|
|
@@ -11,6 +38,7 @@ None
|
|
|
11
38
|
### Delphinus Projects Updates
|
|
12
39
|
None
|
|
13
40
|
|
|
41
|
+
|
|
14
42
|
## 0.26.5 (June 20, 2022)
|
|
15
43
|
|
|
16
44
|
### Core Delphinus Updates
|
|
@@ -19,6 +47,7 @@ Fixes issue in navigation where the menu toogle would jump to bottom of the menu
|
|
|
19
47
|
### Delphinus Projects Updates
|
|
20
48
|
None
|
|
21
49
|
|
|
50
|
+
|
|
22
51
|
## 0.26.4 (June 7, 2022)
|
|
23
52
|
|
|
24
53
|
### Core Delphinus Updates
|
|
@@ -27,6 +56,7 @@ None
|
|
|
27
56
|
### Delphinus Projects Updates
|
|
28
57
|
* Removed box-shadow from `.roles-config__role__content`
|
|
29
58
|
|
|
59
|
+
|
|
30
60
|
## 0.26.3 (June 1, 2022)
|
|
31
61
|
|
|
32
62
|
### Core Delphinus Updates
|
|
@@ -811,6 +811,11 @@
|
|
|
811
811
|
"value": "76",
|
|
812
812
|
"description": "This is the largest size",
|
|
813
813
|
"type": "other"
|
|
814
|
+
},
|
|
815
|
+
"Side": {
|
|
816
|
+
"value": "34",
|
|
817
|
+
"description": "The size used for page vertical margins",
|
|
818
|
+
"type": "other"
|
|
814
819
|
}
|
|
815
820
|
}
|
|
816
821
|
},
|
|
@@ -906,6 +911,11 @@
|
|
|
906
911
|
"value": "121",
|
|
907
912
|
"description": "This is the largest size",
|
|
908
913
|
"type": "other"
|
|
914
|
+
},
|
|
915
|
+
"Side": {
|
|
916
|
+
"value": "46",
|
|
917
|
+
"description": "The size used for page vertical margins",
|
|
918
|
+
"type": "other"
|
|
909
919
|
}
|
|
910
920
|
}
|
|
911
921
|
}
|
|
@@ -91,6 +91,11 @@
|
|
|
91
91
|
"value": "57",
|
|
92
92
|
"description": "This is the largest size",
|
|
93
93
|
"type": "other"
|
|
94
|
+
},
|
|
95
|
+
"Side": {
|
|
96
|
+
"value": "20",
|
|
97
|
+
"description": "The spacing used for vertical page margins",
|
|
98
|
+
"type": "other"
|
|
94
99
|
}
|
|
95
100
|
},
|
|
96
101
|
"sizes": {
|
|
@@ -254,6 +259,11 @@
|
|
|
254
259
|
"value": "$spacingSizes.Plus2",
|
|
255
260
|
"description": "This is the largest whitespace",
|
|
256
261
|
"type": "spacing"
|
|
262
|
+
},
|
|
263
|
+
"Side": {
|
|
264
|
+
"value": "$spacingSizes.Side",
|
|
265
|
+
"description": "The whitespace used for vertical page margins",
|
|
266
|
+
"type": "spacing"
|
|
257
267
|
}
|
|
258
268
|
},
|
|
259
269
|
"otherSpacings": {
|
|
@@ -1248,6 +1258,10 @@
|
|
|
1248
1258
|
"Zero": {
|
|
1249
1259
|
"value": "$spacingSizes.Zero",
|
|
1250
1260
|
"type": "borderWidth"
|
|
1261
|
+
},
|
|
1262
|
+
"Side": {
|
|
1263
|
+
"value": "$spacingSizes.Side",
|
|
1264
|
+
"type": "borderWidth"
|
|
1251
1265
|
}
|
|
1252
1266
|
}
|
|
1253
1267
|
},
|
|
@@ -1343,6 +1357,11 @@
|
|
|
1343
1357
|
"value": "76",
|
|
1344
1358
|
"description": "This is the largest size",
|
|
1345
1359
|
"type": "other"
|
|
1360
|
+
},
|
|
1361
|
+
"Side": {
|
|
1362
|
+
"value": "34",
|
|
1363
|
+
"description": "The size used for page vertical margins",
|
|
1364
|
+
"type": "other"
|
|
1346
1365
|
}
|
|
1347
1366
|
}
|
|
1348
1367
|
},
|
|
@@ -1438,6 +1457,11 @@
|
|
|
1438
1457
|
"value": "121",
|
|
1439
1458
|
"description": "This is the largest size",
|
|
1440
1459
|
"type": "other"
|
|
1460
|
+
},
|
|
1461
|
+
"Side": {
|
|
1462
|
+
"value": "46",
|
|
1463
|
+
"description": "The size used for page vertical margins",
|
|
1464
|
+
"type": "other"
|
|
1441
1465
|
}
|
|
1442
1466
|
}
|
|
1443
1467
|
}
|
|
@@ -491,6 +491,11 @@
|
|
|
491
491
|
"value": "57",
|
|
492
492
|
"description": "This is the largest size",
|
|
493
493
|
"type": "other"
|
|
494
|
+
},
|
|
495
|
+
"Side": {
|
|
496
|
+
"value": "20",
|
|
497
|
+
"description": "The spacing used for vertical page margins",
|
|
498
|
+
"type": "other"
|
|
494
499
|
}
|
|
495
500
|
},
|
|
496
501
|
"sizes": {
|
|
@@ -654,6 +659,11 @@
|
|
|
654
659
|
"value": "$spacingSizes.Plus2",
|
|
655
660
|
"description": "This is the largest whitespace",
|
|
656
661
|
"type": "spacing"
|
|
662
|
+
},
|
|
663
|
+
"Side": {
|
|
664
|
+
"value": "$spacingSizes.Side",
|
|
665
|
+
"description": "The whitespace used for vertical page margins",
|
|
666
|
+
"type": "spacing"
|
|
657
667
|
}
|
|
658
668
|
},
|
|
659
669
|
"otherSpacings": {
|
|
@@ -1780,6 +1790,10 @@
|
|
|
1780
1790
|
"Zero": {
|
|
1781
1791
|
"value": "$spacingSizes.Zero",
|
|
1782
1792
|
"type": "borderWidth"
|
|
1793
|
+
},
|
|
1794
|
+
"Side": {
|
|
1795
|
+
"value": "$spacingSizes.Side",
|
|
1796
|
+
"type": "borderWidth"
|
|
1783
1797
|
}
|
|
1784
1798
|
},
|
|
1785
1799
|
"Borders": {
|
|
@@ -4617,6 +4631,11 @@
|
|
|
4617
4631
|
"value": "76",
|
|
4618
4632
|
"description": "This is the largest size",
|
|
4619
4633
|
"type": "other"
|
|
4634
|
+
},
|
|
4635
|
+
"Side": {
|
|
4636
|
+
"value": "34",
|
|
4637
|
+
"description": "The size used for page vertical margins",
|
|
4638
|
+
"type": "other"
|
|
4620
4639
|
}
|
|
4621
4640
|
}
|
|
4622
4641
|
},
|
|
@@ -4712,6 +4731,11 @@
|
|
|
4712
4731
|
"value": "121",
|
|
4713
4732
|
"description": "This is the largest size",
|
|
4714
4733
|
"type": "other"
|
|
4734
|
+
},
|
|
4735
|
+
"Side": {
|
|
4736
|
+
"value": "46",
|
|
4737
|
+
"description": "The size used for page vertical margins",
|
|
4738
|
+
"type": "other"
|
|
4715
4739
|
}
|
|
4716
4740
|
}
|
|
4717
4741
|
}
|
package/build/js/app.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";n.r(t);const r=(e,t)=>{let n=!1;return e.composedPath().forEach(e=>{e.classList&&e.classList.contains(t)&&(n=!0)}),n},o=e=>{const t=e.parentElement;return t?t.classList.contains("nav")?t:o(t):e},a=(e,t=null)=>{e.forEach(e=>{const n=e.querySelector(".nav__toggle");e!==t&&(e.classList.contains("nav--toggled")&&(n.focus(),n.setAttribute("aria-expanded","false")),e.classList.remove("nav--toggled"))})},l=e=>{document.querySelectorAll(".nav__toggle").forEach(
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";n.r(t);const r=(e,t)=>{let n=!1;return e.composedPath().forEach(e=>{e.classList&&e.classList.contains(t)&&(n=!0)}),n},o=e=>{const t=e.parentElement;return t?t.classList.contains("nav")?t:o(t):e},a=(e,t=null)=>{e.forEach(e=>{const n=e.querySelector(".nav__toggle");e!==t&&(e.classList.contains("nav--toggled")&&(n.focus(),n.setAttribute("aria-expanded","false")),e.classList.remove("nav--toggled"))})},l=e=>{const t=[];return document.querySelectorAll(".nav__toggle").forEach(n=>{const r=()=>{const t=(e=>{const t=o(e),n=t.querySelector(".nav__items"),r=null==n?void 0:n.querySelector(".nav__item:last-of-type");null==n||n.classList.add("nav__items--fadeout");const a=null==n?void 0:n.querySelector(".nav__item");a&&a.focus();const l=()=>{t.classList.toggle("nav--toggled"),null==n||n.classList.remove("nav__items--fadeout"),null==r||r.removeEventListener("transitionend",l)};return null==r||r.addEventListener("transitionend",l),t})(n),r=n.getAttribute("aria-expanded");n.setAttribute("aria-expanded","false"===r?"true":"false"),a(e,t)};t.push({element:n,clickEvent:r}),n.addEventListener("click",r)}),t},i=(e,t)=>{var n;t.classList.remove("nav--toggled");const o=t.querySelector(".nav__items");if(o){const e=o.querySelectorAll(".nav__item"),n="nav__item--is-overflown",r="nav--has-overflow",a="nav__item--active";let l=!1;for(let o=e.length-1;o>=0;o-=1){const i=e[o];i.offsetTop>0?(i.classList.add(n),t.classList.add(r),l=!0):i.classList.contains(a)||i.classList.remove(n)}if(!l){t.classList.remove(r);const e=t.querySelector(`.${a}`);e&&e.classList.remove(n)}}const l=t=>{t.target.classList.contains("nav__toggle")||r(t,"nav__items")||a(e)};return null===(n=document.querySelector("body"))||void 0===n||n.addEventListener("click",l),{element:document.querySelector("body"),clickEvent:l}},c=e=>{const t=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)/(()=>parseInt(window.getComputedStyle(document.documentElement).fontSize.replace("px",""),10))(),n=(e=>e.contains("tabbed-content--hide-tabs-on-medium-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-medium").replace("rem",""),10):e.contains("tabbed-content--hide-tabs-on-wide-width")?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--bp-wide").replace("rem",""),10):-1)(e);return!(n>-1)||t<n},s=(e,t,n,r,o,a=!0,l=(e=>console.log(e)))=>{a&&r.focus(),r.removeAttribute("tabindex"),r.setAttribute("aria-selected","true"),r.classList.add("nav__item--active"),n&&(n.removeAttribute("aria-selected"),n.setAttribute("tabindex","-1"),n.classList.remove("nav__item--active"));const i=Array.prototype.indexOf.call(e,r);if(t[i].hidden=!1,n){t[Array.prototype.indexOf.call(e,n)].hidden=!0}r.dispatchEvent(new CustomEvent("switch-tab",{bubbles:!0,detail:{tab:i}})),l(i)};let d=0;const u=[],f=()=>{u.forEach((e,t)=>{const{rendered:n,domElement:r}=e;if(c(r.classList)){if(!n){const n=r.getAttribute("data-focus-onload"),o=r.getAttribute("data-initial-tab");((e,t,n=0,r=!0,o=(e=>console.log(e)))=>{const a=t.querySelector(".nav__items"),l=a.querySelectorAll("a"),i=[];t.querySelectorAll("section").forEach(e=>{e.parentNode===t&&i.push(e)});const c=t.querySelector("button.tabbed-content__expand-all");if(c){const e=()=>{a.hidden=!0,i.forEach(e=>{e.hidden=!1})};c.removeEventListener("click",e),c.addEventListener("click",e)}a.setAttribute("role","tablist"),l.forEach((n,r)=>{var c;n.setAttribute("role","tab"),n.setAttribute("id",`tab${e}_${r+1}`),n.setAttribute("tabindex","-1"),null===(c=n.parentElement)||void 0===c||c.setAttribute("role","presentation");const d=e=>{e.preventDefault();const n=a.querySelector("[aria-selected]");e.currentTarget!==n&&s(l,i,n,e.currentTarget,t.classList,!0,e=>{o(e)})};n.removeEventListener("click",d),n.addEventListener("click",d);const u=e=>{const n=Array.prototype.indexOf.call(l,e.currentTarget);let a=null;"ArrowLeft"===e.key&&(a=n-1),"ArrowRight"===e.key&&(a=n+1),"ArrowDown"===e.key&&(a="down"),null!==a&&(e.preventDefault(),"down"===a?i[r].focus():l[a]&&s(l,i,e.currentTarget,l[a],t.classList,!0,e=>{o(e)}))};n.removeEventListener("keydown",u),n.addEventListener("keydown",u)}),i.forEach((e,t)=>{e.setAttribute("tabindex","-1"),e.setAttribute("aria-labelledby",l[t].id),e.hidden=!0,e.setAttribute("role","tabpanel")}),n>-1&&s(l,i,null,l[n],t.classList,r)})(t,r,o?parseInt(o,10):0,"false"!==n),e.rendered=!0}}else n&&((e=>{const t=e.querySelector(".nav__items"),n=null==t?void 0:t.querySelectorAll("a"),r=[];e.querySelectorAll("section").forEach(t=>{t.parentNode===e&&r.push(t)}),null==n||n.forEach(e=>{e.removeAttribute("aria-selected"),e.classList.remove("nav__item--active")}),r.forEach(e=>{e.hidden=!1,e.removeAttribute("role")})})(r),e.rendered=!1)})};(e=>{"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)})(()=>{document.querySelectorAll(".tabbed-content").forEach(e=>u.push({domElement:e,rendered:!1})),f(),(()=>{const e=document.querySelector("body");if(e){const t=window.getComputedStyle(e).getPropertyValue("--color-background"),n=document.querySelector('meta[name="theme-color"]');if(n)n.content=t;else{const e=document.createElement("meta");e.name="theme-color",e.content=t,document.getElementsByTagName("head")[0].appendChild(e)}}})();const e=document.querySelectorAll(".nav:not(.nav--vertical)");e.forEach(t=>i(e,t)),l(e),document.querySelectorAll(".table--wrap-medium-width, .table--wrap-default-width").forEach(e=>(e=>{const t=e.querySelector("thead"),n=e.querySelector("tbody"),r=e.querySelector("tfoot");if(t){const e=[];t.querySelectorAll("th").forEach(t=>{t.classList.contains("table__cell--self-explanatory")?e.push(""):e.push(t.innerHTML)});const o=[];n&&o.push(n),r&&o.push(r),o.forEach(t=>{t.querySelectorAll("tr").forEach(t=>{t.querySelectorAll("td, th").forEach((t,n)=>{e[n]&&t.setAttribute("data-label",e[n])})})})}})(e)),document.querySelectorAll(".content-toggle__content").forEach(e=>{(e=>{var t;const n=(t,n,r)=>{if(n){r&&n.focus();const o=()=>{e.setAttribute("hidden","hidden"),t.removeAttribute("hidden"),t.setAttribute("aria-expanded","false"),t.focus()};n.removeEventListener("click",o),n.addEventListener("click",o)}},r=null==e?void 0:null===(t=e.parentElement)||void 0===t?void 0:t.querySelector(".content-toggle__toggle"),o=e.querySelector(".content-toggle__close");r&&(r.addEventListener("click",()=>{const t=r.getAttribute("aria-expanded");r.setAttribute("aria-expanded","false"===t?"true":"false"),"true"===t?e.setAttribute("hidden","hidden"):e.removeAttribute("hidden"),r.hasAttribute("aria-haspopup")&&(r.setAttribute("hidden","hidden"),n(r,o,!0))}),n(r,o,!1))})(e)}),window.addEventListener("load",()=>{d=window.innerWidth}),window.addEventListener("resize",()=>{d>0&&window.innerWidth!==d&&(d=window.innerWidth,e.forEach(t=>i(e,t)),f())})})}])}));
|
|
2
2
|
//# sourceMappingURL=app.js.map
|
package/build/js/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./source/js/components/helpers.ts","webpack:///./source/js/components/nav.ts","webpack:///./source/js/components/tabs.ts","webpack:///./source/js/production/app.ts","webpack:///./source/js/components/ready.ts","webpack:///./source/js/components/table.ts","webpack:///./source/js/components/content-toggle.ts"],"names":["root","factory","exports","module","define","amd","a","i","window","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isElementWithClassNameInEventPath","event","className","found","composedPath","forEach","classList","contains","findNav","element","parent","parentElement","closeResponsiveNav","navElements","keepOpen","button","querySelector","focus","setAttribute","remove","setResponsiveToggle","document","querySelectorAll","addEventListener","nav","navItems","lastNavItem","add","firstElement","transitionListener","toggle","removeEventListener","toggleMenu","ariaExpanded","getAttribute","setResponsiveNav","navElement","navItemsParent","isOverflownClass","hasOverflowClass","isActiveClass","hasOverflown","length","offsetTop","isActive","e","target","isBelowViewportLimit","widthInRem","Math","max","documentElement","clientWidth","innerWidth","parseInt","getComputedStyle","fontSize","replace","getBaseFontSize","mediaWidth","getPropertyValue","getMediaWidthBasedOnModifier","switchTab","tabs","panels","oldTab","newTab","_","callback","index","console","log","removeAttribute","Array","indexOf","hidden","dispatchEvent","CustomEvent","bubbles","detail","tab","windowInnerWidth","tabbedObjects","setTabs","tabObject","rendered","domElement","dataInitial","tabbed","initial","tablist","section","parentNode","push","expandAll","expandAllEvent","panel","tabClickEvent","preventDefault","currentTab","currentTarget","tabIndex","tabKeyEvent","dir","id","setTabbedContent","destroyTabs","fn","readyState","ready","body","bgColor","existingMeta","content","meta","createElement","getElementsByTagName","appendChild","setMetaThemeColor","table","head","foot","headers","h","innerHTML","rowContainers","rc","tr","cell","setResponsi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BAAiB,QAAS6G,KAIrCrH,EAASkG,aAAH,YAAGA,EAAStG,qBAAZ,aAAG,EAAwBK,cAAc,2BAC/CmH,EAAelB,EAAQjG,cAAc,0BAEvCD,IACFA,EAAOQ,iBAAiB,QAAS,KAC/B,MAAMU,EAAelB,EAAOmB,aAAa,iBACzCnB,EAAOG,aAAa,gBAAkC,UAAjBe,EAA2B,OAAS,SACpD,SAAjBA,EACFgF,EAAQ/F,aAAa,SAAU,UAE/B+F,EAAQzC,gBAAgB,UAGtBzD,EAAOsH,aAAa,mBACtBtH,EAAOG,aAAa,SAAU,UAC9BgH,EAAgBnH,EAAQoH,GAAc,MAI1CD,EAAgBnH,EAAQoH,GAAc,KHctCG,CAAiBxG,KAGnBjE,OAAO0D,iBAAiB,OAAQ,KAC9B0D,EAAmBpH,OAAOwF,aAG5BxF,OAAO0D,iBAAiB,SAAU,KAC5B0D,EAAmB,GAAKpH,OAAOwF,aAAe4B,IAChDA,EAAmBpH,OAAOwF,WAC1BxC,EAAYR,QAASZ,GAAM0C,EAAiBtB,EAAapB,IACzD0F","file":"app.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/* eslint-disable wrap-iife */\n/* eslint-disable import/prefer-default-export */\n/* eslint-env browser */\nconst copyToClipboard = (str: string): void => {\n // eslint-disable-next-line no-console\n navigator.clipboard.writeText(str).then(() => console.log(`${str} written to clipboard`));\n};\n\nconst isElementWithClassNameInEventPath = (event: MouseEvent, className: string): boolean => {\n let found = false;\n const path = event.composedPath();\n path.forEach((p: EventTarget): void => {\n if ((p as HTMLElement).classList) {\n if ((p as HTMLElement).classList.contains(className)) {\n found = true;\n }\n }\n });\n return found;\n};\n\nconst setMetaThemeColor = (): void => {\n const body = document.querySelector('body');\n if (body) {\n const bgColor = window.getComputedStyle(body).getPropertyValue('--color-background');\n const existingMeta = document.querySelector('meta[name=\"theme-color\"]') as HTMLMetaElement;\n if (existingMeta) {\n existingMeta.content = bgColor;\n } else {\n const meta = document.createElement('meta');\n meta.name = 'theme-color';\n meta.content = bgColor;\n document.getElementsByTagName('head')[0].appendChild(meta);\n }\n }\n};\n\nconst getBaseFontSize = (): number => parseInt(window.getComputedStyle(document.documentElement).fontSize.replace('px', ''), 10);\n\nexport {\n copyToClipboard,\n isElementWithClassNameInEventPath,\n getBaseFontSize,\n setMetaThemeColor,\n};\n","/* eslint-env browser */\nimport { copyToClipboard, isElementWithClassNameInEventPath } from './helpers';\n\nconst findNav = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('nav')) {\n return parent;\n }\n return findNav(parent);\n }\n return element;\n};\n\n// eslint-disable-next-line max-len\nconst closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElement | null = null): void => {\n const navToggledClass = 'nav--toggled';\n navElements.forEach((n) => {\n const button = n.querySelector('.nav__toggle') as HTMLElement;\n if (n !== keepOpen) {\n if (n.classList.contains(navToggledClass)) {\n button.focus();\n button.setAttribute('aria-expanded', 'false');\n }\n n.classList.remove(navToggledClass);\n }\n });\n};\n\nconst setResponsiveToggle = (navElements: NodeListOf<Element>): void => {\n const toggleMenu = (button: HTMLElement) => {\n const parent = findNav(button);\n\n const navItems = parent.querySelector('.nav__items');\n const lastNavItem = navItems?.querySelector('.nav__item:last-of-type');\n navItems?.classList.add('nav__items--fadeout');\n const firstElement = navItems?.querySelector('.nav__item') as HTMLElement;\n if (firstElement) {\n firstElement.focus();\n }\n\n const transitionListener = () => {\n parent.classList.toggle('nav--toggled');\n navItems?.classList.remove('nav__items--fadeout');\n lastNavItem?.removeEventListener('transitionend', transitionListener);\n };\n\n lastNavItem?.addEventListener('transitionend', transitionListener);\n return parent;\n };\n\n const toggle = document.querySelectorAll('.nav__toggle');\n toggle.forEach((button) => {\n button.addEventListener('click', () => {\n const nav = toggleMenu(button as HTMLElement);\n const ariaExpanded = button.getAttribute('aria-expanded');\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n closeResponsiveNav(navElements, nav);\n });\n });\n};\n\nconst setResponsiveNav = (navElements: NodeListOf<Element>, navElement: Element): void => {\n const navToggledClass = 'nav--toggled';\n const navItemsClass = 'nav__items';\n // gitlab #117\n navElement.classList.remove(navToggledClass);\n const navItemsParent = navElement.querySelector(`.${navItemsClass}`);\n\n if (navItemsParent) {\n const navItems = navItemsParent.querySelectorAll('.nav__item');\n const isOverflownClass = 'nav__item--is-overflown';\n const hasOverflowClass = 'nav--has-overflow';\n const isActiveClass = 'nav__item--active';\n let hasOverflown = false;\n\n for (let i = navItems.length - 1; i >= 0; i -= 1) {\n const nav = navItems[i] as HTMLElement;\n const top = nav.offsetTop;\n\n if (top > 0) {\n nav.classList.add(isOverflownClass);\n navElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n } else if (!nav.classList.contains(isActiveClass)) {\n nav.classList.remove(isOverflownClass);\n }\n }\n\n if (!hasOverflown) {\n navElement.classList.remove(hasOverflowClass);\n const isActive = navElement.querySelector(`.${isActiveClass}`);\n if (isActive) {\n isActive.classList.remove(isOverflownClass);\n }\n }\n }\n\n // gitlab #115\n document.querySelector('body')?.addEventListener('click', (e) => {\n if (!(e.target as HTMLElement).classList.contains('nav__toggle')\n && !isElementWithClassNameInEventPath(e, navItemsClass)) {\n closeResponsiveNav(navElements);\n }\n });\n};\n\nconst closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {\n const subNavClass = 'sub-nav--toggled';\n buttons.forEach((button) => {\n if (button !== keepOpen) {\n if (button?.parentElement?.classList.contains(subNavClass)) {\n (button as HTMLElement).focus();\n button.setAttribute('aria-expanded', 'false');\n }\n button?.parentElement?.classList.remove(subNavClass);\n }\n });\n};\n\nconst setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): void => {\n const subNavClass = 'sub-nav--toggled';\n button.addEventListener('click', () => {\n button?.parentElement?.classList.toggle(subNavClass);\n if (button?.parentElement?.classList.contains(subNavClass)) {\n button.setAttribute('aria-expanded', 'true');\n } else {\n button.setAttribute('aria-expanded', 'false');\n }\n closeSubNav(buttons, button);\n });\n\n // gitlab #115\n document.querySelector('body')?.addEventListener('click', (e) => {\n if (!isElementWithClassNameInEventPath(e, 'sub-nav')) {\n closeSubNav(buttons);\n }\n });\n};\n\nconst setCopyToClipboard = (lang = 'da'): void => {\n const copySpans = document.querySelectorAll('.copy-to-clipboard__this') as NodeListOf<HTMLElement>;\n copySpans.forEach((span) => {\n const parentBtn = span.parentNode as HTMLElement;\n const listener = () => {\n const toCopy = span.innerText;\n copyToClipboard(toCopy);\n // eslint-disable-next-line no-param-reassign\n span.innerText = lang === 'da' ? 'Kopieret' : 'Copied';\n parentBtn?.removeEventListener('click', listener);\n setTimeout(() => {\n // eslint-disable-next-line no-param-reassign\n span.innerText = toCopy;\n parentBtn?.addEventListener('click', listener);\n }, 1200);\n };\n if (parentBtn?.classList.contains('copy-to-clipboard')) {\n parentBtn?.addEventListener('click', listener);\n }\n });\n};\n\nexport {\n findNav,\n setResponsiveToggle,\n setResponsiveNav,\n setSubNavToggle,\n setCopyToClipboard,\n};\n","/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable no-param-reassign */\nimport { getBaseFontSize } from './helpers';\n\nconst getMediaWidthBasedOnModifier = (classList: DOMTokenList): number => {\n if (classList.contains('tabbed-content--hide-tabs-on-medium-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-medium').replace('rem', ''), 10);\n }\n if (classList.contains('tabbed-content--hide-tabs-on-wide-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-wide').replace('rem', ''), 10);\n }\n\n return -1;\n};\n\nconst isBelowViewportLimit = (classList: DOMTokenList): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const widthInRem = viewportWidth / getBaseFontSize();\n const mediaWidth = getMediaWidthBasedOnModifier(classList);\n if (mediaWidth > -1) {\n return widthInRem < mediaWidth;\n }\n return true;\n};\n\nconst destroyTabs = (tabbed: Element): void => {\n const tablist = tabbed.querySelector('.nav__items');\n const tabs = tablist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n tabs?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('nav__item--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst switchTab = (\n tabs: NodeListOf<HTMLAnchorElement>,\n panels: HTMLElement[],\n oldTab: Element | null,\n newTab: HTMLElement,\n _: DOMTokenList,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number): void => console.log(index),\n): void => {\n if (focus) {\n newTab.focus();\n }\n // Make the active tab focusable by the user (Tab key)\n newTab.removeAttribute('tabindex');\n // Set the selected state\n newTab.setAttribute('aria-selected', 'true');\n newTab.classList.add('nav__item--active');\n if (oldTab) {\n oldTab.removeAttribute('aria-selected');\n oldTab.setAttribute('tabindex', '-1');\n oldTab.classList.remove('nav__item--active');\n }\n\n const index = Array.prototype.indexOf.call(tabs, newTab);\n\n // Get the indices of the new and old tabs to find the correct\n // tab panels to show and hide\n panels[index].hidden = false;\n if (oldTab) {\n const oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\n panels[oldIndex].hidden = true;\n }\n\n // Dispatches custom event on every tab change\n newTab.dispatchEvent(new CustomEvent('switch-tab', {\n bubbles: true,\n detail: { tab: index },\n }));\n callback(index);\n};\n\nconst setTabbedContent = (\n key: number,\n tabbed: Element,\n initial = 0,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number) => console.log(index),\n): void => {\n const tablist = tabbed.querySelector('.nav__items') as HTMLElement;\n const tabs = tablist.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n\n const expandAll = tabbed.querySelector('button.tabbed-content__expand-all');\n if (expandAll) {\n const expandAllEvent = () => {\n tablist.hidden = true;\n panels.forEach((panel: HTMLElement) => {\n panel.hidden = false;\n });\n };\n\n expandAll.removeEventListener('click', expandAllEvent);\n expandAll.addEventListener('click', expandAllEvent);\n }\n\n // Add the tablist role to the first <ul> in the .tabbed container\n tablist.setAttribute('role', 'tablist');\n\n // Add semantics are remove user focusability for each tab\n tabs.forEach((tab, i) => {\n tab.setAttribute('role', 'tab');\n tab.setAttribute('id', `tab${key}_${(i + 1)}`);\n tab.setAttribute('tabindex', '-1');\n tab.parentElement?.setAttribute('role', 'presentation');\n\n // Handle clicking of tabs for mouse users\n const tabClickEvent = (e: MouseEvent) => {\n e.preventDefault();\n const currentTab = tablist.querySelector('[aria-selected]');\n if (e.currentTarget !== currentTab) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, currentTab, e.currentTarget as HTMLElement, tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n };\n\n tab.removeEventListener('click', tabClickEvent);\n tab.addEventListener('click', tabClickEvent);\n\n // Handle keydown events for keyboard users\n const tabKeyEvent = (e: KeyboardEvent) => {\n // Get the index of the current tab in the tabs node list\n const index = Array.prototype.indexOf.call(tabs, e.currentTarget);\n // Work out which key the user is pressing and\n // Calculate the new tab's index where appropriate\n let dir: number | string | null = null;\n if (e.key === 'ArrowLeft') {\n dir = index - 1;\n }\n if (e.key === 'ArrowRight') {\n dir = index + 1;\n }\n if (e.key === 'ArrowDown') {\n dir = 'down';\n }\n if (dir !== null) {\n e.preventDefault();\n // If the down key is pressed, move focus to the open panel,\n // otherwise switch to the adjacent tab\n if (dir === 'down') {\n panels[i].focus();\n } else if (tabs[dir]) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, e.currentTarget as Element, tabs[dir], tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n }\n };\n tab.removeEventListener('keydown', tabKeyEvent);\n tab.addEventListener('keydown', tabKeyEvent);\n });\n\n // Add tab panel semantics and hide them all\n panels.forEach((panel: HTMLElement, i: number) => {\n panel.setAttribute('tabindex', '-1');\n panel.setAttribute('aria-labelledby', tabs[i].id);\n // eslint-disable-next-line no-param-reassign\n panel.hidden = true;\n panel.setAttribute('role', 'tabpanel');\n });\n\n // Initially activate the first tab and reveal the first tab panel\n if (initial > -1) {\n switchTab(tabs, panels, null, tabs[initial], tabbed.classList, focus);\n }\n};\n\nexport {\n setTabbedContent,\n isBelowViewportLimit,\n destroyTabs,\n};\n","/* eslint-disable no-param-reassign */\n/* eslint-env browser */\nimport ready from '../components/ready';\nimport {\n setResponsiveNav,\n setResponsiveToggle,\n} from '../components/nav';\nimport { setMetaThemeColor } from '../components/helpers';\nimport { setResponsiveTable } from '../components/table';\nimport { setTabbedContent, isBelowViewportLimit, destroyTabs } from '../components/tabs';\nimport { setContentToggle } from '../components/content-toggle';\n\nlet windowInnerWidth = 0;\n\nconst tabbedObjects: ITabbedObject[] = [];\n\nconst setTabs = (): void => {\n tabbedObjects.forEach((tabObject: ITabbedObject, key: number): void => {\n const { rendered, domElement } = tabObject;\n if (isBelowViewportLimit(domElement.classList)) {\n if (!rendered) {\n const focus = domElement.getAttribute('data-focus-onload');\n const dataInitial = domElement.getAttribute('data-initial-tab');\n const initial = dataInitial ? parseInt(dataInitial, 10) : 0;\n setTabbedContent(key, domElement, initial, focus !== 'false');\n tabObject.rendered = true;\n }\n } else if (rendered) {\n destroyTabs(domElement);\n tabObject.rendered = false;\n }\n });\n};\n\nready(() => {\n const tabbedContent = document.querySelectorAll('.tabbed-content');\n tabbedContent.forEach((tab) => tabbedObjects.push({\n domElement: tab,\n rendered: false,\n }));\n setTabs();\n setMetaThemeColor();\n\n const navElements = document.querySelectorAll('.nav:not(.nav--vertical)');\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setResponsiveToggle(navElements);\n\n const tables = document.querySelectorAll('.table--wrap-medium-width, .table--wrap-default-width');\n tables.forEach((table) => setResponsiveTable(table));\n\n const toggles = document.querySelectorAll('.content-toggle__content');\n toggles.forEach((toggle) => {\n setContentToggle(toggle);\n });\n\n window.addEventListener('load', () => {\n windowInnerWidth = window.innerWidth;\n });\n\n window.addEventListener('resize', () => {\n if (windowInnerWidth > 0 && window.innerWidth !== windowInnerWidth) {\n windowInnerWidth = window.innerWidth;\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setTabs();\n }\n });\n});\n","/* eslint-env browser */\nconst ready = (fn: () => void): void => {\n if (document.readyState !== 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n};\n\nexport default ready;\n","/* eslint-disable import/prefer-default-export */\nconst setResponsiveTable = (table: Element): void => {\n const head = table.querySelector('thead');\n const body = table.querySelector('tbody');\n const foot = table.querySelector('tfoot');\n\n if (head) {\n const headers: string[] = [];\n const ths = head.querySelectorAll('th');\n ths.forEach((h) => {\n if (!h.classList.contains('table__cell--self-explanatory')) {\n headers.push(h.innerHTML); // Because innerText inherits stuff like text-transform\n } else {\n headers.push(''); // If header is self explanatory we do not add it\n }\n });\n\n const rowContainers: HTMLTableSectionElement[] = [];\n // Table elements that possibly contains <tr>'s\n if (body) {\n rowContainers.push(body);\n }\n if (foot) {\n rowContainers.push(foot);\n }\n\n rowContainers.forEach((rc) => {\n const rows = rc.querySelectorAll('tr');\n rows.forEach((tr) => {\n const cells = tr.querySelectorAll('td, th');\n cells.forEach((cell, i) => {\n if (headers[i]) {\n // if header is self explanatory we skip (value of array index is '' which is falsy)\n cell.setAttribute('data-label', headers[i]);\n }\n });\n });\n });\n }\n};\n\nexport {\n setResponsiveTable,\n};\n","/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\nconst setContentToggle = (content: Element): Element | null => {\n const setContentClose = (button: HTMLElement, contentClose: HTMLElement, focus: boolean) => {\n if (contentClose) {\n if (focus) {\n contentClose.focus();\n }\n const click = () => {\n content.setAttribute('hidden', 'hidden');\n button.removeAttribute('hidden');\n button.setAttribute('aria-expanded', 'false');\n button.focus();\n };\n contentClose.removeEventListener('click', click);\n contentClose.addEventListener('click', click);\n }\n };\n\n const button = content?.parentElement?.querySelector('.content-toggle__toggle') as HTMLElement;\n const contentClose = content.querySelector('.content-toggle__close') as HTMLElement;\n\n if (button) {\n button.addEventListener('click', () => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n if (ariaExpanded === 'true') {\n content.setAttribute('hidden', 'hidden');\n } else {\n content.removeAttribute('hidden');\n }\n\n if (button.hasAttribute('aria-haspopup')) {\n button.setAttribute('hidden', 'hidden');\n setContentClose(button, contentClose, true);\n }\n });\n\n setContentClose(button, contentClose, false);\n }\n return button;\n};\n\nexport {\n setContentToggle,\n};\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./source/js/components/helpers.ts","webpack:///./source/js/components/nav.ts","webpack:///./source/js/components/tabs.ts","webpack:///./source/js/production/app.ts","webpack:///./source/js/components/ready.ts","webpack:///./source/js/components/table.ts","webpack:///./source/js/components/content-toggle.ts"],"names":["root","factory","exports","module","define","amd","a","i","window","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isElementWithClassNameInEventPath","event","className","found","composedPath","forEach","classList","contains","findNav","element","parent","parentElement","closeResponsiveNav","navElements","keepOpen","button","querySelector","focus","setAttribute","remove","setResponsiveToggle","cleanUp","document","querySelectorAll","clickEvent","nav","navItems","lastNavItem","add","firstElement","transitionListener","toggle","removeEventListener","addEventListener","toggleMenu","ariaExpanded","getAttribute","push","setResponsiveNav","navElement","navItemsParent","isOverflownClass","hasOverflowClass","isActiveClass","hasOverflown","length","offsetTop","isActive","bodyClickEvent","e","target","isBelowViewportLimit","widthInRem","Math","max","documentElement","clientWidth","innerWidth","parseInt","getComputedStyle","fontSize","replace","getBaseFontSize","mediaWidth","getPropertyValue","getMediaWidthBasedOnModifier","switchTab","tabs","panels","oldTab","newTab","_","callback","index","console","log","removeAttribute","Array","indexOf","hidden","dispatchEvent","CustomEvent","bubbles","detail","tab","windowInnerWidth","tabbedObjects","setTabs","tabObject","rendered","domElement","dataInitial","tabbed","initial","tablist","section","parentNode","expandAll","expandAllEvent","panel","tabClickEvent","preventDefault","currentTab","currentTarget","tabIndex","tabKeyEvent","dir","id","setTabbedContent","destroyTabs","fn","readyState","ready","body","bgColor","existingMeta","content","meta","createElement","getElementsByTagName","appendChild","setMetaThemeColor","table","head","foot","headers","h","innerHTML","rowContainers","rc","tr","cell","setResponsiveTable","setContentClose","contentClose","click","hasAttribute","setContentToggle"],"mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KA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AAwBK,cAAc,2BAC/CsH,EAAelB,EAAQpG,cAAc,0BAEvCD,IACFA,EAAOkB,iBAAiB,QAAS,KAC/B,MAAME,EAAepB,EAAOqB,aAAa,iBACzCrB,EAAOG,aAAa,gBAAkC,UAAjBiB,EAA2B,OAAS,SACpD,SAAjBA,EACFiF,EAAQlG,aAAa,SAAU,UAE/BkG,EAAQxC,gBAAgB,UAGtB7D,EAAOyH,aAAa,mBACtBzH,EAAOG,aAAa,SAAU,UAC9BmH,EAAgBtH,EAAQuH,GAAc,MAI1CD,EAAgBtH,EAAQuH,GAAc,KHctCG,CAAiB1G,KAGnBlE,OAAOoE,iBAAiB,OAAQ,KAC9BoD,EAAmBxH,OAAO4F,aAG5B5F,OAAOoE,iBAAiB,SAAU,KAC5BoD,EAAmB,GAAKxH,OAAO4F,aAAe4B,IAChDA,EAAmBxH,OAAO4F,WAC1B5C,EAAYR,QAASZ,GAAM6C,EAAiBzB,EAAapB,IACzD8F","file":"app.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/* eslint-disable wrap-iife */\n/* eslint-disable import/prefer-default-export */\n/* eslint-env browser */\nconst copyToClipboard = (str: string): void => {\n // eslint-disable-next-line no-console\n navigator.clipboard.writeText(str).then(() => console.log(`${str} written to clipboard`));\n};\n\nconst isElementWithClassNameInEventPath = (event: MouseEvent, className: string): boolean => {\n let found = false;\n const path = event.composedPath();\n path.forEach((p: EventTarget): void => {\n if ((p as HTMLElement).classList) {\n if ((p as HTMLElement).classList.contains(className)) {\n found = true;\n }\n }\n });\n return found;\n};\n\nconst setMetaThemeColor = (): void => {\n const body = document.querySelector('body');\n if (body) {\n const bgColor = window.getComputedStyle(body).getPropertyValue('--color-background');\n const existingMeta = document.querySelector('meta[name=\"theme-color\"]') as HTMLMetaElement;\n if (existingMeta) {\n existingMeta.content = bgColor;\n } else {\n const meta = document.createElement('meta');\n meta.name = 'theme-color';\n meta.content = bgColor;\n document.getElementsByTagName('head')[0].appendChild(meta);\n }\n }\n};\n\nconst getBaseFontSize = (): number => parseInt(window.getComputedStyle(document.documentElement).fontSize.replace('px', ''), 10);\n\nexport {\n copyToClipboard,\n isElementWithClassNameInEventPath,\n getBaseFontSize,\n setMetaThemeColor,\n};\n","/* eslint-env browser */\nimport { copyToClipboard, isElementWithClassNameInEventPath } from './helpers';\n\nconst findNav = (element: HTMLElement): HTMLElement => {\n const parent = element.parentElement;\n if (parent) {\n if (parent.classList.contains('nav')) {\n return parent;\n }\n return findNav(parent);\n }\n return element;\n};\n\n// eslint-disable-next-line max-len\nconst closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElement | null = null): void => {\n const navToggledClass = 'nav--toggled';\n navElements.forEach((n) => {\n const button = n.querySelector('.nav__toggle') as HTMLElement;\n if (n !== keepOpen) {\n if (n.classList.contains(navToggledClass)) {\n button.focus();\n button.setAttribute('aria-expanded', 'false');\n }\n n.classList.remove(navToggledClass);\n }\n });\n};\n\nconst setResponsiveToggle = (navElements: NodeListOf<Element>): CleanUpPair[] => {\n const toggleMenu = (button: HTMLElement) => {\n const parent = findNav(button);\n\n const navItems = parent.querySelector('.nav__items');\n const lastNavItem = navItems?.querySelector('.nav__item:last-of-type');\n navItems?.classList.add('nav__items--fadeout');\n const firstElement = navItems?.querySelector('.nav__item') as HTMLElement;\n if (firstElement) {\n firstElement.focus();\n }\n\n const transitionListener = () => {\n parent.classList.toggle('nav--toggled');\n navItems?.classList.remove('nav__items--fadeout');\n lastNavItem?.removeEventListener('transitionend', transitionListener);\n };\n\n lastNavItem?.addEventListener('transitionend', transitionListener);\n return parent;\n };\n\n const cleanUp: CleanUpPair[] = [];\n\n const toggle = document.querySelectorAll('.nav__toggle');\n toggle.forEach((button) => {\n const clickEvent = () => {\n const nav = toggleMenu(button as HTMLElement);\n const ariaExpanded = button.getAttribute('aria-expanded');\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n closeResponsiveNav(navElements, nav);\n };\n\n cleanUp.push({\n element: button,\n clickEvent,\n });\n\n button.addEventListener('click', clickEvent);\n });\n\n return cleanUp;\n};\n\nconst setResponsiveNav = (\n navElements: NodeListOf<Element>,\n navElement: Element,\n): SetResponsiveNavCleanUp => {\n const navToggledClass = 'nav--toggled';\n const navItemsClass = 'nav__items';\n // gitlab #117\n navElement.classList.remove(navToggledClass);\n const navItemsParent = navElement.querySelector(`.${navItemsClass}`);\n\n if (navItemsParent) {\n const navItems = navItemsParent.querySelectorAll('.nav__item');\n const isOverflownClass = 'nav__item--is-overflown';\n const hasOverflowClass = 'nav--has-overflow';\n const isActiveClass = 'nav__item--active';\n let hasOverflown = false;\n\n for (let i = navItems.length - 1; i >= 0; i -= 1) {\n const nav = navItems[i] as HTMLElement;\n const top = nav.offsetTop;\n\n if (top > 0) {\n nav.classList.add(isOverflownClass);\n navElement.classList.add(hasOverflowClass);\n hasOverflown = true;\n } else if (!nav.classList.contains(isActiveClass)) {\n nav.classList.remove(isOverflownClass);\n }\n }\n\n if (!hasOverflown) {\n navElement.classList.remove(hasOverflowClass);\n const isActive = navElement.querySelector(`.${isActiveClass}`);\n if (isActive) {\n isActive.classList.remove(isOverflownClass);\n }\n }\n }\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!(e.target as HTMLElement).classList.contains('nav__toggle')\n && !isElementWithClassNameInEventPath(e as MouseEvent, navItemsClass)) {\n closeResponsiveNav(navElements);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n\n return {\n element: document.querySelector('body'),\n clickEvent: bodyClickEvent,\n };\n};\n\nconst closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {\n const subNavClass = 'sub-nav--toggled';\n buttons.forEach((button) => {\n if (button !== keepOpen) {\n if (button?.parentElement?.classList.contains(subNavClass)) {\n (button as HTMLElement).focus();\n button.setAttribute('aria-expanded', 'false');\n }\n button?.parentElement?.classList.remove(subNavClass);\n }\n });\n};\n\nconst setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): SetSubNavToggleCleanUp => {\n const subNavClass = 'sub-nav--toggled';\n const buttonClickEvent = () => {\n button?.parentElement?.classList.toggle(subNavClass);\n if (button?.parentElement?.classList.contains(subNavClass)) {\n button.setAttribute('aria-expanded', 'true');\n } else {\n button.setAttribute('aria-expanded', 'false');\n }\n closeSubNav(buttons, button);\n };\n\n button.addEventListener('click', buttonClickEvent);\n\n // gitlab #115\n const bodyClickEvent = (e: Event) => {\n if (!isElementWithClassNameInEventPath(e as MouseEvent, 'sub-nav')) {\n closeSubNav(buttons);\n }\n };\n\n document.querySelector('body')?.addEventListener('click', bodyClickEvent);\n return {\n buttonClickEvent,\n element: document.querySelector('body'),\n bodyClickEvent,\n };\n};\n\nconst setCopyToClipboard = (lang = 'da'): void => {\n const copySpans = document.querySelectorAll('.copy-to-clipboard__this') as NodeListOf<HTMLElement>;\n copySpans.forEach((span) => {\n const parentBtn = span.parentNode as HTMLElement;\n const listener = () => {\n const toCopy = span.innerText;\n copyToClipboard(toCopy);\n // eslint-disable-next-line no-param-reassign\n span.innerText = lang === 'da' ? 'Kopieret' : 'Copied';\n parentBtn?.removeEventListener('click', listener);\n setTimeout(() => {\n // eslint-disable-next-line no-param-reassign\n span.innerText = toCopy;\n parentBtn?.addEventListener('click', listener);\n }, 1200);\n };\n if (parentBtn?.classList.contains('copy-to-clipboard')) {\n parentBtn?.addEventListener('click', listener);\n }\n });\n};\n\nexport {\n findNav,\n setResponsiveToggle,\n setResponsiveNav,\n setSubNavToggle,\n setCopyToClipboard,\n};\n","/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable no-param-reassign */\nimport { getBaseFontSize } from './helpers';\n\nconst getMediaWidthBasedOnModifier = (classList: DOMTokenList): number => {\n if (classList.contains('tabbed-content--hide-tabs-on-medium-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-medium').replace('rem', ''), 10);\n }\n if (classList.contains('tabbed-content--hide-tabs-on-wide-width')) {\n return parseInt(getComputedStyle(document.documentElement).getPropertyValue('--bp-wide').replace('rem', ''), 10);\n }\n\n return -1;\n};\n\nconst isBelowViewportLimit = (classList: DOMTokenList): boolean => {\n const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n const widthInRem = viewportWidth / getBaseFontSize();\n const mediaWidth = getMediaWidthBasedOnModifier(classList);\n if (mediaWidth > -1) {\n return widthInRem < mediaWidth;\n }\n return true;\n};\n\nconst destroyTabs = (tabbed: Element): void => {\n const tablist = tabbed.querySelector('.nav__items');\n const tabs = tablist?.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n tabs?.forEach((tab) => {\n tab.removeAttribute('aria-selected');\n tab.classList.remove('nav__item--active');\n });\n\n panels.forEach((panel) => {\n panel.hidden = false;\n panel.removeAttribute('role');\n });\n};\n\nconst switchTab = (\n tabs: NodeListOf<HTMLAnchorElement>,\n panels: HTMLElement[],\n oldTab: Element | null,\n newTab: HTMLElement,\n _: DOMTokenList,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number): void => console.log(index),\n): void => {\n if (focus) {\n newTab.focus();\n }\n // Make the active tab focusable by the user (Tab key)\n newTab.removeAttribute('tabindex');\n // Set the selected state\n newTab.setAttribute('aria-selected', 'true');\n newTab.classList.add('nav__item--active');\n if (oldTab) {\n oldTab.removeAttribute('aria-selected');\n oldTab.setAttribute('tabindex', '-1');\n oldTab.classList.remove('nav__item--active');\n }\n\n const index = Array.prototype.indexOf.call(tabs, newTab);\n\n // Get the indices of the new and old tabs to find the correct\n // tab panels to show and hide\n panels[index].hidden = false;\n if (oldTab) {\n const oldIndex = Array.prototype.indexOf.call(tabs, oldTab);\n panels[oldIndex].hidden = true;\n }\n\n // Dispatches custom event on every tab change\n newTab.dispatchEvent(new CustomEvent('switch-tab', {\n bubbles: true,\n detail: { tab: index },\n }));\n callback(index);\n};\n\nconst setTabbedContent = (\n key: number,\n tabbed: Element,\n initial = 0,\n focus = true,\n // eslint-disable-next-line no-console\n callback = (index: number) => console.log(index),\n): void => {\n const tablist = tabbed.querySelector('.nav__items') as HTMLElement;\n const tabs = tablist.querySelectorAll('a');\n const panels: HTMLElement[] = [];\n const sections = tabbed.querySelectorAll('section');\n sections.forEach((section) => {\n if (section.parentNode === tabbed) {\n panels.push(section);\n }\n });\n\n const expandAll = tabbed.querySelector('button.tabbed-content__expand-all');\n if (expandAll) {\n const expandAllEvent = () => {\n tablist.hidden = true;\n panels.forEach((panel: HTMLElement) => {\n panel.hidden = false;\n });\n };\n\n expandAll.removeEventListener('click', expandAllEvent);\n expandAll.addEventListener('click', expandAllEvent);\n }\n\n // Add the tablist role to the first <ul> in the .tabbed container\n tablist.setAttribute('role', 'tablist');\n\n // Add semantics are remove user focusability for each tab\n tabs.forEach((tab, i) => {\n tab.setAttribute('role', 'tab');\n tab.setAttribute('id', `tab${key}_${(i + 1)}`);\n tab.setAttribute('tabindex', '-1');\n tab.parentElement?.setAttribute('role', 'presentation');\n\n // Handle clicking of tabs for mouse users\n const tabClickEvent = (e: MouseEvent) => {\n e.preventDefault();\n const currentTab = tablist.querySelector('[aria-selected]');\n if (e.currentTarget !== currentTab) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, currentTab, e.currentTarget as HTMLElement, tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n };\n\n tab.removeEventListener('click', tabClickEvent);\n tab.addEventListener('click', tabClickEvent);\n\n // Handle keydown events for keyboard users\n const tabKeyEvent = (e: KeyboardEvent) => {\n // Get the index of the current tab in the tabs node list\n const index = Array.prototype.indexOf.call(tabs, e.currentTarget);\n // Work out which key the user is pressing and\n // Calculate the new tab's index where appropriate\n let dir: number | string | null = null;\n if (e.key === 'ArrowLeft') {\n dir = index - 1;\n }\n if (e.key === 'ArrowRight') {\n dir = index + 1;\n }\n if (e.key === 'ArrowDown') {\n dir = 'down';\n }\n if (dir !== null) {\n e.preventDefault();\n // If the down key is pressed, move focus to the open panel,\n // otherwise switch to the adjacent tab\n if (dir === 'down') {\n panels[i].focus();\n } else if (tabs[dir]) {\n // eslint-disable-next-line max-len\n switchTab(tabs, panels, e.currentTarget as Element, tabs[dir], tabbed.classList, true, (tabIndex) => {\n callback(tabIndex);\n });\n }\n }\n };\n tab.removeEventListener('keydown', tabKeyEvent);\n tab.addEventListener('keydown', tabKeyEvent);\n });\n\n // Add tab panel semantics and hide them all\n panels.forEach((panel: HTMLElement, i: number) => {\n panel.setAttribute('tabindex', '-1');\n panel.setAttribute('aria-labelledby', tabs[i].id);\n // eslint-disable-next-line no-param-reassign\n panel.hidden = true;\n panel.setAttribute('role', 'tabpanel');\n });\n\n // Initially activate the first tab and reveal the first tab panel\n if (initial > -1) {\n switchTab(tabs, panels, null, tabs[initial], tabbed.classList, focus);\n }\n};\n\nexport {\n setTabbedContent,\n isBelowViewportLimit,\n destroyTabs,\n};\n","/* eslint-disable no-param-reassign */\n/* eslint-env browser */\nimport ready from '../components/ready';\nimport {\n setResponsiveNav,\n setResponsiveToggle,\n} from '../components/nav';\nimport { setMetaThemeColor } from '../components/helpers';\nimport { setResponsiveTable } from '../components/table';\nimport { setTabbedContent, isBelowViewportLimit, destroyTabs } from '../components/tabs';\nimport { setContentToggle } from '../components/content-toggle';\n\nlet windowInnerWidth = 0;\n\nconst tabbedObjects: ITabbedObject[] = [];\n\nconst setTabs = (): void => {\n tabbedObjects.forEach((tabObject: ITabbedObject, key: number): void => {\n const { rendered, domElement } = tabObject;\n if (isBelowViewportLimit(domElement.classList)) {\n if (!rendered) {\n const focus = domElement.getAttribute('data-focus-onload');\n const dataInitial = domElement.getAttribute('data-initial-tab');\n const initial = dataInitial ? parseInt(dataInitial, 10) : 0;\n setTabbedContent(key, domElement, initial, focus !== 'false');\n tabObject.rendered = true;\n }\n } else if (rendered) {\n destroyTabs(domElement);\n tabObject.rendered = false;\n }\n });\n};\n\nready(() => {\n const tabbedContent = document.querySelectorAll('.tabbed-content');\n tabbedContent.forEach((tab) => tabbedObjects.push({\n domElement: tab,\n rendered: false,\n }));\n setTabs();\n setMetaThemeColor();\n\n const navElements = document.querySelectorAll('.nav:not(.nav--vertical)');\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setResponsiveToggle(navElements);\n\n const tables = document.querySelectorAll('.table--wrap-medium-width, .table--wrap-default-width');\n tables.forEach((table) => setResponsiveTable(table));\n\n const toggles = document.querySelectorAll('.content-toggle__content');\n toggles.forEach((toggle) => {\n setContentToggle(toggle);\n });\n\n window.addEventListener('load', () => {\n windowInnerWidth = window.innerWidth;\n });\n\n window.addEventListener('resize', () => {\n if (windowInnerWidth > 0 && window.innerWidth !== windowInnerWidth) {\n windowInnerWidth = window.innerWidth;\n navElements.forEach((n) => setResponsiveNav(navElements, n));\n setTabs();\n }\n });\n});\n","/* eslint-env browser */\nconst ready = (fn: () => void): void => {\n if (document.readyState !== 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n};\n\nexport default ready;\n","/* eslint-disable import/prefer-default-export */\nconst setResponsiveTable = (table: Element): void => {\n const head = table.querySelector('thead');\n const body = table.querySelector('tbody');\n const foot = table.querySelector('tfoot');\n\n if (head) {\n const headers: string[] = [];\n const ths = head.querySelectorAll('th');\n ths.forEach((h) => {\n if (!h.classList.contains('table__cell--self-explanatory')) {\n headers.push(h.innerHTML); // Because innerText inherits stuff like text-transform\n } else {\n headers.push(''); // If header is self explanatory we do not add it\n }\n });\n\n const rowContainers: HTMLTableSectionElement[] = [];\n // Table elements that possibly contains <tr>'s\n if (body) {\n rowContainers.push(body);\n }\n if (foot) {\n rowContainers.push(foot);\n }\n\n rowContainers.forEach((rc) => {\n const rows = rc.querySelectorAll('tr');\n rows.forEach((tr) => {\n const cells = tr.querySelectorAll('td, th');\n cells.forEach((cell, i) => {\n if (headers[i]) {\n // if header is self explanatory we skip (value of array index is '' which is falsy)\n cell.setAttribute('data-label', headers[i]);\n }\n });\n });\n });\n }\n};\n\nexport {\n setResponsiveTable,\n};\n","/* eslint-env browser */\n/* eslint-disable import/prefer-default-export */\nconst setContentToggle = (content: Element): Element | null => {\n const setContentClose = (button: HTMLElement, contentClose: HTMLElement, focus: boolean) => {\n if (contentClose) {\n if (focus) {\n contentClose.focus();\n }\n const click = () => {\n content.setAttribute('hidden', 'hidden');\n button.removeAttribute('hidden');\n button.setAttribute('aria-expanded', 'false');\n button.focus();\n };\n contentClose.removeEventListener('click', click);\n contentClose.addEventListener('click', click);\n }\n };\n\n const button = content?.parentElement?.querySelector('.content-toggle__toggle') as HTMLElement;\n const contentClose = content.querySelector('.content-toggle__close') as HTMLElement;\n\n if (button) {\n button.addEventListener('click', () => {\n const ariaExpanded = button.getAttribute('aria-expanded');\n button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');\n if (ariaExpanded === 'true') {\n content.setAttribute('hidden', 'hidden');\n } else {\n content.removeAttribute('hidden');\n }\n\n if (button.hasAttribute('aria-haspopup')) {\n button.setAttribute('hidden', 'hidden');\n setContentClose(button, contentClose, true);\n }\n });\n\n setContentClose(button, contentClose, false);\n }\n return button;\n};\n\nexport {\n setContentToggle,\n};\n"],"sourceRoot":""}
|
|
@@ -23,7 +23,9 @@ const hideModal = (modal: string, sender: Element, callback = () => { }): void =
|
|
|
23
23
|
|
|
24
24
|
const addedEvents: string[] = [];
|
|
25
25
|
|
|
26
|
-
const showModal = (
|
|
26
|
+
const showModal = (
|
|
27
|
+
modal: string, sender: Element, hideCallback = (): void => { }, closeable = true,
|
|
28
|
+
): void => {
|
|
27
29
|
const modalView = document.getElementById(modal) as HTMLElementWithInert;
|
|
28
30
|
if (modalView) {
|
|
29
31
|
modalView.classList.add('modal-view--visible');
|
|
@@ -53,7 +55,7 @@ const showModal = (modal: string, sender: Element, hideCallback = (): void => {
|
|
|
53
55
|
modalView.addEventListener('click', clickEvent);
|
|
54
56
|
window.removeEventListener('keyup', keyEvent);
|
|
55
57
|
window.addEventListener('keyup', keyEvent);
|
|
56
|
-
}
|
|
58
|
+
}
|
|
57
59
|
|
|
58
60
|
if (!addedEvents.includes(modal)) {
|
|
59
61
|
modalView.addEventListener('click', clickEvent);
|
|
@@ -27,7 +27,7 @@ const closeResponsiveNav = (navElements: NodeListOf<Element>, keepOpen: HTMLElem
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const setResponsiveToggle = (navElements: NodeListOf<Element>):
|
|
30
|
+
const setResponsiveToggle = (navElements: NodeListOf<Element>): CleanUpPair[] => {
|
|
31
31
|
const toggleMenu = (button: HTMLElement) => {
|
|
32
32
|
const parent = findNav(button);
|
|
33
33
|
|
|
@@ -49,18 +49,32 @@ const setResponsiveToggle = (navElements: NodeListOf<Element>): void => {
|
|
|
49
49
|
return parent;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
const cleanUp: CleanUpPair[] = [];
|
|
53
|
+
|
|
52
54
|
const toggle = document.querySelectorAll('.nav__toggle');
|
|
53
55
|
toggle.forEach((button) => {
|
|
54
|
-
|
|
56
|
+
const clickEvent = () => {
|
|
55
57
|
const nav = toggleMenu(button as HTMLElement);
|
|
56
58
|
const ariaExpanded = button.getAttribute('aria-expanded');
|
|
57
59
|
button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');
|
|
58
60
|
closeResponsiveNav(navElements, nav);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
cleanUp.push({
|
|
64
|
+
element: button,
|
|
65
|
+
clickEvent,
|
|
59
66
|
});
|
|
67
|
+
|
|
68
|
+
button.addEventListener('click', clickEvent);
|
|
60
69
|
});
|
|
70
|
+
|
|
71
|
+
return cleanUp;
|
|
61
72
|
};
|
|
62
73
|
|
|
63
|
-
const setResponsiveNav = (
|
|
74
|
+
const setResponsiveNav = (
|
|
75
|
+
navElements: NodeListOf<Element>,
|
|
76
|
+
navElement: Element,
|
|
77
|
+
): SetResponsiveNavCleanUp => {
|
|
64
78
|
const navToggledClass = 'nav--toggled';
|
|
65
79
|
const navItemsClass = 'nav__items';
|
|
66
80
|
// gitlab #117
|
|
@@ -97,12 +111,19 @@ const setResponsiveNav = (navElements: NodeListOf<Element>, navElement: Element)
|
|
|
97
111
|
}
|
|
98
112
|
|
|
99
113
|
// gitlab #115
|
|
100
|
-
|
|
114
|
+
const bodyClickEvent = (e: Event) => {
|
|
101
115
|
if (!(e.target as HTMLElement).classList.contains('nav__toggle')
|
|
102
|
-
&& !isElementWithClassNameInEventPath(e, navItemsClass)) {
|
|
116
|
+
&& !isElementWithClassNameInEventPath(e as MouseEvent, navItemsClass)) {
|
|
103
117
|
closeResponsiveNav(navElements);
|
|
104
118
|
}
|
|
105
|
-
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
document.querySelector('body')?.addEventListener('click', bodyClickEvent);
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
element: document.querySelector('body'),
|
|
125
|
+
clickEvent: bodyClickEvent,
|
|
126
|
+
};
|
|
106
127
|
};
|
|
107
128
|
|
|
108
129
|
const closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = null) => {
|
|
@@ -118,9 +139,9 @@ const closeSubNav = (buttons: NodeListOf<Element>, keepOpen: Element | null = nu
|
|
|
118
139
|
});
|
|
119
140
|
};
|
|
120
141
|
|
|
121
|
-
const setSubNavToggle = (buttons: NodeListOf<Element>, button: Element):
|
|
142
|
+
const setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): SetSubNavToggleCleanUp => {
|
|
122
143
|
const subNavClass = 'sub-nav--toggled';
|
|
123
|
-
|
|
144
|
+
const buttonClickEvent = () => {
|
|
124
145
|
button?.parentElement?.classList.toggle(subNavClass);
|
|
125
146
|
if (button?.parentElement?.classList.contains(subNavClass)) {
|
|
126
147
|
button.setAttribute('aria-expanded', 'true');
|
|
@@ -128,14 +149,23 @@ const setSubNavToggle = (buttons: NodeListOf<Element>, button: Element): void =>
|
|
|
128
149
|
button.setAttribute('aria-expanded', 'false');
|
|
129
150
|
}
|
|
130
151
|
closeSubNav(buttons, button);
|
|
131
|
-
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
button.addEventListener('click', buttonClickEvent);
|
|
132
155
|
|
|
133
156
|
// gitlab #115
|
|
134
|
-
|
|
135
|
-
if (!isElementWithClassNameInEventPath(e, 'sub-nav')) {
|
|
157
|
+
const bodyClickEvent = (e: Event) => {
|
|
158
|
+
if (!isElementWithClassNameInEventPath(e as MouseEvent, 'sub-nav')) {
|
|
136
159
|
closeSubNav(buttons);
|
|
137
160
|
}
|
|
138
|
-
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
document.querySelector('body')?.addEventListener('click', bodyClickEvent);
|
|
164
|
+
return {
|
|
165
|
+
buttonClickEvent,
|
|
166
|
+
element: document.querySelector('body'),
|
|
167
|
+
bodyClickEvent,
|
|
168
|
+
};
|
|
139
169
|
};
|
|
140
170
|
|
|
141
171
|
const setCopyToClipboard = (lang = 'da'): void => {
|
|
@@ -10,25 +10,39 @@ const removeOverlay = (containers: NodeListOf<Element>): void => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const setSelectionListOverlays = ():
|
|
13
|
+
const setSelectionListOverlays = (): setSelectionListOverlaysCleanUp => {
|
|
14
|
+
const cleanUp: CleanUpPair[] = [];
|
|
14
15
|
const containers = document.querySelectorAll('.selection-list-overlay-container');
|
|
15
16
|
containers.forEach((container) => {
|
|
16
17
|
const btn = container.querySelector('button') as HTMLElement; // Assumes only one button pr container
|
|
17
|
-
|
|
18
|
+
const clickEvent = () => {
|
|
18
19
|
removeOverlay(containers);
|
|
19
20
|
const sibling = btn.nextSibling as HTMLElement;
|
|
20
21
|
if (sibling) {
|
|
21
22
|
sibling.classList.add('selection-list--toggled');
|
|
22
23
|
}
|
|
24
|
+
};
|
|
25
|
+
cleanUp.push({
|
|
26
|
+
element: btn,
|
|
27
|
+
clickEvent,
|
|
23
28
|
});
|
|
29
|
+
|
|
30
|
+
btn.addEventListener('click', clickEvent);
|
|
24
31
|
});
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
const bodyClickEvent = (e: Event): void => {
|
|
27
34
|
if (!(e.target as HTMLElement).classList.contains('selection-list--overlay')
|
|
28
|
-
&& !isElementWithClassNameInEventPath(e, 'selection-list-overlay-container')) {
|
|
35
|
+
&& !isElementWithClassNameInEventPath(e as MouseEvent, 'selection-list-overlay-container')) {
|
|
29
36
|
removeOverlay(containers);
|
|
30
37
|
}
|
|
31
|
-
}
|
|
38
|
+
};
|
|
39
|
+
document.querySelector('body')?.addEventListener('click', bodyClickEvent);
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
pairs: cleanUp,
|
|
43
|
+
element: document.querySelector('body'),
|
|
44
|
+
clickEvent: bodyClickEvent,
|
|
45
|
+
};
|
|
32
46
|
};
|
|
33
47
|
|
|
34
48
|
export {
|
|
@@ -40,10 +40,11 @@ const setToolbars = (): void => {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
const setToolbarToggle = ():
|
|
43
|
+
const setToolbarToggle = (): CleanUpPair[] => {
|
|
44
|
+
const cleanUp: CleanUpPair[] = [];
|
|
44
45
|
const buttons = document.querySelectorAll('.toolbar .toolbar__toggle');
|
|
45
46
|
buttons.forEach((button) => {
|
|
46
|
-
|
|
47
|
+
const clickEvent = () => {
|
|
47
48
|
button?.parentElement?.classList.toggle('toolbar--toggled');
|
|
48
49
|
const ariaExpanded = button.getAttribute('aria-expanded');
|
|
49
50
|
if (ariaExpanded !== 'true') {
|
|
@@ -53,8 +54,15 @@ const setToolbarToggle = (): void => {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
cleanUp.push({
|
|
60
|
+
element: button,
|
|
61
|
+
clickEvent,
|
|
56
62
|
});
|
|
63
|
+
button.addEventListener('click', clickEvent);
|
|
57
64
|
});
|
|
65
|
+
return cleanUp;
|
|
58
66
|
};
|
|
59
67
|
|
|
60
68
|
export {
|