@content-blocks/js 0.5.0 → 0.6.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 +56 -40
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +1 -1
- package/dist/cjs/content-blocks.cjs.js +2 -2
- package/dist/cjs/content-carousel.cjs.entry.js +2 -1
- package/dist/cjs/content-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js +23 -19
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -1
- package/dist/cjs/content-split-block.cjs.entry.js +4 -4
- package/dist/cjs/content-split-block.cjs.entry.js.map +1 -1
- package/dist/cjs/content-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{index-072153fb.js → index-9f20d89a.js} +34 -4
- package/dist/cjs/index-9f20d89a.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{utils-9856e159.js → utils-db61cd70.js} +1 -3
- package/dist/cjs/utils-db61cd70.js.map +1 -0
- package/dist/cjs/{window-resize-service-77b2c64e.js → window-resize-service-ac5c2012.js} +2 -2
- package/dist/cjs/{window-resize-service-77b2c64e.js.map → window-resize-service-ac5c2012.js.map} +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.css +6 -0
- package/dist/collection/blocks/content-split-block/content-split-block.js +1 -1
- package/dist/collection/blocks/content-split-block/content-split-block.js.map +1 -1
- package/dist/collection/components/content-accordion/content-accordion.js +2 -2
- package/dist/collection/components/content-accordion/content-accordion.js.map +1 -1
- package/dist/collection/components/content-carousel/content-carousel.js +1 -0
- package/dist/collection/components/content-carousel/content-carousel.js.map +1 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +20 -16
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +1 -1
- package/dist/collection/components/content-overlay/content-overlay.css +6 -3
- package/dist/collection/components/content-overlay/content-overlay.js +24 -9
- package/dist/collection/components/content-overlay/content-overlay.js.map +1 -1
- package/dist/collection/elements/content-button/content-button.js +2 -5
- package/dist/collection/elements/content-button/content-button.js.map +1 -1
- package/dist/collection/elements/content-image/content-image.css +4 -7
- package/dist/collection/elements/content-image/content-image.js +79 -21
- package/dist/collection/elements/content-image/content-image.js.map +1 -1
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +1 -0
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +46 -3
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -1
- package/dist/collection/formatters/content-spacer/content-spacer.js +3 -2
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +1 -1
- package/dist/components/content-accordion.js +1 -1
- package/dist/components/content-accordion.js.map +1 -1
- package/dist/components/content-button.js +2 -5
- 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 +8 -2
- package/dist/components/content-grid-formatter2.js.map +1 -1
- package/dist/components/content-hero-block.js +1 -1
- package/dist/components/content-hero-block.js.map +1 -1
- package/dist/components/content-image.js +26 -22
- package/dist/components/content-image.js.map +1 -1
- package/dist/components/content-navigation-block.js +20 -16
- package/dist/components/content-navigation-block.js.map +1 -1
- package/dist/components/content-overlay.js +22 -7
- package/dist/components/content-overlay.js.map +1 -1
- package/dist/components/content-spacer.js +1 -1
- package/dist/components/content-spacer.js.map +1 -1
- package/dist/components/content-split-block.js +1 -1
- package/dist/components/content-split-block.js.map +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/components/utils.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/index.esm.js +1 -1
- package/dist/content-blocks/{p-ebaee21f.entry.js → p-167a9155.entry.js} +2 -2
- package/dist/content-blocks/{p-ebaee21f.entry.js.map → p-167a9155.entry.js.map} +1 -1
- package/dist/content-blocks/{p-30ab003a.entry.js → p-271fb304.entry.js} +2 -2
- package/dist/content-blocks/p-271fb304.entry.js.map +1 -0
- package/dist/content-blocks/p-288eace9.js +3 -0
- package/dist/content-blocks/p-288eace9.js.map +1 -0
- package/dist/content-blocks/p-4038cd42.entry.js +10 -0
- package/dist/content-blocks/p-4038cd42.entry.js.map +1 -0
- package/dist/content-blocks/{p-fd14acd9.entry.js → p-4bfbd7ef.entry.js} +2 -2
- package/dist/content-blocks/{p-fd14acd9.entry.js.map → p-4bfbd7ef.entry.js.map} +1 -1
- package/dist/content-blocks/{p-2c515f18.entry.js → p-8cc22c1e.entry.js} +2 -2
- package/dist/content-blocks/{p-da2c36ea.js → p-b04fe808.js} +2 -2
- package/dist/content-blocks/{p-da2c36ea.js.map → p-b04fe808.js.map} +1 -1
- package/dist/content-blocks/{p-3b4b9ad1.js → p-cfb4593f.js} +2 -2
- package/dist/esm/content-accordion_11.entry.js +56 -40
- package/dist/esm/content-accordion_11.entry.js.map +1 -1
- package/dist/esm/content-blocks.js +3 -3
- package/dist/esm/content-carousel.entry.js +2 -1
- package/dist/esm/content-carousel.entry.js.map +1 -1
- package/dist/esm/content-navigation-block.entry.js +23 -19
- package/dist/esm/content-navigation-block.entry.js.map +1 -1
- package/dist/esm/content-split-block.entry.js +4 -4
- package/dist/esm/content-split-block.entry.js.map +1 -1
- package/dist/esm/content-tabs.entry.js +3 -3
- package/dist/esm/{index-5c31f78b.js → index-e848c048.js} +34 -4
- package/dist/esm/index-e848c048.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-4f29a9cf.js → utils-4f78228e.js} +2 -2
- package/dist/esm/utils-4f78228e.js.map +1 -0
- package/dist/esm/{window-resize-service-332e7420.js → window-resize-service-f40ec51c.js} +2 -2
- package/dist/esm/{window-resize-service-332e7420.js.map → window-resize-service-f40ec51c.js.map} +1 -1
- package/dist/types/components/content-accordion/content-accordion.d.ts +6 -6
- package/dist/types/components/content-overlay/content-overlay.d.ts +4 -2
- package/dist/types/components.d.ts +37 -3
- package/dist/types/elements/content-image/content-image.d.ts +12 -0
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +8 -2
- package/dist/types/typings.d.ts +3 -3
- package/package.json +1 -1
- package/dist/cjs/index-072153fb.js.map +0 -1
- package/dist/cjs/utils-9856e159.js.map +0 -1
- package/dist/content-blocks/p-2faf0c78.js +0 -3
- package/dist/content-blocks/p-2faf0c78.js.map +0 -1
- package/dist/content-blocks/p-30ab003a.entry.js.map +0 -1
- package/dist/content-blocks/p-b8009321.entry.js +0 -10
- package/dist/content-blocks/p-b8009321.entry.js.map +0 -1
- package/dist/esm/index-5c31f78b.js.map +0 -1
- package/dist/esm/utils-4f29a9cf.js.map +0 -1
- /package/dist/content-blocks/{p-2c515f18.entry.js.map → p-8cc22c1e.entry.js.map} +0 -0
- /package/dist/content-blocks/{p-3b4b9ad1.js.map → p-cfb4593f.js.map} +0 -0
package/dist/cjs/index.cjs.js
CHANGED
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
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],"videoType":[1,"video-type"],"showContent":[1537,"show-content"],"activeSrc":[32],"lazyLoadIsComplete":[32],"showVideoAsGif":[32],"activeLazyLoadClass":[32],"classString":[32],"inlineStyle":[32],"hasMediaContent":[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],"horizontalAlignment":[1537,"horizontal-alignment"],"verticalAlignment":[1537,"vertical-alignment"],"closeTitle":[1,"close-title"],"isActive":[32],"activeClass":[32],"classString":[32],"contentSlot":[32],"isFullScreen":[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"],"horizontalPosition":[1537,"horizontal-position"],"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"],"verticalAlignment":[1537,"vertical-alignment"],"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"],"verticalAlignment":[1537,"vertical-alignment"],"horizontalAlignment":[1537,"horizontal-alignment"],"columns":[1537],"classString":[32],"activeClassString":[32],"inlineStyle":[32]}]]]], options);
|
|
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],"horizontalAlignment":[1537,"horizontal-alignment"],"verticalAlignment":[1537,"vertical-alignment"],"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"],"horizontalPosition":[1537,"horizontal-position"],"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"],"verticalAlignment":[1537,"vertical-alignment"],"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"],"verticalAlignment":[1537,"vertical-alignment"],"horizontalAlignment":[1537,"horizontal-alignment"],"columns":[1537],"columnGap":[1537,"column-gap"],"classString":[32],"activeClassString":[32],"inlineStyle":[32]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -113,10 +113,8 @@ const utils = /*#__PURE__*/Object.freeze({
|
|
|
113
113
|
objectToCssString: objectToCssString
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
exports.breakpointValues = breakpointValues;
|
|
117
116
|
exports.getCurrentBreakpointIndex = getCurrentBreakpointIndex;
|
|
118
117
|
exports.getCurrentValue = getCurrentValue;
|
|
119
|
-
exports.getValueAtIndex = getValueAtIndex;
|
|
120
118
|
exports.utils = utils;
|
|
121
119
|
|
|
122
|
-
//# sourceMappingURL=utils-
|
|
120
|
+
//# sourceMappingURL=utils-db61cd70.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"utils-db61cd70.js","mappings":";;AAEO,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;AACrH,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;AAC5H,MAAM,gBAAgB,GAAG,CAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,CAAC,CAAC;SAE5C,mBAAmB;IACjC,OAAO,gBAAgB,CAAC;AAC1B,CAAC;SACe,iBAAiB,CAAC,QAAkB,E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WAAmB;IACxD,IAAI,aAAa,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;IACxD,IAAI,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACtC,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC;KAC7B;IACD,IAAI,aAAa,EAAE;QACjB,OAAO,aAAa,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC;KAC3C;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;SAEe,iBAAiB,CAAC,MAAc;IAC9C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;QACtB,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE;YAChE,MAAM,IAAI,GAAG,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;SACrC;KACF;IACD,OAAO,MAAM,CAAC;AAChB;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["import { ResponsiveString } from \"../typings\";\n\nexport const breakpoints = ['mobile', 'tablet-portrait', 'tablet-landscape', 'tablet-pro', 'desktop-large', 'desktop-wide'];\nexport const breakpointLabels = ['Mobile', 'Tablet (Portrait)', 'Tablet (Landscape)', 'iPad Pro', 'Desktop Large', 'Desktop Wide'];\nexport const breakpointValues = [0,768,1024,1366,1440,1920];\n\nexport function getBreakpointValues() {\n return breakpointValues;\n}\nexport function insertCssIntoHead(document: Document, fontCssUrl: string) {\n let element = document.querySelector(`link[href=\"${fontCssUrl}\"]`);\n // Only inject the element if it's not yet present\n if (!element) {\n element = document.createElement('link');\n element.setAttribute('rel', 'stylesheet');\n element.setAttribute('href', fontCssUrl);\n document.head.prepend(element);\n }\n}\n\nexport function generateResponsiveClass(classPrefix: string, responsiveValue: string) {\n let index = -1;\n let classString = '';\n responsiveValue.split('|').forEach(value => {\n index++;\n if (!value || value === 'false') {\n return false;\n }\n classString += ` ${classPrefix}-${breakpoints[index]}-${value}`\n });\n return classString;\n}\n\n// Fills in default value if none exists for a breakpoint\nexport function generateResponsiveValues(responsiveValue: string): string[] {\n if (!responsiveValue) {\n return [];\n }\n let responseArray = [];\n let splitResponsiveValues = responsiveValue.split('|');\n let lastGoodValue = splitResponsiveValues[0];\n breakpointValues.forEach((_value, index) => {\n let thisBreakpointValue = splitResponsiveValues[index];\n if (thisBreakpointValue) {\n lastGoodValue = thisBreakpointValue;\n }\n responseArray.push(thisBreakpointValue ? thisBreakpointValue : lastGoodValue);\n });\n return responseArray;\n}\n\nexport function getCurrentBreakpointIndex(): number {\n let activeBreakpointIndex: number = 0;\n let windowWidth = window.innerWidth;\n breakpointValues.some((width) => {\n // The first time this is true will end the loop\n let condition = width > windowWidth;\n if (!condition) {\n activeBreakpointIndex = breakpointValues.indexOf(width);\n }\n return condition;\n });\n return activeBreakpointIndex;\n}\n\nexport function getCurrentValue(responsiveValue: string|boolean): string {\n if (!responsiveValue) {\n return '';\n }\n let currentBreakpoint = getCurrentBreakpointIndex();\n let responsiveValues = generateResponsiveValues(responsiveValue.toString());\n let returnValue: string;\n for (var i = currentBreakpoint; i >= 0; i--) {\n if (responsiveValues[i]) {\n returnValue = responsiveValues[i];\n i = -1;\n }\n }\n return returnValue;\n}\n\nexport function getValueAtIndex(index: number, responsiveValue: ResponsiveString): string {\n let responsiveValues = generateResponsiveValues(responsiveValue.toString());\n return responsiveValues[index].trim();\n}\n\nexport function getHydratedClassString(classString: string): string {\n let cleanedString = getCurrentValue(classString).trim();\n if (cleanedString.includes('hydrated')) {\n return cleanedString.trim();\n }\n if (cleanedString) {\n return cleanedString.trim() + ' hydrated';\n }\n return 'hydrated';\n}\n\nexport function objectToCssString(object: object): string {\n let string = '';\n for (var key in object) {\n if (object[key].length > 0 && !['px', '%'].includes(object[key])) {\n string += `${key}: ${object[key]};`;\n }\n }\n return string;\n}"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const utils = require('./utils-
|
|
3
|
+
const utils = require('./utils-db61cd70.js');
|
|
4
4
|
const BehaviorSubject = require('./BehaviorSubject-771fd78b.js');
|
|
5
5
|
|
|
6
6
|
class WindowResizeController {
|
|
@@ -34,4 +34,4 @@ const WindowResizeService = new WindowResizeController();
|
|
|
34
34
|
|
|
35
35
|
exports.WindowResizeService = WindowResizeService;
|
|
36
36
|
|
|
37
|
-
//# sourceMappingURL=window-resize-service-
|
|
37
|
+
//# sourceMappingURL=window-resize-service-ac5c2012.js.map
|
package/dist/cjs/{window-resize-service-77b2c64e.js.map → window-resize-service-ac5c2012.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"window-resize-service-
|
|
1
|
+
{"file":"window-resize-service-ac5c2012.js","mappings":";;;;;AAIA,MAAM,sBAAsB;;IAK1B;QAJA,sBAAiB,GAAGA,+BAAyB,EAAE,CAAC;QAChD,qBAAgB,GAA4B,IAAIC,+BAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAKtF,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,QAAQ;YAChD,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aAClC;YACD,IAAI,WAAW,GAAGD,+BAAyB,EAAE,CAAC;YAC9C,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,KAAK,WAAW,EAAE;gBAC/C,OAAO,KAAK,CAAC;aACd;YACD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACzC,CAAC,CAAC;QAEH,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KAC9C;IAED,YAAY,CAAC,eAAe;QAC1B,OAAO,IAAIE,0BAAU,CAAC,QAAQ;YAC5B,QAAQ,CAAC,IAAI,CAACC,qBAAe,CAAC,eAAe,CAAC,CAAC,CAAC;YAChD,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC;gBAC9B,IAAI,SAAS,GAAGA,qBAAe,CAAC,eAAe,CAAC,CAAC;gBACjD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC1B,CAAC,CAAC;SACJ,CAAC,CAAC;KACJ;CACF;MAEY,mBAAmB,GAAG,IAAI,sBAAsB;;;;","names":["getCurrentBreakpointIndex","BehaviorSubject","Observable","getCurrentValue"],"sources":["src/services/window-resize-service.ts"],"sourcesContent":["import { BehaviorSubject, Observable } from \"rxjs\";\nimport { getCurrentBreakpointIndex, getCurrentValue } from \"../utils/utils\";\nimport _ from 'underscore';\n\nclass WindowResizeController {\n currentBreakpoint = getCurrentBreakpointIndex();\n breakpointIndex$: BehaviorSubject<number> = new BehaviorSubject(this.currentBreakpoint);\n timeoutHolder: number;\n // timeoutHolder: Timeout;\n constructor() {\n\n const resizeObserver = new ResizeObserver(_entries => {\n if (this.timeoutHolder) {\n clearTimeout(this.timeoutHolder);\n }\n let activeValue = getCurrentBreakpointIndex();\n if (this.breakpointIndex$.value === activeValue) {\n return false;\n }\n this.breakpointIndex$.next(activeValue);\n });\n\n resizeObserver.observe(window.document.body);\n }\n \n registerProp(activePropValue): Observable<string|boolean|number> {\n return new Observable(observer => {\n observer.next(getCurrentValue(activePropValue));\n this.breakpointIndex$.subscribe(() => {\n let nextValue = getCurrentValue(activePropValue);\n observer.next(nextValue);\n });\n });\n }\n}\n\nexport const WindowResizeService = new WindowResizeController();"],"version":3}
|
|
@@ -18,6 +18,12 @@ content-hero-block[content-position=above] .content-hero-block__background {
|
|
|
18
18
|
height: 100%;
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
}
|
|
21
|
+
content-hero-block[content-position=above] .content-hero-block__background content-image,
|
|
22
|
+
content-hero-block[content-position=above] .content-hero-block__background content-image picture,
|
|
23
|
+
content-hero-block[content-position=above] .content-hero-block__background content-image img,
|
|
24
|
+
content-hero-block[content-position=above] .content-hero-block__background content-image video {
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
21
27
|
content-hero-block[content-position=above] .content-hero-block__content {
|
|
22
28
|
display: flex;
|
|
23
29
|
top: 0;
|
|
@@ -16,7 +16,7 @@ export class ContentSplitBlock {
|
|
|
16
16
|
WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue));
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { class: this.classString, reverse: this.reverse }, h("content-grid-formatter", { type: "flex", "flex-grow": "true", "flex-shrink": "true", columns: this.columns }, h("slot", { name: "column1" }), h("slot", { name: "column2" }))));
|
|
19
|
+
return (h(Host, { class: this.classString, reverse: this.reverse }, h("content-grid-formatter", { type: "none|flex", "flex-grow": "true", "flex-shrink": "true", columns: this.columns }, h("slot", { name: "column1" }), h("slot", { name: "column2" }))));
|
|
20
20
|
}
|
|
21
21
|
static get is() { return "content-split-block"; }
|
|
22
22
|
static get originalStyleUrls() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-split-block.js","sourceRoot":"","sources":["../../../../src/blocks/content-split-block/content-split-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E;;;GAGG;AAMH,MAAM,OAAO,iBAAiB;;uBASW,KAAK;uBAKlB,KAAK;;;;IAY/B,iBAAiB;QACf,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,QAAkB,CAAC,CAAC,CAAC;QAC1G,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,QAAkB,CAAC,CAAC,CAAC;IAChH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO;YAClD,8BAAwB,IAAI,EAAC,
|
|
1
|
+
{"version":3,"file":"content-split-block.js","sourceRoot":"","sources":["../../../../src/blocks/content-split-block/content-split-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E;;;GAGG;AAMH,MAAM,OAAO,iBAAiB;;uBASW,KAAK;uBAKlB,KAAK;;;;IAY/B,iBAAiB;QACf,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,QAAkB,CAAC,CAAC,CAAC;QAC1G,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,QAAkB,CAAC,CAAC,CAAC;IAChH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO;YAClD,8BAAwB,IAAI,EAAC,WAAW,eAAW,MAAM,iBAAa,MAAM,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO;gBAChG,YAAM,IAAI,EAAC,SAAS,GAAQ;gBAC5B,YAAM,IAAI,EAAC,SAAS,GAAQ,CACL,CACpB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Prop, State } from '@stencil/core';\nimport { WindowResizeService } from '../../services/window-resize-service';\nimport { ResponsiveBoolean, ResponsiveString } from '../../typings';\n/**\n * @slot column1 - This will be column 1.\n * @slot column2 - This will be column 2.\n */\n@Component({\n tag: 'content-split-block',\n styleUrl: 'content-split-block.scss',\n shadow: false,\n})\nexport class ContentSplitBlock {\n /**\n * @type Boolean\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n reverse: ResponsiveBoolean | boolean = false;\n /**\n * @type Number\n * @responsive\n */\n @Prop() columns: string = '1|2';\n /**\n * @type String\n * @responsive\n */\n @Prop({\n mutable: true,\n reflect: true,\n })\n classes: ResponsiveString;\n @State() classString;\n\n componentWillLoad() {\n WindowResizeService.registerProp(this.reverse).subscribe(newValue => (this.reverse = newValue as string));\n WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue as string));\n }\n\n render() {\n return (\n <Host class={this.classString} reverse={this.reverse}>\n <content-grid-formatter type=\"none|flex\" flex-grow=\"true\" flex-shrink=\"true\" columns={this.columns}>\n <slot name=\"column1\"></slot>\n <slot name=\"column2\"></slot>\n </content-grid-formatter>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -10,7 +10,7 @@ export class ContentAccordion {
|
|
|
10
10
|
this.open = 'false|true';
|
|
11
11
|
this.animationStart = 'animation-start';
|
|
12
12
|
this.animationEnd = 'animation-end';
|
|
13
|
-
this.animationTime =
|
|
13
|
+
this.animationTime = 0;
|
|
14
14
|
this.isOpen = false;
|
|
15
15
|
this.randomID = '';
|
|
16
16
|
this.classString = '';
|
|
@@ -160,7 +160,7 @@ export class ContentAccordion {
|
|
|
160
160
|
},
|
|
161
161
|
"attribute": "animation-time",
|
|
162
162
|
"reflect": false,
|
|
163
|
-
"defaultValue": "
|
|
163
|
+
"defaultValue": "0"
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
}
|
|
@@ -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,YAAY;8BAKrB,iBAAiB;4BAMnB,eAAe;6BAMd,
|
|
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,YAAY;8BAKrB,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,EA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AC,EAAE;YAC/D,IAAI,CAAC,MAAM,GAAG,QAAQ,KAAK,MAAM,CAAC;YAClC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,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|true';\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 }\n\n componentDidLoad() {\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"]}
|
|
@@ -7,6 +7,7 @@ export class ContentCarousel {
|
|
|
7
7
|
this.swiperOptions = '{"slidesPerView": 1, "slidesPerGroup": 1, "autoplay": true, "loop": false}';
|
|
8
8
|
}
|
|
9
9
|
getSwiperOptions(newOptions) {
|
|
10
|
+
console.log(this.swiperNextElement);
|
|
10
11
|
return Object.assign({
|
|
11
12
|
observer: true,
|
|
12
13
|
observeParents: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-carousel.js","sourceRoot":"","sources":["../../../../src/components/content-carousel/content-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAavC,MAAM,OAAO,eAAe;;QAsB1B,eAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;0BAf7B,MAAM;6BAKX,4EAA4E;;IAY5G,gBAAgB,CAAC,UAAkB;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE;gBACV,EAAE,EAAE,IAAI,CAAC,gBAAgB;aAC1B;YACD,UAAU,EAAE;gBACV,MAAM,EAAE,IAAI,CAAC,iBAAiB;gBAC9B,MAAM,EAAE,IAAI,CAAC,iBAAiB;aAC/B;YACD,SAAS,EAAE;gBACT,EAAE,EAAE,IAAI,CAAC,eAAe;aACzB;SACF,EAAE,UAAU,CAAC,CAAC;IACjB,CAAC;IACD,gBAAgB;QACd,IAAI,IAAI,CAAC,UAAU,KAAK,MAAM,EAAE,CAAC;YAC/B,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBACvB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAuB,IAAI,EAAE,CAAC,CAAC,CAAC;YAClG,CAAC;YAED,IAAI,OAAO,GAAG;gBACZ,IAAI,EAAE,IAAI;gBACV,UAAU,EAAE,KAAK;gBACjB,SAAS,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A0C;SAC3C,EACD,CAAC;IACL,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,WAAK,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,EAAoB;gBAC/D,WAAK,KAAK,EAAC,gBAAgB,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,GAAG,EAAoB;oBAC9E,YAAM,IAAI,EAAC,SAAS,GAAQ;oBAC5B,eAAa,CACT;gBACN,WAAK,KAAK,EAAC,mBAAmB,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,GAAG,EAAoB,GAAQ;gBAE9F,WAAK,KAAK,EAAC,oBAAoB,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,GAAG,EAAoB,GAAQ;gBAChG,WAAK,KAAK,EAAC,oBAAoB,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,GAAG,EAAoB,GAAQ;gBAEhG,WAAK,KAAK,EAAC,kBAAkB,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,GAAG,EAAoB,GAAQ,CACxF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, h, Host, Prop, Listen, Element } from '@stencil/core';\nimport { HTMLStencilElement } from '@stencil/core/internal';\nimport { BehaviorSubject } from 'rxjs';\n// import { A11y, Navigation, Pagination } from 'swiper/modules';\n\n/**\n * @slot content - This slot will usually serve a content hero block or image.\n * @slot - Default slot, same as content slot.\n */\nexport type InitMethodType = 'load' | 'event';\n@Component({\n tag: 'content-carousel',\n styleUrl: 'content-carousel.scss',\n shadow: false,\n})\nexport class ContentCarousel {\n @Element() hostElement: HTMLStencilElement;\n /**\n * @type Select\n * @options load\n * @options init\n */\n @Prop() initMethod: InitMethodType = 'load';\n /**\n * @type JSON\n * @schema Swiper Options\n */\n @Prop() swiperOptions: string = '{\"slidesPerView\": 1, \"slidesPerGroup\": 1, \"autoplay\": true, \"loop\": false}';\n public swiperCarousel: any;\n public swiper?: HTMLDivElement;\n public swiperWrapper?: HTMLDivElement;\n public swiperPagination?: HTMLDivElement;\n public swiperPrevElement?: HTMLDivElement;\n public swiperNextElement?: HTMLDivElement;\n public swiperScrollbar?: HTMLDivElement;\n public swiperOptionsFinal;\n\n loadStatus: BehaviorSubject<boolean> = new BehaviorSubject(false);\n\n getSwiperOptions(newOptions: string): string {\n return Object.assign({\n observer: true,\n observeParents: true,\n pagination: {\n el: this.swiperPagination,\n },\n navigation: {\n nextEl: this.swiperNextElement,\n prevEl: this.swiperPrevElement,\n },\n scrollbar: {\n el: this.swiperScrollbar,\n },\n }, newOptions);\n }\n componentDidLoad() {\n if (this.initMethod === 'load') {\n if (this.swiperOptions) {\n this.swiperOptionsFinal = this.getSwiperOptions(JSON.parse(this.swiperOptions as string || ''));\n }\n \n let options = {\n root: null,\n rootMargin: '0px',\n threshold: 0.1,\n }\n \n let observer = new IntersectionObserver((entries) => {\n entries.forEach(async entry => {\n if (entry.isIntersecting && !this.loadStatus.getValue()) {\n await this.initSwiper();\n this.loadStatus.next(true);\n }\n });\n }, options);\n observer.observe(this.hostElement);\n }\n }\n\n @Listen('setSwiperOptions')\n setSwiperOptionsCallback(event: CustomEvent) {\n this.loadStatus.subscribe(async () => {\n let loaded = this.loadStatus.value;\n if (loaded) {\n this.swiperOptionsFinal = this.getSwiperOptions(event.detail);\n await this.initSwiper();\n }\n });\n }\n\n async initSwiper() {\n let Swiper = await import('swiper');\n for (const slide of this.swiperWrapper.children as any) {\n slide.classList.add('swiper-slide');\n }\n // configure Swiper to use modules\n this.swiperCarousel = new Swiper.Swiper(this.swiper, {\n ...this.swiperOptionsFinal, ...{\n // modules: [A11y, Navigation, Pagination]\n }\n });\n }\n\n render() {\n return (\n <Host>\n <div class=\"swiper\" ref={el => this.swiper = el as HTMLDivElement}>\n <div class=\"swiper-wrapper\" ref={el => this.swiperWrapper = el as HTMLDivElement}>\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n <div class=\"swiper-pagination\" ref={el => this.swiperPagination = el as HTMLDivElement}></div>\n\n <div class=\"swiper-button-prev\" ref={el => this.swiperPrevElement = el as HTMLDivElement}></div>\n <div class=\"swiper-button-next\" ref={el => this.swiperNextElement = el as HTMLDivElement}></div>\n\n <div class=\"swiper-scrollbar\" ref={el => this.swiperScrollbar = el as HTMLDivElement}></div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"content-carousel.js","sourceRoot":"","sources":["../../../../src/components/content-carousel/content-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAavC,MAAM,OAAO,eAAe;;QAsB1B,eAAU,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;0BAf7B,MAAM;6BAKX,4EAA4E;;IAY5G,gBAAgB,CAAC,UAAkB;QACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE;gBACV,EAAE,EAAE,IAAI,CAAC,gBAAgB;aAC1B;YACD,UAAU,EAAE;gBACV,MAAM,EAAE,IAAI,CAAC,iBAAiB;gBAC9B,MAAM,EAAE,IAAI,CAAC,iBAAiB;aAC/B;YACD,SAAS,EAAE;gBACT,EAAE,EAAE,IAAI,CAAC,eAAe;aACz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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, h, Host, Prop, Listen, Element } from '@stencil/core';\nimport { HTMLStencilElement } from '@stencil/core/internal';\nimport { BehaviorSubject } from 'rxjs';\n// import { A11y, Navigation, Pagination } from 'swiper/modules';\n\n/**\n * @slot content - This slot will usually serve a content hero block or image.\n * @slot - Default slot, same as content slot.\n */\nexport type InitMethodType = 'load' | 'event';\n@Component({\n tag: 'content-carousel',\n styleUrl: 'content-carousel.scss',\n shadow: false,\n})\nexport class ContentCarousel {\n @Element() hostElement: HTMLStencilElement;\n /**\n * @type Select\n * @options load\n * @options init\n */\n @Prop() initMethod: InitMethodType = 'load';\n /**\n * @type JSON\n * @schema Swiper Options\n */\n @Prop() swiperOptions: string = '{\"slidesPerView\": 1, \"slidesPerGroup\": 1, \"autoplay\": true, \"loop\": false}';\n public swiperCarousel: any;\n public swiper?: HTMLDivElement;\n public swiperWrapper?: HTMLDivElement;\n public swiperPagination?: HTMLDivElement;\n public swiperPrevElement?: HTMLDivElement;\n public swiperNextElement?: HTMLDivElement;\n public swiperScrollbar?: HTMLDivElement;\n public swiperOptionsFinal;\n\n loadStatus: BehaviorSubject<boolean> = new BehaviorSubject(false);\n\n getSwiperOptions(newOptions: string): string {\n console.log(this.swiperNextElement);\n return Object.assign({\n observer: true,\n observeParents: true,\n pagination: {\n el: this.swiperPagination,\n },\n navigation: {\n nextEl: this.swiperNextElement,\n prevEl: this.swiperPrevElement,\n },\n scrollbar: {\n el: this.swiperScrollbar,\n },\n }, newOptions);\n }\n componentDidLoad() {\n if (this.initMethod === 'load') {\n if (this.swiperOptions) {\n this.swiperOptionsFinal = this.getSwiperOptions(JSON.parse(this.swiperOptions as string || ''));\n }\n \n let options = {\n root: null,\n rootMargin: '0px',\n threshold: 0.1,\n }\n \n let observer = new IntersectionObserver((entries) => {\n entries.forEach(async entry => {\n if (entry.isIntersecting && !this.loadStatus.getValue()) {\n await this.initSwiper();\n this.loadStatus.next(true);\n }\n });\n }, options);\n observer.observe(this.hostElement);\n }\n }\n\n @Listen('setSwiperOptions')\n setSwiperOptionsCallback(event: CustomEvent) {\n this.loadStatus.subscribe(async () => {\n let loaded = this.loadStatus.value;\n if (loaded) {\n this.swiperOptionsFinal = this.getSwiperOptions(event.detail);\n await this.initSwiper();\n }\n });\n }\n\n async initSwiper() {\n let Swiper = await import('swiper');\n for (const slide of this.swiperWrapper.children as any) {\n slide.classList.add('swiper-slide');\n }\n // configure Swiper to use modules\n this.swiperCarousel = new Swiper.Swiper(this.swiper, {\n ...this.swiperOptionsFinal, ...{\n // modules: [A11y, Navigation, Pagination]\n }\n });\n }\n\n render() {\n return (\n <Host>\n <div class=\"swiper\" ref={el => this.swiper = el as HTMLDivElement}>\n <div class=\"swiper-wrapper\" ref={el => this.swiperWrapper = el as HTMLDivElement}>\n <slot name=\"content\"></slot>\n <slot></slot>\n </div>\n <div class=\"swiper-pagination\" ref={el => this.swiperPagination = el as HTMLDivElement}></div>\n\n <div class=\"swiper-button-prev\" ref={el => this.swiperPrevElement = el as HTMLDivElement}></div>\n <div class=\"swiper-button-next\" ref={el => this.swiperNextElement = el as HTMLDivElement}></div>\n\n <div class=\"swiper-scrollbar\" ref={el => this.swiperScrollbar = el as HTMLDivElement}></div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -27,23 +27,27 @@ export class ContentNavigationBlock {
|
|
|
27
27
|
let openButton = this.hostElement.querySelector('[slot="openButton"]');
|
|
28
28
|
let closeButton = this.hostElement.querySelector('[slot="closeButton"]');
|
|
29
29
|
let content = this.hostElement.querySelector('[slot="content"]');
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
if (openButton) {
|
|
31
|
+
openButton.onclick = () => {
|
|
32
|
+
this.ariaExpanded = this.ariaExpanded === 'true' ? 'false' : 'true';
|
|
33
|
+
content.setAttribute('hidden', this.ariaExpanded === 'false' ? 'true' : 'false');
|
|
34
|
+
if (this.ariaExpanded === 'false') {
|
|
35
|
+
document.body.classList.remove('content-navigation-block-open');
|
|
36
|
+
}
|
|
37
|
+
else if (this.bodyToggle) {
|
|
38
|
+
document.body.classList.add('content-navigation-block-open');
|
|
39
|
+
}
|
|
40
|
+
setTimeout(() => closeButton.focus(), 1);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (closeButton) {
|
|
44
|
+
closeButton.onclick = () => {
|
|
45
|
+
this.ariaExpanded = 'false';
|
|
46
|
+
content.setAttribute('hidden', 'true');
|
|
34
47
|
document.body.classList.remove('content-navigation-block-open');
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
setTimeout(() => closeButton.focus(), 1);
|
|
40
|
-
};
|
|
41
|
-
closeButton.onclick = () => {
|
|
42
|
-
this.ariaExpanded = 'false';
|
|
43
|
-
content.setAttribute('hidden', 'true');
|
|
44
|
-
document.body.classList.remove('content-navigation-block-open');
|
|
45
|
-
setTimeout(() => openButton.focus(), 1);
|
|
46
|
-
};
|
|
48
|
+
setTimeout(() => openButton.focus(), 1);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
render() {
|
|
49
53
|
return (h(Host, { class: this.classString, "aria-expanded": this.ariaExpanded }, h("slot", null), h("slot", { name: "openButton" }), h("slot", { name: "closeButton" }), h("slot", { name: "content" })));
|
|
@@ -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;
|
|
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,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,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,eAAa;YACb,YAAM,IAAI,EAAC,YAAY,GAAQ;YAC/B,YAAM,IAAI,EAAC,aAAa,GAAQ;YAChC,YAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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></slot>\n <slot name=\"openButton\"></slot>\n <slot name=\"closeButton\"></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -9,14 +9,16 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
content-overlay {
|
|
12
|
-
display:
|
|
12
|
+
display: none;
|
|
13
13
|
position: relative;
|
|
14
|
+
flex: 0;
|
|
14
15
|
}
|
|
15
16
|
content-overlay .content-overlay__content > *[slot=content] {
|
|
16
17
|
height: 100%;
|
|
18
|
+
overflow: auto;
|
|
17
19
|
}
|
|
18
|
-
content-overlay.content-overlay-
|
|
19
|
-
display:
|
|
20
|
+
content-overlay.content-overlay-active {
|
|
21
|
+
display: block;
|
|
20
22
|
}
|
|
21
23
|
content-overlay[vertical-position=left] {
|
|
22
24
|
align-items: flex-start;
|
|
@@ -60,6 +62,7 @@ content-overlay .content-overlay__close {
|
|
|
60
62
|
appearance: none;
|
|
61
63
|
background: none;
|
|
62
64
|
border: none;
|
|
65
|
+
min-width: 16px;
|
|
63
66
|
}
|
|
64
67
|
content-overlay.content-overlay--fullscreen .content-overlay-background {
|
|
65
68
|
position: fixed;
|
|
@@ -22,22 +22,33 @@ export class ContentOverlay {
|
|
|
22
22
|
this.classString = '';
|
|
23
23
|
this.contentSlot = undefined;
|
|
24
24
|
this.isFullScreen = false;
|
|
25
|
+
this.hasCloseButton = false;
|
|
26
|
+
this.originalMarkup = undefined;
|
|
25
27
|
}
|
|
26
28
|
onContentBlockActivated(event) {
|
|
27
29
|
if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
|
|
28
30
|
event.preventDefault();
|
|
29
|
-
this.
|
|
31
|
+
if (!this.isActive) {
|
|
32
|
+
this.openOverlay();
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.closeOverlay();
|
|
36
|
+
}
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
async openOverlay() {
|
|
33
|
-
if (this.isActive) {
|
|
34
|
-
|
|
35
|
-
}
|
|
40
|
+
// if (this.isActive) {
|
|
41
|
+
// return false;
|
|
42
|
+
// }
|
|
36
43
|
this.isActive = true;
|
|
44
|
+
if (!this.originalMarkup) {
|
|
45
|
+
this.originalMarkup = this.contentSlot.querySelector('[slot="content"]').innerHTML;
|
|
46
|
+
}
|
|
37
47
|
if (this.target) {
|
|
38
48
|
let targetElement = document.getElementById(this.target);
|
|
39
49
|
if (targetElement) {
|
|
40
50
|
targetElement.classList.add('content-block-overlay-container');
|
|
51
|
+
targetElement.appendChild(this.hostElement);
|
|
41
52
|
}
|
|
42
53
|
}
|
|
43
54
|
else if (this.isFullScreen) {
|
|
@@ -46,6 +57,7 @@ export class ContentOverlay {
|
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
59
|
if (this.contentSlot) {
|
|
60
|
+
this.contentSlot.innerHTML = this.originalMarkup;
|
|
49
61
|
this.setComputedActiveClass();
|
|
50
62
|
if (this.isFullScreen) {
|
|
51
63
|
this.focusTrap = focusTrap.createFocusTrap(this.hostElement, {
|
|
@@ -60,6 +72,7 @@ export class ContentOverlay {
|
|
|
60
72
|
this.contentOverlayActivated.emit(this.hostElement);
|
|
61
73
|
}
|
|
62
74
|
async closeOverlay() {
|
|
75
|
+
this.contentSlot.innerHTML = '';
|
|
63
76
|
this.isActive = false;
|
|
64
77
|
this.activeClass = '';
|
|
65
78
|
if (this.focusTrap) {
|
|
@@ -82,7 +95,6 @@ export class ContentOverlay {
|
|
|
82
95
|
this.activeClass = `content-overlay ${this.isActive ? 'content-overlay-active' : 'content-overlay-inactive'} content-overlay--${positioningValue}`;
|
|
83
96
|
}
|
|
84
97
|
componentWillLoad() {
|
|
85
|
-
this.contentSlot = this.hostElement.querySelector('[slot="content"]');
|
|
86
98
|
this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');
|
|
87
99
|
WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));
|
|
88
100
|
WindowResizeService.registerProp(this.horizontalAlignment).subscribe(newValue => this.hostElement.setAttribute('horizontal-alignment', newValue));
|
|
@@ -94,13 +106,14 @@ export class ContentOverlay {
|
|
|
94
106
|
WindowResizeService.registerProp(this.open).subscribe(newValue => {
|
|
95
107
|
this.hostElement.setAttribute('open', newValue);
|
|
96
108
|
});
|
|
109
|
+
this.hasCloseButton = !!this.hostElement.querySelector('[slot="closeButton"]');
|
|
97
110
|
}
|
|
98
111
|
closeOverlayButtonClicked(event) {
|
|
99
112
|
event.preventDefault();
|
|
100
113
|
this.closeOverlay();
|
|
101
114
|
}
|
|
102
115
|
render() {
|
|
103
|
-
return (h(Host, { class: `${this.activeClass} ${this.classString}` }, h("div", { class: "content-block-overlay-container" }, h("div", { class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, h("div", { ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", class: this.isActive ? 'active' : 'hidden', "aria-expanded": this.isActive }, h("div", { class: "content-overlay__header" }, h("button", { onClick: e => this.closeOverlayButtonClicked(e), class: "content-overlay__close", title: this.closeTitle }, h("slot", { name: "closeButton" })), h("slot", { name: "header" })), h("div", { class: "
|
|
116
|
+
return (h(Host, { class: `${this.activeClass} ${this.classString}` }, h("div", { class: "content-block-overlay-container" }, h("div", { class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, h("div", { ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", class: this.isActive ? 'active' : 'hidden', "aria-expanded": this.isActive }, h("div", { class: "content-overlay__header" }, h("button", { onClick: e => this.closeOverlayButtonClicked(e), class: "content-overlay__close", title: this.closeTitle }, !this.hasCloseButton && (h("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" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18 18 6M6 6l12 12" }))), h("slot", { name: "closeButton" })), h("slot", { name: "header" })), h("div", { class: "content-overlay__content", ref: (el) => (this.contentSlot = el) }, h("slot", { name: "content" })))))));
|
|
104
117
|
}
|
|
105
118
|
componentDidRender() {
|
|
106
119
|
if (this.open === 'true') {
|
|
@@ -347,7 +360,9 @@ export class ContentOverlay {
|
|
|
347
360
|
"activeClass": {},
|
|
348
361
|
"classString": {},
|
|
349
362
|
"contentSlot": {},
|
|
350
|
-
"isFullScreen": {}
|
|
363
|
+
"isFullScreen": {},
|
|
364
|
+
"hasCloseButton": {},
|
|
365
|
+
"originalMarkup": {}
|
|
351
366
|
};
|
|
352
367
|
}
|
|
353
368
|
static get events() {
|
|
@@ -377,7 +392,7 @@ export class ContentOverlay {
|
|
|
377
392
|
return {
|
|
378
393
|
"openOverlay": {
|
|
379
394
|
"complexType": {
|
|
380
|
-
"signature": "() => Promise<
|
|
395
|
+
"signature": "() => Promise<void>",
|
|
381
396
|
"parameters": [],
|
|
382
397
|
"references": {
|
|
383
398
|
"Promise": {
|
|
@@ -385,7 +400,7 @@ export class ContentOverlay {
|
|
|
385
400
|
"id": "global::Promise"
|
|
386
401
|
}
|
|
387
402
|
},
|
|
388
|
-
"return": "Promise<
|
|
403
|
+
"return": "Promise<void>"
|
|
389
404
|
},
|
|
390
405
|
"docs": {
|
|
391
406
|
"text": "",
|
|
@@ -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;;IAItC,uBAAuB,CAAC,KAAkB;QACxC,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,KAAK,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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: HTMLTemplateElement;\n\n dialogElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n\n @State() isFullScreen: boolean = false;\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 this.openOverlay();\n }\n }\n\n @Method()\n async openOverlay() {\n if (this.isActive) {\n return false;\n }\n this.isActive = true;\n if (this.target) {\n let targetElement = document.getElementById(this.target);\n if (targetElement) {\n targetElement.classList.add('content-block-overlay-container');\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.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.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.contentSlot = this.hostElement.querySelector('[slot=\"content\"]');\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 }\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 <slot name=\"closeButton\"></slot>\n </button>\n <slot name=\"header\"></slot>\n </div>\n <div class=\"js-content-overlay-content content-overlay__content\">\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,yBAA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,EAAC,CAAC,EAAC,sBAAsB,GAAG,CAC5E,CACP;gCACD,YAAM,IAAI,EAAC,aAAa,GAAQ,CACzB;4BACT,YAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB;wBACN,WAAK,KAAK,EAAC,0BAA0B,EAAC,GAAG,EAAE,CAAC,EAAkB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;4BACxF,YAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACF,CACF,CACF,CACD,CACR,CAAC;IACJ,CAAC;IAED,kBAAkB;QAChB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;QACrB,CAAC;QACD,IAAI,IAAI,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 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"]}
|
|
@@ -35,19 +35,16 @@ export class ContentButton {
|
|
|
35
35
|
onHandleClickEvent(ev) {
|
|
36
36
|
console.log(ev);
|
|
37
37
|
if (this.hasContentToActivate) {
|
|
38
|
-
console.log('this.hascontenttoactivate');
|
|
39
38
|
ev.preventDefault();
|
|
40
|
-
ev.stopPropagation();
|
|
39
|
+
// ev.stopPropagation();
|
|
41
40
|
this.activatedContent.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: this.activatedContent }));
|
|
42
41
|
this.activatedContent.scrollIntoView({ behavior: 'smooth' });
|
|
43
42
|
}
|
|
44
43
|
else if (this.href && this.href.length > 1 && this.href.substring(0, 1) === '#') {
|
|
45
44
|
let element = document.getElementById(this.href.substring(1));
|
|
46
|
-
console.log(this.href.substring(1));
|
|
47
45
|
if (element) {
|
|
48
46
|
ev.preventDefault();
|
|
49
|
-
ev.stopPropagation();
|
|
50
|
-
console.log(element);
|
|
47
|
+
// ev.stopPropagation();
|
|
51
48
|
element.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: element }));
|
|
52
49
|
// element.scrollIntoView({ behavior: 'smooth' });
|
|
53
50
|
}
|
|
@@ -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,EAAsB,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAG3E;;;;GAIG;AAMH,MAAM,OAAO,aAAa;;;;uBAmBN,EAAE;2BACG,EAAE;8BAIS,KAAK;;;;;;;IAmCvC,iBAAiB;QACf,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;QACpF,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;QACpD,2EAA2E;QAC3E,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QACpC,CAAC;QAED,mBAAmB,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YACpE,IAAI,CAAC,SAAS,GAAG,QAAkB,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,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,kBAAkB,CAAC,EAAE;QACnB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,
|
|
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,EAAsB,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAG3E;;;;GAIG;AAMH,MAAM,OAAO,aAAa;;;;uBAmBN,EAAE;2BACG,EAAE;8BAIS,KAAK;;;;;;;IAmCvC,iBAAiB;QACf,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;QACpF,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;QACpD,2EAA2E;QAC3E,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE,C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AAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;gBACrF,kDAAkD;YACpD,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,WAAW;YAC3B,uBACc,IAAI,CAAC,SAAS,EAC1B,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EACzD,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,mBAC3B,IAAI,CAAC,QAAQ,mBACb,IAAI,CAAC,QAAQ,EAC5B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAElB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CACtB;gBACE,YAAM,IAAI,EAAC,SAAS,GAAQ;gBAC5B,eAAa,CACR,CACR,CAAC,CAAC,CAAC,CACF,WAAK,KAAK,EAAC,mCAAmC;gBAC5C,YAAM,IAAI,EAAC,SAAS,GAAQ;gBAC5B,eAAa,CACT,CACP,CACC;YACJ,YAAM,IAAI,EAAC,kBAAkB,GAAQ,CAChC,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\nimport { Element, 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: HTMLStencilElement;\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 console.log(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"]}
|
|
@@ -14,6 +14,10 @@ content-image.content-image-loading {
|
|
|
14
14
|
content-image.content-image-loaded {
|
|
15
15
|
opacity: 1;
|
|
16
16
|
}
|
|
17
|
+
content-image[aspect-ratio] img, content-image[aspect-ratio] picture, content-image[aspect-ratio] video {
|
|
18
|
+
aspect-ratio: var(--aspect-ratio);
|
|
19
|
+
object-fit: cover;
|
|
20
|
+
}
|
|
17
21
|
content-image img,
|
|
18
22
|
content-image picture,
|
|
19
23
|
content-image video {
|
|
@@ -21,13 +25,6 @@ content-image video {
|
|
|
21
25
|
width: 100%;
|
|
22
26
|
height: 100%;
|
|
23
27
|
}
|
|
24
|
-
content-hero-block content-image img, content-grid-formatter content-image img,
|
|
25
|
-
content-hero-block content-image picture,
|
|
26
|
-
content-grid-formatter content-image picture,
|
|
27
|
-
content-hero-block content-image video,
|
|
28
|
-
content-grid-formatter content-image video {
|
|
29
|
-
height: auto;
|
|
30
|
-
}
|
|
31
28
|
content-image .content-image__media-content {
|
|
32
29
|
display: none;
|
|
33
30
|
position: absolute;
|