@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
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const windowResizeService = require('./window-resize-service-
|
|
7
|
-
const utils = require('./utils-
|
|
5
|
+
const index = require('./index-9f20d89a.js');
|
|
6
|
+
const windowResizeService = require('./window-resize-service-ac5c2012.js');
|
|
7
|
+
const utils = require('./utils-db61cd70.js');
|
|
8
8
|
require('./BehaviorSubject-771fd78b.js');
|
|
9
9
|
|
|
10
10
|
const contentAccordionCss = "*{box-sizing:border-box}content-accordion{display:block}content-accordion>button{display:block;width:100%;padding:0;border:none;font:inherit;color:inherit;background-color:transparent;cursor:pointer}content-accordion[expanded]>.content-accordion__reveal{display:block}content-accordion>.content-accordion__reveal{display:none}";
|
|
@@ -16,7 +16,7 @@ const ContentAccordion = class {
|
|
|
16
16
|
this.open = 'false|true';
|
|
17
17
|
this.animationStart = 'animation-start';
|
|
18
18
|
this.animationEnd = 'animation-end';
|
|
19
|
-
this.animationTime =
|
|
19
|
+
this.animationTime = 0;
|
|
20
20
|
this.isOpen = false;
|
|
21
21
|
this.randomID = '';
|
|
22
22
|
this.classString = '';
|
|
@@ -99,19 +99,16 @@ const ContentButton = class {
|
|
|
99
99
|
onHandleClickEvent(ev) {
|
|
100
100
|
console.log(ev);
|
|
101
101
|
if (this.hasContentToActivate) {
|
|
102
|
-
console.log('this.hascontenttoactivate');
|
|
103
102
|
ev.preventDefault();
|
|
104
|
-
ev.stopPropagation();
|
|
103
|
+
// ev.stopPropagation();
|
|
105
104
|
this.activatedContent.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: this.activatedContent }));
|
|
106
105
|
this.activatedContent.scrollIntoView({ behavior: 'smooth' });
|
|
107
106
|
}
|
|
108
107
|
else if (this.href && this.href.length > 1 && this.href.substring(0, 1) === '#') {
|
|
109
108
|
let element = document.getElementById(this.href.substring(1));
|
|
110
|
-
console.log(this.href.substring(1));
|
|
111
109
|
if (element) {
|
|
112
110
|
ev.preventDefault();
|
|
113
|
-
ev.stopPropagation();
|
|
114
|
-
console.log(element);
|
|
111
|
+
// ev.stopPropagation();
|
|
115
112
|
element.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: element }));
|
|
116
113
|
// element.scrollIntoView({ behavior: 'smooth' });
|
|
117
114
|
}
|
|
@@ -124,7 +121,7 @@ const ContentButton = class {
|
|
|
124
121
|
};
|
|
125
122
|
ContentButton.style = contentButtonCss;
|
|
126
123
|
|
|
127
|
-
const contentGridFormatterCss = "*{box-sizing:border-box}content-grid-formatter{width:100%;overflow:auto}content-grid-formatter *{box-sizing:border-box}content-grid-formatter[type=grid]{display:grid;grid-template-columns:repeat(var(--columns), 1fr)}content-grid-formatter[type=flex]{display:flex;align-items:var(--align-items);justify-content:var(--justify-content);flex-wrap:wrap}content-grid-formatter[type=flex]>*{overflow:auto;flex:0 0 auto;width:calc(100% / var(--columns))}content-grid-formatter>[flex-shrink=true]{width:auto;flex-shrink:1}content-grid-formatter[flex-shrink=true]>*{flex-shrink:1}content-grid-formatter[flex-grow=true]>*{flex-grow:1}content-grid-formatter>[flex-grow=true]{width:auto;flex-grow:1}";
|
|
124
|
+
const contentGridFormatterCss = "*{box-sizing:border-box}content-grid-formatter{width:100%;overflow:auto}content-grid-formatter *{box-sizing:border-box}content-grid-formatter[type=grid]{display:grid;grid-template-columns:repeat(var(--columns), 1fr);column-gap:var(--column-gap)}content-grid-formatter[type=flex]{display:flex;align-items:var(--align-items);justify-content:var(--justify-content);flex-wrap:wrap}content-grid-formatter[type=flex]>*{overflow:auto;flex:0 0 auto;width:calc(100% / var(--columns))}content-grid-formatter>[flex-shrink=true]{width:auto;flex-shrink:1}content-grid-formatter[flex-shrink=true]>*{flex-shrink:1}content-grid-formatter[flex-grow=true]>*{flex-grow:1}content-grid-formatter>[flex-grow=true]{width:auto;flex-grow:1}";
|
|
128
125
|
|
|
129
126
|
const ContentGridFormatter = class {
|
|
130
127
|
constructor(hostRef) {
|
|
@@ -137,10 +134,11 @@ const ContentGridFormatter = class {
|
|
|
137
134
|
this.verticalAlignment = 'space-between';
|
|
138
135
|
this.horizontalAlignment = 'space-between';
|
|
139
136
|
this.columns = '1';
|
|
137
|
+
this.columnGap = '0';
|
|
140
138
|
this.activeClassString = undefined;
|
|
141
139
|
this.inlineStyle = {};
|
|
142
140
|
}
|
|
143
|
-
|
|
141
|
+
componentWillLoad() {
|
|
144
142
|
return Promise.allSettled([
|
|
145
143
|
windowResizeService.WindowResizeService.registerProp(this.type).subscribe(newValue => (this.type = newValue)),
|
|
146
144
|
windowResizeService.WindowResizeService.registerProp(this.verticalAlignment).subscribe(newValue => {
|
|
@@ -157,6 +155,10 @@ const ContentGridFormatter = class {
|
|
|
157
155
|
this.columns = newValue;
|
|
158
156
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--columns': newValue });
|
|
159
157
|
}),
|
|
158
|
+
windowResizeService.WindowResizeService.registerProp(this.columnGap).subscribe(newValue => {
|
|
159
|
+
this.columnGap = newValue;
|
|
160
|
+
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--column-gap': newValue });
|
|
161
|
+
}),
|
|
160
162
|
windowResizeService.WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue)),
|
|
161
163
|
]);
|
|
162
164
|
}
|
|
@@ -166,7 +168,7 @@ const ContentGridFormatter = class {
|
|
|
166
168
|
};
|
|
167
169
|
ContentGridFormatter.style = contentGridFormatterCss;
|
|
168
170
|
|
|
169
|
-
const contentHeroBlockCss = "*{box-sizing:border-box}content-hero-block{position:relative}content-hero-block[content-position=above]{display:grid;grid-template-columns:1fr}content-hero-block[content-position=above] .content-hero-block__background,content-hero-block[content-position=above] .content-hero-block__content{grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__background{height:100%;overflow:hidden}content-hero-block[content-position=above] .content-hero-block__content{display:flex;top:0;left:0;width:100%;height:100%;grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__content>*{width:100%}content-hero-block[content-position=above] .content-hero-block__content{position:relative;z-index:1}content-hero-block[content-position=below]{display:block}";
|
|
171
|
+
const contentHeroBlockCss = "*{box-sizing:border-box}content-hero-block{position:relative}content-hero-block[content-position=above]{display:grid;grid-template-columns:1fr}content-hero-block[content-position=above] .content-hero-block__background,content-hero-block[content-position=above] .content-hero-block__content{grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__background{height:100%;overflow:hidden}content-hero-block[content-position=above] .content-hero-block__background content-image,content-hero-block[content-position=above] .content-hero-block__background content-image picture,content-hero-block[content-position=above] .content-hero-block__background content-image img,content-hero-block[content-position=above] .content-hero-block__background content-image video{height:100%}content-hero-block[content-position=above] .content-hero-block__content{display:flex;top:0;left:0;width:100%;height:100%;grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__content>*{width:100%}content-hero-block[content-position=above] .content-hero-block__content{position:relative;z-index:1}content-hero-block[content-position=below]{display:block}";
|
|
170
172
|
|
|
171
173
|
const ContentHeroBlock = class {
|
|
172
174
|
constructor(hostRef) {
|
|
@@ -195,7 +197,7 @@ const ContentHeroBlock = class {
|
|
|
195
197
|
};
|
|
196
198
|
ContentHeroBlock.style = contentHeroBlockCss;
|
|
197
199
|
|
|
198
|
-
const contentImageCss = "*{box-sizing:border-box}content-image{display:block;height:auto;transition:opacity 0.3s;position:relative}content-image.content-image-loading{opacity:0}content-image.content-image-loaded{opacity:1}content-image img,content-image picture,content-image video{
|
|
200
|
+
const contentImageCss = "*{box-sizing:border-box}content-image{display:block;height:auto;transition:opacity 0.3s;position:relative}content-image.content-image-loading{opacity:0}content-image.content-image-loaded{opacity:1}content-image[aspect-ratio] img,content-image[aspect-ratio] picture,content-image[aspect-ratio] video{aspect-ratio:var(--aspect-ratio);object-fit:cover}content-image img,content-image picture,content-image video{display:block;width:100%;height:100%}content-image .content-image__media-content{display:none;position:absolute;width:100%;height:100%;top:0;left:0;align-items:center;justify-content:center;overflow:hidden}content-image .content-image__media-content [slot=mediaContent]{height:100%;width:100%}content-image[content=true] .content-image__media-content{display:flex}";
|
|
199
201
|
|
|
200
202
|
const ContentImage = class {
|
|
201
203
|
constructor(hostRef) {
|
|
@@ -207,6 +209,8 @@ const ContentImage = class {
|
|
|
207
209
|
this.alt = undefined;
|
|
208
210
|
this.width = '16';
|
|
209
211
|
this.height = '9';
|
|
212
|
+
this.aspectRatio = undefined;
|
|
213
|
+
this.type = 'image';
|
|
210
214
|
this.videoType = 'video/mp4';
|
|
211
215
|
this.showContent = 'false|true';
|
|
212
216
|
this.lazyLoadIsComplete = false;
|
|
@@ -215,6 +219,7 @@ const ContentImage = class {
|
|
|
215
219
|
this.classString = '';
|
|
216
220
|
this.inlineStyle = {};
|
|
217
221
|
this.hasMediaContent = false;
|
|
222
|
+
this.pictureImageSrc = undefined;
|
|
218
223
|
}
|
|
219
224
|
preloadImage(src) {
|
|
220
225
|
return new Promise(r => {
|
|
@@ -226,12 +231,22 @@ const ContentImage = class {
|
|
|
226
231
|
}
|
|
227
232
|
componentWillLoad() {
|
|
228
233
|
this.hasMediaContent = !!this.hostElement.querySelector('[slot="mediaContent"]');
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
let observer = new IntersectionObserver(entries => {
|
|
235
|
+
entries.forEach(async (entry) => {
|
|
236
|
+
if (entry.isIntersecting) {
|
|
237
|
+
this.lazyLoadIsComplete = true;
|
|
238
|
+
this.pictureImageSrc = utils.getCurrentValue(this.src);
|
|
239
|
+
this.showVideoAsGif = this.pictureImageSrc.indexOf('.mp4') >= 0 || utils.getCurrentValue(this.type) === 'video';
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}, {
|
|
243
|
+
root: null,
|
|
244
|
+
rootMargin: `${Math.max(100, window.innerHeight * 0.15)}px`,
|
|
245
|
+
threshold: 0.1,
|
|
246
|
+
});
|
|
247
|
+
observer.observe(this.hostElement);
|
|
248
|
+
windowResizeService.WindowResizeService.registerProp(this.aspectRatio).subscribe(newValue => {
|
|
249
|
+
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--aspect-ratio': `${newValue}` });
|
|
235
250
|
});
|
|
236
251
|
windowResizeService.WindowResizeService.registerProp(this.alt).subscribe(newValue => {
|
|
237
252
|
this.alt = newValue;
|
|
@@ -260,19 +275,7 @@ const ContentImage = class {
|
|
|
260
275
|
}
|
|
261
276
|
}
|
|
262
277
|
render() {
|
|
263
|
-
|
|
264
|
-
let pictureImageSrc = '';
|
|
265
|
-
if (this.src) {
|
|
266
|
-
utils.breakpointValues.forEach((_bp, index) => {
|
|
267
|
-
if (index === 0) {
|
|
268
|
-
pictureImageSrc = utils.getValueAtIndex(0, this.src);
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
pictureSrcSet += `${utils.getValueAtIndex(index, this.src)} ${utils.breakpointValues[index]}w,`;
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
return (index.h(index.Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (index.h("div", { class: "content-image__media-content" }, index.h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (index.h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, index.h("source", { src: this.lazyLoadIsComplete ? this.src : null, type: this.videoType }))) : (index.h("picture", null, index.h("source", { srcSet: pictureSrcSet }), index.h("img", { width: this.width, height: this.height, src: pictureImageSrc, alt: this.alt })))));
|
|
278
|
+
return (index.h(index.Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (index.h("div", { class: "content-image__media-content" }, index.h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (index.h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, index.h("source", { src: this.lazyLoadIsComplete ? this.src : null, type: this.videoType }))) : (index.h("img", { width: this.width, height: this.height, src: this.pictureImageSrc, alt: this.alt }))));
|
|
276
279
|
}
|
|
277
280
|
get hostElement() { return index.getElement(this); }
|
|
278
281
|
static get watchers() { return {
|
|
@@ -2250,7 +2253,7 @@ aria.replaceDialog = function (newDialogId, newFocusAfterClosed, newFocusFirst)
|
|
|
2250
2253
|
}; // end replaceDialog
|
|
2251
2254
|
window.aria = aria;
|
|
2252
2255
|
|
|
2253
|
-
const contentOverlayCss = "*{box-sizing:border-box}.content-block-overlay-container{position:relative;display:block;height:100%}content-overlay{display:
|
|
2256
|
+
const contentOverlayCss = "*{box-sizing:border-box}.content-block-overlay-container{position:relative;display:block;height:100%}content-overlay{display:none;position:relative;flex:0}content-overlay .content-overlay__content>*[slot=content]{height:100%;overflow:auto}content-overlay.content-overlay-active{display:block}content-overlay[vertical-position=left]{align-items:flex-start}content-overlay[vertical-position=center]{align-items:center}content-overlay[vertical-position=right]{align-items:flex-end}content-overlay[vertical-position=top]{justify-content:flex-start}content-overlay[vertical-position=center]{justify-content:center}content-overlay[vertical-position=bottom]{justify-content:flex-end}content-overlay .content-overlay-background{background:rgba(255, 255, 255, 0.8);bottom:0;display:none;top:0;z-index:100000;right:0;left:0}content-overlay .content-overlay-background.active{display:block}content-overlay .content-overlay__header{display:flex;align-items:center}content-overlay .content-overlay__close{order:2;margin-left:auto;cursor:pointer;z-index:1;appearance:none;background:none;border:none;min-width:16px}content-overlay.content-overlay--fullscreen .content-overlay-background{position:fixed}content-overlay.content-overlay--absolute{position:absolute;box-sizing:border-box;z-index:100000;height:100%;width:100%;top:0;left:0}content-overlay.content-overlay--absolute .content-overlay-background{position:absolute}content-overlay.content-overlay--absolute .content-overlay__content,content-overlay.content-overlay--fullscreen .content-overlay__content{flex:1;overflow:hidden}content-overlay [role=dialog]{display:flex;flex-direction:column;height:100%;justify-content:flex-start}content-overlay [role=dialog].hidden{display:none}body.has-dialog{overflow:hidden}";
|
|
2254
2257
|
|
|
2255
2258
|
const ContentOverlay = class {
|
|
2256
2259
|
constructor(hostRef) {
|
|
@@ -2268,22 +2271,33 @@ const ContentOverlay = class {
|
|
|
2268
2271
|
this.classString = '';
|
|
2269
2272
|
this.contentSlot = undefined;
|
|
2270
2273
|
this.isFullScreen = false;
|
|
2274
|
+
this.hasCloseButton = false;
|
|
2275
|
+
this.originalMarkup = undefined;
|
|
2271
2276
|
}
|
|
2272
2277
|
onContentBlockActivated(event) {
|
|
2273
2278
|
if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
|
|
2274
2279
|
event.preventDefault();
|
|
2275
|
-
this.
|
|
2280
|
+
if (!this.isActive) {
|
|
2281
|
+
this.openOverlay();
|
|
2282
|
+
}
|
|
2283
|
+
else {
|
|
2284
|
+
this.closeOverlay();
|
|
2285
|
+
}
|
|
2276
2286
|
}
|
|
2277
2287
|
}
|
|
2278
2288
|
async openOverlay() {
|
|
2279
|
-
if (this.isActive) {
|
|
2280
|
-
|
|
2281
|
-
}
|
|
2289
|
+
// if (this.isActive) {
|
|
2290
|
+
// return false;
|
|
2291
|
+
// }
|
|
2282
2292
|
this.isActive = true;
|
|
2293
|
+
if (!this.originalMarkup) {
|
|
2294
|
+
this.originalMarkup = this.contentSlot.querySelector('[slot="content"]').innerHTML;
|
|
2295
|
+
}
|
|
2283
2296
|
if (this.target) {
|
|
2284
2297
|
let targetElement = document.getElementById(this.target);
|
|
2285
2298
|
if (targetElement) {
|
|
2286
2299
|
targetElement.classList.add('content-block-overlay-container');
|
|
2300
|
+
targetElement.appendChild(this.hostElement);
|
|
2287
2301
|
}
|
|
2288
2302
|
}
|
|
2289
2303
|
else if (this.isFullScreen) {
|
|
@@ -2292,6 +2306,7 @@ const ContentOverlay = class {
|
|
|
2292
2306
|
}
|
|
2293
2307
|
}
|
|
2294
2308
|
if (this.contentSlot) {
|
|
2309
|
+
this.contentSlot.innerHTML = this.originalMarkup;
|
|
2295
2310
|
this.setComputedActiveClass();
|
|
2296
2311
|
if (this.isFullScreen) {
|
|
2297
2312
|
this.focusTrap = createFocusTrap(this.hostElement, {
|
|
@@ -2306,6 +2321,7 @@ const ContentOverlay = class {
|
|
|
2306
2321
|
this.contentOverlayActivated.emit(this.hostElement);
|
|
2307
2322
|
}
|
|
2308
2323
|
async closeOverlay() {
|
|
2324
|
+
this.contentSlot.innerHTML = '';
|
|
2309
2325
|
this.isActive = false;
|
|
2310
2326
|
this.activeClass = '';
|
|
2311
2327
|
if (this.focusTrap) {
|
|
@@ -2328,7 +2344,6 @@ const ContentOverlay = class {
|
|
|
2328
2344
|
this.activeClass = `content-overlay ${this.isActive ? 'content-overlay-active' : 'content-overlay-inactive'} content-overlay--${positioningValue}`;
|
|
2329
2345
|
}
|
|
2330
2346
|
componentWillLoad() {
|
|
2331
|
-
this.contentSlot = this.hostElement.querySelector('[slot="content"]');
|
|
2332
2347
|
this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');
|
|
2333
2348
|
windowResizeService.WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));
|
|
2334
2349
|
windowResizeService.WindowResizeService.registerProp(this.horizontalAlignment).subscribe(newValue => this.hostElement.setAttribute('horizontal-alignment', newValue));
|
|
@@ -2340,13 +2355,14 @@ const ContentOverlay = class {
|
|
|
2340
2355
|
windowResizeService.WindowResizeService.registerProp(this.open).subscribe(newValue => {
|
|
2341
2356
|
this.hostElement.setAttribute('open', newValue);
|
|
2342
2357
|
});
|
|
2358
|
+
this.hasCloseButton = !!this.hostElement.querySelector('[slot="closeButton"]');
|
|
2343
2359
|
}
|
|
2344
2360
|
closeOverlayButtonClicked(event) {
|
|
2345
2361
|
event.preventDefault();
|
|
2346
2362
|
this.closeOverlay();
|
|
2347
2363
|
}
|
|
2348
2364
|
render() {
|
|
2349
|
-
return (index.h(index.Host, { class: `${this.activeClass} ${this.classString}` }, index.h("div", { class: "content-block-overlay-container" }, index.h("div", { class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, index.h("div", { ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", class: this.isActive ? 'active' : 'hidden', "aria-expanded": this.isActive }, index.h("div", { class: "content-overlay__header" }, index.h("button", { onClick: e => this.closeOverlayButtonClicked(e), class: "content-overlay__close", title: this.closeTitle }, index.h("slot", { name: "closeButton" })), index.h("slot", { name: "header" })), index.h("div", { class: "
|
|
2365
|
+
return (index.h(index.Host, { class: `${this.activeClass} ${this.classString}` }, index.h("div", { class: "content-block-overlay-container" }, index.h("div", { class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, index.h("div", { ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", class: this.isActive ? 'active' : 'hidden', "aria-expanded": this.isActive }, index.h("div", { class: "content-overlay__header" }, index.h("button", { onClick: e => this.closeOverlayButtonClicked(e), class: "content-overlay__close", title: this.closeTitle }, !this.hasCloseButton && (index.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" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18 18 6M6 6l12 12" }))), index.h("slot", { name: "closeButton" })), index.h("slot", { name: "header" })), index.h("div", { class: "content-overlay__content", ref: (el) => (this.contentSlot = el) }, index.h("slot", { name: "content" })))))));
|
|
2350
2366
|
}
|
|
2351
2367
|
componentDidRender() {
|
|
2352
2368
|
if (this.open === 'true') {
|
|
@@ -2375,7 +2391,7 @@ const ContentSpacingWrapper = class {
|
|
|
2375
2391
|
this.maxWidth = '100';
|
|
2376
2392
|
this.fullHeight = 'false';
|
|
2377
2393
|
this.textAlign = 'default';
|
|
2378
|
-
this.horizontalPosition =
|
|
2394
|
+
this.horizontalPosition = 'default';
|
|
2379
2395
|
this.topOffset = '0';
|
|
2380
2396
|
this.bottomOffset = '0';
|
|
2381
2397
|
this.leftOffset = '0';
|