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
47
<template>
    <template if:true={showModal}>
      <section
        role="dialog"
        tabindex="-1"
        aria-labelledby="modal-heading-01"
        aria-modal="true"
        aria-describedby="modal-content-id-1"
        class="slds-modal slds-fade-in-open"
      >
        <div class="slds-modal__container">
          <header class="slds-modal__header">
            <lightning-button-icon
              class="slds-modal__close"
              title="Close"
              icon-name="utility:close"
              icon-class="slds-button_icon-inverse"
              onclick={handleDialogClose}
            ></lightning-button-icon>
  
            <template if:true={hasHeaderString}>
              <h2 class="slds-text-heading_medium slds-hyphenate header-string">
                {header}
              </h2>
            </template>
            <template if:false={hasHeaderString}>
              <h2 class="slds-text-heading_medium slds-hyphenate header-slot">
                <slot name="header"></slot>
              </h2>
            </template>
  
            <p class="slds-m-top_x-small modal-hidden">
              <slot name="tagline" onslotchange={handleSlotTaglineChange}></slot>
            </p>
          </header>
          <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
            <slot></slot>
          </div>
  
          <footer class="slds-modal__footer modal-hidden">
            <slot name="footer" onslotchange={handleSlotFooterChange}></slot>
          </footer>
        </div>
      </section>
      <div class="slds-backdrop slds-backdrop_open"></div>
    </template>
  </template>