@ptcwebops/ptcw-design 1.5.3 → 1.5.5
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/bundle-jumbotron-example.cjs.entry.js +50 -0
- package/dist/cjs/{bundle-jumbotron-example_14.cjs.entry.js → icon-asset_16.cjs.entry.js} +416 -405
- package/dist/cjs/interfaces-0ecd8027.js +15 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/max-width-container_3.cjs.entry.js +236 -0
- package/dist/cjs/ptc-jumbotron.cjs.entry.js +135 -0
- package/dist/cjs/ptc-pricing-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ptc-text-copy-with-background.cjs.entry.js +2 -1
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +7 -0
- package/dist/collection/components/list-item/list-item.css +15 -0
- package/dist/collection/components/list-item/list-item.js +2 -2
- package/dist/collection/components/ptc-back-to-top/ptc-back-to-top.css +30 -0
- package/dist/collection/components/ptc-back-to-top/ptc-back-to-top.js +61 -0
- package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +33 -12
- package/dist/collection/components/ptc-picture/ptc-picture.css +7 -1
- package/dist/collection/components/ptc-picture/ptc-picture.js +20 -0
- package/dist/collection/components/ptc-pricing-tabs/ptc-pricing-tabs.css +33 -12
- package/dist/collection/components/ptc-product-card/ptc-product-card.css +61 -0
- package/dist/collection/components/ptc-product-card/ptc-product-card.js +179 -0
- package/dist/collection/components/ptc-product-category/ptc-product-category.css +4 -0
- package/dist/collection/components/ptc-product-category/ptc-product-category.js +60 -0
- package/dist/collection/components/ptc-product-dropdown/ptc-product-dropdown.css +79 -0
- package/dist/collection/components/ptc-product-dropdown/ptc-product-dropdown.js +185 -0
- package/dist/collection/components/ptc-product-highlight-card/ptc-product-highlight-card.css +11 -0
- package/dist/collection/components/ptc-product-highlight-card/ptc-product-highlight-card.js +96 -0
- package/dist/collection/components/ptc-product-list/ptc-product-list.css +23 -0
- package/dist/collection/components/ptc-product-list/ptc-product-list.js +171 -0
- package/dist/collection/components/ptc-product-sidebar/ptc-product-sidebar.css +150 -0
- package/dist/collection/components/ptc-product-sidebar/ptc-product-sidebar.js +237 -0
- package/dist/collection/components/ptc-text-copy-with-background/ptc-text-copy-with-background.js +2 -1
- package/dist/collection/components/ptc-title/ptc-title.css +8 -0
- package/dist/collection/components/ptc-title/ptc-title.js +2 -2
- package/dist/collection/components/ptc-tooltip/ptc-tooltip.css +9 -0
- package/dist/collection/components/ptc-tooltip/ptc-tooltip.js +21 -1
- package/dist/custom-elements/index.d.ts +42 -0
- package/dist/custom-elements/index.js +456 -11
- package/dist/esm/bundle-jumbotron-example.entry.js +46 -0
- package/dist/esm/{bundle-jumbotron-example_14.entry.js → icon-asset_16.entry.js} +409 -400
- package/dist/esm/interfaces-c1c73092.js +12 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/max-width-container_3.entry.js +230 -0
- package/dist/esm/ptc-jumbotron.entry.js +131 -0
- package/dist/esm/ptc-pricing-tabs.entry.js +1 -1
- package/dist/esm/ptc-text-copy-with-background.entry.js +2 -1
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/ptcw-design/p-50e52c88.js +1 -0
- package/dist/ptcw-design/p-6927c111.entry.js +1 -0
- package/dist/ptcw-design/p-73ea7065.entry.js +1 -0
- package/dist/ptcw-design/p-9379f3b6.entry.js +1 -0
- package/dist/ptcw-design/p-a0ead888.entry.js +1 -0
- package/dist/ptcw-design/{p-face0c41.entry.js → p-e2c96087.entry.js} +1 -1
- package/dist/ptcw-design/p-f9129612.entry.js +1 -0
- package/dist/ptcw-design/ptcw-design.css +2 -2
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/list-item/list-item.d.ts +1 -1
- package/dist/types/components/ptc-back-to-top/ptc-back-to-top.d.ts +9 -0
- package/dist/types/components/ptc-picture/ptc-picture.d.ts +4 -0
- package/dist/types/components/ptc-product-card/ptc-product-card.d.ts +39 -0
- package/dist/types/components/ptc-product-category/ptc-product-category.d.ts +5 -0
- package/dist/types/components/ptc-product-dropdown/ptc-product-dropdown.d.ts +18 -0
- package/dist/types/components/ptc-product-highlight-card/ptc-product-highlight-card.d.ts +23 -0
- package/dist/types/components/ptc-product-list/ptc-product-list.d.ts +17 -0
- package/dist/types/components/ptc-product-sidebar/ptc-product-sidebar.d.ts +30 -0
- package/dist/types/components/ptc-title/ptc-title.d.ts +1 -1
- package/dist/types/components/ptc-tooltip/ptc-tooltip.d.ts +4 -0
- package/dist/types/components.d.ts +229 -4
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/ptcw-design/p-81bd0113.entry.js +0 -1
- package/dist/ptcw-design/p-df275994.entry.js +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class PtcProductDropdown {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.internalOptions = undefined;
|
|
5
|
+
this.newOptions = undefined;
|
|
6
|
+
this.selectedOptions = [];
|
|
7
|
+
this.placeholder = undefined;
|
|
8
|
+
this.isOpen = false;
|
|
9
|
+
}
|
|
10
|
+
parseOptions() {
|
|
11
|
+
let options = Array.from(this.hostElement.querySelectorAll('span'));
|
|
12
|
+
if (options) {
|
|
13
|
+
this.internalOptions = options.map((option) => {
|
|
14
|
+
return option.textContent;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
toggleDropdown() {
|
|
19
|
+
this.isOpen = !this.isOpen;
|
|
20
|
+
this.dropdownTouched.emit({
|
|
21
|
+
'sender': this,
|
|
22
|
+
'isOpen': this.isOpen
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
handleSearchResult(event) {
|
|
26
|
+
const { sender, searchTerm } = event.detail;
|
|
27
|
+
if (sender) {
|
|
28
|
+
if (searchTerm === "") {
|
|
29
|
+
this.selectedOptions = [];
|
|
30
|
+
this.isOpen = false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
handleinputChanged(event) {
|
|
35
|
+
const { sender } = event.detail;
|
|
36
|
+
if (sender) {
|
|
37
|
+
this.selectedOptions = [];
|
|
38
|
+
this.isOpen = false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handleCheckboxChange(option) {
|
|
42
|
+
const index = this.selectedOptions.indexOf(option);
|
|
43
|
+
if (index > -1) {
|
|
44
|
+
this.selectedOptions.splice(index, 1);
|
|
45
|
+
//console.log(this.selectedOptions);
|
|
46
|
+
this.selectedValues.emit({
|
|
47
|
+
'sender': this,
|
|
48
|
+
'selectedOptions': this.selectedOptions
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
this.selectedOptions.push(option);
|
|
53
|
+
//console.log(this.selectedOptions);
|
|
54
|
+
this.selectedValues.emit({
|
|
55
|
+
'sender': this,
|
|
56
|
+
'selectedOptions': this.selectedOptions
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
componentWillLoad() {
|
|
61
|
+
this.parseOptions();
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return (h(Host, null, h("div", { class: "dropdown" }, h("div", { class: "dropdown-toggle", onClick: () => this.toggleDropdown() }, h("span", { class: "dropdown-placeholder" }, this.placeholder), h("span", { class: "caret" })), this.isOpen && (h("div", { class: "dropdown-menu" }, this.internalOptions.map((option) => (h("label", { class: "checkbox-label" }, h("input", { type: "checkbox", checked: this.selectedOptions.includes(option), onChange: () => this.handleCheckboxChange(option) }), option)))))), h("div", { class: "hidden" }, h("slot", null))));
|
|
65
|
+
}
|
|
66
|
+
static get is() { return "ptc-product-dropdown"; }
|
|
67
|
+
static get encapsulation() { return "shadow"; }
|
|
68
|
+
static get originalStyleUrls() {
|
|
69
|
+
return {
|
|
70
|
+
"$": ["ptc-product-dropdown.scss"]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static get styleUrls() {
|
|
74
|
+
return {
|
|
75
|
+
"$": ["ptc-product-dropdown.css"]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
static get properties() {
|
|
79
|
+
return {
|
|
80
|
+
"newOptions": {
|
|
81
|
+
"type": "unknown",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "string[]",
|
|
85
|
+
"resolved": "string[]",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": ""
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"selectedOptions": {
|
|
96
|
+
"type": "unknown",
|
|
97
|
+
"mutable": false,
|
|
98
|
+
"complexType": {
|
|
99
|
+
"original": "string[]",
|
|
100
|
+
"resolved": "string[]",
|
|
101
|
+
"references": {}
|
|
102
|
+
},
|
|
103
|
+
"required": false,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": ""
|
|
108
|
+
},
|
|
109
|
+
"defaultValue": "[]"
|
|
110
|
+
},
|
|
111
|
+
"placeholder": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": false,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "string",
|
|
116
|
+
"resolved": "string",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": ""
|
|
124
|
+
},
|
|
125
|
+
"attribute": "placeholder",
|
|
126
|
+
"reflect": false
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
static get states() {
|
|
131
|
+
return {
|
|
132
|
+
"internalOptions": {},
|
|
133
|
+
"isOpen": {}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
static get events() {
|
|
137
|
+
return [{
|
|
138
|
+
"method": "selectedValues",
|
|
139
|
+
"name": "selectedValues",
|
|
140
|
+
"bubbles": true,
|
|
141
|
+
"cancelable": true,
|
|
142
|
+
"composed": true,
|
|
143
|
+
"docs": {
|
|
144
|
+
"tags": [],
|
|
145
|
+
"text": ""
|
|
146
|
+
},
|
|
147
|
+
"complexType": {
|
|
148
|
+
"original": "any",
|
|
149
|
+
"resolved": "any",
|
|
150
|
+
"references": {}
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
"method": "dropdownTouched",
|
|
154
|
+
"name": "dropdownTouched",
|
|
155
|
+
"bubbles": true,
|
|
156
|
+
"cancelable": true,
|
|
157
|
+
"composed": true,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": ""
|
|
161
|
+
},
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "any",
|
|
164
|
+
"resolved": "any",
|
|
165
|
+
"references": {}
|
|
166
|
+
}
|
|
167
|
+
}];
|
|
168
|
+
}
|
|
169
|
+
static get elementRef() { return "hostElement"; }
|
|
170
|
+
static get listeners() {
|
|
171
|
+
return [{
|
|
172
|
+
"name": "clearsearch",
|
|
173
|
+
"method": "handleSearchResult",
|
|
174
|
+
"target": "document",
|
|
175
|
+
"capture": false,
|
|
176
|
+
"passive": false
|
|
177
|
+
}, {
|
|
178
|
+
"name": "inputChanged",
|
|
179
|
+
"method": "handleinputChanged",
|
|
180
|
+
"target": "document",
|
|
181
|
+
"capture": false,
|
|
182
|
+
"passive": false
|
|
183
|
+
}];
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class PtcProductHighlightCard {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.cardTitle = undefined;
|
|
5
|
+
this.cardImage = undefined;
|
|
6
|
+
this.cardImageAltText = undefined;
|
|
7
|
+
this.cardDescription = undefined;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h(Host, null, h("ptc-title", { type: 'h4', upperline: "no-upperline", "title-margin": "margin-flush", "title-size": "small", "text-align": 'center' }, h("ptc-tooltip", { "text-display": "block", "text-lines": "2", "z-index": "z-999", description: this.cardTitle, position: "bottom", width: 'full-width' })), h("ptc-picture", { alt: "image-test", src: this.cardImage, "image-alignment": "center", width: "69", "display-image": "inline-block", styles: "img{margin: 12px auto 18px auto}" }), h("ptc-para", { "font-size": "x-small", "para-margin": "margin-flush", "para-line-h": "line-height-densest", "para-align": 'left', "para-z-index": "z-auto" }, h("ptc-tooltip", { "text-display": "block", "text-lines": "3", "z-index": "z-999", description: this.cardDescription, position: "bottom", width: 'full-width' }))));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "ptc-product-highlight-card"; }
|
|
13
|
+
static get encapsulation() { return "shadow"; }
|
|
14
|
+
static get originalStyleUrls() {
|
|
15
|
+
return {
|
|
16
|
+
"$": ["ptc-product-highlight-card.scss"]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static get styleUrls() {
|
|
20
|
+
return {
|
|
21
|
+
"$": ["ptc-product-highlight-card.css"]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static get properties() {
|
|
25
|
+
return {
|
|
26
|
+
"cardTitle": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"mutable": false,
|
|
29
|
+
"complexType": {
|
|
30
|
+
"original": "string",
|
|
31
|
+
"resolved": "string",
|
|
32
|
+
"references": {}
|
|
33
|
+
},
|
|
34
|
+
"required": false,
|
|
35
|
+
"optional": true,
|
|
36
|
+
"docs": {
|
|
37
|
+
"tags": [],
|
|
38
|
+
"text": "\ncardTitle"
|
|
39
|
+
},
|
|
40
|
+
"attribute": "card-title",
|
|
41
|
+
"reflect": false
|
|
42
|
+
},
|
|
43
|
+
"cardImage": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"mutable": false,
|
|
46
|
+
"complexType": {
|
|
47
|
+
"original": "string",
|
|
48
|
+
"resolved": "string",
|
|
49
|
+
"references": {}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": true,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": "\ncardImage"
|
|
56
|
+
},
|
|
57
|
+
"attribute": "card-image",
|
|
58
|
+
"reflect": false
|
|
59
|
+
},
|
|
60
|
+
"cardImageAltText": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"mutable": false,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "string",
|
|
65
|
+
"resolved": "string",
|
|
66
|
+
"references": {}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": true,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": "\ncardImageAltText"
|
|
73
|
+
},
|
|
74
|
+
"attribute": "card-image-alt-text",
|
|
75
|
+
"reflect": false
|
|
76
|
+
},
|
|
77
|
+
"cardDescription": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "string",
|
|
82
|
+
"resolved": "string",
|
|
83
|
+
"references": {}
|
|
84
|
+
},
|
|
85
|
+
"required": false,
|
|
86
|
+
"optional": true,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": "\ncardDescription"
|
|
90
|
+
},
|
|
91
|
+
"attribute": "card-description",
|
|
92
|
+
"reflect": false
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
padding-bottom: 52px;
|
|
4
|
+
}
|
|
5
|
+
@media only screen and (min-width: 992px) {
|
|
6
|
+
:host {
|
|
7
|
+
padding-bottom: 102px;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
:host .no-result-wrap {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
:host .no-result-wrap.show {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
:host .no-result-wrap .no-result {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
min-height: 160px;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
text-align: center;
|
|
23
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class PtcProductList {
|
|
3
|
+
handleSearchResult(event) {
|
|
4
|
+
const { sender, searchTerm } = event.detail;
|
|
5
|
+
if (sender) {
|
|
6
|
+
this.sortCards(searchTerm);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
handleMultipleSearchResult(event) {
|
|
10
|
+
const { sender, selectedOptions } = event.detail;
|
|
11
|
+
if (sender) {
|
|
12
|
+
this.sortMultipleCards(selectedOptions);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
handleEmptyResult(event) {
|
|
16
|
+
const { sender, searchTerm } = event.detail;
|
|
17
|
+
if (sender) {
|
|
18
|
+
this.noresultSection.classList.add('show');
|
|
19
|
+
this.sortCards(searchTerm);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
sortMultipleCards(searchItems) {
|
|
23
|
+
const categoryList = Array.from(this.hostElement.querySelectorAll('ptc-product-category'));
|
|
24
|
+
categoryList.forEach((category) => {
|
|
25
|
+
const categoryTitle = category.getAttribute('category-title');
|
|
26
|
+
const productList = Array.from(category.querySelectorAll('ptc-product-card'));
|
|
27
|
+
if (searchItems.length > 0) {
|
|
28
|
+
const shouldDisplayCategory = searchItems.some(searchItem => categoryTitle && categoryTitle.includes(searchItem));
|
|
29
|
+
category.style.display = shouldDisplayCategory ? 'block' : 'none';
|
|
30
|
+
if (shouldDisplayCategory) {
|
|
31
|
+
productList.forEach(product => {
|
|
32
|
+
product.style.display = 'block';
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
productList.forEach(product => {
|
|
37
|
+
const productTitle = product.getAttribute('card-title');
|
|
38
|
+
const shouldDisplayProduct = searchItems.some(searchItem => productTitle && productTitle.includes(searchItem));
|
|
39
|
+
product.style.display = shouldDisplayProduct ? 'block' : 'none';
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
category.style.display = 'block';
|
|
45
|
+
productList.forEach(product => {
|
|
46
|
+
product.style.display = 'block';
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// Sorting the
|
|
52
|
+
sortCards(searchItem) {
|
|
53
|
+
const categoryList = this.hostElement.querySelectorAll('ptc-product-category');
|
|
54
|
+
categoryList.forEach((category) => {
|
|
55
|
+
const categoryTitle = category.getAttribute('category-title');
|
|
56
|
+
const productList = category.querySelectorAll('ptc-product-card');
|
|
57
|
+
category.style.display = 'none';
|
|
58
|
+
if (searchItem === '') {
|
|
59
|
+
category.style.display = 'block';
|
|
60
|
+
productList.forEach(product => {
|
|
61
|
+
product.style.display = 'block';
|
|
62
|
+
});
|
|
63
|
+
this.noresultSection.classList.remove('show');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const searchItemLowerCase = searchItem; //
|
|
67
|
+
if (searchItemLowerCase === categoryTitle) {
|
|
68
|
+
category.style.display = 'block';
|
|
69
|
+
productList.forEach(product => {
|
|
70
|
+
product.style.display = 'block';
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
productList.forEach(product => {
|
|
75
|
+
const productTitle = product.getAttribute('card-title');
|
|
76
|
+
product.style.display = 'none';
|
|
77
|
+
if (searchItemLowerCase === productTitle) {
|
|
78
|
+
product.style.display = 'block';
|
|
79
|
+
category.style.display = 'block';
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
componentDidLoad() {
|
|
87
|
+
this.addIds();
|
|
88
|
+
this.noresultSection = this.hostElement.shadowRoot.querySelector('.no-result-wrap');
|
|
89
|
+
this.productList = this.hostElement.shadowRoot.querySelector('.product-list');
|
|
90
|
+
}
|
|
91
|
+
handleClick(event) {
|
|
92
|
+
this.clearCtaClicked.emit({
|
|
93
|
+
'sender': this,
|
|
94
|
+
'event': event,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Adding id to the category and product cards
|
|
98
|
+
addIds() {
|
|
99
|
+
const categoryList = this.hostElement.querySelectorAll('ptc-product-category');
|
|
100
|
+
categoryList.forEach((category) => {
|
|
101
|
+
const categoryTitle = category.getAttribute('category-title');
|
|
102
|
+
category.setAttribute('id', categoryTitle);
|
|
103
|
+
const productList = category.querySelectorAll('ptc-product-card');
|
|
104
|
+
productList.forEach(product => {
|
|
105
|
+
const productTitle = product.getAttribute('card-title');
|
|
106
|
+
product.setAttribute('id', productTitle);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
return (h(Host, null, h("div", { class: "product-list" }, h("slot", null)), h("div", { class: "no-result-wrap" }, h("div", { class: "no-result" }, h("div", null, h("ptc-title", { type: 'h3', "title-margin": "margin-flush", upperline: 'no-upperline', "title-size": "large" }, "No Results Found"), h("ptc-para", { "font-size": "x-small" }, "Try changing or removing some of your filters"), h("ptc-button", { type: "link", color: "ptc-quaternary", target: "_blank", onClick: (e) => { this.handleClick(e); } }, "Clear Filters"))))));
|
|
112
|
+
}
|
|
113
|
+
static get is() { return "ptc-product-list"; }
|
|
114
|
+
static get encapsulation() { return "shadow"; }
|
|
115
|
+
static get originalStyleUrls() {
|
|
116
|
+
return {
|
|
117
|
+
"$": ["ptc-product-list.scss"]
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
static get styleUrls() {
|
|
121
|
+
return {
|
|
122
|
+
"$": ["ptc-product-list.css"]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
static get events() {
|
|
126
|
+
return [{
|
|
127
|
+
"method": "clearCtaClicked",
|
|
128
|
+
"name": "clearCtaClicked",
|
|
129
|
+
"bubbles": true,
|
|
130
|
+
"cancelable": true,
|
|
131
|
+
"composed": true,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": ""
|
|
135
|
+
},
|
|
136
|
+
"complexType": {
|
|
137
|
+
"original": "any",
|
|
138
|
+
"resolved": "any",
|
|
139
|
+
"references": {}
|
|
140
|
+
}
|
|
141
|
+
}];
|
|
142
|
+
}
|
|
143
|
+
static get elementRef() { return "hostElement"; }
|
|
144
|
+
static get listeners() {
|
|
145
|
+
return [{
|
|
146
|
+
"name": "selectedResult",
|
|
147
|
+
"method": "handleSearchResult",
|
|
148
|
+
"target": "document",
|
|
149
|
+
"capture": false,
|
|
150
|
+
"passive": false
|
|
151
|
+
}, {
|
|
152
|
+
"name": "clearsearch",
|
|
153
|
+
"method": "handleSearchResult",
|
|
154
|
+
"target": "document",
|
|
155
|
+
"capture": false,
|
|
156
|
+
"passive": false
|
|
157
|
+
}, {
|
|
158
|
+
"name": "selectedValues",
|
|
159
|
+
"method": "handleMultipleSearchResult",
|
|
160
|
+
"target": "document",
|
|
161
|
+
"capture": false,
|
|
162
|
+
"passive": false
|
|
163
|
+
}, {
|
|
164
|
+
"name": "emptyResult",
|
|
165
|
+
"method": "handleEmptyResult",
|
|
166
|
+
"target": "document",
|
|
167
|
+
"capture": false,
|
|
168
|
+
"passive": false
|
|
169
|
+
}];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
:host .hide {
|
|
6
|
+
display: none !important;
|
|
7
|
+
}
|
|
8
|
+
:host .white-box {
|
|
9
|
+
padding: 12px;
|
|
10
|
+
background-color: var(--color-white);
|
|
11
|
+
border-radius: var(--ptc-border-radius-standard);
|
|
12
|
+
}
|
|
13
|
+
:host .sort-wrap {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
@media only screen and (min-width: 480px) {
|
|
17
|
+
:host .sort-wrap {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
@media only screen and (min-width: 992px) {
|
|
23
|
+
:host .sort-wrap {
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
:host .filter-result-wrap label {
|
|
28
|
+
font-size: var(--ptc-font-size-x-small);
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
}
|
|
31
|
+
:host .filter-result-wrap .result-header {
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
align-items: center;
|
|
35
|
+
margin-bottom: 12px;
|
|
36
|
+
}
|
|
37
|
+
@media only screen and (min-width: 992px) {
|
|
38
|
+
:host .filter-result-wrap .result-header {
|
|
39
|
+
margin-bottom: 26px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
:host .filter-result-wrap .result-header .clear-cta {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
display: none;
|
|
45
|
+
color: var(--color-gray-07);
|
|
46
|
+
font-size: var(--ptc-font-size-x-small);
|
|
47
|
+
text-decoration: underline;
|
|
48
|
+
}
|
|
49
|
+
:host .filter-result-wrap .result-header .clear-cta.show {
|
|
50
|
+
display: block;
|
|
51
|
+
}
|
|
52
|
+
:host .filter-result-wrap .typeahead-input {
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
margin-bottom: 14px;
|
|
55
|
+
width: 100%;
|
|
56
|
+
margin-right: 0;
|
|
57
|
+
}
|
|
58
|
+
@media only screen and (min-width: 480px) {
|
|
59
|
+
:host .filter-result-wrap .typeahead-input {
|
|
60
|
+
margin-right: 40px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
@media only screen and (min-width: 992px) {
|
|
64
|
+
:host .filter-result-wrap .typeahead-input {
|
|
65
|
+
margin-right: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
:host .filter-result-wrap .typeahead-input .input-wrap {
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
71
|
+
:host .filter-result-wrap .typeahead-input .input-wrap svg {
|
|
72
|
+
position: absolute;
|
|
73
|
+
left: 8px;
|
|
74
|
+
top: 8px;
|
|
75
|
+
}
|
|
76
|
+
:host .filter-result-wrap .typeahead-input .input-wrap input {
|
|
77
|
+
margin-top: 4px;
|
|
78
|
+
padding: 8px 8px 8px 34px;
|
|
79
|
+
display: block;
|
|
80
|
+
width: 100%;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
border: 1px solid var(--color-gray-03);
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
}
|
|
85
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap {
|
|
86
|
+
position: relative;
|
|
87
|
+
width: 100%;
|
|
88
|
+
}
|
|
89
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap .suggestions {
|
|
90
|
+
border: 1px solid var(--color-gray-03);
|
|
91
|
+
box-shadow: 0px 2px 4px rgba(35, 43, 45, 0.3);
|
|
92
|
+
background-color: var(--color-white);
|
|
93
|
+
position: absolute;
|
|
94
|
+
z-index: 105;
|
|
95
|
+
top: 0;
|
|
96
|
+
margin: 0;
|
|
97
|
+
width: 100%;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
padding: 0;
|
|
100
|
+
max-height: 400px;
|
|
101
|
+
overflow-y: auto;
|
|
102
|
+
}
|
|
103
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap .suggestions::-webkit-scrollbar {
|
|
104
|
+
width: 5px;
|
|
105
|
+
}
|
|
106
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap .suggestions::-webkit-scrollbar-track {
|
|
107
|
+
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
108
|
+
}
|
|
109
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap .suggestions::-webkit-scrollbar-thumb {
|
|
110
|
+
background-color: var(--color-gray-05);
|
|
111
|
+
outline: 1px solid var(--color-gray-05);
|
|
112
|
+
}
|
|
113
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap .suggestions li {
|
|
114
|
+
list-style: none;
|
|
115
|
+
padding: 10px 16px;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
display: block;
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
}
|
|
120
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap .suggestions li:first-child {
|
|
121
|
+
padding-top: 20px;
|
|
122
|
+
}
|
|
123
|
+
:host .filter-result-wrap .typeahead-input .suggestion-wrap .suggestions li:last-child {
|
|
124
|
+
padding-bottom: 20px;
|
|
125
|
+
}
|
|
126
|
+
:host .filter-result-wrap .dropdwon-filter {
|
|
127
|
+
margin-bottom: 10px;
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
:host .product-list-wrap {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
@media only screen and (min-width: 992px) {
|
|
134
|
+
:host .product-list-wrap {
|
|
135
|
+
display: block;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
:host .product-list-wrap .category-list {
|
|
139
|
+
display: block;
|
|
140
|
+
padding: 12px 4px;
|
|
141
|
+
font-size: var(--ptc-font-size-x-small);
|
|
142
|
+
}
|
|
143
|
+
:host .product-list-wrap .category-list ptc-para {
|
|
144
|
+
padding-bottom: 4px;
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
|
147
|
+
:host .product-list-wrap .category-list ul {
|
|
148
|
+
padding-left: 20px;
|
|
149
|
+
margin: 0;
|
|
150
|
+
}
|