@descope/web-components-ui 1.0.378 → 1.0.379
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +3166 -1257
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +4738 -2826
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1224.js +1 -1
- package/dist/umd/1438.js +3 -3
- package/dist/umd/1612.js +1 -1
- package/dist/umd/2773.js +4 -4
- package/dist/umd/3830.js +1 -1
- package/dist/umd/3951.js +1 -1
- package/dist/umd/3966.js +319 -0
- package/dist/umd/4024.js +1 -1
- package/dist/umd/4052.js +1 -1
- package/dist/umd/4392.js +1 -1
- package/dist/umd/4525.js +1 -1
- package/dist/umd/4978.js +1 -1
- package/dist/umd/5135.js +2 -2
- package/dist/umd/5517.js +1 -1
- package/dist/umd/5778.js +275 -0
- package/dist/umd/5806.js +1 -1
- package/dist/umd/5977.js +140 -0
- package/dist/umd/5977.js.LICENSE.txt +29 -0
- package/dist/umd/63.js +4 -4
- package/dist/umd/6770.js +1 -1
- package/dist/umd/7056.js +3 -3
- package/dist/umd/7284.js +1 -1
- package/dist/umd/7541.js +449 -0
- package/dist/umd/7541.js.LICENSE.txt +17 -0
- package/dist/umd/7911.js +2 -2
- package/dist/umd/{4028.js → 8060.js} +3 -3
- package/dist/umd/8137.js +1 -1
- package/dist/umd/8191.js +2 -2
- package/dist/umd/8655.js +123 -0
- package/dist/umd/9314.js +2 -2
- package/dist/umd/9423.js +6 -6
- package/dist/umd/9562.js +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-apps-list-index-js.js +1 -1
- package/dist/umd/descope-avatar-index-js.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-combo-box-index-js.js +5 -5
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -0
- package/dist/umd/descope-date-field-index-js.js +1 -0
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +2 -2
- package/dist/umd/descope-grid-descope-grid-item-details-column-index-js.js +2 -2
- package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +4 -4
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-number-field-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-radio-group-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
- package/package.json +11 -5
- package/src/components/descope-combo-box/ComboBoxClass.js +7 -1
- package/src/components/descope-date-field/DateCounterClass.js +83 -0
- package/src/components/descope-date-field/DateFieldClass.js +675 -0
- package/src/components/descope-date-field/consts.js +55 -0
- package/src/components/descope-date-field/descope-calendar/CalendarClass.js +666 -0
- package/src/components/descope-date-field/descope-calendar/helpers.js +186 -0
- package/src/components/descope-date-field/descope-calendar/index.js +9 -0
- package/src/components/descope-date-field/formats.js +49 -0
- package/src/components/descope-date-field/helpers.js +72 -0
- package/src/components/descope-date-field/icons.js +14 -0
- package/src/components/descope-date-field/index.js +10 -0
- package/src/components/descope-text-field/textFieldMappings.js +2 -0
- package/src/index.cjs.js +2 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -1
- package/src/mixins/inputValidationMixin.js +8 -2
- package/src/mixins/portalMixin.js +6 -3
- package/src/theme/components/calendar.js +94 -0
- package/src/theme/components/dateField.js +63 -0
- package/src/theme/components/index.js +4 -0
- package/src/theme/components/inputWrapper.js +6 -0
- package/src/theme/components/textField.js +1 -0
- package/dist/umd/4746.js +0 -124
- package/dist/umd/7531.js +0 -319
- package/dist/umd/8866.js +0 -275
- package/dist/umd/9092.js +0 -1086
- package/dist/umd/9092.js.LICENSE.txt +0 -27
- package/dist/umd/descope-date-picker-index-js.js +0 -1
- package/src/components/descope-date-picker/index.js +0 -20
- /package/dist/umd/{7531.js.LICENSE.txt → 3966.js.LICENSE.txt} +0 -0
- /package/dist/umd/{8866.js.LICENSE.txt → 5778.js.LICENSE.txt} +0 -0
- /package/dist/umd/{4028.js.LICENSE.txt → 8060.js.LICENSE.txt} +0 -0
- /package/dist/umd/{4746.js.LICENSE.txt → 8655.js.LICENSE.txt} +0 -0
package/dist/umd/5778.js
ADDED
@@ -0,0 +1,275 @@
|
|
1
|
+
/*! For license information please see 5778.js.LICENSE.txt */
|
2
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5778],{99031:(e,t,i)=>{i.d(t,{Y:()=>o});var s=i(94843);const o=e=>class extends e{static get properties(){return{pageSize:{type:Number,value:50,observer:"_pageSizeChanged"},size:{type:Number,observer:"_sizeChanged"},dataProvider:{type:Object,observer:"_dataProviderChanged"},_pendingRequests:{value:()=>({})},__placeHolder:{value:new s.h},__previousDataProviderFilter:{type:String}}}static get observers(){return["_dataProviderFilterChanged(filter)","_warnDataProviderValue(dataProvider, value)","_ensureFirstPage(opened)"]}ready(){super.ready(),this._scroller.addEventListener("index-requested",(e=>{const t=e.detail.index,i=e.detail.currentScrollerPos,s=Math.floor(1.5*this.pageSize);if(!this._shouldSkipIndex(t,s,i)&&void 0!==t){const e=this._getPageForIndex(t);this._shouldLoadPage(e)&&this._loadPage(e)}}))}_dataProviderFilterChanged(e){void 0!==this.__previousDataProviderFilter||""!==e?this.__previousDataProviderFilter!==e&&(this.__previousDataProviderFilter=e,this._pendingRequests={},this.loading=this._shouldFetchData(),this.size=void 0,this.clearCache()):this.__previousDataProviderFilter=e}_shouldFetchData(){return!!this.dataProvider&&(this.opened||this.filter&&this.filter.length)}_ensureFirstPage(e){e&&this._shouldLoadPage(0)&&this._loadPage(0)}_shouldSkipIndex(e,t,i){return 0!==i&&e>=i-t&&e<=i+t}_shouldLoadPage(e){if(!this.filteredItems||this._forceNextRequest)return this._forceNextRequest=!1,!0;const t=this.filteredItems[e*this.pageSize];return void 0!==t?t instanceof s.h:void 0===this.size}_loadPage(e){if(this._pendingRequests[e]||!this.dataProvider)return;const t={page:e,pageSize:this.pageSize,filter:this.filter},i=(s,o)=>{if(this._pendingRequests[e]!==i)return;const n=this.filteredItems?[...this.filteredItems]:[];n.splice(t.page*t.pageSize,s.length,...s),this.filteredItems=n,this.opened||this._isInputFocused()||this._commitValue(),void 0!==o&&(this.size=o),delete this._pendingRequests[e],0===Object.keys(this._pendingRequests).length&&(this.loading=!1)};this._pendingRequests[e]=i,this.loading=!0,this.dataProvider(t,i)}_getPageForIndex(e){return Math.floor(e/this.pageSize)}clearCache(){if(!this.dataProvider)return;this._pendingRequests={};const e=[];for(let t=0;t<(this.size||0);t++)e.push(this.__placeHolder);this.filteredItems=e,this._shouldFetchData()?(this._forceNextRequest=!1,this._loadPage(0)):this._forceNextRequest=!0}_sizeChanged(e=0){const t=(this.filteredItems||[]).slice(0,e);for(let i=0;i<e;i++)t[i]=void 0!==t[i]?t[i]:this.__placeHolder;this.filteredItems=t,this._flushPendingRequests(e)}_pageSizeChanged(e,t){if(Math.floor(e)!==e||e<1)throw this.pageSize=t,new Error("`pageSize` value must be an integer > 0");this.clearCache()}_dataProviderChanged(e,t){this._ensureItemsOrDataProvider((()=>{this.dataProvider=t})),this.clearCache()}_ensureItemsOrDataProvider(e){if(void 0!==this.items&&void 0!==this.dataProvider)throw e(),new Error("Using `items` and `dataProvider` together is not supported");this.dataProvider&&!this.filteredItems&&(this.filteredItems=[])}_warnDataProviderValue(e,t){if(e&&""!==t&&(void 0===this.selectedItem||null===this.selectedItem)){const e=this.__getItemIndexByValue(this.filteredItems,t);(e<0||!this._getItemLabel(this.filteredItems[e]))&&console.warn("Warning: unable to determine the label for the provided `value`. Nothing to display in the text field. This usually happens when setting an initial `value` before any items are returned from the `dataProvider` callback. Consider setting `selectedItem` instead of `value`")}}_flushPendingRequests(e){if(this._pendingRequests){const t=Math.ceil(e/this.pageSize);Object.entries(this._pendingRequests).forEach((([i,s])=>{parseInt(i)>=t&&s([],e)}))}}}},45115:(e,t,i)=>{i.d(t,{O:()=>s});const s=e=>class extends e{static get properties(){return{index:{type:Number},item:{type:Object},label:{type:String},selected:{type:Boolean,value:!1,reflectToAttribute:!0},focused:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Function}}}static get observers(){return["__rendererOrItemChanged(renderer, index, item.*, selected, focused)","__updateLabel(label, renderer)"]}static get observedAttributes(){return[...super.observedAttributes,"hidden"]}attributeChangedCallback(e,t,i){"hidden"===e&&null!==i?this.index=void 0:super.attributeChangedCallback(e,t,i)}connectedCallback(){super.connectedCallback(),this._owner=this.parentNode.owner;const e=this._owner.getAttribute("dir");e&&this.setAttribute("dir",e)}requestContentUpdate(){if(!this.renderer)return;const e={index:this.index,item:this.item,focused:this.focused,selected:this.selected};this.renderer(this,this._owner,e)}__rendererOrItemChanged(e,t,i){void 0!==i&&void 0!==t&&(this._oldRenderer!==e&&(this.innerHTML="",delete this._$litPart$),e&&(this._oldRenderer=e,this.requestContentUpdate()))}__updateLabel(e,t){t||(this.textContent=e)}}},66599:(e,t,i)=>{i.d(t,{t:()=>b});var s=i(95229),o=i(21360),n=i(3550),r=i(52628),a=i(61037),l=i(16155),d=i(39320),h=i(14905),u=i(40262),c=i(56326),m=i(34524);class _{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")}}var p=i(94843);function g(e){return null!=e}function v(e,t){return e.findIndex((e=>!(e instanceof p.h)&&t(e)))}const b=e=>class extends((0,d.u)((0,l.k)((0,m.n)((0,o.W)((0,r.L)((0,c.J)((0,s.f)(e)))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:Function,items:{type:Array,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged"},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1},filter:{type:String,value:"",notify:!0},selectedItem:{type:Object,notify:!0},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged"},itemValuePath:{type:String,value:"value"},itemIdPath:String,_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array},_closeOnBlurIsPrevented:Boolean,_scroller:Object,_overlayOpened:{type:Boolean,observer:"_overlayOpenedChanged"}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, theme)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(e){super._inputElementChanged(e);const t=this._nativeInput;t&&(t.autocomplete="off",t.autocapitalize="off",t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-expanded",!!this.opened),t.setAttribute("spellcheck","false"),t.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const e=()=>{requestAnimationFrame((()=>{this._overlayElement.bringToFront()}))};this.addEventListener("mousedown",e),this.addEventListener("touchstart",e),(0,u.k)(this),this.addController(new _(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach((e=>{e.requestContentUpdate()})))}open(){this.disabled||this.readonly||(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(e,t,i){super._propertiesChanged(e,t,i),void 0!==t.filter&&this._filterChanged(t.filter)}_initOverlay(){const e=this.$.overlay;e._comboBox=this,e.addEventListener("touchend",this._boundOnOverlayTouchAction),e.addEventListener("touchmove",this._boundOnOverlayTouchAction),e.addEventListener("mousedown",(e=>e.preventDefault())),e.addEventListener("opened-changed",(e=>{this._overlayOpened=e.detail.value})),this._overlayElement=e}_initScroller(e){const t=`${this._tagNamePrefix}-scroller`,i=this._overlayElement;i.renderer=e=>{e.firstChild||e.appendChild(document.createElement(t))},i.requestContentUpdate();const s=i.querySelector(t);s.owner=e||this,s.getItemLabel=this._getItemLabel.bind(this),s.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged),this._scroller=s}_updateScroller(e,t,i,s,o,n,r,a,l){e&&(i&&(e.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),e.setProperties({items:i?t:[],opened:i,loading:s,selectedItem:o,itemIdPath:n,focusedIndex:r,renderer:a,theme:l}))}_openedOrItemsChanged(e,t,i){this._overlayOpened=!(!e||!(i||t&&t.length))}_overlayOpenedChanged(e,t){e?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):t&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(e,t){void 0!==t&&this._updateActiveDescendant(e)}_isInputFocused(){return this.inputElement&&(0,n.Qw)(this.inputElement)}_updateActiveDescendant(e){const t=this._nativeInput;if(!t)return;const i=this._getItemElements().find((t=>t.index===e));i?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant")}_openedChanged(e,t){if(void 0===t)return;e?(this._openedWithFocusRing=this.hasAttribute("focus-ring"),this._isInputFocused()||a.T||this.inputElement&&this.inputElement.focus(),this._overlayElement.restoreFocusOnClose=!0):(this._onClosed(),this._openedWithFocusRing&&this._isInputFocused()&&this.setAttribute("focus-ring",""));const i=this._nativeInput;i&&(i.setAttribute("aria-expanded",!!e),e?i.setAttribute("aria-controls",this._scroller.id):i.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(e){return e.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(e){e.preventDefault(),this.inputElement.focus()}_onClearButtonClick(e){e.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(e){e.preventDefault(),this.opened?this.close():this.open()}_onHostClick(e){this.autoOpenDisabled||(e.preventDefault(),this.open())}_onClick(e){this._isClearButton(e)?this._onClearButtonClick(e):e.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(e):this._onHostClick(e)}_onKeyDown(e){super._onKeyDown(e),"Tab"===e.key?this._overlayElement.restoreFocusOnClose=!1:"ArrowDown"===e.key?(this._onArrowDown(),e.preventDefault()):"ArrowUp"===e.key&&(this._onArrowUp(),e.preventDefault())}_getItemLabel(e){let t=e&&this.itemLabelPath?(0,h.U)(this.itemLabelPath,e):void 0;return null==t&&(t=e?e.toString():""),t}_getItemValue(e){let t=e&&this.itemValuePath?(0,h.U)(this.itemValuePath,e):void 0;return void 0===t&&(t=e?e.toString():""),t}_onArrowDown(){if(this.opened){const e=this._dropdownItems;e&&(this._focusedIndex=Math.min(e.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const e=this._dropdownItems;e&&(this._focusedIndex=e.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){if(this._focusedIndex>-1){const e=this._dropdownItems[this._focusedIndex];this._inputElementValue=this._getItemLabel(e),this._markAllSelectionRange()}}_setSelectionRange(e,t){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(e,t)}_markAllSelectionRange(){void 0!==this._inputElementValue&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(void 0!==this._inputElementValue){const e=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(e,e)}}_closeOrCommit(){this.opened||this.loading?this.close():this._commitValue()}_onEnter(e){if(!this._hasValidInputValue())return e.preventDefault(),void e.stopPropagation();this.opened&&(e.preventDefault(),e.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const e=this._focusedIndex<0&&""!==this._inputElementValue&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!e}_onEscape(e){this.autoOpenDisabled?this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0?(e.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.clearButtonVisible&&!this.opened&&this.value&&(e.stopPropagation(),this._onClearAction()):this.opened?(e.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&(e.stopPropagation(),this._onClearAction())}_toggleElementChanged(e){e&&(e.addEventListener("mousedown",(e=>e.preventDefault())),e.addEventListener("click",(()=>{a.T&&!this._isInputFocused()&&document.activeElement.blur()})))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){this.loading&&!this.allowCustomValue||this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const e=this._dropdownItems[this._focusedIndex];this.selectedItem!==e&&(this.selectedItem=e),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(""===this._inputElementValue||void 0===this._inputElementValue)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const e=[this.selectedItem,...this._dropdownItems||[]],t=e[this.__getItemIndexByLabel(e,this._inputElementValue)];if(this.allowCustomValue&&!t){const e=this._inputElementValue;this._lastCustomValue=e;const t=new CustomEvent("custom-value-set",{detail:e,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(t),t.defaultPrevented||(this.value=e)}else this.allowCustomValue||this.opened||!t?this._inputElementValue=this.selectedItem?this._getItemLabel(this.selectedItem):this.value||"":this.value=this._getItemValue(t)}this._detectAndDispatchChange(),this._clearSelectionRange(),this.filter=""}_onInput(e){const t=this._inputElementValue,i={};this.filter===t?this._filterChanged(this.filter):i.filter=t,this.opened||this._isClearButton(e)||this.autoOpenDisabled||(i.opened=!0),this.setProperties(i)}_onChange(e){e.stopPropagation()}_itemLabelPathChanged(e){"string"!=typeof e&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(e){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,e):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this.allowCustomValue&&!this.selectedItem?this._inputElementValue=this.value:this._inputElementValue=this._getItemLabel(this.selectedItem)}_selectedItemChanged(e){if(null==e)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const t=this._getItemValue(e);if(this.value!==t&&(this.value=t,this.value!==t))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(e)}}_valueChanged(e,t){""===e&&void 0===t||(g(e)?(this._getItemValue(this.selectedItem)!==e&&this._selectItemForValue(e),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=e),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this.filter="",this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this.validate(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(e,t){this._ensureItemsOrDataProvider((()=>{this.items=t})),e?this.filteredItems=e.slice(0):t&&(this.filteredItems=null)}_filteredItemsChanged(e,t){this._setDropdownItems(e);const i=t?t[this._focusedIndex]:null,s=this.__getItemIndexByValue(e,this.value);(null===this.selectedItem||void 0===this.selectedItem)&&s>=0&&(this.selectedItem=e[s]);const o=this.__getItemIndexByValue(e,this._getItemValue(i));this._focusedIndex=o>-1?o:this.__getItemIndexByLabel(this.filteredItems,this.filter)}_filterItems(e,t){return e?e.filter((e=>(t=t?t.toString().toLowerCase():"",this._getItemLabel(e).toString().toLowerCase().indexOf(t)>-1))):e}_selectItemForValue(e){const t=this.__getItemIndexByValue(this.filteredItems,e),i=this.selectedItem;t>=0?this.selectedItem=this.filteredItems[t]:this.dataProvider&&void 0===this.selectedItem?this.selectedItem=void 0:this.selectedItem=null,null===this.selectedItem&&null===i&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(e){this._dropdownItems=e}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(e){this._scroller&&this._scroller.scrollIntoView(e)}__getItemIndexByValue(e,t){return e&&g(t)?v(e,(e=>this._getItemValue(e)===t)):-1}__getItemIndexByLabel(e,t){return e&&t?v(e,(e=>this._getItemLabel(e).toString().toLowerCase()===t.toString().toLowerCase())):-1}_overlaySelectedItemChanged(e){e.stopPropagation(),e.detail.item instanceof p.h||this.opened&&(this._focusedIndex=this.filteredItems.indexOf(e.detail.item),this.close())}_setFocused(e){if(super._setFocused(e),!e&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue)return void delete this._lastCustomValue;this._closeOrCommit()}}_shouldRemoveFocus(e){return!(e.relatedTarget&&e.relatedTarget.localName===`${this._tagNamePrefix}-item`||e.relatedTarget===this._overlayElement&&(e.composedPath()[0].focus(),1))}_onTouchend(e){this.clearElement&&e.composedPath()[0]===this.clearElement&&(e.preventDefault(),this._onClearAction())}}},43515:(e,t,i)=>{i.d(t,{H:()=>o});var s=i(63373);const o=e=>class extends((0,s.y)(e)){static get observers(){return["_setOverlayWidth(positionTarget, opened)"]}constructor(){super(),this.requiredVerticalSpace=200}connectedCallback(){super.connectedCallback();const e=this._comboBox,t=e&&e.getAttribute("dir");t&&this.setAttribute("dir",t)}_shouldCloseOnOutsideClick(e){const t=e.composedPath();return!t.includes(this.positionTarget)&&!t.includes(this)}_updateOverlayWidth(){const e=this.localName;this.style.setProperty(`--_${e}-default-width`,`${this.positionTarget.clientWidth}px`);const t=getComputedStyle(this._comboBox).getPropertyValue(`--${e}-width`);""===t?this.style.removeProperty(`--${e}-width`):this.style.setProperty(`--${e}-width`,t)}_setOverlayWidth(e,t){e&&t&&(this._updateOverlayWidth(),this._updatePosition())}}},94843:(e,t,i)=>{i.d(t,{h:()=>s});const s=class{toString(){return""}}},16557:(e,t,i)=>{i.d(t,{t:()=>a});var s=i(14905),o=i(73971),n=i(63003),r=i(94843);const a=e=>class extends e{static get properties(){return{items:{type:Array,observer:"__itemsChanged"},focusedIndex:{type:Number,observer:"__focusedIndexChanged"},loading:{type:Boolean,observer:"__loadingChanged"},opened:{type:Boolean,observer:"__openedChanged"},selectedItem:{type:Object,observer:"__selectedItemChanged"},itemIdPath:{type:String},owner:{type:Object},getItemLabel:{type:Object},renderer:{type:Object,observer:"__rendererChanged"},theme:{type:String}}}constructor(){super(),this.__boundOnItemClick=this.__onItemClick.bind(this)}get _viewportTotalPaddingBottom(){if(void 0===this._cachedViewportTotalPaddingBottom){const e=window.getComputedStyle(this.$.selector);this._cachedViewportTotalPaddingBottom=[e.paddingBottom,e.borderBottomWidth].map((e=>parseInt(e,10))).reduce(((e,t)=>e+t))}return this._cachedViewportTotalPaddingBottom}ready(){super.ready(),this.setAttribute("role","listbox"),this.id=`${this.localName}-${(0,o.l)()}`,this.__hostTagName=this.constructor.is.replace("-scroller",""),this.addEventListener("click",(e=>e.stopPropagation())),this.__patchWheelOverScrolling(),this.__virtualizer=new n.d({createElements:this.__createElements.bind(this),updateElement:this._updateElement.bind(this),elementsContainer:this,scrollTarget:this,scrollContainer:this.$.selector})}requestContentUpdate(){this.__virtualizer&&this.__virtualizer.update()}scrollIntoView(e){if(!(this.opened&&e>=0))return;const t=this._visibleItemsCount();let i=e;e>this.__virtualizer.lastVisibleIndex-1?(this.__virtualizer.scrollToIndex(e),i=e-t+1):e>this.__virtualizer.firstVisibleIndex&&(i=this.__virtualizer.firstVisibleIndex),this.__virtualizer.scrollToIndex(Math.max(0,i));const s=[...this.children].find((e=>!e.hidden&&e.index===this.__virtualizer.lastVisibleIndex));if(!s||e!==s.index)return;const o=s.getBoundingClientRect(),n=this.getBoundingClientRect(),r=o.bottom-n.bottom+this._viewportTotalPaddingBottom;r>0&&(this.scrollTop+=r)}_isItemSelected(e,t,i){return!(e instanceof r.h)&&(i&&void 0!==e&&void 0!==t?(0,s.U)(i,e)===(0,s.U)(i,t):e===t)}__itemsChanged(e){this.__virtualizer&&e&&(this.__virtualizer.size=e.length,this.__virtualizer.flush(),this.requestContentUpdate())}__loadingChanged(){this.requestContentUpdate()}__openedChanged(e){e&&this.requestContentUpdate()}__selectedItemChanged(){this.requestContentUpdate()}__focusedIndexChanged(e,t){e!==t&&this.requestContentUpdate(),e>=0&&!this.loading&&this.scrollIntoView(e)}__rendererChanged(e,t){(e||t)&&this.requestContentUpdate()}__createElements(e){return[...Array(e)].map((()=>{const e=document.createElement(`${this.__hostTagName}-item`);return e.addEventListener("click",this.__boundOnItemClick),e.tabIndex="-1",e.style.width="100%",e}))}_updateElement(e,t){const i=this.items[t],s=this.focusedIndex,o=this._isItemSelected(i,this.selectedItem,this.itemIdPath);e.setProperties({item:i,index:t,label:this.getItemLabel(i),selected:o,renderer:this.renderer,focused:!this.loading&&s===t}),e.id=`${this.__hostTagName}-item-${t}`,e.setAttribute("role",void 0!==t&&"option"),e.setAttribute("aria-selected",o.toString()),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",this.items.length),this.theme?e.setAttribute("theme",this.theme):e.removeAttribute("theme"),i instanceof r.h&&this.__requestItemByIndex(t)}__onItemClick(e){this.dispatchEvent(new CustomEvent("selection-changed",{detail:{item:e.currentTarget.item}}))}__patchWheelOverScrolling(){this.$.selector.addEventListener("wheel",(e=>{const t=0===this.scrollTop,i=this.scrollHeight-this.scrollTop-this.clientHeight<=1;(t&&e.deltaY<0||i&&e.deltaY>0)&&e.preventDefault()}))}__requestItemByIndex(e){requestAnimationFrame((()=>{this.dispatchEvent(new CustomEvent("index-requested",{detail:{index:e,currentScrollerPos:this._oldScrollerPosition}}))}))}_visibleItemsCount(){return this.__virtualizer.scrollToIndex(this.__virtualizer.firstVisibleIndex),this.__virtualizer.size>0?this.__virtualizer.lastVisibleIndex-this.__virtualizer.firstVisibleIndex+1:0}}},48900:(e,t,i)=>{i.d(t,{V:()=>n}),i(51195),i(29416),i(29849);var s=i(17026),o=i(46570);const n=o.iv`
|
3
|
+
:host {
|
4
|
+
transition: background-color 100ms;
|
5
|
+
overflow: hidden;
|
6
|
+
--_lumo-item-selected-icon-display: block;
|
7
|
+
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
8
|
+
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
9
|
+
}
|
10
|
+
|
11
|
+
@media (any-hover: hover) {
|
12
|
+
:host([focused]:not([disabled])) {
|
13
|
+
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
`;(0,o.hC)("vaadin-combo-box-item",[s.w,n],{moduleId:"lumo-combo-box-item"})},53891:(e,t,i)=>{i.d(t,{G:()=>a,p:()=>l}),i(51195),i(29416),i(29849);var s=i(58168),o=i(96754),n=i(90510),r=i(46570);const a=r.iv`
|
17
|
+
[part='content'] {
|
18
|
+
padding: 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
/* When items are empty, the spinner needs some room */
|
22
|
+
:host(:not([closing])) [part~='content'] {
|
23
|
+
min-height: calc(2 * var(--lumo-space-s) + var(--lumo-icon-size-s));
|
24
|
+
}
|
25
|
+
|
26
|
+
[part~='overlay'] {
|
27
|
+
position: relative;
|
28
|
+
}
|
29
|
+
|
30
|
+
:host([top-aligned]) [part~='overlay'] {
|
31
|
+
margin-top: var(--lumo-space-xs);
|
32
|
+
}
|
33
|
+
|
34
|
+
:host([bottom-aligned]) [part~='overlay'] {
|
35
|
+
margin-bottom: var(--lumo-space-xs);
|
36
|
+
}
|
37
|
+
`,l=r.iv`
|
38
|
+
[part~='loader'] {
|
39
|
+
position: absolute;
|
40
|
+
z-index: 1;
|
41
|
+
left: var(--lumo-space-s);
|
42
|
+
right: var(--lumo-space-s);
|
43
|
+
top: var(--lumo-space-s);
|
44
|
+
margin-left: auto;
|
45
|
+
margin-inline-start: auto;
|
46
|
+
margin-inline-end: 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
:host([dir='rtl']) [part~='loader'] {
|
50
|
+
left: auto;
|
51
|
+
margin-left: 0;
|
52
|
+
margin-right: auto;
|
53
|
+
margin-inline-start: 0;
|
54
|
+
margin-inline-end: auto;
|
55
|
+
}
|
56
|
+
`;(0,r.hC)("vaadin-combo-box-overlay",[n.I,o.e,a,s._,l,r.iv`
|
57
|
+
:host {
|
58
|
+
--_vaadin-combo-box-items-container-border-width: var(--lumo-space-xs);
|
59
|
+
--_vaadin-combo-box-items-container-border-style: solid;
|
60
|
+
}
|
61
|
+
`],{moduleId:"lumo-combo-box-overlay"})},17026:(e,t,i)=>{i.d(t,{w:()=>o}),i(71189),i(79098),i(29416),i(29849),i(34173);var s=i(46570);const o=s.iv`
|
62
|
+
:host {
|
63
|
+
display: flex;
|
64
|
+
align-items: center;
|
65
|
+
box-sizing: border-box;
|
66
|
+
font-family: var(--lumo-font-family);
|
67
|
+
font-size: var(--lumo-font-size-m);
|
68
|
+
line-height: var(--lumo-line-height-xs);
|
69
|
+
padding: 0.5em calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4) 0.5em
|
70
|
+
var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4));
|
71
|
+
min-height: var(--lumo-size-m);
|
72
|
+
outline: none;
|
73
|
+
border-radius: var(--lumo-border-radius-m);
|
74
|
+
cursor: var(--lumo-clickable-cursor);
|
75
|
+
-webkit-font-smoothing: antialiased;
|
76
|
+
-moz-osx-font-smoothing: grayscale;
|
77
|
+
-webkit-tap-highlight-color: var(--lumo-primary-color-10pct);
|
78
|
+
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
79
|
+
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
80
|
+
--_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color));
|
81
|
+
}
|
82
|
+
|
83
|
+
/* Checkmark */
|
84
|
+
[part='checkmark']::before {
|
85
|
+
display: var(--_lumo-item-selected-icon-display, none);
|
86
|
+
content: var(--lumo-icons-checkmark);
|
87
|
+
font-family: lumo-icons;
|
88
|
+
font-size: var(--lumo-icon-size-m);
|
89
|
+
line-height: 1;
|
90
|
+
font-weight: normal;
|
91
|
+
width: 1em;
|
92
|
+
height: 1em;
|
93
|
+
margin: calc((1 - var(--lumo-line-height-xs)) * var(--lumo-font-size-m) / 2) 0;
|
94
|
+
color: var(--_selection-color-text);
|
95
|
+
flex: none;
|
96
|
+
opacity: 0;
|
97
|
+
transition: transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2), opacity 0.1s;
|
98
|
+
}
|
99
|
+
|
100
|
+
:host([selected]) [part='checkmark']::before {
|
101
|
+
opacity: 1;
|
102
|
+
}
|
103
|
+
|
104
|
+
:host([active]:not([selected])) [part='checkmark']::before {
|
105
|
+
transform: scale(0.8);
|
106
|
+
opacity: 0;
|
107
|
+
transition-duration: 0s;
|
108
|
+
}
|
109
|
+
|
110
|
+
[part='content'] {
|
111
|
+
flex: auto;
|
112
|
+
}
|
113
|
+
|
114
|
+
/* Disabled */
|
115
|
+
:host([disabled]) {
|
116
|
+
color: var(--lumo-disabled-text-color);
|
117
|
+
cursor: default;
|
118
|
+
pointer-events: none;
|
119
|
+
}
|
120
|
+
|
121
|
+
/* TODO a workaround until we have "focus-follows-mouse". After that, use the hover style for focus-ring as well */
|
122
|
+
@media (any-hover: hover) {
|
123
|
+
:host(:hover:not([disabled])) {
|
124
|
+
background-color: var(--lumo-primary-color-10pct);
|
125
|
+
}
|
126
|
+
|
127
|
+
:host([focus-ring]:not([disabled])) {
|
128
|
+
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
/* RTL specific styles */
|
133
|
+
:host([dir='rtl']) {
|
134
|
+
padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4);
|
135
|
+
padding-right: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4));
|
136
|
+
}
|
137
|
+
|
138
|
+
/* Slotted icons */
|
139
|
+
:host ::slotted(vaadin-icon) {
|
140
|
+
width: var(--lumo-icon-size-m);
|
141
|
+
height: var(--lumo-icon-size-m);
|
142
|
+
}
|
143
|
+
`;(0,s.hC)("vaadin-item",o,{moduleId:"lumo-item"})},63373:(e,t,i)=>{i.d(t,{y:()=>a});var s=i(63726);const o={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,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!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 i=this.__isRTL,s=this.__shouldAlignStartHorizontally(e,i),r=!i&&s||i&&!s;this.style.alignItems=r?"flex-start":"flex-end";const a=this.getBoundingClientRect(),l=this.__calculatePositionInOneDimension(e,a,this.noVerticalOverlap,o,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 i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const s=Math.min(window.innerWidth,document.documentElement.clientWidth),o=!t&&"start"===this.horizontalAlign||t&&"end"===this.horizontalAlign;return this.__shouldAlignStart(e,i,s,this.__margins,o,this.noHorizontalOverlap,n)}__shouldAlignStartVertically(e){const t=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const i=Math.min(window.innerHeight,document.documentElement.clientHeight),s="top"===this.verticalAlign;return this.__shouldAlignStart(e,t,i,this.__margins,s,this.noVerticalOverlap,o)}__shouldAlignStart(e,t,i,s,o,n,r){const a=i-e[n?r.end:r.start]-s[r.end],l=e[n?r.start:r.end]-s[r.start],d=o?a:l;return o===(d>(o?l:a)||d>t)}__adjustBottomProperty(e,t,i){let s;if(e===t.end){if(t.end===o.end){const e=Math.min(window.innerHeight,document.documentElement.clientHeight);i>e&&this.__oldViewportHeight&&(s=i-(this.__oldViewportHeight-e)),this.__oldViewportHeight=e}if(t.end===n.end){const e=Math.min(window.innerWidth,document.documentElement.clientWidth);i>e&&this.__oldViewportWidth&&(s=i-(this.__oldViewportWidth-e)),this.__oldViewportWidth=e}}return s}__calculatePositionInOneDimension(e,t,i,s,o,n){const r=n?s.start:s.end,a=n?s.end:s.start,l=parseFloat(o.style[r]||getComputedStyle(o)[r]),d=this.__adjustBottomProperty(r,s,l),h=t[n?s.start:s.end]-e[i===n?s.end:s.start];return{[r]:d?`${d}px`:`${l+h*(n?-1:1)}px`,[a]:""}}}},58168:(e,t,i)=>{i.d(t,{_:()=>s}),i(51195),i(79098);const s=i(46570).iv`
|
144
|
+
[part~='loader'] {
|
145
|
+
box-sizing: border-box;
|
146
|
+
width: var(--lumo-icon-size-s);
|
147
|
+
height: var(--lumo-icon-size-s);
|
148
|
+
border: 2px solid transparent;
|
149
|
+
border-color: var(--lumo-primary-color-10pct) var(--lumo-primary-color-10pct) var(--lumo-primary-color)
|
150
|
+
var(--lumo-primary-color);
|
151
|
+
border-radius: calc(0.5 * var(--lumo-icon-size-s));
|
152
|
+
opacity: 0;
|
153
|
+
pointer-events: none;
|
154
|
+
}
|
155
|
+
|
156
|
+
:host(:not([loading])) [part~='loader'] {
|
157
|
+
display: none;
|
158
|
+
}
|
159
|
+
|
160
|
+
:host([loading]) [part~='loader'] {
|
161
|
+
animation: 1s linear infinite lumo-loader-rotate, 0.3s 0.1s lumo-loader-fade-in both;
|
162
|
+
}
|
163
|
+
|
164
|
+
@keyframes lumo-loader-fade-in {
|
165
|
+
0% {
|
166
|
+
opacity: 0;
|
167
|
+
}
|
168
|
+
|
169
|
+
100% {
|
170
|
+
opacity: 1;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
|
174
|
+
@keyframes lumo-loader-rotate {
|
175
|
+
0% {
|
176
|
+
transform: rotate(0deg);
|
177
|
+
}
|
178
|
+
|
179
|
+
100% {
|
180
|
+
transform: rotate(360deg);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
`},96754:(e,t,i)=>{i.d(t,{e:()=>n}),i(29416),i(29849);var s=i(46570),o=i(90510);const n=s.iv`
|
184
|
+
:host([opening]),
|
185
|
+
:host([closing]) {
|
186
|
+
animation: 0.14s lumo-overlay-dummy-animation;
|
187
|
+
}
|
188
|
+
|
189
|
+
[part='overlay'] {
|
190
|
+
will-change: opacity, transform;
|
191
|
+
}
|
192
|
+
|
193
|
+
:host([opening]) [part='overlay'] {
|
194
|
+
animation: 0.1s lumo-menu-overlay-enter ease-out both;
|
195
|
+
}
|
196
|
+
|
197
|
+
@keyframes lumo-menu-overlay-enter {
|
198
|
+
0% {
|
199
|
+
opacity: 0;
|
200
|
+
transform: translateY(-4px);
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
:host([closing]) [part='overlay'] {
|
205
|
+
animation: 0.1s lumo-menu-overlay-exit both;
|
206
|
+
}
|
207
|
+
|
208
|
+
@keyframes lumo-menu-overlay-exit {
|
209
|
+
100% {
|
210
|
+
opacity: 0;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
`;(0,s.hC)("",n,{moduleId:"lumo-menu-overlay-core"});const r=s.iv`
|
214
|
+
/* Small viewport (bottom sheet) styles */
|
215
|
+
/* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
|
216
|
+
@media (max-width: 420px), (max-height: 420px) {
|
217
|
+
:host {
|
218
|
+
top: 0 !important;
|
219
|
+
right: 0 !important;
|
220
|
+
bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
|
221
|
+
left: 0 !important;
|
222
|
+
align-items: stretch !important;
|
223
|
+
justify-content: flex-end !important;
|
224
|
+
}
|
225
|
+
|
226
|
+
[part='overlay'] {
|
227
|
+
max-height: 50vh;
|
228
|
+
width: 100vw;
|
229
|
+
border-radius: 0;
|
230
|
+
box-shadow: var(--lumo-box-shadow-xl);
|
231
|
+
}
|
232
|
+
|
233
|
+
/* The content part scrolls instead of the overlay part, because of the gradient fade-out */
|
234
|
+
[part='content'] {
|
235
|
+
padding: 30px var(--lumo-space-m);
|
236
|
+
max-height: inherit;
|
237
|
+
box-sizing: border-box;
|
238
|
+
-webkit-overflow-scrolling: touch;
|
239
|
+
overflow: auto;
|
240
|
+
-webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
|
241
|
+
mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
|
242
|
+
}
|
243
|
+
|
244
|
+
[part='backdrop'] {
|
245
|
+
display: block;
|
246
|
+
}
|
247
|
+
|
248
|
+
/* Animations */
|
249
|
+
|
250
|
+
:host([opening]) [part='overlay'] {
|
251
|
+
animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
|
252
|
+
}
|
253
|
+
|
254
|
+
:host([closing]),
|
255
|
+
:host([closing]) [part='backdrop'] {
|
256
|
+
animation-delay: 0.14s;
|
257
|
+
}
|
258
|
+
|
259
|
+
:host([closing]) [part='overlay'] {
|
260
|
+
animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
|
261
|
+
}
|
262
|
+
}
|
263
|
+
|
264
|
+
@keyframes lumo-mobile-menu-overlay-enter {
|
265
|
+
0% {
|
266
|
+
transform: translateY(150%);
|
267
|
+
}
|
268
|
+
}
|
269
|
+
|
270
|
+
@keyframes lumo-mobile-menu-overlay-exit {
|
271
|
+
100% {
|
272
|
+
transform: translateY(150%);
|
273
|
+
}
|
274
|
+
}
|
275
|
+
`,a=[o.I,n,r];(0,s.hC)("",a,{moduleId:"lumo-menu-overlay"})}}]);
|
package/dist/umd/5806.js
CHANGED
@@ -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(13553);var l=n(
|
38
|
+
`;(0,a.hC)("vaadin-number-field",[s.J,i.q,r],{moduleId:"lumo-number-field"}),n(13553);var l=n(3354),o=n(52807),u=n(12521),h=n(34463),p=n(62743),d=n(73208),c=n(20422),m=n(46729);const _=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}get __hasUnparsableValue(){return this.inputElement.validity.badInput}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 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.cancelable&&(e.preventDefault(),this._decreaseValue())}_onIncreaseButtonTouchend(e){e.cancelable&&(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.inputElement.value=String(parseFloat(i)),this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.__commitValueChange())}_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),this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValueStatus=!1)}_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||this.__hasUnparsableValue}_onInput(e){this.__keepCommittedValue=!0,super._onInput(e),this.__keepCommittedValue=!1}_onChange(e){e.stopPropagation()}_onClearAction(e){super._onClearAction(e),this.__commitValueChange()}_setFocused(e){super._setFocused(e),e||this.__commitValueChange()}_onEnter(e){super._onEnter(e),this.__commitValueChange()}__commitValueChange(){this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValueStatus!==this.__hasUnparsableValue&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValueStatus=this.__hasUnparsableValue}},v=n(9392).iv`
|
39
39
|
:host([readonly]) [part$='button'] {
|
40
40
|
pointer-events: none;
|
41
41
|
}
|
package/dist/umd/5977.js
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
/*! For license information please see 5977.js.LICENSE.txt */
|
2
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5977],{20422:(e,t,o)=>{o.d(t,{j:()=>i});var s=o(73406);const i=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()}}},85079:(e,t,o)=>{var s=o(9392),i=o(3550),r=o(52807),n=o(51914);const a=new WeakMap;var l=o(14905);const h={},_=/([A-Z])/gu;function d(e){return h[e]||(h[e]=e.replace(_,"-$1").toLowerCase()),h[e]}function u(e){return e[0].toUpperCase()+e.substring(1)}function c(e){const[t,o]=e.split("(");return{method:t,observerProps:o.replace(")","").split(",").map((e=>e.trim()))}}function p(e,t){return Object.prototype.hasOwnProperty.call(e,t)||(e[t]=new Map(e[t])),e[t]}const v=(g=e=>class extends e{static createProperty(e,t){[String,Boolean,Number,Array].includes(t)&&(t={type:t}),t.reflectToAttribute&&(t.reflect=!0),super.createProperty(e,t)}static getOrCreateMap(e){return p(this,e)}static finalize(){if(super.finalize(),Array.isArray(this.observers)){const e=this.getOrCreateMap("__complexObservers");this.observers.forEach((t=>{const{method:o,observerProps:s}=c(t);e.set(o,s)}))}}static addCheckedInitializer(e){super.addInitializer((t=>{t instanceof this&&e(t)}))}static getPropertyDescriptor(e,t,o){const s=super.getPropertyDescriptor(e,t,o);let i=s;if(o.sync&&(i={get:s.get,set(s){const i=this[e];this[t]=s,this.requestUpdate(e,i,o),this.hasUpdated&&this.performUpdate()},configurable:!0,enumerable:!0}),o.readOnly){const t=s.set;this.addCheckedInitializer((s=>{s[`_set${u(e)}`]=function(e){t.call(s,e),o.sync&&this.performUpdate()}})),i={get:s.get,set(){},configurable:!0,enumerable:!0}}if("value"in o&&this.addCheckedInitializer((t=>{const s="function"==typeof o.value?o.value.call(t):o.value;o.readOnly?t[`_set${u(e)}`](s):t[e]=s})),o.observer){const t=o.observer;this.getOrCreateMap("__observers").set(e,t),this.addCheckedInitializer((e=>{e[t]||console.warn(`observer method ${t} not defined`)}))}if(o.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){const e=this.__notifyProps;this.__notifyProps=new Set(e)}}else this.__notifyProps=new Set;this.__notifyProps.add(e)}if(o.computed){const t=`__assignComputed${e}`,s=c(o.computed);this.prototype[t]=function(...t){this[e]=this[s.method](...t)},this.getOrCreateMap("__complexObservers").set(t,s.observerProps)}return o.attribute||(o.attribute=d(e)),i}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach((e=>{this.$[e.id]=e}))}ready(){}updated(e){this.constructor.__observers&&this.__runObservers(e,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(e,this.constructor.__complexObservers),this.__dynamicObservers&&this.__runComplexObservers(e,this.__dynamicObservers),this.constructor.__notifyProps&&this.__runNotifyProps(e,this.constructor.__notifyProps),this.__isReadyInvoked||(this.__isReadyInvoked=!0,this.ready())}_createMethodObserver(e){const t=p(this,"__dynamicObservers"),{method:o,observerProps:s}=c(e);t.set(o,s)}__runComplexObservers(e,t){t.forEach(((t,o)=>{t.some((t=>e.has(t)))&&(this[o]?this[o](...t.map((e=>this[e]))):console.warn(`observer method ${o} not defined`))}))}__runObservers(e,t){e.forEach(((e,o)=>{const s=t.get(o);void 0!==s&&this[s]&&this[s](this[o],e)}))}__runNotifyProps(e,t){e.forEach(((e,o)=>{t.has(o)&&this.dispatchEvent(new CustomEvent(`${d(o)}-changed`,{detail:{value:this[o]}}))}))}_get(e,t){return(0,l.U)(e,t)}_set(e,t,o){(0,l.t)(e,t,o)}},e=>{if(function(e,t){let o=t;for(;o;){if(a.get(o)===e)return!0;o=Object.getPrototypeOf(o)}return!1}(g,e))return e;const t=g(e);return a.set(t,g),t});var g,y=o(6196),m=o(46570),f=o(14932),b=o(63373);const C=e=>class extends((0,b.y)((0,f.F)(e))){static get properties(){return{position:{type:String,reflectToAttribute:!0}}}get _tagNamePrefix(){return"vaadin-popover"}requestContentUpdate(){if(super.requestContentUpdate(),this.positionTarget&&this.owner){const e=getComputedStyle(this.owner);["top","bottom","start","end"].forEach((t=>{this.style.setProperty(`--${this._tagNamePrefix}-offset-${t}`,e.getPropertyValue(`--${this._tagNamePrefix}-offset-${t}`))}))}}_updatePosition(){if(super._updatePosition(),this.positionTarget&&this.opened){if(this.removeAttribute("arrow-centered"),"bottom"===this.position||"top"===this.position){const e=this.positionTarget.getBoundingClientRect(),t=this.$.overlay.getBoundingClientRect(),o=e.width/2-t.width/2;if(this.style.left){const e=t.left+o;e>0&&(this.style.left=`${e}px`,this.setAttribute("arrow-centered",""))}if(this.style.right){const e=parseFloat(this.style.right)+o;e>0&&(this.style.right=`${e}px`,this.setAttribute("arrow-centered",""))}}if("start"===this.position||"end"===this.position){const e=this.positionTarget.getBoundingClientRect(),t=this.$.overlay.getBoundingClientRect(),o=e.height/2-t.height/2;this.style.top=`${t.top+o}px`}}}};class T extends(C((0,n.U)((0,m.Tb)(v(s.oi))))){static get is(){return"vaadin-popover-overlay"}static get styles(){return[y.r,s.iv`
|
3
|
+
:host {
|
4
|
+
--_vaadin-popover-content-width: auto;
|
5
|
+
--_vaadin-popover-content-height: auto;
|
6
|
+
}
|
7
|
+
|
8
|
+
:host([modeless][with-backdrop]) [part='backdrop'] {
|
9
|
+
pointer-events: none;
|
10
|
+
}
|
11
|
+
|
12
|
+
:host([position^='top'][top-aligned]) [part='overlay'],
|
13
|
+
:host([position^='bottom'][top-aligned]) [part='overlay'] {
|
14
|
+
margin-top: var(--vaadin-popover-offset-top, 0);
|
15
|
+
}
|
16
|
+
|
17
|
+
[part='overlay'] {
|
18
|
+
position: relative;
|
19
|
+
overflow: visible;
|
20
|
+
}
|
21
|
+
|
22
|
+
[part='content'] {
|
23
|
+
overflow: auto;
|
24
|
+
width: var(--_vaadin-popover-content-width);
|
25
|
+
height: var(--_vaadin-popover-content-height);
|
26
|
+
}
|
27
|
+
|
28
|
+
/* Increase the area of the popover so the pointer can go from the target directly to it. */
|
29
|
+
[part='overlay']::before {
|
30
|
+
position: absolute;
|
31
|
+
content: '';
|
32
|
+
inset-block: calc(var(--vaadin-popover-offset-top, 0) * -1) calc(var(--vaadin-popover-offset-bottom, 0) * -1);
|
33
|
+
inset-inline: calc(var(--vaadin-popover-offset-start, 0) * -1) calc(var(--vaadin-popover-offset-end, 0) * -1);
|
34
|
+
z-index: -1;
|
35
|
+
pointer-events: auto;
|
36
|
+
}
|
37
|
+
|
38
|
+
:host([position^='top'][bottom-aligned]) [part='overlay'],
|
39
|
+
:host([position^='bottom'][bottom-aligned]) [part='overlay'] {
|
40
|
+
margin-bottom: var(--vaadin-popover-offset-bottom, 0);
|
41
|
+
}
|
42
|
+
|
43
|
+
:host([position^='start'][start-aligned]) [part='overlay'],
|
44
|
+
:host([position^='end'][start-aligned]) [part='overlay'] {
|
45
|
+
margin-inline-start: var(--vaadin-popover-offset-start, 0);
|
46
|
+
}
|
47
|
+
|
48
|
+
:host([position^='start'][end-aligned]) [part='overlay'],
|
49
|
+
:host([position^='end'][end-aligned]) [part='overlay'] {
|
50
|
+
margin-inline-end: var(--vaadin-popover-offset-end, 0);
|
51
|
+
}
|
52
|
+
|
53
|
+
[part='arrow'] {
|
54
|
+
display: none;
|
55
|
+
position: absolute;
|
56
|
+
height: 0;
|
57
|
+
width: 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
:host([theme~='arrow']) [part='arrow'] {
|
61
|
+
display: block;
|
62
|
+
}
|
63
|
+
`]}render(){return s.dy`
|
64
|
+
<div id="backdrop" part="backdrop" hidden ?hidden="${!this.withBackdrop}"></div>
|
65
|
+
<div part="overlay" id="overlay" tabindex="0">
|
66
|
+
<div part="arrow"></div>
|
67
|
+
<div part="content" id="content"><slot></slot></div>
|
68
|
+
</div>
|
69
|
+
`}_shouldCloseOnOutsideClick(e){return(!this.owner.__hasTrigger("focus")||!(0,i.Qw)(this))&&super._shouldCloseOnOutsideClick(e)}}(0,r.M)(T);var O=o(33692);const w=e=>e??O.Ld;var E=o(12521),k=o(39320),$=o(73971),D=o(19577),x=o(61462),F=o(87913),I=o(36139);const P=e=>class extends e{static get properties(){return{for:{type:String,observer:"__forChanged"},target:{type:Object,observer:"__targetChanged"}}}connectedCallback(){super.connectedCallback(),this.target&&this._addTargetListeners(this.target)}disconnectedCallback(){super.disconnectedCallback(),this.target&&this._removeTargetListeners(this.target)}__forChanged(e){e&&(this.__setTargetByIdDebouncer=I.dx.debounce(this.__setTargetByIdDebouncer,F.YA,(()=>this.__setTargetById(e))))}__setTargetById(e){if(!this.isConnected)return;const t=this.getRootNode().getElementById(e);t?this.target=t:console.warn(`No element with id="${e}" set via "for" property found on the page.`)}__targetChanged(e,t){t&&this._removeTargetListeners(t),e&&this._addTargetListeners(e)}_addTargetListeners(e){}_removeTargetListeners(e){}},L=500;let S=L,M=L,A=L;class N{constructor(e){this.host=e}get isClosing(){return null!=this.__closeTimeout}get __focusDelay(){const e=this.host;return null!=e.focusDelay&&e.focusDelay>=0?e.focusDelay:S}get __hoverDelay(){const e=this.host;return null!=e.hoverDelay&&e.hoverDelay>=0?e.hoverDelay:M}get __hideDelay(){const e=this.host;return null!=e.hideDelay&&e.hideDelay>=0?e.hideDelay:A}open(e={immediate:!1}){const{immediate:t,trigger:o}=e,s="hover"===o&&this.__hoverDelay>0,i="focus"===o&&this.__focusDelay>0;t||!s&&!i||this.__closeTimeout?this.__showPopover():this.__scheduleOpen(o)}close(e){!e&&this.__hideDelay>0?this.__scheduleClose():(this.__abortClose(),this.__setOpened(!1))}__setOpened(e){this.host.opened=e}__showPopover(){this.__abortClose(),this.__setOpened(!0)}__abortClose(){this.__closeTimeout&&(clearTimeout(this.__closeTimeout),this.__closeTimeout=null)}__abortOpen(){this.__openTimeout&&(clearTimeout(this.__openTimeout),this.__openTimeout=null)}__scheduleClose(){this.__closeTimeout=setTimeout((()=>{this.__closeTimeout=null,this.__setOpened(!1)}),this.__hideDelay)}__scheduleOpen(e){this.__abortOpen();const t="focus"===e?this.__focusDelay:this.__hoverDelay;this.__openTimeout=setTimeout((()=>{this.__openTimeout=null,this.__showPopover()}),t)}}class B extends((e=>class extends e{static get properties(){return{position:{type:String},_position:{type:String,value:"bottom"},__effectivePosition:{type:String,computed:"__computePosition(position, _position)"}}}__computeHorizontalAlign(e){return["top-end","bottom-end","start-top","start","start-bottom"].includes(e)?"end":"start"}__computeNoHorizontalOverlap(e){return["start-top","start","start-bottom","end-top","end","end-bottom"].includes(e)}__computeNoVerticalOverlap(e){return["top-start","top-end","top","bottom-start","bottom","bottom-end"].includes(e)}__computeVerticalAlign(e){return["top-start","top-end","top","start-bottom","end-bottom"].includes(e)?"bottom":"top"}__computePosition(e,t){return e||t}})(P((0,k.u)((0,x.I)((0,E.S)(v(s.oi))))))){static get is(){return"vaadin-popover"}static get styles(){return s.iv`
|
70
|
+
:host {
|
71
|
+
display: none !important;
|
72
|
+
}
|
73
|
+
`}static get properties(){return{accessibleName:{type:String},accessibleNameRef:{type:String},autofocus:{type:Boolean},contentHeight:{type:String},contentWidth:{type:String},focusDelay:{type:Number},hideDelay:{type:Number},hoverDelay:{type:Number},opened:{type:Boolean,value:!1,notify:!0,observer:"__openedChanged"},overlayRole:{type:String,value:"dialog"},renderer:{type:Object},modal:{type:Boolean,value:!1},noCloseOnOutsideClick:{type:Boolean,value:!1},noCloseOnEsc:{type:Boolean,value:!1},trigger:{type:Array,value:()=>["click"]},withBackdrop:{type:Boolean,value:!1},__shouldRestoreFocus:{type:Boolean,value:!1,sync:!0},__overlayId:{type:String}}}static get observers(){return["__updateContentHeight(contentHeight, _overlayElement)","__updateContentWidth(contentWidth, _overlayElement)","__openedOrTargetChanged(opened, target)","__overlayRoleOrTargetChanged(overlayRole, target)"]}static setDefaultFocusDelay(e){S=null!=e&&e>=0?e:L}static setDefaultHideDelay(e){A=null!=e&&e>=0?e:L}static setDefaultHoverDelay(e){M=null!=e&&e>=0?e:L}constructor(){super(),this.__overlayId=`vaadin-popover-${(0,$.l)()}`,this.__onGlobalClick=this.__onGlobalClick.bind(this),this.__onGlobalKeyDown=this.__onGlobalKeyDown.bind(this),this.__onTargetClick=this.__onTargetClick.bind(this),this.__onTargetFocusIn=this.__onTargetFocusIn.bind(this),this.__onTargetFocusOut=this.__onTargetFocusOut.bind(this),this.__onTargetMouseEnter=this.__onTargetMouseEnter.bind(this),this.__onTargetMouseLeave=this.__onTargetMouseLeave.bind(this),this._openedStateController=new N(this)}render(){const e=this.__effectivePosition;return s.dy`
|
74
|
+
<vaadin-popover-overlay
|
75
|
+
id="${this.__overlayId}"
|
76
|
+
role="${this.overlayRole}"
|
77
|
+
aria-label="${w(this.accessibleName)}"
|
78
|
+
aria-labelledby="${w(this.accessibleNameRef)}"
|
79
|
+
.renderer="${this.renderer}"
|
80
|
+
.owner="${this}"
|
81
|
+
theme="${w(this._theme)}"
|
82
|
+
.positionTarget="${this.target}"
|
83
|
+
.position="${e}"
|
84
|
+
.opened="${this.opened}"
|
85
|
+
.modeless="${!this.modal}"
|
86
|
+
.focusTrap="${this.modal}"
|
87
|
+
.withBackdrop="${this.withBackdrop}"
|
88
|
+
?no-horizontal-overlap="${this.__computeNoHorizontalOverlap(e)}"
|
89
|
+
?no-vertical-overlap="${this.__computeNoVerticalOverlap(e)}"
|
90
|
+
.horizontalAlign="${this.__computeHorizontalAlign(e)}"
|
91
|
+
.verticalAlign="${this.__computeVerticalAlign(e)}"
|
92
|
+
@mousedown="${this.__onOverlayMouseDown}"
|
93
|
+
@mouseenter="${this.__onOverlayMouseEnter}"
|
94
|
+
@mouseleave="${this.__onOverlayMouseLeave}"
|
95
|
+
@focusin="${this.__onOverlayFocusIn}"
|
96
|
+
@focusout="${this.__onOverlayFocusOut}"
|
97
|
+
@opened-changed="${this.__onOpenedChanged}"
|
98
|
+
.restoreFocusOnClose="${this.__shouldRestoreFocus}"
|
99
|
+
.restoreFocusNode="${this.target}"
|
100
|
+
@vaadin-overlay-escape-press="${this.__onEscapePress}"
|
101
|
+
@vaadin-overlay-outside-click="${this.__onOutsideClick}"
|
102
|
+
@vaadin-overlay-open="${this.__onOverlayOpened}"
|
103
|
+
@vaadin-overlay-closed="${this.__onOverlayClosed}"
|
104
|
+
></vaadin-popover-overlay>
|
105
|
+
`}requestContentUpdate(){this.renderer&&this._overlayElement&&this._overlayElement.requestContentUpdate()}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-popover-overlay")}connectedCallback(){super.connectedCallback(),document.documentElement.addEventListener("click",this.__onGlobalClick,!0)}disconnectedCallback(){super.disconnectedCallback(),document.documentElement.removeEventListener("click",this.__onGlobalClick,!0),this._openedStateController.close(!0)}_addTargetListeners(e){e.addEventListener("click",this.__onTargetClick),e.addEventListener("mouseenter",this.__onTargetMouseEnter),e.addEventListener("mouseleave",this.__onTargetMouseLeave),e.addEventListener("focusin",this.__onTargetFocusIn),e.addEventListener("focusout",this.__onTargetFocusOut)}_removeTargetListeners(e){e.removeEventListener("click",this.__onTargetClick),e.removeEventListener("mouseenter",this.__onTargetMouseEnter),e.removeEventListener("mouseleave",this.__onTargetMouseLeave),e.removeEventListener("focusin",this.__onTargetFocusIn),e.removeEventListener("focusout",this.__onTargetFocusOut)}__openedChanged(e,t){e?document.addEventListener("keydown",this.__onGlobalKeyDown,!0):t&&document.removeEventListener("keydown",this.__onGlobalKeyDown,!0)}__openedOrTargetChanged(e,t){t&&(t.setAttribute("aria-expanded",e?"true":"false"),e?t.setAttribute("aria-controls",this.__overlayId):t.removeAttribute("aria-controls"))}__overlayRoleOrTargetChanged(e,t){if(this.__oldTarget&&this.__oldTarget.removeAttribute("aria-haspopup"),t){const o="dialog"===e||"alertdialog"===e;t.setAttribute("aria-haspopup",o?"dialog":"true"),this.__oldTarget=t}}__onGlobalClick(e){!this.opened||this.__isManual||this.modal||e.composedPath().some((e=>e===this._overlayElement||e===this.target))||this.noCloseOnOutsideClick||!(0,D.C)(this._overlayElement)||this._openedStateController.close(!0)}__onTargetClick(){this.__hasTrigger("click")&&(this.opened||(this.__shouldRestoreFocus=!0),this.opened?this._openedStateController.close(!0):this._openedStateController.open({immediate:!0}))}__onGlobalKeyDown(e){this.modal||("Escape"===e.key&&!this.noCloseOnEsc&&this.opened&&!this.__isManual&&(0,D.C)(this._overlayElement)&&(e.stopPropagation(),this._openedStateController.close(!0)),"Tab"===e.key&&(e.shiftKey?this.__onGlobalShiftTab(e):this.__onGlobalTab(e)))}__onGlobalTab(e){const t=this._overlayElement.$.overlay;if(this.target&&(0,i.Qw)(this.target))return e.preventDefault(),void t.focus();const o=this.__getLastFocusable(t);if(o&&(0,i.Qw)(o)){const o=this.__getNextBodyFocusable(this.target);if(o&&o!==t)return e.preventDefault(),void o.focus()}const s=(0,i.Gf)();this.__getNextBodyFocusable(s)===t&&o&&o.focus()}__onGlobalShiftTab(e){const t=this._overlayElement.$.overlay;if(this.target&&(0,i.Qw)(this.target)&&this.__shouldRestoreFocus)return void(this.__shouldRestoreFocus=!1);if(this.target&&(0,i.Qw)(t))return e.preventDefault(),void this.target.focus();const o=this.__getNextBodyFocusable(this.target);if(o&&(0,i.Qw)(o)){const o=this.__getLastFocusable(t);o&&(e.preventDefault(),o.focus())}}__getNextBodyFocusable(e){const t=(0,i.GO)(document.body),o=t.findIndex((t=>t===e));return t[o+1]}__getLastFocusable(e){return(0,i.GO)(e).pop()}__onTargetFocusIn(){if(this.__focusInside=!0,this.__hasTrigger("focus")){if(this.__hasTrigger("click")&&!(0,i.LQ)())return;this.__shouldRestoreFocus||(this.__shouldRestoreFocus=!0,this._openedStateController.open({trigger:"focus"}))}}__onTargetFocusOut(e){(0,D.C)(this._overlayElement)&&(this.__hasTrigger("focus")&&this.__mouseDownInside||this._overlayElement.contains(e.relatedTarget)||this.__handleFocusout())}__onTargetMouseEnter(){this.__hoverInside=!0,this.__hasTrigger("hover")&&!this.opened&&(this.modal&&(this.target.style.pointerEvents="auto"),this._openedStateController.open({trigger:"hover"}))}__onTargetMouseLeave(e){(0,D.C)(this._overlayElement)&&(this._overlayElement.contains(e.relatedTarget)||this.__handleMouseLeave())}__onOverlayFocusIn(){this.__focusInside=!0,(this.__hasTrigger("focus")||this.__hasTrigger("click"))&&(this.__shouldRestoreFocus=!0)}__onOverlayFocusOut(e){(0,D.C)(this._overlayElement)&&(this.__hasTrigger("focus")&&this.__mouseDownInside||e.relatedTarget===this.target||this._overlayElement.contains(e.relatedTarget)||this.__handleFocusout())}__onOverlayMouseDown(){this.__hasTrigger("focus")&&(this.__mouseDownInside=!0,document.addEventListener("mouseup",(()=>{this.__mouseDownInside=!1}),{once:!0}))}__onOverlayMouseEnter(){this.__hoverInside=!0,this.__hasTrigger("hover")&&this._openedStateController.isClosing&&this._openedStateController.open({immediate:!0})}__onOverlayMouseLeave(e){(0,D.C)(this._overlayElement)&&e.relatedTarget!==this.target&&this.__handleMouseLeave()}__handleFocusout(){this.__focusInside=!1,this.__hasTrigger("hover")&&this.__hoverInside||this.__hasTrigger("focus")&&this._openedStateController.close(!0)}__handleMouseLeave(){this.__hoverInside=!1,this.__hasTrigger("focus")&&this.__focusInside||this.__hasTrigger("hover")&&this._openedStateController.close()}__onOpenedChanged(e){this.opened=e.detail.value}__onOverlayOpened(){this.autofocus&&!this.modal&&this._overlayElement.$.overlay.focus()}__onOverlayClosed(){this.__shouldRestoreFocus&&setTimeout((()=>{this.__shouldRestoreFocus=!1})),this.modal&&this.target.style.pointerEvents&&(this.target.style.pointerEvents=""),this.dispatchEvent(new CustomEvent("closed"))}__onEscapePress(e){(this.noCloseOnEsc||this.__isManual)&&e.preventDefault()}__onOutsideClick(e){(this.noCloseOnOutsideClick||this.__isManual)&&e.preventDefault()}__hasTrigger(e){return Array.isArray(this.trigger)&&this.trigger.includes(e)}get __isManual(){return null==this.trigger||Array.isArray(this.trigger)&&0===this.trigger.length}__updateDimension(e,t,o){const s=`--_vaadin-popover-content-${t}`;o?e.style.setProperty(s,o):e.style.removeProperty(s)}__updateContentHeight(e,t){t&&this.__updateDimension(t,"height",e)}__updateContentWidth(e,t){t&&this.__updateDimension(t,"width",e)}}(0,r.M)(B)},18005:(e,t,o)=>{o.d(t,{n:()=>c}),o(13553);var s=o(3354),i=o(52807),r=o(12521),n=o(34463),a=o(62743),l=o(46570),h=o(73208),_=o(20422),d=o(46729);const u=e=>class extends((0,_.j)(e)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new h.b(this,(e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e}))),this.addController(new d.v(this.inputElement,this._labelController))}};(0,l.hC)("vaadin-text-field",a.J,{moduleId:"vaadin-text-field-styles"});class c extends(u((0,l.Tb)((0,r.S)(s.H3)))){static get is(){return"vaadin-text-field"}static get template(){return s.dy`
|
106
|
+
<style>
|
107
|
+
[part='input-field'] {
|
108
|
+
flex-grow: 0;
|
109
|
+
}
|
110
|
+
</style>
|
111
|
+
|
112
|
+
<div class="vaadin-field-container">
|
113
|
+
<div part="label">
|
114
|
+
<slot name="label"></slot>
|
115
|
+
<span part="required-indicator" aria-hidden="true" on-click="focus"></span>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<vaadin-input-container
|
119
|
+
part="input-field"
|
120
|
+
readonly="[[readonly]]"
|
121
|
+
disabled="[[disabled]]"
|
122
|
+
invalid="[[invalid]]"
|
123
|
+
theme$="[[_theme]]"
|
124
|
+
>
|
125
|
+
<slot name="prefix" slot="prefix"></slot>
|
126
|
+
<slot name="input"></slot>
|
127
|
+
<slot name="suffix" slot="suffix"></slot>
|
128
|
+
<div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
|
129
|
+
</vaadin-input-container>
|
130
|
+
|
131
|
+
<div part="helper-text">
|
132
|
+
<slot name="helper"></slot>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div part="error-message">
|
136
|
+
<slot name="error-message"></slot>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
<slot name="tooltip"></slot>
|
140
|
+
`}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new n.f(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,i.M)(c)},58725:(e,t,o)=>{o(21578);var s=o(83208);(0,o(46570).hC)("vaadin-text-field",s.J,{moduleId:"lumo-text-field-styles"}),o(18005)},79789:(e,t,o)=>{o(58725),o(18005)}}]);
|
@@ -0,0 +1,29 @@
|
|
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) 2022 - 2024 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) 2024 Vaadin Ltd.
|
22
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
23
|
+
*/
|
24
|
+
|
25
|
+
/**
|
26
|
+
* @license
|
27
|
+
* Copyright 2018 Google LLC
|
28
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
29
|
+
*/
|
package/dist/umd/63.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
[part='toggle-button']::before {
|
8
8
|
content: var(--lumo-icons-dropdown);
|
9
9
|
}
|
10
|
-
`;(0,i.hC)("vaadin-combo-box",[a.J,r],{moduleId:"lumo-combo-box"}),o(13553);var s=o(
|
10
|
+
`;(0,i.hC)("vaadin-combo-box",[a.J,r],{moduleId:"lumo-combo-box"}),o(13553);var s=o(3354),n=o(52807),l=o(51914),d=o(45115);class p extends((0,d.O)((0,i.Tb)((0,l.U)(s.H3)))){static get template(){return s.dy`
|
11
11
|
<style>
|
12
12
|
:host {
|
13
13
|
display: block;
|
@@ -21,7 +21,7 @@
|
|
21
21
|
<div part="content">
|
22
22
|
<slot></slot>
|
23
23
|
</div>
|
24
|
-
`}static get is(){return"vaadin-combo-box-item"}}(0,n.M)(p);var c=o(
|
24
|
+
`}static get is(){return"vaadin-combo-box-item"}}(0,n.M)(p);var c=o(14932),u=o(6196),h=o(43515);const v=i.iv`
|
25
25
|
#overlay {
|
26
26
|
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
|
27
27
|
}
|
@@ -64,7 +64,7 @@
|
|
64
64
|
<div id="selector">
|
65
65
|
<slot></slot>
|
66
66
|
</div>
|
67
|
-
`}}(0,n.M)(g);var y=o(12521),_=o(34463),x=o(73406),f=o(73208),C=o(46729),w=o(39091);const k=t=>class extends((0,w.t)(t)){static get properties(){return{pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"pattern"]}static get constraints(){return[...super.constraints,"pattern"]}};var T=o(62743),E=o(99031),S=o(
|
67
|
+
`}}(0,n.M)(g);var y=o(12521),_=o(34463),x=o(73406),f=o(73208),C=o(46729),w=o(39091);const k=t=>class extends((0,w.t)(t)){static get properties(){return{pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"pattern"]}static get constraints(){return[...super.constraints,"pattern"]}};var T=o(62743),E=o(99031),S=o(66599);(0,i.hC)("vaadin-combo-box",T.J,{moduleId:"vaadin-combo-box-styles"});class A extends((0,E.Y)((0,S.t)(k((0,x.L)((0,i.Tb)((0,y.S)(s.H3))))))){static get is(){return"vaadin-combo-box"}static get template(){return s.dy`
|
68
68
|
<style>
|
69
69
|
:host([opened]) {
|
70
70
|
pointer-events: auto;
|
@@ -110,7 +110,7 @@
|
|
110
110
|
></vaadin-combo-box-overlay>
|
111
111
|
|
112
112
|
<slot name="tooltip"></slot>
|
113
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new f.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new C.v(this.inputElement,this._labelController)),this._tooltipController=new _.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}(0,n.M)(A)},20422:(t,e,o)=>{o.d(e,{j:()=>i});var a=o(73406);const i=t=>class extends((0,a.L)(t)){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(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}},18005:(t,e,o)=>{o.d(e,{n:()=>h}),o(13553);var a=o(
|
113
|
+
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new f.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new C.v(this.inputElement,this._labelController)),this._tooltipController=new _.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}(0,n.M)(A)},20422:(t,e,o)=>{o.d(e,{j:()=>i});var a=o(73406);const i=t=>class extends((0,a.L)(t)){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(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}},18005:(t,e,o)=>{o.d(e,{n:()=>h}),o(13553);var a=o(3354),i=o(52807),r=o(12521),s=o(34463),n=o(62743),l=o(46570),d=o(73208),p=o(20422),c=o(46729);const u=t=>class extends((0,p.j)(t)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new d.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new c.v(this.inputElement,this._labelController))}};(0,l.hC)("vaadin-text-field",n.J,{moduleId:"vaadin-text-field-styles"});class h extends(u((0,l.Tb)((0,r.S)(a.H3)))){static get is(){return"vaadin-text-field"}static get template(){return a.dy`
|
114
114
|
<style>
|
115
115
|
[part='input-field'] {
|
116
116
|
flex-grow: 0;
|