@jblehm/super-list 1.0.43 → 1.0.45
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.
- package/README.md +1 -1
- package/dist/index.css +1 -1
- package/dist/super-list.js +109 -109
- package/dist/super-list.js.map +1 -1
- package/dist/super-list.umd.cjs +2 -2
- package/dist/super-list.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/super-list.js.map
CHANGED
|
@@ -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 }\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 <form @submit.prevent style=\"display: contents !important\">\n <!-- Forces virtual keyboard to display return/enter key when list exists in external form -->\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 @change=\"updateQuery($event as InputEvent)\"\n @paste=\"updateQuery($event as ClipboardEvent)\"\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 </form>\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 const input: HTMLElement | null = textInputRef?.value as HTMLElement | null\n const target: HTMLElement | null = (e?.target ?? null) as HTMLElement | null\n const isInput: boolean = input !== null && input.isEqualNode(target)\n if (!isInput && 'sourceCapabilities' in e && e.sourceCapabilities == null)\n props.parentMethods.closeList()\n else props.parentMethods.openList()\n}\n\nfunction focusOutHandler(event: FocusEvent) {\n props.parentMethods.unfocus(event)\n}\n\nlet lastQuery: string = ''\n\nfunction updateQuery(event: any) {\n if (event?.target?.value != undefined && event?.target?.value !== lastQuery)\n emit('update:query', event.target.value)\n lastQuery = 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;\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 @focusout=\"focusOutHandler($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 focusOutHandler = (event: FocusEvent) => {\n props.parentMethods.unfocus(event)\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 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 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 = filteredListItems.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(\n filteredListItems.value[matchingIndexes[i]]\n )\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\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\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 listBtn: HTMLElement | null = dropDownButtonInput?.value?.buttonRef as HTMLElement | null\n const isListInput = event?.relatedTarget && listInput?.isEqualNode(event?.relatedTarget)\n const isList = list?.contains(event?.relatedTarget) || listBtn?.isEqualNode(event.relatedTarget)\n const isListItem = event?.relatedTarget && list && list.isEqualNode(event?.relatedTarget)\n if (isList || isListInput) return\n else if (isListItem) focusInput()\n else closeList()\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","input","target","focusOutHandler","lastQuery","updateQuery","textInputSize","computed","refLength","placeHolderLength","pointerEventsClass","textInputColourClass","blurInput","focusInput","__expose","_createElementBlock","_createElementVNode","$event","_cache","_withKeys","_normalizeClass","_openBlock","_hoisted_1","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","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","optns","validateObjectList","values","key","dataLength","getCurrentlyFocusedListItemElement","press","keypress","down","up","updateSelectedFromTextQuery","parentMethods","listInput","listBtn","isListInput","isList","isListItem","$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,EAAA;AAAA,EAEH;AAAA,EACA;AAAA,EAER,YAAYC,GAA0BC,IAAkB,SAAS,MAAM;AACrE,SAAK,aAAaA,GAClB,KAAK,mBAAoB,CAACC,MACxBF,EAAeE,CAAK,GACtB,KAAK,mBAAmB,IAAI,iBAAkB,MAAMF,GAAqC;AAAA,EAC3F;AAAA,EAEO,UAAgB;AACrB,SAAK,iBAAiB,QAAQ,KAAK,YAAY,KAAK,MAAM;AAC1D,eAAWG,KAAa,KAAK,YAAa,MAAK,YAAYA,CAAS;AACpE,SAAK,kBAAA,GACL,KAAK,yBAAA;AAAA,EACP;AAAA,EAEA,wBAA8B;AAC5B,SAAK,iBAAiB,WAAA;AAAA,EACxB;AAAA,EAEA,0BAAgC;AAC9B,SAAK,iBAAiB,QAAQ,KAAK,YAAY,KAAK,MAAM;AAAA,EAC5D;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../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 }\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 <form @submit.prevent style=\"display: contents !important\">\n <!-- Forces virtual keyboard to display return/enter key when list exists in external form -->\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 @change=\"updateQuery($event as InputEvent)\"\n @paste=\"updateQuery($event as ClipboardEvent)\"\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 </form>\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 const input: HTMLElement | null = textInputRef?.value as HTMLElement | null\n const target: HTMLElement | null = (e?.target ?? null) as HTMLElement | null\n const isInput: boolean = input !== null && input.isEqualNode(target)\n if (!isInput && 'sourceCapabilities' in e && e.sourceCapabilities == null)\n props.parentMethods.closeList()\n else props.parentMethods.openList()\n}\n\nfunction focusOutHandler(event: FocusEvent) {\n props.parentMethods.unfocus(event)\n}\n\nlet lastQuery: string = ''\n\nfunction updateQuery(event: any) {\n if (event?.target?.value != undefined && event?.target?.value !== lastQuery)\n emit('update:query', event.target.value)\n lastQuery = 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;\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 @focusout=\"focusOutHandler($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 focusOutHandler = (event: FocusEvent) => {\n props.parentMethods.unfocus(event)\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 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 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 = filteredListItems.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(\n filteredListItems.value[matchingIndexes[i]]\n )\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\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\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 btn: HTMLElement | null = dropDownButtonInput?.value?.buttonRef as HTMLElement | null\n const isListInput: boolean = event?.relatedTarget && listInput?.isEqualNode(event?.relatedTarget)\n const listContains: boolean = event?.relatedTarget && list && list.contains(event?.relatedTarget)\n const isListButton: boolean = event?.relatedTarget && btn && btn.isEqualNode(event.relatedTarget)\n const isList = listContains || isListButton\n const isListItem = event?.relatedTarget && list && list.isEqualNode(event?.relatedTarget)\n if (isList || isListInput) return\n else if (isListItem) focusInput()\n else closeList()\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","input","target","focusOutHandler","lastQuery","updateQuery","textInputSize","computed","refLength","placeHolderLength","pointerEventsClass","textInputColourClass","blurInput","focusInput","__expose","_createElementBlock","_createElementVNode","$event","_cache","_withKeys","_normalizeClass","_openBlock","_hoisted_1","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","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","optns","validateObjectList","values","key","dataLength","getCurrentlyFocusedListItemElement","press","keypress","down","up","updateSelectedFromTextQuery","parentMethods","listInput","btn","isListInput","listContains","isListButton","isList","isListItem","$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,EAAA;AAAA,EAEH;AAAA,EACA;AAAA,EAER,YAAYC,GAA0BC,IAAkB,SAAS,MAAM;AACrE,SAAK,aAAaA,GAClB,KAAK,mBAAoB,CAACC,MACxBF,EAAeE,CAAK,GACtB,KAAK,mBAAmB,IAAI,iBAAkB,MAAMF,GAAqC;AAAA,EAC3F;AAAA,EAEO,UAAgB;AACrB,SAAK,iBAAiB,QAAQ,KAAK,YAAY,KAAK,MAAM;AAC1D,eAAWG,KAAa,KAAK,YAAa,MAAK,YAAYA,CAAS;AACpE,SAAK,kBAAA,GACL,KAAK,yBAAA;AAAA,EACP;AAAA,EAEA,wBAA8B;AAC5B,SAAK,iBAAiB,WAAA;AAAA,EACxB;AAAA,EAEA,0BAAgC;AAC9B,SAAK,iBAAiB,QAAQ,KAAK,YAAY,KAAK,MAAM;AAAA,EAC5D;AAAA,EAEO,YAAkB;AACvB,SAAK,iBAAiB,WAAA;AACtB,eAAWA,KAAa,KAAK,YAAa,MAAK,eAAeA,CAAS;AACvE,SAAK,qBAAA,GACL,KAAK,4BAAA;AAAA,EACP;AAAA,EAEQ,YAAYA,GAAyB;AAC3C,aAAS,iBAAiBA,GAAW,KAAK,kBAAkB,EAAI;AAAA,EAClE;AAAA,EAEQ,eAAeA,GAAyB;AA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AAAA,iBAhCN;AAAA,QAAJ,KAAID;AAAA,QACH,kBAAgBN,EAAA;AAAA,QAChB,mBAAmB4B,EAAA;AAAA,QACnB,qBAAqBJ,EAAA;AAAA,QACrB,cAAcG,EAAA;AAAA,QACd,eAAeF,EAAA;AAAA,QACf,uBAAqB5I,EAAA;AAAA,QACrB,8BAA4BA,EAAA;AAAA,QAC5B,kBAAgBwL;AAAA,QACT,iBAAiBpE,EAAA;AAAA,2DAAAA,EAAgB,QAAA/F;AAAA,QACxC,uBAAqB4F,EAAA;AAAA,QACrB,uBAAmB3F,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAD,MAAEgG,EAAA,QAAsBhG;AAAA,QAC3C,mBAAmB8I,EAAA;AAAA,MAAA;oBAEpB,MAiBc;AAAA,UAjBd5D,EAiBcuB,IAAA;AAAA,qBAhBR;AAAA,YAAJ,KAAID;AAAA,YACH,kBAAgB2D;AAAA,YAChB,kBAAgBrE,EAAA;AAAA,YAChB,sBAAoBD,EAAA;AAAA,YACpB,eAAalH,EAAA;AAAA,YACb,0BAAwBqH,EAAA;AAAA,UAAA;wBAEzB,MAQE;AAAA,cARFd,EAQEqB,IAAA;AAAA,yBAPI;AAAA,gBAAJ,KAAID;AAAA,gBACH,sBAAoBT,EAAA;AAAA,gBACpB,kBAAgBC,EAAA;AAAA,gBAChB,aAAagB,GAAA;AAAA,gBACb,uBAAqBb,EAAA;AAAA,gBACrB,kBAAgBkE;AAAA,gBAChB,kBAAYlK,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAD,MAAE0G,EAAA,QAAQ1G;AAAA,cAAA;;;;;;;;;;"}
|
package/dist/super-list.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(e,K){typeof exports=="object"&&typeof module<"u"?module.exports=K(require("vue")):typeof define=="function"&&define.amd?define(["vue"],K):(e=typeof globalThis<"u"?globalThis:e||self,e.SuperList=K(e.Vue))})(this,function(e){"use strict";var K=document.createElement("style");K.textContent=`.list-filter-text-input[data-v-edeb41fa]{color:var(--superlist-text-colour, rgb(17, 24, 39));text-align:center;padding:.125rem 2rem .125rem .5rem;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-edeb41fa]:focus,.list-filter-text-input[data-v-edeb41fa]:focus-visible,.list-filter-text-input[data-v-edeb41fa]:active{text-align:left}.click-through[data-v-edeb41fa]{pointer-events:none}.dark-placeholder-text[data-v-edeb41fa]::placeholder{color:var(--superlist-text-colour, rgb(17, 24, 39))}.light-placeholder-text[data-v-edeb41fa]::placeholder{color:var(--superlist-disabled-text-colour, rgb(120, 125, 130))}.text-filter-disabled[data-v-edeb41fa]{background-color:transparent;border:none;outline:none;box-shadow:none;filter:none}@media (min-width: 640px){.list-filter-text-input[data-v-edeb41fa]{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-bb412ce9]{top:var(--parent-y)}.list-reverse[data-v-bb412ce9]{bottom:var(--parent-y)}.select-list[data-v-bb412ce9]{--parent-width: var(--v15890c8c);--parent-x: var(--v4338b9be);--parent-y: var(--v4338bd7f);--duration: var(--v6e74f140);--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-bb412ce9]:focus-visible,.select-list>ul[data-v-bb412ce9]:focus-visible,.super-list-button-container[data-v-bb412ce9]:focus-visible{outline:none}.super-list-button-container[data-v-bb412ce9]{height:100%;width:100%}.select-list.select-list-open[data-v-bb412ce9]{z-index:999999;--max-height: var(--v4db56ff9);max-height:var(--max-height, 0)}.select-list.no-scroll[data-v-bb412ce9]{overflow:hidden}.select-list-fixed[data-v-bb412ce9]{position:fixed;opacity:1;visibility:visible}.list-content[data-v-bb412ce9]{--duration: var(--v6e74f140);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-bb412ce9]{border-radius:var(--border-radius)}.select-list[data-v-bb412ce9]:not(.select-list-fixed){transition:none;box-shadow:none!important}@media (min-width: 640px){.select-list.select-list-scrollable[data-v-bb412ce9]{border-radius:var(--border-radius) 0 0 var(--border-radius)}.list-content[data-v-bb412ce9]{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-
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(K);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=h=>r(h),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,h){return r!=null?r(t):t==null?"":typeof t=="object"?t[c]:h?ue(t,h):""+t}function ue(t,r){return r.find(c=>c.type===t)?.label??""}class de{constructor(){this.abortController=new AbortController,this.func=()=>{},this.then=()=>{}}async abortablePromise(r,c,h){const i=await c();if(!r.aborted)return h(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 ce=["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 h=c,i=t,m=e.ref(null);function y(v){const d=m?.value,b=v?.target??null;!(d!==null&&d.isEqualNode(b))&&"sourceCapabilities"in v&&v.sourceCapabilities==null?i.parentMethods.closeList():i.parentMethods.openList()}function n(v){i.parentMethods.unfocus(v)}let s="";function f(v){v?.target?.value!=null&&v?.target?.value!==s&&h("update:query",v.target.value),s=v?.target?.value??""}const u=e.computed(()=>{const v=m?.value?m.value.length:0,d=i.placeholder?.length||0;return v>0?v:d>0?d:5}),w=e.computed(()=>i.enableButtonClick===!0&&i.enableTextFilter===!0?"":"click-through"),D=e.computed(()=>i.showDropDown&&!i.enableTextFilter||!i.showDropDown?"dark-placeholder-text":"light-placeholder-text");function L(){if(m?.value){const v=m.value;v.blur(),v.value=""}}function O(){m?.value&&m.value.focus()}return r({blurInput:L,focusInput:O,textInputRef:m}),(v,d)=>(e.openBlock(),e.createElementBlock("form",{onSubmit:d[10]||(d[10]=e.withModifiers(()=>{},["prevent"])),style:{display:"contents !important"}},[e.createElementVNode("input",{ref_key:"textInputRef",ref:m,tabindex:t.enableTextFilter?0:-1,onKeydown:[d[0]||(d[0]=e.withKeys(b=>t.parentMethods.press(b),["enter"])),d[1]||(d[1]=e.withKeys(b=>t.parentMethods.press(),["space"])),d[2]||(d[2]=e.withKeys(b=>t.parentMethods.press(b),["esc"])),d[3]||(d[3]=e.withKeys(b=>t.parentMethods.press(b),["up"])),d[4]||(d[4]=e.withKeys(b=>t.parentMethods.press(b),["down"]))],onFocusin:d[5]||(d[5]=b=>y(b)),onFocusout:d[6]||(d[6]=b=>n(b)),onInput:d[7]||(d[7]=b=>f(b)),onChange:d[8]||(d[8]=b=>f(b)),onPaste:d[9]||(d[9]=b=>f(b)),type:"text","aria-autocomplete":"none",autocomplete:"off",placeholder:t.placeholder,size:u.value,class:e.normalizeClass([[w.value,D.value,{"text-filter-disabled":!t.enableTextFilter}],"list-filter-text-input"])},null,42,ce)],32))}}),E=(t,r)=>{const c=t.__vccOpts||t;for(const[h,i]of r)c[h]=i;return c},ne=E(fe,[["__scopeId","data-v-edeb41fa"]]),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]]),ve=["onMousedown"],ge={class:"list-item-span"},we={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"),h=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,()=>m()),e.watch(()=>h.value,()=>m());function i(){!r.showDropDown||!h?.value?.parentElement?.parentElement||(h.value.parentElement.parentElement.scrollTop=h.value.offsetTop)}function m(){const y=h.value,n=y?.parentElement?.parentElement;if(!r.showDropDown||!y||!n)return;const s=y.offsetTop-n.scrollTop<0,f=y.offsetTop+y.offsetHeight-n.scrollTop>n.clientHeight;s&&(n.scrollTop=y.offsetTop),f&&(n.scrollTop=y.offsetTop+y.clientHeight-n.clientHeight)}return(y,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(u=>t.parentMethods.press(u),["enter"])),n[1]||(n[1]=e.withKeys(u=>t.parentMethods.press(u),["space"])),n[2]||(n[2]=e.withKeys(u=>t.parentMethods.press(u),["esc"]))],onKeydown:[n[3]||(n[3]=e.withKeys(u=>t.parentMethods.press(u),["up"])),n[4]||(n[4]=e.withKeys(u=>t.parentMethods.press(u),["down"]))],onFocusout:n[5]||(n[5]=u=>t.parentMethods.unfocus(u)),tabindex:"-1",onMousedown:e.withModifiers(u=>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,ve))),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",we," +"+e.toDisplayString(t.totalOptionsCount-t.filteredListItems?.length||0)+" More Items...",1)],32)):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-e4eeb2f7"]]),oe=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:r,emit:c}){e.useCssVars(l=>({v15890c8c:D.value,v4338b9be:M.value,v4338bd7f:W.value,v6e74f140:j.value,v4db56ff9:S.value}));const h=c,i=t,m=e.ref(null),y=e.ref(null),n=e.ref(null),s=e.ref(0),f=e.ref(0),u=e.ref(0),w=e.ref(0),D=e.ref("0px"),L=e.ref(!1),O=e.ref([]),v=e.ref(0),d=e.computed(()=>!L.value||window?.innerHeight==null?!1:Z()&&q()),b=e.computed(()=>i.maxListHeightPX>=v.value);e.watch(()=>d.value,l=>h("reverseDropDownList",l),{immediate:!0});const M=e.computed(()=>s.value+"px"),W=e.computed(()=>w.value+"px");r({listContainerRef:n});const N=l=>{l?.key&&l.key===" "&&l.preventDefault()},Q=l=>{i.parentMethods.unfocus(l)},z=l=>{const g=n?.value,x=l.target;(!(g&&x&&g.contains(x))||g.isEqualNode(x))&&i.parentMethods.focusInput()};function T(){return y?.value?(y?.value).clientHeight:0}function H(){if(!L.value||T()===0)return i.maxListHeightPX;const l=T()===0?i.maxListHeightPX:+T();return i.maxListHeightPX&&i.maxListHeightPX>l?l:i.maxListHeightPX}function Z(){return f.value>H()}function q(){return u.value<H()}const S=e.computed(()=>(i.maxListHeightPX||0)+"px"),j=e.computed(()=>(i.listAnimationDurationMs||0)+"ms"),C=e.computed(()=>i.blockListChange?O.value:i.filteredListItems);e.watch(()=>C,l=>{l&&(O.value=l.value)},{immediate:!1,deep:!0});let F=setTimeout(()=>{},0),I=null;function Y(){v.value=T(),clearTimeout(F),I&&I.observe(),L.value=!0,V(void 0)}function $(){clearTimeout(F),F=setTimeout(()=>{i.showDropDown||(L.value=!1,I&&I.unobserve())},i.listAnimationDurationMs+50)}e.watch(()=>i.showDropDown,(l,g)=>{l!==g&&(A(),l?Y():$())},{immediate:!0});function V(l){A(),e.nextTick(()=>A()),X(l)}function X(l){if(!i.enableScrollClose||!i.showDropDown||typeof n?.value?.contains!="function"||l?.target?.nodeType==null||G(l))return;const x=["scroll","wheel","touchmove"].includes(l?.type);i.showDropDown&&x&&i.parentMethods.closeList()}function G(l){const g=!!m.value?.contains(l?.target),x=!!n.value?.contains(l.target),P=[l?.srcElement?.id,l?.target?.id].includes("super-list-select-list");return g||x||P}function A(){R(),_()}function R(){if(m?.value==null)return;const l=m.value.getBoundingClientRect();f.value=l.top,u.value=window.innerHeight-l.bottom,D.value=l.width+"px"}function _(){if(m?.value==null||n?.value==null)return;const l=J().getBoundingClientRect(),g=n.value.getBoundingClientRect(),x=w.value,P=s.value;d.value?w.value=x-(l.top-g.bottom):w.value=x-(g.top-l.bottom),s.value=P-(g.left-l.left)}function U(){return(m?.value).getElementsByTagName("button")[0]}function J(){return m?.value}return e.onMounted(()=>{I=new le(V,U()),setTimeout(()=>V(void 0),250)}),e.onUnmounted(()=>{I?.unobserve()}),(l,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"dropDownButtonContainer",ref:m,class:"super-list-button-container"},[e.renderSlot(l.$slots,"default",{},void 0,!0)],512),e.createElementVNode("div",{id:"super-list-select-list",ref_key:"listContainerRef",ref:n,onMouseenter:g[0]||(g[0]=x=>t.parentMethods.mouseOverList()),tabindex:"-1",class:e.normalizeClass(["select-list",d.value?"list-reverse":"list-normal",{"select-list-open":t.showDropDown},{"no-scroll":b.value&&L.value},{"select-list-fixed":L.value},{"select-list-scrollable":!b.value}]),onKeydown:g[1]||(g[1]=e.withKeys(x=>N(x),["space"])),onMouseup:g[2]||(g[2]=e.withModifiers(x=>z(x),["left"])),onFocusout:g[3]||(g[3]=x=>Q(x))},[e.createElementVNode("ul",{tabindex:"-1",ref_key:"dropDownListUL",ref:y,class:"list-content"},[e.createVNode(ye,{filteredListItems:O.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-bb412ce9"]]),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 ie=E(xe,[["render",Ie]]),ke=["tabindex"],Te={key:2,class:"list-button-icon custom-icon"},se=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,h=e.ref(null);function i(){c.enableTextFilter||c.parentMethods.openList()}function m(f){c.enableTextFilter?(c.parentMethods.focusInput(),f.stopPropagation(),f.preventDefault()):c.parentMethods.press(f)}function y(f){c.enableTextFilter||c.parentMethods.press(f)}function n(){h?.value&&h.value.blur()}function s(){h?.value&&h.value.focus()}return r({blurInput:n,focusInput:s,buttonRef:h}),(f,u)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonRef",ref:h,tabindex:t.enableTextFilter?-1:0,onKeydown:[u[0]||(u[0]=e.withKeys(w=>m(w),["enter"])),u[1]||(u[1]=e.withKeys(w=>y(w),["space"])),u[2]||(u[2]=e.withKeys(w=>t.parentMethods.press(w),["esc"])),u[3]||(u[3]=e.withKeys(w=>t.parentMethods.press(w),["up"])),u[4]||(u[4]=e.withKeys(w=>t.parentMethods.press(w),["down"]))],onFocusout:u[5]||(u[5]=w=>t.parentMethods.unfocus(w)),onClick:u[6]||(u[6]=w=>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(ie,{"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(ie,{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},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},scrollTextInputToTopOnMobile:{type:Boolean,default:!0}},emits:{"update:selected":null},setup(t,{expose:r,emit:c}){const h=c,i=t,m=e.ref([]),y=new de,n=e.ref(0),s=e.computed(()=>i.forceTextFilterVisibilityTo!=null?i.forceTextFilterVisibilityTo:n.value>i.maxListOptions),f=e.ref(!1),u=e.ref(!1),w=e.ref(!1),D=e.ref(!0),L=e.ref(!1),O=e.ref(!1),v=e.ref(oe),d=e.ref(ne),b=e.ref(se),M=e.ref("");e.watch(()=>M.value,(o,a)=>{o!==a&&typeof i.options=="function"&&g(o)});const W=()=>{s.value&&d?.value?.blurInput()},N=()=>{clearTimeout(R),W(),M.value="",f.value=!1,D.value=!0},Q=e.computed(()=>O?.value===!0?"Error loading data":L?.value===!0?"Loading...":T(i.selected)),z=o=>{o&&h("update:selected",o),N()},T=o=>ae(o,i.customPlaceHolderFunction,i.objectLabelKeyName,i.enumKeyToLabelObjectArray);function H(){throw L.value=!0,O.value=!0,new Error("Invalid options argument provided to ListInputComponent")}function Z(){throw L.value=!0,O.value=!0,new Error("Invalid response provided to ListInputComponent, no total count key found")}function q(){throw L.value=!0,O.value=!0,new Error("Invalid objectLabelKeyName for provided Dropdown list value.")}e.onMounted(()=>{typeof i.options!="function"&&!Array.isArray(i.options)?H():J()});const S=e.ref(!1),j=e.ref(0),C=e.ref(0),F=e.ref(0);e.watch(()=>C.value,(o,a)=>{o!=a&&!u.value&&(F.value=o)},{immediate:!0}),e.watch(()=>u.value,o=>{o||(F.value=C.value)},{immediate:!0});const I=e.computed(()=>{if(typeof i.options=="function"&&!Array.isArray(i.options))return m.value;const o=M.value,a=m.value;return o===""?a:a.filter(p=>T(p).toLowerCase().includes(o.toLowerCase()))});e.watch(()=>I.value,(o,a)=>{JSON.stringify(o)!==JSON.stringify(a)&&$()},{immediate:!1,deep:!0});const Y=()=>{S.value=!0},$=()=>{const o=V();j.value=o,C.value=o>-1?o:0};function V(){if(i.selected==null)return-1;const o=I.value.map(p=>T(p)),a=o.filter(p=>p===T(i.selected));if(a.length>1){const p=a.map(k=>o.indexOf(k));for(let k=0;k<p.length;k++){const B=JSON.stringify(I.value[p[k]]),te=JSON.stringify(i.selected);if(B===te)return p[k]}return-1}return o.indexOf(T(i.selected))}const X=()=>{L.value||(f.value||(u.value=!1,$(),G(),f.value=!0),S.value=!1,D.value=!1)},G=()=>{const o=window?.innerWidth!=null&&window.innerWidth<640,a=screen?.width!=null&&screen.width<640,p=d.value.textInputRef;(o||a)&&s.value&&(_(),i.scrollTextInputToTopOnMobile&&p?.scrollIntoView({block:"start",inline:"center"}))},A=e.ref(!0);let R=setTimeout(()=>{},0);function _(){const o=d.value.textInputRef;if(!o)return;A.value=!1;let a=null;const p=()=>{a&&clearInterval(a),clearTimeout(R),setTimeout(()=>{A.value=!0},100)};R=setTimeout(p,5e3),a=setInterval(()=>{(f.value===!1||o?.scrollTop===0&&document.readyState==="complete")&&p()},100)}const U=()=>{s?.value==!0?d.value.focusInput():b?.value?.focusInput&&b?.value?.focusInput()};async function J(){typeof i.options=="function"?await g(M.value?M.value:void 0,!0):(x(i.options),n.value=m.value.length),l()}r({initializeOptions:J,getLabel:T});function l(){V()==-1&&m.value&&!!m.value[0]&&z(m.value[0])}async function g(o,a=!0){L.value=a;const p=async()=>i.options(i.maxListOptions,o||""),k=B=>{(!B||!("data"in B))&&H(),x(B.data),Ce(B?.data?.length??0).then(()=>{L.value=!1})};await y.resetAndExecute(p,k)}function x(o){Array.isArray(o)||H(),o.length>0&&typeof o[0]=="object"&&P(o),m.value=o}function P(o){(!i.objectLabelKeyName||i.objectLabelKeyName.length===0)&&q();const a=i.objectLabelKeyName;for(let p=0;p<o.length;p++)(typeof o[p]!="object"||!(a in o[p]))&&q()}async function Ce(o){const a=async()=>i.options(1,""),p=k=>{(!k||!("totalNum"in k))&&Z(),n.value=k.totalNum??o};await y.resetAndExecute(a,p)}const re=()=>d?.value?.textInputRef?.getElementsByTagName("li")[C.value]??null,De=o=>{f.value==!1?X():o&&Oe(o)},Oe=o=>{const a=o.key||o.code;(a==="Tab"||a==="Escape")&&N(),a==="ArrowDown"&&Be(o),a==="ArrowUp"&&Ee(o),(a==="Enter"||a===" ")&&Me(),o.preventDefault(),o.stopPropagation()},Me=()=>{I.value.length>0?(u.value=!0,z(I.value[C.value])):N()},Be=o=>{D.value=!0,C.value<I.value.length-1&&(o.preventDefault(),S.value=!1,C.value++,re()?.focus())},Ee=o=>{D.value=!0,C.value>0&&(o.preventDefault(),S.value=!1,C.value--,re()?.focus())},ee={openList:X,unfocus:o=>{if(f?.value===!1)return;M.value.length>0&&(u.value=!0);const a=v?.value?.listContainerRef,p=d?.value?.textInputRef,k=b?.value?.buttonRef,B=o?.relatedTarget&&p?.isEqualNode(o?.relatedTarget),te=a?.contains(o?.relatedTarget)||k?.isEqualNode(o.relatedTarget),Ne=o?.relatedTarget&&a&&a.isEqualNode(o?.relatedTarget);te||B||(Ne?U():N())},press:De,mouseOverList:Y,getLabel:T,updatedSelected:z,focusInput:U,closeList:N};return(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative"},class:e.normalizeClass(o.$attrs.class)},[e.createVNode(oe,{ref_key:"itemListRef",ref:v,"show-drop-down":f.value,filteredListItems:I.value,mouseHoveringOnList:S.value,focusedIndex:F.value,selectedIndex:j.value,"max-list-height-p-x":t.maxListHeightPX,"list-animation-duration-ms":t.listAnimationDurationMs,"parent-methods":ee,blockListChange:u.value,"onUpdate:blockListChange":a[1]||(a[1]=p=>u.value=p),"total-options-count":n.value,onReverseDropDownList:a[2]||(a[2]=p=>w.value=p),enableScrollClose:A.value},{default:e.withCtx(()=>[e.createVNode(se,{ref_key:"dropDownButtonInput",ref:b,"parent-methods":ee,"show-drop-down":f.value,"enable-text-filter":s.value,"custom-icon":t.customIcon,"reverse-drop-down-list":w.value},{default:e.withCtx(()=>[e.createVNode(ne,{ref_key:"dropDownTextInput",ref:d,"enable-text-filter":s.value,"show-drop-down":f.value,placeholder:Q.value,"enable-button-click":D.value,"parent-methods":ee,"onUpdate:query":a[0]||(a[0]=p=>M.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-c7006a45"]])});
|
|
1
|
+
(function(e,K){typeof exports=="object"&&typeof module<"u"?module.exports=K(require("vue")):typeof define=="function"&&define.amd?define(["vue"],K):(e=typeof globalThis<"u"?globalThis:e||self,e.SuperList=K(e.Vue))})(this,function(e){"use strict";var K=document.createElement("style");K.textContent=`.list-filter-text-input[data-v-edeb41fa]{color:var(--superlist-text-colour, rgb(17, 24, 39));text-align:center;padding:.125rem 2rem .125rem .5rem;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-edeb41fa]:focus,.list-filter-text-input[data-v-edeb41fa]:focus-visible,.list-filter-text-input[data-v-edeb41fa]:active{text-align:left}.click-through[data-v-edeb41fa]{pointer-events:none}.dark-placeholder-text[data-v-edeb41fa]::placeholder{color:var(--superlist-text-colour, rgb(17, 24, 39))}.light-placeholder-text[data-v-edeb41fa]::placeholder{color:var(--superlist-disabled-text-colour, rgb(120, 125, 130))}.text-filter-disabled[data-v-edeb41fa]{background-color:transparent;border:none;outline:none;box-shadow:none;filter:none}@media (min-width: 640px){.list-filter-text-input[data-v-edeb41fa]{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-bb412ce9]{top:var(--parent-y)}.list-reverse[data-v-bb412ce9]{bottom:var(--parent-y)}.select-list[data-v-bb412ce9]{--parent-width: var(--v15890c8c);--parent-x: var(--v4338b9be);--parent-y: var(--v4338bd7f);--duration: var(--v6e74f140);--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-bb412ce9]:focus-visible,.select-list>ul[data-v-bb412ce9]:focus-visible,.super-list-button-container[data-v-bb412ce9]:focus-visible{outline:none}.super-list-button-container[data-v-bb412ce9]{height:100%;width:100%}.select-list.select-list-open[data-v-bb412ce9]{z-index:999999;--max-height: var(--v4db56ff9);max-height:var(--max-height, 0)}.select-list.no-scroll[data-v-bb412ce9]{overflow:hidden}.select-list-fixed[data-v-bb412ce9]{position:fixed;opacity:1;visibility:visible}.list-content[data-v-bb412ce9]{--duration: var(--v6e74f140);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-bb412ce9]{border-radius:var(--border-radius)}.select-list[data-v-bb412ce9]:not(.select-list-fixed){transition:none;box-shadow:none!important}@media (min-width: 640px){.select-list.select-list-scrollable[data-v-bb412ce9]{border-radius:var(--border-radius) 0 0 var(--border-radius)}.list-content[data-v-bb412ce9]{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-55c6d2bd]{box-sizing:border-box}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(K);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=h=>r(h),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,h){return r!=null?r(t):t==null?"":typeof t=="object"?t[c]:h?ue(t,h):""+t}function ue(t,r){return r.find(c=>c.type===t)?.label??""}class de{constructor(){this.abortController=new AbortController,this.func=()=>{},this.then=()=>{}}async abortablePromise(r,c,h){const i=await c();if(!r.aborted)return h(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 ce=["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 h=c,i=t,m=e.ref(null);function y(g){const d=m?.value,b=g?.target??null;!(d!==null&&d.isEqualNode(b))&&"sourceCapabilities"in g&&g.sourceCapabilities==null?i.parentMethods.closeList():i.parentMethods.openList()}function n(g){i.parentMethods.unfocus(g)}let s="";function f(g){g?.target?.value!=null&&g?.target?.value!==s&&h("update:query",g.target.value),s=g?.target?.value??""}const u=e.computed(()=>{const g=m?.value?m.value.length:0,d=i.placeholder?.length||0;return g>0?g:d>0?d:5}),w=e.computed(()=>i.enableButtonClick===!0&&i.enableTextFilter===!0?"":"click-through"),D=e.computed(()=>i.showDropDown&&!i.enableTextFilter||!i.showDropDown?"dark-placeholder-text":"light-placeholder-text");function L(){if(m?.value){const g=m.value;g.blur(),g.value=""}}function O(){m?.value&&m.value.focus()}return r({blurInput:L,focusInput:O,textInputRef:m}),(g,d)=>(e.openBlock(),e.createElementBlock("form",{onSubmit:d[10]||(d[10]=e.withModifiers(()=>{},["prevent"])),style:{display:"contents !important"}},[e.createElementVNode("input",{ref_key:"textInputRef",ref:m,tabindex:t.enableTextFilter?0:-1,onKeydown:[d[0]||(d[0]=e.withKeys(b=>t.parentMethods.press(b),["enter"])),d[1]||(d[1]=e.withKeys(b=>t.parentMethods.press(),["space"])),d[2]||(d[2]=e.withKeys(b=>t.parentMethods.press(b),["esc"])),d[3]||(d[3]=e.withKeys(b=>t.parentMethods.press(b),["up"])),d[4]||(d[4]=e.withKeys(b=>t.parentMethods.press(b),["down"]))],onFocusin:d[5]||(d[5]=b=>y(b)),onFocusout:d[6]||(d[6]=b=>n(b)),onInput:d[7]||(d[7]=b=>f(b)),onChange:d[8]||(d[8]=b=>f(b)),onPaste:d[9]||(d[9]=b=>f(b)),type:"text","aria-autocomplete":"none",autocomplete:"off",placeholder:t.placeholder,size:u.value,class:e.normalizeClass([[w.value,D.value,{"text-filter-disabled":!t.enableTextFilter}],"list-filter-text-input"])},null,42,ce)],32))}}),E=(t,r)=>{const c=t.__vccOpts||t;for(const[h,i]of r)c[h]=i;return c},ne=E(fe,[["__scopeId","data-v-edeb41fa"]]),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]]),ge=["onMousedown"],ve={class:"list-item-span"},we={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"),h=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,()=>m()),e.watch(()=>h.value,()=>m());function i(){!r.showDropDown||!h?.value?.parentElement?.parentElement||(h.value.parentElement.parentElement.scrollTop=h.value.offsetTop)}function m(){const y=h.value,n=y?.parentElement?.parentElement;if(!r.showDropDown||!y||!n)return;const s=y.offsetTop-n.scrollTop<0,f=y.offsetTop+y.offsetHeight-n.scrollTop>n.clientHeight;s&&(n.scrollTop=y.offsetTop),f&&(n.scrollTop=y.offsetTop+y.clientHeight-n.clientHeight)}return(y,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(u=>t.parentMethods.press(u),["enter"])),n[1]||(n[1]=e.withKeys(u=>t.parentMethods.press(u),["space"])),n[2]||(n[2]=e.withKeys(u=>t.parentMethods.press(u),["esc"]))],onKeydown:[n[3]||(n[3]=e.withKeys(u=>t.parentMethods.press(u),["up"])),n[4]||(n[4]=e.withKeys(u=>t.parentMethods.press(u),["down"]))],onFocusout:n[5]||(n[5]=u=>t.parentMethods.unfocus(u)),tabindex:"-1",onMousedown:e.withModifiers(u=>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",ve,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,ge))),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",we," +"+e.toDisplayString(t.totalOptionsCount-t.filteredListItems?.length||0)+" More Items...",1)],32)):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-e4eeb2f7"]]),oe=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:r,emit:c}){e.useCssVars(a=>({v15890c8c:D.value,v4338b9be:M.value,v4338bd7f:W.value,v6e74f140:j.value,v4db56ff9:S.value}));const h=c,i=t,m=e.ref(null),y=e.ref(null),n=e.ref(null),s=e.ref(0),f=e.ref(0),u=e.ref(0),w=e.ref(0),D=e.ref("0px"),L=e.ref(!1),O=e.ref([]),g=e.ref(0),d=e.computed(()=>!L.value||window?.innerHeight==null?!1:Z()&&q()),b=e.computed(()=>i.maxListHeightPX>=g.value);e.watch(()=>d.value,a=>h("reverseDropDownList",a),{immediate:!0});const M=e.computed(()=>s.value+"px"),W=e.computed(()=>w.value+"px");r({listContainerRef:n});const N=a=>{a?.key&&a.key===" "&&a.preventDefault()},Q=a=>{i.parentMethods.unfocus(a)},z=a=>{const v=n?.value,x=a.target;(!(v&&x&&v.contains(x))||v.isEqualNode(x))&&i.parentMethods.focusInput()};function T(){return y?.value?(y?.value).clientHeight:0}function H(){if(!L.value||T()===0)return i.maxListHeightPX;const a=T()===0?i.maxListHeightPX:+T();return i.maxListHeightPX&&i.maxListHeightPX>a?a:i.maxListHeightPX}function Z(){return f.value>H()}function q(){return u.value<H()}const S=e.computed(()=>(i.maxListHeightPX||0)+"px"),j=e.computed(()=>(i.listAnimationDurationMs||0)+"ms"),C=e.computed(()=>i.blockListChange?O.value:i.filteredListItems);e.watch(()=>C,a=>{a&&(O.value=a.value)},{immediate:!1,deep:!0});let F=setTimeout(()=>{},0),k=null;function Y(){g.value=T(),clearTimeout(F),k&&k.observe(),L.value=!0,V(void 0)}function $(){clearTimeout(F),F=setTimeout(()=>{i.showDropDown||(L.value=!1,k&&k.unobserve())},i.listAnimationDurationMs+50)}e.watch(()=>i.showDropDown,(a,v)=>{a!==v&&(A(),a?Y():$())},{immediate:!0});function V(a){A(),e.nextTick(()=>A()),X(a)}function X(a){if(!i.enableScrollClose||!i.showDropDown||typeof n?.value?.contains!="function"||a?.target?.nodeType==null||G(a))return;const x=["scroll","wheel","touchmove"].includes(a?.type);i.showDropDown&&x&&i.parentMethods.closeList()}function G(a){const v=!!m.value?.contains(a?.target),x=!!n.value?.contains(a.target),P=[a?.srcElement?.id,a?.target?.id].includes("super-list-select-list");return v||x||P}function A(){R(),_()}function R(){if(m?.value==null)return;const a=m.value.getBoundingClientRect();f.value=a.top,u.value=window.innerHeight-a.bottom,D.value=a.width+"px"}function _(){if(m?.value==null||n?.value==null)return;const a=J().getBoundingClientRect(),v=n.value.getBoundingClientRect(),x=w.value,P=s.value;d.value?w.value=x-(a.top-v.bottom):w.value=x-(v.top-a.bottom),s.value=P-(v.left-a.left)}function U(){return(m?.value).getElementsByTagName("button")[0]}function J(){return m?.value}return e.onMounted(()=>{k=new le(V,U()),setTimeout(()=>V(void 0),250)}),e.onUnmounted(()=>{k?.unobserve()}),(a,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"dropDownButtonContainer",ref:m,class:"super-list-button-container"},[e.renderSlot(a.$slots,"default",{},void 0,!0)],512),e.createElementVNode("div",{id:"super-list-select-list",ref_key:"listContainerRef",ref:n,onMouseenter:v[0]||(v[0]=x=>t.parentMethods.mouseOverList()),tabindex:"-1",class:e.normalizeClass(["select-list",d.value?"list-reverse":"list-normal",{"select-list-open":t.showDropDown},{"no-scroll":b.value&&L.value},{"select-list-fixed":L.value},{"select-list-scrollable":!b.value}]),onKeydown:v[1]||(v[1]=e.withKeys(x=>N(x),["space"])),onMouseup:v[2]||(v[2]=e.withModifiers(x=>z(x),["left"])),onFocusout:v[3]||(v[3]=x=>Q(x))},[e.createElementVNode("ul",{tabindex:"-1",ref_key:"dropDownListUL",ref:y,class:"list-content"},[e.createVNode(ye,{filteredListItems:O.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-bb412ce9"]]),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 ie=E(xe,[["render",Ie]]),ke=["tabindex"],Te={key:2,class:"list-button-icon custom-icon"},se=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,h=e.ref(null);function i(){c.enableTextFilter||c.parentMethods.openList()}function m(f){c.enableTextFilter?(c.parentMethods.focusInput(),f.stopPropagation(),f.preventDefault()):c.parentMethods.press(f)}function y(f){c.enableTextFilter||c.parentMethods.press(f)}function n(){h?.value&&h.value.blur()}function s(){h?.value&&h.value.focus()}return r({blurInput:n,focusInput:s,buttonRef:h}),(f,u)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonRef",ref:h,tabindex:t.enableTextFilter?-1:0,onKeydown:[u[0]||(u[0]=e.withKeys(w=>m(w),["enter"])),u[1]||(u[1]=e.withKeys(w=>y(w),["space"])),u[2]||(u[2]=e.withKeys(w=>t.parentMethods.press(w),["esc"])),u[3]||(u[3]=e.withKeys(w=>t.parentMethods.press(w),["up"])),u[4]||(u[4]=e.withKeys(w=>t.parentMethods.press(w),["down"]))],onFocusout:u[5]||(u[5]=w=>t.parentMethods.unfocus(w)),onClick:u[6]||(u[6]=w=>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(ie,{"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(ie,{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},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},scrollTextInputToTopOnMobile:{type:Boolean,default:!0}},emits:{"update:selected":null},setup(t,{expose:r,emit:c}){const h=c,i=t,m=e.ref([]),y=new de,n=e.ref(0),s=e.computed(()=>i.forceTextFilterVisibilityTo!=null?i.forceTextFilterVisibilityTo:n.value>i.maxListOptions),f=e.ref(!1),u=e.ref(!1),w=e.ref(!1),D=e.ref(!0),L=e.ref(!1),O=e.ref(!1),g=e.ref(oe),d=e.ref(ne),b=e.ref(se),M=e.ref("");e.watch(()=>M.value,(o,l)=>{o!==l&&typeof i.options=="function"&&v(o)});const W=()=>{s.value&&d?.value?.blurInput()},N=()=>{clearTimeout(R),W(),M.value="",f.value=!1,D.value=!0},Q=e.computed(()=>O?.value===!0?"Error loading data":L?.value===!0?"Loading...":T(i.selected)),z=o=>{o&&h("update:selected",o),N()},T=o=>ae(o,i.customPlaceHolderFunction,i.objectLabelKeyName,i.enumKeyToLabelObjectArray);function H(){throw L.value=!0,O.value=!0,new Error("Invalid options argument provided to ListInputComponent")}function Z(){throw L.value=!0,O.value=!0,new Error("Invalid response provided to ListInputComponent, no total count key found")}function q(){throw L.value=!0,O.value=!0,new Error("Invalid objectLabelKeyName for provided Dropdown list value.")}e.onMounted(()=>{typeof i.options!="function"&&!Array.isArray(i.options)?H():J()});const S=e.ref(!1),j=e.ref(0),C=e.ref(0),F=e.ref(0);e.watch(()=>C.value,(o,l)=>{o!=l&&!u.value&&(F.value=o)},{immediate:!0}),e.watch(()=>u.value,o=>{o||(F.value=C.value)},{immediate:!0});const k=e.computed(()=>{if(typeof i.options=="function"&&!Array.isArray(i.options))return m.value;const o=M.value,l=m.value;return o===""?l:l.filter(p=>T(p).toLowerCase().includes(o.toLowerCase()))});e.watch(()=>k.value,(o,l)=>{JSON.stringify(o)!==JSON.stringify(l)&&$()},{immediate:!1,deep:!0});const Y=()=>{S.value=!0},$=()=>{const o=V();j.value=o,C.value=o>-1?o:0};function V(){if(i.selected==null)return-1;const o=k.value.map(p=>T(p)),l=o.filter(p=>p===T(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(k.value[p[I]]),te=JSON.stringify(i.selected);if(B===te)return p[I]}return-1}return o.indexOf(T(i.selected))}const X=()=>{L.value||(f.value||(u.value=!1,$(),G(),f.value=!0),S.value=!1,D.value=!1)},G=()=>{const o=window?.innerWidth!=null&&window.innerWidth<640,l=screen?.width!=null&&screen.width<640,p=d.value.textInputRef;(o||l)&&s.value&&(_(),i.scrollTextInputToTopOnMobile&&p?.scrollIntoView({block:"start",inline:"center"}))},A=e.ref(!0);let R=setTimeout(()=>{},0);function _(){const o=d.value.textInputRef;if(!o)return;A.value=!1;let l=null;const p=()=>{l&&clearInterval(l),clearTimeout(R),setTimeout(()=>{A.value=!0},100)};R=setTimeout(p,5e3),l=setInterval(()=>{(f.value===!1||o?.scrollTop===0&&document.readyState==="complete")&&p()},100)}const U=()=>{s?.value==!0?d.value.focusInput():b?.value?.focusInput&&b?.value?.focusInput()};async function J(){typeof i.options=="function"?await v(M.value?M.value:void 0,!0):(x(i.options),n.value=m.value.length),a()}r({initializeOptions:J,getLabel:T});function a(){V()==-1&&m.value&&!!m.value[0]&&z(m.value[0])}async function v(o,l=!0){L.value=l;const p=async()=>i.options(i.maxListOptions,o||""),I=B=>{(!B||!("data"in B))&&H(),x(B.data),Ce(B?.data?.length??0).then(()=>{L.value=!1})};await y.resetAndExecute(p,I)}function x(o){Array.isArray(o)||H(),o.length>0&&typeof o[0]=="object"&&P(o),m.value=o}function P(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()}async function Ce(o){const l=async()=>i.options(1,""),p=I=>{(!I||!("totalNum"in I))&&Z(),n.value=I.totalNum??o};await y.resetAndExecute(l,p)}const re=()=>d?.value?.textInputRef?.getElementsByTagName("li")[C.value]??null,De=o=>{f.value==!1?X():o&&Oe(o)},Oe=o=>{const l=o.key||o.code;(l==="Tab"||l==="Escape")&&N(),l==="ArrowDown"&&Be(o),l==="ArrowUp"&&Ee(o),(l==="Enter"||l===" ")&&Me(),o.preventDefault(),o.stopPropagation()},Me=()=>{k.value.length>0?(u.value=!0,z(k.value[C.value])):N()},Be=o=>{D.value=!0,C.value<k.value.length-1&&(o.preventDefault(),S.value=!1,C.value++,re()?.focus())},Ee=o=>{D.value=!0,C.value>0&&(o.preventDefault(),S.value=!1,C.value--,re()?.focus())},ee={openList:X,unfocus:o=>{if(f?.value===!1)return;M.value.length>0&&(u.value=!0);const l=g?.value?.listContainerRef,p=d?.value?.textInputRef,I=b?.value?.buttonRef,B=o?.relatedTarget&&p?.isEqualNode(o?.relatedTarget),te=o?.relatedTarget&&l&&l.contains(o?.relatedTarget),Ne=o?.relatedTarget&&I&&I.isEqualNode(o.relatedTarget),Se=te||Ne,Fe=o?.relatedTarget&&l&&l.isEqualNode(o?.relatedTarget);Se||B||(Fe?U():N())},press:De,mouseOverList:Y,getLabel:T,updatedSelected:z,focusInput:U,closeList:N};return(o,l)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative"},class:e.normalizeClass(o.$attrs.class)},[e.createVNode(oe,{ref_key:"itemListRef",ref:g,"show-drop-down":f.value,filteredListItems:k.value,mouseHoveringOnList:S.value,focusedIndex:F.value,selectedIndex:j.value,"max-list-height-p-x":t.maxListHeightPX,"list-animation-duration-ms":t.listAnimationDurationMs,"parent-methods":ee,blockListChange:u.value,"onUpdate:blockListChange":l[1]||(l[1]=p=>u.value=p),"total-options-count":n.value,onReverseDropDownList:l[2]||(l[2]=p=>w.value=p),enableScrollClose:A.value},{default:e.withCtx(()=>[e.createVNode(se,{ref_key:"dropDownButtonInput",ref:b,"parent-methods":ee,"show-drop-down":f.value,"enable-text-filter":s.value,"custom-icon":t.customIcon,"reverse-drop-down-list":w.value},{default:e.withCtx(()=>[e.createVNode(ne,{ref_key:"dropDownTextInput",ref:d,"enable-text-filter":s.value,"show-drop-down":f.value,placeholder:Q.value,"enable-button-click":D.value,"parent-methods":ee,"onUpdate:query":l[0]||(l[0]=p=>M.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-55c6d2bd"]])});
|
|
3
3
|
//# sourceMappingURL=super-list.umd.cjs.map
|