@content-blocks/js 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/content-accordion_11.cjs.entry.js +40 -38
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +1 -1
- package/dist/cjs/content-blocks.cjs.js +1 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js +1 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/blocks/content-text-block/content-text-block.css +8 -8
- package/dist/collection/blocks/content-text-block/content-text-block.js +4 -4
- package/dist/collection/blocks/content-text-block/content-text-block.js.map +1 -1
- package/dist/collection/components/content-accordion/content-accordion.js +2 -4
- package/dist/collection/components/content-accordion/content-accordion.js.map +1 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +1 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +1 -1
- package/dist/collection/components/content-overlay/content-overlay.css +6 -6
- package/dist/collection/components/content-overlay/content-overlay.js +8 -8
- package/dist/collection/components/content-overlay/content-overlay.js.map +1 -1
- package/dist/collection/elements/content-button/content-button.js +0 -1
- package/dist/collection/elements/content-button/content-button.js.map +1 -1
- package/dist/collection/elements/content-image/content-image.js +18 -15
- package/dist/collection/elements/content-image/content-image.js.map +1 -1
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +12 -12
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -1
- package/dist/collection/formatters/content-spacer/content-spacer.css +16 -3
- package/dist/collection/formatters/content-spacer/content-spacer.js +45 -4
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +1 -1
- package/dist/collection/stories/ContentHeroBlock.stories.js +2 -2
- package/dist/collection/stories/ContentHeroBlock.stories.js.map +1 -1
- package/dist/collection/stories/FullPageExample.stories.js +11 -11
- package/dist/collection/stories/FullPageExample.stories.js.map +1 -1
- package/dist/components/content-accordion.js +2 -3
- package/dist/components/content-accordion.js.map +1 -1
- package/dist/components/content-button.js +1 -1
- package/dist/components/content-button.js.map +1 -1
- package/dist/components/content-carousel.js +1 -0
- package/dist/components/content-carousel.js.map +1 -1
- package/dist/components/content-grid-formatter2.js +11 -10
- package/dist/components/content-grid-formatter2.js.map +1 -1
- package/dist/components/content-hero-block.js +1 -0
- package/dist/components/content-hero-block.js.map +1 -1
- package/dist/components/content-image.js +19 -15
- package/dist/components/content-image.js.map +1 -1
- package/dist/components/content-line.js +1 -0
- package/dist/components/content-line.js.map +1 -1
- package/dist/components/content-navigation-block.js +2 -1
- package/dist/components/content-navigation-block.js.map +1 -1
- package/dist/components/content-overlay.js +8 -7
- package/dist/components/content-overlay.js.map +1 -1
- package/dist/components/content-spacer.js +8 -4
- package/dist/components/content-spacer.js.map +1 -1
- package/dist/components/content-split-block.js +1 -0
- package/dist/components/content-split-block.js.map +1 -1
- package/dist/components/content-tabs.js +1 -0
- package/dist/components/content-tabs.js.map +1 -1
- package/dist/components/content-text-block.js +5 -4
- package/dist/components/content-text-block.js.map +1 -1
- package/dist/components/content-tout-block.js +1 -0
- package/dist/components/content-tout-block.js.map +1 -1
- package/dist/components/content-video.js +1 -0
- package/dist/components/content-video.js.map +1 -1
- package/dist/content-blocks/content-blocks.esm.js +1 -1
- package/dist/content-blocks/content-blocks.esm.js.map +1 -1
- package/dist/content-blocks/p-24657e66.entry.js +10 -0
- package/dist/content-blocks/p-24657e66.entry.js.map +1 -0
- package/dist/content-blocks/{p-167a9155.entry.js → p-6a177aef.entry.js} +2 -2
- package/dist/content-blocks/{p-167a9155.entry.js.map → p-6a177aef.entry.js.map} +1 -1
- package/dist/esm/content-accordion_11.entry.js +40 -38
- package/dist/esm/content-accordion_11.entry.js.map +1 -1
- package/dist/esm/content-blocks.js +1 -1
- package/dist/esm/content-navigation-block.entry.js +1 -1
- package/dist/esm/content-navigation-block.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/blocks/content-text-block/content-text-block.d.ts +1 -1
- package/dist/types/components/content-accordion/content-accordion.d.ts +0 -1
- package/dist/types/components/content-overlay/content-overlay.d.ts +2 -2
- package/dist/types/components.d.ts +30 -12
- package/dist/types/elements/content-button/content-button.d.ts +2 -2
- package/dist/types/elements/content-image/content-image.d.ts +1 -0
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +2 -2
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +11 -2
- package/package.json +1 -1
- package/dist/content-blocks/p-4038cd42.entry.js +0 -10
- package/dist/content-blocks/p-4038cd42.entry.js.map +0 -1
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["content-split-block.cjs",[[4,"content-split-block",{"reverse":[1544],"columns":[1],"classes":[1537],"classString":[32]}]]],["content-carousel.cjs",[[4,"content-carousel",{"initMethod":[1,"init-method"],"swiperOptions":[1,"swiper-options"]},[[0,"setSwiperOptions","setSwiperOptionsCallback"]]]]],["content-navigation-block.cjs",[[4,"content-navigation-block",{"hamburger":[1537],"classes":[1537],"classString":[32],"ariaExpanded":[32],"bodyToggle":[32]}]]],["content-tabs.cjs",[[4,"content-tabs",{"classes":[1537],"classString":[32]}]]],["content-accordion_11.cjs",[[4,"content-accordion",{"open":[1],"animationStart":[1,"animation-start"],"animationEnd":[1,"animation-end"],"animationTime":[2,"animation-time"],"revealElement":[32],"isOpen":[32],"randomID":[32],"classString":[32]}],[4,"content-button",{"href":[1537],"target":[1],"classes":[1],"clickableBlock":[4,"clickable-block"],"expanded":[1537],"controls":[1],"linkLabel":[1,"link-label"],"linkClass":[1537,"link-class"],"classString":[32],"hasContentToActivate":[32]}],[4,"content-hero-block",{"contentPosition":[1537,"content-position"],"classes":[1],"hasBackground":[32],"classString":[32],"revealHiddenContent":[32]},[[8,"contentBlockActivated","contentBlockActivationHandler"]]],[4,"content-image",{"classes":[1537],"lazyLoad":[4,"lazy-load"],"src":[1025],"alt":[1537],"width":[1025],"height":[1025],"aspectRatio":[1025,"aspect-ratio"],"type":[1],"videoType":[1,"video-type"],"showContent":[1537,"show-content"],"activeSrc":[32],"lazyLoadIsComplete":[32],"showVideoAsGif":[32],"activeLazyLoadClass":[32],"classString":[32],"inlineStyle":[32],"hasMediaContent":[32],"pictureImageSrc":[32]},null,{"lazyLoadIsComplete":["watchLazyLoadIsComplete"]}],[4,"content-line",{"tag":[1],"textAlign":[1,"text-align"],"classes":[8],"maxWidth":[1,"max-width"],"classString":[32],"inlineStyle":[32]}],[4,"content-overlay",{"target":[1],"open":[1537],"fullScreen":[1,"full-screen"],"classes":[1],"
|
|
20
|
+
return index.bootstrapLazy([["content-split-block.cjs",[[4,"content-split-block",{"reverse":[1544],"columns":[1],"classes":[1537],"classString":[32]}]]],["content-carousel.cjs",[[4,"content-carousel",{"initMethod":[1,"init-method"],"swiperOptions":[1,"swiper-options"]},[[0,"setSwiperOptions","setSwiperOptionsCallback"]]]]],["content-navigation-block.cjs",[[4,"content-navigation-block",{"hamburger":[1537],"classes":[1537],"classString":[32],"ariaExpanded":[32],"bodyToggle":[32]}]]],["content-tabs.cjs",[[4,"content-tabs",{"classes":[1537],"classString":[32]}]]],["content-accordion_11.cjs",[[4,"content-accordion",{"open":[1],"animationStart":[1,"animation-start"],"animationEnd":[1,"animation-end"],"animationTime":[2,"animation-time"],"revealElement":[32],"isOpen":[32],"randomID":[32],"classString":[32]}],[4,"content-button",{"href":[1537],"target":[1],"classes":[1],"clickableBlock":[4,"clickable-block"],"expanded":[1537],"controls":[1],"linkLabel":[1,"link-label"],"linkClass":[1537,"link-class"],"classString":[32],"hasContentToActivate":[32]}],[4,"content-hero-block",{"contentPosition":[1537,"content-position"],"classes":[1],"hasBackground":[32],"classString":[32],"revealHiddenContent":[32]},[[8,"contentBlockActivated","contentBlockActivationHandler"]]],[4,"content-image",{"classes":[1537],"lazyLoad":[4,"lazy-load"],"src":[1025],"alt":[1537],"width":[1025],"height":[1025],"aspectRatio":[1025,"aspect-ratio"],"type":[1],"videoType":[1,"video-type"],"showContent":[1537,"show-content"],"activeSrc":[32],"lazyLoadIsComplete":[32],"showVideoAsGif":[32],"activeLazyLoadClass":[32],"classString":[32],"inlineStyle":[32],"hasMediaContent":[32],"pictureImageSrc":[32]},null,{"lazyLoadIsComplete":["watchLazyLoadIsComplete"]}],[4,"content-line",{"tag":[1],"textAlign":[1,"text-align"],"classes":[8],"maxWidth":[1,"max-width"],"classString":[32],"inlineStyle":[32]}],[4,"content-overlay",{"target":[1],"open":[1537],"fullScreen":[1,"full-screen"],"classes":[1],"horizontal":[1537],"vertical":[1537],"closeTitle":[1,"close-title"],"isActive":[32],"activeClass":[32],"classString":[32],"contentSlot":[32],"isFullScreen":[32],"hasCloseButton":[32],"originalMarkup":[32],"openOverlay":[64],"closeOverlay":[64]},[[0,"contentBlockActivated","onContentBlockActivated"]]],[4,"content-spacer",{"classes":[1],"maxWidth":[1,"max-width"],"fullHeight":[1537,"full-height"],"textAlign":[1537,"text-align"],"horizontal":[1537],"vertical":[1537],"topOffset":[1,"top-offset"],"bottomOffset":[1,"bottom-offset"],"leftOffset":[1,"left-offset"],"rightOffset":[1,"right-offset"],"classString":[32],"inlineStyle":[32]}],[4,"content-text-block",{"classes":[1],"minHeight":[1537,"min-height"],"vertical":[1537],"fullHeight":[1537,"full-height"],"textAlign":[1537,"text-align"],"classString":[32],"inlineStyle":[32]}],[4,"content-tout-block",{"hover":[1537],"classes":[1],"classString":[32],"hasHoverContent":[32]}],[4,"content-video",{"method":[1],"autoplay":[4],"src":[1],"width":[2],"height":[2],"type":[1],"playButtonAriaLabel":[1,"play-button-aria-label"],"classes":[1537],"controls":[4],"preload":[1],"fitContainer":[1537,"fit-container"],"classString":[32],"isLoaded":[32],"hasPoster":[32],"isPlayed":[32]}],[4,"content-grid-formatter",{"classes":[1],"type":[1537],"flexGrow":[1537,"flex-grow"],"flexShrink":[1537,"flex-shrink"],"vertical":[1537],"horizontal":[1537],"columns":[1537],"columnGap":[1537,"column-gap"],"classString":[32],"activeClassString":[32],"inlineStyle":[32]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -55,7 +55,7 @@ const ContentNavigationBlock = class {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
return (index.h(index.Host, { class: this.classString, "aria-expanded": this.ariaExpanded }, index.h("slot",
|
|
58
|
+
return (index.h(index.Host, { class: this.classString, "aria-expanded": this.ariaExpanded }, index.h("slot", { name: "openButton" }), index.h("slot", { name: "closeButton" }), index.h("div", { class: "content-navigation__menu" }, index.h("slot", { name: "content" }), index.h("slot", null))));
|
|
59
59
|
}
|
|
60
60
|
get hostElement() { return index.getElement(this); }
|
|
61
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"content-navigation-block.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,yvDAAyvD;;MCe9wD,sBAAsB;;;yBAaH,YAAY;;;4BAaV,OAAO;0BACR,KAAK;;IAEpC,iBAAiB;QACfA,uCAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,QAAQ;YACjE,IAAI,CAAC,SAAS,GAAG,QAAkB,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC;YAC7C,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;SACjE,CAAC,CAAC;QACHA,uCAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ;YAC/D,IAAI,CAAC,WAAW,GAAG,QAAkB,CAAC;SACvC,CAAC,CAAC;KACJ;IAED,gBAAgB;QACd,IAAI,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,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,CAAC;iBACjE;qBAAM,IAAI,IAAI,CAAC,UAAU,EAAE;oBAC1B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;iBAC9D;gBACD,UAAU,CAAC,MAAM,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;aAC1C,CAAC;SACH;QACD,IAAI,WAAW,EAAE;YACf,WAAW,CAAC,OAAO,GAAG;gBACpB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;gBAC5B,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBACvC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;gBAChE,UAAU,CAAC,MAAM,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;aACzC,CAAC;SACH;KACF;IAED,MAAM;QACJ,QACEC,QAACC,UAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW,mBAAiB,IAAI,CAAC,YAAY,IAC7DD,kBAAM,IAAI,EAAC,YAAY,GAAQ,EAC/BA,kBAAM,IAAI,EAAC,aAAa,GAAQ,EAChCA,iBAAK,KAAK,EAAC,0BAA0B,IACnCA,kBAAM,IAAI,EAAC,SAAS,GAAQ,EAC5BA,qBAAa,CACT,CACD,EACP;KACH;;;;;;;","names":["WindowResizeService","h","Host"],"sources":["src/components/content-navigation-block/content-navigation-block.scss?tag=content-navigation-block","src/components/content-navigation-block/content-navigation-block.tsx"],"sourcesContent":["body.content-navigation-block-open {\n overflow: hidden;\n}\ncontent-navigation-block {\n &[hamburger=\"fixed\"],\n &[hamburger=\"absolute\"],\n &[hamburger=\"static\"] {\n display: inline-block;\n &[aria-expanded=\"false\"] {\n [slot=\"closeButton\"] {\n display: none;\n }\n }\n [slot=\"openButton\"],\n [slot=\"closeButton\"] {\n cursor: pointer;\n }\n \n [slot=\"content\"] {\n display: none;\n background: white;\n &[hidden=\"false\"] {\n display: block;\n }\n }\n }\n\n &[hamburger=\"fixed\"] {\n [slot=\"content\"] {\n position: fixed;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100%;\n z-index: 100;\n }\n }\n &[hamburger=\"absolute\"] {\n [slot=\"content\"] {\n position: absolute;\n z-index: 100;\n }\n }\n &[hamburger=\"static\"] {\n [slot=\"content\"] {\n position: static;\n }\n }\n \n &[hamburger=\"none\"] {\n display: block;\n [slot=\"openButton\"],\n [slot=\"closeButton\"] {\n display: none;\n }\n }\n}","import { Component, Prop, Host, h, State, Element } from '@stencil/core';\nimport { HTMLStencilElement } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ResponsiveString } from '../../typings';\n\n/**\n * @slot openButton - This slot will expand the navigation when clicked.\n * @slot closeButton - This slot will close the navigation when clicked.\n * @slot content - Default slot\n */\n@Component({\n tag: 'content-navigation-block',\n styleUrl: 'content-navigation-block.scss',\n shadow: false,\n})\nexport class ContentNavigationBlock {\n /**\n * @type Select\n * @responsive\n * @options fixed\n * @options absolute\n * @options static\n * @options none\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n hamburger: ResponsiveString = 'fixed|none';\n\n /**\n * @type String\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n classes: ResponsiveString;\n @State() classString;\n @Element() hostElement: HTMLStencilElement;\n @State() ariaExpanded: string = 'false';\n @State() bodyToggle: boolean = false;\n\n componentWillLoad() {\n WindowResizeService.registerProp(this.hamburger).subscribe(newValue => {\n this.hamburger = newValue as string;\n this.bodyToggle = this.hamburger === 'fixed';\n document.body.classList.remove('content-navigation-block-open');\n });\n WindowResizeService.registerProp(this.classes).subscribe(newValue => {\n this.classString = newValue as string;\n });\n }\n\n componentDidLoad() {\n let openButton = this.hostElement.querySelector('[slot=\"openButton\"]') as HTMLElement;\n let closeButton = this.hostElement.querySelector('[slot=\"closeButton\"]') as HTMLElement;\n let content = this.hostElement.querySelector('[slot=\"content\"]') as HTMLElement;\n if (openButton) {\n openButton.onclick = () => {\n this.ariaExpanded = this.ariaExpanded === 'true' ? 'false' : 'true';\n content.setAttribute('hidden', this.ariaExpanded === 'false' ? 'true' : 'false');\n if (this.ariaExpanded === 'false') {\n document.body.classList.remove('content-navigation-block-open');\n } else if (this.bodyToggle) {\n document.body.classList.add('content-navigation-block-open');\n }\n setTimeout(() => closeButton.focus(), 1);\n };\n }\n if (closeButton) {\n closeButton.onclick = () => {\n this.ariaExpanded = 'false';\n content.setAttribute('hidden', 'true');\n document.body.classList.remove('content-navigation-block-open');\n setTimeout(() => openButton.focus(), 1);\n };\n }\n }\n\n render() {\n return (\n <Host class={this.classString} aria-expanded={this.ariaExpanded}>\n <slot name=\"openButton\"></slot>\n <slot name=\"closeButton\"></slot>\n <div class=\"content-navigation__menu\">\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ const index = require('./index-9f20d89a.js');
|
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy([["content-split-block.cjs",[[4,"content-split-block",{"reverse":[1544],"columns":[1],"classes":[1537],"classString":[32]}]]],["content-carousel.cjs",[[4,"content-carousel",{"initMethod":[1,"init-method"],"swiperOptions":[1,"swiper-options"]},[[0,"setSwiperOptions","setSwiperOptionsCallback"]]]]],["content-navigation-block.cjs",[[4,"content-navigation-block",{"hamburger":[1537],"classes":[1537],"classString":[32],"ariaExpanded":[32],"bodyToggle":[32]}]]],["content-tabs.cjs",[[4,"content-tabs",{"classes":[1537],"classString":[32]}]]],["content-accordion_11.cjs",[[4,"content-accordion",{"open":[1],"animationStart":[1,"animation-start"],"animationEnd":[1,"animation-end"],"animationTime":[2,"animation-time"],"revealElement":[32],"isOpen":[32],"randomID":[32],"classString":[32]}],[4,"content-button",{"href":[1537],"target":[1],"classes":[1],"clickableBlock":[4,"clickable-block"],"expanded":[1537],"controls":[1],"linkLabel":[1,"link-label"],"linkClass":[1537,"link-class"],"classString":[32],"hasContentToActivate":[32]}],[4,"content-hero-block",{"contentPosition":[1537,"content-position"],"classes":[1],"hasBackground":[32],"classString":[32],"revealHiddenContent":[32]},[[8,"contentBlockActivated","contentBlockActivationHandler"]]],[4,"content-image",{"classes":[1537],"lazyLoad":[4,"lazy-load"],"src":[1025],"alt":[1537],"width":[1025],"height":[1025],"aspectRatio":[1025,"aspect-ratio"],"type":[1],"videoType":[1,"video-type"],"showContent":[1537,"show-content"],"activeSrc":[32],"lazyLoadIsComplete":[32],"showVideoAsGif":[32],"activeLazyLoadClass":[32],"classString":[32],"inlineStyle":[32],"hasMediaContent":[32],"pictureImageSrc":[32]},null,{"lazyLoadIsComplete":["watchLazyLoadIsComplete"]}],[4,"content-line",{"tag":[1],"textAlign":[1,"text-align"],"classes":[8],"maxWidth":[1,"max-width"],"classString":[32],"inlineStyle":[32]}],[4,"content-overlay",{"target":[1],"open":[1537],"fullScreen":[1,"full-screen"],"classes":[1],"
|
|
9
|
+
return index.bootstrapLazy([["content-split-block.cjs",[[4,"content-split-block",{"reverse":[1544],"columns":[1],"classes":[1537],"classString":[32]}]]],["content-carousel.cjs",[[4,"content-carousel",{"initMethod":[1,"init-method"],"swiperOptions":[1,"swiper-options"]},[[0,"setSwiperOptions","setSwiperOptionsCallback"]]]]],["content-navigation-block.cjs",[[4,"content-navigation-block",{"hamburger":[1537],"classes":[1537],"classString":[32],"ariaExpanded":[32],"bodyToggle":[32]}]]],["content-tabs.cjs",[[4,"content-tabs",{"classes":[1537],"classString":[32]}]]],["content-accordion_11.cjs",[[4,"content-accordion",{"open":[1],"animationStart":[1,"animation-start"],"animationEnd":[1,"animation-end"],"animationTime":[2,"animation-time"],"revealElement":[32],"isOpen":[32],"randomID":[32],"classString":[32]}],[4,"content-button",{"href":[1537],"target":[1],"classes":[1],"clickableBlock":[4,"clickable-block"],"expanded":[1537],"controls":[1],"linkLabel":[1,"link-label"],"linkClass":[1537,"link-class"],"classString":[32],"hasContentToActivate":[32]}],[4,"content-hero-block",{"contentPosition":[1537,"content-position"],"classes":[1],"hasBackground":[32],"classString":[32],"revealHiddenContent":[32]},[[8,"contentBlockActivated","contentBlockActivationHandler"]]],[4,"content-image",{"classes":[1537],"lazyLoad":[4,"lazy-load"],"src":[1025],"alt":[1537],"width":[1025],"height":[1025],"aspectRatio":[1025,"aspect-ratio"],"type":[1],"videoType":[1,"video-type"],"showContent":[1537,"show-content"],"activeSrc":[32],"lazyLoadIsComplete":[32],"showVideoAsGif":[32],"activeLazyLoadClass":[32],"classString":[32],"inlineStyle":[32],"hasMediaContent":[32],"pictureImageSrc":[32]},null,{"lazyLoadIsComplete":["watchLazyLoadIsComplete"]}],[4,"content-line",{"tag":[1],"textAlign":[1,"text-align"],"classes":[8],"maxWidth":[1,"max-width"],"classString":[32],"inlineStyle":[32]}],[4,"content-overlay",{"target":[1],"open":[1537],"fullScreen":[1,"full-screen"],"classes":[1],"horizontal":[1537],"vertical":[1537],"closeTitle":[1,"close-title"],"isActive":[32],"activeClass":[32],"classString":[32],"contentSlot":[32],"isFullScreen":[32],"hasCloseButton":[32],"originalMarkup":[32],"openOverlay":[64],"closeOverlay":[64]},[[0,"contentBlockActivated","onContentBlockActivated"]]],[4,"content-spacer",{"classes":[1],"maxWidth":[1,"max-width"],"fullHeight":[1537,"full-height"],"textAlign":[1537,"text-align"],"horizontal":[1537],"vertical":[1537],"topOffset":[1,"top-offset"],"bottomOffset":[1,"bottom-offset"],"leftOffset":[1,"left-offset"],"rightOffset":[1,"right-offset"],"classString":[32],"inlineStyle":[32]}],[4,"content-text-block",{"classes":[1],"minHeight":[1537,"min-height"],"vertical":[1537],"fullHeight":[1537,"full-height"],"textAlign":[1537,"text-align"],"classString":[32],"inlineStyle":[32]}],[4,"content-tout-block",{"hover":[1537],"classes":[1],"classString":[32],"hasHoverContent":[32]}],[4,"content-video",{"method":[1],"autoplay":[4],"src":[1],"width":[2],"height":[2],"type":[1],"playButtonAriaLabel":[1,"play-button-aria-label"],"classes":[1537],"controls":[4],"preload":[1],"fitContainer":[1537,"fit-container"],"classString":[32],"isLoaded":[32],"hasPoster":[32],"isPlayed":[32]}],[4,"content-grid-formatter",{"classes":[1],"type":[1537],"flexGrow":[1537,"flex-grow"],"flexShrink":[1537,"flex-shrink"],"vertical":[1537],"horizontal":[1537],"columns":[1537],"columnGap":[1537,"column-gap"],"classString":[32],"activeClassString":[32],"inlineStyle":[32]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -17,32 +17,32 @@ content-text-block > *[slot=footer] {
|
|
|
17
17
|
padding-top: 1rem;
|
|
18
18
|
height: auto;
|
|
19
19
|
}
|
|
20
|
-
content-text-block[vertical
|
|
20
|
+
content-text-block[vertical=bottom] > [slot=footer] {
|
|
21
21
|
position: static;
|
|
22
22
|
height: auto;
|
|
23
23
|
}
|
|
24
|
-
content-text-block[vertical
|
|
24
|
+
content-text-block[vertical] {
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
}
|
|
28
|
-
content-text-block[vertical
|
|
28
|
+
content-text-block[vertical=top] {
|
|
29
29
|
justify-content: flex-start;
|
|
30
30
|
}
|
|
31
|
-
content-text-block[vertical
|
|
31
|
+
content-text-block[vertical=center] {
|
|
32
32
|
justify-content: center;
|
|
33
33
|
}
|
|
34
|
-
content-text-block[vertical
|
|
34
|
+
content-text-block[vertical=center][footer=true] .content-text-block__content {
|
|
35
35
|
margin-top: auto;
|
|
36
36
|
margin-bottom: 0;
|
|
37
37
|
}
|
|
38
|
-
content-text-block[vertical
|
|
38
|
+
content-text-block[vertical=bottom] {
|
|
39
39
|
justify-content: flex-end;
|
|
40
40
|
}
|
|
41
|
-
content-text-block[vertical
|
|
41
|
+
content-text-block[vertical=bottom][footer=true] .content-text-block__content {
|
|
42
42
|
margin-top: auto;
|
|
43
43
|
margin-bottom: 0;
|
|
44
44
|
}
|
|
45
|
-
content-text-block[vertical
|
|
45
|
+
content-text-block[vertical=bottom][footer=true] > [slot=footer] {
|
|
46
46
|
margin-top: 0;
|
|
47
47
|
}
|
|
48
48
|
content-text-block[text-align=left] {
|
|
@@ -10,7 +10,7 @@ export class ContentTextBlock {
|
|
|
10
10
|
this.classes = undefined;
|
|
11
11
|
this.classString = undefined;
|
|
12
12
|
this.minHeight = undefined;
|
|
13
|
-
this.
|
|
13
|
+
this.vertical = 'top';
|
|
14
14
|
this.fullHeight = 'false';
|
|
15
15
|
this.textAlign = 'default';
|
|
16
16
|
this.inlineStyle = {};
|
|
@@ -23,7 +23,7 @@ export class ContentTextBlock {
|
|
|
23
23
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { 'min-height': isNaN(newValue) ? newValue : newValue + 'px' });
|
|
24
24
|
});
|
|
25
25
|
WindowResizeService.registerProp(this.textAlign).subscribe(newValue => this.hostElement.setAttribute('text-align', newValue));
|
|
26
|
-
WindowResizeService.registerProp(this.
|
|
26
|
+
WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue));
|
|
27
27
|
WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => {
|
|
28
28
|
this.hostElement.setAttribute('full-height', newValue);
|
|
29
29
|
});
|
|
@@ -103,7 +103,7 @@ export class ContentTextBlock {
|
|
|
103
103
|
"attribute": "min-height",
|
|
104
104
|
"reflect": true
|
|
105
105
|
},
|
|
106
|
-
"
|
|
106
|
+
"vertical": {
|
|
107
107
|
"type": "string",
|
|
108
108
|
"mutable": true,
|
|
109
109
|
"complexType": {
|
|
@@ -138,7 +138,7 @@ export class ContentTextBlock {
|
|
|
138
138
|
}],
|
|
139
139
|
"text": "Pipe separated list of ContentVerticalAlignments for text box placement."
|
|
140
140
|
},
|
|
141
|
-
"attribute": "vertical
|
|
141
|
+
"attribute": "vertical",
|
|
142
142
|
"reflect": true,
|
|
143
143
|
"defaultValue": "'top'"
|
|
144
144
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-text-block.js","sourceRoot":"","sources":["../../../../src/blocks/content-text-block/content-text-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAsB,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAI3E;;;;GAIG;AAMH,MAAM,OAAO,gBAAgB;;;;;
|
|
1
|
+
{"version":3,"file":"content-text-block.js","sourceRoot":"","sources":["../../../../src/blocks/content-text-block/content-text-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAsB,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAI3E;;;;GAIG;AAMH,MAAM,OAAO,gBAAgB;;;;;wBAgCW,KAAK;0BAUZ,OAAO;yBAeG,SAAS;2BAEC,EAAE;;IACrD,iBAAiB;QACf,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAClD,CAAC;QACD,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YACpE,IAAI,CAAC,WAAW,mCAAQ,IAAI,CAAC,WAAW,KAAE,YAAY,EAAE,KAAK,CAAC,QAAe,CAAC,CAAC,CAAC,CAAE,QAAmB,CAAC,CAAC,CAAC,QA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;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Element, State } from '@stencil/core';\nimport { HTMLStencilElement, Prop } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ContentVerticalAlignments, ResponsiveString, ContentLineTextAlignOptions } from '../../typings';\nimport { objectToCssString } from '../../utils/utils';\n\n/**\n * @slot content - This slot will usually serve a text block.\n * @slot footer - This slot is placed below the content slot\n * @slot - Default slot, same as content slot\n */\n@Component({\n tag: 'content-text-block',\n styleUrl: 'content-text-block.scss',\n shadow: false,\n})\nexport class ContentTextBlock {\n /**\n * This is a pipe separated string representing the style class.\n * @type String\n * @responsive\n */\n @Prop() classes: ResponsiveString;\n @State() classString;\n\n /**\n * This is a pipe separated string representing the minimum height. Units without values default to pixels.\n * @type String\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n minHeight: ResponsiveString;\n\n /**\n * Pipe separated list of ContentVerticalAlignments for text box placement.\n * @type Select\n * @options top\n * @options center\n * @options bottom\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n vertical: ContentVerticalAlignments = 'top';\n\n /**\n * @type Boolean\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n fullHeight: ResponsiveString = 'false';\n\n /**\n * Pipe separated list of ContentLineTextAlignOptions for text alignment.\n * @type Select\n * @options default\n * @options left\n * @options center\n * @options right\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n textAlign: ContentLineTextAlignOptions = 'default';\n @Element() hostElement: HTMLStencilElement;\n @State() inlineStyle?: { [key: string]: string } = {};\n componentWillLoad() {\n if (!!this.hostElement.querySelector('[slot=\"footer\"]')) {\n this.hostElement.setAttribute('footer', 'true');\n }\n WindowResizeService.registerProp(this.minHeight).subscribe(newValue => {\n this.inlineStyle = { ...this.inlineStyle, 'min-height': isNaN(newValue as any) ? (newValue as string) : newValue + 'px' };\n });\n WindowResizeService.registerProp(this.textAlign).subscribe(newValue => this.hostElement.setAttribute('text-align', newValue as ContentLineTextAlignOptions));\n WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue as ContentVerticalAlignments));\n WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => {\n this.hostElement.setAttribute('full-height', newValue as string);\n });\n WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue as string));\n }\n render() {\n return (\n <Host class={this.classString} style={this.inlineStyle}>\n <div class=\"content-text-block__content\">\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n <slot name=\"footer\"></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import { WindowResizeService } from "../../services/window-resize-service";
|
|
|
7
7
|
export class ContentAccordion {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.revealElement = undefined;
|
|
10
|
-
this.open = 'false
|
|
10
|
+
this.open = 'false';
|
|
11
11
|
this.animationStart = 'animation-start';
|
|
12
12
|
this.animationEnd = 'animation-end';
|
|
13
13
|
this.animationTime = 0;
|
|
@@ -44,8 +44,6 @@ export class ContentAccordion {
|
|
|
44
44
|
else {
|
|
45
45
|
this.randomID = `${this.hostElement.tagName}_${Math.floor(Math.random() * document.querySelectorAll(this.hostElement.tagName).length)}`;
|
|
46
46
|
}
|
|
47
|
-
}
|
|
48
|
-
componentDidLoad() {
|
|
49
47
|
WindowResizeService.registerProp(this.open).subscribe(newValue => {
|
|
50
48
|
this.isOpen = newValue === 'true';
|
|
51
49
|
if (this.isOpen) {
|
|
@@ -97,7 +95,7 @@ export class ContentAccordion {
|
|
|
97
95
|
},
|
|
98
96
|
"attribute": "open",
|
|
99
97
|
"reflect": false,
|
|
100
|
-
"defaultValue": "'false
|
|
98
|
+
"defaultValue": "'false'"
|
|
101
99
|
},
|
|
102
100
|
"animationStart": {
|
|
103
101
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-accordion.js","sourceRoot":"","sources":["../../../../src/components/content-accordion/content-accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAe,IAAI,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAGlE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E;;;GAGG;AAMH,MAAM,OAAO,gBAAgB;;;oBASO,
|
|
1
|
+
{"version":3,"file":"content-accordion.js","sourceRoot":"","sources":["../../../../src/components/content-accordion/content-accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAe,IAAI,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAGlE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E;;;GAGG;AAMH,MAAM,OAAO,gBAAgB;;;oBASO,OAAO;8BAKhB,iBAAiB;4BAMnB,eAAe;6BAMd,CAAC;sBAEP,KAAK;wBACK,EAAE;2BACP,EAAE;;IAGzB,gBAAgB,CAAC,CAAa;QAC5B,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC,aAAa;QACvD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACtD,CAAC,EAAE,CAAC,CAAC,CAAC;QACR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AAK,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM;YAClD,cAAQ,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,mBAAiB,IAAI,CAAC,MAAM,mBAAiB,IAAI,CAAC,QAAQ;gBACtG,YAAM,IAAI,EAAC,SAAS,GAAQ,CACrB;YACT,WAAK,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,uDAAuD;gBACnF,YAAM,IAAI,EAAC,SAAS,GAAQ;gBAC5B,eAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Element } from '@stencil/core';\nimport { HostElement, Prop, State } from '@stencil/core/internal';\nimport W3DisclosureButton from './libraries/w3_disclosure_button';\nimport { ResponsiveBoolean } from '../../typings';\nimport { WindowResizeService } from '../../services/window-resize-service';\n\n/**\n * @slot content - This slot will usually serve a content button.\n * @slot - Default slot, same as content slot.\n */\n@Component({\n tag: 'content-accordion',\n styleUrl: 'content-accordion.scss',\n shadow: false,\n})\nexport class ContentAccordion {\n @Element() hostElement: HostElement;\n\n @State() revealElement!: HTMLDivElement;\n /**\n *\n * @type Boolean\n * @responsive\n */\n @Prop() open: ResponsiveBoolean = 'false';\n /**\n * The starting animation class in case you want to control content styling.\n * @type String\n */\n @Prop() animationStart = 'animation-start';\n\n /**\n * The ending animation class in case you want to control content styling.\n * @type String\n */\n @Prop() animationEnd = 'animation-end';\n\n /**\n * The amount of time in milliseconds to run the closing animation, before the class is removed\n * @type Number\n */\n @Prop() animationTime = 0;\n\n @State() isOpen = false;\n @State() randomID: string = '';\n @State() classString = '';\n\n timeoutHolder;\n handleClickEvent(e: MouseEvent) {\n this.animateAccordion(!this.isOpen);\n }\n\n animateAccordion(open, animationTime = this.animationTime) {\n if (this.timeoutHolder) {\n clearTimeout(this.timeoutHolder);\n }\n if (open) {\n this.isOpen = true;\n this.timeoutHolder = setTimeout(() => {\n this.hostElement.classList.add(this.animationStart);\n }, 0);\n } else {\n this.hostElement.classList.add(this.animationEnd);\n this.timeoutHolder = setTimeout(() => {\n this.hostElement.classList.remove(this.animationStart, this.animationEnd);\n this.isOpen = false;\n }, animationTime);\n }\n }\n\n componentWillLoad() {\n this.revealElement = this.hostElement.querySelector('.js-content-accordion-reveal');\n if (this.hostElement.id) {\n this.randomID = `${this.hostElement.tagName}_${this.hostElement.id}`;\n } else {\n this.randomID = `${this.hostElement.tagName}_${Math.floor(Math.random() * document.querySelectorAll(this.hostElement.tagName).length)}`;\n }\n WindowResizeService.registerProp(this.open).subscribe(newValue => {\n this.isOpen = newValue === 'true';\n if (this.isOpen) {\n this.animateAccordion(true);\n }\n });\n }\n\n render() {\n return (\n <Host class={this.classString} expanded={this.isOpen}>\n <button onClick={e => this.handleClickEvent(e)} aria-expanded={this.isOpen} aria-controls={this.randomID}>\n <slot name=\"trigger\"></slot>\n </button>\n <div id={this.randomID} class=\"js-content-accordion-reveal content-accordion__reveal\">\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -50,7 +50,7 @@ export class ContentNavigationBlock {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
|
-
return (h(Host, { class: this.classString, "aria-expanded": this.ariaExpanded }, h("slot",
|
|
53
|
+
return (h(Host, { class: this.classString, "aria-expanded": this.ariaExpanded }, h("slot", { name: "openButton" }), h("slot", { name: "closeButton" }), h("div", { class: "content-navigation__menu" }, h("slot", { name: "content" }), h("slot", null))));
|
|
54
54
|
}
|
|
55
55
|
static get is() { return "content-navigation-block"; }
|
|
56
56
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-navigation-block.js","sourceRoot":"","sources":["../../../../src/components/content-navigation-block/content-navigation-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAG3E;;;;GAIG;AAMH,MAAM,OAAO,sBAAsB;;yBAaH,YAAY;;;4BAaV,OAAO;0BACR,KAAK;;IAEpC,iBAAiB;QACf,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YACpE,IAAI,CAAC,SAAS,GAAG,QAAkB,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC;YAC7C,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;QACH,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YAClE,IAAI,CAAC,WAAW,GAAG,QAAkB,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;QACd,IAAI,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAgB,CAAC;QACtF,IAAI,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,sBAAsB,CAAgB,CAAC;QACxF,IAAI,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAgB,CAAC;QAChF,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,OAAO,GAAG,GAAG,EAAE;gBACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;gBACpE,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBACjF,IAAI,IAAI,CAAC,YAAY,KAAK,OAAO,EAAE,CAAC;oBAClC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;gBAClE,CAAC;qBAAM,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;oBAC3B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;gBAC/D,CAAC;gBACD,UAAU,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3C,CAAC,CAAC;QACJ,CAAC;QACD,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,OAAO,GAAG,GAAG,EAAE;gBACzB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;gBAC5B,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBACvC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;gBAChE,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;YAC1C,CAAC,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW,mBAAiB,IAAI,CAAC,YAAY;YAC7D,
|
|
1
|
+
{"version":3,"file":"content-navigation-block.js","sourceRoot":"","sources":["../../../../src/components/content-navigation-block/content-navigation-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,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'@stencil/core';\nimport { HTMLStencilElement } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ResponsiveString } from '../../typings';\n\n/**\n * @slot openButton - This slot will expand the navigation when clicked.\n * @slot closeButton - This slot will close the navigation when clicked.\n * @slot content - Default slot\n */\n@Component({\n tag: 'content-navigation-block',\n styleUrl: 'content-navigation-block.scss',\n shadow: false,\n})\nexport class ContentNavigationBlock {\n /**\n * @type Select\n * @responsive\n * @options fixed\n * @options absolute\n * @options static\n * @options none\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n hamburger: ResponsiveString = 'fixed|none';\n\n /**\n * @type String\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n classes: ResponsiveString;\n @State() classString;\n @Element() hostElement: HTMLStencilElement;\n @State() ariaExpanded: string = 'false';\n @State() bodyToggle: boolean = false;\n\n componentWillLoad() {\n WindowResizeService.registerProp(this.hamburger).subscribe(newValue => {\n this.hamburger = newValue as string;\n this.bodyToggle = this.hamburger === 'fixed';\n document.body.classList.remove('content-navigation-block-open');\n });\n WindowResizeService.registerProp(this.classes).subscribe(newValue => {\n this.classString = newValue as string;\n });\n }\n\n componentDidLoad() {\n let openButton = this.hostElement.querySelector('[slot=\"openButton\"]') as HTMLElement;\n let closeButton = this.hostElement.querySelector('[slot=\"closeButton\"]') as HTMLElement;\n let content = this.hostElement.querySelector('[slot=\"content\"]') as HTMLElement;\n if (openButton) {\n openButton.onclick = () => {\n this.ariaExpanded = this.ariaExpanded === 'true' ? 'false' : 'true';\n content.setAttribute('hidden', this.ariaExpanded === 'false' ? 'true' : 'false');\n if (this.ariaExpanded === 'false') {\n document.body.classList.remove('content-navigation-block-open');\n } else if (this.bodyToggle) {\n document.body.classList.add('content-navigation-block-open');\n }\n setTimeout(() => closeButton.focus(), 1);\n };\n }\n if (closeButton) {\n closeButton.onclick = () => {\n this.ariaExpanded = 'false';\n content.setAttribute('hidden', 'true');\n document.body.classList.remove('content-navigation-block-open');\n setTimeout(() => openButton.focus(), 1);\n };\n }\n }\n\n render() {\n return (\n <Host class={this.classString} aria-expanded={this.ariaExpanded}>\n <slot name=\"openButton\"></slot>\n <slot name=\"closeButton\"></slot>\n <div class=\"content-navigation__menu\">\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -20,22 +20,22 @@ content-overlay .content-overlay__content > *[slot=content] {
|
|
|
20
20
|
content-overlay.content-overlay-active {
|
|
21
21
|
display: block;
|
|
22
22
|
}
|
|
23
|
-
content-overlay[vertical
|
|
23
|
+
content-overlay[vertical=left] {
|
|
24
24
|
align-items: flex-start;
|
|
25
25
|
}
|
|
26
|
-
content-overlay[vertical
|
|
26
|
+
content-overlay[vertical=center] {
|
|
27
27
|
align-items: center;
|
|
28
28
|
}
|
|
29
|
-
content-overlay[vertical
|
|
29
|
+
content-overlay[vertical=right] {
|
|
30
30
|
align-items: flex-end;
|
|
31
31
|
}
|
|
32
|
-
content-overlay[vertical
|
|
32
|
+
content-overlay[vertical=top] {
|
|
33
33
|
justify-content: flex-start;
|
|
34
34
|
}
|
|
35
|
-
content-overlay[vertical
|
|
35
|
+
content-overlay[vertical=center] {
|
|
36
36
|
justify-content: center;
|
|
37
37
|
}
|
|
38
|
-
content-overlay[vertical
|
|
38
|
+
content-overlay[vertical=bottom] {
|
|
39
39
|
justify-content: flex-end;
|
|
40
40
|
}
|
|
41
41
|
content-overlay .content-overlay-background {
|
|
@@ -14,8 +14,8 @@ export class ContentOverlay {
|
|
|
14
14
|
this.open = 'false';
|
|
15
15
|
this.fullScreen = 'true';
|
|
16
16
|
this.classes = undefined;
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
17
|
+
this.horizontal = 'center';
|
|
18
|
+
this.vertical = 'center';
|
|
19
19
|
this.closeTitle = 'Close Overlay';
|
|
20
20
|
this.isActive = false;
|
|
21
21
|
this.activeClass = '';
|
|
@@ -97,8 +97,8 @@ export class ContentOverlay {
|
|
|
97
97
|
componentWillLoad() {
|
|
98
98
|
this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');
|
|
99
99
|
WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));
|
|
100
|
-
WindowResizeService.registerProp(this.
|
|
101
|
-
WindowResizeService.registerProp(this.
|
|
100
|
+
WindowResizeService.registerProp(this.horizontal).subscribe(newValue => this.hostElement.setAttribute('horizontal', newValue));
|
|
101
|
+
WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue));
|
|
102
102
|
WindowResizeService.registerProp(this.fullScreen).subscribe(newValue => {
|
|
103
103
|
if (!this.target)
|
|
104
104
|
this.isFullScreen = newValue === 'true';
|
|
@@ -253,7 +253,7 @@ export class ContentOverlay {
|
|
|
253
253
|
"attribute": "classes",
|
|
254
254
|
"reflect": false
|
|
255
255
|
},
|
|
256
|
-
"
|
|
256
|
+
"horizontal": {
|
|
257
257
|
"type": "string",
|
|
258
258
|
"mutable": true,
|
|
259
259
|
"complexType": {
|
|
@@ -291,11 +291,11 @@ export class ContentOverlay {
|
|
|
291
291
|
}],
|
|
292
292
|
"text": "A pipe delimited setting for horizontal alignment. This only applies when fullscreen mode is activated."
|
|
293
293
|
},
|
|
294
|
-
"attribute": "horizontal
|
|
294
|
+
"attribute": "horizontal",
|
|
295
295
|
"reflect": true,
|
|
296
296
|
"defaultValue": "'center'"
|
|
297
297
|
},
|
|
298
|
-
"
|
|
298
|
+
"vertical": {
|
|
299
299
|
"type": "string",
|
|
300
300
|
"mutable": true,
|
|
301
301
|
"complexType": {
|
|
@@ -327,7 +327,7 @@ export class ContentOverlay {
|
|
|
327
327
|
}],
|
|
328
328
|
"text": "A pipe delimited setting for vertical alignment. This only applies when fullscreen mode is activated."
|
|
329
329
|
},
|
|
330
|
-
"attribute": "vertical
|
|
330
|
+
"attribute": "vertical",
|
|
331
331
|
"reflect": true,
|
|
332
332
|
"defaultValue": "'center'"
|
|
333
333
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-overlay.js","sourceRoot":"","sources":["../../../../src/components/content-overlay/content-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,KAAK,EAAoC,MAAM,EAAS,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAG3E,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AACxC,OAAO,4BAA4B,CAAC;AACpC,OAAO,yBAAyB,CAAC;AACjC;;;;GAIG;AAMH,MAAM,OAAO,cAAc;;;oBAgBC,OAAO;0BAKO,MAAM;;mCAmBK,QAAQ;iCAYZ,QAAQ;0BAM1B,eAAe;wBAEf,KAAK;2BACH,EAAE;2BACF,EAAE;;4BAWA,KAAK;8BACH,KAAK;;;IAKxC,uBAAuB,CAAC,KAAkB;QACxC,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5E,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACnB,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAGD,KAAK,CAAC,WAAW;QACf,uBAAuB;QACvB,kBAAkB;QAClB,IAAI;QACJ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAC,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Listen, Element } from '@stencil/core';\nimport { Event, EventEmitter, HTMLStencilElement, Method, Watch } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ContentLineTextAlignOptions, ContentVerticalAlignments, ResponsiveBoolean, ResponsiveString } from '../../typings';\nimport { getCurrentValue } from '../../utils/utils';\nimport * as focusTrap from 'focus-trap';\nimport './libraries/aria-utilities';\nimport './libraries/aria-dialog';\n/**\n * @slot closeButton - Contents of the overlay close button.\n * @slot header - This is adjacent to the close button, usually a header or title for the overlay.\n * @slot content - Contents that sit inside the overlay.\n */\n@Component({\n tag: 'content-overlay',\n styleUrl: 'content-overlay.scss',\n shadow: false,\n})\nexport class ContentOverlay {\n @Element() hostElement: HTMLStencilElement;\n /**\n * @type String\n * @responsive\n */\n @Prop() target: string;\n\n /**\n * @type Boolean\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n open: ResponsiveBoolean = 'false';\n /**\n * @type Boolean\n * @responsive\n */\n @Prop() fullScreen: ResponsiveBoolean = 'true';\n /**\n * @type String\n * @responsive\n */\n @Prop() classes: ResponsiveString;\n /**\n * A pipe delimited setting for horizontal alignment. This only applies when fullscreen mode is activated.\n * @type Select\n * @options default\n * @options left\n * @options center\n * @options right\n * @responsive\n */\n @Prop({\n reflect: true,\n mutable: true,\n })\n horizontalAlignment: ContentLineTextAlignOptions = 'center';\n /**\n * A pipe delimited setting for vertical alignment. This only applies when fullscreen mode is activated.\n * @type Select\n * @options top\n * @options center\n * @options bottom\n */\n @Prop({\n reflect: true,\n mutable: true,\n })\n verticalAlignment: ContentVerticalAlignments = 'center';\n\n /**\n * Title attribute value for the close button.\n * @type String\n */\n @Prop() closeTitle: string = 'Close Overlay';\n\n @State() isActive: boolean = false;\n @State() activeClass: string = '';\n @State() classString: string = '';\n @Event({\n bubbles: true,\n })\n contentOverlayActivated: EventEmitter<HTMLElement>;\n\n @State() contentSlot: HTMLElement;\n\n dialogElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n\n @State() isFullScreen: boolean = false;\n @State() hasCloseButton: boolean = false;\n @State() originalMarkup: string;\n ariaDialog;\n focusTrap;\n @Listen('contentBlockActivated')\n onContentBlockActivated(event: CustomEvent) {\n if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {\n event.preventDefault();\n if (!this.isActive) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n }\n }\n\n @Method()\n async openOverlay() {\n // if (this.isActive) {\n // return false;\n // }\n this.isActive = true;\n if (!this.originalMarkup) {\n this.originalMarkup = this.contentSlot.querySelector('[slot=\"content\"]').innerHTML;\n }\n if (this.target) {\n let targetElement = document.getElementById(this.target);\n if (targetElement) {\n targetElement.classList.add('content-block-overlay-container');\n targetElement.appendChild(this.hostElement);\n }\n } else if (this.isFullScreen) {\n if (document.querySelectorAll(`#${this.hostElement.getAttribute('id')}`).length === 1) {\n document.body.appendChild(this.hostElement);\n }\n }\n if (this.contentSlot) {\n this.contentSlot.innerHTML = this.originalMarkup;\n this.setComputedActiveClass();\n if (this.isFullScreen) {\n this.focusTrap = focusTrap.createFocusTrap(this.hostElement, {\n fallbackFocus: this.hostElement,\n onDeactivate: () => {\n this.isActive = false;\n this.setComputedActiveClass();\n },\n });\n }\n }\n this.contentOverlayActivated.emit(this.hostElement);\n }\n\n @Method()\n async closeOverlay() {\n this.contentSlot.innerHTML = '';\n this.isActive = false;\n this.activeClass = '';\n if (this.focusTrap) {\n try {\n this.focusTrap.deactivate();\n } catch (e) {\n console.log(e);\n }\n }\n }\n\n setComputedActiveClass() {\n let positioningValue = 'static';\n if (this.target) {\n positioningValue = 'absolute';\n }\n if (this.isFullScreen) {\n positioningValue = 'fullscreen';\n }\n this.activeClass = `content-overlay ${this.isActive ? 'content-overlay-active' : 'content-overlay-inactive'} content-overlay--${positioningValue}`;\n }\n\n componentWillLoad() {\n this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');\n\n WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));\n\n WindowResizeService.registerProp(this.horizontalAlignment).subscribe(newValue =>\n this.hostElement.setAttribute('horizontal-alignment', newValue as ContentLineTextAlignOptions),\n );\n WindowResizeService.registerProp(this.verticalAlignment).subscribe(newValue => this.hostElement.setAttribute('vertical-alignment', newValue as ContentVerticalAlignments));\n WindowResizeService.registerProp(this.fullScreen).subscribe(newValue => {\n if (!this.target) this.isFullScreen = (newValue as string) === 'true';\n });\n WindowResizeService.registerProp(this.open).subscribe(newValue => {\n this.hostElement.setAttribute('open', newValue as string);\n });\n this.hasCloseButton = !!this.hostElement.querySelector('[slot=\"closeButton\"]');\n }\n\n closeOverlayButtonClicked(event) {\n event.preventDefault();\n this.closeOverlay();\n }\n\n render() {\n return (\n <Host class={`${this.activeClass} ${this.classString}`}>\n <div class=\"content-block-overlay-container\">\n <div class={`content-overlay-background ${this.isActive ? 'active' : ''}`}>\n <div ref={element => (this.dialogElement = element)} role=\"dialog\" aria-modal=\"true\" class={this.isActive ? 'active' : 'hidden'} aria-expanded={this.isActive}>\n <div class=\"content-overlay__header\">\n <button onClick={e => this.closeOverlayButtonClicked(e)} class=\"content-overlay__close\" title={this.closeTitle}>\n {!this.hasCloseButton && (\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n </svg>\n )}\n <slot name=\"closeButton\"></slot>\n </button>\n <slot name=\"header\"></slot>\n </div>\n <div class=\"content-overlay__content\" ref={(el: HTMLDivElement) => (this.contentSlot = el)}>\n <slot name=\"content\"></slot>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidRender() {\n if (this.open === 'true') {\n this.openOverlay();\n }\n if (this.isActive && this.focusTrap && !this.focusTrap.active) {\n try {\n this.focusTrap.activate();\n } catch (e) {\n console.log(e);\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"content-overlay.js","sourceRoot":"","sources":["../../../../src/components/content-overlay/content-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,KAAK,EAAoC,MAAM,EAAS,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAG3E,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AACxC,OAAO,4BAA4B,CAAC;AACpC,OAAO,yBAAyB,CAAC;AACjC;;;;GAIG;AAMH,MAAM,OAAO,cAAc;;;oBAgBC,OAAO;0BAKO,MAAM;;0BAmBJ,QAAQ;wBAYZ,QAAQ;0BAMjB,eAAe;wBAEf,KAAK;2BACH,EAAE;2BACF,EAAE;;4BAWA,KAAK;8BACH,KAAK;;;IAKxC,uBAAuB,CAAC,KAAkB;QACxC,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5E,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACnB,IAAI,CAAC,WAAW,EAAE,CA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CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YAC9D,IAAI,CAAC;gBACH,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC5B,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Listen, Element } from '@stencil/core';\nimport { Event, EventEmitter, HTMLStencilElement, Method, Watch } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ContentLineTextAlignOptions, ContentVerticalAlignments, ResponsiveBoolean, ResponsiveString } from '../../typings';\nimport { getCurrentValue } from '../../utils/utils';\nimport * as focusTrap from 'focus-trap';\nimport './libraries/aria-utilities';\nimport './libraries/aria-dialog';\n/**\n * @slot closeButton - Contents of the overlay close button.\n * @slot header - This is adjacent to the close button, usually a header or title for the overlay.\n * @slot content - Contents that sit inside the overlay.\n */\n@Component({\n tag: 'content-overlay',\n styleUrl: 'content-overlay.scss',\n shadow: false,\n})\nexport class ContentOverlay {\n @Element() hostElement: HTMLStencilElement;\n /**\n * @type String\n * @responsive\n */\n @Prop() target: string;\n\n /**\n * @type Boolean\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n open: ResponsiveBoolean = 'false';\n /**\n * @type Boolean\n * @responsive\n */\n @Prop() fullScreen: ResponsiveBoolean = 'true';\n /**\n * @type String\n * @responsive\n */\n @Prop() classes: ResponsiveString;\n /**\n * A pipe delimited setting for horizontal alignment. This only applies when fullscreen mode is activated.\n * @type Select\n * @options default\n * @options left\n * @options center\n * @options right\n * @responsive\n */\n @Prop({\n reflect: true,\n mutable: true,\n })\n horizontal: ContentLineTextAlignOptions = 'center';\n /**\n * A pipe delimited setting for vertical alignment. This only applies when fullscreen mode is activated.\n * @type Select\n * @options top\n * @options center\n * @options bottom\n */\n @Prop({\n reflect: true,\n mutable: true,\n })\n vertical: ContentVerticalAlignments = 'center';\n\n /**\n * Title attribute value for the close button.\n * @type String\n */\n @Prop() closeTitle: string = 'Close Overlay';\n\n @State() isActive: boolean = false;\n @State() activeClass: string = '';\n @State() classString: string = '';\n @Event({\n bubbles: true,\n })\n contentOverlayActivated: EventEmitter<HTMLElement>;\n\n @State() contentSlot: HTMLElement;\n\n dialogElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n\n @State() isFullScreen: boolean = false;\n @State() hasCloseButton: boolean = false;\n @State() originalMarkup: string;\n ariaDialog;\n focusTrap;\n @Listen('contentBlockActivated')\n onContentBlockActivated(event: CustomEvent) {\n if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {\n event.preventDefault();\n if (!this.isActive) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n }\n }\n\n @Method()\n async openOverlay() {\n // if (this.isActive) {\n // return false;\n // }\n this.isActive = true;\n if (!this.originalMarkup) {\n this.originalMarkup = this.contentSlot.querySelector('[slot=\"content\"]').innerHTML;\n }\n if (this.target) {\n let targetElement = document.getElementById(this.target);\n if (targetElement) {\n targetElement.classList.add('content-block-overlay-container');\n targetElement.appendChild(this.hostElement);\n }\n } else if (this.isFullScreen) {\n if (document.querySelectorAll(`#${this.hostElement.getAttribute('id')}`).length === 1) {\n document.body.appendChild(this.hostElement);\n }\n }\n if (this.contentSlot) {\n this.contentSlot.innerHTML = this.originalMarkup;\n this.setComputedActiveClass();\n if (this.isFullScreen) {\n this.focusTrap = focusTrap.createFocusTrap(this.hostElement, {\n fallbackFocus: this.hostElement,\n onDeactivate: () => {\n this.isActive = false;\n this.setComputedActiveClass();\n },\n });\n }\n }\n this.contentOverlayActivated.emit(this.hostElement);\n }\n\n @Method()\n async closeOverlay() {\n this.contentSlot.innerHTML = '';\n this.isActive = false;\n this.activeClass = '';\n if (this.focusTrap) {\n try {\n this.focusTrap.deactivate();\n } catch (e) {\n console.log(e);\n }\n }\n }\n\n setComputedActiveClass() {\n let positioningValue = 'static';\n if (this.target) {\n positioningValue = 'absolute';\n }\n if (this.isFullScreen) {\n positioningValue = 'fullscreen';\n }\n this.activeClass = `content-overlay ${this.isActive ? 'content-overlay-active' : 'content-overlay-inactive'} content-overlay--${positioningValue}`;\n }\n\n componentWillLoad() {\n this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');\n\n WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));\n\n WindowResizeService.registerProp(this.horizontal).subscribe(newValue => this.hostElement.setAttribute('horizontal', newValue as ContentLineTextAlignOptions));\n WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue as ContentVerticalAlignments));\n WindowResizeService.registerProp(this.fullScreen).subscribe(newValue => {\n if (!this.target) this.isFullScreen = (newValue as string) === 'true';\n });\n WindowResizeService.registerProp(this.open).subscribe(newValue => {\n this.hostElement.setAttribute('open', newValue as string);\n });\n this.hasCloseButton = !!this.hostElement.querySelector('[slot=\"closeButton\"]');\n }\n\n closeOverlayButtonClicked(event) {\n event.preventDefault();\n this.closeOverlay();\n }\n\n render() {\n return (\n <Host class={`${this.activeClass} ${this.classString}`}>\n <div class=\"content-block-overlay-container\">\n <div class={`content-overlay-background ${this.isActive ? 'active' : ''}`}>\n <div ref={element => (this.dialogElement = element)} role=\"dialog\" aria-modal=\"true\" class={this.isActive ? 'active' : 'hidden'} aria-expanded={this.isActive}>\n <div class=\"content-overlay__header\">\n <button onClick={e => this.closeOverlayButtonClicked(e)} class=\"content-overlay__close\" title={this.closeTitle}>\n {!this.hasCloseButton && (\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n </svg>\n )}\n <slot name=\"closeButton\"></slot>\n </button>\n <slot name=\"header\"></slot>\n </div>\n <div class=\"content-overlay__content\" ref={(el: HTMLDivElement) => (this.contentSlot = el)}>\n <slot name=\"content\"></slot>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n componentDidRender() {\n if (this.open === 'true') {\n this.openOverlay();\n }\n if (this.isActive && this.focusTrap && !this.focusTrap.active) {\n try {\n this.focusTrap.activate();\n } catch (e) {\n console.log(e);\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-button.js","sourceRoot":"","sources":["../../../../src/elements/content-button/content-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"content-button.js","sourceRoot":"","sources":["../../../../src/elements/content-button/content-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,OAAO,EAAmC,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAG3E;;;;GAIG;AAMH,MAAM,OAAO,aAAa;;;;uBAmBN,EAAE;2BACG,EAAE;8BAIS,KAAK;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\nimport { Element, HostElement, HTMLStencilElement, State } from '@stencil/core/internal';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ResponsiveString } from '../../typings';\n\n/**\n * @slot content - Inner contents of the button, usually plaintext.\n * @slot - Default slot, same as content slot.\n * @slot activatedContent - If this slot is used, the content in this will be scrolled to and triggered.\n */\n@Component({\n tag: 'content-button',\n styleUrl: 'content-button.scss',\n shadow: false,\n})\nexport class ContentButton {\n @Element() hostElement: HostElement;\n /**\n * @type URL\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n href: string;\n /**\n * @type String\n */\n @Prop() target: string;\n /**\n * The classes for the button.\n * @type String\n * @responsive\n */\n @Prop() classes = '';\n @State() classString = '';\n /**\n * @type Boolean\n */\n @Prop() clickableBlock: boolean = false;\n /**\n * @type Boolean\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n expanded: string;\n /**\n\n /**\n * Aria-controls value\n * @type Target\n */\n @Prop() controls: string;\n\n /**\n * @type String\n * @responsive\n */\n @Prop() linkLabel: ResponsiveString;\n /**\n * @type String\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n linkClass: ResponsiveString;\n @State() hasContentToActivate: boolean;\n\n public activatedContent: HTMLDivElement;\n\n componentWillLoad() {\n this.activatedContent = this.hostElement.querySelector('[slot=\"activatedContent\"]');\n this.hasContentToActivate = !!this.activatedContent;\n // If this is a clickable block, forcefully add a # to force an anchor link\n if (!this.href || this.href === '#') {\n this.href = 'javascript:void(0);';\n }\n\n WindowResizeService.registerProp(this.linkClass).subscribe(newValue => {\n this.linkClass = newValue as string;\n });\n\n WindowResizeService.registerProp(this.classes).subscribe(newValue => {\n this.classString = newValue as string;\n });\n }\n\n onHandleClickEvent(ev) {\n if (this.hasContentToActivate) {\n ev.preventDefault();\n // ev.stopPropagation();\n this.activatedContent.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: this.activatedContent }));\n this.activatedContent.scrollIntoView({ behavior: 'smooth' });\n } else if (this.href && this.href.length > 1 && this.href.substring(0, 1) === '#') {\n let element = document.getElementById(this.href.substring(1));\n if (element) {\n ev.preventDefault();\n // ev.stopPropagation();\n element.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: element }));\n // element.scrollIntoView({ behavior: 'smooth' });\n }\n }\n }\n\n render() {\n return (\n <Host class={this.classString}>\n <a\n aria-label={this.linkLabel}\n class={this.linkClass}\n role={this.href === 'javascript:void(0);' ? 'button' : ''}\n onClick={ev => this.onHandleClickEvent(ev)}\n aria-expanded={this.expanded}\n aria-controls={this.controls}\n href={this.href}\n target={this.target}\n >\n {!this.clickableBlock ? (\n <span>\n <slot name=\"content\"></slot>\n <slot></slot>\n </span>\n ) : (\n <div class=\"content-button__clickable-content\">\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n )}\n </a>\n <slot name=\"activatedContent\"></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -35,20 +35,6 @@ export class ContentImage {
|
|
|
35
35
|
}
|
|
36
36
|
componentWillLoad() {
|
|
37
37
|
this.hasMediaContent = !!this.hostElement.querySelector('[slot="mediaContent"]');
|
|
38
|
-
let observer = new IntersectionObserver(entries => {
|
|
39
|
-
entries.forEach(async (entry) => {
|
|
40
|
-
if (entry.isIntersecting) {
|
|
41
|
-
this.lazyLoadIsComplete = true;
|
|
42
|
-
this.pictureImageSrc = getCurrentValue(this.src);
|
|
43
|
-
this.showVideoAsGif = this.pictureImageSrc.indexOf('.mp4') >= 0 || getCurrentValue(this.type) === 'video';
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}, {
|
|
47
|
-
root: null,
|
|
48
|
-
rootMargin: `${Math.max(100, window.innerHeight * 0.15)}px`,
|
|
49
|
-
threshold: 0.1,
|
|
50
|
-
});
|
|
51
|
-
observer.observe(this.hostElement);
|
|
52
38
|
WindowResizeService.registerProp(this.aspectRatio).subscribe(newValue => {
|
|
53
39
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--aspect-ratio': `${newValue}` });
|
|
54
40
|
});
|
|
@@ -65,6 +51,23 @@ export class ContentImage {
|
|
|
65
51
|
this.classString = `${newValue}`;
|
|
66
52
|
});
|
|
67
53
|
}
|
|
54
|
+
componentDidLoad() {
|
|
55
|
+
let observer = new IntersectionObserver(entries => {
|
|
56
|
+
entries.forEach(async (entry) => {
|
|
57
|
+
if (entry.isIntersecting) {
|
|
58
|
+
this.lazyLoadIsComplete = true;
|
|
59
|
+
this.pictureImageSrc = getCurrentValue(this.src);
|
|
60
|
+
this.showVideoAsGif = this.pictureImageSrc.indexOf('.mp4') >= 0 || getCurrentValue(this.type) === 'video';
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}, {
|
|
64
|
+
root: null,
|
|
65
|
+
// rootMargin: `${Math.max(100, window.innerHeight * 0.95)}px`,
|
|
66
|
+
rootMargin: `0px`,
|
|
67
|
+
threshold: 0.1,
|
|
68
|
+
});
|
|
69
|
+
observer.observe(this.hostElement);
|
|
70
|
+
}
|
|
68
71
|
watchLazyLoadIsComplete(newValue) {
|
|
69
72
|
if (newValue === true) {
|
|
70
73
|
this.activeLazyLoadClass = 'content-image-loaded';
|
|
@@ -79,7 +82,7 @@ export class ContentImage {
|
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
render() {
|
|
82
|
-
return (h(Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (h("div", { class: "content-image__media-content" }, h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, h("source", { src: this.lazyLoadIsComplete ? this.
|
|
85
|
+
return (h(Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (h("div", { class: "content-image__media-content" }, h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, h("source", { src: this.lazyLoadIsComplete ? this.pictureImageSrc : null, type: this.videoType }))) : (h("img", { width: this.width, height: this.height, src: this.pictureImageSrc, alt: this.alt }))));
|
|
83
86
|
}
|
|
84
87
|
static get is() { return "content-image"; }
|
|
85
88
|
static get originalStyleUrls() {
|