@descope/web-components-ui 1.0.135 → 1.0.148

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/package.json +77 -56
  2. package/src/baseClasses/createBaseClass.js +18 -16
  3. package/src/baseClasses/createBaseInputClass.js +14 -8
  4. package/src/baseClasses/createCssVarImageClass.js +27 -23
  5. package/src/components/boolean-fields/booleanFieldMixin.js +18 -29
  6. package/src/components/boolean-fields/commonStyles.js +1 -1
  7. package/src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js +46 -51
  8. package/src/components/boolean-fields/descope-boolean-field-internal/index.js +1 -1
  9. package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +80 -85
  10. package/src/components/boolean-fields/descope-checkbox/index.js +2 -2
  11. package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +88 -95
  12. package/src/components/boolean-fields/descope-switch-toggle/index.js +2 -2
  13. package/src/components/descope-button/ButtonClass.js +57 -47
  14. package/src/components/descope-button/clickableMixin.js +10 -0
  15. package/src/components/descope-combo-box/ComboBoxClass.js +156 -160
  16. package/src/components/descope-container/ContainerClass.js +32 -42
  17. package/src/components/descope-date-picker/index.js +9 -14
  18. package/src/components/descope-divider/DividerClass.js +52 -62
  19. package/src/components/descope-email-field/EmailFieldClass.js +25 -20
  20. package/src/components/descope-image/ImageClass.js +21 -24
  21. package/src/components/descope-link/LinkClass.js +31 -35
  22. package/src/components/descope-loader-linear/LoaderLinearClass.js +31 -36
  23. package/src/components/descope-loader-radial/LoaderRadialClass.js +23 -30
  24. package/src/components/descope-logo/LogoClass.js +5 -1
  25. package/src/components/descope-new-password/NewPasswordClass.js +63 -81
  26. package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +157 -162
  27. package/src/components/descope-new-password/descope-new-password-internal/componentName.js +1 -1
  28. package/src/components/descope-new-password/descope-new-password-internal/index.js +3 -3
  29. package/src/components/descope-new-password/index.js +3 -3
  30. package/src/components/descope-number-field/NumberFieldClass.js +25 -20
  31. package/src/components/descope-passcode/PasscodeClass.js +95 -95
  32. package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +151 -157
  33. package/src/components/descope-passcode/descope-passcode-internal/helpers.js +7 -8
  34. package/src/components/descope-passcode/descope-passcode-internal/index.js +2 -2
  35. package/src/components/descope-passcode/index.js +2 -2
  36. package/src/components/descope-password/PasswordClass.js +75 -83
  37. package/src/components/descope-password/passwordDraggableMixin.js +28 -27
  38. package/src/components/descope-phone-field/CountryCodes.js +1210 -1210
  39. package/src/components/descope-phone-field/PhoneFieldClass.js +139 -141
  40. package/src/components/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +157 -173
  41. package/src/components/descope-phone-field/helpers.js +3 -3
  42. package/src/components/descope-text/TextClass.js +25 -29
  43. package/src/components/descope-text-area/TextAreaClass.js +68 -67
  44. package/src/components/descope-text-field/TextFieldClass.js +42 -37
  45. package/src/components/descope-text-field/textFieldMappings.js +40 -55
  46. package/src/components/descope-totp-image/TotpImageClass.js +5 -1
  47. package/src/components/descope-upload-file/UploadFileClass.js +202 -0
  48. package/src/components/descope-upload-file/helpers.js +11 -0
  49. package/src/components/descope-upload-file/index.js +6 -0
  50. package/src/constants.js +3 -3
  51. package/src/helpers/componentHelpers.js +68 -74
  52. package/src/helpers/index.js +17 -16
  53. package/src/helpers/mixinsHelpers.js +21 -10
  54. package/src/helpers/themeHelpers/colorsHelpers.js +18 -18
  55. package/src/helpers/themeHelpers/componentsThemeManager.js +7 -6
  56. package/src/helpers/themeHelpers/index.js +114 -124
  57. package/src/helpers/themeHelpers/resetHelpers.js +16 -16
  58. package/src/index.cjs.js +3 -3
  59. package/src/index.d.ts +22 -21
  60. package/src/index.js +5 -4
  61. package/src/index.umd.js +14 -13
  62. package/src/mixins/changeMixin.js +18 -17
  63. package/src/mixins/componentNameValidationMixin.js +19 -19
  64. package/src/mixins/createProxy.js +33 -33
  65. package/src/mixins/createStyleMixin/helpers.js +54 -64
  66. package/src/mixins/createStyleMixin/index.js +155 -141
  67. package/src/mixins/draggableMixin.js +61 -61
  68. package/src/mixins/hoverableMixin.js +11 -13
  69. package/src/mixins/index.js +6 -6
  70. package/src/mixins/inputEventsDispatchingMixin.js +61 -60
  71. package/src/mixins/inputValidationMixin.js +153 -148
  72. package/src/mixins/lifecycleEventsMixin.js +17 -15
  73. package/src/mixins/normalizeBooleanAttributesMixin.js +31 -23
  74. package/src/mixins/portalMixin.js +58 -52
  75. package/src/mixins/proxyInputMixin.js +138 -132
  76. package/src/theme/components/button.js +86 -81
  77. package/src/theme/components/checkbox.js +26 -28
  78. package/src/theme/components/comboBox.js +32 -31
  79. package/src/theme/components/container.js +99 -89
  80. package/src/theme/components/divider.js +30 -31
  81. package/src/theme/components/emailField.js +20 -19
  82. package/src/theme/components/image.js +3 -3
  83. package/src/theme/components/index.js +33 -25
  84. package/src/theme/components/inputWrapper.js +28 -25
  85. package/src/theme/components/link.js +29 -36
  86. package/src/theme/components/loader/index.js +3 -3
  87. package/src/theme/components/loader/loaderLinear.js +34 -34
  88. package/src/theme/components/loader/loaderRadial.js +40 -34
  89. package/src/theme/components/logo.js +4 -4
  90. package/src/theme/components/newPassword.js +14 -13
  91. package/src/theme/components/numberField.js +20 -19
  92. package/src/theme/components/passcode.js +20 -22
  93. package/src/theme/components/password.js +22 -21
  94. package/src/theme/components/phoneField.js +23 -23
  95. package/src/theme/components/switchToggle.js +47 -46
  96. package/src/theme/components/text.js +72 -72
  97. package/src/theme/components/textArea.js +27 -25
  98. package/src/theme/components/textField.js +23 -22
  99. package/src/theme/components/totpImage.js +4 -4
  100. package/src/theme/components/uploadFile.js +60 -0
  101. package/src/theme/globals.js +123 -124
  102. package/src/theme/index.js +1 -1
  103. package/dist/cjs/index.cjs.js +0 -5924
  104. package/dist/cjs/index.cjs.js.map +0 -1
  105. package/dist/cjs/package.json +0 -1
  106. package/dist/index.d.ts +0 -51
  107. package/dist/index.esm.js +0 -6606
  108. package/dist/index.esm.js.map +0 -1
  109. package/dist/umd/1018.js +0 -577
  110. package/dist/umd/1018.js.LICENSE.txt +0 -23
  111. package/dist/umd/2481.js +0 -1
  112. package/dist/umd/3208.js +0 -2
  113. package/dist/umd/3208.js.LICENSE.txt +0 -5
  114. package/dist/umd/3585.js +0 -1
  115. package/dist/umd/3878.js +0 -1
  116. package/dist/umd/4201.js +0 -1
  117. package/dist/umd/422.js +0 -2
  118. package/dist/umd/422.js.LICENSE.txt +0 -5
  119. package/dist/umd/4447.js +0 -1
  120. package/dist/umd/4513.js +0 -1
  121. package/dist/umd/4803.js +0 -1
  122. package/dist/umd/541.js +0 -744
  123. package/dist/umd/541.js.LICENSE.txt +0 -21
  124. package/dist/umd/5767.js +0 -2
  125. package/dist/umd/5767.js.LICENSE.txt +0 -15
  126. package/dist/umd/5806.js +0 -109
  127. package/dist/umd/5806.js.LICENSE.txt +0 -5
  128. package/dist/umd/7056.js +0 -48
  129. package/dist/umd/7056.js.LICENSE.txt +0 -5
  130. package/dist/umd/7101.js +0 -148
  131. package/dist/umd/7101.js.LICENSE.txt +0 -11
  132. package/dist/umd/729.js +0 -1
  133. package/dist/umd/7824.js +0 -229
  134. package/dist/umd/7824.js.LICENSE.txt +0 -27
  135. package/dist/umd/7840.js +0 -356
  136. package/dist/umd/7840.js.LICENSE.txt +0 -61
  137. package/dist/umd/8725.js +0 -37
  138. package/dist/umd/8725.js.LICENSE.txt +0 -11
  139. package/dist/umd/9211.js +0 -312
  140. package/dist/umd/9211.js.LICENSE.txt +0 -5
  141. package/dist/umd/9241.js +0 -1
  142. package/dist/umd/9314.js +0 -283
  143. package/dist/umd/9314.js.LICENSE.txt +0 -27
  144. package/dist/umd/9437.js +0 -19
  145. package/dist/umd/9437.js.LICENSE.txt +0 -5
  146. package/dist/umd/9515.js +0 -202
  147. package/dist/umd/9515.js.LICENSE.txt +0 -11
  148. package/dist/umd/9789.js +0 -1
  149. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +0 -1
  150. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +0 -1
  151. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +0 -1
  152. package/dist/umd/descope-button-index-js.js +0 -1
  153. package/dist/umd/descope-combo-box-index-js.js +0 -1
  154. package/dist/umd/descope-container-index-js.js +0 -1
  155. package/dist/umd/descope-date-picker-index-js.js +0 -1
  156. package/dist/umd/descope-divider-index-js.js +0 -1
  157. package/dist/umd/descope-email-field-index-js.js +0 -1
  158. package/dist/umd/descope-image-index-js.js +0 -1
  159. package/dist/umd/descope-link-index-js.js +0 -1
  160. package/dist/umd/descope-loader-linear-index-js.js +0 -1
  161. package/dist/umd/descope-loader-radial-index-js.js +0 -1
  162. package/dist/umd/descope-logo-index-js.js +0 -1
  163. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +0 -1
  164. package/dist/umd/descope-new-password-index-js.js +0 -1
  165. package/dist/umd/descope-number-field-index-js.js +0 -1
  166. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +0 -1
  167. package/dist/umd/descope-passcode-index-js.js +0 -1
  168. package/dist/umd/descope-password-index-js.js +0 -1
  169. package/dist/umd/descope-phone-field-descope-phone-field-internal-index-js.js +0 -1
  170. package/dist/umd/descope-phone-field-index-js.js +0 -1
  171. package/dist/umd/descope-text-area-index-js.js +0 -1
  172. package/dist/umd/descope-text-field-index-js.js +0 -1
  173. package/dist/umd/descope-text-index-js.js +0 -1
  174. package/dist/umd/descope-totp-image-index-js.js +0 -1
  175. package/dist/umd/index.js +0 -1
