@ptcwebops/ptcw-design 6.3.2 → 6.3.3
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/{component-5b5b6a98.js → component-1b8ad4d2.js} +1 -1
- package/dist/cjs/{component-06dda623.js → component-35540bfb.js} +1 -1
- package/dist/cjs/event-jumbotron-example.cjs.entry.js +196 -0
- package/dist/cjs/focus-trap.esm-8c5a8938.js +1558 -0
- package/dist/cjs/icon-asset.cjs.entry.js +65 -0
- package/dist/cjs/list-item.cjs.entry.js +48 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ptc-breadcrumb.cjs.entry.js +47 -0
- package/dist/cjs/ptc-button.cjs.entry.js +87 -0
- package/dist/cjs/ptc-card-bottom_2.cjs.entry.js +156 -0
- package/dist/cjs/ptc-card-content.cjs.entry.js +76 -0
- package/dist/cjs/ptc-close-icon_2.cjs.entry.js +336 -0
- package/dist/cjs/ptc-data-lookup.cjs.entry.js +2 -2
- package/dist/cjs/ptc-form-checkbox_2.cjs.entry.js +1 -1
- package/dist/cjs/ptc-icon-list.cjs.entry.js +2 -2
- package/dist/cjs/ptc-img.cjs.entry.js +133 -0
- package/dist/cjs/ptc-link.cjs.entry.js +87 -0
- package/dist/cjs/ptc-multi-select_2.cjs.entry.js +2 -2
- package/dist/cjs/ptc-office-location-card.cjs.entry.js +3 -2
- package/dist/cjs/ptc-office-locations.cjs.entry.js +5 -0
- package/dist/cjs/ptc-para.cjs.entry.js +127 -0
- package/dist/cjs/ptc-scroll-button.cjs.entry.js +136 -0
- package/dist/cjs/ptc-spacer.cjs.entry.js +38 -0
- package/dist/cjs/ptc-title.cjs.entry.js +152 -0
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/collection/components/ptc-icon-list/ptc-icon-list.css +6 -0
- package/dist/collection/components/ptc-icon-list/ptc-icon-list.js +1 -1
- package/dist/collection/components/ptc-office-location-card/ptc-office-location-card.js +3 -2
- package/dist/collection/components/ptc-office-locations/ptc-office-locations.js +5 -0
- package/dist/custom-elements/index.js +11 -5
- package/dist/esm/blog-detail-content_2.entry.js +1 -1
- package/dist/esm/blog-detail-layout.entry.js +1 -1
- package/dist/esm/blogs-search-section.entry.js +1 -1
- package/dist/esm/{component-274da230.js → component-8c53e377.js} +1 -1
- package/dist/esm/{component-341e4eaa.js → component-9beac35b.js} +1 -1
- package/dist/esm/event-jumbotron-example.entry.js +192 -0
- package/dist/esm/focus-trap.esm-d205300d.js +1556 -0
- package/dist/esm/homepage-jumbotron.entry.js +1 -1
- package/dist/esm/homepage-toggled-content.entry.js +1 -1
- package/dist/esm/icon-asset.entry.js +61 -0
- package/dist/esm/list-item.entry.js +44 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/most-popular-news.entry.js +1 -1
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/ptc-accordion-item.entry.js +1 -1
- package/dist/esm/ptc-background-video.entry.js +1 -1
- package/dist/esm/ptc-breadcrumb.entry.js +43 -0
- package/dist/esm/ptc-button.entry.js +83 -0
- package/dist/esm/ptc-card-bottom_2.entry.js +151 -0
- package/dist/esm/ptc-card-content.entry.js +72 -0
- package/dist/esm/ptc-close-icon_2.entry.js +331 -0
- package/dist/esm/ptc-collapse-list.entry.js +1 -1
- package/dist/esm/ptc-data-lookup.entry.js +2 -2
- package/dist/esm/ptc-form-checkbox_2.entry.js +2 -2
- package/dist/esm/ptc-homepage-image-feature.entry.js +1 -1
- package/dist/esm/ptc-homepage-video-background.entry.js +1 -1
- package/dist/esm/ptc-icon-card.entry.js +1 -1
- package/dist/esm/ptc-icon-list.entry.js +2 -2
- package/dist/esm/ptc-img.entry.js +129 -0
- package/dist/esm/ptc-link.entry.js +83 -0
- package/dist/esm/ptc-media-card.entry.js +1 -1
- package/dist/esm/ptc-multi-select_2.entry.js +3 -3
- package/dist/esm/ptc-office-location-card.entry.js +3 -2
- package/dist/esm/ptc-office-locations.entry.js +5 -0
- package/dist/esm/ptc-para.entry.js +123 -0
- package/dist/esm/ptc-pricing-packaging-table.entry.js +1 -1
- package/dist/esm/ptc-pricing-tabs.entry.js +1 -1
- package/dist/esm/ptc-scroll-button.entry.js +132 -0
- package/dist/esm/ptc-social-icons-footer.entry.js +1 -1
- package/dist/esm/ptc-spacer.entry.js +34 -0
- package/dist/esm/ptc-title.entry.js +148 -0
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/esm/{utils-ff65c75b.js → utils-63eab4bd.js} +1 -1
- package/dist/ptcw-design/p-01075feb.entry.js +1 -0
- package/dist/ptcw-design/p-0b33279e.js +10 -0
- package/dist/ptcw-design/p-0c69ea52.entry.js +1 -0
- package/dist/ptcw-design/{p-e0b873d0.entry.js → p-16e70f20.entry.js} +1 -1
- package/dist/ptcw-design/{p-ae970a60.entry.js → p-17f6e145.entry.js} +1 -1
- package/dist/ptcw-design/p-25a25451.entry.js +1 -0
- package/dist/ptcw-design/{p-e4000363.entry.js → p-28be539b.entry.js} +1 -1
- package/dist/ptcw-design/{p-ec7fb1fb.entry.js → p-2cb2de0f.entry.js} +1 -1
- package/dist/ptcw-design/p-42992202.entry.js +1 -0
- package/dist/ptcw-design/{p-d9abe7e8.entry.js → p-48c33817.entry.js} +1 -1
- package/dist/ptcw-design/{p-e3f8e5d5.entry.js → p-49e54079.entry.js} +1 -1
- package/dist/ptcw-design/{p-2c6fc745.entry.js → p-4ee98a3e.entry.js} +1 -1
- package/dist/ptcw-design/{p-1ca8a5bf.entry.js → p-5dae4f30.entry.js} +1 -1
- package/dist/ptcw-design/{p-d10cb999.entry.js → p-627103d8.entry.js} +1 -1
- package/dist/ptcw-design/{p-c95f423e.entry.js → p-6a3caf2b.entry.js} +1 -1
- package/dist/ptcw-design/{p-7a9611b4.entry.js → p-6f5fecae.entry.js} +1 -1
- package/dist/ptcw-design/p-7793babb.entry.js +1 -0
- package/dist/ptcw-design/{p-8872161f.js → p-77b1221e.js} +1 -1
- package/dist/ptcw-design/p-7a3e9ecd.entry.js +1 -0
- package/dist/ptcw-design/p-7fb155da.entry.js +1 -0
- package/dist/ptcw-design/p-7fe4d383.entry.js +1 -0
- package/dist/ptcw-design/{p-c37a3bd2.entry.js → p-821f0ff9.entry.js} +1 -1
- package/dist/ptcw-design/p-92d22c78.entry.js +1 -0
- package/dist/ptcw-design/{p-be533f0d.js → p-98844b50.js} +1 -1
- package/dist/ptcw-design/p-99355e65.entry.js +1 -0
- package/dist/ptcw-design/p-a3822c52.entry.js +1 -0
- package/dist/ptcw-design/{p-918fb77d.entry.js → p-b52301e2.entry.js} +1 -1
- package/dist/ptcw-design/p-b651c1cb.entry.js +1 -0
- package/dist/ptcw-design/p-b8ee8699.entry.js +1 -0
- package/dist/ptcw-design/p-bf18b622.entry.js +1 -0
- package/dist/ptcw-design/p-bf3bc577.entry.js +1 -0
- package/dist/ptcw-design/{p-1b257420.entry.js → p-c01ea76f.entry.js} +1 -1
- package/dist/ptcw-design/{p-6d3326da.entry.js → p-cbee4653.entry.js} +1 -1
- package/dist/ptcw-design/{p-c66b8926.entry.js → p-d3229458.entry.js} +1 -1
- package/dist/ptcw-design/{p-cfa6996d.entry.js → p-dd02e4d6.entry.js} +1 -1
- package/dist/ptcw-design/{p-da82dc93.entry.js → p-e577ad62.entry.js} +1 -1
- package/dist/ptcw-design/{p-808ec62a.entry.js → p-eec2f3da.entry.js} +1 -1
- package/dist/ptcw-design/p-f4eb6d0a.entry.js +1 -0
- package/dist/ptcw-design/{p-36007a57.entry.js → p-fd394e84.entry.js} +1 -1
- package/dist/ptcw-design/p-feecf6b5.entry.js +1 -0
- package/dist/ptcw-design/ptcw-design.css +1 -1
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/ptc-office-location-card/ptc-office-location-card.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/cjs/event-jumbotron-example_15.cjs.entry.js +0 -3095
- package/dist/cjs/ptc-card-bottom.cjs.entry.js +0 -67
- package/dist/esm/event-jumbotron-example_15.entry.js +0 -3077
- package/dist/esm/ptc-card-bottom.entry.js +0 -63
- package/dist/ptcw-design/p-1a6759a4.entry.js +0 -1
- package/dist/ptcw-design/p-48815ee0.entry.js +0 -1
- package/dist/ptcw-design/p-8cd1d668.entry.js +0 -11
- package/dist/ptcw-design/p-9fe0c27d.entry.js +0 -1
- package/dist/ptcw-design/p-dbbe35bf.entry.js +0 -1
- /package/dist/ptcw-design/{p-c1513c3f.js → p-98426799.js} +0 -0
|
@@ -14,7 +14,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
14
14
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
15
|
PERFORMANCE OF THIS SOFTWARE.
|
|
16
16
|
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
17
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
18
|
|
|
19
19
|
var extendStatics = function(d, b) {
|
|
20
20
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-63ddc79c.js');
|
|
6
|
+
const focusTrap_esm = require('./focus-trap.esm-8c5a8938.js');
|
|
7
|
+
|
|
8
|
+
const eventJumbotronExampleCss = "h1.sc-event-jumbotron-example,h2.sc-event-jumbotron-example,h3.sc-event-jumbotron-example,h4.sc-event-jumbotron-example,h5.sc-event-jumbotron-example,h6.sc-event-jumbotron-example,p.sc-event-jumbotron-example,ul.sc-event-jumbotron-example,li.sc-event-jumbotron-example,ptc-subnav.sc-event-jumbotron-example,ptc-tab-list.sc-event-jumbotron-example,ptc-link.sc-event-jumbotron-example,ptc-square-card.sc-event-jumbotron-example,.hyphenate-text.sc-event-jumbotron-example,ptc-footer.sc-event-jumbotron-example{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1.sc-event-jumbotron-example,h2.sc-event-jumbotron-example,h3.sc-event-jumbotron-example,h4.sc-event-jumbotron-example,h5.sc-event-jumbotron-example,h6.sc-event-jumbotron-example,p.sc-event-jumbotron-example,ul.sc-event-jumbotron-example,li.sc-event-jumbotron-example,ptc-subnav.sc-event-jumbotron-example,ptc-tab-list.sc-event-jumbotron-example,ptc-link.sc-event-jumbotron-example,ptc-square-card.sc-event-jumbotron-example,.hyphenate-text.sc-event-jumbotron-example,ptc-footer.sc-event-jumbotron-example{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}.sc-event-jumbotron-example-h{display:block;position:relative}.event-jumbotron.sc-event-jumbotron-example{margin-bottom:3rem;width:100%}.white-placeholder.sc-event-jumbotron-example{position:absolute;height:130px;width:100%;background-color:#F3f3f3;bottom:0px}.jumbotron-cards-wrapper.sc-event-jumbotron-example{z-index:1;position:relative;display:flex;flex-direction:column}.jumbotron-cards.sc-event-jumbotron-example{display:flex;gap:24px;overflow-x:auto;padding:0 24px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;cursor:grab}.jumbotron-cards.sc-event-jumbotron-example::-webkit-scrollbar{display:none}.jumbotron-cards.dragging.sc-event-jumbotron-example{cursor:grabbing}.card.sc-event-jumbotron-example{flex:1 0 auto;width:250px;height:414px;background:transparent;border-radius:var(--ptc-border-radius-standard);display:flex;justify-content:center;align-items:center;text-align:center;flex-direction:column;padding:24px;position:relative}.card.sc-event-jumbotron-example::after{content:\"\";position:absolute;top:0;left:0;bottom:0;right:0;box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);z-index:-1;border-radius:var(--ptc-border-radius-standard)}.card.sc-event-jumbotron-example:focus-visible{border-radius:var(--ptc-border-radius-standard);outline:5px solid var(--keyboard-nav-outline)}.card.sc-event-jumbotron-example ptc-img.sc-event-jumbotron-example::after{content:\"\";top:0px;left:0px;position:absolute;width:100%;height:100%;border-radius:var(--ptc-border-radius-standard);background:linear-gradient(0deg, black 0%, black 100%);opacity:0.7;transition:opacity var(--ptc-transition-slow) ease-in-out;border:none;outline:1px solid rgba(255, 255, 255, 0.1);outline-offset:-1px}.card.sc-event-jumbotron-example:hover ptc-img.sc-event-jumbotron-example::after{opacity:0.8}.card.sc-event-jumbotron-example:focus ptc-img.sc-event-jumbotron-example::after,.card.sc-event-jumbotron-example:active ptc-img.sc-event-jumbotron-example::after{opacity:0.85}.text-wrapper.sc-event-jumbotron-example{align-self:flex-start;text-align:left}.card-title.sc-event-jumbotron-example{color:var(--color-white);font-family:var(--ptc-font-latin);font-size:var(--ptc-font-size-x-large);font-weight:var(--ptc-font-weight-extrabold);line-height:var(--ptc-line-height-densest);position:relative;z-index:2;margin-top:0;margin-bottom:var(--ptc-element-spacing-06)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-weight:var(--ptc-font-weight-medium);display:inline-block}.cta-all.sc-event-jumbotron-example{margin-right:var(--ptc-element-spacing-05)}.panel.sc-event-jumbotron-example{display:none;visibility:hidden}@media only screen and (min-width: 768px){.card-title.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}}@media only screen and (min-width: 992px){.card-title.sc-event-jumbotron-example{font-size:var(--ptc-font-size-x-large)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-size:var(--ptc-font-size-x-large)}.cta-group.sc-event-jumbotron-example{margin-bottom:88px}.jumbotron-cards.sc-event-jumbotron-example{overflow-x:visible;justify-content:space-between;cursor:auto;transition:transform 0.3s ease-in-out;width:100%;padding-left:0px;padding-right:0px}.card.sc-event-jumbotron-example{width:auto;height:530px;padding:var(--ptc-element-spacing-06);cursor:pointer;flex:1}.card.hidden.sc-event-jumbotron-example{opacity:0;pointer-events:none}.card.active.sc-event-jumbotron-example{min-height:530px;border-top-right-radius:0px;border-bottom-right-radius:0px;box-shadow:var(--ptc-shadow-x-large);height:auto}.card.active.sc-event-jumbotron-example ptc-img.sc-event-jumbotron-example::after{border-top-right-radius:0px;border-bottom-right-radius:0px}.card.active.sc-event-jumbotron-example:hover ptc-img.sc-event-jumbotron-example::after{opacity:0.7}.card.active.sc-event-jumbotron-example:focus ptc-img.sc-event-jumbotron-example::after,.card.active.sc-event-jumbotron-example:active ptc-img.sc-event-jumbotron-example::after{opacity:0.7}.panel.sc-event-jumbotron-example{visibility:hidden;opacity:0;position:absolute;top:0;left:0;min-height:530px;padding:40px;background:var(--color-white);border-radius:var(--ptc-border-radius-standard);box-shadow:0 2px 8px rgba(0, 0, 0, 0.1);transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;z-index:10}.panel.visible.sc-event-jumbotron-example{visibility:visible;opacity:1;border-top-left-radius:0px;border-bottom-left-radius:0px;box-shadow:var(--ptc-shadow-x-large);height:auto}.close-panel.sc-event-jumbotron-example{position:absolute;top:0px;right:0px;background:var(--color-white);border:none;text-align:center;cursor:pointer;padding:0px;margin:5px}.hide-scrollbar.sc-event-jumbotron-example{margin-left:-40px;margin-right:-40px}}@media only screen and (min-width: 1200px){.card-title.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}.card-title.sc-event-jumbotron-example span.sc-event-jumbotron-example{font-size:var(--ptc-font-size-xx-large)}.jumbotron-cards.sc-event-jumbotron-example{padding:0;gap:32px}}@media only screen and (min-width: 1440px){.jumbotron-cards.sc-event-jumbotron-example{gap:40px}}";
|
|
9
|
+
|
|
10
|
+
const EventJumbotronExample = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.startX = 0;
|
|
14
|
+
this.scrollLeft = 0;
|
|
15
|
+
this.updateContainerClass = () => {
|
|
16
|
+
if (this.isDesktop) {
|
|
17
|
+
this.sliderWrapper.classList.add('ptc-container', 'u-paddingRight-flush', 'u-paddingLeft-flush');
|
|
18
|
+
this.disableDragging();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.sliderWrapper.classList.remove('ptc-container', 'u-paddingRight-flush', 'u-paddingLeft-flush');
|
|
22
|
+
this.enableDragging();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this.startDragging = (e) => {
|
|
26
|
+
this.isMouseDown = true;
|
|
27
|
+
this.isDragging = false;
|
|
28
|
+
this.startX = e.pageX;
|
|
29
|
+
this.scrollLeft = this.slider.scrollLeft;
|
|
30
|
+
};
|
|
31
|
+
this.performDragging = (e) => {
|
|
32
|
+
if (!this.isMouseDown)
|
|
33
|
+
return;
|
|
34
|
+
const x = e.pageX - this.slider.offsetLeft;
|
|
35
|
+
const walk = x - this.startX;
|
|
36
|
+
this.isDragging = Math.abs(walk) > 5;
|
|
37
|
+
this.slider.scrollLeft = this.scrollLeft - walk;
|
|
38
|
+
};
|
|
39
|
+
this.stopDragging = () => {
|
|
40
|
+
this.isMouseDown = false;
|
|
41
|
+
};
|
|
42
|
+
this.closeActiveModal = () => {
|
|
43
|
+
document.querySelectorAll('ptc-modal').forEach(modal => {
|
|
44
|
+
if (modal.show)
|
|
45
|
+
modal.show = false;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
this.cards = [];
|
|
49
|
+
this.modalBtnCloseText = 'Close';
|
|
50
|
+
this.activePanel = null;
|
|
51
|
+
this.activeCard = null;
|
|
52
|
+
this.isDragging = false;
|
|
53
|
+
this.isMouseDown = false;
|
|
54
|
+
this.isDesktop = window.innerWidth >= 992;
|
|
55
|
+
this.openedWithKeyboard = false;
|
|
56
|
+
}
|
|
57
|
+
onScreenStatusChange() {
|
|
58
|
+
!this.isDesktop && this.closeActiveModal();
|
|
59
|
+
}
|
|
60
|
+
handleCardClick(cardIndex) {
|
|
61
|
+
const card = this.slider.children[cardIndex];
|
|
62
|
+
const panelID = `panel-${cardIndex}`;
|
|
63
|
+
//const cardID = `card-${cardIndex}`
|
|
64
|
+
const panel = document.getElementById(panelID);
|
|
65
|
+
if (this.isDesktop && panel) {
|
|
66
|
+
this.showPanel(card, panel);
|
|
67
|
+
if (this.openedWithKeyboard) {
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
this.trap = focusTrap_esm.createFocusTrap(panel, {
|
|
70
|
+
escapeDeactivates: true,
|
|
71
|
+
clickOutsideDeactivates: true,
|
|
72
|
+
onActivate: () => {
|
|
73
|
+
if (!this.openedWithKeyboard) {
|
|
74
|
+
this.trap.pause(); // Prevent focus trapping when opened by mouse
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
onDeactivate: () => {
|
|
78
|
+
this.closePanel(panelID);
|
|
79
|
+
this.trap.deactivate();
|
|
80
|
+
},
|
|
81
|
+
tabbableOptions: {
|
|
82
|
+
getShadowRoot: true,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
this.trap.activate();
|
|
86
|
+
}, 500);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
if (this.trap) {
|
|
90
|
+
this.trap.deactivate();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (!this.isDesktop) {
|
|
95
|
+
if (!this.isDragging) {
|
|
96
|
+
const modal = document.getElementById(`modal-${cardIndex}`);
|
|
97
|
+
console.log('open: ' + modal.id);
|
|
98
|
+
modal.show = true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
showPanel(card, panel) {
|
|
103
|
+
if (this.activePanel)
|
|
104
|
+
return;
|
|
105
|
+
this.slider.style.transform = `translateX(-${card.offsetLeft}px)`;
|
|
106
|
+
Array.from(this.slider.children).forEach(c => {
|
|
107
|
+
if (c !== card)
|
|
108
|
+
c.classList.add('hidden');
|
|
109
|
+
});
|
|
110
|
+
panel.style.display = 'block';
|
|
111
|
+
panel.style.width = `calc(100% - ${card.getBoundingClientRect().width}px`;
|
|
112
|
+
card.style.height = `${panel.getBoundingClientRect().height}px`;
|
|
113
|
+
this.arrowButtons = document.querySelectorAll('ptc-scroll-button');
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
panel.style.transform = `translateX(${card.offsetWidth}px)`;
|
|
116
|
+
panel.classList.add('visible');
|
|
117
|
+
card.classList.add('active');
|
|
118
|
+
this.arrowButtons.forEach(button => button.initVisibility());
|
|
119
|
+
this.activePanel = panel.id;
|
|
120
|
+
this.activeCard = card.id;
|
|
121
|
+
}, 100);
|
|
122
|
+
}
|
|
123
|
+
closePanel(panelId) {
|
|
124
|
+
const panel = document.getElementById(panelId);
|
|
125
|
+
if (panel) {
|
|
126
|
+
panel.classList.remove('visible');
|
|
127
|
+
panel.addEventListener('transitionend', () => {
|
|
128
|
+
if (!panel.classList.contains('visible')) {
|
|
129
|
+
panel.style.display = 'none';
|
|
130
|
+
}
|
|
131
|
+
}, { once: true });
|
|
132
|
+
}
|
|
133
|
+
this.activePanel = null;
|
|
134
|
+
this.slider.style.transform = 'translateX(0)';
|
|
135
|
+
Array.from(this.slider.children).forEach(card => {
|
|
136
|
+
card.style.cssText = '';
|
|
137
|
+
});
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
Array.from(this.slider.children).forEach(card => {
|
|
140
|
+
card.classList.remove('hidden', 'active');
|
|
141
|
+
});
|
|
142
|
+
}, 300);
|
|
143
|
+
if (this.trap) {
|
|
144
|
+
this.trap.deactivate();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
enableDragging() {
|
|
148
|
+
this.slider.addEventListener('mousedown', this.startDragging);
|
|
149
|
+
this.slider.addEventListener('mousemove', this.performDragging);
|
|
150
|
+
['mouseup', 'mouseleave'].forEach(event => this.slider.addEventListener(event, this.stopDragging));
|
|
151
|
+
}
|
|
152
|
+
disableDragging() {
|
|
153
|
+
this.slider.removeEventListener('mousedown', this.startDragging);
|
|
154
|
+
this.slider.removeEventListener('mousemove', this.performDragging);
|
|
155
|
+
['mouseup', 'mouseleave'].forEach(event => this.slider.removeEventListener(event, this.stopDragging));
|
|
156
|
+
}
|
|
157
|
+
componentDidLoad() {
|
|
158
|
+
// const cardOverlays = document.querySelectorAll('overlay');
|
|
159
|
+
this.sliderWrapper = document.querySelector('.jumbotron-cards-wrapper');
|
|
160
|
+
this.slider = document.querySelector('.jumbotron-cards');
|
|
161
|
+
this.updateContainerClass();
|
|
162
|
+
window.addEventListener('resize', () => {
|
|
163
|
+
this.isDesktop = window.innerWidth >= 992;
|
|
164
|
+
this.updateContainerClass();
|
|
165
|
+
this.activePanel && this.activeCard && this.closePanel(this.activePanel);
|
|
166
|
+
});
|
|
167
|
+
document.addEventListener('keydown', event => {
|
|
168
|
+
if (event.key === 'Tab' || event.key === 'Enter' || event.key === ' ') {
|
|
169
|
+
this.openedWithKeyboard = true;
|
|
170
|
+
console.log('keyboard status: ' + this.openedWithKeyboard);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
document.addEventListener('mousedown', () => {
|
|
174
|
+
this.openedWithKeyboard = false;
|
|
175
|
+
});
|
|
176
|
+
// cardOverlays.forEach( (ele=> {(ele as HTMLPtcOverlayElement).setOverlayColorValue('linear-gradient(0deg, rgba(0, 0, 0, 0.70) 0%, rgba(0, 0, 0, 0.70) 100%)')}))
|
|
177
|
+
}
|
|
178
|
+
render() {
|
|
179
|
+
const modalContentSlots = Array.from(this.el.querySelectorAll('template'));
|
|
180
|
+
return [
|
|
181
|
+
index.h("div", { class: {
|
|
182
|
+
'event-jumbotron': true,
|
|
183
|
+
'ptc-container': this.isDesktop,
|
|
184
|
+
} }, index.h("div", { class: "jumbotron-cards-wrapper" }, index.h("div", { class: "jumbotron-cards" }, this.cards.map((card, index$1) => (index.h("div", { id: `card-${index$1}`, class: "card", onClick: () => this.handleCardClick(index$1), "data-panel": `panel-${index$1}`, onKeyPress: () => this.handleCardClick(index$1), tabindex: "0" }, index.h("ptc-img", { "border-radius": "radius-standard", "image-type": "smart-bg", "img-url": card.cardBg, "load-mode": "lazy-bg", styles: `ptc-img{position: absolute; width: 100%; height: 100%; z-index: 0} ${this.activePanel && 'ptc-img div{border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;'}` }), index.h("div", { class: "text-wrapper" }, index.h("h3", { class: "card-title" }, card.title, " ", index.h("span", null, card.description)), !this.activePanel && [index.h("div", { innerHTML: card.panelContent })]))))), this.cards.map((_, index$1) => (index.h("div", { id: `panel-${index$1}`, class: "panel" }, index.h("button", { tabindex: "-1", class: "close-panel", onClick: () => this.closePanel(`panel-${index$1}`), "aria-label": "Close panel" }, index.h("ptc-close-icon", null)), index.h("slot", { name: `panel-content-${index$1}` })))), !this.isDesktop &&
|
|
185
|
+
this.cards.map((_, index$1) => (index.h("ptc-modal", { id: `modal-${index$1}`, show: false, "close-on-blur": true, "modal-type": "event-listing", "custom-class": "event-mobile-modal", headerOnlyText1: this.cards[index$1].title, headerOnlyText2: this.cards[index$1].description, headerOnlyBg: this.cards[index$1].cardBg, bottomCloseBtn: this.modalBtnCloseText }, index.h("div", { innerHTML: modalContentSlots[index$1].innerHTML })))))),
|
|
186
|
+
index.h("div", { class: "white-placeholder" }),
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
get el() { return index.getElement(this); }
|
|
190
|
+
static get watchers() { return {
|
|
191
|
+
"isDesktop": ["onScreenStatusChange"]
|
|
192
|
+
}; }
|
|
193
|
+
};
|
|
194
|
+
EventJumbotronExample.style = eventJumbotronExampleCss;
|
|
195
|
+
|
|
196
|
+
exports.event_jumbotron_example = EventJumbotronExample;
|