From 6fc761525c4b9e4cfbb3055a0312d93757f04e9e Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Sun, 10 Mar 2024 08:46:40 +0200 Subject: [PATCH] add primevue autocomplete library dependency --- app/webroot/js/vue/primevue-3.48.1.autocomplete.min.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 app/webroot/js/vue/primevue-3.48.1.autocomplete.min.js diff --git a/app/webroot/js/vue/primevue-3.48.1.autocomplete.min.js b/app/webroot/js/vue/primevue-3.48.1.autocomplete.min.js new file mode 100644 index 000000000..406479587 --- /dev/null +++ b/app/webroot/js/vue/primevue-3.48.1.autocomplete.min.js @@ -0,0 +1 @@ +this.primevue=this.primevue||{},this.primevue.autocomplete=function(e,t,i,n,o,s,l,r,a,u,c,d){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=p(e),f=p(t),m=p(i),y=p(n),v=p(o),b=p(s),O=p(l),g=p(a),x=p(u);function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function S(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){if(e){if("string"==typeof e)return L(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?L(e,t):void 0}}function w(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function C(e){if(Array.isArray(e))return L(e)}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i=this.minLength?(this.focusedOptionIndex=-1,this.searchTimeout=setTimeout((function(){t.search(e,i,"input")}),this.delay)):this.hide()},onChange:function(e){var t=this;if(this.forceSelection){var i=!1;if(this.visibleOptions&&!this.multiple){var n=this.visibleOptions.find((function(e){return t.isOptionMatched(e,t.$refs.focusInput.value||"")}));void 0!==n&&(i=!0,!this.isSelected(n)&&this.onOptionSelect(e,n))}i||(this.$refs.focusInput.value="",this.$emit("clear"),!this.multiple&&this.updateModel(e,null))}},onMultipleContainerFocus:function(){this.disabled||(this.focused=!0)},onMultipleContainerBlur:function(){this.focusedMultipleOptionIndex=-1,this.focused=!1},onMultipleContainerKeyDown:function(e){if(this.disabled)e.preventDefault();else switch(e.code){case"ArrowLeft":this.onArrowLeftKeyOnMultiple(e);break;case"ArrowRight":this.onArrowRightKeyOnMultiple(e);break;case"Backspace":this.onBackspaceKeyOnMultiple(e)}},onContainerClick:function(e){this.clicked=!0,this.disabled||this.searching||this.loading||this.isInputClicked(e)||this.isDropdownClicked(e)||this.overlay&&this.overlay.contains(e.target)||r.DomHandler.focus(this.$refs.focusInput)},onDropdownClick:function(e){var t=void 0;this.overlayVisible?this.hide(!0):(r.DomHandler.focus(this.$refs.focusInput),t=this.$refs.focusInput.value,"blank"===this.dropdownMode?this.search(e,"","dropdown"):"current"===this.dropdownMode&&this.search(e,t,"dropdown")),this.$emit("dropdown-click",{originalEvent:e,query:t})},onOptionSelect:function(e,t){var i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this.getOptionValue(t);this.multiple?(this.$refs.focusInput.value="",this.isSelected(t)||this.updateModel(e,[].concat(C(i=this.modelValue||[])||w(i)||k(i)||S(),[o]))):this.updateModel(e,o),this.$emit("item-select",{originalEvent:e,value:t}),n&&this.hide(!0)},onOptionMouseMove:function(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOverlayClick:function(e){v.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){if(this.overlayVisible){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowUpKey:function(e){if(this.overlayVisible)if(e.altKey)-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),e.preventDefault()}},onArrowLeftKey:function(e){var t=e.currentTarget;this.focusedOptionIndex=-1,this.multiple&&(r.ObjectUtils.isEmpty(t.value)&&this.hasSelectedOption?(r.DomHandler.focus(this.$refs.multiContainer),this.focusedMultipleOptionIndex=this.modelValue.length):e.stopPropagation())},onArrowRightKey:function(e){this.focusedOptionIndex=-1,this.multiple&&e.stopPropagation()},onHomeKey:function(e){var t=e.currentTarget;t.setSelectionRange(0,e.shiftKey?t.value.length:0),this.focusedOptionIndex=-1,e.preventDefault()},onEndKey:function(e){var t=e.currentTarget,i=t.value.length;t.setSelectionRange(e.shiftKey?0:i,i),this.focusedOptionIndex=-1,e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.overlayVisible?(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.hide()):(this.focusedOptionIndex=-1,this.onArrowDownKey(e)),e.preventDefault()},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide()},onBackspaceKey:function(e){if(this.multiple){if(r.ObjectUtils.isNotEmpty(this.modelValue)&&!this.$refs.focusInput.value){var t=this.modelValue[this.modelValue.length-1],i=this.modelValue.slice(0,-1);this.$emit("update:modelValue",i),this.$emit("item-unselect",{originalEvent:e,value:t})}e.stopPropagation()}},onArrowLeftKeyOnMultiple:function(){this.focusedMultipleOptionIndex=this.focusedMultipleOptionIndex<1?0:this.focusedMultipleOptionIndex-1},onArrowRightKeyOnMultiple:function(){this.focusedMultipleOptionIndex++,this.focusedMultipleOptionIndex>this.modelValue.length-1&&(this.focusedMultipleOptionIndex=-1,r.DomHandler.focus(this.$refs.focusInput))},onBackspaceKeyOnMultiple:function(e){-1!==this.focusedMultipleOptionIndex&&this.removeOption(e,this.focusedMultipleOptionIndex)},onOverlayEnter:function(e){r.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),r.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){r.ZIndexUtils.clear(e)},alignOverlay:function(){var e=this.multiple?this.$refs.multiContainer:this.$refs.focusInput;"self"===this.appendTo?r.DomHandler.relativePosition(this.overlay,e):(this.overlay.style.minWidth=r.DomHandler.getOuterWidth(e)+"px",r.DomHandler.absolutePosition(this.overlay,e))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new r.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!r.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked:function(e){return!this.overlay.contains(e.target)&&!this.isInputClicked(e)&&!this.isDropdownClicked(e)},isInputClicked:function(e){return this.multiple?e.target===this.$refs.multiContainer||this.$refs.multiContainer.contains(e.target):e.target===this.$refs.focusInput},isDropdownClicked:function(e){return!!this.$refs.dropdownButton&&(e.target===this.$refs.dropdownButton||this.$refs.dropdownButton.$el.contains(e.target))},isOptionMatched:function(e,t){var i;return this.isValidOption(e)&&(null===(i=this.getOptionLabel(e))||void 0===i?void 0:i.toLocaleLowerCase(this.searchLocale))===t.toLocaleLowerCase(this.searchLocale)},isValidOption:function(e){return r.ObjectUtils.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return r.ObjectUtils.equals(this.modelValue,this.getOptionValue(e),this.equalityKey)},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return r.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?r.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},search:function(e,t,i){null!=t&&("input"===i&&0===t.trim().length||(this.searching=!0,this.$emit("complete",{originalEvent:e,query:t})))},removeOption:function(e,t){var i=this,n=this.modelValue[t],o=this.modelValue.filter((function(e,i){return i!==t})).map((function(e){return i.getOptionValue(e)}));this.updateModel(e,o),this.$emit("item-unselect",{originalEvent:e,value:n}),this.dirty=!0,r.DomHandler.focus(this.$refs.focusInput)},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView(),(this.selectOnFocus||this.autoHighlight)&&this.onOptionSelect(e,this.visibleOptions[t],!1))},scrollInView:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.$nextTick((function(){var i=-1!==t?"".concat(e.id,"_").concat(t):e.focusedOptionId,n=r.DomHandler.findSingle(e.list,'li[id="'.concat(i,'"]'));n?n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(-1!==t?t:e.focusedOptionIndex)}))},autoUpdateModel:function(){(this.selectOnFocus||this.autoHighlight)&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},overlayRef:function(e){this.overlay=e},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){return this.optionGroupLabel?this.flatOptions(this.suggestions):this.suggestions||[]},inputValue:function(){if(r.ObjectUtils.isNotEmpty(this.modelValue)){if("object"===I(this.modelValue)){var e=this.getOptionLabel(this.modelValue);return null!=e?e:this.modelValue}return this.modelValue}return""},hasSelectedOption:function(){return r.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey:function(){return this.dataKey},searchResultMessageText:function(){return r.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.overlayVisible?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},focusedMultipleOptionId:function(){return-1!==this.focusedMultipleOptionIndex?"".concat(this.id,"_multiple_option_").concat(this.focusedMultipleOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},components:{Button:h.default,VirtualScroller:g.default,Portal:b.default,ChevronDownIcon:f.default,SpinnerIcon:m.default,TimesCircleIcon:y.default},directives:{ripple:O.default}};function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function M(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function B(e){for(var t=1;t