liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { LightningElement, api, track } from "lwc";
 
const CSS_CLASS = "modal-hidden";
 
export default class Modal extends LightningElement {
  @track showModal = false;
  @api objName;
  @api
  set header(value) {
    this.hasHeaderString = value !== "";
    this._headerPrivate = value;
  }
  get header() {
    return this._headerPrivate;
  }
 
  @track hasHeaderString = false;
  _headerPrivate;
 
  @api show() {
    this.showModal = true;
    console.log('show!!!!!!!!');
    console.log(this.objName);
  }
 
  @api hide() {
    this.showModal = false;
  }
 
  handleDialogClose() {
    //Let parent know that dialog is closed (mainly by that cross button) so it can set proper variables if needed
    const closedialog = new CustomEvent("closedialog");
    this.dispatchEvent(closedialog);
    this.hide();
  }
 
  handleSlotTaglineChange() {
    const taglineEl = this.template.querySelector("p");
    if (taglineEl && taglineEl.classList) taglineEl.classList.remove(CSS_CLASS);
  }
 
  handleSlotFooterChange() {
    const footerEl = this.template.querySelector("footer");
    if (footerEl && footerEl.classList) footerEl.classList.remove(CSS_CLASS);
  }
}