@uoguelph/web-components 1.1.2 → 1.2.0-rc.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.
Files changed (83) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/{index-00f6c6f1.js → index-06b58d35.js} +5 -5
  3. package/dist/cjs/{index-d71963b7.js → index-cdb046b4.js} +149 -44
  4. package/dist/cjs/loader.cjs.js +5 -3
  5. package/dist/cjs/uofg-alert.cjs.entry.js +11 -10
  6. package/dist/cjs/uofg-back-to-top_5.cjs.entry.js +1374 -0
  7. package/dist/cjs/uofg-modal.cjs.entry.js +152 -142
  8. package/dist/cjs/uofg-web-components.cjs.js +6 -4
  9. package/dist/cjs/utils-3d4b7e2e.js +16 -0
  10. package/dist/collection/collection-manifest.json +2 -2
  11. package/dist/collection/components/uofg-alert/uofg-alert.css +1 -75
  12. package/dist/collection/components/uofg-alert/uofg-alert.js +15 -15
  13. package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.css +1 -40
  14. package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.js +66 -63
  15. package/dist/collection/components/uofg-card/uofg-card.css +1 -95
  16. package/dist/collection/components/uofg-card/uofg-card.js +42 -40
  17. package/dist/collection/components/uofg-footer/uofg-footer.css +1 -249
  18. package/dist/collection/components/uofg-footer/uofg-footer.js +132 -40
  19. package/dist/collection/components/uofg-header/logo-full.svg +1 -1
  20. package/dist/collection/components/uofg-header/uofg-header.css +1 -542
  21. package/dist/collection/components/uofg-header/uofg-header.js +238 -157
  22. package/dist/collection/components/uofg-menu/uofg-menu.js +414 -410
  23. package/dist/collection/components/uofg-modal/uofg-modal.css +1 -113
  24. package/dist/collection/components/uofg-modal/uofg-modal.js +393 -386
  25. package/dist/collection/utils/font-awesome-icon.js +4 -4
  26. package/dist/collection/utils/utils.js +5 -5
  27. package/dist/components/font-awesome-icon.js +4 -4
  28. package/dist/components/uofg-alert.d.ts +2 -2
  29. package/dist/components/uofg-alert.js +22 -21
  30. package/dist/components/uofg-back-to-top.d.ts +2 -2
  31. package/dist/components/uofg-back-to-top.js +38 -34
  32. package/dist/components/uofg-card.d.ts +2 -2
  33. package/dist/components/uofg-card.js +28 -25
  34. package/dist/components/uofg-footer.d.ts +2 -2
  35. package/dist/components/uofg-footer.js +243 -115
  36. package/dist/components/uofg-header.d.ts +2 -2
  37. package/dist/components/uofg-header.js +235 -144
  38. package/dist/components/uofg-menu.d.ts +2 -2
  39. package/dist/components/uofg-menu2.js +245 -239
  40. package/dist/components/uofg-modal.d.ts +2 -2
  41. package/dist/components/uofg-modal.js +176 -166
  42. package/dist/components/utils.js +4 -4
  43. package/dist/esm/app-globals-0f993ce5.js +3 -0
  44. package/dist/esm/{index-284464b7.js → index-0b0002d2.js} +149 -44
  45. package/dist/esm/{index-a0a2924b.js → index-e685921a.js} +5 -5
  46. package/dist/esm/loader.js +6 -4
  47. package/dist/esm/uofg-alert.entry.js +11 -10
  48. package/dist/esm/uofg-back-to-top_5.entry.js +1366 -0
  49. package/dist/esm/uofg-modal.entry.js +152 -142
  50. package/dist/esm/uofg-web-components.js +7 -5
  51. package/dist/esm/utils-379bb71a.js +12 -0
  52. package/dist/types/components/uofg-alert/uofg-alert.d.ts +1 -1
  53. package/dist/types/components/uofg-back-to-top/uofg-back-to-top.d.ts +8 -8
  54. package/dist/types/components/uofg-card/uofg-card.d.ts +5 -5
  55. package/dist/types/components/uofg-footer/uofg-footer.d.ts +6 -6
  56. package/dist/types/components/uofg-header/uofg-header.d.ts +30 -29
  57. package/dist/types/components/uofg-menu/uofg-menu.d.ts +65 -65
  58. package/dist/types/components/uofg-modal/uofg-modal.d.ts +70 -70
  59. package/dist/types/components.d.ts +27 -1
  60. package/dist/types/stencil-public-runtime.d.ts +29 -0
  61. package/dist/types/utils/font-awesome-icon.d.ts +1 -1
  62. package/dist/uofg-web-components/{p-8bb65209.js → p-6fa0f8f6.js} +1 -1
  63. package/dist/uofg-web-components/p-7569d8f2.entry.js +1 -0
  64. package/dist/uofg-web-components/p-bce5df9d.entry.js +1 -0
  65. package/dist/uofg-web-components/p-e1255160.js +1 -0
  66. package/dist/uofg-web-components/p-ee27db22.js +2 -0
  67. package/dist/uofg-web-components/p-fde6370b.entry.js +1 -0
  68. package/dist/uofg-web-components/uofg-web-components.css +1 -1
  69. package/dist/uofg-web-components/uofg-web-components.esm.js +1 -1
  70. package/package.json +12 -7
  71. package/dist/cjs/uofg-back-to-top_4.cjs.entry.js +0 -1139
  72. package/dist/cjs/uofg-card.cjs.entry.js +0 -21
  73. package/dist/cjs/utils-582c8cb9.js +0 -16
  74. package/dist/components/_commonjsHelpers.js +0 -15
  75. package/dist/esm/uofg-back-to-top_4.entry.js +0 -1132
  76. package/dist/esm/uofg-card.entry.js +0 -17
  77. package/dist/esm/utils-cfa32fa2.js +0 -12
  78. package/dist/uofg-web-components/p-204e5cf7.entry.js +0 -1
  79. package/dist/uofg-web-components/p-3d5269a9.entry.js +0 -1
  80. package/dist/uofg-web-components/p-9429a69e.entry.js +0 -1
  81. package/dist/uofg-web-components/p-ba36e942.js +0 -2
  82. package/dist/uofg-web-components/p-e063f0e4.entry.js +0 -1
  83. /package/dist/uofg-web-components/{p-826dc478.js → p-fec87f9d.js} +0 -0
