Skip to content

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

متغير: modal ​

const modal: ElementDefinition

Alpha

&lt;instui-modal&gt; — عنصر &lt;dialog&gt; حقيقي، لذا يحصل على حجز التركيز، والإغلاق بواسطة مفتاح Escape، و ::backdrop مجانا. السمة open تتحكم في showModal()/close(); الإغلاق الأصلي (مفتاح Escape أو النقر على الخلفية) ينعكس على السمة ويُعيد إطلاق حدث close قابل للانتشار. قابل للتحكم من DOM الخفيف عبر أوامر Invoker — يقوم <button command="--show|--close|--toggle" commandfor="modal-id"> بتبديله بحسب المعرف. يوضع المحتوى في الفتحة الافتراضية.

Example ​

html
<button command="--show" commandfor="confirm">حذف…</button>
<instui-modal id="confirm">
  <h2>حذف هذا العنصر؟</h2>
  <button command="--close" commandfor="confirm">إلغاء</button>
</instui-modal>