@descope/web-components-ui 1.0.206 → 1.0.207

Sign up to get free protection for your applications and to get access to all the features.
package/dist/umd/3208.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 3208.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[3208],{3208:(e,t,u)=>{u.d(t,{b:()=>i});var s=u(4271);class i extends s.n{constructor(e,t){super(e,"input","input",{initializer:(e,u)=>{u.value&&e.setAttribute("value",u.value),u.type&&e.setAttribute("type",u.type),e.id=this.defaultId,"function"==typeof t&&t(e)},useUniqueId:!0})}}}}]);
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[3208],{3208:(e,t,u)=>{u.d(t,{b:()=>i});var s=u(9229);class i extends s.n{constructor(e,t){super(e,"input","input",{initializer:(e,u)=>{u.value&&(e.value=u.value),u.type&&e.setAttribute("type",u.type),e.id=this.defaultId,"function"==typeof t&&t(e)},useUniqueId:!0})}}}}]);
package/dist/umd/422.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 422.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[422],{422:(e,t,a)=>{a.d(t,{j:()=>u});var s=a(2006);const u=e=>class extends((0,s.L)(e)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(e){this.__dataValue=e}_inputElementChanged(e){super._inputElementChanged(e),e&&(e.value&&e.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),e.value=""),this.value&&(e.value=this.value))}_setFocused(e){super._setFocused(e),e||this.validate()}_onInput(e){super._onInput(e),this.invalid&&this.validate()}_valueChanged(e,t){super._valueChanged(e,t),void 0!==t&&this.invalid&&this.validate()}}}}]);
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[422],{422:(e,t,a)=>{a.d(t,{j:()=>u});var s=a(3398);const u=e=>class extends((0,s.L)(e)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(e){this.__dataValue=e}_inputElementChanged(e){super._inputElementChanged(e),e&&(e.value&&e.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),e.value=""),this.value&&(e.value=this.value))}_setFocused(e){super._setFocused(e),!e&&document.hasFocus()&&this.validate()}_onInput(e){super._onInput(e),this.invalid&&this.validate()}_valueChanged(e,t){super._valueChanged(e,t),void 0!==t&&this.invalid&&this.validate()}}}}]);
@@ -0,0 +1,215 @@
1
+ /*! For license information please see 4767.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[4767],{2223:(e,t,o)=>{o.d(t,{T8:()=>l}),o(7894);let s=!1,i=[],n=[];function r(){s=!0,requestAnimationFrame((function(){s=!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())}(n)}))}))}function a(e){const t=e[0],o=e[1],s=e[2];try{o.apply(t,s)}catch(e){setTimeout((()=>{throw e}))}}function l(e,t,o){s||r(),n.push([e,t,o])}},962:(e,t,o)=>{o.d(t,{Ry:()=>d});let s=new WeakMap,i=new WeakMap,n={},r=0;const a=e=>e&&e.nodeType===Node.ELEMENT_NODE,l=(...e)=>{console.error(`Error: ${e.join(" ")}. Skip setting aria-hidden.`)},d=(e,t=document.body,o="data-aria-hidden")=>{const d=Array.from(Array.isArray(e)?e:[e]);return t&&d.push(...Array.from(t.querySelectorAll("[aria-live]"))),((e,t,o,d)=>{const h=((e,t)=>a(e)?t.map((t=>{if(!a(t))return l(t,"is not a valid element"),null;let o=t;for(;o&&o!==e;){if(e.contains(o))return t;o=o.getRootNode().host}return l(t,"is not contained inside",e),null})).filter((e=>Boolean(e))):(l(e,"is not a valid element"),[]))(t,Array.isArray(e)?e:[e]);n[o]||(n[o]=new WeakMap);const c=n[o],u=[],p=new Set,_=new Set(h),m=e=>{if(!e||p.has(e))return;p.add(e);const t=e.assignedSlot;t&&m(t),m(e.parentNode||e.host)};h.forEach(m);const v=e=>{if(!e||_.has(e))return;const t=e.shadowRoot;(t?[...e.children,...t.children]:[...e.children]).forEach((e=>{if(!["template","script","style"].includes(e.localName))if(p.has(e))v(e);else{const t=e.getAttribute(d),n=null!==t&&"false"!==t,r=(s.get(e)||0)+1,a=(c.get(e)||0)+1;s.set(e,r),c.set(e,a),u.push(e),1===r&&n&&i.set(e,!0),1===a&&e.setAttribute(o,"true"),n||e.setAttribute(d,"true")}}))};return v(t),p.clear(),r+=1,()=>{u.forEach((e=>{const t=s.get(e)-1,n=c.get(e)-1;s.set(e,t),c.set(e,n),t||(i.has(e)?i.delete(e):e.removeAttribute(d)),n||e.removeAttribute(o)})),r-=1,r||(s=new WeakMap,s=new WeakMap,i=new WeakMap,n={})}})(d,t,o,"aria-hidden")};HTMLElement.prototype},9320:(e,t,o)=>{o.d(t,{u:()=>s});const s=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 s="string"==typeof e?e.split(" "):[];s.length>0&&o.add(...s),this.__previousClasses=s}}},9580:(e,t,o)=>{o.d(t,{B:()=>s});class s{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")}}},7673:(e,t,o)=>{o.d(t,{F:()=>m});var s=o(2223),i=o(1037),n=o(962);class r{constructor(e,t){this.host=e,this.callback="function"==typeof t?t:()=>e}showModal(){const e=this.callback();this.__showOthers=(0,n.Ry)(e)}close(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null)}}var a=o(3550);class l{saveFocus(e){this.focusNode=e||(0,a.Gf)()}restoreFocus(){const e=this.focusNode;e&&((0,a.Gf)()===document.body?setTimeout((()=>e.focus())):e.focus(),this.focusNode=null)}}const d=[];class h{constructor(e){this.host=e,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){return(0,a.GO)(this.__trapNode)}get __focusedElementIndex(){const e=this.__focusableElements;return e.indexOf(e.filter(a.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,s=this.__focusedElementIndex,i=t[(t.length+s+o)%t.length];i.focus(),"input"===i.localName&&i.select()}}var c=o(6155);const u=e=>class extends((0,c.k)(e)){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new r(this),this.__focusTrapController=new h(this),this.__focusRestorationController=new l}ready(){super.ready(),this.addController(this.__ariaModalController),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}_resetFocus(){this.focusTrap&&(this.__ariaModalController.close(),this.__focusTrapController.releaseFocus()),this.restoreFocusOnClose&&this._shouldRestoreFocus()&&this.__focusRestorationController.restoreFocus()}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&(this.__ariaModalController.showModal(),this.__focusTrapController.trapFocus(this.$.overlay))}_shouldRestoreFocus(){const e=(0,a.Gf)();return e===document.body||this._deepContains(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}},p=()=>Array.from(document.body.children).filter((e=>e instanceof HTMLElement&&e._hasOverlayStackMixin&&!e.hasAttribute("closing"))).sort(((e,t)=>e.__zIndex-t.__zIndex||0)),_=e=>class extends e{constructor(){super(),this._hasOverlayStackMixin=!0}get _last(){return this===p().pop()}bringToFront(){let e="";const t=p().filter((e=>e!==this)).pop();t&&(e=t.__zIndex+1),this.style.zIndex=e,this.__zIndex=e||parseFloat(getComputedStyle(this).zIndex)}_enterModalState(){"none"!==document.body.style.pointerEvents&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),p().forEach((e=>{e!==this&&(e.$.overlay.style.pointerEvents="none")}))}_exitModalState(){void 0!==this._previousDocumentPointerEvents&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);const e=p();let t;for(;(t=e.pop())&&(t===this||(t.$.overlay.style.removeProperty("pointer-events"),t.modeless)););}},m=e=>class extends(u(_(e))){static get properties(){return{opened:{type:Boolean,notify:!0,observer:"_openedChanged",reflectToAttribute:!0},owner:{type:Object},model:{type:Object},renderer:{type:Object},modeless:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_modelessChanged"},hidden:{type:Boolean,reflectToAttribute:!0,observer:"_hiddenChanged"},withBackdrop:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["_rendererOrDataChanged(renderer, owner, model, opened)"]}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),i.gn&&(this._boundIosResizeListener=()=>this._detectIosNavbar())}ready(){super.ready(),this.addEventListener("click",(()=>{})),this.$.backdrop.addEventListener("click",(()=>{}))}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)}close(e){const t=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),t.defaultPrevented||(this.opened=!1)}_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")}_addGlobalListeners(){document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0)}_removeGlobalListeners(){document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0)}_rendererOrDataChanged(e,t,o,s){const i=this._oldOwner!==t||this._oldModel!==o;this._oldModel=o,this._oldOwner=t;const n=this._oldRenderer!==e;this._oldRenderer=e;const r=this._oldOpened!==s;this._oldOpened=s,n&&(this.innerHTML="",delete this._$litPart$),s&&e&&(n||r||i)&&this.requestContentUpdate()}_modelessChanged(e){e?(this._removeGlobalListeners(),this._exitModalState()):this.opened&&(this._addGlobalListeners(),this._enterModalState())}_openedChanged(e,t){e?(this._saveFocus(),this._animatedOpening(),(0,s.T8)(this,(()=>{this._trapFocus();const e=new CustomEvent("vaadin-overlay-open",{bubbles:!0});this.dispatchEvent(e)})),document.addEventListener("keydown",this._boundKeydownListener),this.modeless||this._addGlobalListeners()):t&&(this._resetFocus(),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`,s=e=>{e&&e.target!==this||(t(),this.removeEventListener("animationend",s),delete this[o])};this[o]=s,this.addEventListener("animationend",s)}_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(){this.hasAttribute("opening")&&this._flushAnimation("opening"),this._placeholder&&(this._exitModalState(),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)}_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)}}}},3373:(e,t,o)=>{o.d(t,{y:()=>a});var s=o(3726);const i={start:"top",end:"bottom"},n={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,s.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,s=this.__shouldAlignStartHorizontally(e,o),r=!o&&s||o&&!s;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,n,this,s);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 s=Math.min(window.innerWidth,document.documentElement.clientWidth),i=!t&&"start"===this.horizontalAlign||t&&"end"===this.horizontalAlign;return this.__shouldAlignStart(e,o,s,this.__margins,i,this.noHorizontalOverlap,n)}__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),s="top"===this.verticalAlign;return this.__shouldAlignStart(e,t,o,this.__margins,s,this.noVerticalOverlap,i)}__shouldAlignStart(e,t,o,s,i,n,r){const a=o-e[n?r.end:r.start]-s[r.end],l=e[n?r.start:r.end]-s[r.start],d=i?a:l;return i===(d>(i?l:a)||d>t)}__adjustBottomProperty(e,t,o){let s;if(e===t.end){if(t.end===i.end){const e=Math.min(window.innerHeight,document.documentElement.clientHeight);o>e&&this.__oldViewportHeight&&(s=o-(this.__oldViewportHeight-e)),this.__oldViewportHeight=e}if(t.end===n.end){const e=Math.min(window.innerWidth,document.documentElement.clientWidth);o>e&&this.__oldViewportWidth&&(s=o-(this.__oldViewportWidth-e)),this.__oldViewportWidth=e}}return s}__calculatePositionInOneDimension(e,t,o,s,i,n){const r=n?s.start:s.end,a=n?s.end:s.start,l=parseFloat(i.style[r]||getComputedStyle(i)[r]),d=this.__adjustBottomProperty(r,s,l),h=t[n?s.start:s.end]-e[o===n?s.end:s.start];return{[r]:d?`${d}px`:`${l+h*(n?-1:1)}px`,[a]:""}}}},6196:(e,t,o)=>{o.d(t,{r:()=>s});const s=o(9897).iv`
3
+ :host {
4
+ z-index: 200;
5
+ position: fixed;
6
+
7
+ /* Despite of what the names say, <vaadin-overlay> is just a container
8
+ for position/sizing/alignment. The actual overlay is the overlay part. */
9
+
10
+ /* Default position constraints: the entire viewport. Note: themes can
11
+ override this to introduce gaps between the overlay and the viewport. */
12
+ inset: 0;
13
+ bottom: var(--vaadin-overlay-viewport-bottom);
14
+
15
+ /* Use flexbox alignment for the overlay part. */
16
+ display: flex;
17
+ flex-direction: column; /* makes dropdowns sizing easier */
18
+ /* Align to center by default. */
19
+ align-items: center;
20
+ justify-content: center;
21
+
22
+ /* Allow centering when max-width/max-height applies. */
23
+ margin: auto;
24
+
25
+ /* The host is not clickable, only the overlay part is. */
26
+ pointer-events: none;
27
+
28
+ /* Remove tap highlight on touch devices. */
29
+ -webkit-tap-highlight-color: transparent;
30
+
31
+ /* CSS API for host */
32
+ --vaadin-overlay-viewport-bottom: 0;
33
+ }
34
+
35
+ :host([hidden]),
36
+ :host(:not([opened]):not([closing])) {
37
+ display: none !important;
38
+ }
39
+
40
+ [part='overlay'] {
41
+ -webkit-overflow-scrolling: touch;
42
+ overflow: auto;
43
+ pointer-events: auto;
44
+
45
+ /* Prevent overflowing the host */
46
+ max-width: 100%;
47
+ box-sizing: border-box;
48
+
49
+ -webkit-tap-highlight-color: initial; /* reenable tap highlight inside */
50
+ }
51
+
52
+ [part='backdrop'] {
53
+ z-index: -1;
54
+ content: '';
55
+ background: rgba(0, 0, 0, 0.5);
56
+ position: fixed;
57
+ inset: 0;
58
+ pointer-events: auto;
59
+ }
60
+ `},6754:(e,t,o)=>{o.d(t,{L:()=>a,e:()=>n}),o(9416),o(9849);var s=o(5128),i=o(510);const n=s.iv`
61
+ :host([opening]),
62
+ :host([closing]) {
63
+ animation: 0.14s lumo-overlay-dummy-animation;
64
+ }
65
+
66
+ [part='overlay'] {
67
+ will-change: opacity, transform;
68
+ }
69
+
70
+ :host([opening]) [part='overlay'] {
71
+ animation: 0.1s lumo-menu-overlay-enter ease-out both;
72
+ }
73
+
74
+ @keyframes lumo-menu-overlay-enter {
75
+ 0% {
76
+ opacity: 0;
77
+ transform: translateY(-4px);
78
+ }
79
+ }
80
+
81
+ :host([closing]) [part='overlay'] {
82
+ animation: 0.1s lumo-menu-overlay-exit both;
83
+ }
84
+
85
+ @keyframes lumo-menu-overlay-exit {
86
+ 100% {
87
+ opacity: 0;
88
+ }
89
+ }
90
+ `;(0,s.hC)("",n,{moduleId:"lumo-menu-overlay-core"});const r=s.iv`
91
+ /* Small viewport (bottom sheet) styles */
92
+ /* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
93
+ @media (max-width: 420px), (max-height: 420px) {
94
+ :host {
95
+ top: 0 !important;
96
+ right: 0 !important;
97
+ bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
98
+ left: 0 !important;
99
+ align-items: stretch !important;
100
+ justify-content: flex-end !important;
101
+ }
102
+
103
+ [part='overlay'] {
104
+ max-height: 50vh;
105
+ width: 100vw;
106
+ border-radius: 0;
107
+ box-shadow: var(--lumo-box-shadow-xl);
108
+ }
109
+
110
+ /* The content part scrolls instead of the overlay part, because of the gradient fade-out */
111
+ [part='content'] {
112
+ padding: 30px var(--lumo-space-m);
113
+ max-height: inherit;
114
+ box-sizing: border-box;
115
+ -webkit-overflow-scrolling: touch;
116
+ overflow: auto;
117
+ -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
118
+ mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
119
+ }
120
+
121
+ [part='backdrop'] {
122
+ display: block;
123
+ }
124
+
125
+ /* Animations */
126
+
127
+ :host([opening]) [part='overlay'] {
128
+ animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
129
+ }
130
+
131
+ :host([closing]),
132
+ :host([closing]) [part='backdrop'] {
133
+ animation-delay: 0.14s;
134
+ }
135
+
136
+ :host([closing]) [part='overlay'] {
137
+ animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
138
+ }
139
+ }
140
+
141
+ @keyframes lumo-mobile-menu-overlay-enter {
142
+ 0% {
143
+ transform: translateY(150%);
144
+ }
145
+ }
146
+
147
+ @keyframes lumo-mobile-menu-overlay-exit {
148
+ 100% {
149
+ transform: translateY(150%);
150
+ }
151
+ }
152
+ `,a=[i.I,n,r];(0,s.hC)("",a,{moduleId:"lumo-menu-overlay"})},510:(e,t,o)=>{o.d(t,{I:()=>i}),o(1195),o(9416),o(9849),o(4173);var s=o(5128);const i=s.iv`
153
+ :host {
154
+ top: var(--lumo-space-m);
155
+ right: var(--lumo-space-m);
156
+ bottom: var(--lumo-space-m);
157
+ left: var(--lumo-space-m);
158
+ /* Workaround for Edge issue (only on Surface), where an overflowing vaadin-list-box inside vaadin-select-overlay makes the overlay transparent */
159
+ /* stylelint-disable-next-line */
160
+ outline: 0px solid transparent;
161
+ }
162
+
163
+ [part='overlay'] {
164
+ background-color: var(--lumo-base-color);
165
+ background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
166
+ border-radius: var(--lumo-border-radius-m);
167
+ box-shadow: 0 0 0 1px var(--lumo-shade-5pct), var(--lumo-box-shadow-m);
168
+ color: var(--lumo-body-text-color);
169
+ font-family: var(--lumo-font-family);
170
+ font-size: var(--lumo-font-size-m);
171
+ font-weight: 400;
172
+ line-height: var(--lumo-line-height-m);
173
+ letter-spacing: 0;
174
+ text-transform: none;
175
+ -webkit-text-size-adjust: 100%;
176
+ -webkit-font-smoothing: antialiased;
177
+ -moz-osx-font-smoothing: grayscale;
178
+ }
179
+
180
+ [part='content'] {
181
+ padding: var(--lumo-space-xs);
182
+ }
183
+
184
+ [part='backdrop'] {
185
+ background-color: var(--lumo-shade-20pct);
186
+ animation: 0.2s lumo-overlay-backdrop-enter both;
187
+ will-change: opacity;
188
+ }
189
+
190
+ @keyframes lumo-overlay-backdrop-enter {
191
+ 0% {
192
+ opacity: 0;
193
+ }
194
+ }
195
+
196
+ :host([closing]) [part='backdrop'] {
197
+ animation: 0.2s lumo-overlay-backdrop-exit both;
198
+ }
199
+
200
+ @keyframes lumo-overlay-backdrop-exit {
201
+ 100% {
202
+ opacity: 0;
203
+ }
204
+ }
205
+
206
+ @keyframes lumo-overlay-dummy-animation {
207
+ 0% {
208
+ opacity: 1;
209
+ }
210
+
211
+ 100% {
212
+ opacity: 1;
213
+ }
214
+ }
215
+ `;(0,s.hC)("",i,{moduleId:"lumo-overlay"})}}]);
@@ -4,6 +4,12 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
 
7
+ /**
8
+ * @license
9
+ * Copyright (c) 2017 Anton Korzunov
10
+ * SPDX-License-Identifier: MIT
11
+ */
12
+
7
13
  /**
8
14
  * @license
9
15
  * Copyright (c) 2021 - 2023 Vaadin Ltd.
package/dist/umd/5806.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see 5806.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[5806],{5806:(e,t,n)=>{n(3787),n(9098);var i=n(4398),s=n(2279),a=n(5128);const r=a.iv`
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[5806],{5806:(e,t,n)=>{n(3787),n(9098);var i=n(4398),s=n(2279),r=n(5128);const a=r.iv`
3
3
  :host([step-buttons-visible]:not([theme~='align-right'])) ::slotted(input) {
4
4
  text-align: center;
5
5
  }
@@ -35,7 +35,7 @@
35
35
  :host([dir='rtl']:not([theme~='align-right'])) ::slotted(input) {
36
36
  --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
37
37
  }
38
- `;(0,a.hC)("vaadin-number-field",[s.J,i.q,r],{moduleId:"lumo-number-field"}),n(3130);var l=n(4241),o=n(2521),u=n(4463),h=n(2743),d=n(3208),p=n(422),c=n(6729);const m=e=>class extends((0,p.j)(e)){static get properties(){return{min:{type:Number},max:{type:Number},step:{type:Number},stepButtonsVisible:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["_stepChanged(step, inputElement)"]}static get delegateProps(){return[...super.delegateProps,"min","max"]}static get constraints(){return[...super.constraints,"min","max","step"]}constructor(){super(),this._setType("number")}get slotStyles(){const e=this.localName;return[`\n ${e} input[type="number"]::-webkit-outer-spin-button,\n ${e} input[type="number"]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n ${e} input[type="number"] {\n -moz-appearance: textfield;\n }\n\n ${e}[dir='rtl'] input[type="number"]::placeholder {\n direction: rtl;\n }\n\n ${e}[dir='rtl']:not([step-buttons-visible]) input[type="number"]::placeholder {\n text-align: left;\n }\n `]}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new d.b(this,(e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e}))),this.addController(new c.v(this.inputElement,this._labelController))}checkValidity(){return this.inputElement?this.inputElement.checkValidity():!this.invalid}_onDecreaseButtonTouchend(e){e.preventDefault(),this._decreaseValue()}_onIncreaseButtonTouchend(e){e.preventDefault(),this._increaseValue()}_onDecreaseButtonClick(){this._decreaseValue()}_onIncreaseButtonClick(){this._increaseValue()}_decreaseValue(){this._incrementValue(-1)}_increaseValue(){this._incrementValue(1)}_incrementValue(e){if(this.disabled||this.readonly)return;const t=this.step||1;let n=parseFloat(this.value);this.value?n<this.min?(e=0,n=this.min):n>this.max&&(e=0,n=this.max):0===this.min&&e<0||0===this.max&&e>0||0===this.max&&0===this.min?(e=0,n=0):(null==this.max||this.max>=0)&&(null==this.min||this.min<=0)?n=0:this.min>0?(n=this.min,this.max<0&&e<0&&(n=this.max),e=0):this.max<0&&(n=this.max,e<0?e=0:this._getIncrement(1,n-t)>this.max?n-=2*t:n-=t);const i=this._getIncrement(e,n);this.value&&0!==e&&!this._incrementIsInsideTheLimits(e,n)||this._setValue(i)}_setValue(e){this.value=this.inputElement.value=String(parseFloat(e)),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}_getIncrement(e,t){let n=this.step||1,i=this.min||0;const s=Math.max(this._getMultiplier(t),this._getMultiplier(n),this._getMultiplier(i));n*=s,i*=s;const a=((t=Math.round(t*s))-i)%n;return e>0?(t-a+n)/s:e<0?(t-(a||n))/s:t/s}_getDecimalCount(e){const t=String(e),n=t.indexOf(".");return-1===n?1:t.length-n-1}_getMultiplier(e){if(!isNaN(e))return 10**this._getDecimalCount(e)}_incrementIsInsideTheLimits(e,t){return e<0?null==this.min||this._getIncrement(e,t)>=this.min:e>0?null==this.max||this._getIncrement(e,t)<=this.max:this._getIncrement(e,t)<=this.max&&this._getIncrement(e,t)>=this.min}_isButtonEnabled(e){const t=e*(this.step||1),n=parseFloat(this.value);return!this.value||!this.disabled&&this._incrementIsInsideTheLimits(t,n)}_stepChanged(e,t){t&&(t.step=e||"any")}_valueChanged(e,t){e&&isNaN(parseFloat(e))?this.value="":"string"!=typeof this.value&&(this.value=String(this.value)),super._valueChanged(this.value,t)}_onKeyDown(e){"ArrowUp"===e.key?(e.preventDefault(),this._increaseValue()):"ArrowDown"===e.key&&(e.preventDefault(),this._decreaseValue()),super._onKeyDown(e)}_setHasInputValue(e){const t=e.composedPath()[0];this._hasInputValue=t.value.length>0||t.validity.badInput}},b=n(9897).iv`
38
+ `;(0,r.hC)("vaadin-number-field",[s.J,i.q,a],{moduleId:"lumo-number-field"}),n(3130);var l=n(4241),o=n(2807),u=n(2521),h=n(4463),d=n(2743),p=n(3208),c=n(422),m=n(6729);const b=e=>class extends((0,c.j)(e)){static get properties(){return{min:{type:Number},max:{type:Number},step:{type:Number},stepButtonsVisible:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["_stepChanged(step, inputElement)"]}static get delegateProps(){return[...super.delegateProps,"min","max"]}static get constraints(){return[...super.constraints,"min","max","step"]}constructor(){super(),this._setType("number"),this.__onWheel=this.__onWheel.bind(this)}get slotStyles(){const e=this.localName;return[`\n ${e} input[type="number"]::-webkit-outer-spin-button,\n ${e} input[type="number"]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n ${e} input[type="number"] {\n -moz-appearance: textfield;\n }\n\n ${e}[dir='rtl'] input[type="number"]::placeholder {\n direction: rtl;\n }\n\n ${e}[dir='rtl']:not([step-buttons-visible]) input[type="number"]::placeholder {\n text-align: left;\n }\n `]}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new p.b(this,(e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e}))),this.addController(new m.v(this.inputElement,this._labelController))}checkValidity(){return this.inputElement?this.inputElement.checkValidity():!this.invalid}_addInputListeners(e){super._addInputListeners(e),e.addEventListener("wheel",this.__onWheel)}_removeInputListeners(e){super._removeInputListeners(e),e.removeEventListener("wheel",this.__onWheel)}__onWheel(e){this.hasAttribute("focused")&&e.preventDefault()}_onDecreaseButtonTouchend(e){e.preventDefault(),this._decreaseValue()}_onIncreaseButtonTouchend(e){e.preventDefault(),this._increaseValue()}_onDecreaseButtonClick(){this._decreaseValue()}_onIncreaseButtonClick(){this._increaseValue()}_decreaseValue(){this._incrementValue(-1)}_increaseValue(){this._incrementValue(1)}_incrementValue(e){if(this.disabled||this.readonly)return;const t=this.step||1;let n=parseFloat(this.value);this.value?n<this.min?(e=0,n=this.min):n>this.max&&(e=0,n=this.max):0===this.min&&e<0||0===this.max&&e>0||0===this.max&&0===this.min?(e=0,n=0):(null==this.max||this.max>=0)&&(null==this.min||this.min<=0)?n=0:this.min>0?(n=this.min,this.max<0&&e<0&&(n=this.max),e=0):this.max<0&&(n=this.max,e<0?e=0:this._getIncrement(1,n-t)>this.max?n-=2*t:n-=t);const i=this._getIncrement(e,n);this.value&&0!==e&&!this._incrementIsInsideTheLimits(e,n)||this._setValue(i)}_setValue(e){this.value=this.inputElement.value=String(parseFloat(e)),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}_getIncrement(e,t){let n=this.step||1,i=this.min||0;const s=Math.max(this._getMultiplier(t),this._getMultiplier(n),this._getMultiplier(i));n*=s,i*=s;const r=((t=Math.round(t*s))-i)%n;return e>0?(t-r+n)/s:e<0?(t-(r||n))/s:t/s}_getDecimalCount(e){const t=String(e),n=t.indexOf(".");return-1===n?1:t.length-n-1}_getMultiplier(e){if(!isNaN(e))return 10**this._getDecimalCount(e)}_incrementIsInsideTheLimits(e,t){return e<0?null==this.min||this._getIncrement(e,t)>=this.min:e>0?null==this.max||this._getIncrement(e,t)<=this.max:this._getIncrement(e,t)<=this.max&&this._getIncrement(e,t)>=this.min}_isButtonEnabled(e){const t=e*(this.step||1),n=parseFloat(this.value);return!this.value||!this.disabled&&this._incrementIsInsideTheLimits(t,n)}_stepChanged(e,t){t&&(t.step=e||"any")}_valueChanged(e,t){e&&isNaN(parseFloat(e))?this.value="":"string"!=typeof this.value&&(this.value=String(this.value)),super._valueChanged(this.value,t)}_onKeyDown(e){"ArrowUp"===e.key?(e.preventDefault(),this._increaseValue()):"ArrowDown"===e.key&&(e.preventDefault(),this._decreaseValue()),super._onKeyDown(e)}_setHasInputValue(e){const t=e.composedPath()[0];this._hasInputValue=t.value.length>0||t.validity.badInput}},_=n(9897).iv`
39
39
  :host([readonly]) [part$='button'] {
40
40
  pointer-events: none;
41
41
  }
@@ -58,7 +58,7 @@
58
58
  :host([dir='rtl']) [part='input-field'] {
59
59
  direction: ltr;
60
60
  }
61
- `;(0,a.hC)("vaadin-number-field",[h.J,b],{moduleId:"vaadin-number-field-styles"});class v extends(m((0,a.Tb)((0,o.S)(l.H3)))){static get is(){return"vaadin-number-field"}static get template(){return l.dy`
61
+ `;(0,r.hC)("vaadin-number-field",[d.J,_],{moduleId:"vaadin-number-field-styles"});class v extends(b((0,r.Tb)((0,u.S)(l.H3)))){static get is(){return"vaadin-number-field"}static get template(){return l.dy`
62
62
  <div class="vaadin-field-container">
63
63
  <div part="label">
64
64
  <slot name="label"></slot>
@@ -106,4 +106,4 @@
106
106
  </div>
107
107
 
108
108
  <slot name="tooltip"></slot>
109
- `}ready(){super.ready(),this._tooltipController=new u.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top")}}customElements.define(v.is,v)}}]);
109
+ `}ready(){super.ready(),this._tooltipController=new h.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement)}}(0,o.M)(v)}}]);