package/dist/umd/7824.js DELETED
@@ -1,229 +0,0 @@
1
- /*! For license information please see 7824.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[7824],{2223:(e,t,o)=>{o.d(t,{T8:()=>l}),o(7894);let n=!1,i=[],s=[];function r(){n=!0,requestAnimationFrame((function(){n=!1,function(e){for(;e.length;)a(e.shift())}(i),setTimeout((function(){!function(e){for(let t=0,o=e.length;t<o;t++)a(e.shift())}(s)}))}))}function a(e){const t=e[0],o=e[1],n=e[2];try{o.apply(t,n)}catch(e){setTimeout((()=>{throw e}))}}function l(e,t,o){n||r(),s.push([e,t,o])}},1037:(e,t,o)=>{o.d(t,{G6:()=>l,T:()=>d,gn:()=>a,vU:()=>s});const n=e=>e.test(navigator.userAgent),i=e=>e.test(navigator.platform);n(/Android/u),n(/Chrome/u)&&/Google Inc/u.test(navigator.vendor);const s=n(/Firefox/u),r=i(/^iPad/u)||i(/^Mac/u)&&navigator.maxTouchPoints>1,a=i(/^iPhone/u)||r,l=n(/^((?!chrome|android).)*safari/iu),d=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})()},9320:(e,t,o)=>{o.d(t,{u:()=>n});const n=e=>class extends e{static get properties(){return{overlayClass:{type:String},_overlayElement:{type:Object}}}static get observers(){return["__updateOverlayClassNames(overlayClass, _overlayElement)"]}__updateOverlayClassNames(e,t){if(!t)return;if(void 0===e)return;const{classList:o}=t;if(this.__initialClasses||(this.__initialClasses=new Set(o)),Array.isArray(this.__previousClasses)){const e=this.__previousClasses.filter((e=>!this.__initialClasses.has(e)));e.length>0&&o.remove(...e)}const n="string"==typeof e?e.split(" "):[];n.length>0&&o.add(...n),this.__previousClasses=n}}},262:(e,t,o)=>{function n(e){window.Vaadin&&window.Vaadin.templateRendererCallback?window.Vaadin.templateRendererCallback(e):e.querySelector("template")&&console.warn(`WARNING: <template> inside <${e.localName}> is no longer supported. Import @vaadin/polymer-legacy-adapter/template-renderer.js to enable compatibility.`)}o.d(t,{k:()=>n})},9580:(e,t,o)=>{o.d(t,{B:()=>n});class n{constructor(e){this.host=e,e.addEventListener("opened-changed",(()=>{e.opened||this.__setVirtualKeyboardEnabled(!1)})),e.addEventListener("blur",(()=>this.__setVirtualKeyboardEnabled(!0))),e.addEventListener("touchstart",(()=>this.__setVirtualKeyboardEnabled(!0)))}__setVirtualKeyboardEnabled(e){this.host.inputElement&&(this.host.inputElement.inputMode=e?"":"none")}}},3373:(e,t,o)=>{o.d(t,{y:()=>a});var n=o(3726);const i={start:"top",end:"bottom"},s={start:"left",end:"right"},r=new ResizeObserver((e=>{setTimeout((()=>{e.forEach((e=>{e.target.__overlay&&e.target.__overlay._updatePosition()}))}))})),a=e=>class extends e{static get properties(){return{positionTarget:{type:Object,value:null},horizontalAlign:{type:String,value:"start"},verticalAlign:{type:String,value:"top"},noHorizontalOverlap:{type:Boolean,value:!1},noVerticalOverlap:{type:Boolean,value:!1},requiredVerticalSpace:{type:Number,value:0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.addEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes=(0,n.AD)(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach((e=>{e.addEventListener("scroll",this.__onScroll,!0)}))}__removeUpdatePositionEventListeners(){window.removeEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach((e=>{e.removeEventListener("scroll",this.__onScroll,!0)})),this.__positionTargetAncestorRootNodes=null)}__overlayOpenedChanged(e,t){if(this.__removeUpdatePositionEventListeners(),t&&(t.__overlay=null,r.unobserve(t),e&&(this.__addUpdatePositionEventListeners(),t.__overlay=this,r.observe(t))),e){const e=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((t=>{this.__margins[t]=parseInt(e[t],10)}))),this.setAttribute("dir",e.direction),this._updatePosition(),requestAnimationFrame((()=>this._updatePosition()))}}__positionSettingsChanged(){this._updatePosition()}__onScroll(e){this.contains(e.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened)return;const e=this.positionTarget.getBoundingClientRect(),t=this.__shouldAlignStartVertically(e);this.style.justifyContent=t?"flex-start":"flex-end";const o=this.__isRTL,n=this.__shouldAlignStartHorizontally(e,o),r=!o&&n||o&&!n;this.style.alignItems=r?"flex-start":"flex-end";const a=this.getBoundingClientRect(),l=this.__calculatePositionInOneDimension(e,a,this.noVerticalOverlap,i,this,t),d=this.__calculatePositionInOneDimension(e,a,this.noHorizontalOverlap,s,this,n);Object.assign(this.style,l,d),this.toggleAttribute("bottom-aligned",!t),this.toggleAttribute("top-aligned",t),this.toggleAttribute("end-aligned",!r),this.toggleAttribute("start-aligned",r)}__shouldAlignStartHorizontally(e,t){const o=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const n=Math.min(window.innerWidth,document.documentElement.clientWidth),i=!t&&"start"===this.horizontalAlign||t&&"end"===this.horizontalAlign;return this.__shouldAlignStart(e,o,n,this.__margins,i,this.noHorizontalOverlap,s)}__shouldAlignStartVertically(e){const t=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const o=Math.min(window.innerHeight,document.documentElement.clientHeight),n="top"===this.verticalAlign;return this.__shouldAlignStart(e,t,o,this.__margins,n,this.noVerticalOverlap,i)}__shouldAlignStart(e,t,o,n,i,s,r){const a=o-e[s?r.end:r.start]-n[r.end],l=e[s?r.start:r.end]-n[r.start],d=i?a:l;return i===(d>(i?l:a)||d>t)}__adjustBottomProperty(e,t,o){let n;if(e===t.end){if(t.end===i.end){const e=Math.min(window.innerHeight,document.documentElement.clientHeight);o>e&&this.__oldViewportHeight&&(n=o-(this.__oldViewportHeight-e)),this.__oldViewportHeight=e}if(t.end===s.end){const e=Math.min(window.innerWidth,document.documentElement.clientWidth);o>e&&this.__oldViewportWidth&&(n=o-(this.__oldViewportWidth-e)),this.__oldViewportWidth=e}}return n}__calculatePositionInOneDimension(e,t,o,n,i,s){const r=s?n.start:n.end,a=s?n.end:n.start,l=parseFloat(i.style[r]||getComputedStyle(i)[r]),d=this.__adjustBottomProperty(r,n,l),h=t[s?n.start:n.end]-e[o===s?n.end:n.start];return{[r]:d?`${d}px`:`${l+h*(s?-1:1)}px`,[a]:""}}}},8813:(e,t,o)=>{o.d(t,{a:()=>p});var n=o(2223),i=o(4241),s=o(1037),r=o(6155),a=o(1914),l=o(4530);const d=[];class h{constructor(e){this.host=e,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){return(0,l.GO)(this.__trapNode)}get __focusedElementIndex(){const e=this.__focusableElements;return e.indexOf(e.filter(l.Qw).pop())}hostConnected(){document.addEventListener("keydown",this.__onKeyDown)}hostDisconnected(){document.removeEventListener("keydown",this.__onKeyDown)}trapFocus(e){if(this.__trapNode=e,0===this.__focusableElements.length)throw this.__trapNode=null,new Error("The trap node should have at least one focusable descendant or be focusable itself.");d.push(this),-1===this.__focusedElementIndex&&this.__focusableElements[0].focus()}releaseFocus(){this.__trapNode=null,d.pop()}__onKeyDown(e){if(this.__trapNode&&this===Array.from(d).pop()&&"Tab"===e.key){e.preventDefault();const t=e.shiftKey;this.__focusNextElement(t)}}__focusNextElement(e=!1){const t=this.__focusableElements,o=e?-1:1,n=this.__focusedElementIndex,i=t[(t.length+n+o)%t.length];i.focus(),"input"===i.localName&&i.select()}}var c=o(262),u=o(5128);class p extends((0,u.Tb)((0,a.U)((0,r.k)(i.H3)))){static get template(){return i.dy`
3
- <style>
4
- :host {
5
- z-index: 200;
6
- position: fixed;
7
-
8
- /* Despite of what the names say, <vaadin-overlay> is just a container
9
- for position/sizing/alignment. The actual overlay is the overlay part. */
10
-
11
- /* Default position constraints: the entire viewport. Note: themes can
12
- override this to introduce gaps between the overlay and the viewport. */
13
- top: 0;
14
- right: 0;
15
- bottom: var(--vaadin-overlay-viewport-bottom);
16
- left: 0;
17
-
18
- /* Use flexbox alignment for the overlay part. */
19
- display: flex;
20
- flex-direction: column; /* makes dropdowns sizing easier */
21
- /* Align to center by default. */
22
- align-items: center;
23
- justify-content: center;
24
-
25
- /* Allow centering when max-width/max-height applies. */
26
- margin: auto;
27
-
28
- /* The host is not clickable, only the overlay part is. */
29
- pointer-events: none;
30
-
31
- /* Remove tap highlight on touch devices. */
32
- -webkit-tap-highlight-color: transparent;
33
-
34
- /* CSS API for host */
35
- --vaadin-overlay-viewport-bottom: 0;
36
- }
37
-
38
- :host([hidden]),
39
- :host(:not([opened]):not([closing])) {
40
- display: none !important;
41
- }
42
-
43
- [part='overlay'] {
44
- -webkit-overflow-scrolling: touch;
45
- overflow: auto;
46
- pointer-events: auto;
47
-
48
- /* Prevent overflowing the host in MSIE 11 */
49
- max-width: 100%;
50
- box-sizing: border-box;
51
-
52
- -webkit-tap-highlight-color: initial; /* reenable tap highlight inside */
53
- }
54
-
55
- [part='backdrop'] {
56
- z-index: -1;
57
- content: '';
58
- background: rgba(0, 0, 0, 0.5);
59
- position: fixed;
60
- top: 0;
61
- left: 0;
62
- bottom: 0;
63
- right: 0;
64
- pointer-events: auto;
65
- }
66
- </style>
67
-
68
- <div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
69
- <div part="overlay" id="overlay" tabindex="0">
70
- <div part="content" id="content">
71
- <slot></slot>
72
- </div>
73
- </div>
74
- `}static get is(){return"vaadin-overlay"}static get properties(){return{opened:{type:Boolean,notify:!0,observer:"_openedChanged",reflectToAttribute:!0},owner:Element,renderer:Function,withBackdrop:{type:Boolean,value:!1,reflectToAttribute:!0},model:Object,modeless:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_modelessChanged"},hidden:{type:Boolean,reflectToAttribute:!0,observer:"_hiddenChanged"},focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement},_mouseDownInside:{type:Boolean},_mouseUpInside:{type:Boolean},_oldOwner:Element,_oldModel:Object,_oldRenderer:Object,_oldOpened:Boolean}}static get observers(){return["_rendererOrDataChanged(renderer, owner, model, opened)"]}static get __attachedInstances(){return Array.from(document.body.children).filter((e=>e instanceof p&&!e.hasAttribute("closing"))).sort(((e,t)=>e.__zIndex-t.__zIndex||0))}constructor(){super(),this._boundMouseDownListener=this._mouseDownListener.bind(this),this._boundMouseUpListener=this._mouseUpListener.bind(this),this._boundOutsideClickListener=this._outsideClickListener.bind(this),this._boundKeydownListener=this._keydownListener.bind(this),s.gn&&(this._boundIosResizeListener=()=>this._detectIosNavbar()),this.__focusTrapController=new h(this)}get _last(){return this===p.__attachedInstances.pop()}ready(){super.ready(),this.addEventListener("click",(()=>{})),this.$.backdrop.addEventListener("click",(()=>{})),this.addController(this.__focusTrapController),(0,c.k)(this)}_detectIosNavbar(){if(!this.opened)return;const e=window.innerHeight,t=window.innerWidth>e,o=document.documentElement.clientHeight;t&&o>e?this.style.setProperty("--vaadin-overlay-viewport-bottom",o-e+"px"):this.style.setProperty("--vaadin-overlay-viewport-bottom","0")}close(e){const t=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),t.defaultPrevented||(this.opened=!1)}connectedCallback(){super.connectedCallback(),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener))}disconnectedCallback(){super.disconnectedCallback(),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener)}requestContentUpdate(){this.renderer&&this.renderer.call(this.owner,this,this.owner,this.model)}_mouseDownListener(e){this._mouseDownInside=e.composedPath().indexOf(this.$.overlay)>=0}_mouseUpListener(e){this._mouseUpInside=e.composedPath().indexOf(this.$.overlay)>=0}_shouldCloseOnOutsideClick(e){return this._last}_outsideClickListener(e){if(e.composedPath().includes(this.$.overlay)||this._mouseDownInside||this._mouseUpInside)return this._mouseDownInside=!1,void(this._mouseUpInside=!1);if(!this._shouldCloseOnOutsideClick(e))return;const t=new CustomEvent("vaadin-overlay-outside-click",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}_keydownListener(e){if(this._last&&(!this.modeless||e.composedPath().includes(this.$.overlay))&&"Escape"===e.key){const t=new CustomEvent("vaadin-overlay-escape-press",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}}_openedChanged(e,t){e?(this.__restoreFocusNode=this._getActiveElement(),this._animatedOpening(),(0,n.T8)(this,(()=>{this.focusTrap&&this.__focusTrapController.trapFocus(this.$.overlay);const e=new CustomEvent("vaadin-overlay-open",{bubbles:!0});this.dispatchEvent(e)})),document.addEventListener("keydown",this._boundKeydownListener),this.modeless||this._addGlobalListeners()):t&&(this.focusTrap&&this.__focusTrapController.releaseFocus(),this._animatedClosing(),document.removeEventListener("keydown",this._boundKeydownListener),this.modeless||this._removeGlobalListeners())}_hiddenChanged(e){e&&this.hasAttribute("closing")&&this._flushAnimation("closing")}_shouldAnimate(){const e=getComputedStyle(this),t=e.getPropertyValue("animation-name");return!("none"===e.getPropertyValue("display"))&&t&&"none"!==t}_enqueueAnimation(e,t){const o=`__${e}Handler`,n=e=>{e&&e.target!==this||(t(),this.removeEventListener("animationend",n),delete this[o])};this[o]=n,this.addEventListener("animationend",n)}_flushAnimation(e){const t=`__${e}Handler`;"function"==typeof this[t]&&this[t]()}_animatedOpening(){this.parentNode===document.body&&this.hasAttribute("closing")&&this._flushAnimation("closing"),this._attachOverlay(),this.modeless||this._enterModalState(),this.setAttribute("opening",""),this._shouldAnimate()?this._enqueueAnimation("opening",(()=>{this._finishOpening()})):this._finishOpening()}_attachOverlay(){this._placeholder=document.createComment("vaadin-overlay-placeholder"),this.parentNode.insertBefore(this._placeholder,this),document.body.appendChild(this),this.bringToFront()}_finishOpening(){this.removeAttribute("opening")}_finishClosing(){this._detachOverlay(),this.$.overlay.style.removeProperty("pointer-events"),this.removeAttribute("closing"),this.dispatchEvent(new CustomEvent("vaadin-overlay-closed"))}_animatedClosing(){if(this.hasAttribute("opening")&&this._flushAnimation("opening"),this._placeholder){this._exitModalState();const e=this.restoreFocusNode||this.__restoreFocusNode;if(this.restoreFocusOnClose&&e){const t=this._getActiveElement();(t===document.body||this._deepContains(t))&&setTimeout((()=>e.focus())),this.__restoreFocusNode=null}this.setAttribute("closing",""),this.dispatchEvent(new CustomEvent("vaadin-overlay-closing")),this._shouldAnimate()?this._enqueueAnimation("closing",(()=>{this._finishClosing()})):this._finishClosing()}}_detachOverlay(){this._placeholder.parentNode.insertBefore(this,this._placeholder),this._placeholder.parentNode.removeChild(this._placeholder)}_modelessChanged(e){e?(this._removeGlobalListeners(),this._exitModalState()):this.opened&&(this._addGlobalListeners(),this._enterModalState())}_addGlobalListeners(){document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0)}_enterModalState(){"none"!==document.body.style.pointerEvents&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),p.__attachedInstances.forEach((e=>{e!==this&&(e.shadowRoot.querySelector('[part="overlay"]').style.pointerEvents="none")}))}_removeGlobalListeners(){document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0)}_exitModalState(){void 0!==this._previousDocumentPointerEvents&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);const e=p.__attachedInstances;let t;for(;(t=e.pop())&&(t===this||(t.shadowRoot.querySelector('[part="overlay"]').style.removeProperty("pointer-events"),t.modeless)););}_rendererOrDataChanged(e,t,o,n){const i=this._oldOwner!==t||this._oldModel!==o;this._oldModel=o,this._oldOwner=t;const s=this._oldRenderer!==e;this._oldRenderer=e;const r=this._oldOpened!==n;this._oldOpened=n,s&&(this.innerHTML="",delete this._$litPart$),n&&e&&(s||r||i)&&this.requestContentUpdate()}_getActiveElement(){let e=document.activeElement||document.body;for(;e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}_deepContains(e){if(this.contains(e))return!0;let t=e;const o=e.ownerDocument;for(;t&&t!==o&&t!==this;)t=t.parentNode||t.host;return t===this}bringToFront(){let e="";const t=p.__attachedInstances.filter((e=>e!==this)).pop();t&&(e=t.__zIndex+1),this.style.zIndex=e,this.__zIndex=e||parseFloat(getComputedStyle(this).zIndex)}}customElements.define(p.is,p)},6687:(e,t,o)=>{var n=o(510);(0,o(5128).hC)("vaadin-overlay",n.I,{moduleId:"lumo-vaadin-overlay"}),o(8813)},6754:(e,t,o)=>{o.d(t,{L:()=>a,e:()=>s}),o(9416),o(9849);var n=o(5128),i=o(510);const s=n.iv`
75
- :host([opening]),
76
- :host([closing]) {
77
- animation: 0.14s lumo-overlay-dummy-animation;
78
- }
79
-
80
- [part='overlay'] {
81
- will-change: opacity, transform;
82
- }
83
-
84
- :host([opening]) [part='overlay'] {
85
- animation: 0.1s lumo-menu-overlay-enter ease-out both;
86
- }
87
-
88
- @keyframes lumo-menu-overlay-enter {
89
- 0% {
90
- opacity: 0;
91
- transform: translateY(-4px);
92
- }
93
- }
94
-
95
- :host([closing]) [part='overlay'] {
96
- animation: 0.1s lumo-menu-overlay-exit both;
97
- }
98
-
99
- @keyframes lumo-menu-overlay-exit {
100
- 100% {
101
- opacity: 0;
102
- }
103
- }
104
- `;(0,n.hC)("",s,{moduleId:"lumo-menu-overlay-core"});const r=n.iv`
105
- /* Small viewport (bottom sheet) styles */
106
- /* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
107
- @media (max-width: 420px), (max-height: 420px) {
108
- :host {
109
- top: 0 !important;
110
- right: 0 !important;
111
- bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
112
- left: 0 !important;
113
- align-items: stretch !important;
114
- justify-content: flex-end !important;
115
- }
116
-
117
- [part='overlay'] {
118
- max-height: 50vh;
119
- width: 100vw;
120
- border-radius: 0;
121
- box-shadow: var(--lumo-box-shadow-xl);
122
- }
123
-
124
- /* The content part scrolls instead of the overlay part, because of the gradient fade-out */
125
- [part='content'] {
126
- padding: 30px var(--lumo-space-m);
127
- max-height: inherit;
128
- box-sizing: border-box;
129
- -webkit-overflow-scrolling: touch;
130
- overflow: auto;
131
- -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
132
- mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
133
- }
134
-
135
- [part='backdrop'] {
136
- display: block;
137
- }
138
-
139
- /* Animations */
140
-
141
- :host([opening]) [part='overlay'] {
142
- animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
143
- }
144
-
145
- :host([closing]),
146
- :host([closing]) [part='backdrop'] {
147
- animation-delay: 0.14s;
148
- }
149
-
150
- :host([closing]) [part='overlay'] {
151
- animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
152
- }
153
- }
154
-
155
- @keyframes lumo-mobile-menu-overlay-enter {
156
- 0% {
157
- transform: translateY(150%);
158
- }
159
- }
160
-
161
- @keyframes lumo-mobile-menu-overlay-exit {
162
- 100% {
163
- transform: translateY(150%);
164
- }
165
- }
166
- `,a=[i.I,s,r];(0,n.hC)("",a,{moduleId:"lumo-menu-overlay"})},510:(e,t,o)=>{o.d(t,{I:()=>i}),o(1195),o(9416),o(9849),o(4173);var n=o(5128);const i=n.iv`
167
- :host {
168
- top: var(--lumo-space-m);
169
- right: var(--lumo-space-m);
170
- bottom: var(--lumo-space-m);
171
- left: var(--lumo-space-m);
172
- /* Workaround for Edge issue (only on Surface), where an overflowing vaadin-list-box inside vaadin-select-overlay makes the overlay transparent */
173
- /* stylelint-disable-next-line */
174
- outline: 0px solid transparent;
175
- }
176
-
177
- [part='overlay'] {
178
- background-color: var(--lumo-base-color);
179
- background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
180
- border-radius: var(--lumo-border-radius-m);
181
- box-shadow: 0 0 0 1px var(--lumo-shade-5pct), var(--lumo-box-shadow-m);
182
- color: var(--lumo-body-text-color);
183
- font-family: var(--lumo-font-family);
184
- font-size: var(--lumo-font-size-m);
185
- font-weight: 400;
186
- line-height: var(--lumo-line-height-m);
187
- letter-spacing: 0;
188
- text-transform: none;
189
- -webkit-text-size-adjust: 100%;
190
- -webkit-font-smoothing: antialiased;
191
- -moz-osx-font-smoothing: grayscale;
192
- }
193
-
194
- [part='content'] {
195
- padding: var(--lumo-space-xs);
196
- }
197
-
198
- [part='backdrop'] {
199
- background-color: var(--lumo-shade-20pct);
200
- animation: 0.2s lumo-overlay-backdrop-enter both;
201
- will-change: opacity;
202
- }
203
-
204
- @keyframes lumo-overlay-backdrop-enter {
205
- 0% {
206
- opacity: 0;
207
- }
208
- }
209
-
210
- :host([closing]) [part='backdrop'] {
211
- animation: 0.2s lumo-overlay-backdrop-exit both;
212
- }
213
-
214
- @keyframes lumo-overlay-backdrop-exit {
215
- 100% {
216
- opacity: 0;
217
- }
218
- }
219
-
220
- @keyframes lumo-overlay-dummy-animation {
221
- 0% {
222
- opacity: 1;
223
- }
224
-
225
- 100% {
226
- opacity: 1;
227
- }
228
- }
229
- `;(0,n.hC)("",i,{moduleId:"lumo-overlay"})}}]);
@@ -1,27 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
-
7
- /**
8
- * @license
9
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
10
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
11
- */
12
-
13
- /**
14
- * @license
15
- * Copyright (c) 2023 Vaadin Ltd.
16
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
17
- */
18
-
19
- /**
20
- @license
21
- Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
22
- This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
23
- The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
24
- The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
25
- Code distributed by Google as part of the polymer project is also
26
- subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
27
- */