Skip to content

pantoken-root / renderers/web-components/src / modal

Փոփոխական: modal ​

const modal: ElementDefinition

Ալֆա

&lt;instui-modal&gt; — իրական &lt;dialog&gt;, այնպես որ այն ստանում է կենտրոնացման ընդգծում, Escape-ից-փակել, և ::backdrop անվճար։ open հատկանիշը գործարկում է showModal()/close(); բնիկ հրաժարում (Escape կամ backdrop սեղմում) արտացոլվում է հետ հատկանիշին և վերախաղարկվում է որպես փուչ close իրադարձություն։ Վարվում է թեղ DOM-ից Invoker Commands-ի միջոցով. <button command="--show|--close|--toggle" commandfor="modal-id">-ը միացնում է այն id-ով։ Բովանդակությունը փոխանցվում է կանխադրված slot-ի մեջ։

Օրինակ ​

html
<button command="--show" commandfor="confirm">Ջնջել…</button>
<instui-modal id="confirm">
  <h2>Այս տարրը ջնջե՞լ?</h2>
  <button command="--close" commandfor="confirm">Չեղարկել</button>
</instui-modal>