Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ModalSurvey

Class builds a modal with iframe, providing multiple configuration options. All styles and class names used by the library can be easily overwritten, by passing new values in the configuration object.

Modal structure

The structure of the modal can be described as follows:

<div class="hello-customer-modal">
  <div class="hello-customer-modal__window">
     <div class="hello-customer-modal__bar">
         <div class="hello-customer-modal__close-button">
             ICON
         </div>
     </div>
     <iframe class="hello-customer-survey__survey"></iframe>
  </div>
</div>

Provided class names are the once defined by the library itself by default, and can be overwritten using classNames property of the configuration object.

In order to modify styles attached to the modal elements using aforementioned class names, You can use modalStyle property of the configuration object,

Example (es module)

import { UrlBuilder, InlineSurvey } from '@hello-customer/website-touchpoint'
const urlBuilder = new UrlBuilder({
  baseUrl: 'https://base.com',
  language: 'EN',
  tenantId: 'xxxx',
  touchPointId: 'zzz',
  extra: {
    isPreview: true
  }
});
const modalSurvey = new ModalSurvey(urlBuilder, {});

Example (script tag)

<script src="https://unpkg.com/@hello-customer/website-touchpoint"></script>
<script>
const urlBuilder = new hcWebsiteTouchpoint.UrlBuilder({
    baseUrl: 'https://base.com',
    tenantId: 'xxxx',
    touchPointId: 'zzz',
    language: 'EN',
    extra: {
      isPreview: true
    }
   });
const modalSurvey = new  hcWebsiteTouchpoint.ModalSurvey(urlBuilder, {});
</script>

Hierarchy

  • ModalSurvey

Index

Constructors

constructor

Properties

Private Readonly iFrameHandle

iFrameHandle: HTMLIFrameElement

Private modalConfig

modalConfig: ModalSurveyConfig

Private Readonly modalHandle

modalHandle: HTMLDivElement

Private Readonly quarantineService

quarantineService: QuarantineService

Private Readonly urlFactory

urlFactory: UrlFactory

Private Readonly validator

Accessors

iFrame

  • get iFrame(): HTMLIFrameElement

modalContainer

  • get modalContainer(): HTMLDivElement

Methods

close

  • close(): void

Private createModal

  • createModal(): [HTMLDivElement, HTMLIFrameElement]

Private getClassNames

Private getModalStyle

Private initModalClasses

  • initModalClasses(): void

reload

  • reload(): void

show

  • show(): void

Generated using TypeDoc