@uoguelph/web-components 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/cjs/{index-f0452ddd.js → index-52617c57.js} +11 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{uofg-footer_3.cjs.entry.js → uofg-alert_6.cjs.entry.js} +230 -82
- package/dist/cjs/uofg-web-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/uofg-alert/uofg-alert.css +46 -0
- package/dist/collection/components/uofg-alert/uofg-alert.js +20 -0
- package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.css +40 -0
- package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.js +68 -0
- package/dist/collection/components/uofg-header/uofg-header.js +2 -2
- package/dist/collection/components/uofg-menu/uofg-menu.js +28 -50
- package/dist/collection/components/uofg-modal/uofg-modal.css +80 -0
- package/dist/collection/components/uofg-modal/uofg-modal.js +325 -0
- package/dist/collection/utils/utils.js +6 -0
- package/dist/components/font-awesome-icon.js +10 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index2.js +12 -10
- package/dist/components/uofg-alert.d.ts +11 -0
- package/dist/components/uofg-alert.js +40 -0
- package/dist/components/uofg-back-to-top.d.ts +11 -0
- package/dist/components/uofg-back-to-top.js +48 -0
- package/dist/components/uofg-footer.js +2 -1
- package/dist/components/uofg-header.js +2 -1
- package/dist/components/uofg-menu2.js +31 -46
- package/dist/components/uofg-modal.d.ts +11 -0
- package/dist/components/uofg-modal.js +139 -0
- package/dist/components/utils.js +8 -0
- package/dist/esm/{index-24999f13.js → index-ebf79156.js} +11 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{uofg-footer_3.entry.js → uofg-alert_6.entry.js} +228 -83
- package/dist/esm/uofg-web-components.js +3 -3
- package/dist/types/components/uofg-alert/uofg-alert.d.ts +3 -0
- package/dist/types/components/uofg-back-to-top/uofg-back-to-top.d.ts +10 -0
- package/dist/types/components/uofg-header/uofg-header.d.ts +2 -2
- package/dist/types/components/uofg-menu/uofg-menu.d.ts +4 -4
- package/dist/types/components/uofg-modal/uofg-modal.d.ts +61 -0
- package/dist/types/components.d.ts +116 -4
- package/dist/types/utils/{feature-check.d.ts → utils.d.ts} +1 -0
- package/dist/uofg-web-components/p-2c75433c.entry.js +1 -0
- package/dist/uofg-web-components/p-bc82feb9.js +2 -0
- package/dist/uofg-web-components/uofg-web-components.css +1 -1
- package/dist/uofg-web-components/uofg-web-components.esm.js +1 -1
- package/package.json +4 -3
- package/dist/collection/utils/feature-check.js +0 -2
- package/dist/uofg-web-components/p-b7dfbfdc.js +0 -2
- package/dist/uofg-web-components/p-d87070ab.entry.js +0 -1
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const FontAwesomeIcon = props => {
|
|
4
|
-
const width = props.icon.icon[0];
|
|
5
|
-
const height = props.icon.icon[1];
|
|
6
|
-
const iconPathData = props.icon.icon[4];
|
|
7
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, Array.isArray(iconPathData) ? (iconPathData.map(path => h("path", { d: path }))) : (h("path", { d: iconPathData }))));
|
|
8
|
-
};
|
|
9
|
-
|
|
10
1
|
var faTrees = {
|
|
11
2
|
prefix: 'fas',
|
|
12
3
|
iconName: 'trees',
|
|
@@ -27,6 +18,11 @@ var faList = {
|
|
|
27
18
|
iconName: 'list',
|
|
28
19
|
icon: [512, 512, ["list-squares"], "f03a", "M40 48C26.7 48 16 58.7 16 72v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V72c0-13.3-10.7-24-24-24H40zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM16 232v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V232c0-13.3-10.7-24-24-24H40c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24H88c13.3 0 24-10.7 24-24V392c0-13.3-10.7-24-24-24H40z"]
|
|
29
20
|
};
|
|
21
|
+
var faChevronUp = {
|
|
22
|
+
prefix: 'fas',
|
|
23
|
+
iconName: 'chevron-up',
|
|
24
|
+
icon: [512, 512, [], "f077", "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]
|
|
25
|
+
};
|
|
30
26
|
var faKey = {
|
|
31
27
|
prefix: 'fas',
|
|
32
28
|
iconName: 'key',
|
|
@@ -73,10 +69,16 @@ var faMagnifyingGlass = {
|
|
|
73
69
|
icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
|
|
74
70
|
};
|
|
75
71
|
var faSearch = faMagnifyingGlass;
|
|
72
|
+
var faXmark = {
|
|
73
|
+
prefix: 'fas',
|
|
74
|
+
iconName: 'xmark',
|
|
75
|
+
icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]
|
|
76
|
+
};
|
|
77
|
+
var faTimes = faXmark;
|
|
76
78
|
var faBriefcase = {
|
|
77
79
|
prefix: 'fas',
|
|
78
80
|
iconName: 'briefcase',
|
|
79
81
|
icon: [512, 512, [128188], "f0b1", "M184 48H328c4.4 0 8 3.6 8 8V96H176V56c0-4.4 3.6-8 8-8zm-56 8V96H64C28.7 96 0 124.7 0 160v96H192 320 512V160c0-35.3-28.7-64-64-64H384V56c0-30.9-25.1-56-56-56H184c-30.9 0-56 25.1-56 56zM512 288H320v32c0 17.7-14.3 32-32 32H224c-17.7 0-32-14.3-32-32V288H0V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V288z"]
|
|
80
82
|
};
|
|
81
83
|
|
|
82
|
-
export {
|
|
84
|
+
export { faUniversalAccess as a, faKey as b, faSitemap as c, faCircleCheck as d, faTrees as e, faChevronUp as f, faBriefcase as g, faCalendarRange as h, faList as i, faHandHoldingHeart as j, faPhoneFlip as k, faCaretDown as l, faSearch as m, faRightToBracket as n, faBars as o, faTimes as p };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface UofgAlert extends Components.UofgAlert, HTMLElement {}
|
|
4
|
+
export const UofgAlert: {
|
|
5
|
+
prototype: UofgAlert;
|
|
6
|
+
new (): UofgAlert;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { F as FontAwesomeIcon } from './font-awesome-icon.js';
|
|
3
|
+
|
|
4
|
+
var faCircleExclamation = {
|
|
5
|
+
prefix: 'far',
|
|
6
|
+
iconName: 'circle-exclamation',
|
|
7
|
+
icon: [512, 512, ["exclamation-circle"], "f06a", "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c-13.3 0-24 10.7-24 24V264c0 13.3 10.7 24 24 24s24-10.7 24-24V152c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const uofgAlertCss = ":host{display:block}*{box-sizing:border-box}#uofg-alert{display:flex;flex-direction:column;font-size:2rem}#uofg-alert #uofg-alert-title{display:flex;align-items:center;font-size:2.25rem;padding:2rem;color:white;background-color:#C10631}#uofg-alert #uofg-alert-title>svg{margin-right:1rem;fill:currentColor;height:1.5em}#uofg-alert #uofg-alert-body{display:flex;flex-direction:column;padding:1.5rem 2rem;background-color:white}#uofg-alert #uofg-alert-body slot[name=subtitle]::slotted(*){font-size:2rem;margin-bottom:2rem;font-weight:bold}#uofg-alert #uofg-alert-body slot[name=message]::slotted(*){font-size:1.6rem}#uofg-alert #uofg-alert-footer{display:flex;padding:1rem 2rem;background-color:#DDDDDD;font-size:1.4rem}";
|
|
11
|
+
|
|
12
|
+
const UofgAlert$1 = /*@__PURE__*/ proxyCustomElement(class UofgAlert extends HTMLElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.__registerHost();
|
|
16
|
+
this.__attachShadow();
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h("div", { id: "uofg-alert" }, h("div", { id: "uofg-alert-title" }, h(FontAwesomeIcon, { icon: faCircleExclamation }), h("slot", { name: "title" })), h("div", { id: "uofg-alert-body" }, h("slot", { name: "subtitle" }), h("slot", { name: "message" })), h("div", { id: "uofg-alert-footer" }, h("slot", { name: "footer" }))));
|
|
20
|
+
}
|
|
21
|
+
static get style() { return uofgAlertCss; }
|
|
22
|
+
}, [1, "uofg-alert"]);
|
|
23
|
+
function defineCustomElement$1() {
|
|
24
|
+
if (typeof customElements === "undefined") {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const components = ["uofg-alert"];
|
|
28
|
+
components.forEach(tagName => { switch (tagName) {
|
|
29
|
+
case "uofg-alert":
|
|
30
|
+
if (!customElements.get(tagName)) {
|
|
31
|
+
customElements.define(tagName, UofgAlert$1);
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
} });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const UofgAlert = UofgAlert$1;
|
|
38
|
+
const defineCustomElement = defineCustomElement$1;
|
|
39
|
+
|
|
40
|
+
export { UofgAlert, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface UofgBackToTop extends Components.UofgBackToTop, HTMLElement {}
|
|
4
|
+
export const UofgBackToTop: {
|
|
5
|
+
prototype: UofgBackToTop;
|
|
6
|
+
new (): UofgBackToTop;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { F as FontAwesomeIcon } from './font-awesome-icon.js';
|
|
3
|
+
import { f as faChevronUp } from './index2.js';
|
|
4
|
+
|
|
5
|
+
const uofgBackToTopCss = ":host{display:block}:focus-visible{outline:2px solid #ffc72a;outline-offset:0.5rem}#uofg-back-to-top{position:fixed;margin:10px;height:35px;width:35px;right:0;bottom:0;z-index:1000;cursor:pointer;background-color:black;color:white;transition-duration:0.3s;transition-timing-function:ease-in-out;transition-property:opacity, visibility, background-color;opacity:0;visibility:hidden;border-radius:50%;border:1px solid #fff}#uofg-back-to-top:hover{background-color:#d50029}#uofg-back-to-top>svg{width:1em;height:1em;fill:currentColor}#uofg-back-to-top.visible{opacity:1;visibility:visible}";
|
|
6
|
+
|
|
7
|
+
const UofgBackToTop$1 = /*@__PURE__*/ proxyCustomElement(class UofgBackToTop extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.threshold = 50;
|
|
13
|
+
this.isVisible = false;
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.onScroll();
|
|
17
|
+
}
|
|
18
|
+
onScroll() {
|
|
19
|
+
this.isVisible = window.scrollY >= this.threshold;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (h("button", { id: "uofg-back-to-top", "aria-label": "Go back to the top", class: { visible: this.isVisible }, onClick: () => {
|
|
23
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
24
|
+
} }, h(FontAwesomeIcon, { icon: faChevronUp })));
|
|
25
|
+
}
|
|
26
|
+
static get style() { return uofgBackToTopCss; }
|
|
27
|
+
}, [1, "uofg-back-to-top", {
|
|
28
|
+
"threshold": [2],
|
|
29
|
+
"isVisible": [32]
|
|
30
|
+
}, [[9, "scroll", "onScroll"]]]);
|
|
31
|
+
function defineCustomElement$1() {
|
|
32
|
+
if (typeof customElements === "undefined") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const components = ["uofg-back-to-top"];
|
|
36
|
+
components.forEach(tagName => { switch (tagName) {
|
|
37
|
+
case "uofg-back-to-top":
|
|
38
|
+
if (!customElements.get(tagName)) {
|
|
39
|
+
customElements.define(tagName, UofgBackToTop$1);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
} });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const UofgBackToTop = UofgBackToTop$1;
|
|
46
|
+
const defineCustomElement = defineCustomElement$1;
|
|
47
|
+
|
|
48
|
+
export { UofgBackToTop, defineCustomElement };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
-
import { F as FontAwesomeIcon
|
|
2
|
+
import { F as FontAwesomeIcon } from './font-awesome-icon.js';
|
|
3
|
+
import { a as faUniversalAccess, b as faKey, c as faSitemap, d as faCircleCheck, e as faTrees, g as faBriefcase, h as faCalendarRange, i as faList, j as faHandHoldingHeart, k as faPhoneFlip } from './index2.js';
|
|
3
4
|
|
|
4
5
|
var faSquareTwitter = {
|
|
5
6
|
prefix: 'fab',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
-
import { F as FontAwesomeIcon
|
|
2
|
+
import { F as FontAwesomeIcon } from './font-awesome-icon.js';
|
|
3
|
+
import { l as faCaretDown, m as faSearch, n as faRightToBracket, o as faBars } from './index2.js';
|
|
3
4
|
import { d as defineCustomElement$2 } from './uofg-menu2.js';
|
|
4
5
|
|
|
5
6
|
const PageSpecific = props => {
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement
|
|
2
|
-
|
|
3
|
-
const WEB_ANIMATIONS_SUPPORTED = 'animate' in HTMLElement.prototype;
|
|
4
|
-
const PREFERS_REDUCED_MOTION = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { W as WEB_ANIMATIONS_SUPPORTED, P as PREFERS_REDUCED_MOTION } from './utils.js';
|
|
5
3
|
|
|
6
4
|
const DURATION_REGEX = /^(\d*\.?\d+)(s|ms)$/;
|
|
7
5
|
const EASING_FUNCTION_REGEX = /^cubic-bezier\((\s*-?\d*\.?\d+\s*,){3}\s*-?\d*\.?\d+\s*\)$|^steps\(\s*\d+\s*(,\s*(start|end))?\s*\)$/;
|
|
8
|
-
const
|
|
9
|
-
for (const mutation of mutations) {
|
|
10
|
-
mutation.target.dispatchEvent(new CustomEvent('childListChange', { bubbles: false }));
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
const observerConfig = {
|
|
14
|
-
childList: true,
|
|
15
|
-
};
|
|
16
|
-
const UofgMenu = /*@__PURE__*/ proxyCustomElement(class UofgMenu extends HTMLElement$1 {
|
|
6
|
+
const UofgMenu = /*@__PURE__*/ proxyCustomElement(class UofgMenu extends HTMLElement {
|
|
17
7
|
constructor() {
|
|
18
8
|
super();
|
|
19
9
|
this.__registerHost();
|
|
@@ -25,50 +15,31 @@ const UofgMenu = /*@__PURE__*/ proxyCustomElement(class UofgMenu extends HTMLEle
|
|
|
25
15
|
this.button = null;
|
|
26
16
|
this.content = null;
|
|
27
17
|
this.contentComputedStyle = null;
|
|
18
|
+
this.observer = new MutationObserver(this.handleMutation);
|
|
28
19
|
this.isExpanded = false;
|
|
29
20
|
this.autoCollapse = false;
|
|
30
21
|
}
|
|
31
22
|
connectedCallback() {
|
|
32
23
|
// Bind functions so that "this" correctly refers to the component's instance.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.updateContent = this.updateContent.bind(this);
|
|
36
|
-
this.handleButtonClick = this.handleButtonClick.bind(this);
|
|
24
|
+
this.handleMutation = this.handleMutation.bind(this);
|
|
25
|
+
this.handleClick = this.handleClick.bind(this);
|
|
37
26
|
this.handleFocusout = this.handleFocusout.bind(this);
|
|
38
27
|
this.handleKeyUp = this.handleKeyUp.bind(this);
|
|
39
28
|
this.computedStyle = window.getComputedStyle(this.el);
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
observer.observe(this.el, observerConfig);
|
|
43
|
-
}
|
|
44
|
-
handleChildListChange() {
|
|
45
|
-
this.updateButton();
|
|
46
|
-
this.updateContent();
|
|
29
|
+
this.handleMutation();
|
|
30
|
+
this.observer.observe(this.el, { childList: true });
|
|
47
31
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.isExpanded = false;
|
|
51
|
-
if (e.target !== this.button) {
|
|
52
|
-
e.stopPropagation();
|
|
53
|
-
this.isExpanded = false;
|
|
54
|
-
this.button && this.button.focus();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
32
|
+
disconnectedCallback() {
|
|
33
|
+
this.observer.disconnect();
|
|
57
34
|
}
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
handleMutation() {
|
|
36
|
+
// Update the button element
|
|
60
37
|
const button = this.el.querySelector('[slot="button"]');
|
|
61
|
-
// Clean up the old button before setting the new one
|
|
62
|
-
(_a = this.button) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', this.handleButtonClick);
|
|
63
|
-
(_b = this.button) === null || _b === void 0 ? void 0 : _b.removeAttribute('aria-expanded');
|
|
64
|
-
(_c = this.button) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-haspopup');
|
|
65
38
|
// Set up the new button
|
|
66
39
|
button === null || button === void 0 ? void 0 : button.setAttribute('aria-expanded', this.isExpanded ? 'true' : 'false');
|
|
67
40
|
button === null || button === void 0 ? void 0 : button.setAttribute('aria-haspopup', 'true');
|
|
68
|
-
button === null || button === void 0 ? void 0 : button.addEventListener('click', this.handleButtonClick);
|
|
69
41
|
this.button = button;
|
|
70
|
-
|
|
71
|
-
updateContent() {
|
|
42
|
+
// Update the content element
|
|
72
43
|
const content = this.el.querySelector('[slot="content"]');
|
|
73
44
|
if (content == null) {
|
|
74
45
|
this.content = null;
|
|
@@ -80,8 +51,22 @@ const UofgMenu = /*@__PURE__*/ proxyCustomElement(class UofgMenu extends HTMLEle
|
|
|
80
51
|
this.contentComputedStyle = window.getComputedStyle(this.content);
|
|
81
52
|
}
|
|
82
53
|
}
|
|
83
|
-
|
|
84
|
-
|
|
54
|
+
handleKeyUp(e) {
|
|
55
|
+
if (e.key === 'Escape') {
|
|
56
|
+
this.isExpanded = false;
|
|
57
|
+
if (e.target !== this.button) {
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
this.isExpanded = false;
|
|
60
|
+
this.button && this.button.focus();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
handleClick(e) {
|
|
65
|
+
//Check if the click was on the button or a descendant of the button
|
|
66
|
+
if (this.button && this.button.contains(e.target)) {
|
|
67
|
+
this.isExpanded = !this.isExpanded;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
85
70
|
}
|
|
86
71
|
handleFocusout(e) {
|
|
87
72
|
if (this.autoCollapse && !this.el.contains(e.relatedTarget)) {
|
|
@@ -207,7 +192,7 @@ const UofgMenu = /*@__PURE__*/ proxyCustomElement(class UofgMenu extends HTMLEle
|
|
|
207
192
|
};
|
|
208
193
|
}
|
|
209
194
|
render() {
|
|
210
|
-
return (h(Host, {
|
|
195
|
+
return (h(Host, { "data-expanded": this.isExpanded, tabindex: -1, onFocusout: this.handleFocusout, onKeyUp: this.handleKeyUp, onClick: this.handleClick }));
|
|
211
196
|
}
|
|
212
197
|
/**
|
|
213
198
|
* Get the current expanded state of the menu.
|
|
@@ -257,7 +242,7 @@ const UofgMenu = /*@__PURE__*/ proxyCustomElement(class UofgMenu extends HTMLEle
|
|
|
257
242
|
"toggle": [64],
|
|
258
243
|
"collapse": [64],
|
|
259
244
|
"expand": [64]
|
|
260
|
-
}
|
|
245
|
+
}]);
|
|
261
246
|
function defineCustomElement() {
|
|
262
247
|
if (typeof customElements === "undefined") {
|
|
263
248
|
return;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface UofgModal extends Components.UofgModal, HTMLElement {}
|
|
4
|
+
export const UofgModal: {
|
|
5
|
+
prototype: UofgModal;
|
|
6
|
+
new (): UofgModal;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { F as FontAwesomeIcon } from './font-awesome-icon.js';
|
|
3
|
+
import { p as faTimes } from './index2.js';
|
|
4
|
+
import { g as getAllFocusableElements } from './utils.js';
|
|
5
|
+
|
|
6
|
+
const uofgModalCss = ":host{visibility:visible !important;position:relative !important}:focus-visible{outline:2px solid #ffc72a}*{box-sizing:border-box}#uofg-modal{display:flex;position:fixed;top:0;left:0;z-index:10000;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5);visibility:hidden;opacity:0;padding:2rem;transition-duration:0.3s;transition-timing-function:ease-in-out;transition-property:visibility, opacity}#uofg-modal #uofg-modal-dismiss{display:flex;justify-content:center;align-items:center;position:absolute;top:0;right:0;padding:0.5rem;height:3.5rem;width:3.5rem;font-size:2rem;line-height:1;color:var(--uofg-modal-dismiss-color, #fff);background-color:transparent;border:none;cursor:pointer;z-index:2}#uofg-modal #uofg-modal-dismiss>svg{display:block;height:1em;fill:currentColor}#uofg-modal>#uofg-modal-content{position:absolute;left:50%;transition:transform 0.3s ease-in-out;transform:translate(-50%, -50px);z-index:1}@media (prefers-reduced-motion: reduce){#uofg-modal>#uofg-modal-content{transition:none}}#uofg-modal>#uofg-modal-content.centered{top:50%;transform:translate(-50%, calc(-50% - 50px))}#uofg-modal.open{visibility:visible;opacity:1}#uofg-modal.open #uofg-modal-content{visibility:visible;opacity:1;transform:translate(-50%, 0)}#uofg-modal.open #uofg-modal-content.centered{transform:translate(-50%, -50%)}";
|
|
7
|
+
|
|
8
|
+
const UofgModal$1 = /*@__PURE__*/ proxyCustomElement(class UofgModal extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
this.label = undefined;
|
|
14
|
+
this.alertDialog = false;
|
|
15
|
+
this.centered = false;
|
|
16
|
+
this.staticBackdrop = false;
|
|
17
|
+
this.autoOpen = false;
|
|
18
|
+
this.isOpen = false;
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
// Bind event handlers so that 'this' is always the component instance.
|
|
22
|
+
this.handleClick = this.handleClick.bind(this);
|
|
23
|
+
this.handleKeyUp = this.handleKeyUp.bind(this);
|
|
24
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
25
|
+
if (this.autoOpen) {
|
|
26
|
+
this.isOpen = true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
handleClick(e) {
|
|
30
|
+
if (!this.staticBackdrop && e.target === e.currentTarget) {
|
|
31
|
+
this.isOpen = false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
handleKeyUp(e) {
|
|
35
|
+
if (e.key === 'Escape') {
|
|
36
|
+
this.isOpen = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
handleKeyDown(e) {
|
|
40
|
+
if (e.key === 'Tab') {
|
|
41
|
+
const focusableElements = getAllFocusableElements(this.el);
|
|
42
|
+
const firstFocusable = this.dismissButton; // The dismiss button is always the first focusable element in the modal.
|
|
43
|
+
const lastFocusable = focusableElements[focusableElements.length - 1];
|
|
44
|
+
if (e.target === firstFocusable && e.shiftKey) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
lastFocusable === null || lastFocusable === void 0 ? void 0 : lastFocusable.focus();
|
|
47
|
+
}
|
|
48
|
+
else if (e.target === lastFocusable && !e.shiftKey) {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
handleIsOpenChange(newValue) {
|
|
55
|
+
if (newValue === true) {
|
|
56
|
+
window.requestAnimationFrame(() => {
|
|
57
|
+
window.requestAnimationFrame(() => {
|
|
58
|
+
window.requestAnimationFrame(() => {
|
|
59
|
+
this.dismissButton.focus();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return (h("div", { id: "uofg-modal", class: { open: this.isOpen }, role: this.isOpen ? (this.alertDialog ? 'alertdialog' : 'dialog') : '', "aria-modal": this.isOpen, "aria-label": this.label, "aria-hidden": !this.isOpen, tabIndex: -1, onClick: this.handleClick, onKeyUp: this.handleKeyUp, onKeyDown: this.handleKeyDown }, h("div", { id: "uofg-modal-content", class: { centered: this.centered } }, h("button", { id: "uofg-modal-dismiss", "aria-label": "Close modal", ref: (el) => (this.dismissButton = el), onClick: () => (this.isOpen = false) }, h(FontAwesomeIcon, { icon: faTimes })), h("slot", null))));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get the current state of the modal.
|
|
70
|
+
* @returns A promise which will resolve to true when the modal is open, or false when the modal is closed.
|
|
71
|
+
*/
|
|
72
|
+
async getState() {
|
|
73
|
+
return this.isOpen;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Set the state of the modal.
|
|
77
|
+
* @param value The new state, set it to true to open the modal, or false to close the modal.
|
|
78
|
+
*/
|
|
79
|
+
async setState(value) {
|
|
80
|
+
this.isOpen = value;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Toggle the state of the modal.
|
|
84
|
+
* @returns A promise which will resolve to true (if the modal opened) or false (if the modal closed).
|
|
85
|
+
*/
|
|
86
|
+
async toggle() {
|
|
87
|
+
this.isOpen = !this.isOpen;
|
|
88
|
+
return this.isOpen;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Closes the modal.
|
|
92
|
+
* @returns empty Promise.
|
|
93
|
+
*/
|
|
94
|
+
async close() {
|
|
95
|
+
this.isOpen = false;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Opens the modal.
|
|
99
|
+
* @returns empty Promise.
|
|
100
|
+
*/
|
|
101
|
+
async open() {
|
|
102
|
+
this.isOpen = true;
|
|
103
|
+
}
|
|
104
|
+
get el() { return this; }
|
|
105
|
+
static get watchers() { return {
|
|
106
|
+
"isOpen": ["handleIsOpenChange"]
|
|
107
|
+
}; }
|
|
108
|
+
static get style() { return uofgModalCss; }
|
|
109
|
+
}, [1, "uofg-modal", {
|
|
110
|
+
"label": [1],
|
|
111
|
+
"alertDialog": [4, "alert-dialog"],
|
|
112
|
+
"centered": [4],
|
|
113
|
+
"staticBackdrop": [4, "static-backdrop"],
|
|
114
|
+
"autoOpen": [4, "auto-open"],
|
|
115
|
+
"isOpen": [32],
|
|
116
|
+
"getState": [64],
|
|
117
|
+
"setState": [64],
|
|
118
|
+
"toggle": [64],
|
|
119
|
+
"close": [64],
|
|
120
|
+
"open": [64]
|
|
121
|
+
}]);
|
|
122
|
+
function defineCustomElement$1() {
|
|
123
|
+
if (typeof customElements === "undefined") {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const components = ["uofg-modal"];
|
|
127
|
+
components.forEach(tagName => { switch (tagName) {
|
|
128
|
+
case "uofg-modal":
|
|
129
|
+
if (!customElements.get(tagName)) {
|
|
130
|
+
customElements.define(tagName, UofgModal$1);
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
} });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const UofgModal = UofgModal$1;
|
|
137
|
+
const defineCustomElement = defineCustomElement$1;
|
|
138
|
+
|
|
139
|
+
export { UofgModal, defineCustomElement };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const WEB_ANIMATIONS_SUPPORTED = 'animate' in HTMLElement.prototype;
|
|
2
|
+
const PREFERS_REDUCED_MOTION = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
3
|
+
const getAllFocusableElements = (container) => {
|
|
4
|
+
const query = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [contenteditable], audio[controls], video[controls], details, summary, [tabindex]:not([tabindex="-1"])';
|
|
5
|
+
return Array.from(container.querySelectorAll(query));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { PREFERS_REDUCED_MOTION as P, WEB_ANIMATIONS_SUPPORTED as W, getAllFocusableElements as g };
|
|
@@ -253,6 +253,10 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
253
253
|
// but we'll cheat here and say that the string "false" is the boolean false
|
|
254
254
|
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
255
255
|
}
|
|
256
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
257
|
+
// force it to be a number
|
|
258
|
+
return parseFloat(propValue);
|
|
259
|
+
}
|
|
256
260
|
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
257
261
|
// could have been passed as a number or boolean
|
|
258
262
|
// but we still want it as a string
|
|
@@ -913,7 +917,9 @@ const patch = (oldVNode, newVNode) => {
|
|
|
913
917
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
914
918
|
}
|
|
915
919
|
{
|
|
916
|
-
|
|
920
|
+
if (tag === 'slot')
|
|
921
|
+
;
|
|
922
|
+
else {
|
|
917
923
|
// either this is the first render of an element OR it's an update
|
|
918
924
|
// AND we already know it's possible it could have changed
|
|
919
925
|
// this updates the element's css classes, attrs, props, listeners, etc.
|
|
@@ -1491,12 +1497,16 @@ const connectedCallback = (elm) => {
|
|
|
1491
1497
|
const disconnectedCallback = (elm) => {
|
|
1492
1498
|
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1493
1499
|
const hostRef = getHostRef(elm);
|
|
1500
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
1494
1501
|
{
|
|
1495
1502
|
if (hostRef.$rmListeners$) {
|
|
1496
1503
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1497
1504
|
hostRef.$rmListeners$ = undefined;
|
|
1498
1505
|
}
|
|
1499
1506
|
}
|
|
1507
|
+
{
|
|
1508
|
+
safeCall(instance, 'disconnectedCallback');
|
|
1509
|
+
}
|
|
1500
1510
|
}
|
|
1501
1511
|
};
|
|
1502
1512
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-ebf79156.js';
|
|
2
|
+
export { s as setNonce } from './index-ebf79156.js';
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
6
|
-
return bootstrapLazy([["uofg-
|
|
6
|
+
return bootstrapLazy([["uofg-alert_6",[[1,"uofg-header",{"pageTitle":[1,"page-title"],"pageUrl":[1,"page-url"],"isFullSize":[32],"pageSpecificContent":[32]},[[9,"resize","updateFullSize"]]],[1,"uofg-alert"],[1,"uofg-back-to-top",{"threshold":[2],"isVisible":[32]},[[9,"scroll","onScroll"]]],[1,"uofg-footer"],[1,"uofg-modal",{"label":[1],"alertDialog":[4,"alert-dialog"],"centered":[4],"staticBackdrop":[4,"static-backdrop"],"autoOpen":[4,"auto-open"],"isOpen":[32],"getState":[64],"setState":[64],"toggle":[64],"close":[64],"open":[64]}],[0,"uofg-menu",{"autoCollapse":[4,"auto-collapse"],"isExpanded":[32],"getExpanded":[64],"setExpanded":[64],"toggle":[64],"collapse":[64],"expand":[64]}]]]], options);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { defineCustomElements };
|