@ptcwebops/ptcw-design 2.4.2 → 2.4.4
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/ptc-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-pricing-add-on-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-pricing-table.cjs.entry.js +94 -11
- package/dist/collection/components/ptc-card/ptc-card.css +1 -1
- package/dist/collection/components/ptc-pricing-add-on-card/ptc-pricing-add-on-card.css +2 -2
- package/dist/collection/components/ptc-pricing-table/ptc-pricing-table.css +92 -106
- package/dist/collection/components/ptc-pricing-table/ptc-pricing-table.js +93 -10
- package/dist/custom-elements/index.js +96 -13
- package/dist/esm/ptc-card.entry.js +1 -1
- package/dist/esm/ptc-pricing-add-on-card.entry.js +1 -1
- package/dist/esm/ptc-pricing-table.entry.js +94 -11
- package/dist/ptcw-design/p-30feb059.entry.js +1 -0
- package/dist/ptcw-design/{p-f8eacbd8.entry.js → p-ef79c1f5.entry.js} +1 -1
- package/dist/ptcw-design/{p-05cc800d.entry.js → p-f6cf3eea.entry.js} +1 -1
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/ptc-pricing-table/ptc-pricing-table.d.ts +8 -0
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/ptcw-design/p-3192a7e8.entry.js +0 -1
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
5
|
-
@media only screen and (min-width: 768px) {
|
|
6
|
-
:host .table-descriptor {
|
|
7
|
-
width: 768px;
|
|
8
|
-
margin: auto;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
5
|
:host #vertical-scroll-content-clipper {
|
|
12
6
|
position: fixed;
|
|
13
7
|
top: 0;
|
|
@@ -39,15 +33,10 @@
|
|
|
39
33
|
:host #sticky-header-container::-webkit-scrollbar {
|
|
40
34
|
display: none;
|
|
41
35
|
}
|
|
42
|
-
@media only screen and (min-width: 768px) {
|
|
43
|
-
:host #sticky-header-container {
|
|
44
|
-
box-shadow: none;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
36
|
:host #sticky-header-container th {
|
|
48
37
|
background: var(--color-gray-10);
|
|
49
38
|
color: white;
|
|
50
|
-
padding:
|
|
39
|
+
padding: var(--ptc-element-spacing-04) var(--ptc-element-spacing-06) var(--ptc-element-spacing-04) var(--ptc-element-spacing-06);
|
|
51
40
|
min-width: 168px;
|
|
52
41
|
max-width: 180px;
|
|
53
42
|
vertical-align: middle;
|
|
@@ -65,28 +54,6 @@
|
|
|
65
54
|
width: 99%;
|
|
66
55
|
box-sizing: content-box;
|
|
67
56
|
}
|
|
68
|
-
@media only screen and (min-width: 768px) {
|
|
69
|
-
:host #sticky-header-container th {
|
|
70
|
-
max-width: 275px;
|
|
71
|
-
}
|
|
72
|
-
:host #sticky-header-container th.desktop-header-first-cell {
|
|
73
|
-
display: table-cell;
|
|
74
|
-
min-width: 275px;
|
|
75
|
-
box-sizing: content-box;
|
|
76
|
-
}
|
|
77
|
-
:host #sticky-header-container th:first-of-type {
|
|
78
|
-
position: -webkit-sticky;
|
|
79
|
-
position: sticky;
|
|
80
|
-
left: 0;
|
|
81
|
-
z-index: 5;
|
|
82
|
-
}
|
|
83
|
-
:host #sticky-header-container th.table-filler-header-cell {
|
|
84
|
-
width: 99%;
|
|
85
|
-
display: none;
|
|
86
|
-
max-width: fit-content;
|
|
87
|
-
box-sizing: border-box;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
57
|
:host .scroll-buttons-container {
|
|
91
58
|
position: absolute;
|
|
92
59
|
top: 0;
|
|
@@ -99,6 +66,7 @@
|
|
|
99
66
|
z-index: 15;
|
|
100
67
|
position: absolute;
|
|
101
68
|
display: inline-block;
|
|
69
|
+
width: 36px;
|
|
102
70
|
width: fit-content;
|
|
103
71
|
height: 36px;
|
|
104
72
|
background-color: white;
|
|
@@ -108,39 +76,33 @@
|
|
|
108
76
|
align-items: center;
|
|
109
77
|
}
|
|
110
78
|
:host .scroll-buttons-container .scroll-buttons icon-asset {
|
|
79
|
+
z-index: 15;
|
|
111
80
|
display: flex;
|
|
112
81
|
justify-content: center;
|
|
113
82
|
align-items: center;
|
|
114
83
|
width: 36px;
|
|
84
|
+
height: 100%;
|
|
115
85
|
}
|
|
116
86
|
:host .scroll-buttons-container .scroll-buttons.prev-button {
|
|
87
|
+
z-index: 15;
|
|
117
88
|
left: 0;
|
|
118
|
-
border-radius: 0px
|
|
89
|
+
border-radius: 0px var(--ptc-element-spacing-01) var(--ptc-element-spacing-01) 0px;
|
|
119
90
|
}
|
|
120
91
|
:host .scroll-buttons-container .scroll-buttons.prev-button ptc-para {
|
|
92
|
+
z-index: 15;
|
|
93
|
+
margin-right: var(--ptc-element-spacing-04);
|
|
121
94
|
display: none;
|
|
122
95
|
}
|
|
123
|
-
:host .scroll-buttons-container .scroll-buttons.prev-button:hover {
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
}
|
|
126
|
-
:host .scroll-buttons-container .scroll-buttons.prev-button:hover ptc-para {
|
|
127
|
-
margin-right: 16px;
|
|
128
|
-
display: block;
|
|
129
|
-
}
|
|
130
96
|
:host .scroll-buttons-container .scroll-buttons.next-button {
|
|
97
|
+
z-index: 15;
|
|
131
98
|
right: 0;
|
|
132
|
-
border-radius:
|
|
99
|
+
border-radius: var(--ptc-element-spacing-01) 0px 0px var(--ptc-element-spacing-01);
|
|
133
100
|
}
|
|
134
101
|
:host .scroll-buttons-container .scroll-buttons.next-button ptc-para {
|
|
102
|
+
z-index: 15;
|
|
103
|
+
margin-left: var(--ptc-element-spacing-04);
|
|
135
104
|
display: none;
|
|
136
105
|
}
|
|
137
|
-
:host .scroll-buttons-container .scroll-buttons.next-button:hover {
|
|
138
|
-
cursor: pointer;
|
|
139
|
-
}
|
|
140
|
-
:host .scroll-buttons-container .scroll-buttons.next-button:hover ptc-para {
|
|
141
|
-
margin-left: 16px;
|
|
142
|
-
display: block;
|
|
143
|
-
}
|
|
144
106
|
:host #table-container {
|
|
145
107
|
border-radius: var(--ptc-border-radius-standard);
|
|
146
108
|
box-shadow: var(--ptc-shadow-x-small);
|
|
@@ -150,26 +112,13 @@
|
|
|
150
112
|
:host #table-container #horizontal-scroll-box-shadow {
|
|
151
113
|
display: none;
|
|
152
114
|
}
|
|
153
|
-
@media only screen and (min-width: 768px) {
|
|
154
|
-
:host #table-container #horizontal-scroll-box-shadow {
|
|
155
|
-
display: block;
|
|
156
|
-
position: absolute;
|
|
157
|
-
top: 0;
|
|
158
|
-
left: 0;
|
|
159
|
-
height: 100%;
|
|
160
|
-
width: 24px;
|
|
161
|
-
background: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 100%);
|
|
162
|
-
z-index: 10;
|
|
163
|
-
visibility: hidden;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
115
|
:host #table-container table {
|
|
167
116
|
border-spacing: 0;
|
|
168
117
|
}
|
|
169
118
|
:host #table-container th {
|
|
170
119
|
background: var(--color-gray-10);
|
|
171
120
|
color: white;
|
|
172
|
-
padding:
|
|
121
|
+
padding: var(--ptc-element-spacing-04) var(--ptc-element-spacing-06) var(--ptc-element-spacing-04) var(--ptc-element-spacing-06);
|
|
173
122
|
}
|
|
174
123
|
:host #table-container th:not(:last-child) {
|
|
175
124
|
border-right: 1px solid var(--color-gray-07);
|
|
@@ -181,25 +130,6 @@
|
|
|
181
130
|
width: 99%;
|
|
182
131
|
display: none;
|
|
183
132
|
}
|
|
184
|
-
@media only screen and (min-width: 768px) {
|
|
185
|
-
:host #table-container th {
|
|
186
|
-
max-width: 275px;
|
|
187
|
-
}
|
|
188
|
-
:host #table-container th.desktop-header-first-cell {
|
|
189
|
-
display: table-cell;
|
|
190
|
-
min-width: 275px;
|
|
191
|
-
}
|
|
192
|
-
:host #table-container th:first-of-type {
|
|
193
|
-
position: -webkit-sticky;
|
|
194
|
-
position: sticky;
|
|
195
|
-
left: 0;
|
|
196
|
-
z-index: 5;
|
|
197
|
-
}
|
|
198
|
-
:host #table-container th.table-filler-header-cell {
|
|
199
|
-
width: 99%;
|
|
200
|
-
display: none;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
133
|
:host #table-container tbody.mobile-table-body {
|
|
204
134
|
display: contents;
|
|
205
135
|
width: 100%;
|
|
@@ -207,15 +137,6 @@
|
|
|
207
137
|
:host #table-container tbody.desktop-table-body {
|
|
208
138
|
display: none;
|
|
209
139
|
}
|
|
210
|
-
@media only screen and (min-width: 768px) {
|
|
211
|
-
:host #table-container tbody.mobile-table-body {
|
|
212
|
-
display: none;
|
|
213
|
-
}
|
|
214
|
-
:host #table-container tbody.desktop-table-body {
|
|
215
|
-
display: contents;
|
|
216
|
-
width: 100%;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
140
|
:host #table-container tr {
|
|
220
141
|
background-color: white;
|
|
221
142
|
width: 100%;
|
|
@@ -233,25 +154,14 @@
|
|
|
233
154
|
:host #table-container tr.table-button-row td {
|
|
234
155
|
border-top: 1px solid var(--color-gray-02);
|
|
235
156
|
}
|
|
236
|
-
|
|
237
|
-
:
|
|
238
|
-
background-color: white;
|
|
239
|
-
}
|
|
240
|
-
:host #table-container tr:nth-child(even) {
|
|
241
|
-
background-color: var(--color-gray-01);
|
|
242
|
-
}
|
|
243
|
-
:host #table-container tr.table-button-row {
|
|
244
|
-
background-color: white;
|
|
245
|
-
}
|
|
246
|
-
:host #table-container tr.table-button-row td {
|
|
247
|
-
border-top: 1px solid var(--color-gray-02);
|
|
248
|
-
}
|
|
157
|
+
:host #table-container tr.table-button-row td ptc-tooltip .text-ellipsis {
|
|
158
|
+
font-size: var(--ptc-font-size-x-small);
|
|
249
159
|
}
|
|
250
160
|
:host #table-container td {
|
|
251
161
|
text-align: center;
|
|
252
162
|
min-width: 168px;
|
|
253
163
|
max-width: 180px;
|
|
254
|
-
padding:
|
|
164
|
+
padding: var(--ptc-element-spacing-04) var(--ptc-element-spacing-06) var(--ptc-element-spacing-04) var(--ptc-element-spacing-06);
|
|
255
165
|
}
|
|
256
166
|
:host #table-container td:not(:last-child) {
|
|
257
167
|
border-right: 1px solid var(--color-gray-02);
|
|
@@ -261,6 +171,82 @@
|
|
|
261
171
|
display: none;
|
|
262
172
|
}
|
|
263
173
|
@media only screen and (min-width: 768px) {
|
|
174
|
+
:host .table-descriptor {
|
|
175
|
+
width: 768px;
|
|
176
|
+
margin: auto;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
@media only screen and (min-width: 992px) {
|
|
180
|
+
:host #sticky-header-container {
|
|
181
|
+
box-shadow: none;
|
|
182
|
+
}
|
|
183
|
+
:host #sticky-header-container th {
|
|
184
|
+
max-width: 275px;
|
|
185
|
+
}
|
|
186
|
+
:host #sticky-header-container th.desktop-header-first-cell {
|
|
187
|
+
display: table-cell;
|
|
188
|
+
min-width: 275px;
|
|
189
|
+
box-sizing: content-box;
|
|
190
|
+
}
|
|
191
|
+
:host #sticky-header-container th:first-of-type {
|
|
192
|
+
position: -webkit-sticky;
|
|
193
|
+
position: sticky;
|
|
194
|
+
left: 0;
|
|
195
|
+
z-index: 5;
|
|
196
|
+
}
|
|
197
|
+
:host #sticky-header-container th.table-filler-header-cell {
|
|
198
|
+
width: 99%;
|
|
199
|
+
display: none;
|
|
200
|
+
max-width: fit-content;
|
|
201
|
+
box-sizing: border-box;
|
|
202
|
+
}
|
|
203
|
+
:host #table-container #horizontal-scroll-box-shadow {
|
|
204
|
+
display: block;
|
|
205
|
+
position: absolute;
|
|
206
|
+
top: 0;
|
|
207
|
+
left: 0;
|
|
208
|
+
height: 100%;
|
|
209
|
+
width: var(--ptc-element-spacing-06);
|
|
210
|
+
background: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 100%);
|
|
211
|
+
z-index: 10;
|
|
212
|
+
visibility: hidden;
|
|
213
|
+
}
|
|
214
|
+
:host #table-container th {
|
|
215
|
+
max-width: 275px;
|
|
216
|
+
}
|
|
217
|
+
:host #table-container th.desktop-header-first-cell {
|
|
218
|
+
display: table-cell;
|
|
219
|
+
min-width: 275px;
|
|
220
|
+
}
|
|
221
|
+
:host #table-container th:first-of-type {
|
|
222
|
+
position: -webkit-sticky;
|
|
223
|
+
position: sticky;
|
|
224
|
+
left: 0;
|
|
225
|
+
z-index: 5;
|
|
226
|
+
}
|
|
227
|
+
:host #table-container th.table-filler-header-cell {
|
|
228
|
+
width: 99%;
|
|
229
|
+
display: none;
|
|
230
|
+
}
|
|
231
|
+
:host #table-container tbody.mobile-table-body {
|
|
232
|
+
display: none;
|
|
233
|
+
}
|
|
234
|
+
:host #table-container tbody.desktop-table-body {
|
|
235
|
+
display: contents;
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
:host #table-container tr:nth-child(odd) {
|
|
239
|
+
background-color: white;
|
|
240
|
+
}
|
|
241
|
+
:host #table-container tr:nth-child(even) {
|
|
242
|
+
background-color: var(--color-gray-01);
|
|
243
|
+
}
|
|
244
|
+
:host #table-container tr.table-button-row {
|
|
245
|
+
background-color: white;
|
|
246
|
+
}
|
|
247
|
+
:host #table-container tr.table-button-row td {
|
|
248
|
+
border-top: 1px solid var(--color-gray-02);
|
|
249
|
+
}
|
|
264
250
|
:host #table-container td {
|
|
265
251
|
max-width: 275px;
|
|
266
252
|
}
|
|
@@ -15,15 +15,18 @@ export class PtcPricingTable {
|
|
|
15
15
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
16
16
|
this.targetElements = this.getTargetElements();
|
|
17
17
|
this.targetElements["sticky-header-container"].scrollLeft = (_a = this.targetElements["table-container"]) === null || _a === void 0 ? void 0 : _a.scrollLeft;
|
|
18
|
+
// Scroll the button containers in sync with the table's scrolling
|
|
18
19
|
if (((_b = this.targetElements["table-container"]) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().right) <= ((_c = this.targetElements["table"]) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().right)) {
|
|
19
20
|
this.targetElements["normal-scroll-buttons-container"].style.left = `${((_d = this.targetElements["table-container"]) === null || _d === void 0 ? void 0 : _d.scrollLeft) + this.desktopHeaderFirstCellWidth}px`;
|
|
20
21
|
this.targetElements["sticky-scroll-buttons-container"].style.left = `${((_e = this.targetElements["table-container"]) === null || _e === void 0 ? void 0 : _e.scrollLeft) + this.desktopHeaderFirstCellWidth}px`;
|
|
21
22
|
}
|
|
23
|
+
// Scroll the mobile row headers along with the table in the mobile view
|
|
22
24
|
if (this.targetElements["mobile-table-row-headers"].length > 0) {
|
|
23
25
|
for (let i = 0; i < this.dataRows; i++) {
|
|
24
26
|
this.targetElements["mobile-table-row-headers"][i].style.paddingLeft = `${(_f = this.targetElements["table-container"]) === null || _f === void 0 ? void 0 : _f.scrollLeft}px`;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
29
|
+
// Managing the visibility of the next scroll buttons in both the sticky and normal headers, depending on whether the table can scroll further to the right or not
|
|
27
30
|
if (Math.trunc(this.targetElements["table-container"].getBoundingClientRect().right) >= Math.trunc(this.targetElements["table"].getBoundingClientRect().right)) {
|
|
28
31
|
this.targetElements["normal-next-scroll-button"].style.visibility = 'hidden';
|
|
29
32
|
if (this.targetElements["sticky-header-container"].style.visibility === 'visible') {
|
|
@@ -36,6 +39,7 @@ export class PtcPricingTable {
|
|
|
36
39
|
this.targetElements["sticky-next-scroll-button"].style.visibility = 'visible';
|
|
37
40
|
}
|
|
38
41
|
}
|
|
42
|
+
// Adjusting the visibility of the previous scroll buttons in both the sticky and normal headers, as well as the box shadow in desktop view, depending on whether the table can scroll further to the left or not
|
|
39
43
|
if (this.targetElements["table-container"].scrollLeft === 0) {
|
|
40
44
|
this.targetElements["horizontal-scroll-box-shadow"].style.left = '0';
|
|
41
45
|
this.targetElements["horizontal-scroll-box-shadow"].style.visibility = 'hidden';
|
|
@@ -60,19 +64,19 @@ export class PtcPricingTable {
|
|
|
60
64
|
// Scrolling Up
|
|
61
65
|
if (this.targetElements["table-container"].getBoundingClientRect().bottom > 0) {
|
|
62
66
|
if (this.targetElements["sticky-header-container"].getBoundingClientRect().top < 0) {
|
|
63
|
-
// Scroll the sticky header back into
|
|
67
|
+
// Scroll the sticky header back into view along with the table
|
|
64
68
|
this.targetElements["vertical-scroll-content-clipper"].style.display = 'block';
|
|
65
69
|
this.targetElements["sticky-scroll-buttons-container"].style.opacity = '1';
|
|
66
70
|
this.targetElements["sticky-header-container"].style.visibility = 'visible';
|
|
67
71
|
this.targetElements["sticky-header-container"].style.top = `${this.targetElements["table-container"].getBoundingClientRect().bottom - this.targetElements["sticky-header-container"].getBoundingClientRect().height}px`;
|
|
68
72
|
}
|
|
69
73
|
else {
|
|
70
|
-
//
|
|
74
|
+
// Make the sticky header fixed once it is entirely within the window
|
|
71
75
|
this.targetElements["sticky-header-container"].style.top = this.scrollTopClipperHeight;
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
if (this.targetElements["table-header"].getBoundingClientRect().top > this.targetElements["sticky-header-container"].getBoundingClientRect().top) {
|
|
75
|
-
//
|
|
79
|
+
// Conceal the sticky header and reveal the normal header
|
|
76
80
|
this.targetElements["sticky-scroll-buttons-container"].style.opacity = '0';
|
|
77
81
|
this.targetElements["sticky-header-container"].style.visibility = 'hidden';
|
|
78
82
|
this.targetElements["table-header"].style.visibility = 'visible';
|
|
@@ -82,7 +86,7 @@ export class PtcPricingTable {
|
|
|
82
86
|
else if (scrollTopPosition > this.lastScrollTop) {
|
|
83
87
|
// Scrolling down
|
|
84
88
|
if (this.targetElements["sticky-header-container"].getBoundingClientRect().bottom <= 0) {
|
|
85
|
-
// Reset and hide the sticky header
|
|
89
|
+
// Reset and hide the sticky header when it scrolls out of the top of the window
|
|
86
90
|
this.targetElements["sticky-header-container"].style.top = `${-this.targetElements["sticky-header-container"].getBoundingClientRect().height}px`;
|
|
87
91
|
this.targetElements["sticky-scroll-buttons-container"].style.opacity = '0';
|
|
88
92
|
this.targetElements["sticky-header-container"].style.visibility = 'hidden';
|
|
@@ -94,7 +98,7 @@ export class PtcPricingTable {
|
|
|
94
98
|
this.targetElements["sticky-header-container"].style.top = `${(this.targetElements["table-container"].getBoundingClientRect().bottom - this.targetElements["sticky-header-container"].clientHeight)}px`;
|
|
95
99
|
}
|
|
96
100
|
else {
|
|
97
|
-
//
|
|
101
|
+
// Conceal the normal header and reveal the sticky header
|
|
98
102
|
this.targetElements["vertical-scroll-content-clipper"].style.display = 'block';
|
|
99
103
|
this.targetElements["sticky-scroll-buttons-container"].style.opacity = '1';
|
|
100
104
|
this.targetElements["sticky-header-container"].style.visibility = 'visible';
|
|
@@ -136,6 +140,7 @@ export class PtcPricingTable {
|
|
|
136
140
|
this.ctaButtons = [];
|
|
137
141
|
this.disclaimers = [];
|
|
138
142
|
}
|
|
143
|
+
// Provides an object containing frequently accessed HTML elements for table-related operations
|
|
139
144
|
getTargetElements() {
|
|
140
145
|
let pricingTable = this.el.shadowRoot;
|
|
141
146
|
let verticalScrollContentClipper = pricingTable === null || pricingTable === void 0 ? void 0 : pricingTable.querySelector('#vertical-scroll-content-clipper');
|
|
@@ -157,9 +162,13 @@ export class PtcPricingTable {
|
|
|
157
162
|
let normalScrollButtonsContainer = tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.querySelector('.scroll-buttons-container');
|
|
158
163
|
let stickyScrollButtonsContainer = stickyHeaderContainer === null || stickyHeaderContainer === void 0 ? void 0 : stickyHeaderContainer.querySelector('.scroll-buttons-container');
|
|
159
164
|
let normalPreviousScrollButton = normalScrollButtonsContainer === null || normalScrollButtonsContainer === void 0 ? void 0 : normalScrollButtonsContainer.querySelector('.prev-button');
|
|
165
|
+
let normalPreviousScrollButtonText = normalPreviousScrollButton === null || normalPreviousScrollButton === void 0 ? void 0 : normalPreviousScrollButton.querySelector('ptc-para');
|
|
160
166
|
let stickyPreviousScrollButton = stickyScrollButtonsContainer === null || stickyScrollButtonsContainer === void 0 ? void 0 : stickyScrollButtonsContainer.querySelector('.prev-button');
|
|
167
|
+
let stickyPreviousScrollButtonText = stickyPreviousScrollButton === null || stickyPreviousScrollButton === void 0 ? void 0 : stickyPreviousScrollButton.querySelector('ptc-para');
|
|
161
168
|
let normalNextScrollButton = normalScrollButtonsContainer === null || normalScrollButtonsContainer === void 0 ? void 0 : normalScrollButtonsContainer.querySelector('.next-button');
|
|
169
|
+
let normalNextScrollButtonText = normalNextScrollButton === null || normalNextScrollButton === void 0 ? void 0 : normalNextScrollButton.querySelector('ptc-para');
|
|
162
170
|
let stickyNextScrollButton = stickyScrollButtonsContainer === null || stickyScrollButtonsContainer === void 0 ? void 0 : stickyScrollButtonsContainer.querySelector('.next-button');
|
|
171
|
+
let stickyNextScrollButtonText = stickyNextScrollButton === null || stickyNextScrollButton === void 0 ? void 0 : stickyNextScrollButton.querySelector('ptc-para');
|
|
163
172
|
let horizontalScrollBoxShadow = tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.querySelector('#horizontal-scroll-box-shadow');
|
|
164
173
|
let targetElements = {
|
|
165
174
|
"vertical-scroll-content-clipper": verticalScrollContentClipper,
|
|
@@ -182,23 +191,31 @@ export class PtcPricingTable {
|
|
|
182
191
|
"normal-scroll-buttons-container": normalScrollButtonsContainer,
|
|
183
192
|
"sticky-scroll-buttons-container": stickyScrollButtonsContainer,
|
|
184
193
|
"normal-previous-scroll-button": normalPreviousScrollButton,
|
|
194
|
+
"normal-previous-scroll-button-text": normalPreviousScrollButtonText,
|
|
185
195
|
"sticky-previous-scroll-button": stickyPreviousScrollButton,
|
|
196
|
+
"sticky-previous-scroll-button-text": stickyPreviousScrollButtonText,
|
|
186
197
|
"normal-next-scroll-button": normalNextScrollButton,
|
|
198
|
+
"normal-next-scroll-button-text": normalNextScrollButtonText,
|
|
187
199
|
"sticky-next-scroll-button": stickyNextScrollButton,
|
|
200
|
+
"sticky-next-scroll-button-text": stickyNextScrollButtonText,
|
|
188
201
|
"horizontal-scroll-box-shadow": horizontalScrollBoxShadow,
|
|
189
202
|
};
|
|
190
203
|
return targetElements;
|
|
191
204
|
}
|
|
205
|
+
// Sets up the scroll buttons container for both the sticky and normal headers
|
|
192
206
|
configureScrollButtonsContainers() {
|
|
193
207
|
this.targetElements = this.getTargetElements();
|
|
208
|
+
// Defines the dimensions
|
|
194
209
|
this.targetElements["normal-scroll-buttons-container"].style.width = `${this.targetElements["table-container"].clientWidth}px`;
|
|
195
210
|
this.targetElements["normal-scroll-buttons-container"].style.height = `${this.targetElements["table-header"].clientHeight}px`;
|
|
196
211
|
this.targetElements["sticky-scroll-buttons-container"].style.width = `${this.targetElements["table-container"].clientWidth}px`;
|
|
197
212
|
this.targetElements["sticky-scroll-buttons-container"].style.height = `${this.targetElements["table-header"].clientHeight}px`;
|
|
213
|
+
// For desktop screens, scroll buttons are positioned after the first column of the table
|
|
198
214
|
if (this.targetElements["desktop-header-first-cell"]) {
|
|
199
215
|
this.targetElements["normal-scroll-buttons-container"].style.width = `${this.targetElements["normal-scroll-buttons-container"].getBoundingClientRect().width - this.desktopHeaderFirstCellWidth}px`;
|
|
200
216
|
this.targetElements["sticky-scroll-buttons-container"].style.width = `${this.targetElements["sticky-scroll-buttons-container"].getBoundingClientRect().width - this.desktopHeaderFirstCellWidth}px`;
|
|
201
217
|
}
|
|
218
|
+
// Controlling the visibility of the previous scroll buttons, of the sticky and normal headers, based on whether table can scroll further to the left or not
|
|
202
219
|
if (this.targetElements["table-container"].scrollLeft === 0) {
|
|
203
220
|
this.targetElements["normal-previous-scroll-button"].style.visibility = 'hidden';
|
|
204
221
|
if (this.targetElements["sticky-header-container"].style.visibility === 'visible') {
|
|
@@ -211,6 +228,7 @@ export class PtcPricingTable {
|
|
|
211
228
|
this.targetElements["sticky-previous-scroll-button"].style.visibility = 'visible';
|
|
212
229
|
}
|
|
213
230
|
}
|
|
231
|
+
// Managing the visibility of the next scroll buttons in both the sticky and normal headers, depending on whether the table can be scrolled further to the right or not
|
|
214
232
|
if (this.targetElements["table-container"].getBoundingClientRect().width >= this.targetElements["table"].getBoundingClientRect().width) {
|
|
215
233
|
this.targetElements["normal-next-scroll-button"].style.visibility = 'hidden';
|
|
216
234
|
if (this.targetElements["sticky-header-container"].style.visibility === 'visible') {
|
|
@@ -224,12 +242,23 @@ export class PtcPricingTable {
|
|
|
224
242
|
}
|
|
225
243
|
}
|
|
226
244
|
}
|
|
245
|
+
// Configures the sticky header based on the dimensions of the table header
|
|
227
246
|
configureStickyHeader() {
|
|
228
247
|
var _a, _b, _c, _d, _e, _f;
|
|
229
248
|
const targetElements = this.getTargetElements();
|
|
230
|
-
//
|
|
249
|
+
// Expanding the content clipper by an additional 10px on each side to accommodate the table's box-shadow
|
|
231
250
|
targetElements["vertical-scroll-content-clipper"].style.width = `${targetElements["table-container"].clientWidth + 20}px`;
|
|
251
|
+
// Aligns the background color of the element with the body's background color
|
|
252
|
+
const bodyBackgroundColor = window.getComputedStyle(document.body, null).getPropertyValue('background-color');
|
|
253
|
+
if (bodyBackgroundColor === ("rgba(0, 0, 0, 0)" || "transparent" || "white")) {
|
|
254
|
+
targetElements["vertical-scroll-content-clipper"].style.backgroundColor = "white";
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
targetElements["vertical-scroll-content-clipper"].style.backgroundColor = bodyBackgroundColor;
|
|
258
|
+
}
|
|
259
|
+
// Establishing the width of the sticky header to be in line with the table's width
|
|
232
260
|
targetElements["sticky-header-container"].style.width = `${targetElements["table-container"].clientWidth}px`;
|
|
261
|
+
// Adjusts the table's sticky behavior, making it adhere at varying positions below the top, contingent on factors like the device type (mobile or desktop) and the presence of a subnav in the page
|
|
233
262
|
if (this.pageWithSubnav) {
|
|
234
263
|
if (window.innerWidth >= 1200) {
|
|
235
264
|
this.scrollTopClipperHeight = this.scrollTopClipperHeightOptions.withSubNav.desktop;
|
|
@@ -248,6 +277,7 @@ export class PtcPricingTable {
|
|
|
248
277
|
}
|
|
249
278
|
targetElements["vertical-scroll-content-clipper"].style.height = this.scrollTopClipperHeight;
|
|
250
279
|
targetElements["sticky-header-container"].style.top = this.scrollTopClipperHeight;
|
|
280
|
+
// Align the widths of sticky header cells with those of the normal header cells
|
|
251
281
|
for (let i = 0; i < targetElements["table-header-cells"].length; i++) {
|
|
252
282
|
targetElements["sticky-header-cells"][i].style.width = `${targetElements["table-header-cells"][i].getBoundingClientRect().width}px`;
|
|
253
283
|
if (targetElements["table-header-cells"][i].classList.contains('desktop-header-first-cell')) {
|
|
@@ -275,7 +305,7 @@ export class PtcPricingTable {
|
|
|
275
305
|
this.targetElements = this.getTargetElements();
|
|
276
306
|
this.targetElements["table-filler-sticky-header-cell"].style.width = this.targetElements["table-filler-header-cell"].getBoundingClientRect().width;
|
|
277
307
|
if (this.targetElements['table'].getBoundingClientRect().width < this.targetElements['table-container'].getBoundingClientRect().width) {
|
|
278
|
-
//
|
|
308
|
+
// If the table is smaller than the container, insert fillers
|
|
279
309
|
this.targetElements["table-filler-sticky-header-cell"].style.display = 'table-cell';
|
|
280
310
|
this.targetElements["table-filler-header-cell"].style.display = 'table-cell';
|
|
281
311
|
for (let i = 0; i < this.dataRows; i++) {
|
|
@@ -287,7 +317,7 @@ export class PtcPricingTable {
|
|
|
287
317
|
this.mobileHeaderRowColSpan = this.dataCols + 1;
|
|
288
318
|
}
|
|
289
319
|
else {
|
|
290
|
-
//
|
|
320
|
+
// If the table is equal to or larger than the container, remove fillers
|
|
291
321
|
this.targetElements["table-filler-sticky-header-cell"].style.width = '99%';
|
|
292
322
|
if (getComputedStyle(this.targetElements["sticky-next-scroll-button"]).visibility === 'hidden') {
|
|
293
323
|
for (let i = 0; i < this.targetElements["sticky-header-cells"].length + 1; i++) {
|
|
@@ -302,8 +332,27 @@ export class PtcPricingTable {
|
|
|
302
332
|
var _a;
|
|
303
333
|
this.targetElements["table-container"].scrollLeft = (_a = this.targetElements["sticky-header-container"]) === null || _a === void 0 ? void 0 : _a.scrollLeft;
|
|
304
334
|
}
|
|
335
|
+
handleScrollForwardHover() {
|
|
336
|
+
if (this.targetElements["normal-next-scroll-button"].getAttribute("data-clicked") !== "true") {
|
|
337
|
+
document.body.style.cursor = 'pointer';
|
|
338
|
+
this.targetElements["normal-next-scroll-button-text"].style.display = "block";
|
|
339
|
+
this.targetElements["sticky-next-scroll-button-text"].style.display = "block";
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
handleScrollForwardHoverOut() {
|
|
343
|
+
if (this.targetElements["normal-next-scroll-button"].getAttribute("data-clicked") !== "true") {
|
|
344
|
+
document.body.style.cursor = 'auto';
|
|
345
|
+
this.targetElements["normal-next-scroll-button-text"].style.display = "none";
|
|
346
|
+
this.targetElements["sticky-next-scroll-button-text"].style.display = "none";
|
|
347
|
+
}
|
|
348
|
+
}
|
|
305
349
|
handleScrollForward() {
|
|
306
350
|
this.targetElements = this.getTargetElements();
|
|
351
|
+
// Display the "See more" text when clicked
|
|
352
|
+
document.body.style.cursor = 'pointer';
|
|
353
|
+
this.targetElements["normal-next-scroll-button"].setAttribute("data-clicked", "true");
|
|
354
|
+
this.targetElements["normal-next-scroll-button-text"].style.display = "block";
|
|
355
|
+
this.targetElements["sticky-next-scroll-button-text"].style.display = "block";
|
|
307
356
|
let scrollAdded = 0;
|
|
308
357
|
let intervalId = setInterval(() => {
|
|
309
358
|
scrollAdded += this.scrollAmount;
|
|
@@ -311,12 +360,38 @@ export class PtcPricingTable {
|
|
|
311
360
|
let tableRight = this.targetElements["table"].getBoundingClientRect().right;
|
|
312
361
|
if ((scrollAdded == this.scrollLimit) || (tableContainerRight >= tableRight)) {
|
|
313
362
|
clearInterval(intervalId);
|
|
363
|
+
this.targetElements["normal-next-scroll-button"].setAttribute("data-clicked", "false");
|
|
364
|
+
// Remove the "See more" text if the mouse is not hovering over the button after scrolling
|
|
365
|
+
if (!this.targetElements["normal-next-scroll-button"].matches(':hover') && !this.targetElements["sticky-next-scroll-button"].matches(':hover')) {
|
|
366
|
+
document.body.style.cursor = 'auto';
|
|
367
|
+
this.targetElements["normal-next-scroll-button-text"].style.display = "none";
|
|
368
|
+
this.targetElements["sticky-next-scroll-button-text"].style.display = "none";
|
|
369
|
+
}
|
|
314
370
|
}
|
|
315
371
|
this.targetElements["table-container"].scrollLeft += scrollAdded;
|
|
316
372
|
}, this.scrollTimeInterval);
|
|
317
373
|
}
|
|
374
|
+
handleScrollBackwardHover() {
|
|
375
|
+
document.body.style.cursor = 'pointer';
|
|
376
|
+
if (this.targetElements["normal-previous-scroll-button"].getAttribute("data-clicked") !== "true") {
|
|
377
|
+
this.targetElements["normal-previous-scroll-button-text"].style.display = "block";
|
|
378
|
+
this.targetElements["sticky-previous-scroll-button-text"].style.display = "block";
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
handleScrollBackwardHoverOut() {
|
|
382
|
+
document.body.style.cursor = 'auto';
|
|
383
|
+
if (this.targetElements["normal-previous-scroll-button"].getAttribute("data-clicked") !== "true") {
|
|
384
|
+
this.targetElements["normal-previous-scroll-button-text"].style.display = "none";
|
|
385
|
+
this.targetElements["sticky-previous-scroll-button-text"].style.display = "none";
|
|
386
|
+
}
|
|
387
|
+
}
|
|
318
388
|
handleScrollBackward() {
|
|
319
389
|
this.targetElements = this.getTargetElements();
|
|
390
|
+
// Display the "See more" text when clicked
|
|
391
|
+
document.body.style.cursor = 'pointer';
|
|
392
|
+
this.targetElements["normal-previous-scroll-button"].setAttribute("data-clicked", "true");
|
|
393
|
+
this.targetElements["normal-previous-scroll-button-text"].style.display = "block";
|
|
394
|
+
this.targetElements["sticky-previous-scroll-button-text"].style.display = "block";
|
|
320
395
|
let scrollReduced = 0;
|
|
321
396
|
let intervalId = setInterval(() => {
|
|
322
397
|
scrollReduced += this.scrollAmount;
|
|
@@ -324,6 +399,14 @@ export class PtcPricingTable {
|
|
|
324
399
|
let tableLeft = this.targetElements["table"].getBoundingClientRect().left;
|
|
325
400
|
if ((scrollReduced == this.scrollLimit) || (tableContainerLeft <= tableLeft)) {
|
|
326
401
|
clearInterval(intervalId);
|
|
402
|
+
this.targetElements["normal-previous-scroll-button"].setAttribute("data-clicked", "false");
|
|
403
|
+
// Remove the "See more" text if the mouse is not hovering over the button after scrolling
|
|
404
|
+
if (!this.targetElements["normal-previous-scroll-button"].matches(':hover') && !this.targetElements["sticky-previous-scroll-button"].matches(':hover')) {
|
|
405
|
+
document.body.style.cursor = 'auto';
|
|
406
|
+
this.targetElements["normal-previous-scroll-button-text"].style.display = "none";
|
|
407
|
+
this.targetElements["sticky-previous-scroll-button-text"].style.display = "none";
|
|
408
|
+
}
|
|
409
|
+
return;
|
|
327
410
|
}
|
|
328
411
|
this.targetElements["table-container"].scrollLeft -= scrollReduced;
|
|
329
412
|
}, this.scrollTimeInterval);
|
|
@@ -386,7 +469,7 @@ export class PtcPricingTable {
|
|
|
386
469
|
return (this.tableDescription && h(Fragment, null, h("div", { class: "table-descriptor" }, h("ptc-para", { "font-size": "small", "font-weight": "w-4", "para-align": "center", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, (this.tableDescription.length <= 500) ? this.tableDescription : h("ptc-readmore", { "more-text": "See more" }, this.tableDescription)))));
|
|
387
470
|
};
|
|
388
471
|
const getScrollButtonsContainer = () => {
|
|
389
|
-
return h("div", { class: "scroll-buttons-container" }, h("div", { class: "scroll-buttons prev-button", onClick: () => this.handleScrollBackward() }, h("icon-asset", { type: "solid", size: "medium", name: "chevron-left", color: "primary-gray" }), h("ptc-para", { "font-size": "small", "font-weight": "w-6", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, "See More")), h("div", { class: "scroll-buttons next-button", onClick: () => this.handleScrollForward() }, h("ptc-para", { "font-size": "small", "font-weight": "w-6", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, "See More"), h("icon-asset", { type: "solid", size: "medium", name: "chevron-right", color: "primary-gray" })));
|
|
472
|
+
return h("div", { class: "scroll-buttons-container" }, h("div", { class: "scroll-buttons prev-button", "data-clicked": "false", onClick: () => this.handleScrollBackward(), onMouseOver: () => this.handleScrollBackwardHover(), onMouseOut: () => this.handleScrollBackwardHoverOut() }, h("icon-asset", { type: "solid", size: "medium", name: "chevron-left", color: "primary-gray" }), h("ptc-para", { "font-size": "small", "font-weight": "w-6", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, "See More")), h("div", { class: "scroll-buttons next-button", "data-clicked": "false", onClick: () => this.handleScrollForward(), onMouseOver: () => this.handleScrollForwardHover(), onMouseOut: () => this.handleScrollForwardHoverOut() }, h("ptc-para", { "font-size": "small", "font-weight": "w-6", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, "See More"), h("icon-asset", { type: "solid", size: "medium", name: "chevron-right", color: "primary-gray" })));
|
|
390
473
|
};
|
|
391
474
|
const getTableHeader = (headerType) => {
|
|
392
475
|
return h("thead", null, h("tr", null, h("th", { class: "desktop-header-first-cell" }, h("ptc-para", { "font-size": "medium", "font-weight": "w-7", "para-align": "left", "para-color": "white", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, "Package Options")), ([...Array(this.dataCols).keys()]).map(col => {
|
|
@@ -418,7 +501,7 @@ export class PtcPricingTable {
|
|
|
418
501
|
return h(Fragment, null, h("ptc-para", { "font-size": "xx-small", "font-weight": "w-6", "para-align": "center", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, disclaimer), (ind != (this.disclaimerCount - 1)) ? h("ptc-spacer", { size: "xx-small" }) : null);
|
|
419
502
|
})));
|
|
420
503
|
};
|
|
421
|
-
return (h(Host, null, h("div", { id: "vertical-scroll-content-clipper" }), h("div", { id: "sticky-header-container", onScroll: () => this.handleStickyHeaderHorizontalScroll() }, getScrollButtonsContainer(), getTableHeader("sticky")), h("ptc-spacer", { breakpoint: "small", size: "xxx-large" }), h("ptc-spacer", { breakpoint: "x-small", size: "xxxx-large" }), getTableTitle(), getTableSubTitle(), getTableDescription(), h("ptc-spacer", { breakpoint: "small", size: "xx-large" }), h("ptc-spacer", { breakpoint: "small", size: "xx-small" }), h("ptc-spacer", { breakpoint: "x-small", size: "xxx-large" }), h("ptc-spacer", { breakpoint: "x-small", size: "xx-small" }), h("div", { id: "table-container", onScroll: () => this.handleHorizontalScroll() }, getScrollButtonsContainer(), h("table", null, h("div", { id: "horizontal-scroll-box-shadow" }), getTableHeader("normal"), (window.innerWidth >=
|
|
504
|
+
return (h(Host, null, h("div", { id: "vertical-scroll-content-clipper" }), h("div", { id: "sticky-header-container", onScroll: () => this.handleStickyHeaderHorizontalScroll() }, getScrollButtonsContainer(), getTableHeader("sticky")), h("ptc-spacer", { breakpoint: "small", size: "xxx-large" }), h("ptc-spacer", { breakpoint: "x-small", size: "xxxx-large" }), getTableTitle(), getTableSubTitle(), getTableDescription(), h("ptc-spacer", { breakpoint: "small", size: "xx-large" }), h("ptc-spacer", { breakpoint: "small", size: "xx-small" }), h("ptc-spacer", { breakpoint: "x-small", size: "xxx-large" }), h("ptc-spacer", { breakpoint: "x-small", size: "xx-small" }), h("div", { id: "table-container", onScroll: () => this.handleHorizontalScroll() }, getScrollButtonsContainer(), h("table", null, h("div", { id: "horizontal-scroll-box-shadow" }), getTableHeader("normal"), (window.innerWidth >= 992)
|
|
422
505
|
? getDesktopTableBody()
|
|
423
506
|
: getMobileTableBody())), getDisclaimers(), h("ptc-spacer", { breakpoint: "small", size: "xxx-large" }), h("ptc-spacer", { breakpoint: "x-small", size: "xxxx-large" })));
|
|
424
507
|
}
|