@caweb/framework 1.9.5 → 1.9.7

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.
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'a72d1beae01bd2203977');
1
+ <?php return array('dependencies' => array(), 'version' => '08c3b84f79cf22ad52e0');
package/build/delta.js CHANGED
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'd13d9589eecfacf0469d');
1
+ <?php return array('dependencies' => array(), 'version' => '59577dbf33c239360ff6');
package/build/eureka.js CHANGED
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => '7786c7108dfe1248bd33');
1
+ <?php return array('dependencies' => array(), 'version' => '749fb9ca88b310fc5808');
package/build/mono.js CHANGED
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'bb2dda282afc55a09dd3');
1
+ <?php return array('dependencies' => array(), 'version' => 'facf1679643c43bef391');
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'a88a61f0884df9303968');
1
+ <?php return array('dependencies' => array(), 'version' => '4966fcebe5c624012423');
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => '3a655e5256466c7b8e7d');
1
+ <?php return array('dependencies' => array(), 'version' => '2313f6a8a387984fec4d');
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => '46795bfd62876c67937d');
1
+ <?php return array('dependencies' => array(), 'version' => '8a7cdd00cc8a6cb526bb');
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'b941c263dada6b7424a1');
1
+ <?php return array('dependencies' => array(), 'version' => '1eea98344491bd6397d3');
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => '9e5a3ec701cb3c1c0dcc');
1
+ <?php return array('dependencies' => array(), 'version' => '7e05e0670700dd32b37a');
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'be89f9e1ec010255b838');
1
+ <?php return array('dependencies' => array(), 'version' => '7ac303d0448cd57e2ebc');
package/build/shasta.js CHANGED
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => '976a69f8f72d74f9b94e');
1
+ <?php return array('dependencies' => array(), 'version' => '024ed79f9a5840628291');
package/build/sierra.js CHANGED
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => '74f95d595640fb9df9f0');
1
+ <?php return array('dependencies' => array(), 'version' => '5408553fe1746433cc1f');
package/build/trinity.js CHANGED
@@ -36,7 +36,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\n\n/* EXTERNAL L
36
36
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
37
37
 
38
38
  "use strict";
39
- eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n let compactedElementsHeight = compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // for each element with an id we add the scroll-margin-top\n document.querySelectorAll('#page-container [id]').forEach(element => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n });\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
39
+ eval("{__webpack_require__.r(__webpack_exports__);\n//@ts-check\nwindow.addEventListener('DOMContentLoaded', () => {\n let location_hash = window.location.hash.replace(/(\\|)/g, \"\\\\$1\");\n const header = document.querySelector('header');\n const pageContainer = document.querySelector('#page-container');\n\n // array of elements that are compacted\n const compactedElements = [document.querySelector('.alerts'), document.querySelector('.utility-header')].filter(Boolean);\n const getCompactedElementsHeight = () => {\n return compactedElements.reduce((total, element) => {\n if (element instanceof HTMLElement) {\n return total + element.clientHeight;\n }\n return total;\n }, 0);\n };\n let compactedElementsHeight = getCompactedElementsHeight();\n\n // lets collect the height of any fixed elements above the header.\n let topOffset = 0;\n let current = header?.previousElementSibling;\n while (current) {\n // if current element has a fixed position, add its height to the topOffset.\n if (current instanceof HTMLElement && window.getComputedStyle(current).position === 'fixed') {\n topOffset += current.clientHeight;\n }\n current = current.previousElementSibling;\n }\n\n // scroll to target\n if (location_hash) {\n // location hash has leading #, so we remove it\n let target = document.getElementById(location_hash.substring(1));\n\n // if the location hash is not empty, we scroll to the target element\n requestAnimationFrame(() => {\n target?.scrollIntoView({\n behavior: 'smooth'\n });\n });\n }\n if (!header) {\n return;\n }\n const compactHeader = () => {\n // downscroll code passed the header height\n if (document.body.scrollTop >= header.offsetHeight || document.documentElement.scrollTop >= header.offsetHeight) {\n // move the header up to hide the compacted elements height, minus the top offset.\n header.style.top = `-${compactedElementsHeight - topOffset}px`;\n } else {\n // reset header to initial position\n // we need to set the header's top to the offset.\n if (header) {\n header.style.top = `${topOffset}px`;\n }\n\n // if we have a page container, we need to set its top padding to the offset\n if (pageContainer && pageContainer instanceof HTMLElement) {\n pageContainer.style.paddingTop = `${topOffset}px`;\n }\n }\n };\n\n // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.\n document.querySelectorAll('header .alerts [data-bs-dismiss=\"alert\"]').forEach(closeButton => {\n closeButton.addEventListener('click', () => {\n compactedElementsHeight = getCompactedElementsHeight();\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n });\n });\n\n // for each element with an id we add the scroll-margin-top\n const updateScrollMarginTop = (/** @type Element */element) => {\n if (element instanceof HTMLElement) {\n let scrollMarginHeight = header.clientHeight + topOffset;\n\n // if the elements offsetTop is greater than twice the header size, \n // we can assume the header is compacted\n // so we need to subtract the compacted elements height from the scroll margin.\n if (element.offsetTop > scrollMarginHeight + scrollMarginHeight / 2) {\n scrollMarginHeight -= compactedElementsHeight;\n }\n element.style.scrollMarginTop = `${scrollMarginHeight}px`;\n }\n };\n\n // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.\n document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);\n\n // reset position on scroll\n window.addEventListener('scroll', compactHeader);\n compactHeader();\n});\n\n//# sourceURL=webpack://@caweb/framework/./src/scripts/components/header.js?\n}");
40
40
 
41
41
  /***/ },
42
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/framework",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
4
4
  "description": "Official CAWebPublishing Framework frontend toolkit",
5
5
  "author": "CAWebPublishing",
6
6
  "homepage": "https://github.com/CAWebPublishing/framework#readme",
@@ -11,7 +11,8 @@ window.addEventListener('DOMContentLoaded', () => {
11
11
  document.querySelector('.utility-header'),
12
12
  ].filter(Boolean);
13
13
 
14
- let compactedElementsHeight = compactedElements.reduce((total, element) => {
14
+ const getCompactedElementsHeight = () => {
15
+ return compactedElements.reduce((total, element) => {
15
16
  if( element instanceof HTMLElement ){
16
17
  return total + element.clientHeight;
17
18
  }
@@ -19,6 +20,9 @@ window.addEventListener('DOMContentLoaded', () => {
19
20
  return total;
20
21
 
21
22
  }, 0);
23
+ }
24
+
25
+ let compactedElementsHeight = getCompactedElementsHeight();
22
26
 
23
27
  // lets collect the height of any fixed elements above the header.
24
28
  let topOffset = 0;
@@ -52,7 +56,6 @@ window.addEventListener('DOMContentLoaded', () => {
52
56
 
53
57
 
54
58
  const compactHeader = () => {
55
-
56
59
  // downscroll code passed the header height
57
60
  if (document.body.scrollTop >= header.offsetHeight ||
58
61
  document.documentElement.scrollTop >= header.offsetHeight
@@ -76,21 +79,32 @@ window.addEventListener('DOMContentLoaded', () => {
76
79
 
77
80
  };
78
81
 
82
+ // we need to update the compacted elements height if an alert is closed, so we listen for the alert close event and update the compacted elements height.
83
+ document.querySelectorAll('header .alerts [data-bs-dismiss="alert"]').forEach((closeButton) => {
84
+ closeButton.addEventListener('click', () => {
85
+ compactedElementsHeight = getCompactedElementsHeight();
86
+ document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);
87
+ });
88
+ });
89
+
79
90
  // for each element with an id we add the scroll-margin-top
80
- document.querySelectorAll('#page-container [id]').forEach((element) => {
91
+ const updateScrollMarginTop = (/** @type Element */ element) => {
81
92
  if( element instanceof HTMLElement ){
82
- let scrollMarginHeight = header.clientHeight + topOffset;
83
-
84
- // if the elements offsetTop is greater than twice the header size,
85
- // we can assume the header is compacted
86
- // so we need to subtract the compacted elements height from the scroll margin.
87
- if( element.offsetTop > scrollMarginHeight + (scrollMarginHeight / 2) ){
88
- scrollMarginHeight -= compactedElementsHeight;
89
- }
93
+ let scrollMarginHeight = header.clientHeight + topOffset;
94
+
95
+ // if the elements offsetTop is greater than twice the header size,
96
+ // we can assume the header is compacted
97
+ // so we need to subtract the compacted elements height from the scroll margin.
98
+ if( element.offsetTop > scrollMarginHeight + (scrollMarginHeight / 2) ){
99
+ scrollMarginHeight -= compactedElementsHeight;
100
+ }
101
+
102
+ element.style.scrollMarginTop = `${scrollMarginHeight}px`;
103
+ }
104
+ }
90
105
 
91
- element.style.scrollMarginTop = `${scrollMarginHeight}px`;
92
- }
93
- });
106
+ // add scroll margin top to all elements with an id, so that when we scroll to them, they are not hidden behind the header.
107
+ document.querySelectorAll('#page-container [id]').forEach(updateScrollMarginTop);
94
108
 
95
109
  // reset position on scroll
96
110
  window.addEventListener(