@meetelise/chat 1.20.64 → 1.20.65
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/package.json +1 -1
- package/public/demo/index.html +1 -1
- package/public/dist/index.js +419 -493
- package/src/MEChat.ts +1 -1
- package/src/WebComponent/actions/minimize-expand-button.ts +92 -0
- package/src/WebComponent/launcher/Launcher.ts +103 -152
- package/src/WebComponent/launcher/mobile-launcher.ts +95 -0
- package/src/WebComponent/launcher/typeEmojiStyles.ts +6 -146
- package/src/WebComponent/launcher/typeMobileStyles.ts +0 -1
- package/src/WebComponent/me-chat.ts +106 -39
- package/src/fetchWebchatPreferences.ts +28 -0
- package/src/themes.ts +5 -2
- package/src/utils.ts +18 -2
package/src/MEChat.ts
CHANGED
|
@@ -126,7 +126,7 @@ export default class MEChat {
|
|
|
126
126
|
}
|
|
127
127
|
this.remove();
|
|
128
128
|
const url = window.location.href;
|
|
129
|
-
const requestUrl = `https://app.meetelise.com/
|
|
129
|
+
const requestUrl = `https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(
|
|
130
130
|
url
|
|
131
131
|
)}`;
|
|
132
132
|
const buildingSlug = await axios.get<string | null>(requestUrl, {
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { css, html, LitElement, TemplateResult } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
4
|
+
import { XWhiteOutlineIcon, ChevronIconWhite } from "../../svgIcons";
|
|
5
|
+
import { defaultBrandColor } from "../../themes";
|
|
6
|
+
|
|
7
|
+
@customElement("minimize-expand-button")
|
|
8
|
+
export class MinimizeExpandButton extends LitElement {
|
|
9
|
+
static styles = [
|
|
10
|
+
css`
|
|
11
|
+
.button-container {
|
|
12
|
+
width: 56px;
|
|
13
|
+
height: 56px;
|
|
14
|
+
|
|
15
|
+
background: #ffffff;
|
|
16
|
+
border: 1px solid rgba(95, 95, 95, 0.2);
|
|
17
|
+
border-radius: 1000px;
|
|
18
|
+
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
}
|
|
23
|
+
.mini {
|
|
24
|
+
width: 36px;
|
|
25
|
+
height: 36px;
|
|
26
|
+
}
|
|
27
|
+
.inner-container {
|
|
28
|
+
width: 46px;
|
|
29
|
+
height: 46px;
|
|
30
|
+
|
|
31
|
+
border-radius: 1000px;
|
|
32
|
+
border: 1px solid rgba(255, 255, 255, 0.7);
|
|
33
|
+
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
text-align: center;
|
|
38
|
+
}
|
|
39
|
+
.mini > .inner-container {
|
|
40
|
+
width: 30px;
|
|
41
|
+
height: 30px;
|
|
42
|
+
}
|
|
43
|
+
.x-icon,
|
|
44
|
+
.chevron-up {
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
border-radius: 1000px;
|
|
51
|
+
}
|
|
52
|
+
.chevron-up {
|
|
53
|
+
transform: rotate(-90deg);
|
|
54
|
+
}
|
|
55
|
+
.button-container:hover {
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
filter: brightness(90%);
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
@property({ attribute: true })
|
|
63
|
+
onClick: () => void = () => {
|
|
64
|
+
return;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
@property({ attribute: true })
|
|
68
|
+
brandColor: string = defaultBrandColor;
|
|
69
|
+
|
|
70
|
+
@property({ attribute: true })
|
|
71
|
+
toExpand = false;
|
|
72
|
+
|
|
73
|
+
render(): TemplateResult {
|
|
74
|
+
return html`
|
|
75
|
+
<div
|
|
76
|
+
class=${this.toExpand ? "button-container mini" : "button-container"}
|
|
77
|
+
@click=${this.onClick}
|
|
78
|
+
>
|
|
79
|
+
<div
|
|
80
|
+
class="inner-container"
|
|
81
|
+
style=${styleMap({
|
|
82
|
+
background: this.brandColor,
|
|
83
|
+
})}
|
|
84
|
+
>
|
|
85
|
+
${this.toExpand
|
|
86
|
+
? html`<div class="chevron-up">${ChevronIconWhite}</div>`
|
|
87
|
+
: html` <div class="x-icon">${XWhiteOutlineIcon}</div>`}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -3,7 +3,6 @@ import { customElement, property, state } from "lit/decorators.js";
|
|
|
3
3
|
import { createRef, ref, Ref } from "lit/directives/ref.js";
|
|
4
4
|
import { launcherStyles } from "./launcherStyles";
|
|
5
5
|
import { typeEmojiStyles } from "./typeEmojiStyles";
|
|
6
|
-
import { typeMobileStyles } from "./typeMobileStyles";
|
|
7
6
|
import { typeMiniStyles } from "./typeMiniStyles";
|
|
8
7
|
import {
|
|
9
8
|
EmailUsWindow,
|
|
@@ -25,24 +24,23 @@ import {
|
|
|
25
24
|
HeyThereEmoji,
|
|
26
25
|
ChevronIconBlack,
|
|
27
26
|
ChevronIconWhite,
|
|
28
|
-
XWhiteOutlineIcon,
|
|
29
|
-
ChatBlackOutlineIcon,
|
|
30
27
|
} from "../../svgIcons";
|
|
31
28
|
import { defaultBrandColor } from "../../themes";
|
|
29
|
+
import { hexToAlmostWhite } from "../../utils";
|
|
30
|
+
import "./mobile-launcher";
|
|
32
31
|
|
|
33
32
|
@customElement("meetelise-launcher")
|
|
34
33
|
export class Launcher extends LitElement {
|
|
35
34
|
static styles = css`
|
|
36
35
|
${launcherStyles}
|
|
37
36
|
${typeEmojiStyles}
|
|
38
|
-
${typeMobileStyles}
|
|
39
37
|
${typeMiniStyles}
|
|
40
38
|
`;
|
|
41
39
|
|
|
42
40
|
@property({ type: Boolean })
|
|
43
41
|
isMobile = false;
|
|
44
42
|
|
|
45
|
-
@property({
|
|
43
|
+
@property({ attribute: true })
|
|
46
44
|
isMinimized = false;
|
|
47
45
|
|
|
48
46
|
@property({ type: Boolean })
|
|
@@ -106,11 +104,16 @@ export class Launcher extends LitElement {
|
|
|
106
104
|
return;
|
|
107
105
|
};
|
|
108
106
|
|
|
107
|
+
@property({ attribute: true })
|
|
108
|
+
onClickMinimize: (e: MouseEvent) => void = () => {
|
|
109
|
+
return;
|
|
110
|
+
};
|
|
111
|
+
|
|
109
112
|
@property({ attribute: false })
|
|
110
113
|
launcherStyles: StyleInfo = {};
|
|
111
114
|
|
|
112
115
|
@property({ attribute: true })
|
|
113
|
-
brandColor: string
|
|
116
|
+
brandColor: string = defaultBrandColor;
|
|
114
117
|
|
|
115
118
|
@state()
|
|
116
119
|
isEmailWindowOpen = false;
|
|
@@ -252,12 +255,6 @@ export class Launcher extends LitElement {
|
|
|
252
255
|
this.isTextUsWindowOpen = false;
|
|
253
256
|
};
|
|
254
257
|
|
|
255
|
-
onClickMinimize = (e: MouseEvent): void => {
|
|
256
|
-
e.preventDefault();
|
|
257
|
-
e.stopPropagation();
|
|
258
|
-
this.isMinimized = !this.isMinimized;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
258
|
renderTextUsOption = (): TemplateResult => {
|
|
262
259
|
return html`
|
|
263
260
|
<div
|
|
@@ -319,39 +316,15 @@ export class Launcher extends LitElement {
|
|
|
319
316
|
|
|
320
317
|
renderActionPills = (): TemplateResult => {
|
|
321
318
|
if (this.isMobile || this.isMinimized) {
|
|
322
|
-
return html
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
</button>`}
|
|
332
|
-
<ul>
|
|
333
|
-
<li @click=${this.onClickEmailOption} class="typeMobile-bttn">
|
|
334
|
-
<div class="typeMobile-inner">
|
|
335
|
-
<div class="typeMobile-icon">${EmailBlackOutlineIcon}</div>
|
|
336
|
-
</div>
|
|
337
|
-
</li>
|
|
338
|
-
<li @click=${this.onClickPhoneOption} class="typeMobile-bttn">
|
|
339
|
-
<div class="typeMobile-inner">
|
|
340
|
-
<div class="typeMobile-icon">${PhoneBlackOutlineIcon}</div>
|
|
341
|
-
</div>
|
|
342
|
-
</li>
|
|
343
|
-
<li @click=${this.onClickSSTOption} class="typeMobile-bttn">
|
|
344
|
-
<div class="typeMobile-inner">
|
|
345
|
-
<div class="typeMobile-icon">${BookTourBlackOutlineIcon}</div>
|
|
346
|
-
</div>
|
|
347
|
-
</li>
|
|
348
|
-
<li @click=${this.onChatTapped} class="typeMobile-bttn">
|
|
349
|
-
<div class="typeMobile-inner">
|
|
350
|
-
<div class="typeMobile-icon">${ChatBlackOutlineIcon}</div>
|
|
351
|
-
</div>
|
|
352
|
-
</li>
|
|
353
|
-
</ul>
|
|
354
|
-
</div>`;
|
|
319
|
+
return html` <mobile-launcher
|
|
320
|
+
.onClickMinimize=${this.onClickMinimize}
|
|
321
|
+
.onClickEmailOption=${this.onClickEmailOption}
|
|
322
|
+
.onClickPhoneOption=${this.onClickPhoneOption}
|
|
323
|
+
.onClickSSTOption=${this.onClickSSTOption}
|
|
324
|
+
.onChatTapped=${this.onChatTapped}
|
|
325
|
+
.isMobile=${this.isMobile}
|
|
326
|
+
.brandColor=${this.brandColor}
|
|
327
|
+
></mobile-launcher>`;
|
|
355
328
|
}
|
|
356
329
|
|
|
357
330
|
if (this.buildingABTestType === abTestTypes.ConceptEmoji) {
|
|
@@ -359,21 +332,17 @@ export class Launcher extends LitElement {
|
|
|
359
332
|
<div
|
|
360
333
|
class="type-hey__list"
|
|
361
334
|
style=${styleMap({
|
|
362
|
-
background: this.brandColor
|
|
335
|
+
background: this.brandColor,
|
|
363
336
|
})}
|
|
364
337
|
>
|
|
365
|
-
<div class="type-hey__chat-container"
|
|
366
|
-
<
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
})}
|
|
371
|
-
>
|
|
372
|
-
<div class="type-hey__chat-icon">${XWhiteOutlineIcon}</div>
|
|
373
|
-
</div>
|
|
338
|
+
<div class="type-hey__chat-container">
|
|
339
|
+
<minimize-expand-button
|
|
340
|
+
.brandColor=${this.brandColor}
|
|
341
|
+
.onClick=${this.onClickMinimize}
|
|
342
|
+
></minimize-expand-button>
|
|
374
343
|
</div>
|
|
375
344
|
|
|
376
|
-
<div class="type-hey__top-section"
|
|
345
|
+
<div class="type-hey__top-section">
|
|
377
346
|
<div class="type-hey__ai-topic">
|
|
378
347
|
<p>AI Assistant</p>
|
|
379
348
|
<div class="type-hey__ai-topic-notch"></div>
|
|
@@ -384,26 +353,19 @@ export class Launcher extends LitElement {
|
|
|
384
353
|
</div>
|
|
385
354
|
${this.hasChatEnabled
|
|
386
355
|
? html`
|
|
387
|
-
<div
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
<li>our amenities</li>
|
|
399
|
-
<li>our availability</li>
|
|
400
|
-
`;
|
|
401
|
-
})}
|
|
402
|
-
</ul>
|
|
403
|
-
</div>
|
|
404
|
-
</div>
|
|
405
|
-
<div>${ChevronIconWhite}</div>
|
|
356
|
+
<div
|
|
357
|
+
id="type-hey__ask-prompt"
|
|
358
|
+
class="type-hey__pill"
|
|
359
|
+
@click=${this.onChatTapped}
|
|
360
|
+
style=${styleMap({
|
|
361
|
+
background: hexToAlmostWhite(this.brandColor, 0.2),
|
|
362
|
+
})}
|
|
363
|
+
>
|
|
364
|
+
<div class="type-hey__pill-left">
|
|
365
|
+
<div class="type-hey__icon">${ChatWhiteOutlineIcon}</div>
|
|
366
|
+
<div><span class="title-bold">Chat</span> with us</div>
|
|
406
367
|
</div>
|
|
368
|
+
<div class="type-gradient__icon">${ChevronIconWhite}</div>
|
|
407
369
|
</div>
|
|
408
370
|
`
|
|
409
371
|
: ""}
|
|
@@ -477,11 +439,10 @@ export class Launcher extends LitElement {
|
|
|
477
439
|
</button>
|
|
478
440
|
${this.hasChatEnabled
|
|
479
441
|
? html`
|
|
480
|
-
<div id="overlay-inner-pill" class="inner-pill-wrapper"
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
)} @click=${this.onChatTapped}>
|
|
442
|
+
<div id="overlay-inner-pill" class="inner-pill-wrapper"
|
|
443
|
+
style=${styleMap({
|
|
444
|
+
background: this.brandColor,
|
|
445
|
+
})} @click=${this.onChatTapped}>
|
|
485
446
|
<div class="vertical-pill-left">
|
|
486
447
|
<div class="vertical-pill-icon">${ChatWhiteOutlineIcon}</div>
|
|
487
448
|
<div class="vertical-pill-title">
|
|
@@ -546,82 +507,72 @@ export class Launcher extends LitElement {
|
|
|
546
507
|
installCallUsWindow();
|
|
547
508
|
|
|
548
509
|
return html`
|
|
549
|
-
<div
|
|
550
|
-
class=${
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
: "launcher__mini-launcher-wrapper"
|
|
554
|
-
}
|
|
510
|
+
<div
|
|
511
|
+
class=${this.isMobile || this.isMinimized
|
|
512
|
+
? "launcher__mobile-launcher-wrapper"
|
|
513
|
+
: "launcher__mini-launcher-wrapper"}
|
|
555
514
|
style=${styleMap(this.launcherStyles)}
|
|
556
515
|
>
|
|
557
|
-
${
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
516
|
+
${this.isEmailWindowOpen
|
|
517
|
+
? html`<div class="launcher__window-wrapper">
|
|
518
|
+
<email-us-window
|
|
519
|
+
chatId="${this.chatId}"
|
|
520
|
+
.leadSources="${this.leadSources}"
|
|
521
|
+
currentLeadSource="${this.currentLeadSource}"
|
|
522
|
+
orgSlug="${this.orgSlug}"
|
|
523
|
+
buildingSlug="${this.buildingSlug}"
|
|
524
|
+
featureFlagShowDropdown="${this.featureFlagShowDropdown}"
|
|
525
|
+
${ref(this.emailUsWindowRef)}
|
|
526
|
+
.buildingId=${this.buildingId}
|
|
527
|
+
>
|
|
528
|
+
</email-us-window>
|
|
529
|
+
</div>`
|
|
530
|
+
: ""}
|
|
531
|
+
${this.isTextUsWindowOpen
|
|
532
|
+
? html`<div class="launcher__window-wrapper">
|
|
533
|
+
<text-us-window
|
|
534
|
+
orgSlug="${this.orgSlug}"
|
|
535
|
+
buildingSlug="${this.buildingSlug}"
|
|
536
|
+
${ref(this.textUsWindowRef)}
|
|
537
|
+
.buildingId=${this.buildingId}
|
|
538
|
+
currentLeadSource="${this.currentLeadSource}"
|
|
539
|
+
></text-us-window>
|
|
540
|
+
</div>`
|
|
541
|
+
: ""}
|
|
542
|
+
${this.isSSTWindowOpen
|
|
543
|
+
? html`<div class="launcher__window-wrapper">
|
|
544
|
+
<tour-scheduler
|
|
545
|
+
chatId="${this.chatId}"
|
|
546
|
+
orgSlug="${this.orgSlug}"
|
|
547
|
+
buildingSlug="${this.buildingSlug}"
|
|
548
|
+
sgtUrl="${this.sgtUrl}"
|
|
549
|
+
escortedToursLink="${this.escortedToursLink}"
|
|
550
|
+
virtualToursLink="${this.virtualToursLink}"
|
|
551
|
+
currentLeadSource="${this.currentLeadSource}"
|
|
552
|
+
.leadSources="${this.leadSources}"
|
|
553
|
+
.layoutOptions=${this.layoutOptions}
|
|
554
|
+
.unitOptions=${this.unitOptions}
|
|
555
|
+
.tourTypeOptions=${this.tourTypeOptions}
|
|
556
|
+
buildingId=${this.buildingId}
|
|
557
|
+
featureFlagShowDropdown="${this.featureFlagShowDropdown}"
|
|
558
|
+
${ref(this.tourSchedulerRef)}
|
|
559
|
+
></tour-scheduler>
|
|
560
|
+
</div>`
|
|
561
|
+
: ""}
|
|
562
|
+
${this.isCallUsWindowOpen
|
|
563
|
+
? html`
|
|
564
|
+
<div class="launcher__window-wrapper">
|
|
565
|
+
<call-us-window
|
|
566
|
+
.onCloseClicked=${this.onClosePhoneWindow}
|
|
567
|
+
phoneNumber="${this.phoneNumber}"
|
|
581
568
|
.buildingId=${this.buildingId}
|
|
569
|
+
chatCallUsHeader="${this.chatCallUsHeader}"
|
|
570
|
+
hasTextUsEnabled=${this.hasTextUsEnabled ? true : ""}
|
|
582
571
|
currentLeadSource="${this.currentLeadSource}"
|
|
583
|
-
></
|
|
584
|
-
</div
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
${
|
|
588
|
-
this.isSSTWindowOpen
|
|
589
|
-
? html`<div class="launcher__window-wrapper">
|
|
590
|
-
<tour-scheduler
|
|
591
|
-
chatId="${this.chatId}"
|
|
592
|
-
orgSlug="${this.orgSlug}"
|
|
593
|
-
buildingSlug="${this.buildingSlug}"
|
|
594
|
-
sgtUrl="${this.sgtUrl}"
|
|
595
|
-
escortedToursLink="${this.escortedToursLink}"
|
|
596
|
-
virtualToursLink="${this.virtualToursLink}"
|
|
597
|
-
currentLeadSource="${this.currentLeadSource}"
|
|
598
|
-
.leadSources="${this.leadSources}"
|
|
599
|
-
.layoutOptions=${this.layoutOptions}
|
|
600
|
-
.unitOptions=${this.unitOptions}
|
|
601
|
-
.tourTypeOptions=${this.tourTypeOptions}
|
|
602
|
-
buildingId=${this.buildingId}
|
|
603
|
-
featureFlagShowDropdown="${this.featureFlagShowDropdown}"
|
|
604
|
-
${ref(this.tourSchedulerRef)}
|
|
605
|
-
></tour-scheduler>
|
|
606
|
-
</div>`
|
|
607
|
-
: ""
|
|
608
|
-
}
|
|
609
|
-
${
|
|
610
|
-
this.isCallUsWindowOpen
|
|
611
|
-
? html`
|
|
612
|
-
<div class="launcher__window-wrapper">
|
|
613
|
-
<call-us-window
|
|
614
|
-
.onCloseClicked=${this.onClosePhoneWindow}
|
|
615
|
-
phoneNumber="${this.phoneNumber}"
|
|
616
|
-
.buildingId=${this.buildingId}
|
|
617
|
-
chatCallUsHeader="${this.chatCallUsHeader}"
|
|
618
|
-
hasTextUsEnabled=${this.hasTextUsEnabled ? true : ""}
|
|
619
|
-
currentLeadSource="${this.currentLeadSource}"
|
|
620
|
-
></call-us-window>
|
|
621
|
-
</div>
|
|
622
|
-
`
|
|
623
|
-
: ""
|
|
624
|
-
}
|
|
572
|
+
></call-us-window>
|
|
573
|
+
</div>
|
|
574
|
+
`
|
|
575
|
+
: ""}
|
|
625
576
|
${!this.isCallToActionWindowOpen() ? this.renderActionPills() : ""}
|
|
626
577
|
</div>
|
|
627
578
|
`;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { html, LitElement, TemplateResult } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { typeMobileStyles } from "./typeMobileStyles";
|
|
4
|
+
import {
|
|
5
|
+
EmailBlackOutlineIcon,
|
|
6
|
+
BookTourBlackOutlineIcon,
|
|
7
|
+
PhoneBlackOutlineIcon,
|
|
8
|
+
ChatBlackOutlineIcon,
|
|
9
|
+
} from "../../svgIcons";
|
|
10
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
11
|
+
import { defaultBrandColor } from "../../themes";
|
|
12
|
+
|
|
13
|
+
@customElement("mobile-launcher")
|
|
14
|
+
export class MobileLauncher extends LitElement {
|
|
15
|
+
static styles = [typeMobileStyles];
|
|
16
|
+
|
|
17
|
+
@property({ attribute: true })
|
|
18
|
+
onClickMinimize: () => void = () => {
|
|
19
|
+
return;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
@property({ attribute: true })
|
|
23
|
+
onClickEmailOption: (e: MouseEvent) => void = () => {
|
|
24
|
+
return;
|
|
25
|
+
};
|
|
26
|
+
@property({ attribute: true })
|
|
27
|
+
onClickPhoneOption: (e: MouseEvent) => void = () => {
|
|
28
|
+
return;
|
|
29
|
+
};
|
|
30
|
+
@property({ attribute: true })
|
|
31
|
+
onClickSSTOption: (e: MouseEvent) => void = () => {
|
|
32
|
+
return;
|
|
33
|
+
};
|
|
34
|
+
@property({ attribute: true })
|
|
35
|
+
onChatTapped: (e: MouseEvent) => void = () => {
|
|
36
|
+
return;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
@property({ attribute: true })
|
|
40
|
+
hideChat = false;
|
|
41
|
+
|
|
42
|
+
@property({ attribute: true })
|
|
43
|
+
isMobile = false;
|
|
44
|
+
|
|
45
|
+
@property({ attribute: true })
|
|
46
|
+
brandColor: string = defaultBrandColor;
|
|
47
|
+
|
|
48
|
+
private renderListElement = (
|
|
49
|
+
onClick: (e: MouseEvent) => void,
|
|
50
|
+
icon: TemplateResult<2> // is an svg icon in lit
|
|
51
|
+
) => {
|
|
52
|
+
return html` <li
|
|
53
|
+
@click=${onClick}
|
|
54
|
+
class="typeMobile-bttn"
|
|
55
|
+
style=${styleMap({
|
|
56
|
+
background: `${this.brandColor}`,
|
|
57
|
+
})}
|
|
58
|
+
>
|
|
59
|
+
<div class="typeMobile-inner">
|
|
60
|
+
<div class="typeMobile-icon">${icon}</div>
|
|
61
|
+
</div>
|
|
62
|
+
</li>`;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
render(): TemplateResult {
|
|
66
|
+
return html`<div class="typeMobile-list">
|
|
67
|
+
<ul>
|
|
68
|
+
${this.renderListElement(
|
|
69
|
+
this.onClickEmailOption,
|
|
70
|
+
EmailBlackOutlineIcon
|
|
71
|
+
)}
|
|
72
|
+
${this.renderListElement(
|
|
73
|
+
this.onClickPhoneOption,
|
|
74
|
+
PhoneBlackOutlineIcon
|
|
75
|
+
)}
|
|
76
|
+
${this.renderListElement(
|
|
77
|
+
this.onClickSSTOption,
|
|
78
|
+
BookTourBlackOutlineIcon
|
|
79
|
+
)}
|
|
80
|
+
${this.hideChat
|
|
81
|
+
? ""
|
|
82
|
+
: this.renderListElement(this.onChatTapped, ChatBlackOutlineIcon)}
|
|
83
|
+
${!this.isMobile && !this.hideChat
|
|
84
|
+
? html`
|
|
85
|
+
<minimize-expand-button
|
|
86
|
+
.onClick=${this.onClickMinimize}
|
|
87
|
+
.brandColor=${this.brandColor}
|
|
88
|
+
.toExpand=${true}
|
|
89
|
+
></minimize-expand-button>
|
|
90
|
+
`
|
|
91
|
+
: ""}
|
|
92
|
+
</ul>
|
|
93
|
+
</div>`;
|
|
94
|
+
}
|
|
95
|
+
}
|