@ptcwebops/ptcw-design 6.3.45-beta → 6.3.47-beta
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/global-92142fb4.js +28 -0
- package/dist/cjs/loader.cjs.js +1 -0
- package/dist/cjs/ptc-filter-dropdown_4.cjs.entry.js +20 -3
- package/dist/cjs/ptc-product-list.cjs.entry.js +4 -0
- package/dist/cjs/ptc-theater-video-modal.cjs.entry.js +21 -7
- package/dist/cjs/ptcw-design.cjs.js +1 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ptc-filter-dropdown/ptc-filter-dropdown.js +20 -3
- package/dist/collection/components/ptc-product-list/ptc-product-list.js +4 -0
- package/dist/collection/components/ptc-theater-video-modal/ptc-theater-video-modal.js +21 -7
- package/dist/collection/global/global.js +3 -0
- package/dist/collection/utils/fef-logger.js +23 -0
- package/dist/custom-elements/index.js +71 -10
- package/dist/esm/global-c58db4a9.js +26 -0
- package/dist/esm/loader.js +1 -0
- package/dist/esm/ptc-filter-dropdown_4.entry.js +20 -3
- package/dist/esm/ptc-product-list.entry.js +4 -0
- package/dist/esm/ptc-theater-video-modal.entry.js +21 -7
- package/dist/esm/ptcw-design.js +1 -0
- package/dist/ptcw-design/p-1feb2812.entry.js +1 -0
- package/dist/ptcw-design/p-310934a4.entry.js +1 -0
- package/dist/ptcw-design/p-a36f147a.js +1 -0
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/ptc-filter-dropdown/ptc-filter-dropdown.d.ts +1 -1
- package/dist/types/components/ptc-theater-video-modal/ptc-theater-video-modal.d.ts +2 -0
- package/dist/types/global/global.d.ts +4 -0
- package/dist/types/utils/fef-logger.d.ts +10 -0
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/ptcw-design/p-d9ee43ba.entry.js +0 -1
- package/dist/ptcw-design/p-fac750be.entry.js +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
class PTCLogger {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.prefix = '[PTC FEF LOG]';
|
|
4
|
+
}
|
|
5
|
+
format(level, message, ...args) {
|
|
6
|
+
const timestamp = new Date().toISOString();
|
|
7
|
+
return [`${this.prefix} [${level.toUpperCase()}] ${timestamp}:`, message, ...args];
|
|
8
|
+
}
|
|
9
|
+
log(message, ...args) {
|
|
10
|
+
console.log(...this.format('log', message, ...args));
|
|
11
|
+
}
|
|
12
|
+
info(message, ...args) {
|
|
13
|
+
console.info(...this.format('info', message, ...args));
|
|
14
|
+
}
|
|
15
|
+
warn(message, ...args) {
|
|
16
|
+
console.warn(...this.format('warn', message, ...args));
|
|
17
|
+
}
|
|
18
|
+
error(message, ...args) {
|
|
19
|
+
console.error(...this.format('error', message, ...args));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// Singleton
|
|
23
|
+
export const ptcLogger = new PTCLogger();
|
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import { HTMLElement as HTMLElement$1, h as h$1, Host, Fragment, createEvent, getAssetPath, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
3
|
|
|
4
|
+
class PTCLogger {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.prefix = '[PTC FEF LOG]';
|
|
7
|
+
}
|
|
8
|
+
format(level, message, ...args) {
|
|
9
|
+
const timestamp = new Date().toISOString();
|
|
10
|
+
return [`${this.prefix} [${level.toUpperCase()}] ${timestamp}:`, message, ...args];
|
|
11
|
+
}
|
|
12
|
+
log(message, ...args) {
|
|
13
|
+
console.log(...this.format('log', message, ...args));
|
|
14
|
+
}
|
|
15
|
+
info(message, ...args) {
|
|
16
|
+
console.info(...this.format('info', message, ...args));
|
|
17
|
+
}
|
|
18
|
+
warn(message, ...args) {
|
|
19
|
+
console.warn(...this.format('warn', message, ...args));
|
|
20
|
+
}
|
|
21
|
+
error(message, ...args) {
|
|
22
|
+
console.error(...this.format('error', message, ...args));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// Singleton
|
|
26
|
+
const ptcLogger = new PTCLogger();
|
|
27
|
+
|
|
28
|
+
// src/global/global.ts
|
|
29
|
+
globalThis.ptcLogger = ptcLogger;
|
|
30
|
+
|
|
4
31
|
const academicFormTestCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{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}}:host{display:block}.form-wrapper{width:433px;display:flex;border-radius:3px;background:#FFF;box-shadow:0px 2px 6px 0px rgba(0, 0, 0, 0.16);flex-direction:column;align-items:center;padding:24px 0px}.form-wrapper>form{max-width:277px}.form-wrapper>ptc-button{align-items:center}.form-wrapper .ptc-label{display:block;font-size:var(--ptc-font-size-x-small);font-weight:var(--ptc-font-weight-bold);line-height:normal;margin-bottom:var(--ptc-element-spacing-04);position:relative;z-index:1;color:var(--color-gray-13)}";
|
|
5
32
|
|
|
6
33
|
const AcademicForm = class extends HTMLElement$1 {
|
|
@@ -20401,8 +20428,16 @@ const PtcFilterDropdown$1 = class extends HTMLElement$1 {
|
|
|
20401
20428
|
}));
|
|
20402
20429
|
}
|
|
20403
20430
|
}
|
|
20404
|
-
toggleDropdown() {
|
|
20431
|
+
toggleDropdown(focusInput = false) {
|
|
20405
20432
|
this.isOpen = !this.isOpen;
|
|
20433
|
+
if (focusInput) {
|
|
20434
|
+
requestAnimationFrame(() => {
|
|
20435
|
+
var _a;
|
|
20436
|
+
const selected = this.hostElement.shadowRoot.querySelector('.filter-list input:checked');
|
|
20437
|
+
const firstInput = this.hostElement.shadowRoot.querySelector('.filter-list input');
|
|
20438
|
+
(_a = (selected || firstInput)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
20439
|
+
});
|
|
20440
|
+
}
|
|
20406
20441
|
}
|
|
20407
20442
|
clearFilter() {
|
|
20408
20443
|
this.selectedOptions = [];
|
|
@@ -20446,11 +20481,20 @@ const PtcFilterDropdown$1 = class extends HTMLElement$1 {
|
|
|
20446
20481
|
}
|
|
20447
20482
|
handleKeyDown(e) {
|
|
20448
20483
|
if (e.key === 'Enter') {
|
|
20449
|
-
this.toggleDropdown();
|
|
20484
|
+
this.toggleDropdown(true); // Focus after Enter
|
|
20485
|
+
}
|
|
20486
|
+
else if (e.key === 'Tab' && this.isOpen) {
|
|
20487
|
+
// Let browser do default tabbing, but also guide focus inside dropdown
|
|
20488
|
+
requestAnimationFrame(() => {
|
|
20489
|
+
var _a;
|
|
20490
|
+
const selected = this.hostElement.shadowRoot.querySelector('.filter-list input:checked');
|
|
20491
|
+
const firstInput = this.hostElement.shadowRoot.querySelector('.filter-list input');
|
|
20492
|
+
(_a = (selected || firstInput)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
20493
|
+
});
|
|
20450
20494
|
}
|
|
20451
20495
|
}
|
|
20452
20496
|
render() {
|
|
20453
|
-
return (h$1(Host, null, this.styles && h$1("style", null, this.styles), h$1("div", { class: "dropdown" }, h$1("div", { class: "dropdown-toggle mf-listen", onClick: () => this.toggleDropdown(), tabIndex: 0, onKeyDown: (e) => { this.handleKeyDown(e); } }, h$1("span", { class: "dropdown-placeholder" }, h$1("strong", null, "Filter: "), h$1("span", { class: "dropdown-filter-name" }, this.placeholder)), h$1("span", { class: "caret" }, h$1("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "7", viewBox: "0 0 12 7", fill: "none" }, h$1("path", { d: "M10.2426 1.24264L6 5.48528L1.75736 1.24264", stroke: "#20262A", "stroke-width": "2", "stroke-linecap": "round" })))), this.isOpen && (h$1("div", { class: "dropdown-menu" }, h$1("ul", { class: "filter-list" }, this.internalOptions.map((option) => (h$1("li", { key: option.tabId }, h$1("label", { class: "radio-label", htmlFor: option.value.replace(/\s+/g, '') }, h$1("input", { type: "radio", id: option.value.replace(/\s+/g, ''), name: "theater-filter", value: option.value, checked: this.selectedOptions.some((item) => item.value === option.value), "tab-id": option.tabId, "tag-name": option.tagName }), option.value))))), h$1("div", { class: "filter-btns" }, h$1("span", { class: "clear-btn mf-listen", onClick: () => this.clearFilter(), tabIndex: 0, onKeyDown: (e) => {
|
|
20497
|
+
return (h$1(Host, null, this.styles && h$1("style", null, this.styles), h$1("div", { class: "dropdown" }, h$1("div", { class: "dropdown-toggle mf-listen", onClick: () => this.toggleDropdown(true), tabIndex: 0, onKeyDown: (e) => { this.handleKeyDown(e); } }, h$1("span", { class: "dropdown-placeholder" }, h$1("strong", null, "Filter: "), h$1("span", { class: "dropdown-filter-name" }, this.placeholder)), h$1("span", { class: "caret" }, h$1("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "7", viewBox: "0 0 12 7", fill: "none" }, h$1("path", { d: "M10.2426 1.24264L6 5.48528L1.75736 1.24264", stroke: "#20262A", "stroke-width": "2", "stroke-linecap": "round" })))), this.isOpen && (h$1("div", { class: "dropdown-menu" }, h$1("ul", { class: "filter-list" }, this.internalOptions.map((option) => (h$1("li", { key: option.tabId }, h$1("label", { class: "radio-label", htmlFor: option.value.replace(/\s+/g, '') }, h$1("input", { type: "radio", id: option.value.replace(/\s+/g, ''), name: "theater-filter", value: option.value, checked: this.selectedOptions.some((item) => item.value === option.value), "tab-id": option.tabId, "tag-name": option.tagName }), option.value))))), h$1("div", { class: "filter-btns" }, h$1("span", { class: "clear-btn mf-listen", onClick: () => this.clearFilter(), tabIndex: 0, onKeyDown: (e) => {
|
|
20454
20498
|
if (e.key === 'Enter')
|
|
20455
20499
|
this.clearFilter();
|
|
20456
20500
|
} }, "Clear"), h$1("ptc-button", { "tracker-id": "filter-apply-cta", type: "link", color: "ptc-secondary", onClick: () => this.emitSelectedOptions('applyButton'), styles: ' a span { font-size: 16px !important; } a{ padding: 10px 16px !important; }' }, "Apply"))))), h$1("div", { class: "hidden" }, h$1("slot", null))));
|
|
@@ -26829,6 +26873,10 @@ const PtcProductList$1 = class extends HTMLElement$1 {
|
|
|
26829
26873
|
});
|
|
26830
26874
|
}
|
|
26831
26875
|
componentDidLoad() {
|
|
26876
|
+
// ptcLogger.log('Component loaded!');
|
|
26877
|
+
// ptcLogger.info('Component loaded!');
|
|
26878
|
+
// ptcLogger.warn('Component loaded!');
|
|
26879
|
+
// ptcLogger.error('Component loaded!');
|
|
26832
26880
|
this.addIds();
|
|
26833
26881
|
this.noresultSection = this.hostElement.shadowRoot.querySelector('.no-result-wrap');
|
|
26834
26882
|
this.productList = this.hostElement.shadowRoot.querySelector('.product-list');
|
|
@@ -33540,11 +33588,6 @@ const PtcTheaterVideoModal$1 = class extends HTMLElement$1 {
|
|
|
33540
33588
|
this.modalType = undefined;
|
|
33541
33589
|
this.focusCardElement = undefined;
|
|
33542
33590
|
}
|
|
33543
|
-
// @Listen('filterCliked', { target: 'document' })
|
|
33544
|
-
// handleFilterClick(event: CustomEvent) {
|
|
33545
|
-
// const filters = event.detail;
|
|
33546
|
-
// this.filteredTagName = filters['selected-tag'].trim();
|
|
33547
|
-
// }
|
|
33548
33591
|
async updateData(data, currentModalIndex, cardElement) {
|
|
33549
33592
|
// debugger
|
|
33550
33593
|
this.cards = data;
|
|
@@ -33556,6 +33599,24 @@ const PtcTheaterVideoModal$1 = class extends HTMLElement$1 {
|
|
|
33556
33599
|
const closebtn = this.hostEl.querySelector('.vm-close');
|
|
33557
33600
|
closebtn === null || closebtn === void 0 ? void 0 : closebtn.focus();
|
|
33558
33601
|
}, 200);
|
|
33602
|
+
setTimeout(() => {
|
|
33603
|
+
this.trap = createFocusTrap(this.modalPopUpRef, {
|
|
33604
|
+
escapeDeactivates: true,
|
|
33605
|
+
clickOutsideDeactivates: true,
|
|
33606
|
+
returnFocusOnDeactivate: true,
|
|
33607
|
+
onActivate: () => {
|
|
33608
|
+
this.trap.pause();
|
|
33609
|
+
},
|
|
33610
|
+
onDeactivate: () => {
|
|
33611
|
+
this.closeCardModal();
|
|
33612
|
+
this.trap.deactivate();
|
|
33613
|
+
},
|
|
33614
|
+
tabbableOptions: {
|
|
33615
|
+
getShadowRoot: true,
|
|
33616
|
+
},
|
|
33617
|
+
});
|
|
33618
|
+
this.trap.activate();
|
|
33619
|
+
}, 200);
|
|
33559
33620
|
}
|
|
33560
33621
|
closeCardModal() {
|
|
33561
33622
|
this.showModal = false;
|
|
@@ -33604,10 +33665,10 @@ const PtcTheaterVideoModal$1 = class extends HTMLElement$1 {
|
|
|
33604
33665
|
}
|
|
33605
33666
|
render() {
|
|
33606
33667
|
return (h$1(Host, null, h$1("slot", null), this.showModal &&
|
|
33607
|
-
(this.modalType != 'only-video' ? (h$1("div", { class: "modal" }, h$1("div", { class: "modal-container ptc-container" }, h$1("div", { class: "vm-close-container" }, h$1("div", { onClick: () => this.closeCardModal(), class: 'vm-close mf-listen', tabIndex: 0, onKeyDown: (e) => {
|
|
33668
|
+
(this.modalType != 'only-video' ? (h$1("div", { class: "modal", ref: el => (this.modalPopUpRef = el) }, h$1("div", { class: "modal-container ptc-container" }, h$1("div", { class: "vm-close-container" }, h$1("div", { onClick: () => this.closeCardModal(), class: 'vm-close mf-listen', tabIndex: 0, onKeyDown: (e) => {
|
|
33608
33669
|
if (e.key === 'Enter')
|
|
33609
33670
|
this.closeCardModal();
|
|
33610
|
-
} }, h$1("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, h$1("g", { "clip-path": "url(#clip0_214_927)" }, h$1("path", { d: "M18 2.8125L15.1875 0L9 6.1875L2.8125 0L0 2.8125L6.1875 9L0 15.1875L2.8125 18L9 11.8125L15.1875 18L18 15.1875L11.8125 9L18 2.8125Z", fill: "white" })), h$1("defs", null, h$1("clipPath", { id: "clip0_214_927" }, h$1("rect", { width: "18", height: "18", fill: "white" })))))), h$1("div", { class: "is-grid has-col-gap-xl has-row-gap-lg" }, h$1("div", { class: 'is-col is-col-7-lg' }, h$1("div", { class: "v-modal-left" }, h$1("div", { class: 'v-nav' }, h$1("button", { onClick: () => this.showPrevCard(), disabled: this.currentCardIndex === 0 }, "Previous Video"), h$1("div", { class: 'v-number' }, ' ', this.currentCardIndex + 1, " of ", this.cards.length), h$1("button", { onClick: () => this.showNextCard(), disabled: this.currentCardIndex === this.cards.length - 1 }, "Next Video")), h$1("div", { class: 'aspect-ratio-container ' }, h$1("div", { class: 'video-container' }, h$1("video-js", { id: "bcPlayer", "data-account": "1532789042001", "data-player": "HknUe20R", "data-embed": "default", "data-video-id": this.cards[this.currentCardIndex].videoId, controls: "", "data-application-id": "", class: `dpm-vj-${this.currentCardIndex} video-js vjs-fills` }))), h$1("div", { class: "card-description-content" }, h$1("ptc-title", { type: "h3", "title-size": "large", "title-color": "white", upperline: "no-upperline", "title-height": "densest", "title-margin": "margin-flush", "title-weight": "w-7", styles: ".is-standard{margin-top:14px !important}" }, this.cards[this.currentCardIndex].title), h$1("ptc-para", { "font-size": "medium", "font-weight": "w-4", "para-color": "white", "para-margin": "margin-3", "para-line-h": "line-height-p", innerHTML: this.cards[this.currentCardIndex].cardDescription })))), h$1("div", { class: 'is-col is-col-5-lg' }, h$1("div", { class: "video-modal-description" }, h$1("div", { innerHTML: this.cards[this.currentCardIndex].descriptionModal }))))))) : (h$1("div", { class: "modal modal-only-video" }, h$1("div", { class: "modal-wrapper" }, h$1("div", { onClick: () => this.closeCardModal(), class: 'vm-close mf-listen', tabIndex: 0, onKeyDown: (e) => {
|
|
33671
|
+
} }, h$1("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, h$1("g", { "clip-path": "url(#clip0_214_927)" }, h$1("path", { d: "M18 2.8125L15.1875 0L9 6.1875L2.8125 0L0 2.8125L6.1875 9L0 15.1875L2.8125 18L9 11.8125L15.1875 18L18 15.1875L11.8125 9L18 2.8125Z", fill: "white" })), h$1("defs", null, h$1("clipPath", { id: "clip0_214_927" }, h$1("rect", { width: "18", height: "18", fill: "white" })))))), h$1("div", { class: "is-grid has-col-gap-xl has-row-gap-lg" }, h$1("div", { class: 'is-col is-col-7-lg' }, h$1("div", { class: "v-modal-left" }, h$1("div", { class: 'v-nav' }, h$1("button", { onClick: () => this.showPrevCard(), disabled: this.currentCardIndex === 0 }, "Previous Video"), h$1("div", { class: 'v-number' }, ' ', this.currentCardIndex + 1, " of ", this.cards.length), h$1("button", { onClick: () => this.showNextCard(), disabled: this.currentCardIndex === this.cards.length - 1 }, "Next Video")), h$1("div", { class: 'aspect-ratio-container ' }, h$1("div", { class: 'video-container' }, h$1("video-js", { id: "bcPlayer", "data-account": "1532789042001", "data-player": "HknUe20R", "data-embed": "default", "data-video-id": this.cards[this.currentCardIndex].videoId, controls: "", "data-application-id": "", class: `dpm-vj-${this.currentCardIndex} video-js vjs-fills` }))), h$1("div", { class: "card-description-content" }, h$1("ptc-title", { type: "h3", "title-size": "large", "title-color": "white", upperline: "no-upperline", "title-height": "densest", "title-margin": "margin-flush", "title-weight": "w-7", styles: ".is-standard{margin-top:14px !important}" }, this.cards[this.currentCardIndex].title), h$1("ptc-para", { "font-size": "medium", "font-weight": "w-4", "para-color": "white", "para-margin": "margin-3", "para-line-h": "line-height-p", innerHTML: this.cards[this.currentCardIndex].cardDescription })))), h$1("div", { class: 'is-col is-col-5-lg' }, h$1("div", { class: "video-modal-description" }, h$1("div", { innerHTML: this.cards[this.currentCardIndex].descriptionModal }))))))) : (h$1("div", { class: "modal modal-only-video", ref: el => (this.modalPopUpRef = el) }, h$1("div", { class: "modal-wrapper" }, h$1("div", { onClick: () => this.closeCardModal(), class: 'vm-close mf-listen', tabIndex: 0, onKeyDown: (e) => {
|
|
33611
33672
|
if (e.key === 'Enter')
|
|
33612
33673
|
this.closeCardModal();
|
|
33613
33674
|
} }, h$1("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, h$1("g", { "clip-path": "url(#clip0_214_927)" }, h$1("path", { d: "M18 2.8125L15.1875 0L9 6.1875L2.8125 0L0 2.8125L6.1875 9L0 15.1875L2.8125 18L9 11.8125L15.1875 18L18 15.1875L11.8125 9L18 2.8125Z", fill: "white" })), h$1("defs", null, h$1("clipPath", { id: "clip0_214_927" }, h$1("rect", { width: "18", height: "18", fill: "white" }))))), h$1("div", { class: 'aspect-ratio-container ' }, h$1("div", { class: 'video-container' }, h$1("video-js", { id: "bcPlayer", "data-account": "1532789042001", "data-player": "HknUe20R", "data-embed": "default", "data-video-id": this.cards[this.currentCardIndex].videoId, controls: "", "data-application-id": "", class: `dpm-vj-${this.currentCardIndex} video-js vjs-fills` })))))))));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
class PTCLogger {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.prefix = '[PTC FEF LOG]';
|
|
4
|
+
}
|
|
5
|
+
format(level, message, ...args) {
|
|
6
|
+
const timestamp = new Date().toISOString();
|
|
7
|
+
return [`${this.prefix} [${level.toUpperCase()}] ${timestamp}:`, message, ...args];
|
|
8
|
+
}
|
|
9
|
+
log(message, ...args) {
|
|
10
|
+
console.log(...this.format('log', message, ...args));
|
|
11
|
+
}
|
|
12
|
+
info(message, ...args) {
|
|
13
|
+
console.info(...this.format('info', message, ...args));
|
|
14
|
+
}
|
|
15
|
+
warn(message, ...args) {
|
|
16
|
+
console.warn(...this.format('warn', message, ...args));
|
|
17
|
+
}
|
|
18
|
+
error(message, ...args) {
|
|
19
|
+
console.error(...this.format('error', message, ...args));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// Singleton
|
|
23
|
+
const ptcLogger = new PTCLogger();
|
|
24
|
+
|
|
25
|
+
// src/global/global.ts
|
|
26
|
+
globalThis.ptcLogger = ptcLogger;
|
package/dist/esm/loader.js
CHANGED
|
@@ -36,8 +36,16 @@ const PtcFilterDropdown = class {
|
|
|
36
36
|
}));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
toggleDropdown() {
|
|
39
|
+
toggleDropdown(focusInput = false) {
|
|
40
40
|
this.isOpen = !this.isOpen;
|
|
41
|
+
if (focusInput) {
|
|
42
|
+
requestAnimationFrame(() => {
|
|
43
|
+
var _a;
|
|
44
|
+
const selected = this.hostElement.shadowRoot.querySelector('.filter-list input:checked');
|
|
45
|
+
const firstInput = this.hostElement.shadowRoot.querySelector('.filter-list input');
|
|
46
|
+
(_a = (selected || firstInput)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
41
49
|
}
|
|
42
50
|
clearFilter() {
|
|
43
51
|
this.selectedOptions = [];
|
|
@@ -81,11 +89,20 @@ const PtcFilterDropdown = class {
|
|
|
81
89
|
}
|
|
82
90
|
handleKeyDown(e) {
|
|
83
91
|
if (e.key === 'Enter') {
|
|
84
|
-
this.toggleDropdown();
|
|
92
|
+
this.toggleDropdown(true); // Focus after Enter
|
|
93
|
+
}
|
|
94
|
+
else if (e.key === 'Tab' && this.isOpen) {
|
|
95
|
+
// Let browser do default tabbing, but also guide focus inside dropdown
|
|
96
|
+
requestAnimationFrame(() => {
|
|
97
|
+
var _a;
|
|
98
|
+
const selected = this.hostElement.shadowRoot.querySelector('.filter-list input:checked');
|
|
99
|
+
const firstInput = this.hostElement.shadowRoot.querySelector('.filter-list input');
|
|
100
|
+
(_a = (selected || firstInput)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
101
|
+
});
|
|
85
102
|
}
|
|
86
103
|
}
|
|
87
104
|
render() {
|
|
88
|
-
return (h(Host, null, this.styles && h("style", null, this.styles), h("div", { class: "dropdown" }, h("div", { class: "dropdown-toggle mf-listen", onClick: () => this.toggleDropdown(), tabIndex: 0, onKeyDown: (e) => { this.handleKeyDown(e); } }, h("span", { class: "dropdown-placeholder" }, h("strong", null, "Filter: "), h("span", { class: "dropdown-filter-name" }, this.placeholder)), h("span", { class: "caret" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "7", viewBox: "0 0 12 7", fill: "none" }, h("path", { d: "M10.2426 1.24264L6 5.48528L1.75736 1.24264", stroke: "#20262A", "stroke-width": "2", "stroke-linecap": "round" })))), this.isOpen && (h("div", { class: "dropdown-menu" }, h("ul", { class: "filter-list" }, this.internalOptions.map((option) => (h("li", { key: option.tabId }, h("label", { class: "radio-label", htmlFor: option.value.replace(/\s+/g, '') }, h("input", { type: "radio", id: option.value.replace(/\s+/g, ''), name: "theater-filter", value: option.value, checked: this.selectedOptions.some((item) => item.value === option.value), "tab-id": option.tabId, "tag-name": option.tagName }), option.value))))), h("div", { class: "filter-btns" }, h("span", { class: "clear-btn mf-listen", onClick: () => this.clearFilter(), tabIndex: 0, onKeyDown: (e) => {
|
|
105
|
+
return (h(Host, null, this.styles && h("style", null, this.styles), h("div", { class: "dropdown" }, h("div", { class: "dropdown-toggle mf-listen", onClick: () => this.toggleDropdown(true), tabIndex: 0, onKeyDown: (e) => { this.handleKeyDown(e); } }, h("span", { class: "dropdown-placeholder" }, h("strong", null, "Filter: "), h("span", { class: "dropdown-filter-name" }, this.placeholder)), h("span", { class: "caret" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "7", viewBox: "0 0 12 7", fill: "none" }, h("path", { d: "M10.2426 1.24264L6 5.48528L1.75736 1.24264", stroke: "#20262A", "stroke-width": "2", "stroke-linecap": "round" })))), this.isOpen && (h("div", { class: "dropdown-menu" }, h("ul", { class: "filter-list" }, this.internalOptions.map((option) => (h("li", { key: option.tabId }, h("label", { class: "radio-label", htmlFor: option.value.replace(/\s+/g, '') }, h("input", { type: "radio", id: option.value.replace(/\s+/g, ''), name: "theater-filter", value: option.value, checked: this.selectedOptions.some((item) => item.value === option.value), "tab-id": option.tabId, "tag-name": option.tagName }), option.value))))), h("div", { class: "filter-btns" }, h("span", { class: "clear-btn mf-listen", onClick: () => this.clearFilter(), tabIndex: 0, onKeyDown: (e) => {
|
|
89
106
|
if (e.key === 'Enter')
|
|
90
107
|
this.clearFilter();
|
|
91
108
|
} }, "Clear"), h("ptc-button", { "tracker-id": "filter-apply-cta", type: "link", color: "ptc-secondary", onClick: () => this.emitSelectedOptions('applyButton'), styles: ' a span { font-size: 16px !important; } a{ padding: 10px 16px !important; }' }, "Apply"))))), h("div", { class: "hidden" }, h("slot", null))));
|
|
@@ -94,6 +94,10 @@ const PtcProductList = class {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
componentDidLoad() {
|
|
97
|
+
// ptcLogger.log('Component loaded!');
|
|
98
|
+
// ptcLogger.info('Component loaded!');
|
|
99
|
+
// ptcLogger.warn('Component loaded!');
|
|
100
|
+
// ptcLogger.error('Component loaded!');
|
|
97
101
|
this.addIds();
|
|
98
102
|
this.noresultSection = this.hostElement.shadowRoot.querySelector('.no-result-wrap');
|
|
99
103
|
this.productList = this.hostElement.shadowRoot.querySelector('.product-list');
|