PageSourceSearch

https://nda.nic.in/VAADIN/build/vaadin-dialog-fYSXg8Nk.js

js nda.nic.in collected 2026-09-27 21:40:02 UTC 20,516 bytes, 344 lines download raw bytes

1import{i as u,r as v,ak as w,am as b,al as C,p as f,d as m,B as z,T as x,l as _,aw as E,R as L,O,J as $,E as B}from"./indexhtml-CfStPPYv.js";const T=u`
2  /* Optical centering */
3  :host::before,
4  :host::after {
5    content: '';
6    flex-basis: 0;
7    flex-grow: 1;
8  }
9
10  :host::after {
11    flex-grow: 1.1;
12  }
13
14  [part='overlay'] {
15    border-radius: var(--lumo-border-radius-l);
16    box-shadow:
17      0 0 0 1px var(--lumo-shade-5pct),
18      var(--lumo-box-shadow-xl);
19    background-image: none;
20    outline: none;
21    -webkit-tap-highlight-color: transparent;
22  }
23
24  [part='content'] {
25    padding: var(--lumo-space-l);
26  }
27
28  :host(:is([has-header], [has-title])) [part='header'] + [part='content'] {
29    padding-top: 0;
30  }
31
32  [part='header'],
33  [part='header-content'],
34  [part='footer'] {
35    gap: var(--lumo-space-xs) var(--lumo-space-s);
36    line-height: var(--lumo-line-height-s);
37  }
38
39  [part='header'] {
40    padding: var(--lumo-space-m);
41    background-color: var(--lumo-base-color);
42    border-radius: var(--lumo-border-radius-l) var(--lumo-border-radius-l) 0 0; /* Needed for Safari */
43  }
44
45  [part='footer'] {
46    padding: var(--lumo-space-s) var(--lumo-space-m);
47    background-color: var(--lumo-contrast-5pct);
48    border-radius: 0 0 var(--lumo-border-radius-l) var(--lumo-border-radius-l); /* Needed for Safari */
49  }
50
51  [part='title'] {
52    font-size: var(--lumo-font-size-xl);
53    font-weight: 600;
54    color: var(--lumo-header-text-color);
55    margin-inline-start: calc(var(--lumo-space-l) - var(--lumo-space-m));
56  }
57
58  /* No padding */
59  :host([theme~='no-padding']) [part='content'] {
60    padding: 0 !important;
61  }
62
63  @media (min-height: 320px) {
64    :host([overflow~='top']) [part='header'] {
65      box-shadow: 0 1px 0 0 var(--lumo-contrast-10pct);
66    }
67  }
68
69  /* Animations */
70
71  :host([opening]),
72  :host([closing]) {
73    animation: 0.25s lumo-overlay-dummy-animation;
74  }
75
76  :host([opening]) [part='overlay'] {
77    animation: 0.12s 0.05s vaadin-dialog-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
78  }
79
80  @keyframes vaadin-dialog-enter {
81    0% {
82      opacity: 0;
83      transform: scale(0.95);
84    }
85  }
86
87  :host([closing]) [part='overlay'] {
88    animation: 0.1s 0.03s vaadin-dialog-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
89  }
90
91  :host([closing]) [part='backdrop'] {
92    animation-delay: 0.05s;
93  }
94
95  @keyframes vaadin-dialog-exit {
96    100% {
97      opacity: 0;
98      transform: scale(1.02);
99    }
100  }
101`;v("vaadin-dialog-overlay",[w,T],{moduleId:"lumo-dialog"});/**
102 * @license
103 * Copyright (c) 2017 - 2025 Vaadin Ltd.
104 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
105 */const R=r=>class extends b(r){static get properties(){return{headerTitle:{type:String},headerRenderer:{type:Object},footerRenderer:{type:Object},keepInViewport:{type:Boolean,reflectToAttribute:!0}}}static get observers(){return["_headerFooterRendererChange(headerRenderer, footerRenderer, opened)","_headerTitleChanged(headerTitle, opened)","__keepInViewportChanged(keepInViewport, opened)"]}ready(){super.ready(),this.__resizeObserver=new ResizeObserver(()=>{this.__updateOverflow(),this.__adjustPosition()}),this.__resizeObserver.observe(this.$.resizerContainer),this.$.content.addEventListener("scroll",()=>{this.__updateOverflow()}),this.__handleWindowResize=this.__handleWindowResize.bind(this)}__createContainer(e){const t=document.createElement("div");return t.setAttribute("slot",e),t}__clearContainer(e){e.innerHTML="",delete e._$litPart$}__initContainer(e,t){return e?this.__clearContainer(e):e=this.__createContainer(t),e}_headerFooterRendererChange(e,t,i){const o=this.__oldHeaderRenderer!==e;this.__oldHeaderRenderer=e;const n=this.__oldFooterRenderer!==t;this.__oldFooterRenderer=t;const s=this._oldOpenedFooterHeader!==i;this._oldOpenedFooterHeader=i,this.toggleAttribute("has-header",!!e),this.toggleAttribute("has-footer",!!t),o&&(e?this.headerContainer=this.__initContainer(this.headerContainer,"header-content"):this.headerContainer&&(this.headerContainer.remove(),this.headerContainer=null,this.__updateOverflow())),n&&(t?this.footerContainer=this.__init
105Container(this.footerContainer,"footer"):this.footerContainer&&(this.footerContainer.remove(),this.footerContainer=null,this.__updateOverflow())),(e&&(o||s)||t&&(n||s))&&i&&this.requestContentUpdate()}_headerTitleChanged(e,t){this.toggleAttribute("has-title",!!e),t&&(e||this._oldHeaderTitle)&&this.requestContentUpdate(),this._oldHeaderTitle=e}_headerTitleRenderer(){this.headerTitle?(this.headerTitleElement||(this.headerTitleElement=document.createElement("h2"),this.headerTitleElement.setAttribute("slot","title"),this.headerTitleElement.classList.add("draggable")),this.appendChild(this.headerTitleElement),this.headerTitleElement.textContent=this.headerTitle):this.headerTitleElement&&(this.headerTitleElement.remove(),this.headerTitleElement=null)}requestContentUpdate(){super.requestContentUpdate(),this.headerContainer&&(this.headerContainer.parentElement||this.appendChild(this.headerContainer),this.headerRenderer&&this.headerRenderer.call(this.owner,this.headerContainer,this.owner)),this.footerContainer&&(this.footerContainer.parentElement||this.appendChild(this.footerContainer),this.footerRenderer&&this.footerRenderer.call(this.owner,this.footerContainer,this.owner)),this._headerTitleRenderer(),this.__updateOverflow()}setBounds(e,t=!0){const i=this.$.overlay,o={...e};t&&i.style.position!=="absolute"&&(i.style.position="absolute"),Object.keys(o).forEach(n=>{o[n]!==null&&!isNaN(o[n])&&(o[n]=`${o[n]}px`)}),Object.assign(i.style,o),this.__adjustPosition()}getBounds(){const e=this.$.overlay.getBoundingClientRect(),t=this.getBoundingClientRect(),i=e.top-t.top,o=e.left-t.left,n=e.width,s=e.height;return{top:i,left:o,width:n,height:s}}__updateOverflow(){let e="";if(this.hasAttribute("has-header")||this.hasAttribute("has-footer")||this.headerTitle){const i=this.$.content;i.scrollTop>0&&(e+=" top"),i.scrollTop<i.scrollHeight-i.clientHeight&&(e+=" bottom")}const t=e.trim();t.length>0&&this.getAttribute("overflow")!==t?this.setAttribute("overflow",t):t.length===0&&this.hasAttribute("overflow")&&this.removeAttribute("overflow")}__keepInViewportChanged(e,t){t&&e?window.addEventListener("resize",this.__handleWindowResize):window.removeEventListener("resize",this.__handleWindowResize)}__handleWindowResize(){this.__adjustPosition()}__adjustPosition(){if(!this.opened||!this.keepInViewport)return;const e=getComputedStyle(this.$.overlay);if(e.position!=="absolute")return;const t=this.getBoundingClientRect(),i=this.getBounds(),o=parseFloat(e.width)||i.width,n=parseFloat(e.height)||i.height,s=t.right-t.left-o,a=t.bottom-t.top-n;if(i.left>s||i.top>a){const h=Math.max(0,Math.min(i.left,s)),d=Math.max(0,Math.min(i.top,a));Object.assign(this.$.overlay.style,{left:`${h}px`,top:`${d}px`})}}};/**
106 * @license
107 * Copyright (c) 2017 - 2025 Vaadin Ltd.
108 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
109 */const k=u`
110  [part='header'],
111  [part='header-content'],
112  [part='footer'] {
113    display: flex;
114    align-items: center;
115    flex-wrap: wrap;
116    flex: none;
117    pointer-events: none;
118    z-index: 1;
119  }
120
121  [part='header'] {
122    flex-wrap: nowrap;
123  }
124
125  ::slotted([slot='header-content']),
126  ::slotted([slot='title']),
127  ::slotted([slot='footer']) {
128    display: contents;
129    pointer-events: auto;
130  }
131
132  ::slotted([slot='title']) {
133    font: inherit !important;
134    overflow-wrap: anywhere;
135  }
136
137  [part='header-content'] {
138    flex: 1;
139  }
140
141  :host([has-title]) [part='header-content'],
142  [part='footer'] {
143    justify-content: flex-end;
144  }
145
146  :host(:not([has-title]):not([has-header])) [part='header'],
147  :host(:not([has-header])) [part='header-content'],
148  :host(:not([has-title])) [part='title'],
149  :host(:not([has-footer])) [part='footer'] {
150    display: none !important;
151  }
152
153  :host(:is([has-title], [has-header], [has-footer])) [part='content'] {
154    height: auto;
155  }
156
157  @media (min-height: 320px) {
158    :host(:is([has-title], [has-header], [has-footer])) .resizer-container {
159      overflow: hidden;
160      display: flex;
161      flex-direction: column;
162    }
163
164    :host(:is([has-title], [has-header], [has-footer])) [part='content'] {
165      flex: 1;
166      overflow: auto;
167    }
168  }
169
170  /*
171      NOTE(platosha): Make some min-width to prevent collapsing of the content
172      taking the parent width, e. g., <vaadin-grid> and such.
173    */
174  [part='content'] {
175    min-width: 12em; /* matches the default <vaadin-text-field> width */
176  }
177
178  :host([has-bounds-set]:not([keep-in-viewport])) [part='overlay'] {
179    max-width: none;
180  }
181
182  @media (forced-colors: active) {
183    [part='overlay'] {
184      outline: 3px solid !important;
185    }
186  }
187`,M=u`
188  [part='overlay'] {
189    position: relative;
190    overflow: visible;
191    max-height: 100%;
192    display: flex;
193    width: max-content;
194  }
195
196  [part='content'] {
197    box-sizing: border-box;
198    height: 100%;
199  }
200
201  .resizer-container {
202    overflow: auto;
203    flex-grow: 1;
204    border-radius: inherit; /* prevent child elements being drawn outside part=overlay */
205  }
206
207  [part='overlay'][style] .resizer-container {
208    min-height: 100%;
209    width: 100%;
210  }
211
212  :host(:not([resizable])) .resizer {
213    display: none;
214  }
215
216  :host([resizable]) [part='title'] {
217    cursor: move;
218    -webkit-user-select: none;
219    user-select: none;
220  }
221
222  .resizer {
223    position: absolute;
224    height: 16px;
225    width: 16px;
226  }
227
228  .resizer.edge {
229    height: 8px;
230    width: 8px;
231    inset: -4px;
232  }
233
234  .resizer.edge.n {
235    width: auto;
236    bottom: auto;
237    cursor: ns-resize;
238  }
239
240  .resizer.ne {
241    top: -4px;
242    right: -4px;
243    cursor: nesw-resize;
244  }
245
246  .resizer.edge.e {
247    height: auto;
248    left: auto;
249    cursor: ew-resize;
250  }
251
252  .resizer.se {
253    bottom: -4px;
254    right: -4px;
255    cursor: nwse-resize;
256  }
257
258  .resizer.edge.s {
259    width: auto;
260    top: auto;
261    cursor: ns-resize;
262  }
263
264  .resizer.sw {
265    bottom: -4px;
266    left: -4px;
267    cursor: nesw-resize;
268  }
269
270  .resizer.edge.w {
271    height: auto;
272    right: auto;
273    cursor: ew-resize;
274  }
275
276  .resizer.nw {
277    top: -4px;
278    left: -4px;
279    cursor: nwse-resize;
280  }
281`;/**
282 * @license
283 * Copyright (c) 2017 - 2025 Vaadin Ltd.
284 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
285 */v("vaadin-dialog-overlay",[C,k,M],{moduleId:"vaadin-dialog-overlay-styles"});class D extends R(z(x(_))){static get is(){return"vaadin-dialog-overlay"}static get template(){return f`
286      <div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
287      <div part="overlay" id="overlay" tabindex="0">
288        <section id="resizerContainer" class="resizer-container">
289          <header part="header">
290            <div part="title"><slot name="title"></slot></div>
291            <div part="header-content"><slot name="header-content"></slot></div>
292          </header>
293          <div part="content" id="content"><slot></slot></div>
294          <footer part="footer"><slot name="footer"></slot></footer>
295        </section>
296      </div>
297    `}}m(D);/**
298 * @license
299 * Copyright (c) 2017 - 2025 Vaadin Ltd.
300 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
301 */const A=r=>class extends r{static get properties(){return{opened:{type:Boolean,value:!1,notify:!0,sync:!0},noCloseOnOutsideClick:{type:Boolean,value:!1},noCloseOnEsc:{type:Boolean,value:!1},modeless:{type:Boolean,value:!1},top:{type:String},left:{type:String},width:{type:String},height:{type:String},overlayRole:{type:String,value:"dialog"},keepInViewport:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["__positionChanged(top, left)","__sizeChanged(width, height)"]}ready(){super.ready();const e=this.$.overlay;e.addEventListener("vaadin-overlay-outside-click",this._handleOutsideClick.bind(this)),e.addEventListener("vaadin-overlay-escape-press",this._handleEscPress.bind(this)),e.addEventListener("vaadin-overlay-closed",this.__handleOverlayClosed.bind(this)),this._overlayElement=e}__handleOverlayClosed(){this.dispatchEvent(new CustomEvent("closed"))}connectedCallback(){super.connectedCallback(),this.__restoreOpened&&(this.opened=!0)}disconnectedCallback(){super.disconnectedCallback(),setTimeout(()=>{this.isConnected||(this.__restoreOpened=this.opened,this.opened=!1)})}_onOverlayOpened(e){e.detail.value===!1&&(this.opened=!1)}_handleOutsideClick(e){this.noCloseOnOutsideClick&&e.preventDefault()}_handleEscPress(e){this.noCloseOnEsc&&e.preventDefault()}_bringOverlayToFront(){this.modeless&&this._overlayElement.bringToFront()}__positionChanged(e,t){requestAnimationFrame(()=>this.$.overlay.setBounds({top:e,left:t}))}__sizeChanged(e,t){requestAnimationFrame(()=>this.$.overlay.setBounds({width:e,height:t},!1))}};/**
302 * @license
303 * Copyright (c) 2017 - 2025 Vaadin Ltd.
304 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
305 */function p(r){return r.touches?r.touches[0]:r}function y(r){return r.clientX>=0&&r.clientX<=window.innerWidth&&r.clientY>
305=0&&r.clientY<=window.innerHeight}/**
306 * @license
307 * Copyright (c) 2017 - 2025 Vaadin Ltd.
308 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
309 */const S=r=>class extends r{static get properties(){return{draggable:{type:Boolean,value:!1,reflectToAttribute:!0},_touchDevice:{type:Boolean,value:E},__dragHandleClassName:{type:String}}}ready(){super.ready(),this._originalBounds={},this._originalMouseCoords={},this._startDrag=this._startDrag.bind(this),this._drag=this._drag.bind(this),this._stopDrag=this._stopDrag.bind(this),this.$.overlay.$.overlay.addEventListener("mousedown",this._startDrag),this.$.overlay.$.overlay.addEventListener("touchstart",this._startDrag)}_startDrag(e){if(!(e.type==="touchstart"&&e.touches.length>1)&&this.draggable&&(e.button===0||e.touches)){const t=this.$.overlay.$.resizerContainer,i=e.target===t,o=e.offsetX>t.clientWidth||e.offsetY>t.clientHeight,n=e.target===this.$.overlay.$.content,s=e.composedPath().some((a,h)=>{if(!a.classList)return!1;const d=a.classList.contains(this.__dragHandleClassName||"draggable"),c=a.classList.contains("draggable-leaf-only"),g=h===0;return c&&g||d&&(!c||g)});if(i&&!o||n||s){s||e.preventDefault(),this._originalBounds=this.$.overlay.getBounds();const a=p(e);if(this._originalMouseCoords={top:a.pageY,left:a.pageX},window.addEventListener("mouseup",this._stopDrag),window.addEventListener("touchend",this._stopDrag),window.addEventListener("mousemove",this._drag),window.addEventListener("touchmove",this._drag),this.$.overlay.$.overlay.style.position!=="absolute"){const{top:h,left:d}=this._originalBounds;this.top=h,this.left=d}}}}_drag(e){const t=p(e);if(y(t)){let i=this._originalBounds.top+(t.pageY-this._originalMouseCoords.top),o=this._originalBounds.left+(t.pageX-this._originalMouseCoords.left);if(this.keepInViewport){const{width:n,height:s}=this._originalBounds,a=this.$.overlay.getBoundingClientRect(),h=a.right-a.left-n,d=a.bottom-a.top-s;o=Math.max(0,Math.min(o,h)),i=Math.max(0,Math.min(i,d))}this.top=i,this.left=o}}_stopDrag(){this.dispatchEvent(new CustomEvent("dragged",{bubbles:!0,composed:!0,detail:{top:this.top,left
309:this.left}})),window.removeEventListener("mouseup",this._stopDrag),window.removeEventListener("touchend",this._stopDrag),window.removeEventListener("mousemove",this._drag),window.removeEventListener("touchmove",this._drag)}};/**
310 * @license
311 * Copyright (c) 2017 - 2025 Vaadin Ltd.
312 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
313 */const H=r=>class extends r{static get properties(){return{renderer:{type:Object},headerTitle:String,headerRenderer:{type:Object},footerRenderer:{type:Object}}}requestContentUpdate(){this._overlayElement&&this._overlayElement.requestContentUpdate()}};/**
314 * @license
315 * Copyright (c) 2017 - 2025 Vaadin Ltd.
316 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
317 */const F=r=>class extends r{static get properties(){return{resizable:{type:Boolean,value:!1,reflectToAttribute:!0}}}ready(){super.ready(),this._originalBounds={},this._originalMouseCoords={},this._resizeListeners={start:{},resize:{},stop:{}},this._addResizeListeners()}_addResizeListeners(){["n","e","s","w","nw","ne","se","sw"].forEach(e=>{const t=document.createElement("div");this._resizeListeners.start[e]=i=>this._startResize(i,e),this._resizeListeners.resize[e]=i=>this._resize(i,e),this._resizeListeners.stop[e]=()=>this._stopResize(e),e.length===1&&t.classList.add("edge"),t.classList.add("resizer"),t.classList.add(e),t.addEventListener("mousedown",this._resizeListeners.start[e]),t.addEventListener("touchstart",this._resizeListeners.start[e]),this.$.overlay.$.resizerContainer.appendChild(t)})}_startResize(e,t){if(!(e.type==="touchstart"&&e.touches.length>1)&&(e.button===0||e.touches)){e.preventDefault(),this._originalBounds=this.$.overlay.getBounds();const i=p(e);this._originalMouseCoords={top:i.pageY,left:i.pageX},window.addEventListener("mousemove",this._resizeListeners.resize[t]),window.addEventListener("touchmove",this._resizeListeners.resize[t]),window.addEventListener("mouseup",this._resizeListeners.stop[t]),window.addEventListener("touchend",this._resizeListeners.stop[t]),this.$.overlay.setBounds(this._originalBounds),this.$.overlay.setAttribute("has-bounds-set","")}}_resize(e,t){const i=p(e);y(i)&&t.split("").forEach(n=>{switch(n){case"n":{const s=this._originalBounds.height-(i.pageY-this._originalMouseCoords.top),a=this._originalBounds.top+(i.pageY-this._originalMouseCoords.top);s>40&&(this.top=a,this.height=s);break}case"e":{const s=this._originalBounds.width+(i.pageX-this._originalMouseCoords.left);s>40&&(this.width=s);break}case"s":{const s=this._originalBounds.height+(i.pageY-this._originalMouseCoords.top);s>40&&(this.height=s);break}case"w":{const s=this._originalBounds.width-(i.pageX-this._originalMouseCoords.left),a=this._originalBounds.left+(i.pageX-this._originalMouseCoords.left);s>40&&(this.left=a,this.width=s);break}}})}_stopResize(e){window.removeEventListener("mousemove",this._resizeListeners.resize[e]),window.removeEventListener("touchmove",this._resizeListeners.resize[e]),window.removeEventListener("mouseup",this._resizeListeners.stop[e]),window.removeEventListener("touchend",this._resizeListeners.stop[e]),this.dispatchEvent(new CustomEvent("resize",{detail:this._getResizeDimensions()}))}_getResizeDimensions(){const e=this.$.overlay.$.resizerContainer.scrollTop,{width:t,height:i,top:o,left:n}=getComputedStyle(this.$.overlay.$.overlay),s=this.$.overlay.$.content;s.setAttribute("style","position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-sizing: content-box; height: auto;");const{width:a,height:h}=getComputedStyle(s);return s.removeAttribute("style"),this.$.overlay.$.resizerContainer.scrollTop=e,{width:t,height:i,contentWidth:a,contentHeight:h,top:o,left:n}}};/**
318 * @license
319 * Copyright (c) 2017 - 2025 Vaadin Ltd.
320 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
321 */class j extends S(F(H(A(O($(B(_))))))){static get template(){return f`
322      <style>
323        :host {
324          display: none !important;
325        }
326      </style>
327
328      <vaadin-dialog-overlay
329        id="overlay"
330        role$="[[overlayRole]]"
331        header-title="[[headerTitle]]"
332        on-opened-changed="_onOverlayOpened"
333        on-mousedown="_bringOverlayToFront"
334        on-touchstart="_bringOverlayToFront"
335        theme$="[[_theme]]"
336        modeless="[[modeless]]"
337        with-backdrop="[[!modeless]]"
338        resizable$="[[resizable]]"
339        draggable$="[[draggable]]"
340        keep-in-viewport="[[keepInViewport]]"
341        restore-focus-on-close
342        focus-trap
343      ></vaadin-dialog-overlay>
344    `}static get is(){return"vaadin-dialog"}static get properties(){return{ariaLabel:{type:String,value:""}}}static get observers(){return["_openedChanged(opened)","_ariaLabelChanged(ariaLabel, headerTitle)","_rendererChanged(renderer, headerRenderer, footerRenderer)"]}ready(){super.ready(),L(this)}_rendererChanged(l,e,t){this.$.overlay.setProperties({owner:this,renderer:l,headerRenderer:e,footerRenderer:t})}_openedChanged(l){this.$.overlay.opened=l}_ariaLabelChanged(l,e){l||e?this.$.overlay.setAttribute("aria-label",l||e):this.$.overlay.removeAttribute("aria-label")}}m(j);export{A as D,k as a,T as d};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.