@@ -4,259 +4,265 @@ import { W as WEB_ANIMATIONS_SUPPORTED, P as PREFERS_REDUCED_MOTION } from './ut
4
4
  const DURATION_REGEX = /^(\d*\.?\d+)(s|ms)$/;
5
5
  const EASING_FUNCTION_REGEX = /^cubic-bezier\((\s*-?\d*\.?\d+\s*,){3}\s*-?\d*\.?\d+\s*\)$|^steps\(\s*\d+\s*(,\s*(start|end))?\s*\)$/;
6
6
  const UofgMenu = /*@__PURE__*/ proxyCustomElement(class UofgMenu extends HTMLElement {
7
- constructor() {
8
- super();
9
- this.__registerHost();
10
- this.expanded = createEvent(this, "expanded", 2);
11
- this.collapsed = createEvent(this, "collapsed", 2);
12
- this.animationStarted = createEvent(this, "animationStarted", 2);
13
- this.animationEnded = createEvent(this, "animationEnded", 2);
14
- this.computedStyle = null;
15
- this.button = null;
16
- this.content = null;
17
- this.contentComputedStyle = null;
18
- this.observer = new MutationObserver(this.handleMutation);
19
- this.isExpanded = false;
20
- this.autoCollapse = false;
21
- }
22
- connectedCallback() {
23
- // Bind functions so that "this" correctly refers to the component's instance.
24
- this.handleMutation = this.handleMutation.bind(this);
25
- this.handleClick = this.handleClick.bind(this);
26
- this.handleFocusout = this.handleFocusout.bind(this);
27
- this.handleKeyUp = this.handleKeyUp.bind(this);
28
- this.computedStyle = window.getComputedStyle(this.el);
29
- this.handleMutation();
30
- this.observer.observe(this.el, { childList: true });
31
- }
32
- disconnectedCallback() {
33
- this.observer.disconnect();
34
- }
35
- handleMutation() {
36
- // Update the button element
37
- const button = this.el.querySelector('[slot="button"]');
38
- // Set up the new button
39
- button === null || button === void 0 ? void 0 : button.setAttribute('aria-expanded', this.isExpanded ? 'true' : 'false');
40
- button === null || button === void 0 ? void 0 : button.setAttribute('aria-haspopup', 'true');
41
- this.button = button;
42
- // Update the content element
43
- const content = this.el.querySelector('[slot="content"]');
44
- if (content == null) {
45
- this.content = null;
46
- this.contentComputedStyle = null;
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.expanded = createEvent(this, "expanded", 2);
11
+ this.collapsed = createEvent(this, "collapsed", 2);
12
+ this.animationStarted = createEvent(this, "animationStarted", 2);
13
+ this.animationEnded = createEvent(this, "animationEnded", 2);
14
+ this.computedStyle = null;
15
+ this.button = null;
16
+ this.content = null;
17
+ this.contentComputedStyle = null;
18
+ this.observer = new MutationObserver(this.handleMutation);
19
+ this.isExpanded = false;
20
+ this.autoCollapse = false;
47
21
  }
48
- else {
49
- this.content = content;
50
- this.content.style.display = this.isExpanded ? '' : 'none';
51
- this.contentComputedStyle = window.getComputedStyle(this.content);
22
+ connectedCallback() {
23
+ // Bind functions so that "this" correctly refers to the component's instance.
24
+ this.handleMutation = this.handleMutation.bind(this);
25
+ this.handleClick = this.handleClick.bind(this);
26
+ this.handleFocusout = this.handleFocusout.bind(this);
27
+ this.handleKeyUp = this.handleKeyUp.bind(this);
28
+ this.computedStyle = window.getComputedStyle(this.el);
29
+ this.handleMutation();
30
+ this.observer.observe(this.el, { childList: true });
52
31
  }
53
- }
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
- }
32
+ disconnectedCallback() {
33
+ this.observer.disconnect();
34
+ }
35
+ handleMutation() {
36
+ // Update the button element
37
+ const button = this.el.querySelector('[slot="button"]');
38
+ // Set up the new button
39
+ button === null || button === void 0 ? void 0 : button.setAttribute('aria-expanded', this.isExpanded ? 'true' : 'false');
40
+ button === null || button === void 0 ? void 0 : button.setAttribute('aria-haspopup', 'true');
41
+ this.button = button;
42
+ // Update the content element
43
+ const content = this.el.querySelector('[slot="content"]');
44
+ if (content == null) {
45
+ this.content = null;
46
+ this.contentComputedStyle = null;
47
+ }
48
+ else {
49
+ this.content = content;
50
+ this.isExpanded
51
+ ? this.content.style.removeProperty('display')
52
+ : this.content.style.setProperty('display', 'none', 'important');
53
+ this.contentComputedStyle = window.getComputedStyle(this.content);
54
+ }
55
+ }
56
+ handleKeyUp(e) {
57
+ if (e.key === 'Escape') {
58
+ this.isExpanded = false;
59
+ if (e.target !== this.button) {
60
+ e.stopPropagation();
61
+ this.isExpanded = false;
62
+ this.button && this.button.focus();
63
+ }
64
+ }
65
+ }
66
+ handleClick(e) {
67
+ //Check if the click was on the button or a descendant of the button
68
+ if (this.button && this.button.contains(e.target)) {
69
+ this.isExpanded = !this.isExpanded;
70
+ return;
71
+ }
72
+ }
73
+ handleFocusout(e) {
74
+ if (this.autoCollapse && !this.el.contains(e.relatedTarget)) {
75
+ this.isExpanded = false;
76
+ }
62
77
  }
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;
78
+ handleIsExpandedChange(newValue) {
79
+ var _a, _b, _c;
80
+ (_a = this.button) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', newValue ? 'true' : 'false');
81
+ newValue ? this.expanded.emit() : this.collapsed.emit();
82
+ // No content is slotted, so we don't need to do anything else.
83
+ if (this.content == null) {
84
+ return;
85
+ }
86
+ // Determine what animation type the user wants.
87
+ const type = this.getAnimationType();
88
+ // If Web Animations API isn't supported, or the user requested no animation, we can simply set display style
89
+ if (!WEB_ANIMATIONS_SUPPORTED() || PREFERS_REDUCED_MOTION() || type === 'none') {
90
+ newValue
91
+ ? this.content.style.removeProperty('display')
92
+ : this.content.style.setProperty('display', 'none', 'important');
93
+ return;
94
+ }
95
+ // Check if we are in the middle of an animation.
96
+ const animations = (_b = this.content) === null || _b === void 0 ? void 0 : _b.getAnimations().filter(animation => animation.id === 'uofg-menu-animation');
97
+ // If we are, then we want to reverse the existing one rather than starting a new animation.
98
+ if (animations.length > 0) {
99
+ animations === null || animations === void 0 ? void 0 : animations.forEach(animation => animation.reverse());
100
+ return;
101
+ }
102
+ let animationDef;
103
+ const options = {
104
+ id: 'uofg-menu-animation',
105
+ duration: this.getAnimationDuration(),
106
+ fill: 'none',
107
+ easing: this.getAnimationEasing(),
108
+ direction: newValue ? 'normal' : 'reverse',
109
+ };
110
+ // Need to remove display none, otherwise keyframe values won't be calculated correctly.
111
+ this.content.style.removeProperty('display');
112
+ switch (type) {
113
+ case 'fade':
114
+ animationDef = this.fadeAnimation();
115
+ break;
116
+ case 'slide':
117
+ animationDef = this.slideAnimation();
118
+ break;
119
+ default:
120
+ animationDef = this.fadeAnimation();
121
+ }
122
+ // We can start the animation.
123
+ this.animationStarted.emit(newValue);
124
+ (_c = this.content) === null || _c === void 0 ? void 0 : _c.animate(animationDef.keyframes, options).finished.finally(() => {
125
+ var _a;
126
+ // Once the animation is done (or something went wrong during it), we update the content's display style.
127
+ if (this.content) {
128
+ this.isExpanded
129
+ ? this.content.style.removeProperty('display')
130
+ : this.content.style.setProperty('display', 'none', 'important');
131
+ (_a = animationDef.callback) === null || _a === void 0 ? void 0 : _a.call(animationDef);
132
+ this.animationEnded.emit(this.isExpanded);
133
+ }
134
+ });
69
135
  }
70
- }
71
- handleFocusout(e) {
72
- if (this.autoCollapse && !this.el.contains(e.relatedTarget)) {
73
- this.isExpanded = false;
136
+ getAnimationType() {
137
+ var _a;
138
+ const str = ((_a = this.computedStyle) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--uofg-menu-animation-type')) || '';
139
+ switch (str) {
140
+ case 'slide':
141
+ case 'fade':
142
+ return str;
143
+ default:
144
+ return 'none';
145
+ }
74
146
  }
75
- }
76
- handleIsExpandedChange(newValue) {
77
- var _a, _b, _c;
78
- (_a = this.button) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', newValue ? 'true' : 'false');
79
- newValue ? this.expanded.emit() : this.collapsed.emit();
80
- // No content is slotted, so we don't need to do anything else.
81
- if (this.content == null) {
82
- return;
147
+ getAnimationDuration() {
148
+ var _a;
149
+ const str = ((_a = this.computedStyle) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--uofg-menu-animation-duration')) || '';
150
+ const matches = DURATION_REGEX.exec(str);
151
+ if (matches == null) {
152
+ return 200;
153
+ }
154
+ return Number.parseFloat(matches[1]) * (matches[2] == 's' ? 1000 : 1);
83
155
  }
84
- // Determine what animation type the user wants.
85
- const type = this.getAnimationType();
86
- // If Web Animations API isn't supported, or the user requested no animation, we can simply set display style
87
- if (!WEB_ANIMATIONS_SUPPORTED() || PREFERS_REDUCED_MOTION() || type === 'none') {
88
- this.content.style.display = newValue ? '' : 'none';
89
- return;
156
+ getAnimationEasing() {
157
+ var _a;
158
+ const str = ((_a = this.computedStyle) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--uofg-menu-animation-easing')) || '';
159
+ switch (str) {
160
+ case 'linear':
161
+ case 'ease':
162
+ case 'ease-in':
163
+ case 'ease-out':
164
+ case 'ease-in-out':
165
+ case 'step-start':
166
+ case 'step-end':
167
+ return str;
168
+ default:
169
+ return EASING_FUNCTION_REGEX.test(str) ? str : 'ease-in-out';
170
+ }
90
171
  }
91
- // Check if we are in the middle of an animation.
92
- const animations = (_b = this.content) === null || _b === void 0 ? void 0 : _b.getAnimations().filter(animation => animation.id === 'uofg-menu-animation');
93
- // If we are, then we want to reverse the existing one rather than starting a new animation.
94
- if (animations.length > 0) {
95
- animations === null || animations === void 0 ? void 0 : animations.forEach(animation => animation.reverse());
96
- return;
172
+ fadeAnimation() {
173
+ return { keyframes: [{ opacity: 0 }, { opacity: 1 }] };
97
174
  }
98
- let animationDef;
99
- const options = {
100
- id: 'uofg-menu-animation',
101
- duration: this.getAnimationDuration(),
102
- fill: 'none',
103
- easing: this.getAnimationEasing(),
104
- direction: newValue ? 'normal' : 'reverse',
105
- };
106
- // Need to remove display none, otherwise keyframe values won't be calculated correctly.
107
- this.content.style.display = '';
108
- switch (type) {
109
- case 'fade':
110
- animationDef = this.fadeAnimation();
111
- break;
112
- case 'slide':
113
- animationDef = this.slideAnimation();
114
- break;
115
- default:
116
- animationDef = this.fadeAnimation();
175
+ slideAnimation() {
176
+ var _a, _b, _c, _d, _e;
177
+ this.content && this.content.style.setProperty('overflow-y', 'hidden', 'important');
178
+ return {
179
+ keyframes: [
180
+ {
181
+ height: 0,
182
+ paddingTop: 0,
183
+ paddingBottom: 0,
184
+ marginTop: 0,
185
+ marginBottom: 0,
186
+ },
187
+ {
188
+ height: ((_a = this.contentComputedStyle) === null || _a === void 0 ? void 0 : _a.height) || 0,
189
+ paddingTop: ((_b = this.contentComputedStyle) === null || _b === void 0 ? void 0 : _b.paddingTop) || 0,
190
+ paddingBottom: ((_c = this.contentComputedStyle) === null || _c === void 0 ? void 0 : _c.paddingBottom) || 0,
191
+ marginTop: ((_d = this.contentComputedStyle) === null || _d === void 0 ? void 0 : _d.marginTop) || 0,
192
+ marginBottom: ((_e = this.contentComputedStyle) === null || _e === void 0 ? void 0 : _e.marginBottom) || 0,
193
+ },
194
+ ],
195
+ callback: () => {
196
+ this.content && this.content.style.removeProperty('overflow-y');
197
+ },
198
+ };
117
199
  }
118
- // We can start the animation.
119
- this.animationStarted.emit(newValue);
120
- (_c = this.content) === null || _c === void 0 ? void 0 : _c.animate(animationDef.keyframes, options).finished.finally(() => {
121
- var _a;
122
- // Once the animation is done (or something went wrong during it), we update the content's display style.
123
- if (this.content) {
124
- this.content.style.display = this.isExpanded ? '' : 'none';
125
- (_a = animationDef.callback) === null || _a === void 0 ? void 0 : _a.call(animationDef);
126
- this.animationEnded.emit(this.isExpanded);
127
- }
128
- });
129
- }
130
- getAnimationType() {
131
- var _a;
132
- const str = ((_a = this.computedStyle) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--uofg-menu-animation-type')) || '';
133
- switch (str) {
134
- case 'slide':
135
- case 'fade':
136
- return str;
137
- default:
138
- return 'none';
200
+ render() {
201
+ return (h(Host, { key: '40c0e7a6dd7f457145ed744aaf86595f72566f8c', "data-expanded": this.isExpanded, tabindex: -1, onFocusout: this.handleFocusout, onKeyUp: this.handleKeyUp, onClick: this.handleClick }));
139
202
  }
140
- }
141
- getAnimationDuration() {
142
- var _a;
143
- const str = ((_a = this.computedStyle) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--uofg-menu-animation-duration')) || '';
144
- const matches = DURATION_REGEX.exec(str);
145
- if (matches == null) {
146
- return 200;
203
+ /**
204
+ * Get the current expanded state of the menu.
205
+ * @returns A promise which will resolve to the current expanded state.
206
+ */
207
+ async getExpanded() {
208
+ return this.isExpanded;
147
209
  }
148
- return Number.parseFloat(matches[1]) * (matches[2] == 's' ? 1000 : 1);
149
- }
150
- getAnimationEasing() {
151
- var _a;
152
- const str = ((_a = this.computedStyle) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--uofg-menu-animation-easing')) || '';
153
- switch (str) {
154
- case 'linear':
155
- case 'ease':
156
- case 'ease-in':
157
- case 'ease-out':
158
- case 'ease-in-out':
159
- case 'step-start':
160
- case 'step-end':
161
- return str;
162
- default:
163
- return EASING_FUNCTION_REGEX.test(str) ? str : 'ease-in-out';
210
+ /**
211
+ * Set the expanded state of the menu.
212
+ * @param value The new expanded state.
213
+ */
214
+ async setExpanded(value) {
215
+ this.isExpanded = value;
164
216
  }
165
- }
166
- fadeAnimation() {
167
- return { keyframes: [{ opacity: 0 }, { opacity: 1 }] };
168
- }
169
- slideAnimation() {
170
- var _a, _b, _c, _d, _e;
171
- this.content && (this.content.style.overflowY = 'hidden');
172
- return {
173
- keyframes: [
174
- {
175
- height: 0,
176
- paddingTop: 0,
177
- paddingBottom: 0,
178
- marginTop: 0,
179
- marginBottom: 0,
180
- },
181
- {
182
- height: ((_a = this.contentComputedStyle) === null || _a === void 0 ? void 0 : _a.height) || 0,
183
- paddingTop: ((_b = this.contentComputedStyle) === null || _b === void 0 ? void 0 : _b.paddingTop) || 0,
184
- paddingBottom: ((_c = this.contentComputedStyle) === null || _c === void 0 ? void 0 : _c.paddingBottom) || 0,
185
- marginTop: ((_d = this.contentComputedStyle) === null || _d === void 0 ? void 0 : _d.marginTop) || 0,
186
- marginBottom: ((_e = this.contentComputedStyle) === null || _e === void 0 ? void 0 : _e.marginBottom) || 0,
187
- },
188
- ],
189
- callback: () => {
190
- this.content && (this.content.style.overflowY = '');
191
- },
192
- };
193
- }
194
- render() {
195
- return (h(Host, { "data-expanded": this.isExpanded, tabindex: -1, onFocusout: this.handleFocusout, onKeyUp: this.handleKeyUp, onClick: this.handleClick }));
196
- }
197
- /**
198
- * Get the current expanded state of the menu.
199
- * @returns A promise which will resolve to the current expanded state.
200
- */
201
- async getExpanded() {
202
- return this.isExpanded;
203
- }
204
- /**
205
- * Set the expanded state of the menu.
206
- * @param value The new expanded state.
207
- */
208
- async setExpanded(value) {
209
- this.isExpanded = value;
210
- }
211
- /**
212
- * Toggle the expanded state of the menu.
213
- * @returns A promise which will resolve to the new expanded state.
214
- */
215
- async toggle() {
216
- this.isExpanded = !this.isExpanded;
217
- return this.isExpanded;
218
- }
219
- /**
220
- * Collapse the menu. This is the same as setting the expanded state to false.
221
- * @returns empty Promise.
222
- */
223
- async collapse() {
224
- this.isExpanded = false;
225
- }
226
- /**
227
- * Expand the menu. This is the same as setting the expanded state to true.
228
- * @returns empty Promise.
229
- */
230
- async expand() {
231
- this.isExpanded = true;
232
- }
233
- get el() { return this; }
234
- static get watchers() { return {
235
- "isExpanded": ["handleIsExpandedChange"]
236
- }; }
217
+ /**
218
+ * Toggle the expanded state of the menu.
219
+ * @returns A promise which will resolve to the new expanded state.
220
+ */
221
+ async toggle() {
222
+ this.isExpanded = !this.isExpanded;
223
+ return this.isExpanded;
224
+ }
225
+ /**
226
+ * Collapse the menu. This is the same as setting the expanded state to false.
227
+ * @returns empty Promise.
228
+ */
229
+ async collapse() {
230
+ this.isExpanded = false;
231
+ }
232
+ /**
233
+ * Expand the menu. This is the same as setting the expanded state to true.
234
+ * @returns empty Promise.
235
+ */
236
+ async expand() {
237
+ this.isExpanded = true;
238
+ }
239
+ get el() { return this; }
240
+ static get watchers() { return {
241
+ "isExpanded": ["handleIsExpandedChange"]
242
+ }; }
237
243
  }, [0, "uofg-menu", {
238
- "autoCollapse": [4, "auto-collapse"],
239
- "isExpanded": [32],
240
- "getExpanded": [64],
241
- "setExpanded": [64],
242
- "toggle": [64],
243
- "collapse": [64],
244
- "expand": [64]
245
- }, undefined, {
246
- "isExpanded": ["handleIsExpandedChange"]
247
- }]);
244
+ "autoCollapse": [4, "auto-collapse"],
245
+ "isExpanded": [32],
246
+ "getExpanded": [64],
247
+ "setExpanded": [64],
248
+ "toggle": [64],
249
+ "collapse": [64],
250
+ "expand": [64]
251
+ }, undefined, {
252
+ "isExpanded": ["handleIsExpandedChange"]
253
+ }]);
248
254
  function defineCustomElement() {
249
- if (typeof customElements === "undefined") {
250
- return;
251
- }
252
- const components = ["uofg-menu"];
253
- components.forEach(tagName => { switch (tagName) {
254
- case "uofg-menu":
255
- if (!customElements.get(tagName)) {
256
- customElements.define(tagName, UofgMenu);
257
- }
258
- break;
259
- } });
255
+ if (typeof customElements === "undefined") {
256
+ return;
257
+ }
258
+ const components = ["uofg-menu"];
259
+ components.forEach(tagName => { switch (tagName) {
260
+ case "uofg-menu":
261
+ if (!customElements.get(tagName)) {
262
+ customElements.define(tagName, UofgMenu);
263
+ }
264
+ break;
265
+ } });
260
266
  }
261
267
 
262
268
  export { UofgMenu as U, defineCustomElement as d };
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../types/components";
2
2
 
3
3
  interface UofgModal extends Components.UofgModal, HTMLElement {}
4
4
  export const UofgModal: {
5
- prototype: UofgModal;
6
- new (): UofgModal;
5
+ prototype: UofgModal;
6
+ new (): UofgModal;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.