@ptcwebops/ptcw-design 4.1.3 → 4.1.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/loader.cjs.js +1 -1
- package/dist/cjs/most-popular-news.cjs.entry.js +1 -1
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/ptc-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/ptc-button_4.cjs.entry.js +313 -0
- package/dist/cjs/ptc-collapse-list.cjs.entry.js +1 -1
- package/dist/cjs/ptc-footer.cjs.entry.js +1 -1
- package/dist/cjs/ptc-form-checkbox_2.cjs.entry.js +5 -5
- package/dist/cjs/ptc-form.cjs.entry.js +1 -1
- package/dist/cjs/ptc-link.cjs.entry.js +1 -1
- package/dist/cjs/ptc-media-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-multi-select_2.cjs.entry.js +46 -15
- package/dist/cjs/ptc-para.cjs.entry.js +1 -1
- package/dist/cjs/ptc-pricing-packaging-table.cjs.entry.js +36 -1
- package/dist/cjs/ptc-pricing-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ptc-subnav.cjs.entry.js +4 -2
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/cjs/{utils-f88137bf.js → utils-eaf0f7f0.js} +29 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/organism-bundles/form/ptc-form/ptc-form.js +1 -1
- package/dist/collection/components/ptc-footer/ptc-footer-v2.css +36 -7
- package/dist/collection/components/ptc-form-checkbox/ptc-form-checkbox.css +7 -6
- package/dist/collection/components/ptc-homepage-image-feature/ptc-homepage-image-feature.css +133 -0
- package/dist/collection/components/ptc-homepage-image-feature/ptc-homepage-image-feature.js +21 -0
- package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +11 -0
- package/dist/collection/components/ptc-multi-select/ptc-multi-select.css +57 -24
- package/dist/collection/components/ptc-multi-select/ptc-multi-select.js +76 -13
- package/dist/collection/components/ptc-pricing-packaging-table/ptc-pricing-packaging-table.js +38 -1
- package/dist/collection/components/ptc-pricing-tabs/ptc-pricing-tabs.css +11 -0
- package/dist/collection/components/ptc-select/ptc-select.css +41 -2
- package/dist/collection/components/ptc-textfield/ptc-textfield.css +17 -1
- package/dist/collection/components/ptc-textfield/ptc-textfield.js +2 -2
- package/dist/collection/components/subnav/ptc-subnav/ptc-subnav.js +4 -2
- package/dist/collection/utils/utils.js +28 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +141 -28
- 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-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ptc-button_4.entry.js +306 -0
- package/dist/esm/ptc-collapse-list.entry.js +1 -1
- package/dist/esm/ptc-footer.entry.js +1 -1
- package/dist/esm/ptc-form-checkbox_2.entry.js +5 -5
- package/dist/esm/ptc-form.entry.js +1 -1
- package/dist/esm/ptc-link.entry.js +1 -1
- package/dist/esm/ptc-media-card.entry.js +1 -1
- package/dist/esm/ptc-multi-select_2.entry.js +47 -16
- package/dist/esm/ptc-para.entry.js +1 -1
- package/dist/esm/ptc-pricing-packaging-table.entry.js +36 -1
- package/dist/esm/ptc-pricing-tabs.entry.js +2 -2
- package/dist/esm/ptc-subnav.entry.js +4 -2
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/esm/{utils-5a73ed80.js → utils-2595f251.js} +29 -1
- package/dist/ptcw-design/p-04391144.entry.js +1 -0
- package/dist/ptcw-design/{p-e8e9a067.entry.js → p-199d7082.entry.js} +1 -1
- package/dist/ptcw-design/p-26991250.entry.js +1 -0
- package/dist/ptcw-design/p-418553b4.entry.js +1 -0
- package/dist/ptcw-design/{p-40057c0b.js → p-515f6adb.js} +1 -1
- package/dist/ptcw-design/p-549cb5e7.entry.js +1 -0
- package/dist/ptcw-design/{p-ce543bd6.entry.js → p-64dff4b8.entry.js} +4 -4
- package/dist/ptcw-design/p-6c070dec.entry.js +1 -0
- package/dist/ptcw-design/{p-084a07b9.entry.js → p-6e85eb2b.entry.js} +1 -1
- package/dist/ptcw-design/{p-3884e48e.entry.js → p-7463154b.entry.js} +1 -1
- package/dist/ptcw-design/{p-01de9a0b.entry.js → p-7cecbb4f.entry.js} +1 -1
- package/dist/ptcw-design/{p-f4143deb.entry.js → p-c06c4c56.entry.js} +1 -1
- package/dist/ptcw-design/{p-8edcb1a3.entry.js → p-c97330ed.entry.js} +1 -1
- package/dist/ptcw-design/{p-66a26780.entry.js → p-ccd23066.entry.js} +1 -1
- package/dist/ptcw-design/{p-a6767ab8.entry.js → p-e3993fba.entry.js} +1 -1
- package/dist/ptcw-design/p-f4d5cee4.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-homepage-image-feature/ptc-homepage-image-feature.d.ts +5 -0
- package/dist/types/components/ptc-multi-select/ptc-multi-select.d.ts +11 -0
- package/dist/types/components/ptc-pricing-packaging-table/ptc-pricing-packaging-table.d.ts +4 -0
- package/dist/types/components.d.ts +15 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/cjs/ptc-button.cjs.entry.js +0 -79
- package/dist/cjs/ptc-img.cjs.entry.js +0 -133
- package/dist/cjs/ptc-title.cjs.entry.js +0 -99
- package/dist/esm/ptc-button.entry.js +0 -75
- package/dist/esm/ptc-img.entry.js +0 -129
- package/dist/esm/ptc-title.entry.js +0 -95
- package/dist/ptcw-design/p-0529c70d.entry.js +0 -1
- package/dist/ptcw-design/p-1b98e9ca.entry.js +0 -1
- package/dist/ptcw-design/p-52d6e19b.entry.js +0 -1
- package/dist/ptcw-design/p-8dcdb48d.entry.js +0 -1
- package/dist/ptcw-design/p-95523b72.entry.js +0 -1
- package/dist/ptcw-design/p-9c0d26df.entry.js +0 -1
- package/dist/ptcw-design/p-a120b60a.entry.js +0 -1
- package/dist/ptcw-design/p-dfff555d.entry.js +0 -1
|
@@ -52,11 +52,44 @@ ptc-link, ptc-square-card {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
.ptc-multi-select {
|
|
56
|
+
position: relative;
|
|
56
57
|
display: block;
|
|
58
|
+
margin-bottom: var(--ptc-element-spacing-04);
|
|
57
59
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
.ptc-multi-select.invalid::before {
|
|
61
|
+
content: "";
|
|
62
|
+
position: absolute;
|
|
63
|
+
width: calc(100% + 16px);
|
|
64
|
+
height: calc(100% + 8px);
|
|
65
|
+
background: #FEF3F3;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
z-index: 0;
|
|
70
|
+
left: 50%;
|
|
71
|
+
top: 50%;
|
|
72
|
+
transform: translate(-50%, -50%);
|
|
73
|
+
}
|
|
74
|
+
.ptc-multi-select.invalid .mdc-select-helper-text--validation-msg {
|
|
75
|
+
z-index: 2;
|
|
76
|
+
opacity: 1;
|
|
77
|
+
position: relative;
|
|
78
|
+
color: #AF3231;
|
|
79
|
+
font-family: var(--ptc-font-latin);
|
|
80
|
+
font-size: var(--ptc-font-size-xx-small);
|
|
81
|
+
font-style: normal;
|
|
82
|
+
font-weight: var(--ptc-font-weight-semibold);
|
|
83
|
+
line-height: var(--ptc-line-height-densest);
|
|
84
|
+
opacity: 1;
|
|
85
|
+
height: auto;
|
|
86
|
+
margin-left: 8px;
|
|
87
|
+
margin-top: var(--ptc-element-spacing-02);
|
|
88
|
+
}
|
|
89
|
+
.ptc-multi-select.invalid .mdc-select-helper-text--validation-msg svg {
|
|
90
|
+
transform: translate(-8px, 3px);
|
|
91
|
+
}
|
|
92
|
+
.ptc-multi-select .multi-select-label {
|
|
60
93
|
display: block;
|
|
61
94
|
font-size: var(--ptc-font-size-xx-small);
|
|
62
95
|
font-weight: var(--ptc-font-weight-semibold);
|
|
@@ -66,8 +99,7 @@ ptc-link, ptc-square-card {
|
|
|
66
99
|
position: relative;
|
|
67
100
|
color: #40434A;
|
|
68
101
|
}
|
|
69
|
-
|
|
70
|
-
.selected-items {
|
|
102
|
+
.ptc-multi-select .selected-items {
|
|
71
103
|
cursor: pointer;
|
|
72
104
|
background-color: #fff;
|
|
73
105
|
border: 1px solid rgba(0, 0, 0, 0.38);
|
|
@@ -75,20 +107,17 @@ ptc-link, ptc-square-card {
|
|
|
75
107
|
border-radius: 0px;
|
|
76
108
|
position: relative;
|
|
77
109
|
user-select: none;
|
|
78
|
-
margin-bottom: var(--ptc-element-spacing-03);
|
|
79
110
|
color: rgba(0, 0, 0, 0.87);
|
|
80
111
|
font-weight: 400;
|
|
81
112
|
font-size: 16px;
|
|
82
113
|
font-family: var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));
|
|
83
114
|
}
|
|
84
|
-
|
|
85
|
-
.multi-select-icon {
|
|
115
|
+
.ptc-multi-select .multi-select-icon {
|
|
86
116
|
fill: rgba(0, 0, 0, 0.54);
|
|
87
117
|
position: absolute;
|
|
88
118
|
right: var(--ptc-element-spacing-03);
|
|
89
119
|
}
|
|
90
|
-
|
|
91
|
-
.dropdown {
|
|
120
|
+
.ptc-multi-select .dropdown {
|
|
92
121
|
display: block;
|
|
93
122
|
list-style: none;
|
|
94
123
|
padding: 0;
|
|
@@ -98,41 +127,46 @@ ptc-link, ptc-square-card {
|
|
|
98
127
|
/* Adjust as needed */
|
|
99
128
|
overflow-y: auto;
|
|
100
129
|
position: absolute;
|
|
101
|
-
width:
|
|
130
|
+
width: 100%;
|
|
102
131
|
background-color: #fff;
|
|
103
132
|
z-index: 1000;
|
|
104
133
|
/* Custom square for the checkbox */
|
|
105
134
|
/* When checkbox is checked, change background color */
|
|
106
135
|
}
|
|
107
|
-
.dropdown li {
|
|
136
|
+
.ptc-multi-select .dropdown li {
|
|
108
137
|
display: flex;
|
|
109
138
|
align-items: center;
|
|
110
139
|
padding: 8px 10px;
|
|
111
140
|
cursor: pointer;
|
|
112
|
-
border-bottom: 1px solid #eee;
|
|
113
141
|
}
|
|
114
|
-
.dropdown li
|
|
115
|
-
background-color:
|
|
142
|
+
.ptc-multi-select .dropdown li:hover {
|
|
143
|
+
background-color: var(--color-gray-02);
|
|
144
|
+
}
|
|
145
|
+
.ptc-multi-select .dropdown li.selected {
|
|
146
|
+
background-color: var(--color-gray-02);
|
|
116
147
|
}
|
|
117
|
-
.dropdown li
|
|
148
|
+
.ptc-multi-select .dropdown li.selected:hover {
|
|
149
|
+
background-color: var(--color-gray-04);
|
|
150
|
+
}
|
|
151
|
+
.ptc-multi-select .dropdown li label {
|
|
118
152
|
margin-left: 8px;
|
|
119
153
|
font-size: var(--ptc-font-size-xx-small);
|
|
120
154
|
position: relative;
|
|
121
155
|
padding-left: 25px;
|
|
122
156
|
cursor: pointer;
|
|
123
157
|
}
|
|
124
|
-
.dropdown li:last-child {
|
|
158
|
+
.ptc-multi-select .dropdown li:last-child {
|
|
125
159
|
border-bottom: none;
|
|
126
160
|
}
|
|
127
|
-
.dropdown input[type=checkbox] {
|
|
161
|
+
.ptc-multi-select .dropdown input[type=checkbox] {
|
|
128
162
|
position: absolute;
|
|
129
163
|
opacity: 0;
|
|
130
164
|
cursor: pointer;
|
|
131
165
|
}
|
|
132
|
-
.dropdown input[type=checkbox]:checked {
|
|
166
|
+
.ptc-multi-select .dropdown input[type=checkbox]:checked {
|
|
133
167
|
background-color: var(--color-green-07);
|
|
134
168
|
}
|
|
135
|
-
.dropdown label::before {
|
|
169
|
+
.ptc-multi-select .dropdown label::before {
|
|
136
170
|
content: "";
|
|
137
171
|
position: absolute;
|
|
138
172
|
left: 0;
|
|
@@ -146,12 +180,12 @@ ptc-link, ptc-square-card {
|
|
|
146
180
|
border: 1px solid #ccc;
|
|
147
181
|
box-sizing: border-box;
|
|
148
182
|
}
|
|
149
|
-
.dropdown input[type=checkbox]:checked + label::before {
|
|
183
|
+
.ptc-multi-select .dropdown input[type=checkbox]:checked + label::before {
|
|
150
184
|
background-color: var(--color-green-07);
|
|
151
185
|
/* Green background */
|
|
152
186
|
border-color: var(--color-green-07);
|
|
153
187
|
}
|
|
154
|
-
.dropdown input[type=checkbox]:checked + label::after {
|
|
188
|
+
.ptc-multi-select .dropdown input[type=checkbox]:checked + label::after {
|
|
155
189
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 1 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E");
|
|
156
190
|
position: absolute;
|
|
157
191
|
left: 1px;
|
|
@@ -159,8 +193,7 @@ ptc-link, ptc-square-card {
|
|
|
159
193
|
font-size: var(--ptc-font-size-xxx-small);
|
|
160
194
|
color: white;
|
|
161
195
|
}
|
|
162
|
-
|
|
163
|
-
button.ddl-click-text {
|
|
196
|
+
.ptc-multi-select button.ddl-click-text {
|
|
164
197
|
all: unset;
|
|
165
198
|
cursor: pointer;
|
|
166
199
|
color: var(--color-gray-7);
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
+
import { ValidationMessages } from '../../utils/validation-messages';
|
|
3
|
+
import { getLanguageFromURL } from '../../utils/utils';
|
|
2
4
|
export class PtcMultiSelect {
|
|
3
5
|
constructor() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
this.handleBlur = () => {
|
|
7
|
+
this.updateValidity();
|
|
8
|
+
};
|
|
9
|
+
this.updateValidity = () => {
|
|
10
|
+
if (this.isRequired) {
|
|
11
|
+
this.isValid = this.selectedItemsCount > 0;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
this.isValid = true;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
14
17
|
this.selectAllItems = (event) => {
|
|
15
18
|
event.preventDefault();
|
|
16
19
|
event.stopPropagation();
|
|
17
20
|
this.items = this.items.map(item => (Object.assign(Object.assign({}, item), { selected: true })));
|
|
21
|
+
// this.selectedItemsCount = this.items.filter(item => item.selected).length;
|
|
22
|
+
// this.updateValidity();
|
|
18
23
|
};
|
|
19
24
|
this.clearSelectedItems = (event) => {
|
|
20
25
|
event.preventDefault();
|
|
21
26
|
event.stopPropagation();
|
|
22
27
|
this.items = this.items.map(item => (Object.assign(Object.assign({}, item), { selected: false })));
|
|
28
|
+
// this.selectedItemsCount = this.items.filter(item => item.selected).length;
|
|
29
|
+
// this.updateValidity();
|
|
23
30
|
};
|
|
24
31
|
this.items = [
|
|
25
32
|
// Initialize with your items, setting 'selected' to false
|
|
@@ -29,13 +36,38 @@ export class PtcMultiSelect {
|
|
|
29
36
|
this.selectAllText = 'Select All';
|
|
30
37
|
this.clearAllText = 'Clear Selected Items';
|
|
31
38
|
this.isRequired = false;
|
|
39
|
+
this.helpertext = 'This field is required';
|
|
32
40
|
this.showDropdown = false;
|
|
41
|
+
this.language = 'en';
|
|
42
|
+
this.isValid = true;
|
|
43
|
+
this.selectedItemsCount = 0;
|
|
44
|
+
}
|
|
45
|
+
componentWillLoad() {
|
|
46
|
+
this.language = getLanguageFromURL();
|
|
47
|
+
// this.selectedItemsCount = this.items.filter(item => item.selected).length;
|
|
48
|
+
// this.updateValidity();
|
|
49
|
+
}
|
|
50
|
+
handleDocumentClick(event) {
|
|
51
|
+
const clickedInside = this.el.contains(event.target);
|
|
52
|
+
if (!clickedInside) {
|
|
53
|
+
this.showDropdown = false;
|
|
54
|
+
this.selectedItemsCount = this.items.filter(item => item.selected).length;
|
|
55
|
+
this.updateValidity();
|
|
56
|
+
}
|
|
33
57
|
}
|
|
34
58
|
toggleDropdown() {
|
|
35
59
|
this.showDropdown = !this.showDropdown;
|
|
36
60
|
}
|
|
37
61
|
toggleItemSelection(index) {
|
|
38
62
|
this.items = [...this.items.slice(0, index), Object.assign(Object.assign({}, this.items[index]), { selected: !this.items[index].selected }), ...this.items.slice(index + 1)];
|
|
63
|
+
// this.selectedItemsCount = this.items.filter(item => item.selected).length;
|
|
64
|
+
// this.updateValidity();
|
|
65
|
+
}
|
|
66
|
+
getValidationMessage(type) {
|
|
67
|
+
return ValidationMessages[this.language][type];
|
|
68
|
+
}
|
|
69
|
+
setHelperText() {
|
|
70
|
+
this.helpertext = this.getValidationMessage('required');
|
|
39
71
|
}
|
|
40
72
|
render() {
|
|
41
73
|
const selectedItems = this.items.filter(item => item.selected);
|
|
@@ -46,10 +78,10 @@ export class PtcMultiSelect {
|
|
|
46
78
|
if (selectedItemsCount === 1) {
|
|
47
79
|
displayText = selectedItems[0].text;
|
|
48
80
|
}
|
|
49
|
-
return (h(Host,
|
|
81
|
+
return (h(Host, { class: { 'ptc-multi-select': true, 'invalid': !this.isValid } }, h("label", { class: "multi-select-label" }, this.label), h("div", { class: "selected-items", onClick: () => this.toggleDropdown() }, displayText, h("span", { class: "multi-select-icon" }, h("svg", { class: "", width: "20", height: "12", viewBox: "0 0 10 10", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1.375 1.875L5 5.5L8.625 1.875L9.9375 3.1875L5 8.125L0.0625 3.1875L1.375 1.875Z" })))), this.showDropdown && (h("ul", { class: "dropdown" }, h("li", null, h("button", { onClick: event => buttonAction(event), class: "ddl-click-text" }, buttonLabel)), this.items.map((item, index) => (h("li", { key: index, class: { selected: item.selected } }, h("input", { class: "multi-checkbox", type: "checkbox", id: `checkbox-${index}`, checked: item.selected, "data-eloqua-name": item.ptcDataEloquaName, "data-target-eloqua-name": item.ptcDataTargetEloquaName, required: this.isRequired, onClick: event => {
|
|
50
82
|
event.stopPropagation(); // Prevents the dropdown from closing
|
|
51
83
|
this.toggleItemSelection(index);
|
|
52
|
-
} }), h("label", { htmlFor: `checkbox-${index}` }, item.text))))))));
|
|
84
|
+
} }), h("label", { htmlFor: `checkbox-${index}` }, item.text)))))), h("div", { id: "tbd", class: "mdc-select-helper-text mdc-select-helper-text--validation-msg" }, h("svg", { class: "select-error-svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "clip-path": "url(#clip0_12_1424)" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.3156 0L16 4.68444V11.3156L11.3156 16H4.68444L0 11.3156V4.68444L4.68444 0H11.3156ZM8 10.4C7.36 10.4 6.84444 10.9156 6.84444 11.5556C6.84444 12.1956 7.36 12.7111 8 12.7111C8.64 12.7111 9.15556 12.1956 9.15556 11.5556C9.15556 10.9156 8.64 10.4 8 10.4ZM8.88889 3.55556H7.11111V8.88889H8.88889V3.55556Z", fill: "#AF3231" })), h("defs", null, h("clipPath", { id: "clip0_12_1424" }, h("rect", { width: "16", height: "16", fill: "white" })))), this.helpertext)));
|
|
53
85
|
}
|
|
54
86
|
static get is() { return "ptc-multi-select"; }
|
|
55
87
|
static get originalStyleUrls() {
|
|
@@ -155,12 +187,43 @@ export class PtcMultiSelect {
|
|
|
155
187
|
"attribute": "is-required",
|
|
156
188
|
"reflect": false,
|
|
157
189
|
"defaultValue": "false"
|
|
190
|
+
},
|
|
191
|
+
"helpertext": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "string",
|
|
196
|
+
"resolved": "string",
|
|
197
|
+
"references": {}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": false,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": ""
|
|
204
|
+
},
|
|
205
|
+
"attribute": "helpertext",
|
|
206
|
+
"reflect": false,
|
|
207
|
+
"defaultValue": "'This field is required'"
|
|
158
208
|
}
|
|
159
209
|
};
|
|
160
210
|
}
|
|
161
211
|
static get states() {
|
|
162
212
|
return {
|
|
163
|
-
"showDropdown": {}
|
|
213
|
+
"showDropdown": {},
|
|
214
|
+
"language": {},
|
|
215
|
+
"isValid": {},
|
|
216
|
+
"selectedItemsCount": {}
|
|
164
217
|
};
|
|
165
218
|
}
|
|
219
|
+
static get elementRef() { return "el"; }
|
|
220
|
+
static get listeners() {
|
|
221
|
+
return [{
|
|
222
|
+
"name": "click",
|
|
223
|
+
"method": "handleDocumentClick",
|
|
224
|
+
"target": "document",
|
|
225
|
+
"capture": false,
|
|
226
|
+
"passive": false
|
|
227
|
+
}];
|
|
228
|
+
}
|
|
166
229
|
}
|
package/dist/collection/components/ptc-pricing-packaging-table/ptc-pricing-packaging-table.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Host, h, Fragment } from '@stencil/core';
|
|
2
|
+
import { generateUUID, debounce } from '../../utils/utils';
|
|
2
3
|
export class PtcPricingPackagingTable {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.verticalScrollContentClipperHeightOptions = {
|
|
@@ -52,7 +53,10 @@ export class PtcPricingPackagingTable {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
// disable horizontal refresh during anchor scrolling
|
|
57
|
+
if (!this.getHashKey()) {
|
|
58
|
+
this.refreshHorizontalPosition();
|
|
59
|
+
}
|
|
56
60
|
this.lastScrollTop = scrollTopPosition <= 0 ? 0 : scrollTopPosition;
|
|
57
61
|
};
|
|
58
62
|
this.handleHorizontalScroll = () => {
|
|
@@ -263,6 +267,8 @@ export class PtcPricingPackagingTable {
|
|
|
263
267
|
this.dataCols = undefined;
|
|
264
268
|
this.disclaimerCount = 0;
|
|
265
269
|
this.isDesktopView = undefined;
|
|
270
|
+
this.hashKey = undefined;
|
|
271
|
+
this.debouncedHashEnable = undefined;
|
|
266
272
|
this.cellWidthXXS = 180;
|
|
267
273
|
this.cellWidthMD = 225;
|
|
268
274
|
this.cellLeftRightPadding = 48;
|
|
@@ -293,7 +299,28 @@ export class PtcPricingPackagingTable {
|
|
|
293
299
|
};
|
|
294
300
|
window.requestAnimationFrame(refresh);
|
|
295
301
|
}
|
|
302
|
+
getHashKey() {
|
|
303
|
+
let ctx = window;
|
|
304
|
+
if (!this.hashKey) {
|
|
305
|
+
this.hashKey = generateUUID();
|
|
306
|
+
}
|
|
307
|
+
if (!ctx.ppptHashes) {
|
|
308
|
+
ctx.ppptHashes = {};
|
|
309
|
+
}
|
|
310
|
+
return ctx.ppptHashes[this.hashKey] == true;
|
|
311
|
+
}
|
|
312
|
+
setHashKey(value) {
|
|
313
|
+
let ctx = window;
|
|
314
|
+
if (!this.hashKey) {
|
|
315
|
+
this.hashKey = generateUUID();
|
|
316
|
+
}
|
|
317
|
+
if (!ctx.ppptHashes) {
|
|
318
|
+
ctx.ppptHashes = {};
|
|
319
|
+
}
|
|
320
|
+
ctx.ppptHashes[this.hashKey] = value;
|
|
321
|
+
}
|
|
296
322
|
componentWillLoad() {
|
|
323
|
+
this.setHashKey(false);
|
|
297
324
|
this.preProcessTableDescription();
|
|
298
325
|
this.preProcessdesktopHeaderFirstCell();
|
|
299
326
|
this.preProcessColumnHeaders();
|
|
@@ -303,9 +330,17 @@ export class PtcPricingPackagingTable {
|
|
|
303
330
|
this.preProcessDisclaimers();
|
|
304
331
|
}
|
|
305
332
|
componentDidLoad() {
|
|
333
|
+
let that = this;
|
|
306
334
|
this.handleTableReset();
|
|
335
|
+
this.debouncedHashEnable = debounce(() => {
|
|
336
|
+
that.setHashKey(false);
|
|
337
|
+
}, 2000, this);
|
|
307
338
|
window.addEventListener("scroll", () => this.handleVerticalScroll());
|
|
308
339
|
window.addEventListener("resize", () => this.handleTableReset());
|
|
340
|
+
window.addEventListener("hashchange", () => {
|
|
341
|
+
that.setHashKey(true);
|
|
342
|
+
this.debouncedHashEnable();
|
|
343
|
+
});
|
|
309
344
|
}
|
|
310
345
|
render() {
|
|
311
346
|
const TableTitle = () => {
|
|
@@ -491,6 +526,8 @@ export class PtcPricingPackagingTable {
|
|
|
491
526
|
static get states() {
|
|
492
527
|
return {
|
|
493
528
|
"isDesktopView": {},
|
|
529
|
+
"hashKey": {},
|
|
530
|
+
"debouncedHashEnable": {},
|
|
494
531
|
"cellWidthXXS": {},
|
|
495
532
|
"cellWidthMD": {},
|
|
496
533
|
"cellLeftRightPadding": {},
|
|
@@ -736,6 +736,17 @@ ptc-link, ptc-square-card {
|
|
|
736
736
|
padding-bottom: 1.5rem;
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
+
.ptc-section-large {
|
|
740
|
+
padding-top: 2.25rem;
|
|
741
|
+
padding-bottom: 2.25rem;
|
|
742
|
+
}
|
|
743
|
+
@media only screen and (min-width: 992px) {
|
|
744
|
+
.ptc-section-large {
|
|
745
|
+
padding-top: 3.5rem;
|
|
746
|
+
padding-bottom: 3.5rem;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
739
750
|
.u-flex {
|
|
740
751
|
display: flex;
|
|
741
752
|
}
|
|
@@ -6105,7 +6105,7 @@ ptc-link, ptc-square-card {
|
|
|
6105
6105
|
content: "";
|
|
6106
6106
|
position: absolute;
|
|
6107
6107
|
width: calc(100% + 16px);
|
|
6108
|
-
height: calc(100% +
|
|
6108
|
+
height: calc(100% + 8px);
|
|
6109
6109
|
background: #FEF3F3;
|
|
6110
6110
|
display: flex;
|
|
6111
6111
|
flex-direction: column;
|
|
@@ -6135,6 +6135,7 @@ ptc-link, ptc-square-card {
|
|
|
6135
6135
|
z-index: 1;
|
|
6136
6136
|
position: relative;
|
|
6137
6137
|
opacity: 0;
|
|
6138
|
+
margin-top: var(--ptc-element-spacing-02);
|
|
6138
6139
|
}
|
|
6139
6140
|
.ptc-select .select-error-svg {
|
|
6140
6141
|
transform: translate(-8px, 3px);
|
|
@@ -6162,7 +6163,8 @@ ptc-link, ptc-square-card {
|
|
|
6162
6163
|
height: auto;
|
|
6163
6164
|
transform: translateX(8px);
|
|
6164
6165
|
}
|
|
6165
|
-
.ptc-select .mdc-select-helper-text--validation-msg,
|
|
6166
|
+
.ptc-select .mdc-select-helper-text--validation-msg,
|
|
6167
|
+
.ptc-select .mdc-select-helper-text--info-msg {
|
|
6166
6168
|
line-height: 0.66;
|
|
6167
6169
|
height: 0;
|
|
6168
6170
|
}
|
|
@@ -6173,4 +6175,41 @@ ptc-link, ptc-square-card {
|
|
|
6173
6175
|
}
|
|
6174
6176
|
.ptc-select .mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon {
|
|
6175
6177
|
fill: var(--color-hyperlink);
|
|
6178
|
+
}
|
|
6179
|
+
.ptc-select .mdc-list {
|
|
6180
|
+
font-family: "Open Sans", Arial, sans-serif;
|
|
6181
|
+
}
|
|
6182
|
+
.ptc-select .mdc-list-item {
|
|
6183
|
+
padding: 5px 8px;
|
|
6184
|
+
}
|
|
6185
|
+
.ptc-select .mdc-list-item:hover .mdc-list-item__ripple::before,
|
|
6186
|
+
.ptc-select .mdc-list-item:hover .mdc-list-item__ripple::after {
|
|
6187
|
+
background-color: var(--color-gray-02) !important;
|
|
6188
|
+
opacity: 1;
|
|
6189
|
+
z-index: -1;
|
|
6190
|
+
}
|
|
6191
|
+
.ptc-select .mdc-list-item--selected .mdc-list-item__ripple::before,
|
|
6192
|
+
.ptc-select .mdc-list-item--selected .mdc-list-item__ripple::after {
|
|
6193
|
+
background-color: var(--color-gray-02) !important;
|
|
6194
|
+
opacity: 1;
|
|
6195
|
+
z-index: -1;
|
|
6196
|
+
}
|
|
6197
|
+
.ptc-select .mdc-list-item--selected:hover .mdc-list-item__ripple::before,
|
|
6198
|
+
.ptc-select .mdc-list-item--selected:hover .mdc-list-item__ripple::after {
|
|
6199
|
+
background-color: var(--color-gray-04) !important;
|
|
6200
|
+
opacity: 1;
|
|
6201
|
+
z-index: -1;
|
|
6202
|
+
}
|
|
6203
|
+
.ptc-select .mdc-list-item__text,
|
|
6204
|
+
.ptc-select .mdc-select__selected-text {
|
|
6205
|
+
color: var(--color--color-gray-12);
|
|
6206
|
+
font-family: "Open Sans", Arial, sans-serif;
|
|
6207
|
+
font-size: var(--ptc-font-size-xx-small);
|
|
6208
|
+
font-weight: var(--ptc-font-weight-regular);
|
|
6209
|
+
line-height: 24px;
|
|
6210
|
+
/* 171.429% */
|
|
6211
|
+
}
|
|
6212
|
+
.ptc-select :not(.mdc-list-item--disabled).mdc-list-item .mdc-list-item__ripple::before,
|
|
6213
|
+
.ptc-select :not(.mdc-list-item--disabled).mdc-list-item .mdc-list-item__ripple::after {
|
|
6214
|
+
background-color: unset;
|
|
6176
6215
|
}
|
|
@@ -3566,7 +3566,7 @@ ptc-link, ptc-square-card {
|
|
|
3566
3566
|
content: "";
|
|
3567
3567
|
position: absolute;
|
|
3568
3568
|
width: calc(100% + 16px);
|
|
3569
|
-
height: calc(100% +
|
|
3569
|
+
height: calc(100% + 8px);
|
|
3570
3570
|
background: #FEF3F3;
|
|
3571
3571
|
display: flex;
|
|
3572
3572
|
flex-direction: column;
|
|
@@ -3616,6 +3616,7 @@ ptc-link, ptc-square-card {
|
|
|
3616
3616
|
line-height: var(--ptc-line-height-densest);
|
|
3617
3617
|
max-width: 240px;
|
|
3618
3618
|
opacity: 0;
|
|
3619
|
+
margin-top: var(--ptc-element-spacing-02);
|
|
3619
3620
|
}
|
|
3620
3621
|
.ptc-text-field .mdc-text-field--invalid + .mdc-text-field-helper-line {
|
|
3621
3622
|
height: auto;
|
|
@@ -3686,6 +3687,11 @@ ptc-link, ptc-square-card {
|
|
|
3686
3687
|
}
|
|
3687
3688
|
.ptc-text-field .mdc-text-field__input {
|
|
3688
3689
|
z-index: 2;
|
|
3690
|
+
color: var(--color--color-gray-12) !important;
|
|
3691
|
+
font-family: "Open Sans", Arial, sans-serif;
|
|
3692
|
+
font-size: var(--ptc-font-size-xx-small);
|
|
3693
|
+
font-weight: var(--ptc-font-weight-regular);
|
|
3694
|
+
line-height: 24px;
|
|
3689
3695
|
}
|
|
3690
3696
|
.ptc-text-field .mdc-text-field--with-internal-counter {
|
|
3691
3697
|
padding-right: 56px;
|
|
@@ -3695,6 +3701,10 @@ ptc-link, ptc-square-card {
|
|
|
3695
3701
|
right: 16px;
|
|
3696
3702
|
top: 0px;
|
|
3697
3703
|
transform: translateY(-150%);
|
|
3704
|
+
font-family: "Open Sans", Arial, sans-serif;
|
|
3705
|
+
font-size: var(--ptc-font-size-xx-small);
|
|
3706
|
+
font-weight: var(--ptc-font-weight-regular);
|
|
3707
|
+
line-height: var(--ptc-font-size-xx-small);
|
|
3698
3708
|
}
|
|
3699
3709
|
.ptc-text-field .iti {
|
|
3700
3710
|
height: 35px;
|
|
@@ -3720,4 +3730,10 @@ ptc-link, ptc-square-card {
|
|
|
3720
3730
|
}
|
|
3721
3731
|
.ptc-text-field .mdc-text-field:not(.mdc-text-field--disabled) + .mdc-text-field-helper-line .mdc-text-field-helper-text {
|
|
3722
3732
|
color: var(--color-gray-13);
|
|
3733
|
+
}
|
|
3734
|
+
.ptc-text-field .mdc-text-field__input::placeholder {
|
|
3735
|
+
font-family: "Open Sans", Arial, sans-serif;
|
|
3736
|
+
font-size: var(--ptc-font-size-xx-small);
|
|
3737
|
+
font-weight: var(--ptc-font-weight-regular);
|
|
3738
|
+
line-height: 24px;
|
|
3723
3739
|
}
|
|
@@ -166,7 +166,7 @@ export class PtcTextfield {
|
|
|
166
166
|
}
|
|
167
167
|
getValidationPattern() {
|
|
168
168
|
let validationPattern = '';
|
|
169
|
-
if (this.type === 'email' && this.fieldName === 'email') {
|
|
169
|
+
if ((this.type === 'email' && this.fieldName === 'email') || (this.type === 'email' && this.fieldName === "companyemail")) {
|
|
170
170
|
validationPattern = "[a-z0-9._%+\\-]+@[a-z0-9.\\-]+\\.(?!.*\\..*\\.)[a-z]{2,7}$";
|
|
171
171
|
}
|
|
172
172
|
if (this.fieldName === 'firstname' || this.fieldName === 'lastname') {
|
|
@@ -177,7 +177,7 @@ export class PtcTextfield {
|
|
|
177
177
|
setHelperText() {
|
|
178
178
|
this.helpertext = this.getValidationMessage('required');
|
|
179
179
|
//console.log('default: ' + this.getValidationMessage('required'));
|
|
180
|
-
if (this.type === 'email' && this.fieldName === 'email') {
|
|
180
|
+
if ((this.type === 'email' && this.fieldName === 'email') || (this.type === 'email' && this.fieldName === "companyemail")) {
|
|
181
181
|
if (this.customInput.validity.valueMissing) {
|
|
182
182
|
this.helpertext = this.getValidationMessage('email');
|
|
183
183
|
}
|
|
@@ -8,8 +8,10 @@ export class PtcSubnav {
|
|
|
8
8
|
this.navOpen = !this.navOpen;
|
|
9
9
|
}
|
|
10
10
|
handleScroll() {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
let elem = this.el.shadowRoot.querySelector('div.sticky-subnav');
|
|
12
|
+
if (elem) {
|
|
13
|
+
elem.classList.remove('sticky');
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
16
|
handleNavLinkClickedEvent() {
|
|
15
17
|
console.log('link clicked');
|
|
@@ -162,3 +162,31 @@ export function equalizeHeightsWithinShadow(selector, shadowRootOrHostElement) {
|
|
|
162
162
|
element.style.height = `${tallestHeight}px`;
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
+
/*
|
|
166
|
+
observeInView:
|
|
167
|
+
Trigger CSS Animations when elements are scrolled into view
|
|
168
|
+
|
|
169
|
+
This function uses the Intersection Observer API to determine if objects are within the viewport
|
|
170
|
+
It adds an 'in-view' class to elements when they come into view (and removes the class when not on screen)
|
|
171
|
+
Use to add @keyframe or transition animations to elements so they animate once they are on screen
|
|
172
|
+
|
|
173
|
+
How to use:
|
|
174
|
+
Import observeInView function in the component
|
|
175
|
+
import { observeInView } from '../../utils/utils';
|
|
176
|
+
Call the function with the host element and selector
|
|
177
|
+
observeInView(this.hostEle, '.ptc-animate');
|
|
178
|
+
|
|
179
|
+
*/
|
|
180
|
+
export function observeInView(hostEle, selector) {
|
|
181
|
+
const observer = new IntersectionObserver(entries => {
|
|
182
|
+
entries.forEach(entry => {
|
|
183
|
+
if (entry.isIntersecting) {
|
|
184
|
+
entry.target.classList.add('in-view');
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
entry.target.classList.remove('in-view');
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
const allAnimatedElements = hostEle.shadowRoot.querySelectorAll(selector);
|
|
191
|
+
allAnimatedElements.forEach((element) => observer.observe(element));
|
|
192
|
+
}
|
|
@@ -326,6 +326,12 @@ export const PtcHeroFooterCta: {
|
|
|
326
326
|
new (): PtcHeroFooterCta;
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
+
interface PtcHomepageImageFeature extends Components.PtcHomepageImageFeature, HTMLElement {}
|
|
330
|
+
export const PtcHomepageImageFeature: {
|
|
331
|
+
prototype: PtcHomepageImageFeature;
|
|
332
|
+
new (): PtcHomepageImageFeature;
|
|
333
|
+
};
|
|
334
|
+
|
|
329
335
|
interface PtcIconCard extends Components.PtcIconCard, HTMLElement {}
|
|
330
336
|
export const PtcIconCard: {
|
|
331
337
|
prototype: PtcIconCard;
|