{"version":3,"file":"dropDownList.obs.js","sources":["../../../Framework/Controls/dropDownList.obs"],"sourcesContent":["<!-- Copyright by the Spark Development Network; Licensed under the Rock Community License -->\r\n<template>\r\n <RockFormField\r\n v-bind=\"standardFieldProps\"\r\n :modelValue=\"internalValue\"\r\n :formGroupClasses=\"'rock-drop-down-list ' + formGroupClasses\"\r\n name=\"dropdownlist\">\r\n <template #default=\"{ uniqueId, field }\">\r\n <div ref=\"controlWrapper\" class=\"control-wrapper\">\r\n <slot name=\"prepend\" :isInputGroupSupported=\"true\" />\r\n <div :class=\"{ 'input-group': $slots.inputGroupPrepend || $slots.inputGroupAppend }\">\r\n <slot name=\"inputGroupPrepend\" :isInputGroupSupported=\"true\" />\r\n <AntSelect\r\n v-model:value=\"internalValue\"\r\n v-bind=\"field\"\r\n class=\"form-control\"\r\n :class=\"inputClasses\"\r\n :allowClear=\"isClearable\"\r\n :loading=\"computedLoading\"\r\n :disabled=\"isDisabled\"\r\n :options=\"computedOptions\"\r\n :showSearch=\"enhanceForLongLists\"\r\n :filterOption=\"filterItem\"\r\n :mode=\"mode\"\r\n :getPopupContainer=\"getPopupContainer\"\r\n showArrow\r\n @dropdownVisibleChange=\"onDropdownVisibleChange\">\r\n <template #clearIcon>\r\n <i class=\"fa fa-times\"></i>\r\n </template>\r\n\r\n <template #suffixIcon>\r\n <i v-if=\"!computedLoading\" class=\"fa fa-caret-down\"></i>\r\n <i v-else class=\"fa fa-spinner fa-spin\"></i>\r\n </template>\r\n\r\n <template #notFoundContent>\r\n <div style=\"color:#999\">\r\n <slot name=\"empty\">No Data</slot>\r\n </div>\r\n </template>\r\n\r\n <template #dropdownRender=\"{ menuNode: menu }\">\r\n <div v-if=\"computedLoading\" class=\"text-center\"><i class=\"fa fa-spinner fa-spin\"></i> Data is loading...</div>\r\n <v-nodes v-else :vnodes=\"menu\" />\r\n </template>\r\n </AntSelect>\r\n <slot name=\"inputGroupAppend\" :isInputGroupSupported=\"true\" />\r\n </div>\r\n <slot name=\"append\" :isInputGroupSupported=\"true\" />\r\n </div>\r\n </template>\r\n </RockFormField>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n import { computed, PropType, ref, watch } from \"vue\";\r\n import { Select as AntSelect } from \"ant-design-vue\";\r\n import { ListItemBag } from \"@Obsidian/ViewModels/Utility/listItemBag\";\r\n import RockFormField from \"./rockFormField.obs\";\r\n import { deepEqual } from \"@Obsidian/Utility/util\";\r\n import { standardRockFormFieldProps, updateRefValue, useStandardRockFormFieldProps } from \"@Obsidian/Utility/component\";\r\n import { defaultControlCompareValue } from \"@Obsidian/Utility/stringUtils\";\r\n\r\n /** The type definition for a select option, since the ones from the library are wrong. */\r\n type SelectOption = {\r\n value?: string;\r\n label: string;\r\n disabled?: boolean;\r\n options?: SelectOption[];\r\n };\r\n\r\n const vNodes = (_: unknown, { attrs }): unknown => {\r\n return attrs.vnodes;\r\n };\r\n\r\n const props = defineProps({\r\n modelValue: {\r\n type: Object as PropType<string | string[]>,\r\n required: true\r\n },\r\n\r\n items: {\r\n type: Array as PropType<ListItemBag[]>,\r\n default: []\r\n },\r\n\r\n showBlankItem: {\r\n type: Boolean as PropType<boolean>,\r\n default: true\r\n },\r\n\r\n blankValue: {\r\n type: String as PropType<string>,\r\n default: \"\"\r\n },\r\n\r\n multiple: {\r\n type: Boolean as PropType<boolean>,\r\n default: false\r\n },\r\n\r\n /** No longer used. */\r\n formControlClasses: {\r\n type: String as PropType<string>,\r\n default: \"\"\r\n },\r\n\r\n inputClasses: {\r\n type: String as PropType<string>,\r\n default: \"\"\r\n },\r\n\r\n enhanceForLongLists: {\r\n type: Boolean as PropType<boolean>,\r\n default: false\r\n },\r\n\r\n grouped: {\r\n type: Boolean as PropType<boolean>,\r\n default: false\r\n },\r\n\r\n disabled: {\r\n type: Boolean as PropType<boolean>,\r\n default: false\r\n },\r\n\r\n loading: {\r\n type: Boolean as PropType<boolean>,\r\n default: false\r\n },\r\n\r\n compareValue: {\r\n type: Function as PropType<((value: string, itemValue: string) => boolean)>,\r\n default: defaultControlCompareValue\r\n },\r\n\r\n ...standardRockFormFieldProps\r\n });\r\n\r\n const emit = defineEmits<{\r\n (e: \"open\"): void;\r\n (e: \"update:modelValue\", value: string | string[]): void;\r\n }>();\r\n\r\n // #region Values\r\n\r\n const internalValue = ref(props.modelValue ? props.modelValue : null);\r\n const controlWrapper = ref<HTMLElement | null>(null);\r\n const standardFieldProps = useStandardRockFormFieldProps(props);\r\n\r\n // #endregion\r\n\r\n // #region Computed Values\r\n\r\n /** Determines if the blank item should be used. */\r\n const computedShowBlankItem = computed((): boolean => {\r\n // Only show the blank item if requested and we are not in multiple\r\n // selection mode.\r\n return !props.multiple && props.showBlankItem;\r\n });\r\n\r\n /** The options to be used by the Ant Select box. */\r\n const computedOptions = computed((): SelectOption[] => {\r\n // If we are not showing grouped items then simply map our item bags\r\n // into a format that can be used by the picker.\r\n if (!props.grouped) {\r\n return props.items.map((o): SelectOption => {\r\n return {\r\n value: o.value ?? \"\",\r\n label: o.text ?? \"\",\r\n disabled: o.disabled ?? false\r\n };\r\n });\r\n }\r\n\r\n const groupedOptions: SelectOption[] = [];\r\n\r\n // Loop through all the options and group everything that has a\r\n // category together.\r\n for (const o of props.items) {\r\n // If no category then just include it as a regular item.\r\n if (!o.category) {\r\n groupedOptions.push({\r\n value: o.value ?? \"\",\r\n label: o.text ?? \"\",\r\n disabled: o.disabled ?? false\r\n });\r\n continue;\r\n }\r\n\r\n const matchedGroups = groupedOptions.filter(g => g.label === o.category && !!g.options);\r\n\r\n // If we found an existing group then just add this item to\r\n // that group. Otherwise create a new group for this item.\r\n if (matchedGroups.length >= 1 && !!matchedGroups[0].options) {\r\n matchedGroups[0].options.push({\r\n value: o.value ?? \"\",\r\n label: o.text ?? \"\",\r\n disabled: o.disabled ?? false\r\n });\r\n }\r\n else {\r\n groupedOptions.push({\r\n label: o.category,\r\n options: [{\r\n value: o.value ?? \"\",\r\n label: o.text ?? \"\",\r\n disabled: o.disabled ?? false\r\n }]\r\n });\r\n }\r\n }\r\n\r\n return groupedOptions;\r\n });\r\n\r\n /** Determines if the control is currently in a loading state. */\r\n const computedLoading = computed((): boolean => {\r\n return props.loading;\r\n });\r\n\r\n /** The mode for the Ant Select control to operate in. */\r\n const mode = computed((): \"multiple\" | undefined => {\r\n return props.multiple ? \"multiple\" : undefined;\r\n });\r\n\r\n /** Determines if we have any selected values. */\r\n const hasValue = computed((): boolean => {\r\n if (Array.isArray(internalValue.value)) {\r\n return internalValue.value.length > 0;\r\n }\r\n else {\r\n return internalValue.value !== \"\";\r\n }\r\n });\r\n\r\n /** Determines if the clear icon should be visible. */\r\n const isClearable = computed((): boolean => {\r\n return computedShowBlankItem.value && !computedLoading.value && hasValue.value && internalValue.value !== props.blankValue;\r\n });\r\n\r\n /** Determines if the control should be in a disabled state. */\r\n const isDisabled = computed((): boolean => {\r\n return props.disabled;\r\n });\r\n\r\n // #endregion\r\n\r\n // #region Functions\r\n\r\n /**\r\n * Synchronizes our internal value with the modelValue and current\r\n * component property values.\r\n */\r\n const syncInternalValue = (): void => {\r\n let value: string | string[] | null = props.modelValue;\r\n\r\n if (props.multiple) {\r\n // We are in multiple mode, if our value is a single value then\r\n // convert it to an array of the one value.\r\n if (!Array.isArray(value)) {\r\n value = value === \"\" ? [] : [value];\r\n }\r\n\r\n // Ensure they are all valid values and make sure they are the\r\n // correct matching value from the item rather than what was\r\n // originally provided.\r\n value = props.items\r\n .filter(o => (value as string[]).some(v => props.compareValue(v, o.value ?? \"\")))\r\n .map(o => o.value ?? \"\");\r\n }\r\n else {\r\n // We are in single mode, if our value is an array of values then\r\n // convert it to a single value by taking the first value.\r\n if (Array.isArray(value)) {\r\n value = value.length === 0 ? null : value[0];\r\n }\r\n\r\n // If no value is selected, then take either the blank value\r\n // or the first value in the list.\r\n if (value === null) {\r\n value = computedShowBlankItem.value\r\n ? props.blankValue\r\n : (props.items[0]?.value || props.blankValue);\r\n }\r\n\r\n // Ensure it is a valid value, if not then set it to either the\r\n // blank value or the first value in the list.\r\n const selectedOption = props.items.find(o => props.compareValue(value as string, o.value ?? \"\")) || null;\r\n\r\n if (!selectedOption) {\r\n value = computedShowBlankItem.value\r\n ? props.blankValue\r\n : (props.items[0]?.value || props.blankValue);\r\n }\r\n else {\r\n value = selectedOption.value ?? \"\";\r\n }\r\n }\r\n\r\n updateRefValue(internalValue, value);\r\n };\r\n\r\n /**\r\n * Determines if a single option should be included during a search\r\n * operation.\r\n *\r\n * @param input The search string typed by the individual.\r\n * @param option The option to be filtered.\r\n *\r\n * @returns true if the option should be included in the list, otherwise false.\r\n */\r\n const filterItem = (input: string, option: SelectOption): boolean => {\r\n return (option.label || \"\").toLocaleLowerCase().indexOf(input.toLocaleLowerCase()) >= 0;\r\n };\r\n\r\n /**\r\n * Gets the element that will contain the popup. By default this is the\r\n * document body, but that breaks if the user is viewing the page\r\n * fullscreen via one of the panel fullscreen buttons.\r\n *\r\n * @returns The HTML element to place the popup into.\r\n */\r\n const getPopupContainer = (): HTMLElement => {\r\n return controlWrapper.value ?? document.body;\r\n };\r\n\r\n // #endregion\r\n\r\n // #region Event Handlers\r\n\r\n const onDropdownVisibleChange = (open: boolean): void => {\r\n if (open) {\r\n emit(\"open\");\r\n }\r\n };\r\n\r\n // #endregion\r\n\r\n watch([() => props.modelValue, computedShowBlankItem, () => props.multiple, () => props.items], () => {\r\n syncInternalValue();\r\n });\r\n\r\n // Watch for changes to the selection made in the UI and then make\r\n // make sure its in the right format and valid.\r\n watch(internalValue, () => {\r\n let newValue = internalValue.value;\r\n\r\n if (props.multiple) {\r\n // We are in multiple select mode, but if we have a non-array\r\n // value then convert it to an array.\r\n if (!Array.isArray(newValue)) {\r\n newValue = newValue === null ? [] : [newValue];\r\n }\r\n }\r\n else {\r\n // We are in single select mode, but if we have an array\r\n // value then convert it to a single item.\r\n if (Array.isArray(newValue)) {\r\n newValue = newValue.length === 0 ? null : newValue[0];\r\n }\r\n\r\n // Ensure that single item is valid.\r\n if (newValue === null) {\r\n newValue = computedShowBlankItem.value\r\n ? props.blankValue\r\n : (props.items[0]?.value || props.blankValue);\r\n }\r\n }\r\n\r\n // If the value hasn't changed, then emit the new value. Normally\r\n // we wouldn't have to do this check, but when emitting complex\r\n // things like an array it can sometimes cause unwanted loops if\r\n // we don't.\r\n if (!deepEqual(props.modelValue, newValue, true)) {\r\n emit(\"update:modelValue\", newValue);\r\n }\r\n });\r\n\r\n syncInternalValue();\r\n</script>\r\n"],"names":["vNodes","_","_ref2","attrs","vnodes","internalValue","ref","props","modelValue","controlWrapper","standardFieldProps","useStandardRockFormFieldProps","computedShowBlankItem","computed","multiple","showBlankItem","computedOptions","grouped","items","map","o","_o$value","_o$text","_o$disabled","value","label","text","disabled","groupedOptions","_iterator","_createForOfIteratorHelper","_step","_loop","category","_o$value2","_o$text2","_o$disabled2","push","matchedGroups","filter","g","options","length","_o$value3","_o$text3","_o$disabled3","_o$value4","_o$text4","_o$disabled4","s","n","done","_ret","err","e","f","computedLoading","loading","mode","undefined","hasValue","Array","isArray","isClearable","blankValue","isDisabled","syncInternalValue","some","v","_o$value5","compareValue","_o$value6","_props$items$","selectedOption","find","_o$value7","_props$items$2","_selectedOption$value","updateRefValue","filterItem","input","option","toLocaleLowerCase","indexOf","getPopupContainer","_controlWrapper$value","document","body","onDropdownVisibleChange","open","emit","watch","newValue","_props$items$3","deepEqual"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwEI,IAAA,IAAMA,MAAM,GAAGA,CAACC,CAAU,EAAAC,KAAA,KAAyB;MAAA,MAAA,IAArBC,KAAK,GAAAD,KAAA,CAALC,KAAK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