@jblehm/super-list 1.0.29 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"super-list.js","sources":["../src/DropDownLibrary.ts","../src/ListInputComponents/ListTextInput.vue","../src/ListInputComponents/default-tick.vue","../src/ListInputComponents/ListItem.vue","../src/ListInputComponents/ItemList.vue","../src/ListInputComponents/default-arrow.vue","../src/ListInputComponents/ListButton.vue","../src/super-list.vue"],"sourcesContent":["export interface DocumentViewChangeListener {\n targetNode: HTMLElement\n observe(): void\n unobserve(): void\n pauseMutationObserver(): void\n unpauseMutationObserver(): void\n}\n\nexport class DocumentViewChangeListener implements DocumentViewChangeListener {\n private readonly eventsTypes: string[] = ['resize', 'load', 'scroll', 'wheel', 'touchmove']\n private readonly config: MutationObserverInit = {\n attributes: true,\n childList: true,\n subtree: true\n }\n private mutationObserver: MutationObserver\n private callbackFunction: EventListenerOrEventListenerObject\n\n constructor(targetFunction: Function, targetNode: any = document.body) {\n this.targetNode = targetNode\n this.callbackFunction = ((event: any) =>\n targetFunction(event)) as EventListenerOrEventListenerObject\n this.mutationObserver = new MutationObserver((() => targetFunction()) as MutationCallback)\n }\n\n public observe(): void {\n this.mutationObserver.observe(this.targetNode, this.config)\n for (const eventType of this.eventsTypes) this.addListener(eventType)\n this.addResizeListener()\n this.addTransitionEndListener()\n }\n\n pauseMutationObserver(): void {\n this.mutationObserver.disconnect()\n }\n\n unpauseMutationObserver(): void {\n this.mutationObserver.observe(this.targetNode, this.config)\n }\n\n public unobserve(): void {\n this.mutationObserver.disconnect()\n for (const eventType of this.eventsTypes) this.removeListener(eventType)\n this.removeResizeListener()\n this.removeTransitionEndListener()\n }\n\n private addListener(eventType: string): void {\n document.addEventListener(eventType, this.callbackFunction, true)\n }\n\n private removeListener(eventType: string): void {\n document.removeEventListener(eventType, this.callbackFunction, true)\n }\n\n private addTransitionEndListener(): void {\n this.targetNode.addEventListener('transitionend', this.callbackFunction)\n }\n\n private removeTransitionEndListener(): void {\n this.targetNode.removeEventListener('transitionend', this.callbackFunction)\n }\n\n private addResizeListener(): void {\n window.addEventListener('resize', this.callbackFunction)\n }\n\n private removeResizeListener(): void {\n window.removeEventListener('resize', this.callbackFunction)\n }\n}\n\nexport function getLabelString(\n value: string | number | object | null | undefined,\n customLabelGetFunction: Function | null | undefined,\n objectLabelKeyName: string | null,\n enumKeyToLabelObjectArray?: EnumType[]\n): string {\n if (customLabelGetFunction != null) return customLabelGetFunction(value)\n if (value == null) return ''\n if (typeof value === 'object') return value[objectLabelKeyName as keyof typeof value]\n if (enumKeyToLabelObjectArray) return getEnumLabel(value, enumKeyToLabelObjectArray)\n return '' + value\n}\n\nfunction getEnumLabel(value: string | number, enumKeyArray: EnumType[]): string {\n return (enumKeyArray.find((eT: EnumType): boolean => eT.type === value)?.label ?? '') as string\n}\n\nexport type ListRequest = (maxNumItems: number, stringFilter?: string) => Promise<DataSet<any>>\n\nexport type EnumType = { type: string; label: string }\n\nexport type DataSet<T> = { data: T[]; totalNum: number; modelName?: string }\n\nexport interface AbortablePromise {\n abortController: AbortController\n func: Function\n then: Function\n}\n\nexport class AbortablePromise implements AbortablePromise {\n constructor() {\n this.abortController = new AbortController()\n this.func = (): void => {}\n this.then = (): void => {}\n }\n\n async abortablePromise(signal: AbortSignal, asyncFunc: Function, then: Function): Promise<any> {\n const response = await asyncFunc()\n if (signal.aborted) return\n return then(response)\n }\n\n setFunc(func: Function): void {\n this.func = func\n }\n\n setThen(then: Function): void {\n this.then = then\n }\n\n execute(): Promise<any> {\n return this.abortablePromise(this.abortController.signal, this.func, this.then)\n }\n\n abort(reason?: string): void {\n this.abortController.abort(reason || 'Aborted By Controller.')\n this.abortController = new AbortController()\n }\n\n resetAndExecute(func: Function, then: Function): Promise<any> {\n this.abort('New Request From Controller.')\n this.setFunc(func)\n this.setThen(then)\n return this.execute()\n }\n}\n","<template>\n <input\n ref=\"textInputRef\"\n :tabindex=\"enableTextFilter ? 0 : -1\"\n @keydown.enter=\"parentMethods.press($event)\"\n @keydown.space=\"parentMethods.press()\"\n @keydown.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusin=\"focusInHandler($event)\"\n @focusout=\"focusOutHandler($event)\"\n @input=\"updateQuery($event as InputEvent)\"\n type=\"text\"\n aria-autocomplete=\"none\"\n autocomplete=\"off\"\n :placeholder=\"placeholder\"\n :size=\"textInputSize\"\n :class=\"[\n pointerEventsClass,\n textInputColourClass,\n { 'text-filter-disabled': !enableTextFilter }\n ]\"\n class=\"list-filter-text-input\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, type PropType, ref } from 'vue'\n\nconst emit = defineEmits({\n 'update:selected': null,\n 'update:query': null,\n 'update:press': null\n})\n\nconst props = defineProps({\n enableTextFilter: {\n type: Boolean as PropType<boolean | null>,\n required: true\n },\n placeholder: {\n type: String as PropType<string | undefined>,\n default: undefined\n },\n enableButtonClick: {\n type: Boolean as PropType<boolean | null>,\n default: true\n },\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n required: true\n }\n})\nconst textInputRef = ref(null)\n\nfunction focusInHandler(e: FocusEvent) {\n if ('sourceCapabilities' in e && e.sourceCapabilities == null) props.parentMethods.closeList()\n else props.parentMethods.openList()\n}\n\nfunction focusOutHandler(event: FocusEvent) {\n props.parentMethods.unfocus(event)\n}\n\nfunction updateQuery(event: any) {\n if (event?.target?.value != undefined) emit('update:query', event.target.value)\n}\n\nconst textInputSize = computed(() => {\n const refLength: number = textInputRef?.value ? (textInputRef.value as string).length : 0\n const placeHolderLength: number = props.placeholder?.length || 0\n return refLength > 0 ? refLength : placeHolderLength > 0 ? placeHolderLength : 5\n})\n\nconst pointerEventsClass = computed(() => {\n const enable: boolean = props.enableButtonClick === true && props.enableTextFilter === true\n return enable ? '' : 'click-through'\n})\n\nconst textInputColourClass = computed(() => {\n const dark: boolean = (props.showDropDown && !props.enableTextFilter) || !props.showDropDown\n return dark ? 'dark-placeholder-text' : 'light-placeholder-text'\n})\n\nfunction blurInput() {\n if (textInputRef?.value) {\n const input: HTMLInputElement = textInputRef.value\n input.blur()\n input.value = ''\n }\n}\n\nfunction focusInput() {\n if (textInputRef?.value) (textInputRef.value as HTMLInputElement).focus()\n}\n\ndefineExpose({ blurInput, focusInput, textInputRef })\n</script>\n\n<style scoped>\n.list-filter-text-input {\n color: var(--superlist-text-colour, rgb(17, 24, 39));\n text-align: center;\n padding: 0.125rem 2rem 0.125rem 0.5rem !important;\n width: 100%;\n height: 100%;\n margin: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n background-color: transparent;\n border: 0 none;\n pointer-events: auto;\n cursor: text;\n}\n\n.list-filter-text-input:focus,\n.list-filter-text-input:focus-visible,\n.list-filter-text-input:active {\n text-align: left;\n}\n\n.click-through {\n pointer-events: none;\n}\n\n.dark-placeholder-text::placeholder {\n color: var(--superlist-text-colour, rgb(17, 24, 39));\n}\n\n.light-placeholder-text::placeholder {\n color: var(--superlist-disabled-text-colour, rgb(120, 125, 130));\n}\n\n.text-filter-disabled {\n background-color: transparent;\n border: none;\n outline: none;\n box-shadow: none;\n filter: none;\n}\n\n@media (min-width: 640px) {\n .list-filter-text-input {\n font-size: 0.875rem;\n line-height: 1.5rem;\n }\n}\n</style>\n","<template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n viewBox=\"0 -16 16 17\"\n >\n <path\n shape-rendering=\"geometricPrecision\"\n d=\"M 6 -2.25 L 13.75 -14 A 0.5 0.5 90 0 1 15 -13 L 6.5 -0.5 A 2 1 90 0 1 5.5 -0.5 L 1 -6 A 0.5 0.5 90 0 1 2.25 -7 Z\"\n />\n </svg>\n</template>\n","<template>\n <li\n v-for=\"(listItem, index) in filteredListItems\"\n :key=\"index\"\n ref=\"items\"\n @keyup.enter=\"parentMethods.press($event)\"\n @keyup.space=\"parentMethods.press($event)\"\n @keyup.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n tabindex=\"-1\"\n @mousedown.left=\"parentMethods.updatedSelected(listItem)\"\n :class=\"[\n { 'list-option-selected': selectedIndex === index },\n {\n 'list-option-active':\n filteredListItems.length === 1 || (focusedIndex === index && !mouseHoveringOnList)\n },\n 'list-option'\n ]\"\n >\n <span class=\"list-item-span\">{{ parentMethods.getLabel(listItem) }}</span>\n <default-tick v-if=\"selectedIndex === index\" class=\"list-item-icon\" aria-hidden=\"true\" />\n </li>\n <li\n v-if=\"filteredListItems.length === 0\"\n @keyup.enter=\"parentMethods.press($event)\"\n @keyup.space=\"parentMethods.press($event)\"\n @keyup.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n @mousedown.left=\"parentMethods.closeList($event)\"\n tabindex=\"-1\"\n class=\"list-option-message\"\n >\n <span class=\"list-item-span\">No Items To Display.</span>\n </li>\n <li\n v-if=\"totalOptionsCount && totalOptionsCount > (filteredListItems?.length || 0)\"\n @keyup.enter=\"parentMethods.press($event)\"\n @keyup.space=\"parentMethods.press($event)\"\n @keyup.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n @mousedown.left=\"parentMethods.closeList($event)\"\n tabindex=\"-1\"\n class=\"list-option-message\"\n >\n <span class=\"list-item-span\">\n +{{ totalOptionsCount - filteredListItems?.length || 0 }} More Items...</span\n >\n </li>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, type ShallowRef, useTemplateRef, watch } from 'vue'\nimport DefaultTick from './default-tick.vue'\nconst props = defineProps({\n mouseHoveringOnList: {\n type: Boolean,\n default: false\n },\n filteredListItems: {\n type: Array,\n default: () => []\n },\n focusedIndex: {\n type: Number,\n default: null\n },\n selectedIndex: {\n type: Number,\n default: null\n },\n listElementOpenAndVisible: {\n type: Boolean,\n default: false\n },\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n default: false\n },\n totalOptionsCount: {\n type: Number,\n default: 0\n }\n})\ntype HTMLLIElementOrArray = HTMLLIElement | HTMLLIElement[] | null\nconst iRefs: Readonly<ShallowRef<HTMLLIElementOrArray>> = useTemplateRef('items')\n\nconst focusedLi = computed((): HTMLElement | null => {\n if (!iRefs?.value) return null\n const refs: Array<HTMLLIElement | null> = Array.isArray(iRefs.value) ? iRefs.value : [iRefs.value]\n const focused = refs[props.focusedIndex]\n if (!focused) return null\n const isObject: boolean = typeof focused == 'object'\n const hasScrollIntoView: boolean = isObject && 'scrollIntoView' in focused\n const hasScrollFunc: boolean = hasScrollIntoView && typeof focused['scrollIntoView'] == 'function'\n return hasScrollFunc ? focused : null\n})\n\nwatch(\n () => props.showDropDown,\n () => scrollHighlightedListItemToTop()\n)\nwatch(\n () => props.listElementOpenAndVisible,\n () => scrollHighlightedListItemIntoView()\n)\nwatch(\n () => focusedLi.value,\n () => scrollHighlightedListItemIntoView()\n)\n\nfunction scrollHighlightedListItemToTop(): void {\n if (!props.showDropDown || !focusedLi?.value?.parentElement?.parentElement) return\n focusedLi.value.parentElement.parentElement.scrollTop = focusedLi.value.offsetTop\n}\n\nfunction scrollHighlightedListItemIntoView(): void {\n const li = focusedLi.value\n const liParent = li?.parentElement?.parentElement\n if (!props.showDropDown || !li || !liParent) return\n const aboveTop = li.offsetTop - liParent.scrollTop < 0\n const belowBottom = li.offsetTop + li.offsetHeight - liParent.scrollTop > liParent.clientHeight\n if (aboveTop) liParent.scrollTop = li.offsetTop\n if (belowBottom) liParent.scrollTop = li.offsetTop + li.clientHeight - liParent.clientHeight\n}\n</script>\n\n<style scoped>\n.list-option {\n text-transform: capitalize;\n display: inline-flex;\n width: 100%;\n position: relative;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n background-color: transparent;\n color: var(--superlist-text-colour, rgb(55, 60, 65));\n transition-property: font-weight, background-color, color, text-shadow;\n transition-duration: 500ms;\n transition-timing-function: ease;\n font-weight: 400;\n text-shadow: 1px 1px 3px var(--superlist-background-colour, white);\n}\n\n.list-option:focus-visible,\n.list-option > span:focus-visible {\n outline: none;\n}\n\n.list-option-selected {\n font-weight: 600;\n}\n\n.list-option-message {\n text-shadow: 1px 1px 3px var(--superlist-background-colour, white);\n text-transform: capitalize;\n display: inline-flex;\n width: 100%;\n position: relative;\n cursor: default;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n background-color: transparent;\n color: var(--superlist-disabled-text-colour, rgb(120, 125, 130));\n}\n\n.list-option-active:hover,\n.list-option-active,\n.list-option-selected:hover,\n.list-option:hover {\n font-weight: 600;\n background-color: var(--superlist-theme-colour, rgb(77, 168, 11, 0.8));\n color: var(--superlist-background-colour, white);\n text-shadow: 1px 1px 3px var(--superlist-theme-colour, rgb(77, 168, 11, 0.8));\n transition-duration: 0s !important;\n}\n\n.list-item-icon {\n display: flex;\n height: 1rem;\n width: 1rem;\n position: absolute;\n right: 0.7rem;\n margin-top: -0.1rem;\n align-self: center;\n}\n\n.list-item-span {\n padding: 0.5rem 1.75rem 0.5rem 0.75rem;\n width: 100%;\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n</style>\n","<template>\n <div ref=\"dropDownButtonContainer\" class=\"super-list-button-container\">\n <slot></slot>\n </div>\n <div\n id=\"super-list-select-list\"\n ref=\"listContainerRef\"\n @mouseenter=\"parentMethods.mouseOverList()\"\n tabindex=\"-1\"\n :class=\"[\n 'select-list',\n reverseList ? 'list-reverse' : 'list-normal',\n { 'select-list-open': showDropDown },\n { 'no-scroll': noScroll && listElementOpenAndVisible },\n { 'select-list-fixed': listElementOpenAndVisible },\n { 'select-list-scrollable': !noScroll }\n ]\"\n @keydown.space=\"preventSpaceScrollingList($event)\"\n @mouseup.left=\"refocusTextInput($event)\"\n >\n <ul tabindex=\"-1\" ref=\"dropDownListUL\" class=\"list-content\">\n <list-item\n :filteredListItems=\"listItemsToDisplay\"\n :mouseHoveringOnList=\"mouseHoveringOnList\"\n :focusedIndex=\"focusedIndex\"\n :selectedIndex=\"selectedIndex\"\n :listElementOpenAndVisible=\"listElementOpenAndVisible\"\n :parent-methods=\"parentMethods\"\n :show-drop-down=\"showDropDown\"\n :total-options-count=\"totalOptionsCount\"\n />\n </ul>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n computed,\n type ComputedRef,\n nextTick,\n onMounted,\n onUnmounted,\n type PropType,\n ref,\n watch\n} from 'vue'\nimport ListItem from '../ListInputComponents/ListItem.vue'\nimport { DocumentViewChangeListener } from '../DropDownLibrary'\n\nconst emit = defineEmits(['reverseDropDownList'])\n\nconst props = defineProps({\n mouseHoveringOnList: {\n type: Boolean,\n default: false\n },\n filteredListItems: {\n type: Array,\n default: () => []\n },\n focusedIndex: {\n type: Number,\n default: null\n },\n selectedIndex: {\n type: Number,\n default: null\n },\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n required: true\n },\n maxListHeightPX: {\n type: Number,\n required: true\n },\n listAnimationDurationMs: {\n type: Number as PropType<number>,\n required: true\n },\n blockListChange: {\n type: Boolean,\n required: true\n },\n totalOptionsCount: {\n type: Number,\n default: 0\n },\n enableScrollClose: {\n type: Boolean,\n default: true\n },\n enableTextFilter: {\n type: Boolean as PropType<boolean | null>,\n required: true\n }\n})\n\nconst dropDownButtonContainer = ref<HTMLElement | null>(null)\nconst dropDownListUL = ref<HTMLElement | null>(null)\nconst listContainerRef = ref<HTMLElement | null>(null)\nconst offsetLeft = ref<number>(0)\nconst offsetTop = ref<number>(0)\nconst offsetBottom = ref<number>(0)\nconst listOffset = ref<number>(0)\nconst parentWidthPx = ref<string>('0px')\nconst listElementOpenAndVisible = ref<boolean>(false)\nconst listItemsToDisplay = ref<any[]>([])\nconst listHeightPx = ref<number>(0)\n\nconst reverseList = computed((): boolean => {\n if (!listElementOpenAndVisible.value || window?.innerHeight == null) return false\n return sufficientRoomAbove() && insufficientRoomBelow()\n})\n\nconst noScroll = computed((): boolean => {\n return props.maxListHeightPX >= listHeightPx.value\n})\n\nwatch(\n () => reverseList.value,\n (reverse: boolean) => emit('reverseDropDownList', reverse),\n { immediate: true }\n)\n\nconst parentXPx = computed((): string => offsetLeft.value + 'px')\nconst parentYPx = computed((): string => listOffset.value + 'px')\n\ndefineExpose({ listContainerRef })\n\nconst preventSpaceScrollingList = (event: any) => {\n if (event?.key && event.key === ' ') event.preventDefault()\n}\n\nconst refocusTextInput = (event: MouseEvent) => {\n const list = listContainerRef?.value as HTMLElement | null\n const target = event.target as HTMLElement | null\n if (!(list && target && list.contains(target)) || list.isEqualNode(target))\n props.parentMethods.focusInput()\n}\n\nfunction getListULHeight(): number {\n return dropDownListUL?.value ? (dropDownListUL?.value as HTMLElement).clientHeight : 0\n}\n\nfunction displayableListHeight(): number {\n if (!listElementOpenAndVisible.value || getListULHeight() === 0) return props.maxListHeightPX\n const ulHt: number = getListULHeight() === 0 ? props.maxListHeightPX : +getListULHeight()\n return props.maxListHeightPX && props.maxListHeightPX > ulHt ? ulHt : props.maxListHeightPX\n}\n\nfunction sufficientRoomAbove(): boolean {\n return offsetTop.value > displayableListHeight()\n}\n\nfunction insufficientRoomBelow(): boolean {\n return offsetBottom.value < displayableListHeight()\n}\n\nconst maxListHeightPx = computed((): string => (props.maxListHeightPX || 0) + 'px')\n\nconst animationDuration = computed((): string => (props.listAnimationDurationMs || 0) + 'ms')\n\nconst updatedListItemsToDisplay = computed((): any[] => {\n return !props.blockListChange ? props.filteredListItems : listItemsToDisplay.value\n})\n\nwatch(\n () => updatedListItemsToDisplay,\n (newVal: ComputedRef<any[]>) => {\n if (newVal) listItemsToDisplay.value = newVal.value\n },\n { immediate: false, deep: true }\n)\n\nlet unobserveTimeout = setTimeout(() => {}, 0)\n\nlet changeListener: DocumentViewChangeListener | null = null\n\nfunction openAndObserveChangeListener() {\n listHeightPx.value = getListULHeight()\n clearTimeout(unobserveTimeout)\n if (changeListener) changeListener.observe()\n listElementOpenAndVisible.value = true\n buttonRePositionCallback(undefined)\n}\n\nfunction closeAndUnobserveChangeListener() {\n clearTimeout(unobserveTimeout)\n unobserveTimeout = setTimeout(() => {\n if (!props.showDropDown) {\n listElementOpenAndVisible.value = false\n if (changeListener) changeListener.unobserve()\n }\n }, props.listAnimationDurationMs + 50)\n}\n\nwatch(\n () => props.showDropDown,\n (newV, oldV) => {\n if (newV !== oldV) {\n setOffsets()\n if (newV) openAndObserveChangeListener()\n else closeAndUnobserveChangeListener()\n }\n },\n { immediate: true }\n)\n\nfunction buttonRePositionCallback(e: any): void {\n setOffsets()\n nextTick(() => setOffsets())\n closeListOnScrollIfNecessary(e)\n}\n\nfunction closeListOnScrollIfNecessary(e: any) {\n if (!props.enableScrollClose || !props.showDropDown) return\n const notInitialized: boolean = typeof listContainerRef?.value?.contains !== 'function'\n if (notInitialized || e?.target?.nodeType == null || insideListOrOtherList(e)) return\n const isScrollEvent: boolean = ['scroll', 'wheel', 'touchmove'].includes(e?.type)\n if (props.showDropDown && isScrollEvent) props.parentMethods.closeList()\n}\n\nfunction insideListOrOtherList(e: any): boolean {\n const insideButton: boolean = !!dropDownButtonContainer.value?.contains(e?.target as Node)\n const insideList: boolean = !!listContainerRef.value?.contains(e.target as Node)\n const otherList: boolean = [e?.srcElement?.id, e?.target?.id].includes('super-list-select-list')\n return insideButton || insideList || otherList\n}\n\nfunction setOffsets(): void {\n setButtonOffset()\n setListOffset()\n}\n\nfunction setButtonOffset(): void {\n if (dropDownButtonContainer?.value == null) return\n const brc: DOMRect = (dropDownButtonContainer.value as HTMLElement).getBoundingClientRect()\n offsetTop.value = brc.top\n offsetBottom.value = window.innerHeight - brc.bottom\n parentWidthPx.value = brc.width + 'px'\n}\n\nfunction setListOffset(): void {\n /**\n * List container must be used when calculating position and not \"dropDownListUL\".\n * Position must be calculated as window viewport might not match list container viewport.\n **/\n if (dropDownButtonContainer?.value == null || listContainerRef?.value == null) return\n const brc: DOMRect = getButtonContainerElement().getBoundingClientRect()\n const slrc: DOMRect = (listContainerRef.value as HTMLElement).getBoundingClientRect()\n const currentListOffset: number = listOffset.value\n const currentOffsetLeft: number = offsetLeft.value\n if (reverseList.value) listOffset.value = currentListOffset - (brc.top - slrc.bottom)\n else listOffset.value = currentListOffset - (slrc.top - brc.bottom)\n offsetLeft.value = currentOffsetLeft - (slrc.left - brc.left)\n}\n\nfunction getButtonElement(): HTMLButtonElement {\n return (dropDownButtonContainer?.value as HTMLElement).getElementsByTagName('button')[0]\n}\n\nfunction getButtonContainerElement(): HTMLDivElement {\n return dropDownButtonContainer?.value as HTMLDivElement\n}\n\nonMounted(() => {\n changeListener = new DocumentViewChangeListener(buttonRePositionCallback, getButtonElement())\n setTimeout(() => buttonRePositionCallback(undefined), 250)\n})\n\nonUnmounted(() => {\n changeListener?.unobserve()\n})\n</script>\n\n<style scoped>\n.list-normal {\n top: var(--parent-y);\n}\n\n.list-reverse {\n bottom: var(--parent-y);\n}\n\n.select-list {\n --parent-width: v-bind(parentWidthPx);\n --parent-x: v-bind(parentXPx);\n --parent-y: v-bind(parentYPx);\n --duration: v-bind(animationDuration);\n --border-radius: var(--superlist-list-border-radius, 0);\n border-radius: var(--border-radius);\n width: var(--parent-width);\n min-width: var(--parent-width);\n left: var(--parent-x);\n display: block;\n transition-property: max-height, opacity, visibility, box-shadow;\n transition-duration: var(--duration, 300ms);\n transition-timing-function: cubic-bezier(0.1, 0.9, 0.35, 0.98);\n position: absolute;\n backdrop-filter: blur(3px);\n -webkit-backdrop-filter: blur(3px);\n background-color: rgb(255, 255, 255, 0.7);\n align-items: baseline;\n opacity: 0.25;\n z-index: 999;\n visibility: collapse;\n overflow: auto;\n max-height: 0;\n border: none !important; /* can't transition border */\n}\n\n.select-list:focus-visible,\n.select-list > ul:focus-visible,\n.super-list-button-container:focus-visible {\n outline: none;\n}\n\n.super-list-button-container {\n height: 100%;\n width: 100%;\n}\n\n.select-list.select-list-open {\n z-index: 999999;\n --max-height: v-bind(maxListHeightPx);\n max-height: var(--max-height, 0);\n}\n\n.select-list.no-scroll {\n overflow: hidden;\n}\n\n.select-list-fixed {\n position: fixed;\n opacity: 1;\n visibility: visible;\n}\n\n.list-content {\n --duration: v-bind(animationDuration);\n overflow: visible;\n margin: 0;\n padding: 0;\n border-style: none;\n color: var(--superlist-text-colour, rgb(55, 60, 65));\n list-style: none;\n max-width: 100%;\n}\n\n.select-list.select-list-scrollable {\n border-radius: var(--border-radius);\n}\n\n.select-list:not(.select-list-fixed) {\n transition: none;\n box-shadow: none !important;\n}\n\n@media (min-width: 640px) {\n .select-list.select-list-scrollable {\n border-radius: var(--border-radius) 0 0 var(--border-radius);\n }\n .list-content {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n}\n</style>\n","<template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n viewBox=\"0 0 12 6\"\n >\n <path\n shape-rendering=\"geometricPrecision\"\n d=\"M 6 4 L 10 0.25 A 0.5 0.5 90 0 1 11 1.25 L 6.5 5.75 A 15 3 90 0 1 5.5 5.75 L 1 1.25 A 0.5 0.5 90 0 1 2 0.25 Z\"\n />\n </svg>\n</template>\n","<template>\n <button\n ref=\"buttonRef\"\n :tabindex=\"enableTextFilter ? -1 : 0\"\n @keydown.enter=\"enterHandler($event)\"\n @keydown.space=\"spaceHandler($event)\"\n @keydown.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n @click=\"clickHandler()\"\n type=\"button\"\n :class=\"[{ 'click-through': props.enableTextFilter || props.showDropDown }]\"\n class=\"list-button\"\n >\n <slot></slot>\n <span class=\"list-button-icon-div\" :class=\"{ 'bigger-gap': props.showDropDown }\">\n <span\n v-if=\"!customIcon\"\n class=\"list-button-icon\"\n :class=\"[{ 'rotate-180': !props.showDropDown }]\"\n >\n <default-arrow aria-hidden=\"true\" />\n </span>\n <span\n v-if=\"!customIcon\"\n class=\"list-button-icon\"\n :class=\"[{ 'rotate-180': props.showDropDown }]\"\n >\n <default-arrow v-if=\"customIcon == null\" aria-hidden=\"true\" />\n </span>\n <span v-if=\"customIcon\" class=\"list-button-icon custom-icon\">\n <component aria-hidden=\"true\" :is=\"customIcon as object\" />\n </span>\n </span>\n </button>\n</template>\n\n<script setup lang=\"ts\">\nimport { type PropType, ref } from 'vue'\nimport DefaultArrow from './default-arrow.vue'\n\n// prettier-ignore\nconst props = defineProps({ // eslint-disable-line\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n required: true\n },\n enableTextFilter: {\n type: Boolean,\n required: true\n },\n customIcon: {\n default: null,\n type: [Object, Function] as PropType<object | Function | null>\n },\n reverseDropDownList: {\n type: Boolean,\n required: true\n }\n})\n\nconst buttonRef = ref(null)\n\nfunction clickHandler() {\n if (props.enableTextFilter) return\n else props.parentMethods.openList()\n}\n\nfunction enterHandler(event: KeyboardEvent) {\n if (props.enableTextFilter) {\n props.parentMethods.focusInput()\n event.stopPropagation()\n event.preventDefault()\n } else {\n props.parentMethods.press(event)\n }\n}\n\nfunction spaceHandler(event: KeyboardEvent) {\n if (!props.enableTextFilter) props.parentMethods.press(event)\n}\n\nfunction blurInput() {\n if (buttonRef?.value) {\n const button: HTMLButtonElement = buttonRef.value\n button.blur()\n }\n}\n\nfunction focusInput() {\n if (buttonRef?.value) (buttonRef.value as HTMLButtonElement).focus()\n}\n\ndefineExpose({ blurInput, focusInput, buttonRef })\n</script>\n\n<style scoped>\n.list-button-icon {\n display: flex;\n transition-timing-function: ease-in-out;\n transition-duration: 200ms;\n transition-property: transform;\n width: 0.6rem;\n transform: rotate(0deg);\n color: var(--superlist-text-colour, rgb(17, 24, 39));\n justify-content: center;\n max-height: 18%;\n}\n\n.list-button-icon.custom-icon {\n max-height: 100%;\n width: 1.25rem;\n}\n\n.list-button-icon.rotate-180 {\n transform: rotate(180deg);\n}\n\n.list-button {\n position: relative;\n padding: 0;\n margin: 0;\n width: 100%;\n max-height: 100%;\n height: 100%;\n background-color: var(--superlist-background-colour, white);\n align-items: center;\n pointer-events: auto;\n cursor: pointer;\n}\n\n.list-button:focus,\n.list-button:focus-visible,\n.list-button:active {\n text-align: left;\n}\n\n.list-button-icon-div {\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding-right: 0.75rem;\n max-height: 100%;\n height: 100%;\n gap: max(0.15rem, calc(6.25% + 0.075rem));\n transition: gap 200ms;\n}\n\n.list-button-icon-div.bigger-gap {\n gap: calc(40% - 0.25rem);\n}\n\n.click-through {\n pointer-events: none;\n}\n</style>\n","<template>\n <div style=\"position: relative\" :class=\"$attrs.class\">\n <item-list\n ref=\"itemListRef\"\n :show-drop-down=\"showDropDown\"\n :filteredListItems=\"filteredListItems\"\n :mouseHoveringOnList=\"mouseHoveringOnList\"\n :focusedIndex=\"activeFocusedIndex\"\n :selectedIndex=\"selectedIndex\"\n :max-list-height-p-x=\"maxListHeightPX\"\n :list-animation-duration-ms=\"listAnimationDurationMs\"\n :parent-methods=\"parentMethods\"\n v-model:blockListChange=\"blockListUpdates\"\n :total-options-count=\"totalOptionsCount\"\n @reverseDropDownList=\"reverseDropDownList = $event\"\n :enableScrollClose=\"enableScrollClose\"\n :enable-text-filter=\"enableTextFilter\"\n >\n <list-button\n ref=\"dropDownButtonInput\"\n :parent-methods=\"parentMethods\"\n :show-drop-down=\"showDropDown\"\n :enable-text-filter=\"enableTextFilter\"\n :custom-icon=\"customIcon\"\n :reverse-drop-down-list=\"reverseDropDownList\"\n >\n <text-input\n ref=\"dropDownTextInput\"\n :enable-text-filter=\"enableTextFilter\"\n :show-drop-down=\"showDropDown\"\n :placeholder=\"placeholder\"\n :enable-button-click=\"enableButtonClick\"\n :parent-methods=\"parentMethods\"\n @update:query=\"query = $event\"\n />\n </list-button>\n </item-list>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, type PropType, ref, watch } from 'vue'\nimport {\n getLabelString,\n AbortablePromise,\n type DataSet,\n type EnumType,\n type ListRequest\n} from './DropDownLibrary'\nimport TextInput from './ListInputComponents/ListTextInput.vue'\nimport ItemList from './ListInputComponents/ItemList.vue'\nimport ListButton from './ListInputComponents/ListButton.vue'\n\nconst emit = defineEmits({ 'update:selected': null })\nconst props = defineProps({\n selected: {\n type: [String, Number, Object, null, undefined] as PropType<\n string | number | object | null | undefined\n >\n },\n options: {\n type: [Function, Array<string | number | object>] as PropType<\n ListRequest | Array<string | number | object>\n >,\n required: true\n },\n maxListOptions: {\n type: Number as PropType<number>,\n default: 50\n },\n maxListHeightPX: {\n type: Number as PropType<number>,\n default: 200\n },\n tooltip: {\n type: String,\n required: false\n },\n objectLabelKeyName: {\n type: String as PropType<string | null>,\n default: ''\n },\n enumKeyToLabelObjectArray: {\n type: Object as PropType<EnumType[]>,\n default: undefined\n },\n listAnimationDurationMs: {\n type: Number as PropType<number>,\n default: 300\n },\n customIcon: {\n default: null,\n type: [Object, Function] as PropType<object | Function | null>\n },\n forceTextFilterVisibilityTo: {\n type: Boolean as PropType<boolean>,\n default: undefined\n },\n customPlaceHolderFunction: {\n type: Function as PropType<Function | null>,\n default: null\n },\n colour: {\n type: String as PropType<string>,\n default: 'black'\n },\n scrollTextInputToTopOnMobile: {\n type: Boolean as PropType<boolean>,\n default: true\n }\n})\n\nconst listOptions = ref([] as Array<string | number | object>)\n\nconst abortablePromise = new AbortablePromise()\n\nconst totalOptionsCount = ref(0)\n\nconst enableTextFilter = computed((): boolean => {\n if (props.forceTextFilterVisibilityTo != undefined) return props.forceTextFilterVisibilityTo\n return totalOptionsCount.value > props.maxListOptions\n})\n\nconst showDropDown = ref<boolean>(false)\n\nconst blockListUpdates = ref<boolean>(false)\n\nconst reverseDropDownList = ref<boolean>(false)\n\nconst enableButtonClick = ref(true)\n\nconst loadingData = ref(false)\nconst errorState = ref(false)\n\nconst itemListRef = ref(ItemList)\nconst dropDownTextInput = ref(TextInput)\nconst dropDownButtonInput = ref(ListButton)\n\nconst query = ref('')\n\nwatch(\n () => query.value,\n (newV, oldV) => {\n if (newV !== oldV && typeof props.options === 'function') loadData(newV)\n }\n)\n\nconst blurInputIfNecessary = () => {\n if (enableTextFilter.value) dropDownTextInput?.value?.blurInput()\n}\n\nconst closeList = () => {\n clearTimeout(blockScrollCloseTimeout)\n blurInputIfNecessary()\n query.value = ''\n showDropDown.value = false\n enableButtonClick.value = true\n}\n\nconst placeholder = computed((): string => {\n if (errorState?.value === true) return 'Error loading data'\n if (loadingData?.value === true) return 'Loading...'\n return getLabel(props.selected)\n})\n\nconst updatedSelected = (newValue: any) => {\n if (newValue) emit('update:selected', newValue)\n closeList()\n}\n\nconst getLabel = (value?: string | number | object | null): string => {\n return getLabelString(\n value,\n props.customPlaceHolderFunction,\n props.objectLabelKeyName,\n props.enumKeyToLabelObjectArray\n )\n}\n\nfunction invalidArgumentError() {\n loadingData.value = true\n errorState.value = true\n throw new Error(`Invalid options argument provided to ListInputComponent`)\n}\n\nfunction invalidResponseError() {\n loadingData.value = true\n errorState.value = true\n throw new Error(`Invalid response provided to ListInputComponent, no total count key found`)\n}\n\nfunction invalidListValueKeyError() {\n loadingData.value = true\n errorState.value = true\n throw new Error('Invalid objectLabelKeyName for provided Dropdown list value.')\n}\n\nonMounted(() => {\n if (typeof props.options !== 'function' && !Array.isArray(props.options)) invalidArgumentError()\n else initializeOptions()\n})\n\nconst mouseHoveringOnList = ref(false)\n\nconst selectedIndex = ref(0)\nconst focusedIndex = ref(0)\nconst activeFocusedIndex = ref(0)\n\nwatch(\n () => focusedIndex.value,\n (newV, oldV) => {\n if (newV != oldV && !blockListUpdates.value) {\n activeFocusedIndex.value = newV\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => blockListUpdates.value,\n (newV) => {\n if (!newV) {\n activeFocusedIndex.value = focusedIndex.value\n }\n },\n { immediate: true }\n)\n\nconst filteredListItems = computed(() => {\n // if is function, return listOptions variable which is set by function\n if (typeof props.options === 'function' && !Array.isArray(props.options)) return listOptions.value\n const qry = query.value\n const lo = listOptions.value\n // else, is array, return filtered array\n return qry === '' ? lo : lo.filter((v) => getLabel(v).toLowerCase().includes(qry.toLowerCase()))\n})\n\nwatch(\n () => filteredListItems.value,\n (newV, oldV) => {\n if (JSON.stringify(newV) !== JSON.stringify(oldV)) focusSelectedOrFirstListItem()\n },\n { immediate: false, deep: true }\n)\n\nconst mouseOverList = () => {\n mouseHoveringOnList.value = true\n}\n\nconst focusSelectedOrFirstListItem = () => {\n const existingIndex = getSelectedValueIndex()\n selectedIndex.value = existingIndex /* may not be in the filtered list, allowed to be -1 */\n focusedIndex.value = existingIndex > -1 ? existingIndex : 0 /* default to first value */\n}\n\nfunction getSelectedValueIndex() {\n if (props.selected == null) return -1\n const labelsArray = listOptions.value.map((v) => getLabel(v))\n const matchingLabelsArray = labelsArray.filter((v) => v === getLabel(props.selected))\n if (matchingLabelsArray.length > 1) {\n const matchingIndexes = matchingLabelsArray.map((v) => labelsArray.indexOf(v))\n for (let i = 0; i < matchingIndexes.length; i++) {\n const currentMatchingOptionString = JSON.stringify(listOptions.value[matchingIndexes[i]])\n const selectedOptionString = JSON.stringify(props.selected)\n if (currentMatchingOptionString === selectedOptionString) return matchingIndexes[i]\n }\n return -1\n }\n return labelsArray.indexOf(getLabel(props.selected))\n}\n\nconst openList = () => {\n if (loadingData.value) return\n if (!showDropDown.value) {\n blockListUpdates.value = false\n focusSelectedOrFirstListItem()\n scrollMobileTextInputToTop()\n showDropDown.value = true\n }\n mouseHoveringOnList.value = false\n enableButtonClick.value = false\n}\n\nconst scrollMobileTextInputToTop = () => {\n const mobileWindow: boolean = window?.innerWidth != null && window.innerWidth < 640\n const mobileScreen: boolean = screen?.width != null && screen.width < 640\n const textInput: HTMLElement | null = dropDownTextInput.value.textInputRef as HTMLElement | null\n if ((mobileWindow || mobileScreen) && enableTextFilter.value) {\n preventScrollClose()\n if (props.scrollTextInputToTopOnMobile)\n textInput?.scrollIntoView({ block: 'start', inline: 'center' })\n }\n}\n\nconst enableScrollClose = ref<boolean>(true)\nlet blockScrollCloseTimeout = setTimeout(() => {}, 0)\n\nfunction preventScrollClose() {\n const textInput: HTMLElement | null = dropDownTextInput.value.textInputRef as HTMLElement | null\n if (!textInput) return\n enableScrollClose.value = false\n let preventingScrollCloseInterval: NodeJS.Timeout | null = null\n\n const clearAll = () => {\n if (preventingScrollCloseInterval) clearInterval(preventingScrollCloseInterval)\n clearTimeout(blockScrollCloseTimeout)\n setTimeout(() => {\n enableScrollClose.value = true\n }, 100)\n }\n\n blockScrollCloseTimeout = setTimeout(clearAll, 5000)\n\n preventingScrollCloseInterval = setInterval(() => {\n if (\n showDropDown.value === false ||\n (textInput?.scrollTop === 0 && document.readyState === 'complete')\n )\n clearAll()\n }, 100)\n}\n\nconst focusInput = () => {\n if (enableTextFilter?.value == true) dropDownTextInput.value.focusInput()\n else if (dropDownButtonInput?.value?.focusInput) dropDownButtonInput?.value?.focusInput()\n}\n\nasync function initializeOptions(): Promise<void> {\n if (typeof props.options === 'function') {\n await loadData(query.value ? query.value : undefined, true)\n } else {\n validateListOptions(props.options as Array<string | number | object>)\n totalOptionsCount.value = listOptions.value.length\n }\n initializeSelected()\n}\n\ndefineExpose({ initializeOptions, getLabel })\n\nfunction initializeSelected() {\n const invalidSelection = getSelectedValueIndex() == -1\n const existingOptionNotSelected = invalidSelection && listOptions.value && !!listOptions.value[0]\n if (existingOptionNotSelected) updatedSelected(listOptions.value[0])\n}\n\nasync function loadData(stringFilter?: string, disableOnLoad: boolean = true) {\n loadingData.value = disableOnLoad\n const func = async () => (props.options as Function)(props.maxListOptions, stringFilter || '')\n const next = (response: DataSet<any>) => {\n if (!response || !('data' in response)) invalidArgumentError()\n validateListOptions(response.data)\n getOptionsCount(response?.data?.length ?? 0).then(() => {\n loadingData.value = false\n })\n }\n await abortablePromise.resetAndExecute(func, next)\n}\n\nasync function getOptionsCount(dataLength: number): Promise<void> {\n const func = async () => (props.options as Function)(1, '')\n const next = (response: DataSet<any>) => {\n if (!response || !('totalNum' in response)) invalidResponseError()\n totalOptionsCount.value = response.totalNum ?? dataLength\n }\n await abortablePromise.resetAndExecute(func, next)\n}\n\nconst getCurrentlyFocusedListItemElement = (): HTMLElement | null => {\n const listInput: HTMLElement | null = dropDownTextInput?.value?.textInputRef as HTMLElement | null\n return listInput?.getElementsByTagName('li')[focusedIndex.value] ?? null\n}\n\nconst press = (event?: any) => {\n if (showDropDown.value == false) {\n openList()\n } else if (event) {\n keypress(event)\n }\n}\n\nconst keypress = (event: any) => {\n const key: string = event.key || event.code\n if (key === 'Tab' || key === 'Escape') closeList()\n if (key === 'ArrowDown') down(event)\n if (key === 'ArrowUp') up(event)\n if (key === 'Enter' || key === ' ') updateSelectedFromTextQuery()\n event.preventDefault()\n event.stopPropagation()\n}\n\nconst updateSelectedFromTextQuery = () => {\n if (filteredListItems.value.length > 0) {\n blockListUpdates.value = true\n updatedSelected(filteredListItems.value[focusedIndex.value])\n } else {\n closeList()\n }\n}\n\nconst down = (event: any) => {\n enableButtonClick.value = true\n if (focusedIndex.value < filteredListItems.value.length - 1) {\n event.preventDefault()\n mouseHoveringOnList.value = false\n focusedIndex.value++\n getCurrentlyFocusedListItemElement()?.focus()\n }\n}\n\nconst up = (event: any) => {\n enableButtonClick.value = true\n if (focusedIndex.value > 0) {\n event.preventDefault()\n mouseHoveringOnList.value = false\n focusedIndex.value--\n getCurrentlyFocusedListItemElement()?.focus()\n }\n}\n\nconst unfocus = (event: any) => {\n if (showDropDown?.value === false) return\n if (query.value.length > 0) blockListUpdates.value = true\n const list: HTMLElement | null = itemListRef?.value?.listContainerRef as HTMLElement | null\n const listInput: HTMLElement | null = dropDownTextInput?.value?.textInputRef as HTMLElement | null\n const isListInput = event?.relatedTarget && listInput?.isEqualNode(event?.relatedTarget)\n const isList = event?.relatedTarget && list && list.contains(event?.relatedTarget)\n const isListItem = event?.relatedTarget && list && list.isEqualNode(event?.relatedTarget)\n if (isList || isListInput) return\n if (isListItem) {\n focusInput()\n return\n }\n closeList()\n}\n\nfunction validateListOptions(optns: Array<string | number | object>) {\n if (!Array.isArray(optns)) invalidArgumentError()\n if (optns.length > 0 && typeof optns[0] === 'object') validateObjectList(optns as Array<object>)\n listOptions.value = optns as Array<string | number | object>\n}\n\nfunction validateObjectList(values: Array<object>) {\n if (!props.objectLabelKeyName || props.objectLabelKeyName.length === 0) invalidListValueKeyError()\n const key: string = props.objectLabelKeyName as string\n for (let i = 0; i < values.length; i++) {\n if (typeof values[i] !== 'object' || !(key in values[i])) invalidListValueKeyError()\n }\n}\n\nconst parentMethods = {\n openList: openList,\n unfocus: unfocus,\n press: press,\n mouseOverList: mouseOverList,\n getLabel: getLabel,\n updatedSelected: updatedSelected,\n focusInput: focusInput,\n closeList: closeList\n}\n</script>\n\n<style scoped>\n* {\n box-sizing: border-box;\n}\n</style>\n"],"names":["DocumentViewChangeListener","targetFunction","targetNode","event","eventType","getLabelString","value","customLabelGetFunction","objectLabelKeyName","enumKeyToLabelObjectArray","getEnumLabel","enumKeyArray","eT","AbortablePromise","signal","asyncFunc","then","response","func","reason","emit","__emit","props","__props","textInputRef","ref","focusInHandler","e","focusOutHandler","updateQuery","textInputSize","computed","refLength","placeHolderLength","pointerEventsClass","textInputColourClass","blurInput","input","focusInput","__expose","_createElementBlock","$event","_cache","_withKeys","_normalizeClass","_openBlock","_hoisted_1","_createElementVNode","iRefs","useTemplateRef","focusedLi","focused","watch","scrollHighlightedListItemToTop","scrollHighlightedListItemIntoView","li","liParent","aboveTop","belowBottom","_Fragment","_renderList","listItem","index","_withModifiers","_hoisted_2","_toDisplayString","_createBlock","DefaultTick","_hoisted_3","dropDownButtonContainer","dropDownListUL","listContainerRef","offsetLeft","offsetTop","offsetBottom","listOffset","parentWidthPx","listElementOpenAndVisible","listItemsToDisplay","listHeightPx","reverseList","sufficientRoomAbove","insufficientRoomBelow","noScroll","reverse","parentXPx","parentYPx","preventSpaceScrollingList","refocusTextInput","list","target","getListULHeight","displayableListHeight","ulHt","maxListHeightPx","animationDuration","updatedListItemsToDisplay","newVal","unobserveTimeout","changeListener","openAndObserveChangeListener","buttonRePositionCallback","closeAndUnobserveChangeListener","newV","oldV","setOffsets","nextTick","closeListOnScrollIfNecessary","insideListOrOtherList","isScrollEvent","insideButton","insideList","otherList","setButtonOffset","setListOffset","brc","getButtonContainerElement","slrc","currentListOffset","currentOffsetLeft","getButtonElement","onMounted","onUnmounted","_renderSlot","_ctx","_createVNode","ListItem","buttonRef","clickHandler","enterHandler","spaceHandler","DefaultArrow","_resolveDynamicComponent","listOptions","abortablePromise","totalOptionsCount","enableTextFilter","showDropDown","blockListUpdates","reverseDropDownList","enableButtonClick","loadingData","errorState","itemListRef","ItemList","dropDownTextInput","TextInput","dropDownButtonInput","ListButton","query","blurInputIfNecessary","closeList","blockScrollCloseTimeout","placeholder","getLabel","updatedSelected","newValue","invalidArgumentError","invalidResponseError","invalidListValueKeyError","initializeOptions","mouseHoveringOnList","selectedIndex","focusedIndex","activeFocusedIndex","filteredListItems","qry","lo","v","focusSelectedOrFirstListItem","mouseOverList","existingIndex","getSelectedValueIndex","labelsArray","matchingLabelsArray","matchingIndexes","i","currentMatchingOptionString","selectedOptionString","openList","scrollMobileTextInputToTop","mobileWindow","mobileScreen","textInput","preventScrollClose","enableScrollClose","preventingScrollCloseInterval","clearAll","loadData","validateListOptions","initializeSelected","stringFilter","disableOnLoad","next","getOptionsCount","dataLength","getCurrentlyFocusedListItemElement","press","keypress","key","down","up","updateSelectedFromTextQuery","unfocus","listInput","isListInput","is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,"file":"super-list.js","sources":["../src/DropDownLibrary.ts","../src/ListInputComponents/ListTextInput.vue","../src/ListInputComponents/default-tick.vue","../src/ListInputComponents/ListItem.vue","../src/ListInputComponents/ItemList.vue","../src/ListInputComponents/default-arrow.vue","../src/ListInputComponents/ListButton.vue","../src/super-list.vue"],"sourcesContent":["export interface DocumentViewChangeListener {\n targetNode: HTMLElement\n observe(): void\n unobserve(): void\n pauseMutationObserver(): void\n unpauseMutationObserver(): void\n}\n\nexport class DocumentViewChangeListener implements DocumentViewChangeListener {\n private readonly eventsTypes: string[] = ['resize', 'load', 'scroll', 'wheel', 'touchmove']\n private readonly config: MutationObserverInit = {\n attributes: true,\n childList: true,\n subtree: true\n }\n private mutationObserver: MutationObserver\n private callbackFunction: EventListenerOrEventListenerObject\n\n constructor(targetFunction: Function, targetNode: any = document.body) {\n this.targetNode = targetNode\n this.callbackFunction = ((event: any) =>\n targetFunction(event)) as EventListenerOrEventListenerObject\n this.mutationObserver = new MutationObserver((() => targetFunction()) as MutationCallback)\n }\n\n public observe(): void {\n this.mutationObserver.observe(this.targetNode, this.config)\n for (const eventType of this.eventsTypes) this.addListener(eventType)\n this.addResizeListener()\n this.addTransitionEndListener()\n }\n\n pauseMutationObserver(): void {\n this.mutationObserver.disconnect()\n }\n\n unpauseMutationObserver(): void {\n this.mutationObserver.observe(this.targetNode, this.config)\n }\n\n public unobserve(): void {\n this.mutationObserver.disconnect()\n for (const eventType of this.eventsTypes) this.removeListener(eventType)\n this.removeResizeListener()\n this.removeTransitionEndListener()\n }\n\n private addListener(eventType: string): void {\n document.addEventListener(eventType, this.callbackFunction, true)\n }\n\n private removeListener(eventType: string): void {\n document.removeEventListener(eventType, this.callbackFunction, true)\n }\n\n private addTransitionEndListener(): void {\n this.targetNode.addEventListener('transitionend', this.callbackFunction)\n }\n\n private removeTransitionEndListener(): void {\n this.targetNode.removeEventListener('transitionend', this.callbackFunction)\n }\n\n private addResizeListener(): void {\n window.addEventListener('resize', this.callbackFunction)\n }\n\n private removeResizeListener(): void {\n window.removeEventListener('resize', this.callbackFunction)\n }\n}\n\nexport function getLabelString(\n value: string | number | object | null | undefined,\n customLabelGetFunction: Function | null | undefined,\n objectLabelKeyName: string | null,\n enumKeyToLabelObjectArray?: EnumType[]\n): string {\n if (customLabelGetFunction != null) return customLabelGetFunction(value)\n if (value == null) return ''\n if (typeof value === 'object') return value[objectLabelKeyName as keyof typeof value]\n if (enumKeyToLabelObjectArray) return getEnumLabel(value, enumKeyToLabelObjectArray)\n return '' + value\n}\n\nfunction getEnumLabel(value: string | number, enumKeyArray: EnumType[]): string {\n return (enumKeyArray.find((eT: EnumType): boolean => eT.type === value)?.label ?? '') as string\n}\n\nexport type ListRequest = (maxNumItems: number, stringFilter?: string) => Promise<DataSet<any>>\n\nexport type EnumType = { type: string; label: string }\n\nexport type DataSet<T> = { data: T[]; totalNum: number; modelName?: string }\n\nexport interface AbortablePromise {\n abortController: AbortController\n func: Function\n then: Function\n}\n\nexport class AbortablePromise implements AbortablePromise {\n constructor() {\n this.abortController = new AbortController()\n this.func = (): void => {}\n this.then = (): void => {}\n }\n\n async abortablePromise(signal: AbortSignal, asyncFunc: Function, then: Function): Promise<any> {\n const response = await asyncFunc()\n if (signal.aborted) return\n return then(response)\n }\n\n setFunc(func: Function): void {\n this.func = func\n }\n\n setThen(then: Function): void {\n this.then = then\n }\n\n execute(): Promise<any> {\n return this.abortablePromise(this.abortController.signal, this.func, this.then)\n }\n\n abort(reason?: string): void {\n this.abortController.abort(reason || 'Aborted By Controller.')\n this.abortController = new AbortController()\n }\n\n resetAndExecute(func: Function, then: Function): Promise<any> {\n this.abort('New Request From Controller.')\n this.setFunc(func)\n this.setThen(then)\n return this.execute()\n }\n}\n","<template>\n <input\n ref=\"textInputRef\"\n :tabindex=\"enableTextFilter ? 0 : -1\"\n @keydown.enter=\"parentMethods.press($event)\"\n @keydown.space=\"parentMethods.press()\"\n @keydown.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusin=\"focusInHandler($event)\"\n @focusout=\"focusOutHandler($event)\"\n @input=\"updateQuery($event as InputEvent)\"\n type=\"text\"\n aria-autocomplete=\"none\"\n autocomplete=\"off\"\n :placeholder=\"placeholder\"\n :size=\"textInputSize\"\n :class=\"[\n pointerEventsClass,\n textInputColourClass,\n { 'text-filter-disabled': !enableTextFilter }\n ]\"\n class=\"list-filter-text-input\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, type PropType, ref } from 'vue'\n\nconst emit = defineEmits({\n 'update:selected': null,\n 'update:query': null,\n 'update:press': null\n})\n\nconst props = defineProps({\n enableTextFilter: {\n type: Boolean as PropType<boolean | null>,\n required: true\n },\n placeholder: {\n type: String as PropType<string | undefined>,\n default: undefined\n },\n enableButtonClick: {\n type: Boolean as PropType<boolean | null>,\n default: true\n },\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n required: true\n }\n})\nconst textInputRef = ref(null)\n\nfunction focusInHandler(e: FocusEvent) {\n if ('sourceCapabilities' in e && e.sourceCapabilities == null) props.parentMethods.closeList()\n else props.parentMethods.openList()\n}\n\nfunction focusOutHandler(event: FocusEvent) {\n props.parentMethods.unfocus(event)\n}\n\nfunction updateQuery(event: any) {\n if (event?.target?.value != undefined) emit('update:query', event.target.value)\n}\n\nconst textInputSize = computed(() => {\n const refLength: number = textInputRef?.value ? (textInputRef.value as string).length : 0\n const placeHolderLength: number = props.placeholder?.length || 0\n return refLength > 0 ? refLength : placeHolderLength > 0 ? placeHolderLength : 5\n})\n\nconst pointerEventsClass = computed(() => {\n const enable: boolean = props.enableButtonClick === true && props.enableTextFilter === true\n return enable ? '' : 'click-through'\n})\n\nconst textInputColourClass = computed(() => {\n const dark: boolean = (props.showDropDown && !props.enableTextFilter) || !props.showDropDown\n return dark ? 'dark-placeholder-text' : 'light-placeholder-text'\n})\n\nfunction blurInput() {\n if (textInputRef?.value) {\n const input: HTMLInputElement = textInputRef.value\n input.blur()\n input.value = ''\n }\n}\n\nfunction focusInput() {\n if (textInputRef?.value) (textInputRef.value as HTMLInputElement).focus()\n}\n\ndefineExpose({ blurInput, focusInput, textInputRef })\n</script>\n\n<style scoped>\n.list-filter-text-input {\n color: var(--superlist-text-colour, rgb(17, 24, 39));\n text-align: center;\n padding: 0.125rem 2rem 0.125rem 0.5rem !important;\n width: 100%;\n height: 100%;\n margin: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n background-color: transparent;\n border: 0 none;\n pointer-events: auto;\n cursor: text;\n}\n\n.list-filter-text-input:focus,\n.list-filter-text-input:focus-visible,\n.list-filter-text-input:active {\n text-align: left;\n}\n\n.click-through {\n pointer-events: none;\n}\n\n.dark-placeholder-text::placeholder {\n color: var(--superlist-text-colour, rgb(17, 24, 39));\n}\n\n.light-placeholder-text::placeholder {\n color: var(--superlist-disabled-text-colour, rgb(120, 125, 130));\n}\n\n.text-filter-disabled {\n background-color: transparent;\n border: none;\n outline: none;\n box-shadow: none;\n filter: none;\n}\n\n@media (min-width: 640px) {\n .list-filter-text-input {\n font-size: 0.875rem;\n line-height: 1.5rem;\n }\n}\n</style>\n","<template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n viewBox=\"0 -16 16 17\"\n >\n <path\n shape-rendering=\"geometricPrecision\"\n d=\"M 6 -2.25 L 13.75 -14 A 0.5 0.5 90 0 1 15 -13 L 6.5 -0.5 A 2 1 90 0 1 5.5 -0.5 L 1 -6 A 0.5 0.5 90 0 1 2.25 -7 Z\"\n />\n </svg>\n</template>\n","<template>\n <li\n v-for=\"(listItem, index) in filteredListItems\"\n :key=\"index\"\n ref=\"items\"\n @keyup.enter=\"parentMethods.press($event)\"\n @keyup.space=\"parentMethods.press($event)\"\n @keyup.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n tabindex=\"-1\"\n @mousedown.left=\"parentMethods.updatedSelected(listItem)\"\n :class=\"[\n { 'list-option-selected': selectedIndex === index },\n {\n 'list-option-active':\n filteredListItems.length === 1 || (focusedIndex === index && !mouseHoveringOnList)\n },\n 'list-option'\n ]\"\n >\n <span class=\"list-item-span\">{{ parentMethods.getLabel(listItem) }}</span>\n <default-tick v-if=\"selectedIndex === index\" class=\"list-item-icon\" aria-hidden=\"true\" />\n </li>\n <li\n v-if=\"filteredListItems.length === 0\"\n @keyup.enter=\"parentMethods.press($event)\"\n @keyup.space=\"parentMethods.press($event)\"\n @keyup.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n @mousedown.left=\"parentMethods.closeList($event)\"\n tabindex=\"-1\"\n class=\"list-option-message\"\n >\n <span class=\"list-item-span\">No Items To Display.</span>\n </li>\n <li\n v-if=\"totalOptionsCount && totalOptionsCount > (filteredListItems?.length || 0)\"\n @keyup.enter=\"parentMethods.press($event)\"\n @keyup.space=\"parentMethods.press($event)\"\n @keyup.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n @mousedown.left=\"parentMethods.closeList($event)\"\n tabindex=\"-1\"\n class=\"list-option-message\"\n >\n <span class=\"list-item-span\">\n +{{ totalOptionsCount - filteredListItems?.length || 0 }} More Items...</span\n >\n </li>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, type ShallowRef, useTemplateRef, watch } from 'vue'\nimport DefaultTick from './default-tick.vue'\nconst props = defineProps({\n mouseHoveringOnList: {\n type: Boolean,\n default: false\n },\n filteredListItems: {\n type: Array,\n default: () => []\n },\n focusedIndex: {\n type: Number,\n default: null\n },\n selectedIndex: {\n type: Number,\n default: null\n },\n listElementOpenAndVisible: {\n type: Boolean,\n default: false\n },\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n default: false\n },\n totalOptionsCount: {\n type: Number,\n default: 0\n }\n})\ntype HTMLLIElementOrArray = HTMLLIElement | HTMLLIElement[] | null\nconst iRefs: Readonly<ShallowRef<HTMLLIElementOrArray>> = useTemplateRef('items')\n\nconst focusedLi = computed((): HTMLElement | null => {\n if (!iRefs?.value) return null\n const refs: Array<HTMLLIElement | null> = Array.isArray(iRefs.value) ? iRefs.value : [iRefs.value]\n const focused = refs[props.focusedIndex]\n if (!focused) return null\n const isObject: boolean = typeof focused == 'object'\n const hasScrollIntoView: boolean = isObject && 'scrollIntoView' in focused\n const hasScrollFunc: boolean = hasScrollIntoView && typeof focused['scrollIntoView'] == 'function'\n return hasScrollFunc ? focused : null\n})\n\nwatch(\n () => props.showDropDown,\n () => scrollHighlightedListItemToTop()\n)\nwatch(\n () => props.listElementOpenAndVisible,\n () => scrollHighlightedListItemIntoView()\n)\nwatch(\n () => focusedLi.value,\n () => scrollHighlightedListItemIntoView()\n)\n\nfunction scrollHighlightedListItemToTop(): void {\n if (!props.showDropDown || !focusedLi?.value?.parentElement?.parentElement) return\n focusedLi.value.parentElement.parentElement.scrollTop = focusedLi.value.offsetTop\n}\n\nfunction scrollHighlightedListItemIntoView(): void {\n const li = focusedLi.value\n const liParent = li?.parentElement?.parentElement\n if (!props.showDropDown || !li || !liParent) return\n const aboveTop = li.offsetTop - liParent.scrollTop < 0\n const belowBottom = li.offsetTop + li.offsetHeight - liParent.scrollTop > liParent.clientHeight\n if (aboveTop) liParent.scrollTop = li.offsetTop\n if (belowBottom) liParent.scrollTop = li.offsetTop + li.clientHeight - liParent.clientHeight\n}\n</script>\n\n<style scoped>\n.list-option {\n text-transform: capitalize;\n display: inline-flex;\n width: 100%;\n position: relative;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n background-color: transparent;\n color: var(--superlist-text-colour, rgb(55, 60, 65));\n transition-property: font-weight, background-color, color, text-shadow;\n transition-duration: 500ms;\n transition-timing-function: ease;\n font-weight: 400;\n text-shadow: 1px 1px 3px var(--superlist-background-colour, white);\n}\n\n.list-option:focus-visible,\n.list-option > span:focus-visible {\n outline: none;\n}\n\n.list-option-selected {\n font-weight: 600;\n}\n\n.list-option-message {\n text-shadow: 1px 1px 3px var(--superlist-background-colour, white);\n text-transform: capitalize;\n display: inline-flex;\n width: 100%;\n position: relative;\n cursor: default;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n background-color: transparent;\n color: var(--superlist-disabled-text-colour, rgb(120, 125, 130));\n}\n\n.list-option-active:hover,\n.list-option-active,\n.list-option-selected:hover,\n.list-option:hover {\n font-weight: 600;\n background-color: var(--superlist-theme-colour, rgb(77, 168, 11, 0.8));\n color: var(--superlist-background-colour, white);\n text-shadow: 1px 1px 3px var(--superlist-theme-colour, rgb(77, 168, 11, 0.8));\n transition-duration: 0s !important;\n}\n\n.list-item-icon {\n display: flex;\n height: 1rem;\n width: 1rem;\n position: absolute;\n right: 0.7rem;\n margin-top: -0.1rem;\n align-self: center;\n}\n\n.list-item-span {\n padding: 0.5rem 1.75rem 0.5rem 0.75rem;\n width: 100%;\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n</style>\n","<template>\n <div ref=\"dropDownButtonContainer\" class=\"super-list-button-container\">\n <slot></slot>\n </div>\n <div\n id=\"super-list-select-list\"\n ref=\"listContainerRef\"\n @mouseenter=\"parentMethods.mouseOverList()\"\n tabindex=\"-1\"\n :class=\"[\n 'select-list',\n reverseList ? 'list-reverse' : 'list-normal',\n { 'select-list-open': showDropDown },\n { 'no-scroll': noScroll && listElementOpenAndVisible },\n { 'select-list-fixed': listElementOpenAndVisible },\n { 'select-list-scrollable': !noScroll }\n ]\"\n @keydown.space=\"preventSpaceScrollingList($event)\"\n @mouseup.left=\"refocusTextInput($event)\"\n >\n <ul tabindex=\"-1\" ref=\"dropDownListUL\" class=\"list-content\">\n <list-item\n :filteredListItems=\"listItemsToDisplay\"\n :mouseHoveringOnList=\"mouseHoveringOnList\"\n :focusedIndex=\"focusedIndex\"\n :selectedIndex=\"selectedIndex\"\n :listElementOpenAndVisible=\"listElementOpenAndVisible\"\n :parent-methods=\"parentMethods\"\n :show-drop-down=\"showDropDown\"\n :total-options-count=\"totalOptionsCount\"\n />\n </ul>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n computed,\n type ComputedRef,\n nextTick,\n onMounted,\n onUnmounted,\n type PropType,\n ref,\n watch\n} from 'vue'\nimport ListItem from '../ListInputComponents/ListItem.vue'\nimport { DocumentViewChangeListener } from '../DropDownLibrary'\n\nconst emit = defineEmits(['reverseDropDownList'])\n\nconst props = defineProps({\n mouseHoveringOnList: {\n type: Boolean,\n default: false\n },\n filteredListItems: {\n type: Array,\n default: () => []\n },\n focusedIndex: {\n type: Number,\n default: null\n },\n selectedIndex: {\n type: Number,\n default: null\n },\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n required: true\n },\n maxListHeightPX: {\n type: Number,\n required: true\n },\n listAnimationDurationMs: {\n type: Number as PropType<number>,\n required: true\n },\n blockListChange: {\n type: Boolean,\n required: true\n },\n totalOptionsCount: {\n type: Number,\n default: 0\n },\n enableScrollClose: {\n type: Boolean,\n default: true\n }\n})\n\nconst dropDownButtonContainer = ref<HTMLElement | null>(null)\nconst dropDownListUL = ref<HTMLElement | null>(null)\nconst listContainerRef = ref<HTMLElement | null>(null)\nconst offsetLeft = ref<number>(0)\nconst offsetTop = ref<number>(0)\nconst offsetBottom = ref<number>(0)\nconst listOffset = ref<number>(0)\nconst parentWidthPx = ref<string>('0px')\nconst listElementOpenAndVisible = ref<boolean>(false)\nconst listItemsToDisplay = ref<any[]>([])\nconst listHeightPx = ref<number>(0)\n\nconst reverseList = computed((): boolean => {\n if (!listElementOpenAndVisible.value || window?.innerHeight == null) return false\n return sufficientRoomAbove() && insufficientRoomBelow()\n})\n\nconst noScroll = computed((): boolean => {\n return props.maxListHeightPX >= listHeightPx.value\n})\n\nwatch(\n () => reverseList.value,\n (reverse: boolean) => emit('reverseDropDownList', reverse),\n { immediate: true }\n)\n\nconst parentXPx = computed((): string => offsetLeft.value + 'px')\nconst parentYPx = computed((): string => listOffset.value + 'px')\n\ndefineExpose({ listContainerRef })\n\nconst preventSpaceScrollingList = (event: any) => {\n if (event?.key && event.key === ' ') event.preventDefault()\n}\n\nconst refocusTextInput = (event: MouseEvent) => {\n const list = listContainerRef?.value as HTMLElement | null\n const target = event.target as HTMLElement | null\n if (!(list && target && list.contains(target)) || list.isEqualNode(target))\n props.parentMethods.focusInput()\n}\n\nfunction getListULHeight(): number {\n return dropDownListUL?.value ? (dropDownListUL?.value as HTMLElement).clientHeight : 0\n}\n\nfunction displayableListHeight(): number {\n if (!listElementOpenAndVisible.value || getListULHeight() === 0) return props.maxListHeightPX\n const ulHt: number = getListULHeight() === 0 ? props.maxListHeightPX : +getListULHeight()\n return props.maxListHeightPX && props.maxListHeightPX > ulHt ? ulHt : props.maxListHeightPX\n}\n\nfunction sufficientRoomAbove(): boolean {\n return offsetTop.value > displayableListHeight()\n}\n\nfunction insufficientRoomBelow(): boolean {\n return offsetBottom.value < displayableListHeight()\n}\n\nconst maxListHeightPx = computed((): string => (props.maxListHeightPX || 0) + 'px')\n\nconst animationDuration = computed((): string => (props.listAnimationDurationMs || 0) + 'ms')\n\nconst updatedListItemsToDisplay = computed((): any[] => {\n return !props.blockListChange ? props.filteredListItems : listItemsToDisplay.value\n})\n\nwatch(\n () => updatedListItemsToDisplay,\n (newVal: ComputedRef<any[]>) => {\n if (newVal) listItemsToDisplay.value = newVal.value\n },\n { immediate: false, deep: true }\n)\n\nlet unobserveTimeout = setTimeout(() => {}, 0)\n\nlet changeListener: DocumentViewChangeListener | null = null\n\nfunction openAndObserveChangeListener() {\n listHeightPx.value = getListULHeight()\n clearTimeout(unobserveTimeout)\n if (changeListener) changeListener.observe()\n listElementOpenAndVisible.value = true\n buttonRePositionCallback(undefined)\n}\n\nfunction closeAndUnobserveChangeListener() {\n clearTimeout(unobserveTimeout)\n unobserveTimeout = setTimeout(() => {\n if (!props.showDropDown) {\n listElementOpenAndVisible.value = false\n if (changeListener) changeListener.unobserve()\n }\n }, props.listAnimationDurationMs + 50)\n}\n\nwatch(\n () => props.showDropDown,\n (newV, oldV) => {\n if (newV !== oldV) {\n setOffsets()\n if (newV) openAndObserveChangeListener()\n else closeAndUnobserveChangeListener()\n }\n },\n { immediate: true }\n)\n\nfunction buttonRePositionCallback(e: any): void {\n setOffsets()\n nextTick(() => setOffsets())\n closeListOnScrollIfNecessary(e)\n}\n\nfunction closeListOnScrollIfNecessary(e: any) {\n if (!props.enableScrollClose || !props.showDropDown) return\n const notInitialized: boolean = typeof listContainerRef?.value?.contains !== 'function'\n if (notInitialized || e?.target?.nodeType == null || insideListOrOtherList(e)) return\n const isScrollEvent: boolean = ['scroll', 'wheel', 'touchmove'].includes(e?.type)\n if (props.showDropDown && isScrollEvent) props.parentMethods.closeList()\n}\n\nfunction insideListOrOtherList(e: any): boolean {\n const insideButton: boolean = !!dropDownButtonContainer.value?.contains(e?.target as Node)\n const insideList: boolean = !!listContainerRef.value?.contains(e.target as Node)\n const otherList: boolean = [e?.srcElement?.id, e?.target?.id].includes('super-list-select-list')\n return insideButton || insideList || otherList\n}\n\nfunction setOffsets(): void {\n setButtonOffset()\n setListOffset()\n}\n\nfunction setButtonOffset(): void {\n if (dropDownButtonContainer?.value == null) return\n const brc: DOMRect = (dropDownButtonContainer.value as HTMLElement).getBoundingClientRect()\n offsetTop.value = brc.top\n offsetBottom.value = window.innerHeight - brc.bottom\n parentWidthPx.value = brc.width + 'px'\n}\n\nfunction setListOffset(): void {\n /**\n * List container must be used when calculating position and not \"dropDownListUL\".\n * Position must be calculated as window viewport might not match list container viewport.\n **/\n if (dropDownButtonContainer?.value == null || listContainerRef?.value == null) return\n const brc: DOMRect = getButtonContainerElement().getBoundingClientRect()\n const slrc: DOMRect = (listContainerRef.value as HTMLElement).getBoundingClientRect()\n const currentListOffset: number = listOffset.value\n const currentOffsetLeft: number = offsetLeft.value\n if (reverseList.value) listOffset.value = currentListOffset - (brc.top - slrc.bottom)\n else listOffset.value = currentListOffset - (slrc.top - brc.bottom)\n offsetLeft.value = currentOffsetLeft - (slrc.left - brc.left)\n}\n\nfunction getButtonElement(): HTMLButtonElement {\n return (dropDownButtonContainer?.value as HTMLElement).getElementsByTagName('button')[0]\n}\n\nfunction getButtonContainerElement(): HTMLDivElement {\n return dropDownButtonContainer?.value as HTMLDivElement\n}\n\nonMounted(() => {\n changeListener = new DocumentViewChangeListener(buttonRePositionCallback, getButtonElement())\n setTimeout(() => buttonRePositionCallback(undefined), 250)\n})\n\nonUnmounted(() => {\n changeListener?.unobserve()\n})\n</script>\n\n<style scoped>\n.list-normal {\n top: var(--parent-y);\n}\n\n.list-reverse {\n bottom: var(--parent-y);\n}\n\n.select-list {\n --parent-width: v-bind(parentWidthPx);\n --parent-x: v-bind(parentXPx);\n --parent-y: v-bind(parentYPx);\n --duration: v-bind(animationDuration);\n --border-radius: var(--superlist-list-border-radius, 0);\n border-radius: var(--border-radius);\n width: var(--parent-width);\n min-width: var(--parent-width);\n left: var(--parent-x);\n display: block;\n transition-property: max-height, opacity, visibility, box-shadow;\n transition-duration: var(--duration, 300ms);\n transition-timing-function: cubic-bezier(0.1, 0.9, 0.35, 0.98);\n position: absolute;\n backdrop-filter: blur(3px);\n -webkit-backdrop-filter: blur(3px);\n background-color: rgb(255, 255, 255, 0.7);\n align-items: baseline;\n opacity: 0.25;\n z-index: 999;\n visibility: collapse;\n overflow: auto;\n max-height: 0;\n border: none !important; /* can't transition border */\n}\n\n.select-list:focus-visible,\n.select-list > ul:focus-visible,\n.super-list-button-container:focus-visible {\n outline: none;\n}\n\n.super-list-button-container {\n height: 100%;\n width: 100%;\n}\n\n.select-list.select-list-open {\n z-index: 999999;\n --max-height: v-bind(maxListHeightPx);\n max-height: var(--max-height, 0);\n}\n\n.select-list.no-scroll {\n overflow: hidden;\n}\n\n.select-list-fixed {\n position: fixed;\n opacity: 1;\n visibility: visible;\n}\n\n.list-content {\n --duration: v-bind(animationDuration);\n overflow: visible;\n margin: 0;\n padding: 0;\n border-style: none;\n color: var(--superlist-text-colour, rgb(55, 60, 65));\n list-style: none;\n max-width: 100%;\n}\n\n.select-list.select-list-scrollable {\n border-radius: var(--border-radius);\n}\n\n.select-list:not(.select-list-fixed) {\n transition: none;\n box-shadow: none !important;\n}\n\n@media (min-width: 640px) {\n .select-list.select-list-scrollable {\n border-radius: var(--border-radius) 0 0 var(--border-radius);\n }\n .list-content {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n}\n</style>\n","<template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n viewBox=\"0 0 12 6\"\n >\n <path\n shape-rendering=\"geometricPrecision\"\n d=\"M 6 4 L 10 0.25 A 0.5 0.5 90 0 1 11 1.25 L 6.5 5.75 A 15 3 90 0 1 5.5 5.75 L 1 1.25 A 0.5 0.5 90 0 1 2 0.25 Z\"\n />\n </svg>\n</template>\n","<template>\n <button\n ref=\"buttonRef\"\n :tabindex=\"enableTextFilter ? -1 : 0\"\n @keydown.enter=\"enterHandler($event)\"\n @keydown.space=\"spaceHandler($event)\"\n @keydown.esc=\"parentMethods.press($event)\"\n @keydown.up=\"parentMethods.press($event)\"\n @keydown.down=\"parentMethods.press($event)\"\n @focusout=\"parentMethods.unfocus($event)\"\n @click=\"clickHandler()\"\n type=\"button\"\n :class=\"[{ 'click-through': props.enableTextFilter || props.showDropDown }]\"\n class=\"list-button\"\n >\n <slot></slot>\n <span class=\"list-button-icon-div\" :class=\"{ 'bigger-gap': props.showDropDown }\">\n <span\n v-if=\"!customIcon\"\n class=\"list-button-icon\"\n :class=\"[{ 'rotate-180': !props.showDropDown }]\"\n >\n <default-arrow aria-hidden=\"true\" />\n </span>\n <span\n v-if=\"!customIcon\"\n class=\"list-button-icon\"\n :class=\"[{ 'rotate-180': props.showDropDown }]\"\n >\n <default-arrow v-if=\"customIcon == null\" aria-hidden=\"true\" />\n </span>\n <span v-if=\"customIcon\" class=\"list-button-icon custom-icon\">\n <component aria-hidden=\"true\" :is=\"customIcon as object\" />\n </span>\n </span>\n </button>\n</template>\n\n<script setup lang=\"ts\">\nimport { type PropType, ref } from 'vue'\nimport DefaultArrow from './default-arrow.vue'\n\n// prettier-ignore\nconst props = defineProps({ // eslint-disable-line\n parentMethods: {\n type: Object,\n required: true\n },\n showDropDown: {\n type: Boolean,\n required: true\n },\n enableTextFilter: {\n type: Boolean,\n required: true\n },\n customIcon: {\n default: null,\n type: [Object, Function] as PropType<object | Function | null>\n },\n reverseDropDownList: {\n type: Boolean,\n required: true\n }\n})\n\nconst buttonRef = ref(null)\n\nfunction clickHandler() {\n if (props.enableTextFilter) return\n else props.parentMethods.openList()\n}\n\nfunction enterHandler(event: KeyboardEvent) {\n if (props.enableTextFilter) {\n props.parentMethods.focusInput()\n event.stopPropagation()\n event.preventDefault()\n } else {\n props.parentMethods.press(event)\n }\n}\n\nfunction spaceHandler(event: KeyboardEvent) {\n if (!props.enableTextFilter) props.parentMethods.press(event)\n}\n\nfunction blurInput() {\n if (buttonRef?.value) {\n const button: HTMLButtonElement = buttonRef.value\n button.blur()\n }\n}\n\nfunction focusInput() {\n if (buttonRef?.value) (buttonRef.value as HTMLButtonElement).focus()\n}\n\ndefineExpose({ blurInput, focusInput, buttonRef })\n</script>\n\n<style scoped>\n.list-button-icon {\n display: flex;\n transition-timing-function: ease-in-out;\n transition-duration: 200ms;\n transition-property: transform;\n width: 0.6rem;\n transform: rotate(0deg);\n color: var(--superlist-text-colour, rgb(17, 24, 39));\n justify-content: center;\n max-height: 18%;\n}\n\n.list-button-icon.custom-icon {\n max-height: 100%;\n width: 1.25rem;\n}\n\n.list-button-icon.rotate-180 {\n transform: rotate(180deg);\n}\n\n.list-button {\n position: relative;\n padding: 0;\n margin: 0;\n width: 100%;\n max-height: 100%;\n height: 100%;\n background-color: var(--superlist-background-colour, white);\n align-items: center;\n pointer-events: auto;\n cursor: pointer;\n}\n\n.list-button:focus,\n.list-button:focus-visible,\n.list-button:active {\n text-align: left;\n}\n\n.list-button-icon-div {\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding-right: 0.75rem;\n max-height: 100%;\n height: 100%;\n gap: max(0.15rem, calc(6.25% + 0.075rem));\n transition: gap 200ms;\n}\n\n.list-button-icon-div.bigger-gap {\n gap: calc(40% - 0.25rem);\n}\n\n.click-through {\n pointer-events: none;\n}\n</style>\n","<template>\n <div style=\"position: relative\" :class=\"$attrs.class\">\n <item-list\n ref=\"itemListRef\"\n :show-drop-down=\"showDropDown\"\n :filteredListItems=\"filteredListItems\"\n :mouseHoveringOnList=\"mouseHoveringOnList\"\n :focusedIndex=\"activeFocusedIndex\"\n :selectedIndex=\"selectedIndex\"\n :max-list-height-p-x=\"maxListHeightPX\"\n :list-animation-duration-ms=\"listAnimationDurationMs\"\n :parent-methods=\"parentMethods\"\n v-model:blockListChange=\"blockListUpdates\"\n :total-options-count=\"totalOptionsCount\"\n @reverseDropDownList=\"reverseDropDownList = $event\"\n :enableScrollClose=\"enableScrollClose\"\n >\n <list-button\n ref=\"dropDownButtonInput\"\n :parent-methods=\"parentMethods\"\n :show-drop-down=\"showDropDown\"\n :enable-text-filter=\"enableTextFilter\"\n :custom-icon=\"customIcon\"\n :reverse-drop-down-list=\"reverseDropDownList\"\n >\n <text-input\n ref=\"dropDownTextInput\"\n :enable-text-filter=\"enableTextFilter\"\n :show-drop-down=\"showDropDown\"\n :placeholder=\"placeholder\"\n :enable-button-click=\"enableButtonClick\"\n :parent-methods=\"parentMethods\"\n @update:query=\"query = $event\"\n />\n </list-button>\n </item-list>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, type PropType, ref, watch } from 'vue'\nimport {\n getLabelString,\n AbortablePromise,\n type DataSet,\n type EnumType,\n type ListRequest\n} from './DropDownLibrary'\nimport TextInput from './ListInputComponents/ListTextInput.vue'\nimport ItemList from './ListInputComponents/ItemList.vue'\nimport ListButton from './ListInputComponents/ListButton.vue'\n\nconst emit = defineEmits({ 'update:selected': null })\nconst props = defineProps({\n selected: {\n type: [String, Number, Object, null, undefined] as PropType<\n string | number | object | null | undefined\n >\n },\n options: {\n type: [Function, Array<string | number | object>] as PropType<\n ListRequest | Array<string | number | object>\n >,\n required: true\n },\n maxListOptions: {\n type: Number as PropType<number>,\n default: 50\n },\n maxListHeightPX: {\n type: Number as PropType<number>,\n default: 200\n },\n tooltip: {\n type: String,\n required: false\n },\n objectLabelKeyName: {\n type: String as PropType<string | null>,\n default: ''\n },\n enumKeyToLabelObjectArray: {\n type: Object as PropType<EnumType[]>,\n default: undefined\n },\n listAnimationDurationMs: {\n type: Number as PropType<number>,\n default: 300\n },\n customIcon: {\n default: null,\n type: [Object, Function] as PropType<object | Function | null>\n },\n forceTextFilterVisibilityTo: {\n type: Boolean as PropType<boolean>,\n default: undefined\n },\n customPlaceHolderFunction: {\n type: Function as PropType<Function | null>,\n default: null\n },\n colour: {\n type: String as PropType<string>,\n default: 'black'\n },\n scrollTextInputToTopOnMobile: {\n type: Boolean as PropType<boolean>,\n default: true\n }\n})\n\nconst listOptions = ref([] as Array<string | number | object>)\n\nconst abortablePromise = new AbortablePromise()\n\nconst totalOptionsCount = ref(0)\n\nconst enableTextFilter = computed((): boolean => {\n if (props.forceTextFilterVisibilityTo != undefined) return props.forceTextFilterVisibilityTo\n return totalOptionsCount.value > props.maxListOptions\n})\n\nconst showDropDown = ref<boolean>(false)\n\nconst blockListUpdates = ref<boolean>(false)\n\nconst reverseDropDownList = ref<boolean>(false)\n\nconst enableButtonClick = ref(true)\n\nconst loadingData = ref(false)\nconst errorState = ref(false)\n\nconst itemListRef = ref(ItemList)\nconst dropDownTextInput = ref(TextInput)\nconst dropDownButtonInput = ref(ListButton)\n\nconst query = ref('')\n\nwatch(\n () => query.value,\n (newV, oldV) => {\n if (newV !== oldV && typeof props.options === 'function') loadData(newV)\n }\n)\n\nconst blurInputIfNecessary = () => {\n if (enableTextFilter.value) dropDownTextInput?.value?.blurInput()\n}\n\nconst closeList = () => {\n clearTimeout(blockScrollCloseTimeout)\n blurInputIfNecessary()\n query.value = ''\n showDropDown.value = false\n enableButtonClick.value = true\n}\n\nconst placeholder = computed((): string => {\n if (errorState?.value === true) return 'Error loading data'\n if (loadingData?.value === true) return 'Loading...'\n return getLabel(props.selected)\n})\n\nconst updatedSelected = (newValue: any) => {\n if (newValue) emit('update:selected', newValue)\n closeList()\n}\n\nconst getLabel = (value?: string | number | object | null): string => {\n return getLabelString(\n value,\n props.customPlaceHolderFunction,\n props.objectLabelKeyName,\n props.enumKeyToLabelObjectArray\n )\n}\n\nfunction invalidArgumentError() {\n loadingData.value = true\n errorState.value = true\n throw new Error(`Invalid options argument provided to ListInputComponent`)\n}\n\nfunction invalidResponseError() {\n loadingData.value = true\n errorState.value = true\n throw new Error(`Invalid response provided to ListInputComponent, no total count key found`)\n}\n\nfunction invalidListValueKeyError() {\n loadingData.value = true\n errorState.value = true\n throw new Error('Invalid objectLabelKeyName for provided Dropdown list value.')\n}\n\nonMounted(() => {\n if (typeof props.options !== 'function' && !Array.isArray(props.options)) invalidArgumentError()\n else initializeOptions()\n})\n\nconst mouseHoveringOnList = ref(false)\n\nconst selectedIndex = ref(0)\nconst focusedIndex = ref(0)\nconst activeFocusedIndex = ref(0)\n\nwatch(\n () => focusedIndex.value,\n (newV, oldV) => {\n if (newV != oldV && !blockListUpdates.value) {\n activeFocusedIndex.value = newV\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => blockListUpdates.value,\n (newV) => {\n if (!newV) {\n activeFocusedIndex.value = focusedIndex.value\n }\n },\n { immediate: true }\n)\n\nconst filteredListItems = computed(() => {\n // if is function, return listOptions variable which is set by function\n if (typeof props.options === 'function' && !Array.isArray(props.options)) return listOptions.value\n const qry = query.value\n const lo = listOptions.value\n // else, is array, return filtered array\n return qry === '' ? lo : lo.filter((v) => getLabel(v).toLowerCase().includes(qry.toLowerCase()))\n})\n\nwatch(\n () => filteredListItems.value,\n (newV, oldV) => {\n if (JSON.stringify(newV) !== JSON.stringify(oldV)) focusSelectedOrFirstListItem()\n },\n { immediate: false, deep: true }\n)\n\nconst mouseOverList = () => {\n mouseHoveringOnList.value = true\n}\n\nconst focusSelectedOrFirstListItem = () => {\n const existingIndex = getSelectedValueIndex()\n selectedIndex.value = existingIndex /* may not be in the filtered list, allowed to be -1 */\n focusedIndex.value = existingIndex > -1 ? existingIndex : 0 /* default to first value */\n}\n\nfunction getSelectedValueIndex() {\n if (props.selected == null) return -1\n const labelsArray = listOptions.value.map((v) => getLabel(v))\n const matchingLabelsArray = labelsArray.filter((v) => v === getLabel(props.selected))\n if (matchingLabelsArray.length > 1) {\n const matchingIndexes = matchingLabelsArray.map((v) => labelsArray.indexOf(v))\n for (let i = 0; i < matchingIndexes.length; i++) {\n const currentMatchingOptionString = JSON.stringify(listOptions.value[matchingIndexes[i]])\n const selectedOptionString = JSON.stringify(props.selected)\n if (currentMatchingOptionString === selectedOptionString) return matchingIndexes[i]\n }\n return -1\n }\n return labelsArray.indexOf(getLabel(props.selected))\n}\n\nconst openList = () => {\n if (loadingData.value) return\n if (!showDropDown.value) {\n blockListUpdates.value = false\n focusSelectedOrFirstListItem()\n scrollMobileTextInputToTop()\n showDropDown.value = true\n }\n mouseHoveringOnList.value = false\n enableButtonClick.value = false\n}\n\nconst scrollMobileTextInputToTop = () => {\n const mobileWindow: boolean = window?.innerWidth != null && window.innerWidth < 640\n const mobileScreen: boolean = screen?.width != null && screen.width < 640\n const textInput: HTMLElement | null = dropDownTextInput.value.textInputRef as HTMLElement | null\n if ((mobileWindow || mobileScreen) && enableTextFilter.value) {\n preventScrollClose()\n if (props.scrollTextInputToTopOnMobile)\n textInput?.scrollIntoView({ block: 'start', inline: 'center' })\n }\n}\n\nconst enableScrollClose = ref<boolean>(true)\nlet blockScrollCloseTimeout = setTimeout(() => {}, 0)\n\nfunction preventScrollClose() {\n const textInput: HTMLElement | null = dropDownTextInput.value.textInputRef as HTMLElement | null\n if (!textInput) return\n enableScrollClose.value = false\n let preventingScrollCloseInterval: NodeJS.Timeout | null = null\n\n const clearAll = () => {\n if (preventingScrollCloseInterval) clearInterval(preventingScrollCloseInterval)\n clearTimeout(blockScrollCloseTimeout)\n setTimeout(() => {\n enableScrollClose.value = true\n }, 100)\n }\n\n blockScrollCloseTimeout = setTimeout(clearAll, 5000)\n\n preventingScrollCloseInterval = setInterval(() => {\n if (\n showDropDown.value === false ||\n (textInput?.scrollTop === 0 && document.readyState === 'complete')\n )\n clearAll()\n }, 100)\n}\n\nconst focusInput = () => {\n if (enableTextFilter?.value == true) dropDownTextInput.value.focusInput()\n else if (dropDownButtonInput?.value?.focusInput) dropDownButtonInput?.value?.focusInput()\n}\n\nasync function initializeOptions(): Promise<void> {\n if (typeof props.options === 'function') {\n await loadData(query.value ? query.value : undefined, true)\n } else {\n validateListOptions(props.options as Array<string | number | object>)\n totalOptionsCount.value = listOptions.value.length\n }\n initializeSelected()\n}\n\ndefineExpose({ initializeOptions, getLabel })\n\nfunction initializeSelected() {\n const invalidSelection = getSelectedValueIndex() == -1\n const existingOptionNotSelected = invalidSelection && listOptions.value && !!listOptions.value[0]\n if (existingOptionNotSelected) updatedSelected(listOptions.value[0])\n}\n\nasync function loadData(stringFilter?: string, disableOnLoad: boolean = true) {\n loadingData.value = disableOnLoad\n const func = async () => (props.options as Function)(props.maxListOptions, stringFilter || '')\n const next = (response: DataSet<any>) => {\n if (!response || !('data' in response)) invalidArgumentError()\n validateListOptions(response.data)\n getOptionsCount(response?.data?.length ?? 0).then(() => {\n loadingData.value = false\n })\n }\n await abortablePromise.resetAndExecute(func, next)\n}\n\nasync function getOptionsCount(dataLength: number): Promise<void> {\n const func = async () => (props.options as Function)(1, '')\n const next = (response: DataSet<any>) => {\n if (!response || !('totalNum' in response)) invalidResponseError()\n totalOptionsCount.value = response.totalNum ?? dataLength\n }\n await abortablePromise.resetAndExecute(func, next)\n}\n\nconst getCurrentlyFocusedListItemElement = (): HTMLElement | null => {\n const listInput: HTMLElement | null = dropDownTextInput?.value?.textInputRef as HTMLElement | null\n return listInput?.getElementsByTagName('li')[focusedIndex.value] ?? null\n}\n\nconst press = (event?: any) => {\n if (showDropDown.value == false) {\n openList()\n } else if (event) {\n keypress(event)\n }\n}\n\nconst keypress = (event: any) => {\n const key: string = event.key || event.code\n if (key === 'Tab' || key === 'Escape') closeList()\n if (key === 'ArrowDown') down(event)\n if (key === 'ArrowUp') up(event)\n if (key === 'Enter' || key === ' ') updateSelectedFromTextQuery()\n event.preventDefault()\n event.stopPropagation()\n}\n\nconst updateSelectedFromTextQuery = () => {\n if (filteredListItems.value.length > 0) {\n blockListUpdates.value = true\n updatedSelected(filteredListItems.value[focusedIndex.value])\n } else {\n closeList()\n }\n}\n\nconst down = (event: any) => {\n enableButtonClick.value = true\n if (focusedIndex.value < filteredListItems.value.length - 1) {\n event.preventDefault()\n mouseHoveringOnList.value = false\n focusedIndex.value++\n getCurrentlyFocusedListItemElement()?.focus()\n }\n}\n\nconst up = (event: any) => {\n enableButtonClick.value = true\n if (focusedIndex.value > 0) {\n event.preventDefault()\n mouseHoveringOnList.value = false\n focusedIndex.value--\n getCurrentlyFocusedListItemElement()?.focus()\n }\n}\n\nconst unfocus = (event: any) => {\n if (showDropDown?.value === false) return\n if (query.value.length > 0) blockListUpdates.value = true\n const list: HTMLElement | null = itemListRef?.value?.listContainerRef as HTMLElement | null\n const listInput: HTMLElement | null = dropDownTextInput?.value?.textInputRef as HTMLElement | null\n const isListInput = event?.relatedTarget && listInput?.isEqualNode(event?.relatedTarget)\n const isList = event?.relatedTarget && list && list.contains(event?.relatedTarget)\n const isListItem = event?.relatedTarget && list && list.isEqualNode(event?.relatedTarget)\n if (isList || isListInput) return\n if (isListItem) {\n focusInput()\n return\n }\n closeList()\n}\n\nfunction validateListOptions(optns: Array<string | number | object>) {\n if (!Array.isArray(optns)) invalidArgumentError()\n if (optns.length > 0 && typeof optns[0] === 'object') validateObjectList(optns as Array<object>)\n listOptions.value = optns as Array<string | number | object>\n}\n\nfunction validateObjectList(values: Array<object>) {\n if (!props.objectLabelKeyName || props.objectLabelKeyName.length === 0) invalidListValueKeyError()\n const key: string = props.objectLabelKeyName as string\n for (let i = 0; i < values.length; i++) {\n if (typeof values[i] !== 'object' || !(key in values[i])) invalidListValueKeyError()\n }\n}\n\nconst parentMethods = {\n openList: openList,\n unfocus: unfocus,\n press: press,\n mouseOverList: mouseOverList,\n getLabel: getLabel,\n updatedSelected: updatedSelected,\n focusInput: focusInput,\n closeList: closeList\n}\n</script>\n\n<style scoped>\n* {\n box-sizing: border-box;\n}\n</style>\n"],"names":["DocumentViewChangeListener","targetFunction","targetNode","event","eventType","getLabelString","value","customLabelGetFunction","objectLabelKeyName","enumKeyToLabelObjectArray","getEnumLabel","enumKeyArray","eT","AbortablePromise","signal","asyncFunc","then","response","func","reason","emit","__emit","props","__props","textInputRef","ref","focusInHandler","e","focusOutHandler","updateQuery","textInputSize","computed","refLength","placeHolderLength","pointerEventsClass","textInputColourClass","blurInput","input","focusInput","__expose","_createElementBlock","$event","_cache","_withKeys","_normalizeClass","_openBlock","_hoisted_1","_createElementVNode","iRefs","useTemplateRef","focusedLi","focused","watch","scrollHighlightedListItemToTop","scrollHighlightedListItemIntoView","li","liParent","aboveTop","belowBottom","_Fragment","_renderList","listItem","index","_withModifiers","_hoisted_2","_toDisplayString","_createBlock","DefaultTick","_hoisted_3","dropDownButtonContainer","dropDownListUL","listContainerRef","offsetLeft","offsetTop","offsetBottom","listOffset","parentWidthPx","listElementOpenAndVisible","listItemsToDisplay","listHeightPx","reverseList","sufficientRoomAbove","insufficientRoomBelow","noScroll","reverse","parentXPx","parentYPx","preventSpaceScrollingList","refocusTextInput","list","target","getListULHeight","displayableListHeight","ulHt","maxListHeightPx","animationDuration","updatedListItemsToDisplay","newVal","unobserveTimeout","changeListener","openAndObserveChangeListener","buttonRePositionCallback","closeAndUnobserveChangeListener","newV","oldV","setOffsets","nextTick","closeListOnScrollIfNecessary","insideListOrOtherList","isScrollEvent","insideButton","insideList","otherList","setButtonOffset","setListOffset","brc","getButtonContainerElement","slrc","currentListOffset","currentOffsetLeft","getButtonElement","onMounted","onUnmounted","_renderSlot","_ctx","_createVNode","ListItem","buttonRef","clickHandler","enterHandler","spaceHandler","DefaultArrow","_resolveDynamicComponent","listOptions","abortablePromise","totalOptionsCount","enableTextFilter","showDropDown","blockListUpdates","reverseDropDownList","enableButtonClick","loadingData","errorState","itemListRef","ItemList","dropDownTextInput","TextInput","dropDownButtonInput","ListButton","query","blurInputIfNecessary","closeList","blockScrollCloseTimeout","placeholder","getLabel","updatedSelected","newValue","invalidArgumentError","invalidResponseError","invalidListValueKeyError","initializeOptions","mouseHoveringOnList","selectedIndex","focusedIndex","activeFocusedIndex","filteredListItems","qry","lo","v","focusSelectedOrFirstListItem","mouseOverList","existingIndex","getSelectedValueIndex","labelsArray","matchingLabelsArray","matchingIndexes","i","currentMatchingOptionString","selectedOptionString","openList","scrollMobileTextInputToTop","mobileWindow","mobileScreen","textInput","preventScrollClose","enableScrollClose","preventingScrollCloseInterval","clearAll","loadData","validateListOptions","initializeSelected","stringFilter","disableOnLoad","next","getOptionsCount","dataLength","getCurrentlyFocusedListItemElement","press","keypress","key","down","up","updateSelectedFromTextQuery","unfocus","listInput","isListInput","isList","isListItem","optns","validateObjectList","values","parentMethods","$attrs"],"mappings":";AAQO,MAAMA,GAAiE;AAAA,EAC3D,cAAwB,CAAC,UAAU,QAAQ,UAAU,SAAS,WAAW;AAAA,EACzE,SAA+B;AAAA,IAC9C,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,SAAS;AAAA,EACX;AA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;AAAA,QAC5B,mBAAmB4B,EAAiB;AAAA,QACpC,qBAAqBJ,EAAmB;AAAA,QACxC,cAAcG,EAAkB;AAAA,QAChC,eAAeF,EAAa;AAAA,QAC5B,uBAAqB3I,EAAe;AAAA,QACpC,8BAA4BA,EAAuB;AAAA,QACnD,kBAAgB4L;AAAA,QACT,iBAAiBzE,EAAgB;AAAA,2DAAhBA,EAAgB,QAAAjG;AAAA,QACxC,uBAAqB8F,EAAiB;AAAA,QACtC,uBAAmB7F,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAD,MAAEkG,EAAmB,QAAGlG;AAAA,QAC3C,mBAAmBgJ,EAAiB;AAAA,MAAA;oBAErC,MAiBc;AAAA,UAjBd5D,EAiBcuB,IAAA;AAAA,qBAhBR;AAAA,YAAJ,KAAID;AAAA,YACH,kBAAgBgE;AAAA,YAChB,kBAAgB1E,EAAY;AAAA,YAC5B,sBAAoBD,EAAgB;AAAA,YACpC,eAAajH,EAAU;AAAA,YACvB,0BAAwBoH,EAAmB;AAAA,UAAA;wBAE5C,MAQE;AAAA,cARFd,EAQEqB,IAAA;AAAA,yBAPI;AAAA,gBAAJ,KAAID;AAAA,gBACH,sBAAoBT,EAAgB;AAAA,gBACpC,kBAAgBC,EAAY;AAAA,gBAC5B,aAAagB,GAAW;AAAA,gBACxB,uBAAqBb,EAAiB;AAAA,gBACtC,kBAAgBuE;AAAA,gBAChB,kBAAYzK,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAD,MAAE4G,EAAK,QAAG5G;AAAA,cAAA;;;;;;;;;;"}
@@ -1,3 +1,3 @@
1
- (function(e,A){typeof exports=="object"&&typeof module<"u"?module.exports=A(require("vue")):typeof define=="function"&&define.amd?define(["vue"],A):(e=typeof globalThis<"u"?globalThis:e||self,e.SuperList=A(e.Vue))})(this,function(e){"use strict";var A=document.createElement("style");A.textContent=`.list-filter-text-input[data-v-acc7ac24]{color:var(--superlist-text-colour, rgb(17, 24, 39));text-align:center;padding:.125rem 2rem .125rem .5rem!important;width:100%;height:100%;margin:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:transparent;border:0 none;pointer-events:auto;cursor:text}.list-filter-text-input[data-v-acc7ac24]:focus,.list-filter-text-input[data-v-acc7ac24]:focus-visible,.list-filter-text-input[data-v-acc7ac24]:active{text-align:left}.click-through[data-v-acc7ac24]{pointer-events:none}.dark-placeholder-text[data-v-acc7ac24]::placeholder{color:var(--superlist-text-colour, rgb(17, 24, 39))}.light-placeholder-text[data-v-acc7ac24]::placeholder{color:var(--superlist-disabled-text-colour, rgb(120, 125, 130))}.text-filter-disabled[data-v-acc7ac24]{background-color:transparent;border:none;outline:none;box-shadow:none;filter:none}@media (min-width: 640px){.list-filter-text-input[data-v-acc7ac24]{font-size:.875rem;line-height:1.5rem}}.list-option[data-v-e4eeb2f7]{text-transform:capitalize;display:inline-flex;width:100%;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:transparent;color:var(--superlist-text-colour, rgb(55, 60, 65));transition-property:font-weight,background-color,color,text-shadow;transition-duration:.5s;transition-timing-function:ease;font-weight:400;text-shadow:1px 1px 3px var(--superlist-background-colour, white)}.list-option[data-v-e4eeb2f7]:focus-visible,.list-option>span[data-v-e4eeb2f7]:focus-visible{outline:none}.list-option-selected[data-v-e4eeb2f7]{font-weight:600}.list-option-message[data-v-e4eeb2f7]{text-shadow:1px 1px 3px var(--superlist-background-colour, white);text-transform:capitalize;display:inline-flex;width:100%;position:relative;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:transparent;color:var(--superlist-disabled-text-colour, rgb(120, 125, 130))}.list-option-active[data-v-e4eeb2f7]:hover,.list-option-active[data-v-e4eeb2f7],.list-option-selected[data-v-e4eeb2f7]:hover,.list-option[data-v-e4eeb2f7]:hover{font-weight:600;background-color:var(--superlist-theme-colour, rgb(77, 168, 11, .8));color:var(--superlist-background-colour, white);text-shadow:1px 1px 3px var(--superlist-theme-colour, rgb(77, 168, 11, .8));transition-duration:0s!important}.list-item-icon[data-v-e4eeb2f7]{display:flex;height:1rem;width:1rem;position:absolute;right:.7rem;margin-top:-.1rem;align-self:center}.list-item-span[data-v-e4eeb2f7]{padding:.5rem 1.75rem .5rem .75rem;width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-normal[data-v-53c634fd]{top:var(--parent-y)}.list-reverse[data-v-53c634fd]{bottom:var(--parent-y)}.select-list[data-v-53c634fd]{--parent-width: var(--220f507e);--parent-x: var(--935a72a0);--parent-y: var(--935a6b1e);--duration: var(--4076fb5c);--border-radius: var(--superlist-list-border-radius, 0);border-radius:var(--border-radius);width:var(--parent-width);min-width:var(--parent-width);left:var(--parent-x);display:block;transition-property:max-height,opacity,visibility,box-shadow;transition-duration:var(--duration, .3s);transition-timing-function:cubic-bezier(.1,.9,.35,.98);position:absolute;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);background-color:#ffffffb3;align-items:baseline;opacity:.25;z-index:999;visibility:collapse;overflow:auto;max-height:0;border:none!important}.select-list[data-v-53c634fd]:focus-visible,.select-list>ul[data-v-53c634fd]:focus-visible,.super-list-button-container[data-v-53c634fd]:focus-visible{outline:none}.super-list-button-container[data-v-53c634fd]{height:100%;width:100%}.select-list.select-list-open[data-v-53c634fd]{z-index:999999;--max-height: var(--51ba7f6b);max-height:var(--max-height, 0)}.select-list.no-scroll[data-v-53c634fd]{overflow:hidden}.select-list-fixed[data-v-53c634fd]{position:fixed;opacity:1;visibility:visible}.list-content[data-v-53c634fd]{--duration: var(--4076fb5c);overflow:visible;margin:0;padding:0;border-style:none;color:var(--superlist-text-colour, rgb(55, 60, 65));list-style:none;max-width:100%}.select-list.select-list-scrollable[data-v-53c634fd]{border-radius:var(--border-radius)}.select-list[data-v-53c634fd]:not(.select-list-fixed){transition:none;box-shadow:none!important}@media (min-width: 640px){.select-list.select-list-scrollable[data-v-53c634fd]{border-radius:var(--border-radius) 0 0 var(--border-radius)}.list-content[data-v-53c634fd]{font-size:.875rem;line-height:1.25rem}}.list-button-icon[data-v-01ef8e37]{display:flex;transition-timing-function:ease-in-out;transition-duration:.2s;transition-property:transform;width:.6rem;transform:rotate(0);color:var(--superlist-text-colour, rgb(17, 24, 39));justify-content:center;max-height:18%}.list-button-icon.custom-icon[data-v-01ef8e37]{max-height:100%;width:1.25rem}.list-button-icon.rotate-180[data-v-01ef8e37]{transform:rotate(180deg)}.list-button[data-v-01ef8e37]{position:relative;padding:0;margin:0;width:100%;max-height:100%;height:100%;background-color:var(--superlist-background-colour, white);align-items:center;pointer-events:auto;cursor:pointer}.list-button[data-v-01ef8e37]:focus,.list-button[data-v-01ef8e37]:focus-visible,.list-button[data-v-01ef8e37]:active{text-align:left}.list-button-icon-div[data-v-01ef8e37]{pointer-events:none;position:absolute;top:0;bottom:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding-right:.75rem;max-height:100%;height:100%;gap:max(.15rem,calc(6.25% + .075rem));transition:gap .2s}.list-button-icon-div.bigger-gap[data-v-01ef8e37]{gap:calc(40% - .25rem)}.click-through[data-v-01ef8e37]{pointer-events:none}[data-v-9cbaf19a]{box-sizing:border-box}
2
- /*$vite$:1*/`,document.head.appendChild(A);class le{eventsTypes=["resize","load","scroll","wheel","touchmove"];config={attributes:!0,childList:!0,subtree:!0};mutationObserver;callbackFunction;constructor(r,c=document.body){this.targetNode=c,this.callbackFunction=m=>r(m),this.mutationObserver=new MutationObserver(()=>r())}observe(){this.mutationObserver.observe(this.targetNode,this.config);for(const r of this.eventsTypes)this.addListener(r);this.addResizeListener(),this.addTransitionEndListener()}pauseMutationObserver(){this.mutationObserver.disconnect()}unpauseMutationObserver(){this.mutationObserver.observe(this.targetNode,this.config)}unobserve(){this.mutationObserver.disconnect();for(const r of this.eventsTypes)this.removeListener(r);this.removeResizeListener(),this.removeTransitionEndListener()}addListener(r){document.addEventListener(r,this.callbackFunction,!0)}removeListener(r){document.removeEventListener(r,this.callbackFunction,!0)}addTransitionEndListener(){this.targetNode.addEventListener("transitionend",this.callbackFunction)}removeTransitionEndListener(){this.targetNode.removeEventListener("transitionend",this.callbackFunction)}addResizeListener(){window.addEventListener("resize",this.callbackFunction)}removeResizeListener(){window.removeEventListener("resize",this.callbackFunction)}}function ae(t,r,c,m){return r!=null?r(t):t==null?"":typeof t=="object"?t[c]:m?ue(t,m):""+t}function ue(t,r){return r.find(c=>c.type===t)?.label??""}class ce{constructor(){this.abortController=new AbortController,this.func=()=>{},this.then=()=>{}}async abortablePromise(r,c,m){const i=await c();if(!r.aborted)return m(i)}setFunc(r){this.func=r}setThen(r){this.then=r}execute(){return this.abortablePromise(this.abortController.signal,this.func,this.then)}abort(r){this.abortController.abort(r||"Aborted By Controller."),this.abortController=new AbortController}resetAndExecute(r,c){return this.abort("New Request From Controller."),this.setFunc(r),this.setThen(c),this.execute()}}const de=["tabindex","placeholder","size"],fe=e.defineComponent({__name:"ListTextInput",props:{enableTextFilter:{type:Boolean,required:!0},placeholder:{type:String,default:void 0},enableButtonClick:{type:Boolean,default:!0},parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,required:!0}},emits:{"update:selected":null,"update:query":null,"update:press":null},setup(t,{expose:r,emit:c}){const m=c,i=t,d=e.ref(null);function v(h){"sourceCapabilities"in h&&h.sourceCapabilities==null?i.parentMethods.closeList():i.parentMethods.openList()}function n(h){i.parentMethods.unfocus(h)}function s(h){h?.target?.value!=null&&m("update:query",h.target.value)}const f=e.computed(()=>{const h=d?.value?d.value.length:0,w=i.placeholder?.length||0;return h>0?h:w>0?w:5}),a=e.computed(()=>i.enableButtonClick===!0&&i.enableTextFilter===!0?"":"click-through"),g=e.computed(()=>i.showDropDown&&!i.enableTextFilter||!i.showDropDown?"dark-placeholder-text":"light-placeholder-text");function T(){if(d?.value){const h=d.value;h.blur(),h.value=""}}function L(){d?.value&&d.value.focus()}return r({blurInput:T,focusInput:L,textInputRef:d}),(h,w)=>(e.openBlock(),e.createElementBlock("input",{ref_key:"textInputRef",ref:d,tabindex:t.enableTextFilter?0:-1,onKeydown:[w[0]||(w[0]=e.withKeys(b=>t.parentMethods.press(b),["enter"])),w[1]||(w[1]=e.withKeys(b=>t.parentMethods.press(),["space"])),w[2]||(w[2]=e.withKeys(b=>t.parentMethods.press(b),["esc"])),w[3]||(w[3]=e.withKeys(b=>t.parentMethods.press(b),["up"])),w[4]||(w[4]=e.withKeys(b=>t.parentMethods.press(b),["down"]))],onFocusin:w[5]||(w[5]=b=>v(b)),onFocusout:w[6]||(w[6]=b=>n(b)),onInput:w[7]||(w[7]=b=>s(b)),type:"text","aria-autocomplete":"none",autocomplete:"off",placeholder:t.placeholder,size:f.value,class:e.normalizeClass([[a.value,g.value,{"text-filter-disabled":!t.enableTextFilter}],"list-filter-text-input"])},null,42,de))}}),E=(t,r)=>{const c=t.__vccOpts||t;for(const[m,i]of r)c[m]=i;return c},te=E(fe,[["__scopeId","data-v-acc7ac24"]]),pe={},me={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true","data-slot":"icon",viewBox:"0 -16 16 17"};function be(t,r){return e.openBlock(),e.createElementBlock("svg",me,r[0]||(r[0]=[e.createElementVNode("path",{"shape-rendering":"geometricPrecision",d:"M 6 -2.25 L 13.75 -14 A 0.5 0.5 90 0 1 15 -13 L 6.5 -0.5 A 2 1 90 0 1 5.5 -0.5 L 1 -6 A 0.5 0.5 90 0 1 2.25 -7 Z"},null,-1)]))}const he=E(pe,[["render",be]]),we=["onMousedown"],ge={class:"list-item-span"},ve={class:"list-item-span"},ye=E(e.defineComponent({__name:"ListItem",props:{mouseHoveringOnList:{type:Boolean,default:!1},filteredListItems:{type:Array,default:()=>[]},focusedIndex:{type:Number,default:null},selectedIndex:{type:Number,default:null},listElementOpenAndVisible:{type:Boolean,default:!1},parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,default:!1},totalOptionsCount:{type:Number,default:0}},setup(t){const r=t,c=e.useTemplateRef("items"),m=e.computed(()=>{if(!c?.value)return null;const n=(Array.isArray(c.value)?c.value:[c.value])[r.focusedIndex];return n&&typeof n=="object"&&"scrollIntoView"in n&&typeof n.scrollIntoView=="function"?n:null});e.watch(()=>r.showDropDown,()=>i()),e.watch(()=>r.listElementOpenAndVisible,()=>d()),e.watch(()=>m.value,()=>d());function i(){!r.showDropDown||!m?.value?.parentElement?.parentElement||(m.value.parentElement.parentElement.scrollTop=m.value.offsetTop)}function d(){const v=m.value,n=v?.parentElement?.parentElement;if(!r.showDropDown||!v||!n)return;const s=v.offsetTop-n.scrollTop<0,f=v.offsetTop+v.offsetHeight-n.scrollTop>n.clientHeight;s&&(n.scrollTop=v.offsetTop),f&&(n.scrollTop=v.offsetTop+v.clientHeight-n.clientHeight)}return(v,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filteredListItems,(s,f)=>(e.openBlock(),e.createElementBlock("li",{key:f,ref_for:!0,ref:"items",onKeyup:[n[0]||(n[0]=e.withKeys(a=>t.parentMethods.press(a),["enter"])),n[1]||(n[1]=e.withKeys(a=>t.parentMethods.press(a),["space"])),n[2]||(n[2]=e.withKeys(a=>t.parentMethods.press(a),["esc"]))],onKeydown:[n[3]||(n[3]=e.withKeys(a=>t.parentMethods.press(a),["up"])),n[4]||(n[4]=e.withKeys(a=>t.parentMethods.press(a),["down"]))],onFocusout:n[5]||(n[5]=a=>t.parentMethods.unfocus(a)),tabindex:"-1",onMousedown:e.withModifiers(a=>t.parentMethods.updatedSelected(s),["left"]),class:e.normalizeClass([{"list-option-selected":t.selectedIndex===f},{"list-option-active":t.filteredListItems.length===1||t.focusedIndex===f&&!t.mouseHoveringOnList},"list-option"])},[e.createElementVNode("span",ge,e.toDisplayString(t.parentMethods.getLabel(s)),1),t.selectedIndex===f?(e.openBlock(),e.createBlock(he,{key:0,class:"list-item-icon","aria-hidden":"true"})):e.createCommentVNode("",!0)],42,we))),128)),t.filteredListItems.length===0?(e.openBlock(),e.createElementBlock("li",{key:0,onKeyup:[n[6]||(n[6]=e.withKeys(s=>t.parentMethods.press(s),["enter"])),n[7]||(n[7]=e.withKeys(s=>t.parentMethods.press(s),["space"])),n[8]||(n[8]=e.withKeys(s=>t.parentMethods.press(s),["esc"]))],onKeydown:[n[9]||(n[9]=e.withKeys(s=>t.parentMethods.press(s),["up"])),n[10]||(n[10]=e.withKeys(s=>t.parentMethods.press(s),["down"]))],onFocusout:n[11]||(n[11]=s=>t.parentMethods.unfocus(s)),onMousedown:n[12]||(n[12]=e.withModifiers(s=>t.parentMethods.closeList(s),["left"])),tabindex:"-1",class:"list-option-message"},n[20]||(n[20]=[e.createElementVNode("span",{class:"list-item-span"},"No Items To Display.",-1)]),32)):e.createCommentVNode("",!0),t.totalOptionsCount&&t.totalOptionsCount>(t.filteredListItems?.length||0)?(e.openBlock(),e.createElementBlock("li",{key:1,onKeyup:[n[13]||(n[13]=e.withKeys(s=>t.parentMethods.press(s),["enter"])),n[14]||(n[14]=e.withKeys(s=>t.parentMethods.press(s),["space"])),n[15]||(n[15]=e.withKeys(s=>t.parentMethods.press(s),["esc"]))],onKeydown:[n[16]||(n[16]=e.withKeys(s=>t.parentMethods.press(s),["up"])),n[17]||(n[17]=e.withKeys(s=>t.parentMethods.press(s),["down"]))],onFocusout:n[18]||(n[18]=s=>t.parentMethods.unfocus(s)),onMousedown:n[19]||(n[19]=e.withModifiers(s=>t.parentMethods.closeList(s),["left"])),tabindex:"-1",class:"list-option-message"},[e.createElementVNode("span",ve," +"+e.toDisplayString(t.totalOptionsCount-t.filteredListItems?.length||0)+" More Items...",1)],32)):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-e4eeb2f7"]]),ne=E(e.defineComponent({__name:"ItemList",props:{mouseHoveringOnList:{type:Boolean,default:!1},filteredListItems:{type:Array,default:()=>[]},focusedIndex:{type:Number,default:null},selectedIndex:{type:Number,default:null},parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,required:!0},maxListHeightPX:{type:Number,required:!0},listAnimationDurationMs:{type:Number,required:!0},blockListChange:{type:Boolean,required:!0},totalOptionsCount:{type:Number,default:0},enableScrollClose:{type:Boolean,default:!0},enableTextFilter:{type:Boolean,required:!0}},emits:["reverseDropDownList"],setup(t,{expose:r,emit:c}){e.useCssVars(u=>({"220f507e":T.value,"935a72a0":O.value,"935a6b1e":W.value,"4076fb5c":S.value,"51ba7f6b":j.value}));const m=c,i=t,d=e.ref(null),v=e.ref(null),n=e.ref(null),s=e.ref(0),f=e.ref(0),a=e.ref(0),g=e.ref(0),T=e.ref("0px"),L=e.ref(!1),h=e.ref([]),w=e.ref(0),b=e.computed(()=>!L.value||window?.innerHeight==null?!1:V()&&Z()),K=e.computed(()=>i.maxListHeightPX>=w.value);e.watch(()=>b.value,u=>m("reverseDropDownList",u),{immediate:!0});const O=e.computed(()=>s.value+"px"),W=e.computed(()=>g.value+"px");r({listContainerRef:n});const N=u=>{u?.key&&u.key===" "&&u.preventDefault()},Q=u=>{const y=n?.value,x=u.target;(!(y&&x&&y.contains(x))||y.isEqualNode(x))&&i.parentMethods.focusInput()};function B(){return v?.value?(v?.value).clientHeight:0}function C(){if(!L.value||B()===0)return i.maxListHeightPX;const u=B()===0?i.maxListHeightPX:+B();return i.maxListHeightPX&&i.maxListHeightPX>u?u:i.maxListHeightPX}function V(){return f.value>C()}function Z(){return a.value<C()}const j=e.computed(()=>(i.maxListHeightPX||0)+"px"),S=e.computed(()=>(i.listAnimationDurationMs||0)+"ms"),$=e.computed(()=>i.blockListChange?h.value:i.filteredListItems);e.watch(()=>$,u=>{u&&(h.value=u.value)},{immediate:!1,deep:!0});let k=setTimeout(()=>{},0),D=null;function F(){w.value=B(),clearTimeout(k),D&&D.observe(),L.value=!0,H(void 0)}function Y(){clearTimeout(k),k=setTimeout(()=>{i.showDropDown||(L.value=!1,D&&D.unobserve())},i.listAnimationDurationMs+50)}e.watch(()=>i.showDropDown,(u,y)=>{u!==y&&(z(),u?F():Y())},{immediate:!0});function H(u){z(),e.nextTick(()=>z()),X(u)}function X(u){if(!i.enableScrollClose||!i.showDropDown||typeof n?.value?.contains!="function"||u?.target?.nodeType==null||U(u))return;const x=["scroll","wheel","touchmove"].includes(u?.type);i.showDropDown&&x&&i.parentMethods.closeList()}function U(u){const y=!!d.value?.contains(u?.target),x=!!n.value?.contains(u.target),q=[u?.srcElement?.id,u?.target?.id].includes("super-list-select-list");return y||x||q}function z(){R(),P()}function R(){if(d?.value==null)return;const u=d.value.getBoundingClientRect();f.value=u.top,a.value=window.innerHeight-u.bottom,T.value=u.width+"px"}function P(){if(d?.value==null||n?.value==null)return;const u=J().getBoundingClientRect(),y=n.value.getBoundingClientRect(),x=g.value,q=s.value;b.value?g.value=x-(u.top-y.bottom):g.value=x-(y.top-u.bottom),s.value=q-(y.left-u.left)}function G(){return(d?.value).getElementsByTagName("button")[0]}function J(){return d?.value}return e.onMounted(()=>{D=new le(H,G()),setTimeout(()=>H(void 0),250)}),e.onUnmounted(()=>{D?.unobserve()}),(u,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"dropDownButtonContainer",ref:d,class:"super-list-button-container"},[e.renderSlot(u.$slots,"default",{},void 0,!0)],512),e.createElementVNode("div",{id:"super-list-select-list",ref_key:"listContainerRef",ref:n,onMouseenter:y[0]||(y[0]=x=>t.parentMethods.mouseOverList()),tabindex:"-1",class:e.normalizeClass(["select-list",b.value?"list-reverse":"list-normal",{"select-list-open":t.showDropDown},{"no-scroll":K.value&&L.value},{"select-list-fixed":L.value},{"select-list-scrollable":!K.value}]),onKeydown:y[1]||(y[1]=e.withKeys(x=>N(x),["space"])),onMouseup:y[2]||(y[2]=e.withModifiers(x=>Q(x),["left"]))},[e.createElementVNode("ul",{tabindex:"-1",ref_key:"dropDownListUL",ref:v,class:"list-content"},[e.createVNode(ye,{filteredListItems:h.value,mouseHoveringOnList:t.mouseHoveringOnList,focusedIndex:t.focusedIndex,selectedIndex:t.selectedIndex,listElementOpenAndVisible:L.value,"parent-methods":t.parentMethods,"show-drop-down":t.showDropDown,"total-options-count":t.totalOptionsCount},null,8,["filteredListItems","mouseHoveringOnList","focusedIndex","selectedIndex","listElementOpenAndVisible","parent-methods","show-drop-down","total-options-count"])],512)],34)],64))}}),[["__scopeId","data-v-53c634fd"]]),xe={},Le={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true","data-slot":"icon",viewBox:"0 0 12 6"};function Ie(t,r){return e.openBlock(),e.createElementBlock("svg",Le,r[0]||(r[0]=[e.createElementVNode("path",{"shape-rendering":"geometricPrecision",d:"M 6 4 L 10 0.25 A 0.5 0.5 90 0 1 11 1.25 L 6.5 5.75 A 15 3 90 0 1 5.5 5.75 L 1 1.25 A 0.5 0.5 90 0 1 2 0.25 Z"},null,-1)]))}const oe=E(xe,[["render",Ie]]),ke=["tabindex"],Te={key:2,class:"list-button-icon custom-icon"},ie=E(e.defineComponent({__name:"ListButton",props:{parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,required:!0},enableTextFilter:{type:Boolean,required:!0},customIcon:{default:null,type:[Object,Function]},reverseDropDownList:{type:Boolean,required:!0}},setup(t,{expose:r}){const c=t,m=e.ref(null);function i(){c.enableTextFilter||c.parentMethods.openList()}function d(f){c.enableTextFilter?(c.parentMethods.focusInput(),f.stopPropagation(),f.preventDefault()):c.parentMethods.press(f)}function v(f){c.enableTextFilter||c.parentMethods.press(f)}function n(){m?.value&&m.value.blur()}function s(){m?.value&&m.value.focus()}return r({blurInput:n,focusInput:s,buttonRef:m}),(f,a)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonRef",ref:m,tabindex:t.enableTextFilter?-1:0,onKeydown:[a[0]||(a[0]=e.withKeys(g=>d(g),["enter"])),a[1]||(a[1]=e.withKeys(g=>v(g),["space"])),a[2]||(a[2]=e.withKeys(g=>t.parentMethods.press(g),["esc"])),a[3]||(a[3]=e.withKeys(g=>t.parentMethods.press(g),["up"])),a[4]||(a[4]=e.withKeys(g=>t.parentMethods.press(g),["down"]))],onFocusout:a[5]||(a[5]=g=>t.parentMethods.unfocus(g)),onClick:a[6]||(a[6]=g=>i()),type:"button",class:e.normalizeClass([[{"click-through":c.enableTextFilter||c.showDropDown}],"list-button"])},[e.renderSlot(f.$slots,"default",{},void 0,!0),e.createElementVNode("span",{class:e.normalizeClass(["list-button-icon-div",{"bigger-gap":c.showDropDown}])},[t.customIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["list-button-icon",[{"rotate-180":!c.showDropDown}]])},[e.createVNode(oe,{"aria-hidden":"true"})],2)),t.customIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["list-button-icon",[{"rotate-180":c.showDropDown}]])},[t.customIcon==null?(e.openBlock(),e.createBlock(oe,{key:0,"aria-hidden":"true"})):e.createCommentVNode("",!0)],2)),t.customIcon?(e.openBlock(),e.createElementBlock("span",Te,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.customIcon),{"aria-hidden":"true"}))])):e.createCommentVNode("",!0)],2)],42,ke))}}),[["__scopeId","data-v-01ef8e37"]]);return E(e.defineComponent({__name:"super-list",props:{selected:{type:[String,Number,Object,null,void 0]},options:{type:[Function,Array],required:!0},maxListOptions:{type:Number,default:50},maxListHeightPX:{type:Number,default:200},tooltip:{type:String,required:!1},objectLabelKeyName:{type:String,default:""},enumKeyToLabelObjectArray:{type:Object,default:void 0},listAnimationDurationMs:{type:Number,default:300},customIcon:{default:null,type:[Object,Function]},forceTextFilterVisibilityTo:{type:Boolean,default:void 0},customPlaceHolderFunction:{type:Function,default:null},colour:{type:String,default:"black"},scrollTextInputToTopOnMobile:{type:Boolean,default:!0}},emits:{"update:selected":null},setup(t,{expose:r,emit:c}){const m=c,i=t,d=e.ref([]),v=new ce,n=e.ref(0),s=e.computed(()=>i.forceTextFilterVisibilityTo!=null?i.forceTextFilterVisibilityTo:n.value>i.maxListOptions),f=e.ref(!1),a=e.ref(!1),g=e.ref(!1),T=e.ref(!0),L=e.ref(!1),h=e.ref(!1),w=e.ref(ne),b=e.ref(te),K=e.ref(ie),O=e.ref("");e.watch(()=>O.value,(o,l)=>{o!==l&&typeof i.options=="function"&&x(o)});const W=()=>{s.value&&b?.value?.blurInput()},N=()=>{clearTimeout(P),W(),O.value="",f.value=!1,T.value=!0},Q=e.computed(()=>h?.value===!0?"Error loading data":L?.value===!0?"Loading...":C(i.selected)),B=o=>{o&&m("update:selected",o),N()},C=o=>ae(o,i.customPlaceHolderFunction,i.objectLabelKeyName,i.enumKeyToLabelObjectArray);function V(){throw L.value=!0,h.value=!0,new Error("Invalid options argument provided to ListInputComponent")}function Z(){throw L.value=!0,h.value=!0,new Error("Invalid response provided to ListInputComponent, no total count key found")}function j(){throw L.value=!0,h.value=!0,new Error("Invalid objectLabelKeyName for provided Dropdown list value.")}e.onMounted(()=>{typeof i.options!="function"&&!Array.isArray(i.options)?V():u()});const S=e.ref(!1),$=e.ref(0),k=e.ref(0),D=e.ref(0);e.watch(()=>k.value,(o,l)=>{o!=l&&!a.value&&(D.value=o)},{immediate:!0}),e.watch(()=>a.value,o=>{o||(D.value=k.value)},{immediate:!0});const F=e.computed(()=>{if(typeof i.options=="function"&&!Array.isArray(i.options))return d.value;const o=O.value,l=d.value;return o===""?l:l.filter(p=>C(p).toLowerCase().includes(o.toLowerCase()))});e.watch(()=>F.value,(o,l)=>{JSON.stringify(o)!==JSON.stringify(l)&&H()},{immediate:!1,deep:!0});const Y=()=>{S.value=!0},H=()=>{const o=X();$.value=o,k.value=o>-1?o:0};function X(){if(i.selected==null)return-1;const o=d.value.map(p=>C(p)),l=o.filter(p=>p===C(i.selected));if(l.length>1){const p=l.map(I=>o.indexOf(I));for(let I=0;I<p.length;I++){const M=JSON.stringify(d.value[p[I]]),ee=JSON.stringify(i.selected);if(M===ee)return p[I]}return-1}return o.indexOf(C(i.selected))}const U=()=>{L.value||(f.value||(a.value=!1,H(),z(),f.value=!0),S.value=!1,T.value=!1)},z=()=>{const o=window?.innerWidth!=null&&window.innerWidth<640,l=screen?.width!=null&&screen.width<640,p=b.value.textInputRef;(o||l)&&s.value&&(G(),i.scrollTextInputToTopOnMobile&&p?.scrollIntoView({block:"start",inline:"center"}))},R=e.ref(!0);let P=setTimeout(()=>{},0);function G(){const o=b.value.textInputRef;if(!o)return;R.value=!1;let l=null;const p=()=>{l&&clearInterval(l),clearTimeout(P),setTimeout(()=>{R.value=!0},100)};P=setTimeout(p,5e3),l=setInterval(()=>{(f.value===!1||o?.scrollTop===0&&document.readyState==="complete")&&p()},100)}const J=()=>{s?.value==!0?b.value.focusInput():K?.value?.focusInput&&K?.value?.focusInput()};async function u(){typeof i.options=="function"?await x(O.value?O.value:void 0,!0):(re(i.options),n.value=d.value.length),y()}r({initializeOptions:u,getLabel:C});function y(){X()==-1&&d.value&&!!d.value[0]&&B(d.value[0])}async function x(o,l=!0){L.value=l;const p=async()=>i.options(i.maxListOptions,o||""),I=M=>{(!M||!("data"in M))&&V(),re(M.data),q(M?.data?.length??0).then(()=>{L.value=!1})};await v.resetAndExecute(p,I)}async function q(o){const l=async()=>i.options(1,""),p=I=>{(!I||!("totalNum"in I))&&Z(),n.value=I.totalNum??o};await v.resetAndExecute(l,p)}const se=()=>b?.value?.textInputRef?.getElementsByTagName("li")[k.value]??null,Ce=o=>{f.value==!1?U():o&&De(o)},De=o=>{const l=o.key||o.code;(l==="Tab"||l==="Escape")&&N(),l==="ArrowDown"&&Be(o),l==="ArrowUp"&&Me(o),(l==="Enter"||l===" ")&&Oe(),o.preventDefault(),o.stopPropagation()},Oe=()=>{F.value.length>0?(a.value=!0,B(F.value[k.value])):N()},Be=o=>{T.value=!0,k.value<F.value.length-1&&(o.preventDefault(),S.value=!1,k.value++,se()?.focus())},Me=o=>{T.value=!0,k.value>0&&(o.preventDefault(),S.value=!1,k.value--,se()?.focus())},Ee=o=>{if(f?.value===!1)return;O.value.length>0&&(a.value=!0);const l=w?.value?.listContainerRef,p=b?.value?.textInputRef,I=o?.relatedTarget&&p?.isEqualNode(o?.relatedTarget),M=o?.relatedTarget&&l&&l.contains(o?.relatedTarget),ee=o?.relatedTarget&&l&&l.isEqualNode(o?.relatedTarget);if(!(M||I)){if(ee){J();return}N()}};function re(o){Array.isArray(o)||V(),o.length>0&&typeof o[0]=="object"&&Ne(o),d.value=o}function Ne(o){(!i.objectLabelKeyName||i.objectLabelKeyName.length===0)&&j();const l=i.objectLabelKeyName;for(let p=0;p<o.length;p++)(typeof o[p]!="object"||!(l in o[p]))&&j()}const _={openList:U,unfocus:Ee,press:Ce,mouseOverList:Y,getLabel:C,updatedSelected:B,focusInput:J,closeList:N};return(o,l)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative"},class:e.normalizeClass(o.$attrs.class)},[e.createVNode(ne,{ref_key:"itemListRef",ref:w,"show-drop-down":f.value,filteredListItems:F.value,mouseHoveringOnList:S.value,focusedIndex:D.value,selectedIndex:$.value,"max-list-height-p-x":t.maxListHeightPX,"list-animation-duration-ms":t.listAnimationDurationMs,"parent-methods":_,blockListChange:a.value,"onUpdate:blockListChange":l[1]||(l[1]=p=>a.value=p),"total-options-count":n.value,onReverseDropDownList:l[2]||(l[2]=p=>g.value=p),enableScrollClose:R.value,"enable-text-filter":s.value},{default:e.withCtx(()=>[e.createVNode(ie,{ref_key:"dropDownButtonInput",ref:K,"parent-methods":_,"show-drop-down":f.value,"enable-text-filter":s.value,"custom-icon":t.customIcon,"reverse-drop-down-list":g.value},{default:e.withCtx(()=>[e.createVNode(te,{ref_key:"dropDownTextInput",ref:b,"enable-text-filter":s.value,"show-drop-down":f.value,placeholder:Q.value,"enable-button-click":T.value,"parent-methods":_,"onUpdate:query":l[0]||(l[0]=p=>O.value=p)},null,8,["enable-text-filter","show-drop-down","placeholder","enable-button-click"])]),_:1},8,["show-drop-down","enable-text-filter","custom-icon","reverse-drop-down-list"])]),_:1},8,["show-drop-down","filteredListItems","mouseHoveringOnList","focusedIndex","selectedIndex","max-list-height-p-x","list-animation-duration-ms","blockListChange","total-options-count","enableScrollClose","enable-text-filter"])],2))}}),[["__scopeId","data-v-9cbaf19a"]])});
1
+ (function(e,F){typeof exports=="object"&&typeof module<"u"?module.exports=F(require("vue")):typeof define=="function"&&define.amd?define(["vue"],F):(e=typeof globalThis<"u"?globalThis:e||self,e.SuperList=F(e.Vue))})(this,function(e){"use strict";var F=document.createElement("style");F.textContent=`.list-filter-text-input[data-v-acc7ac24]{color:var(--superlist-text-colour, rgb(17, 24, 39));text-align:center;padding:.125rem 2rem .125rem .5rem!important;width:100%;height:100%;margin:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:transparent;border:0 none;pointer-events:auto;cursor:text}.list-filter-text-input[data-v-acc7ac24]:focus,.list-filter-text-input[data-v-acc7ac24]:focus-visible,.list-filter-text-input[data-v-acc7ac24]:active{text-align:left}.click-through[data-v-acc7ac24]{pointer-events:none}.dark-placeholder-text[data-v-acc7ac24]::placeholder{color:var(--superlist-text-colour, rgb(17, 24, 39))}.light-placeholder-text[data-v-acc7ac24]::placeholder{color:var(--superlist-disabled-text-colour, rgb(120, 125, 130))}.text-filter-disabled[data-v-acc7ac24]{background-color:transparent;border:none;outline:none;box-shadow:none;filter:none}@media (min-width: 640px){.list-filter-text-input[data-v-acc7ac24]{font-size:.875rem;line-height:1.5rem}}.list-option[data-v-e4eeb2f7]{text-transform:capitalize;display:inline-flex;width:100%;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:transparent;color:var(--superlist-text-colour, rgb(55, 60, 65));transition-property:font-weight,background-color,color,text-shadow;transition-duration:.5s;transition-timing-function:ease;font-weight:400;text-shadow:1px 1px 3px var(--superlist-background-colour, white)}.list-option[data-v-e4eeb2f7]:focus-visible,.list-option>span[data-v-e4eeb2f7]:focus-visible{outline:none}.list-option-selected[data-v-e4eeb2f7]{font-weight:600}.list-option-message[data-v-e4eeb2f7]{text-shadow:1px 1px 3px var(--superlist-background-colour, white);text-transform:capitalize;display:inline-flex;width:100%;position:relative;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:transparent;color:var(--superlist-disabled-text-colour, rgb(120, 125, 130))}.list-option-active[data-v-e4eeb2f7]:hover,.list-option-active[data-v-e4eeb2f7],.list-option-selected[data-v-e4eeb2f7]:hover,.list-option[data-v-e4eeb2f7]:hover{font-weight:600;background-color:var(--superlist-theme-colour, rgb(77, 168, 11, .8));color:var(--superlist-background-colour, white);text-shadow:1px 1px 3px var(--superlist-theme-colour, rgb(77, 168, 11, .8));transition-duration:0s!important}.list-item-icon[data-v-e4eeb2f7]{display:flex;height:1rem;width:1rem;position:absolute;right:.7rem;margin-top:-.1rem;align-self:center}.list-item-span[data-v-e4eeb2f7]{padding:.5rem 1.75rem .5rem .75rem;width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-normal[data-v-e58cd48c]{top:var(--parent-y)}.list-reverse[data-v-e58cd48c]{bottom:var(--parent-y)}.select-list[data-v-e58cd48c]{--parent-width: var(--8d801350);--parent-x: var(--2724698a);--parent-y: var(--27246d4b);--duration: var(--ffcaa9a8);--border-radius: var(--superlist-list-border-radius, 0);border-radius:var(--border-radius);width:var(--parent-width);min-width:var(--parent-width);left:var(--parent-x);display:block;transition-property:max-height,opacity,visibility,box-shadow;transition-duration:var(--duration, .3s);transition-timing-function:cubic-bezier(.1,.9,.35,.98);position:absolute;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);background-color:#ffffffb3;align-items:baseline;opacity:.25;z-index:999;visibility:collapse;overflow:auto;max-height:0;border:none!important}.select-list[data-v-e58cd48c]:focus-visible,.select-list>ul[data-v-e58cd48c]:focus-visible,.super-list-button-container[data-v-e58cd48c]:focus-visible{outline:none}.super-list-button-container[data-v-e58cd48c]{height:100%;width:100%}.select-list.select-list-open[data-v-e58cd48c]{z-index:999999;--max-height: var(--414dd276);max-height:var(--max-height, 0)}.select-list.no-scroll[data-v-e58cd48c]{overflow:hidden}.select-list-fixed[data-v-e58cd48c]{position:fixed;opacity:1;visibility:visible}.list-content[data-v-e58cd48c]{--duration: var(--ffcaa9a8);overflow:visible;margin:0;padding:0;border-style:none;color:var(--superlist-text-colour, rgb(55, 60, 65));list-style:none;max-width:100%}.select-list.select-list-scrollable[data-v-e58cd48c]{border-radius:var(--border-radius)}.select-list[data-v-e58cd48c]:not(.select-list-fixed){transition:none;box-shadow:none!important}@media (min-width: 640px){.select-list.select-list-scrollable[data-v-e58cd48c]{border-radius:var(--border-radius) 0 0 var(--border-radius)}.list-content[data-v-e58cd48c]{font-size:.875rem;line-height:1.25rem}}.list-button-icon[data-v-01ef8e37]{display:flex;transition-timing-function:ease-in-out;transition-duration:.2s;transition-property:transform;width:.6rem;transform:rotate(0);color:var(--superlist-text-colour, rgb(17, 24, 39));justify-content:center;max-height:18%}.list-button-icon.custom-icon[data-v-01ef8e37]{max-height:100%;width:1.25rem}.list-button-icon.rotate-180[data-v-01ef8e37]{transform:rotate(180deg)}.list-button[data-v-01ef8e37]{position:relative;padding:0;margin:0;width:100%;max-height:100%;height:100%;background-color:var(--superlist-background-colour, white);align-items:center;pointer-events:auto;cursor:pointer}.list-button[data-v-01ef8e37]:focus,.list-button[data-v-01ef8e37]:focus-visible,.list-button[data-v-01ef8e37]:active{text-align:left}.list-button-icon-div[data-v-01ef8e37]{pointer-events:none;position:absolute;top:0;bottom:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding-right:.75rem;max-height:100%;height:100%;gap:max(.15rem,calc(6.25% + .075rem));transition:gap .2s}.list-button-icon-div.bigger-gap[data-v-01ef8e37]{gap:calc(40% - .25rem)}.click-through[data-v-01ef8e37]{pointer-events:none}[data-v-6c6e7e6a]{box-sizing:border-box}
2
+ /*$vite$:1*/`,document.head.appendChild(F);class le{eventsTypes=["resize","load","scroll","wheel","touchmove"];config={attributes:!0,childList:!0,subtree:!0};mutationObserver;callbackFunction;constructor(s,c=document.body){this.targetNode=c,this.callbackFunction=m=>s(m),this.mutationObserver=new MutationObserver(()=>s())}observe(){this.mutationObserver.observe(this.targetNode,this.config);for(const s of this.eventsTypes)this.addListener(s);this.addResizeListener(),this.addTransitionEndListener()}pauseMutationObserver(){this.mutationObserver.disconnect()}unpauseMutationObserver(){this.mutationObserver.observe(this.targetNode,this.config)}unobserve(){this.mutationObserver.disconnect();for(const s of this.eventsTypes)this.removeListener(s);this.removeResizeListener(),this.removeTransitionEndListener()}addListener(s){document.addEventListener(s,this.callbackFunction,!0)}removeListener(s){document.removeEventListener(s,this.callbackFunction,!0)}addTransitionEndListener(){this.targetNode.addEventListener("transitionend",this.callbackFunction)}removeTransitionEndListener(){this.targetNode.removeEventListener("transitionend",this.callbackFunction)}addResizeListener(){window.addEventListener("resize",this.callbackFunction)}removeResizeListener(){window.removeEventListener("resize",this.callbackFunction)}}function ae(t,s,c,m){return s!=null?s(t):t==null?"":typeof t=="object"?t[c]:m?ue(t,m):""+t}function ue(t,s){return s.find(c=>c.type===t)?.label??""}class ce{constructor(){this.abortController=new AbortController,this.func=()=>{},this.then=()=>{}}async abortablePromise(s,c,m){const i=await c();if(!s.aborted)return m(i)}setFunc(s){this.func=s}setThen(s){this.then=s}execute(){return this.abortablePromise(this.abortController.signal,this.func,this.then)}abort(s){this.abortController.abort(s||"Aborted By Controller."),this.abortController=new AbortController}resetAndExecute(s,c){return this.abort("New Request From Controller."),this.setFunc(s),this.setThen(c),this.execute()}}const de=["tabindex","placeholder","size"],fe=e.defineComponent({__name:"ListTextInput",props:{enableTextFilter:{type:Boolean,required:!0},placeholder:{type:String,default:void 0},enableButtonClick:{type:Boolean,default:!0},parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,required:!0}},emits:{"update:selected":null,"update:query":null,"update:press":null},setup(t,{expose:s,emit:c}){const m=c,i=t,d=e.ref(null);function v(h){"sourceCapabilities"in h&&h.sourceCapabilities==null?i.parentMethods.closeList():i.parentMethods.openList()}function n(h){i.parentMethods.unfocus(h)}function r(h){h?.target?.value!=null&&m("update:query",h.target.value)}const f=e.computed(()=>{const h=d?.value?d.value.length:0,w=i.placeholder?.length||0;return h>0?h:w>0?w:5}),a=e.computed(()=>i.enableButtonClick===!0&&i.enableTextFilter===!0?"":"click-through"),g=e.computed(()=>i.showDropDown&&!i.enableTextFilter||!i.showDropDown?"dark-placeholder-text":"light-placeholder-text");function T(){if(d?.value){const h=d.value;h.blur(),h.value=""}}function L(){d?.value&&d.value.focus()}return s({blurInput:T,focusInput:L,textInputRef:d}),(h,w)=>(e.openBlock(),e.createElementBlock("input",{ref_key:"textInputRef",ref:d,tabindex:t.enableTextFilter?0:-1,onKeydown:[w[0]||(w[0]=e.withKeys(b=>t.parentMethods.press(b),["enter"])),w[1]||(w[1]=e.withKeys(b=>t.parentMethods.press(),["space"])),w[2]||(w[2]=e.withKeys(b=>t.parentMethods.press(b),["esc"])),w[3]||(w[3]=e.withKeys(b=>t.parentMethods.press(b),["up"])),w[4]||(w[4]=e.withKeys(b=>t.parentMethods.press(b),["down"]))],onFocusin:w[5]||(w[5]=b=>v(b)),onFocusout:w[6]||(w[6]=b=>n(b)),onInput:w[7]||(w[7]=b=>r(b)),type:"text","aria-autocomplete":"none",autocomplete:"off",placeholder:t.placeholder,size:f.value,class:e.normalizeClass([[a.value,g.value,{"text-filter-disabled":!t.enableTextFilter}],"list-filter-text-input"])},null,42,de))}}),E=(t,s)=>{const c=t.__vccOpts||t;for(const[m,i]of s)c[m]=i;return c},te=E(fe,[["__scopeId","data-v-acc7ac24"]]),pe={},me={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true","data-slot":"icon",viewBox:"0 -16 16 17"};function be(t,s){return e.openBlock(),e.createElementBlock("svg",me,s[0]||(s[0]=[e.createElementVNode("path",{"shape-rendering":"geometricPrecision",d:"M 6 -2.25 L 13.75 -14 A 0.5 0.5 90 0 1 15 -13 L 6.5 -0.5 A 2 1 90 0 1 5.5 -0.5 L 1 -6 A 0.5 0.5 90 0 1 2.25 -7 Z"},null,-1)]))}const he=E(pe,[["render",be]]),we=["onMousedown"],ge={class:"list-item-span"},ve={class:"list-item-span"},ye=E(e.defineComponent({__name:"ListItem",props:{mouseHoveringOnList:{type:Boolean,default:!1},filteredListItems:{type:Array,default:()=>[]},focusedIndex:{type:Number,default:null},selectedIndex:{type:Number,default:null},listElementOpenAndVisible:{type:Boolean,default:!1},parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,default:!1},totalOptionsCount:{type:Number,default:0}},setup(t){const s=t,c=e.useTemplateRef("items"),m=e.computed(()=>{if(!c?.value)return null;const n=(Array.isArray(c.value)?c.value:[c.value])[s.focusedIndex];return n&&typeof n=="object"&&"scrollIntoView"in n&&typeof n.scrollIntoView=="function"?n:null});e.watch(()=>s.showDropDown,()=>i()),e.watch(()=>s.listElementOpenAndVisible,()=>d()),e.watch(()=>m.value,()=>d());function i(){!s.showDropDown||!m?.value?.parentElement?.parentElement||(m.value.parentElement.parentElement.scrollTop=m.value.offsetTop)}function d(){const v=m.value,n=v?.parentElement?.parentElement;if(!s.showDropDown||!v||!n)return;const r=v.offsetTop-n.scrollTop<0,f=v.offsetTop+v.offsetHeight-n.scrollTop>n.clientHeight;r&&(n.scrollTop=v.offsetTop),f&&(n.scrollTop=v.offsetTop+v.clientHeight-n.clientHeight)}return(v,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filteredListItems,(r,f)=>(e.openBlock(),e.createElementBlock("li",{key:f,ref_for:!0,ref:"items",onKeyup:[n[0]||(n[0]=e.withKeys(a=>t.parentMethods.press(a),["enter"])),n[1]||(n[1]=e.withKeys(a=>t.parentMethods.press(a),["space"])),n[2]||(n[2]=e.withKeys(a=>t.parentMethods.press(a),["esc"]))],onKeydown:[n[3]||(n[3]=e.withKeys(a=>t.parentMethods.press(a),["up"])),n[4]||(n[4]=e.withKeys(a=>t.parentMethods.press(a),["down"]))],onFocusout:n[5]||(n[5]=a=>t.parentMethods.unfocus(a)),tabindex:"-1",onMousedown:e.withModifiers(a=>t.parentMethods.updatedSelected(r),["left"]),class:e.normalizeClass([{"list-option-selected":t.selectedIndex===f},{"list-option-active":t.filteredListItems.length===1||t.focusedIndex===f&&!t.mouseHoveringOnList},"list-option"])},[e.createElementVNode("span",ge,e.toDisplayString(t.parentMethods.getLabel(r)),1),t.selectedIndex===f?(e.openBlock(),e.createBlock(he,{key:0,class:"list-item-icon","aria-hidden":"true"})):e.createCommentVNode("",!0)],42,we))),128)),t.filteredListItems.length===0?(e.openBlock(),e.createElementBlock("li",{key:0,onKeyup:[n[6]||(n[6]=e.withKeys(r=>t.parentMethods.press(r),["enter"])),n[7]||(n[7]=e.withKeys(r=>t.parentMethods.press(r),["space"])),n[8]||(n[8]=e.withKeys(r=>t.parentMethods.press(r),["esc"]))],onKeydown:[n[9]||(n[9]=e.withKeys(r=>t.parentMethods.press(r),["up"])),n[10]||(n[10]=e.withKeys(r=>t.parentMethods.press(r),["down"]))],onFocusout:n[11]||(n[11]=r=>t.parentMethods.unfocus(r)),onMousedown:n[12]||(n[12]=e.withModifiers(r=>t.parentMethods.closeList(r),["left"])),tabindex:"-1",class:"list-option-message"},n[20]||(n[20]=[e.createElementVNode("span",{class:"list-item-span"},"No Items To Display.",-1)]),32)):e.createCommentVNode("",!0),t.totalOptionsCount&&t.totalOptionsCount>(t.filteredListItems?.length||0)?(e.openBlock(),e.createElementBlock("li",{key:1,onKeyup:[n[13]||(n[13]=e.withKeys(r=>t.parentMethods.press(r),["enter"])),n[14]||(n[14]=e.withKeys(r=>t.parentMethods.press(r),["space"])),n[15]||(n[15]=e.withKeys(r=>t.parentMethods.press(r),["esc"]))],onKeydown:[n[16]||(n[16]=e.withKeys(r=>t.parentMethods.press(r),["up"])),n[17]||(n[17]=e.withKeys(r=>t.parentMethods.press(r),["down"]))],onFocusout:n[18]||(n[18]=r=>t.parentMethods.unfocus(r)),onMousedown:n[19]||(n[19]=e.withModifiers(r=>t.parentMethods.closeList(r),["left"])),tabindex:"-1",class:"list-option-message"},[e.createElementVNode("span",ve," +"+e.toDisplayString(t.totalOptionsCount-t.filteredListItems?.length||0)+" More Items...",1)],32)):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-e4eeb2f7"]]),ne=E(e.defineComponent({__name:"ItemList",props:{mouseHoveringOnList:{type:Boolean,default:!1},filteredListItems:{type:Array,default:()=>[]},focusedIndex:{type:Number,default:null},selectedIndex:{type:Number,default:null},parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,required:!0},maxListHeightPX:{type:Number,required:!0},listAnimationDurationMs:{type:Number,required:!0},blockListChange:{type:Boolean,required:!0},totalOptionsCount:{type:Number,default:0},enableScrollClose:{type:Boolean,default:!0}},emits:["reverseDropDownList"],setup(t,{expose:s,emit:c}){e.useCssVars(u=>({"8d801350":T.value,"2724698a":O.value,"27246d4b":W.value,ffcaa9a8:S.value,"414dd276":q.value}));const m=c,i=t,d=e.ref(null),v=e.ref(null),n=e.ref(null),r=e.ref(0),f=e.ref(0),a=e.ref(0),g=e.ref(0),T=e.ref("0px"),L=e.ref(!1),h=e.ref([]),w=e.ref(0),b=e.computed(()=>!L.value||window?.innerHeight==null?!1:V()&&Z()),K=e.computed(()=>i.maxListHeightPX>=w.value);e.watch(()=>b.value,u=>m("reverseDropDownList",u),{immediate:!0});const O=e.computed(()=>r.value+"px"),W=e.computed(()=>g.value+"px");s({listContainerRef:n});const N=u=>{u?.key&&u.key===" "&&u.preventDefault()},Q=u=>{const y=n?.value,x=u.target;(!(y&&x&&y.contains(x))||y.isEqualNode(x))&&i.parentMethods.focusInput()};function M(){return v?.value?(v?.value).clientHeight:0}function C(){if(!L.value||M()===0)return i.maxListHeightPX;const u=M()===0?i.maxListHeightPX:+M();return i.maxListHeightPX&&i.maxListHeightPX>u?u:i.maxListHeightPX}function V(){return f.value>C()}function Z(){return a.value<C()}const q=e.computed(()=>(i.maxListHeightPX||0)+"px"),S=e.computed(()=>(i.listAnimationDurationMs||0)+"ms"),$=e.computed(()=>i.blockListChange?h.value:i.filteredListItems);e.watch(()=>$,u=>{u&&(h.value=u.value)},{immediate:!1,deep:!0});let k=setTimeout(()=>{},0),D=null;function A(){w.value=M(),clearTimeout(k),D&&D.observe(),L.value=!0,H(void 0)}function Y(){clearTimeout(k),k=setTimeout(()=>{i.showDropDown||(L.value=!1,D&&D.unobserve())},i.listAnimationDurationMs+50)}e.watch(()=>i.showDropDown,(u,y)=>{u!==y&&(z(),u?A():Y())},{immediate:!0});function H(u){z(),e.nextTick(()=>z()),X(u)}function X(u){if(!i.enableScrollClose||!i.showDropDown||typeof n?.value?.contains!="function"||u?.target?.nodeType==null||U(u))return;const x=["scroll","wheel","touchmove"].includes(u?.type);i.showDropDown&&x&&i.parentMethods.closeList()}function U(u){const y=!!d.value?.contains(u?.target),x=!!n.value?.contains(u.target),j=[u?.srcElement?.id,u?.target?.id].includes("super-list-select-list");return y||x||j}function z(){R(),P()}function R(){if(d?.value==null)return;const u=d.value.getBoundingClientRect();f.value=u.top,a.value=window.innerHeight-u.bottom,T.value=u.width+"px"}function P(){if(d?.value==null||n?.value==null)return;const u=J().getBoundingClientRect(),y=n.value.getBoundingClientRect(),x=g.value,j=r.value;b.value?g.value=x-(u.top-y.bottom):g.value=x-(y.top-u.bottom),r.value=j-(y.left-u.left)}function G(){return(d?.value).getElementsByTagName("button")[0]}function J(){return d?.value}return e.onMounted(()=>{D=new le(H,G()),setTimeout(()=>H(void 0),250)}),e.onUnmounted(()=>{D?.unobserve()}),(u,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"dropDownButtonContainer",ref:d,class:"super-list-button-container"},[e.renderSlot(u.$slots,"default",{},void 0,!0)],512),e.createElementVNode("div",{id:"super-list-select-list",ref_key:"listContainerRef",ref:n,onMouseenter:y[0]||(y[0]=x=>t.parentMethods.mouseOverList()),tabindex:"-1",class:e.normalizeClass(["select-list",b.value?"list-reverse":"list-normal",{"select-list-open":t.showDropDown},{"no-scroll":K.value&&L.value},{"select-list-fixed":L.value},{"select-list-scrollable":!K.value}]),onKeydown:y[1]||(y[1]=e.withKeys(x=>N(x),["space"])),onMouseup:y[2]||(y[2]=e.withModifiers(x=>Q(x),["left"]))},[e.createElementVNode("ul",{tabindex:"-1",ref_key:"dropDownListUL",ref:v,class:"list-content"},[e.createVNode(ye,{filteredListItems:h.value,mouseHoveringOnList:t.mouseHoveringOnList,focusedIndex:t.focusedIndex,selectedIndex:t.selectedIndex,listElementOpenAndVisible:L.value,"parent-methods":t.parentMethods,"show-drop-down":t.showDropDown,"total-options-count":t.totalOptionsCount},null,8,["filteredListItems","mouseHoveringOnList","focusedIndex","selectedIndex","listElementOpenAndVisible","parent-methods","show-drop-down","total-options-count"])],512)],34)],64))}}),[["__scopeId","data-v-e58cd48c"]]),xe={},Le={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true","data-slot":"icon",viewBox:"0 0 12 6"};function Ie(t,s){return e.openBlock(),e.createElementBlock("svg",Le,s[0]||(s[0]=[e.createElementVNode("path",{"shape-rendering":"geometricPrecision",d:"M 6 4 L 10 0.25 A 0.5 0.5 90 0 1 11 1.25 L 6.5 5.75 A 15 3 90 0 1 5.5 5.75 L 1 1.25 A 0.5 0.5 90 0 1 2 0.25 Z"},null,-1)]))}const oe=E(xe,[["render",Ie]]),ke=["tabindex"],Te={key:2,class:"list-button-icon custom-icon"},ie=E(e.defineComponent({__name:"ListButton",props:{parentMethods:{type:Object,required:!0},showDropDown:{type:Boolean,required:!0},enableTextFilter:{type:Boolean,required:!0},customIcon:{default:null,type:[Object,Function]},reverseDropDownList:{type:Boolean,required:!0}},setup(t,{expose:s}){const c=t,m=e.ref(null);function i(){c.enableTextFilter||c.parentMethods.openList()}function d(f){c.enableTextFilter?(c.parentMethods.focusInput(),f.stopPropagation(),f.preventDefault()):c.parentMethods.press(f)}function v(f){c.enableTextFilter||c.parentMethods.press(f)}function n(){m?.value&&m.value.blur()}function r(){m?.value&&m.value.focus()}return s({blurInput:n,focusInput:r,buttonRef:m}),(f,a)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonRef",ref:m,tabindex:t.enableTextFilter?-1:0,onKeydown:[a[0]||(a[0]=e.withKeys(g=>d(g),["enter"])),a[1]||(a[1]=e.withKeys(g=>v(g),["space"])),a[2]||(a[2]=e.withKeys(g=>t.parentMethods.press(g),["esc"])),a[3]||(a[3]=e.withKeys(g=>t.parentMethods.press(g),["up"])),a[4]||(a[4]=e.withKeys(g=>t.parentMethods.press(g),["down"]))],onFocusout:a[5]||(a[5]=g=>t.parentMethods.unfocus(g)),onClick:a[6]||(a[6]=g=>i()),type:"button",class:e.normalizeClass([[{"click-through":c.enableTextFilter||c.showDropDown}],"list-button"])},[e.renderSlot(f.$slots,"default",{},void 0,!0),e.createElementVNode("span",{class:e.normalizeClass(["list-button-icon-div",{"bigger-gap":c.showDropDown}])},[t.customIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["list-button-icon",[{"rotate-180":!c.showDropDown}]])},[e.createVNode(oe,{"aria-hidden":"true"})],2)),t.customIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["list-button-icon",[{"rotate-180":c.showDropDown}]])},[t.customIcon==null?(e.openBlock(),e.createBlock(oe,{key:0,"aria-hidden":"true"})):e.createCommentVNode("",!0)],2)),t.customIcon?(e.openBlock(),e.createElementBlock("span",Te,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.customIcon),{"aria-hidden":"true"}))])):e.createCommentVNode("",!0)],2)],42,ke))}}),[["__scopeId","data-v-01ef8e37"]]);return E(e.defineComponent({__name:"super-list",props:{selected:{type:[String,Number,Object,null,void 0]},options:{type:[Function,Array],required:!0},maxListOptions:{type:Number,default:50},maxListHeightPX:{type:Number,default:200},tooltip:{type:String,required:!1},objectLabelKeyName:{type:String,default:""},enumKeyToLabelObjectArray:{type:Object,default:void 0},listAnimationDurationMs:{type:Number,default:300},customIcon:{default:null,type:[Object,Function]},forceTextFilterVisibilityTo:{type:Boolean,default:void 0},customPlaceHolderFunction:{type:Function,default:null},colour:{type:String,default:"black"},scrollTextInputToTopOnMobile:{type:Boolean,default:!0}},emits:{"update:selected":null},setup(t,{expose:s,emit:c}){const m=c,i=t,d=e.ref([]),v=new ce,n=e.ref(0),r=e.computed(()=>i.forceTextFilterVisibilityTo!=null?i.forceTextFilterVisibilityTo:n.value>i.maxListOptions),f=e.ref(!1),a=e.ref(!1),g=e.ref(!1),T=e.ref(!0),L=e.ref(!1),h=e.ref(!1),w=e.ref(ne),b=e.ref(te),K=e.ref(ie),O=e.ref("");e.watch(()=>O.value,(o,l)=>{o!==l&&typeof i.options=="function"&&x(o)});const W=()=>{r.value&&b?.value?.blurInput()},N=()=>{clearTimeout(P),W(),O.value="",f.value=!1,T.value=!0},Q=e.computed(()=>h?.value===!0?"Error loading data":L?.value===!0?"Loading...":C(i.selected)),M=o=>{o&&m("update:selected",o),N()},C=o=>ae(o,i.customPlaceHolderFunction,i.objectLabelKeyName,i.enumKeyToLabelObjectArray);function V(){throw L.value=!0,h.value=!0,new Error("Invalid options argument provided to ListInputComponent")}function Z(){throw L.value=!0,h.value=!0,new Error("Invalid response provided to ListInputComponent, no total count key found")}function q(){throw L.value=!0,h.value=!0,new Error("Invalid objectLabelKeyName for provided Dropdown list value.")}e.onMounted(()=>{typeof i.options!="function"&&!Array.isArray(i.options)?V():u()});const S=e.ref(!1),$=e.ref(0),k=e.ref(0),D=e.ref(0);e.watch(()=>k.value,(o,l)=>{o!=l&&!a.value&&(D.value=o)},{immediate:!0}),e.watch(()=>a.value,o=>{o||(D.value=k.value)},{immediate:!0});const A=e.computed(()=>{if(typeof i.options=="function"&&!Array.isArray(i.options))return d.value;const o=O.value,l=d.value;return o===""?l:l.filter(p=>C(p).toLowerCase().includes(o.toLowerCase()))});e.watch(()=>A.value,(o,l)=>{JSON.stringify(o)!==JSON.stringify(l)&&H()},{immediate:!1,deep:!0});const Y=()=>{S.value=!0},H=()=>{const o=X();$.value=o,k.value=o>-1?o:0};function X(){if(i.selected==null)return-1;const o=d.value.map(p=>C(p)),l=o.filter(p=>p===C(i.selected));if(l.length>1){const p=l.map(I=>o.indexOf(I));for(let I=0;I<p.length;I++){const B=JSON.stringify(d.value[p[I]]),ee=JSON.stringify(i.selected);if(B===ee)return p[I]}return-1}return o.indexOf(C(i.selected))}const U=()=>{L.value||(f.value||(a.value=!1,H(),z(),f.value=!0),S.value=!1,T.value=!1)},z=()=>{const o=window?.innerWidth!=null&&window.innerWidth<640,l=screen?.width!=null&&screen.width<640,p=b.value.textInputRef;(o||l)&&r.value&&(G(),i.scrollTextInputToTopOnMobile&&p?.scrollIntoView({block:"start",inline:"center"}))},R=e.ref(!0);let P=setTimeout(()=>{},0);function G(){const o=b.value.textInputRef;if(!o)return;R.value=!1;let l=null;const p=()=>{l&&clearInterval(l),clearTimeout(P),setTimeout(()=>{R.value=!0},100)};P=setTimeout(p,5e3),l=setInterval(()=>{(f.value===!1||o?.scrollTop===0&&document.readyState==="complete")&&p()},100)}const J=()=>{r?.value==!0?b.value.focusInput():K?.value?.focusInput&&K?.value?.focusInput()};async function u(){typeof i.options=="function"?await x(O.value?O.value:void 0,!0):(re(i.options),n.value=d.value.length),y()}s({initializeOptions:u,getLabel:C});function y(){X()==-1&&d.value&&!!d.value[0]&&M(d.value[0])}async function x(o,l=!0){L.value=l;const p=async()=>i.options(i.maxListOptions,o||""),I=B=>{(!B||!("data"in B))&&V(),re(B.data),j(B?.data?.length??0).then(()=>{L.value=!1})};await v.resetAndExecute(p,I)}async function j(o){const l=async()=>i.options(1,""),p=I=>{(!I||!("totalNum"in I))&&Z(),n.value=I.totalNum??o};await v.resetAndExecute(l,p)}const se=()=>b?.value?.textInputRef?.getElementsByTagName("li")[k.value]??null,Ce=o=>{f.value==!1?U():o&&De(o)},De=o=>{const l=o.key||o.code;(l==="Tab"||l==="Escape")&&N(),l==="ArrowDown"&&Me(o),l==="ArrowUp"&&Be(o),(l==="Enter"||l===" ")&&Oe(),o.preventDefault(),o.stopPropagation()},Oe=()=>{A.value.length>0?(a.value=!0,M(A.value[k.value])):N()},Me=o=>{T.value=!0,k.value<A.value.length-1&&(o.preventDefault(),S.value=!1,k.value++,se()?.focus())},Be=o=>{T.value=!0,k.value>0&&(o.preventDefault(),S.value=!1,k.value--,se()?.focus())},Ee=o=>{if(f?.value===!1)return;O.value.length>0&&(a.value=!0);const l=w?.value?.listContainerRef,p=b?.value?.textInputRef,I=o?.relatedTarget&&p?.isEqualNode(o?.relatedTarget),B=o?.relatedTarget&&l&&l.contains(o?.relatedTarget),ee=o?.relatedTarget&&l&&l.isEqualNode(o?.relatedTarget);if(!(B||I)){if(ee){J();return}N()}};function re(o){Array.isArray(o)||V(),o.length>0&&typeof o[0]=="object"&&Ne(o),d.value=o}function Ne(o){(!i.objectLabelKeyName||i.objectLabelKeyName.length===0)&&q();const l=i.objectLabelKeyName;for(let p=0;p<o.length;p++)(typeof o[p]!="object"||!(l in o[p]))&&q()}const _={openList:U,unfocus:Ee,press:Ce,mouseOverList:Y,getLabel:C,updatedSelected:M,focusInput:J,closeList:N};return(o,l)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative"},class:e.normalizeClass(o.$attrs.class)},[e.createVNode(ne,{ref_key:"itemListRef",ref:w,"show-drop-down":f.value,filteredListItems:A.value,mouseHoveringOnList:S.value,focusedIndex:D.value,selectedIndex:$.value,"max-list-height-p-x":t.maxListHeightPX,"list-animation-duration-ms":t.listAnimationDurationMs,"parent-methods":_,blockListChange:a.value,"onUpdate:blockListChange":l[1]||(l[1]=p=>a.value=p),"total-options-count":n.value,onReverseDropDownList:l[2]||(l[2]=p=>g.value=p),enableScrollClose:R.value},{default:e.withCtx(()=>[e.createVNode(ie,{ref_key:"dropDownButtonInput",ref:K,"parent-methods":_,"show-drop-down":f.value,"enable-text-filter":r.value,"custom-icon":t.customIcon,"reverse-drop-down-list":g.value},{default:e.withCtx(()=>[e.createVNode(te,{ref_key:"dropDownTextInput",ref:b,"enable-text-filter":r.value,"show-drop-down":f.value,placeholder:Q.value,"enable-button-click":T.value,"parent-methods":_,"onUpdate:query":l[0]||(l[0]=p=>O.value=p)},null,8,["enable-text-filter","show-drop-down","placeholder","enable-button-click"])]),_:1},8,["show-drop-down","enable-text-filter","custom-icon","reverse-drop-down-list"])]),_:1},8,["show-drop-down","filteredListItems","mouseHoveringOnList","focusedIndex","selectedIndex","max-list-height-p-x","list-animation-duration-ms","blockListChange","total-options-count","enableScrollClose"])],2))}}),[["__scopeId","data-v-6c6e7e6a"]])});
3
3
  //# sourceMappingURL=super-list.umd.cjs.map