bitboss-ui 0.2.17 → 0.2.19
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/dist/components/BaseSelect/BaseSelect.vue.d.ts +7 -0
- package/dist/components/BbPopover/BbPopover.vue.d.ts +4 -0
- package/dist/components/BbSelect/BbSelect.vue.d.ts +7 -0
- package/dist/index101.js +1 -1
- package/dist/index103.js +2 -2
- package/dist/index109.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index111.js +4 -4
- package/dist/index113.js +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index131.js +2 -2
- package/dist/index15.js +8 -8
- package/dist/index17.js +9 -9
- package/dist/index19.js +3 -3
- package/dist/index197.js +235 -5
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +3 -16
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +35 -16
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +6 -19
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -20
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +4 -29
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +10 -8
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +5 -2
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +16 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +16 -4
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +17 -376
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +17 -131
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +29 -2
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +2 -2
- package/dist/index210.js +8 -174
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +2 -23
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +3 -373
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +3 -3
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +376 -33
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +134 -6
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +2 -235
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +174 -2
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +23 -10
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +370 -25
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +2 -13
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +2 -3
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +9 -3
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +121 -2
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +27 -8
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +12 -120
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +1 -1
- package/dist/index228.js +4 -295
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +434 -5
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +89 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +162 -2
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +2 -2
- package/dist/index233.js +69 -2
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -2
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +2 -2
- package/dist/index236.js +199 -3
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +295 -2
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +5 -116
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +2 -106
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +2 -162
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -2
- package/dist/index242.js +2 -435
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +2 -89
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +2 -200
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +224 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +257 -68
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +2 -38
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +117 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +106 -2
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +2 -2
- package/dist/index250.js +37 -223
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -258
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +2 -2
- package/dist/index252.js.map +1 -1
- package/dist/index254.js +2 -3
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +3 -2
- package/dist/index255.js.map +1 -1
- package/dist/index29.js +3 -3
- package/dist/index31.js +42 -40
- package/dist/index31.js.map +1 -1
- package/dist/index33.js +1 -1
- package/dist/index35.js +2 -2
- package/dist/index47.js +1 -1
- package/dist/index49.js +1 -1
- package/dist/index65.js +5 -5
- package/dist/index69.js +2 -2
- package/dist/index72.js +1 -1
- package/dist/index75.js +1 -1
- package/dist/index79.js +70 -62
- package/dist/index79.js.map +1 -1
- package/dist/index91.js +18 -16
- package/dist/index91.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index31.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index31.js","sources":["../src/components/BaseSelect/BaseSelect.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, withCtx as _withCtx, createBlock as _createBlock, vModelDynamic as _vModelDynamic, createElementVNode as _createElementVNode, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle, Teleport as _Teleport, createVNode as _createVNode, mergeProps as _mergeProps } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-select__input-container\" }\nconst _hoisted_2 = [\"autofocus\", \"disabled\", \"id\", \"placeholder\", \"readonly\"]\nconst _hoisted_3 = {\n key: 0,\n class: \"bb-base-select__loading-container\"\n}\nconst _hoisted_4 = {\n key: 1,\n class: \"bb-base-select__no-data-container\"\n}\nconst _hoisted_5 = [\"aria-selected\", \"id\"]\nconst _hoisted_6 = { class: \"bb-base-select-option__content\" }\nconst _hoisted_7 = { class: \"bb-base-select-option__text\" }\nconst _hoisted_8 = { class: \"bb-base-select__chevron\" }\nconst _hoisted_9 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 16 8\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z\",\n fill: \"currentColor\"\n })\n], -1)\n\nimport BbChip from \"../BbChip/BbChip.vue\";\nimport BbSpinner from \"../BbSpinner/BbSpinner.vue\";\nimport {\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from \"@floating-ui/dom\";\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport { deepEqual } from \"fast-equals\";\nimport { head } from \"@/utilities/functions/head\";\nimport { isNotNil } from \"@/utilities/functions/isNotNil\";\nimport { last } from \"@/utilities/functions/last\";\nimport { useItemText } from \"@/composables/useItemText\";\nimport { useItemValue } from \"@/composables/useItemValue\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport { waitFor } from \"@/utilities/functions/waitFor\";\nimport { when } from \"@/utilities/functions/when\";\nimport type { ComputedRef, HTMLAttributes, InputHTMLAttributes } from \"vue\";\nimport type { NestedKeyOf } from \"@/types/NestedKeyOf\";\n\nexport type BaseSelectProps<T> = {\n /**\n * Allows typing into the input.\n */\n allowWriting?: boolean;\n\n /**\n * Sets autofocus on page load.\n */\n autofocus?: InputHTMLAttributes[\"autofocus\"];\n\n /**\n * Defines an array of dependencies that will trigger actions in the component upon change.\n */\n dependencies?: any[];\n\n /**\n * Timeout used to debounce response to changes to dependencies.\n */\n depsDebounceTime?: number;\n\n /**\n * Disables the component\n */\n disabled?: boolean;\n\n /**\n * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n *\n * e.g. You cannot set v-model to a user that is not present in the items passed.\n *\n * modelValue will be reset upon incoherence.\n */\n enforceCoherence?: boolean;\n\n /**\n * Define if the component should be in an error state.\n * It usually attaches a CSS class for styling purposes.\n */\n hasErrors?: boolean;\n\n /**\n * The identifier of the component.\n */\n id?: HTMLAttributes[\"id\"];\n\n /**\n * String displayed while items are being loaded.\n */\n loadingText?: string;\n\n /**\n * Defines the strategy used to understand whether an option has been selected.\n * `string` is 40% faster but relies on property order.\n * `equality` is more reliable but is slower.\n */\n matchStrategy?: \"string\" | \"equality\";\n\n /**\n * Timeout used to debounce response to changes to modelValue.\n */\n modelValueDebounceTime?: number;\n\n /**\n * Allows the selection of multiple items.\n */\n multiple?: boolean;\n\n /**\n * Defines the name of the input.\n */\n name?: InputHTMLAttributes[\"name\"];\n\n /**\n * String displayed when there are no items to display.\n */\n noDataText?: string;\n\n /**\n * String displayed when there's no data.\n */\n placeholder?: InputHTMLAttributes[\"placeholder\"];\n\n /**\n * Sets the input in a readonly state.\n */\n readonly?: InputHTMLAttributes[\"readonly\"];\n\n /**\n * How long the transition has to last in milliseconds\n */\n transitionDuration?: number;\n /**\n * Used to retrieve items can be an array or a function.\n */\n items:\n | T[]\n | ((query: string, prefill: boolean, modelValue: any) => Promise<T[]>)\n | ((query: string, prefill: boolean, modelValue: any) => T[]);\n\n /**\n * Defines a path that returns a property of the object to use as text or a function that returns a string\n */\n itemText?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => string) | undefined;\n\n /**\n * Defines a path that returns a property of the object to use as value or a function that returns any value\n */\n itemValue?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => any) | undefined;\n /**\n * Used by v-model. Can be any serializable type.\n */\n modelValue: any;\n\n /**\n * Allows the user to add options to the list by\n * inserting text in the input and pressing ENTER.\n * The value and text of the option generated is a\n * string equal to what has been inserted.\n */\n addOptions?: boolean;\n /**\n * Sets the display model for selected values to a list\n * of comma separated string. In this mode the user\n * cannot deselect an option by pressing the close button.\n */\n comma?: boolean;\n /**\n * Defines how the filtering should work.\n * In any case options are always filtered by the text displayed but\n * they can also take into account other properties of the\n * passed elements when this property is a string or an array of string.\n * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n * You can also pass false to not filter anything or a function for more granular control.\n *\n */\n filterBy?:\n | string\n | string[]\n | false\n | ((value: any, item: T) => boolean)\n | null;\n /**\n * Defines the prefill strategy for the input. By default the input will prefill\n * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n */\n prefill?: boolean | \"focus\";\n /**\n * Time to wait when the users stops writing in the input before querying data.\n * Especially useful when searching live data on big datasets.\n */\n queryDebounceTime?: number;\n /**\n * If `true` when in multiple selection, reset the query immediately\n * upon selecting an option. By default the query is\n * not reset until focus is lost so the user can search\n * for \"Cath\" and select \"Cathy\" and then write more to\n * search for \"Catherine\"\n */\n resetQueryOnOptionSelected?: boolean;\n /**\n * Adds a stash to accumulate selected values. Especially\n * useful when searching in a big database of items.\n * E.g. if you search for \"John\" and then search for \"Richard\"\n * you either always return the previous items or you stash them passing `true` to this option.\n */\n stash?: boolean;\n /**\n * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n */\n updateOnAnimationFrame?: boolean;\n};\n\nexport type BaseOption<T> = {\n id: string;\n jsonValue: string;\n manual: boolean;\n original: T;\n text: string;\n value: any;\n disabled: boolean;\n};\n\nexport type Option<T> = BaseOption<T> & {\n index: number;\n selected: boolean;\n};\n\nexport type FilteredOption<T> = Option<T> & {\n focused: boolean;\n};\n\nexport type BaseSelectEvents = {\n (e: \"blur\", event: FocusEvent): void;\n (e: \"change\", event: Event): void;\n (e: \"click\", event: MouseEvent): void;\n (e: \"focus\", event: FocusEvent): void;\n (e: \"inactive\"): void;\n (e: \"input\", event: Event): void;\n (e: \"update:modelValue\", value: any): void;\n};\n\nexport type BaseSelectSlots<T> = {\n \"prepend-outer\"?: (props: {}) => any;\n prepend?: (props: {}) => any;\n \"options:prepend\"?: (props: {}) => any;\n loading?: (props: { query: string }) => any;\n \"no-data\"?: (props: { query: string }) => any;\n \"option:prepend\"?: (props: { item: T }) => any;\n chip?: (props: {\n disabled: boolean;\n hasErrors?: boolean;\n index: number;\n item: T;\n loading: boolean;\n manual: boolean;\n selected: boolean;\n text: string;\n value: any;\n }) => any;\n option?: (props: {\n disabled: boolean;\n focused: boolean;\n hasErrors?: boolean;\n index: number;\n item: T;\n loading: boolean;\n manual: boolean;\n selected: boolean;\n text: string;\n value: any;\n }) => any;\n \"option:append\"?: (props: { item: T }) => any;\n \"options:append\"?: (props: {}) => any;\n chevron?: (props: { loading: boolean; shown: boolean }) => any;\n append?: (props: {}) => any;\n spinner?: (props: { loading: boolean }) => any;\n \"append-outer\"?: (props: {}) => any;\n};\n\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseSelect',\n props: {\n allowWriting: { type: Boolean, default: true },\n autofocus: {},\n dependencies: {},\n depsDebounceTime: { default: 0 },\n disabled: { type: Boolean },\n enforceCoherence: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n loadingText: { default: \"Caricamento...\" },\n matchStrategy: { default: \"string\" },\n modelValueDebounceTime: { default: 0 },\n multiple: { type: Boolean },\n name: {},\n noDataText: { default: \"Nessun elemento da visualizzare\" },\n placeholder: {},\n readonly: {},\n transitionDuration: { default: 200 },\n items: {},\n itemText: {},\n itemValue: {},\n modelValue: {},\n addOptions: { type: Boolean },\n comma: { type: Boolean },\n filterBy: { type: [String, Array, Boolean, Function, null], default: () => [] },\n prefill: { type: [Boolean, String], default: \"focus\" },\n queryDebounceTime: { default: 500 },\n resetQueryOnOptionSelected: { type: Boolean },\n stash: { type: Boolean },\n updateOnAnimationFrame: { type: Boolean, default: false }\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"inactive\", \"input\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n throw new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst optionsContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst query = ref<string>(\"\");\nconst computedPlaceholder = computed(() => {\n if (selectedOptions.value.length) return \"\";\n else return props.placeholder;\n});\n/**\n * Use a number accumulator because if the fn takes 5 seconds\n * and after 2 seconds another search is run\n * When the first returns the second is still out for 2 seconds\n * and we want to track them both.\n * Debounce will not be enough.\n */\nconst loading = ref(0);\nconst transitionDuration = props.transitionDuration / 1000 + \"s\";\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n if (innerContainer.value && optionsContainer.value) {\n cleanUpPositioning = autoUpdate(\n innerContainer.value,\n optionsContainer.value,\n displayOptions,\n {\n ancestorResize: true,\n ancestorScroll: true,\n animationFrame: props.updateOnAnimationFrame,\n elementResize: true,\n }\n );\n }\n});\nonBeforeUnmount(() => {\n cleanUpPositioning();\n});\n\nconst internalItems = ref<T[]>([]);\nconst stash = ref<BaseOption<T>[]>([]);\nconst manualItems = ref<BaseOption<T>[]>([]);\nconst { getItemText } = useItemText();\nconst { getItemValue } = useItemValue();\n\nconst internalOptions = computed<BaseOption<T>[]>(() => {\n return internalItems.value.map((item: any, _) => {\n const text = getItemText(item, props.itemText as any);\n const value = getItemValue(item, props.itemValue);\n\n // Undefined is not JSONable\n if (value === undefined)\n throw new Error(\n 'The result of extracting \"value\" from option was undefined. Affected item is ' +\n JSON.stringify(item) +\n \" please check itemValue property is correct.\"\n );\n\n const jsonValue = JSON.stringify(value);\n return {\n disabled: !!item.disabled,\n id: \"option_\" + jsonValue.replace(/\\W/g, \"_\"),\n jsonValue,\n manual: false,\n original: item,\n text,\n value,\n };\n });\n});\n\nconst options = computed<Option<T>[]>(() => {\n let fromOptions = internalOptions.value.reduce(\n (acc: { [key: string]: BaseOption<T> }, curr: BaseOption<T>) => {\n acc[curr.id] = curr;\n return acc;\n },\n {}\n );\n const withManual: { [key: string]: BaseOption<T> } = manualItems.value.reduce(\n (acc, curr) => {\n if (!acc[curr.id]) acc[curr.id] = curr as any;\n return acc;\n },\n fromOptions\n );\n const withStash: { [key: string]: BaseOption<T> } = stash.value.reduce(\n (acc, curr) => {\n if (!acc[curr.id]) acc[curr.id] = curr as any;\n return acc;\n },\n withManual\n );\n return Object.values(withStash).map<Option<T>>(\n (option: BaseOption<T>, index) => {\n return {\n ...option,\n selected: isNotNil(modelValueIndexed.value.get(option.value)),\n index,\n };\n }\n );\n});\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<FilteredOption<T>[]>(() => {\n let base = [];\n /** Only filter when a value is being searched not when the query is fully set on a selected option text */\n if (\n query.value &&\n !selectedOptions.value.some(\n (option: Option<T>) => option.text === query.value\n )\n ) {\n base = options.value.filter((item: Option<T>) => {\n let matchedAnything = false;\n if (!props.filterBy) return true;\n else if (typeof props.filterBy === \"function\")\n matchedAnything = props.filterBy(item.value, item.original);\n else if (props.filterBy.length) {\n const keys = ([] as string[]).concat(props.filterBy);\n for (let index = 0; index < keys.length; index++) {\n const propName = keys[index];\n matchedAnything =\n matchedAnything ||\n ((item.original as any)[propName] &&\n (item.original as any)[propName]\n .toLowerCase()\n .includes(query.value.toLowerCase()));\n }\n }\n return (\n matchedAnything ||\n item.text.toLowerCase().includes(query.value.toLowerCase())\n );\n });\n /** Otherwise defaul;t to the whole set of options */\n } else base = options.value;\n /** This is done here so that only visible options are highlighted */\n return base.map((option: Option<T>, index) => ({\n ...option,\n focused: normalizedFocusedIndex.value === index,\n }));\n});\n\n/**\n * Indexes options by id for retrieval\n */\n\nconst optionsIndexedById = computed<{\n [key: string]: Option<T>;\n}>(() =>\n options.value.reduce(\n (acc, curr) => ({\n ...acc,\n [curr.id]: curr,\n }),\n {}\n )\n);\n\n/**\n * Indexes options by their value\n * (using JSON to circumvent identical objects not being equal in JS)\n */\nconst optionsIndexedByValue = computed(() => {\n if (props.matchStrategy === \"string\") {\n let indexed = options.value.reduce(\n (acc: { [key: string]: Option<T> }, curr: Option<T>) => {\n acc[curr.jsonValue] = curr;\n return acc;\n },\n {}\n );\n return {\n get: (key: any) => {\n return indexed[JSON.stringify(key)];\n },\n };\n } else if (props.matchStrategy === \"equality\") {\n let indexed: [any, Option<T>][] = options.value.map((option) => [\n option.value,\n option,\n ]);\n\n return {\n get: (key: any) => {\n return indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n});\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\nconst modelValueIndexed = computed(() => {\n if (props.matchStrategy === \"string\") {\n let map: { [key: string]: number } = {};\n [].concat(props.modelValue).forEach((value: any, index: number) => {\n map[JSON.stringify(value)] = index;\n });\n return {\n get: (value: any) => map[JSON.stringify(value)],\n };\n } else if (props.matchStrategy === \"equality\") {\n const map = []\n .concat(props.modelValue)\n .filter(isNotNil)\n .map((value, index) => [value, index]);\n\n return {\n get: (key: any) => {\n return map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n});\n\n/**\n * For every item in modelValue find the linked option if it exists.\n * This is used to display chips.\n */\nconst selectedOptions = computed(() => {\n return [].concat(props.modelValue).reduce((acc: Option<T>[], curr: any) => {\n const linkedOption = optionsIndexedByValue.value.get(curr);\n if (linkedOption) acc.push(linkedOption);\n return acc;\n }, []);\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option<T>) => {\n let valueToEmit;\n focusedIndex.value = option.index;\n /**\n * For single selection:\n * If the option was already selected - restore the value to default, clean the stash, manual items, and query.\n * If the option was not selected - use its value, save the option in the stash and display it's text as query\n * The stash is used to remove the complexity of stashing items when searching for identifying information,\n * like searching an address would not return the option that was used to selected a previous address in another country.\n * Or when searching users by username would not return the previous ones.\n * We save it so the user hasn't to.\n */\n if (!props.multiple) {\n if (option.selected) {\n if (option.manual) {\n manualItems.value = manualItems.value.filter(\n (current: any) => current.id !== option.id\n );\n }\n valueToEmit = null;\n if (props.stash) {\n stash.value = [];\n }\n query.value = \"\";\n } else {\n valueToEmit = option.value;\n if (props.stash) {\n stash.value = [option as any];\n }\n query.value = option.text;\n }\n /**\n * For multiple selection\n * If the option was selected remove it from modelValue, if it is a mnaual iutem also remove it from there.\n * In the stash we can search for the id of the option.\n * If the option was not selected we can just add it to modelValue and the stash.\n */\n } else {\n if (option.selected) {\n if (option.manual) {\n manualItems.value = manualItems.value.filter(\n (current: any) => current.id !== option.id\n );\n }\n valueToEmit = props.modelValue.filter(\n (value: any) => JSON.stringify(value) !== option.jsonValue\n );\n if (props.stash) {\n stash.value = stash.value.filter((stashed) => stashed.id !== option.id);\n }\n } else {\n valueToEmit = props.modelValue.concat(option.value);\n if (props.stash) {\n stash.value = stash.value.concat(option as any);\n }\n }\n if (props.resetQueryOnOptionSelected) {\n query.value = \"\";\n }\n }\n emit(\"update:modelValue\", valueToEmit);\n};\n\nconst getOptions = async ({ prefill = false }) => {\n let items: T[] = [];\n if (Array.isArray(props.items)) {\n items = props.items;\n } else {\n if (typeof props.items === \"function\") {\n loading.value++;\n items = await props.items(query.value, prefill, props.modelValue);\n loading.value--;\n }\n }\n internalItems.value = items as any;\n};\n\n/**\n * Add an option to the manual items and then reset the query\n */\nconst addOption = () => {\n const text = query.value;\n const value = query.value;\n const jsonValue = JSON.stringify(value);\n const option = {\n text,\n value,\n jsonValue,\n id: \"option_\" + jsonValue.replace(/\\W/g, \"_\"),\n original: value,\n manual: true,\n disabled: false,\n };\n manualItems.value = manualItems.value.concat(option as any);\n query.value = \"\";\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n props.prefill === true ||\n (!props.multiple && isNotNil(props.modelValue)) ||\n (props.multiple && !!props.modelValue.length);\n/**\n * When modelValue changes split behavior for single and multiple selection:\n */\nlet modelValueTimeout: ReturnType<typeof setTimeout>;\nlet hasRunOnce = false;\nwatch(\n () => props.modelValue,\n (current, previous) => {\n if (modelValueTimeout) clearTimeout(modelValueTimeout);\n modelValueTimeout = setTimeout(\n async () => {\n /**\n * For single selection if the value is already in the option (most likely you are using\n * static items) just use it.\n * If the value is not in the options try searching for it (outside dependencies may fix it).\n * If at last the value cannot be found even after searching\n * reset value to the default value when coherence is enforced\n * or at least do not display the old query\n */\n if (!props.multiple) {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (\n (!found && isNotNil(props.modelValue)) ||\n previous === undefined\n ) {\n const currentQuery = query.value;\n query.value = \"\";\n await getOptions({ prefill: true });\n query.value = currentQuery;\n }\n found = optionsIndexedByValue.value.get(props.modelValue);\n if (found) {\n query.value = found.text;\n if (props.stash) {\n stash.value = [found as any];\n }\n } else {\n if (props.enforceCoherence && isNotNil(current)) {\n query.value = \"\";\n if (props.stash) {\n stash.value = [];\n }\n emit(\"update:modelValue\", null);\n } else {\n query.value = \"\";\n }\n }\n /**\n * For multiple selection if every value is already in the options (most likely you are using\n * static items) just use them.\n * If not all the values are in the current options or is prefilling try searching (outside depencencies may fix the situation).\n * If the values are still not in the available options and coherence is enforced\n * discard the ones that are invalid.\n *\n */\n } else {\n if (!Array.isArray(props.modelValue)) {\n throw new Error(\"props.modelValue is not an array.\");\n }\n let allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n if (!allFound || previous === undefined) {\n await getOptions({ prefill: true });\n allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n }\n if (allFound) {\n if (props.stash) {\n stash.value = props.modelValue.map(\n (value: any) => optionsIndexedByValue.value.get(value)!\n ) as any;\n }\n } else {\n let coherentStash: Option<T>[] = [];\n const coherent = current.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n if (found) coherentStash.push(found);\n return found;\n });\n if (props.stash) {\n stash.value = coherentStash as any;\n }\n if (props.enforceCoherence) {\n emit(\"update:modelValue\", coherent);\n }\n }\n }\n },\n shouldPrefill ? 0 : props.modelValueDebounceTime\n );\n },\n // Prefill when asked or when items are static\n { immediate: shouldPrefill, deep: true }\n);\n\n/**\n * This is triggered to refresh static items whenever the passed array changes.\n * If the parent defines an array in the template this is triggered\n * at every render so we take counter measures\n * Even if the entire array changes all the previously selected values are still in the stash.\n */\nwatch(\n () => props.items,\n async (current, previous) => {\n if (\n typeof current === \"function\" ||\n // Circumvent arrays defined in the template by the parent\n JSON.stringify(current) !== JSON.stringify(previous)\n ) {\n await getOptions({ prefill: false });\n if (props.multiple) {\n const allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n\n if (!allFound) {\n if (props.enforceCoherence) {\n const coherent = props.modelValue.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n return found;\n });\n emit(\"update:modelValue\", coherent);\n }\n }\n } else {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n emit(\"update:modelValue\", null);\n }\n focusedIndex.value = null;\n }\n }\n }\n);\n\n/**\n * When dependencies change\n * If the input has not been prefilled yet just return\n * Check dependencies are the same by value and not reference\n * Otherwise we search again for options as they might be different base on dependencies.\n * If coherence is enforced we set the state accordingly\n */\nlet depsTimeout: ReturnType<typeof setTimeout>;\nwatch(\n () => props.dependencies,\n (current, previous) => {\n if (!shouldPrefill && props.prefill === \"focus\" && isFirstFocus) {\n return;\n }\n // Circumvent array defined in the template by the parent\n if (JSON.stringify(current) === JSON.stringify(previous)) {\n return;\n }\n\n if (depsTimeout) clearTimeout(depsTimeout);\n depsTimeout = setTimeout(async () => {\n if (JSON.stringify(current) !== JSON.stringify(previous)) {\n // Only reset the stash if we are going to enforce coherence\n if (props.enforceCoherence) {\n if (props.stash) {\n stash.value = [];\n }\n }\n // Momentarily reset query\n let currentQuery = query.value;\n query.value = \"\";\n await getOptions({ prefill: true });\n query.value = currentQuery;\n if (!props.multiple) {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n query.value = \"\";\n if (props.stash) {\n stash.value = [];\n }\n emit(\"update:modelValue\", null);\n }\n } else {\n let allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n if (!allFound && props.enforceCoherence) {\n let coherentStash: Option<T>[] = [];\n const coherent = props.modelValue.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n if (found) coherentStash.push(found);\n return found;\n });\n if (props.stash) {\n stash.value = coherentStash as any;\n }\n emit(\"update:modelValue\", coherent);\n }\n }\n }\n }, props.depsDebounceTime);\n },\n { deep: true }\n);\n\n/**\n * This is used to position the option container.\n * When the linked item (outerContainer) updates its position\n * this is rerun by floating-UI\n */\nconst displayOptions = () => {\n if (innerContainer.value && optionsContainer.value) {\n computePosition(innerContainer.value, optionsContainer.value, {\n placement: \"bottom\",\n middleware: [offset(6), flip(), shift()],\n }).then((data) => {\n if (optionsContainer.value) {\n optionsContainer.value.style.left = `${data.x}px`;\n optionsContainer.value.style.top = `${data.y}px`;\n optionsContainer.value.style.width = `${innerContainer.value?.offsetWidth}px`;\n }\n });\n }\n};\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n hidden.value = false;\n showing.value = true;\n await wait(props.transitionDuration);\n showing.value = false;\n shown.value = true;\n};\n\nconst close = async () => {\n shown.value = false;\n hiding.value = true;\n await wait(props.transitionDuration);\n hiding.value = false;\n hidden.value = true;\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nlet isFirstFocus = true;\nconst onInputFocus = async (event: FocusEvent) => {\n emit(\"focus\", event);\n active.value = true;\n document.addEventListener(\"click\", onClickOutside);\n document.addEventListener(\"focusin\", onFocusOutside);\n if (input.value instanceof HTMLInputElement) input.value.select();\n if (props.prefill === \"focus\" && isFirstFocus && !shouldPrefill) {\n await getOptions({ prefill: true });\n isFirstFocus = false;\n }\n};\n\nconst onFocusOutside = (event: FocusEvent) => {\n if (event.target instanceof Node) {\n if (outerContainer.value && optionsContainer.value) {\n if (\n !outerContainer.value.contains(event.target) &&\n !optionsContainer.value.contains(event.target)\n ) {\n close();\n emit(\"inactive\");\n document.removeEventListener(\"focusin\", onFocusOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\n/**\n * On single selection restore the query that might be partially altered by the user.\n * Input can blur either by clicking outside or clicking on an option.\n * We do nothing if the user has selected an option. And we restore the\n * query to its text if the user has moved focus\n */\nconst onInputBlur = async (event: FocusEvent) => {\n emit(\"blur\", event);\n if (!props.multiple) {\n let noop = false;\n const currentModelValue = props.modelValue;\n await Promise.race([\n wait(250),\n waitFor(() => {\n return currentModelValue !== props.modelValue;\n }).then(() => {\n noop = true;\n }),\n ]);\n if (!noop) {\n const found = optionsIndexedByValue.value.get(props.modelValue);\n if (found) {\n query.value = found.text;\n }\n }\n }\n};\n\nconst onInputChange = (event: Event) => emit(\"change\", event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n emit(\"input\", event);\n if (query.value === \"\") {\n if (!props.multiple) {\n emit(\"update:modelValue\", null);\n }\n }\n if (typeof props.items === \"function\") {\n searchByQuery();\n }\n};\n\n// This is the vertical index used to highlight options in the container\nconst focusedIndex = ref<number | null>(null);\n/**\n * Normalize the index using the displayed options so we can start over when reaching the end.\n * Please watch out for the side effect it is used to avoid the\n * complexity of using modulo over negative numbers\n */\nconst normalizedFocusedIndex: ComputedRef<number | null> = computed(() => {\n if (Number.isInteger(focusedIndex.value) && focusedIndex.value) {\n if (focusedIndex.value === -1) {\n focusedIndex.value = filteredOptions.value.length - 1;\n }\n return focusedIndex.value % filteredOptions.value.length;\n }\n return focusedIndex.value;\n});\n\n// This is the horizontal index used to highlight selected options\nconst selectedOptionsFocusedIndex = ref<number | null>(null);\n\n/**\n * Increment the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnNextOption = () => {\n if (focusedIndex.value !== null) focusedIndex.value++;\n else {\n focusedIndex.value = 0;\n }\n nextTick().then(() => {\n if (normalizedFocusedIndex.value !== null) {\n const foundOption = optionsContainer.value?.querySelector(\n `#${options.value[normalizedFocusedIndex.value].id}`\n );\n if (foundOption instanceof HTMLElement)\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n }\n });\n};\n\n/**\n * Decrement the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnPreviousOption = () => {\n if (focusedIndex.value !== null) focusedIndex.value--;\n else focusedIndex.value = options.value.length - 1;\n\n nextTick().then(() => {\n if (normalizedFocusedIndex.value !== null) {\n const foundOption = optionsContainer.value?.querySelector(\n `#${options.value[normalizedFocusedIndex.value].id}`\n );\n if (foundOption instanceof HTMLElement)\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n }\n });\n};\n\n/**\n * This is handled separately from input because it has a lot to do with user\n * interaction and control characters than it has with the query.\n */\nconst onInputKeyDown = async (event: KeyboardEvent) => {\n if (props.readonly || props.disabled) {\n event.preventDefault();\n return;\n }\n switch (event.key) {\n /**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\n case \"ArrowUp\":\n {\n event.preventDefault();\n if (loading.value) return;\n selectedOptionsFocusedIndex.value = null;\n if (shown.value) {\n focusOnPreviousOption();\n } else {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n await open();\n }\n }\n break;\n /**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\n case \"ArrowDown\":\n {\n event.preventDefault();\n if (loading.value) return;\n selectedOptionsFocusedIndex.value = null;\n if (shown.value) {\n focusOnNextOption();\n } else {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n await open();\n }\n }\n break;\n /**\n * When moving horizontally\n * Cycle from rightmost, next, or input focus.\n * If the focus lands on an option align the vertical focus as well\n */\n case \"ArrowLeft\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value =\n selectedOptions.value.length - 1;\n } else if (selectedOptionsFocusedIndex.value > 0) {\n selectedOptionsFocusedIndex.value--;\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n\n if (selectedOptionsFocusedIndex.value !== null) {\n let linkedOption =\n selectedOptions.value[selectedOptionsFocusedIndex.value];\n let foundOption = optionsContainer.value?.querySelector(\n `#${linkedOption.id}`\n );\n if (foundOption) {\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n\n focusedIndex.value =\n optionsIndexedById.value[\n selectedOptions.value[selectedOptionsFocusedIndex.value].id\n ].index;\n }\n }\n }\n }\n }\n break;\n /**\n * When moving horizontally\n * Cycle from leftmost, next, or input focus.\n * If the focus lands on an option align the vertical focus as well\n */\n case \"ArrowRight\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value = 0;\n } else if (\n selectedOptionsFocusedIndex.value <\n selectedOptions.value.length - 1\n ) {\n selectedOptionsFocusedIndex.value++;\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n\n if (selectedOptionsFocusedIndex.value !== null) {\n let linkedOption =\n selectedOptions.value[selectedOptionsFocusedIndex.value];\n let foundOption = optionsContainer.value?.querySelector(\n `#${linkedOption.id}`\n );\n if (foundOption) {\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n\n focusedIndex.value =\n optionsIndexedById.value[\n selectedOptions.value[selectedOptionsFocusedIndex.value].id\n ].index;\n }\n }\n }\n }\n }\n break;\n /**\n * If the panel is closed focus on the first selected option.\n * If the panel was already open select/deselect the currently focused option\n * and close the panel of single selection is enabled\n */\n case \"Enter\":\n {\n event.preventDefault();\n if (loading.value) return;\n if (!shown.value) {\n if (filteredOptions.value.length) {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n }\n await open();\n } else {\n if (normalizedFocusedIndex.value !== null) {\n if (filteredOptions.value[normalizedFocusedIndex.value].disabled)\n return;\n if (!props.multiple) {\n await close();\n }\n onOptionSelected(\n filteredOptions.value[normalizedFocusedIndex.value]\n );\n } else {\n if (props.addOptions) {\n if (props.itemText || props.itemValue) {\n console.error(\n `Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n );\n return;\n }\n addOption();\n const added = last(manualItems.value);\n onOptionSelected(optionsIndexedById.value[added.id]);\n }\n }\n }\n }\n break;\n /**\n * When moving away from the component reset focus both vertically and horizontally\n */\n case \"Tab\":\n case \"Escape\":\n {\n if (shown.value) {\n await close();\n }\n emit(\"inactive\");\n selectedOptionsFocusedIndex.value = null;\n focusedIndex.value = null;\n }\n break;\n // Prevent shift from opening the panel\n case \"Shift\":\n {\n if (loading.value) return;\n }\n break;\n /**\n * Delete behavior is different when query is empty\n * If query is empty\n * If no chip is selected - select rightmost chip\n * If a chip is selected - deselect that option\n * If any option remains move focus to that or reset\n */\n case \"Backspace\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value =\n selectedOptions.value.length - 1;\n } else {\n onOptionSelected(\n selectedOptions.value[selectedOptionsFocusedIndex.value]\n );\n if (selectedOptions.value.length) {\n selectedOptionsFocusedIndex.value = Math.max(\n Math.min(\n selectedOptionsFocusedIndex.value,\n selectedOptions.value.length - 2\n ),\n 0\n );\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n }\n }\n }\n await open();\n }\n break;\n /**\n * Open the panel on writing and reset horizontal focus\n */\n default:\n {\n selectedOptionsFocusedIndex.value = null;\n focusedIndex.value = null;\n await open();\n }\n break;\n }\n};\n\n/**\n * Triggered on input when items is a function.\n */\n\nlet timeout: ReturnType<typeof setTimeout>;\nconst searchByQuery = () => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(async () => {\n try {\n await getOptions({ prefill: false });\n } catch (error) {\n console.error(error);\n }\n }, props.queryDebounceTime);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n emit(\"click\", event);\n if (props.disabled || props.readonly) return;\n if (input.value instanceof HTMLElement) {\n input.value.focus();\n }\n open();\n};\n\n/**\n * When an option is clicked wait for it to bubble to the option container to avoid slot event problems.\n * Select / deselect the option and then move focus to the input.\n * If it is single selection mode close the panel\n */\nconst onOptionClicked = (event: Event) => {\n if (event.currentTarget instanceof HTMLElement) {\n if (event.currentTarget.classList.contains(\"bb-base-select-option\")) {\n const option = optionsIndexedById.value[event.currentTarget.id];\n if (option.disabled) return;\n onOptionSelected(option);\n if (input.value instanceof HTMLInputElement) {\n input.value.focus();\n }\n if (!props.multiple) close();\n }\n }\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onClickOutside = (event: Event) => {\n if (event.target instanceof Node) {\n if (outerContainer.value) {\n if (!outerContainer.value.contains(event.target)) {\n close();\n emit(\"inactive\");\n document.removeEventListener(\"click\", onClickOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n (item: unknown) => typeof item !== \"string\",\n JSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n return [].concat(props.modelValue).map((current) => {\n const value = makeInputValue(current);\n return {\n disabled: props.disabled,\n name: props.name,\n type: \"hidden\",\n value: value,\n };\n });\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-select': true,\n 'bb-base-select--active': active.value,\n 'bb-base-select--loading': loading.value,\n 'bb-base-select--disabled': _ctx.disabled,\n 'bb-base-select--errors': _ctx.hasErrors,\n 'bb-base-select--readonly': _ctx.readonly,\n }),\n onClick: onOuterContainerClick,\n ref_key: \"outerContainer\",\n ref: outerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n class: \"bb-base-select__inner-container\",\n ref_key: \"innerContainer\",\n ref: innerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.multiple)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_ctx.comma)\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-select__selected': true,\n 'bb-base-select__selected--comma': true,\n 'bb-base-select__selected--focused':\n index === selectedOptionsFocusedIndex.value,\n }),\n key: option.id\n }, _toDisplayString(option.text) + _toDisplayString(index < selectedOptions.value.length - 1 ? \",\" : \"\"), 3))\n }), 128))\n : (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createBlock(BbChip, {\n class: _normalizeClass({\n 'bb-base-select__selected': true,\n 'bb-base-select__selected--chip': true,\n 'bb-base-select__selected--focused':\n index === selectedOptionsFocusedIndex.value,\n }),\n clearable: true,\n key: option.id,\n text: option.text,\n \"onClick:clear\": _withModifiers(($event: any) => (onOptionSelected(option)), [\"stop\"])\n }, {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"chip\", {\n disabled: option.disabled,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createTextVNode(_toDisplayString(option.text), 1)\n ])\n ]),\n _: 2\n }, 1032, [\"class\", \"text\", \"onClick:clear\"]))\n }), 128))\n ], 64))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createElementVNode(\"input\", {\n autofocus: _ctx.autofocus,\n class: _normalizeClass('bb-base-select__text-input'),\n disabled: _ctx.disabled,\n id: _ctx.id,\n placeholder: computedPlaceholder.value,\n readonly: _ctx.readonly || !_ctx.allowWriting,\n type: 'text',\n onBlur: _withModifiers(onInputBlur, [\"stop\"]),\n onFocus: _withModifiers(onInputFocus, [\"stop\"]),\n onChange: _withModifiers(onInputChange, [\"stop\"]),\n onInput: _withModifiers(onInputInput, [\"stop\"]),\n onKeydown: _withModifiers(onInputKeyDown, [\"stop\"]),\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((query).value = $event)),\n ref_key: \"input\",\n ref: input\n }, null, 40, _hoisted_2), [\n [_vModelDynamic, query.value]\n ]),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass({\n 'bb-base-select__options-container': true,\n 'bb-base-select__options-container--shown': shown.value,\n 'bb-base-select__options-container--showing': showing.value,\n 'bb-base-select__options-container--hiding': hiding.value,\n 'bb-base-select__options-container--hidden': hidden.value,\n }),\n role: 'listbox',\n style: _normalizeStyle({ transitionDuration: transitionDuration }),\n tabindex: -1,\n ref_key: \"optionsContainer\",\n ref: optionsContainer\n }, [\n _renderSlot(_ctx.$slots, \"options:prepend\"),\n (!filteredOptions.value.length && loading.value)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_3, [\n _renderSlot(_ctx.$slots, 'loading', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.loadingText), 1)\n ])\n ]))\n : (!filteredOptions.value.length)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_4, [\n _renderSlot(_ctx.$slots, 'no-data', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.noDataText), 1)\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(filteredOptions.value, (option) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: option.id\n }, [\n _renderSlot(_ctx.$slots, \"option:prepend\", {\n item: option.original\n }),\n _createElementVNode(\"span\", {\n \"aria-selected\": option.selected,\n class: _normalizeClass({\n 'bb-base-select-option': true,\n 'bb-base-select-option--selected': option.selected,\n 'bb-base-select-option--focused': option.focused,\n 'bb-base-select-option--disabled': option.disabled,\n }),\n id: option.id,\n role: 'option',\n onClick: _withModifiers(onOptionClicked, [\"stop\"])\n }, [\n _renderSlot(_ctx.$slots, \"option\", {\n disabled: option.disabled,\n focused: option.focused,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createElementVNode(\"span\", _hoisted_6, [\n _createElementVNode(\"span\", _hoisted_7, _toDisplayString(option.text), 1)\n ])\n ])\n ], 10, _hoisted_5),\n _renderSlot(_ctx.$slots, \"option:append\", {\n item: option.original\n })\n ], 64))\n }), 128)),\n _renderSlot(_ctx.$slots, \"options:append\")\n ], 6)\n ]))\n ]),\n _createElementVNode(\"span\", _hoisted_8, [\n _renderSlot(_ctx.$slots, \"chevron\", {\n loading: !!loading.value,\n shown: shown.value\n }, () => [\n _hoisted_9\n ])\n ]),\n (!loading.value)\n ? _renderSlot(_ctx.$slots, \"append\", { key: 0 })\n : (_openBlock(), _createElementBlock(\"span\", {\n key: 1,\n class: _normalizeClass({\n 'bb-base-select__spinner': true,\n 'bb-base-select__spinner--loading': loading.value,\n })\n }, [\n _renderSlot(_ctx.$slots, 'spinner', {\n loading: !!loading.value\n }, () => [\n _createVNode(BbSpinner, { size: 'sm' })\n ])\n ], 2))\n ], 512),\n _renderSlot(_ctx.$slots, \"append-outer\"),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(hiddenInputs.value, (input) => {\n return (_openBlock(), _createElementBlock(\"input\", _mergeProps({\n key: input.value\n }, input), null, 16))\n }), 128))\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_sfc_main","_defineComponent","__props","__emit","props","emit","outerContainer","ref","innerContainer","optionsContainer","input","query","computedPlaceholder","computed","selectedOptions","loading","transitionDuration","cleanUpPositioning","onMounted","autoUpdate","displayOptions","onBeforeUnmount","internalItems","stash","manualItems","getItemText","useItemText","getItemValue","useItemValue","internalOptions","item","_","text","value","jsonValue","options","fromOptions","acc","curr","withManual","withStash","option","index","isNotNil","modelValueIndexed","filteredOptions","base","matchedAnything","keys","propName","normalizedFocusedIndex","optionsIndexedById","optionsIndexedByValue","indexed","key","_a","pairs","deepEqual","map","linkedOption","onOptionSelected","valueToEmit","focusedIndex","current","stashed","getOptions","prefill","items","addOption","shouldPrefill","modelValueTimeout","watch","previous","allFound","coherentStash","coherent","found","currentQuery","depsTimeout","isFirstFocus","computePosition","offset","flip","shift","data","shown","showing","hiding","hidden","open","wait","close","active","onInputFocus","event","onClickOutside","onFocusOutside","onInputBlur","noop","currentModelValue","waitFor","onInputChange","onInputInput","searchByQuery","selectedOptionsFocusedIndex","focusOnNextOption","nextTick","foundOption","focusOnPreviousOption","onInputKeyDown","head","_b","added","last","timeout","error","onOuterContainerClick","onOptionClicked","makeInputValue","when","hiddenInputs","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_Fragment","_renderList","_toDisplayString","_createBlock","BbChip","_withModifiers","$event","_withCtx","_createTextVNode","_createCommentVNode","_withDirectives","_vModelDynamic","_Teleport","_normalizeStyle","_createVNode","BbSpinner","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,qCACtBC,KAAa,CAAC,aAAa,YAAY,MAAM,eAAe,UAAU,GACtEC,KAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,KAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,KAAa,CAAC,iBAAiB,IAAI,GACnCC,KAAa,EAAE,OAAO,oCACtBC,KAAa,EAAE,OAAO,iCACtBC,KAAa,EAAE,OAAO,6BACtBC,uBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,aAAa;AAAA,IACb,aAAa;AAAA,IACb,GAAG;AAAA,IACH,MAAM;AAAA,EAAA,CACP;AACH,GAAG,EAAE,GAqRuBC,KAAiBC,gBAAAA,GAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC7C,WAAW,CAAC;AAAA,IACZ,cAAc,CAAC;AAAA,IACf,kBAAkB,EAAE,SAAS,EAAE;AAAA,IAC/B,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,kBAAkB,EAAE,MAAM,QAAQ;AAAA,IAClC,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,aAAa,EAAE,SAAS,iBAAiB;AAAA,IACzC,eAAe,EAAE,SAAS,SAAS;AAAA,IACnC,wBAAwB,EAAE,SAAS,EAAE;AAAA,IACrC,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,MAAM,CAAC;AAAA,IACP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,EAAE,KAAK,GAAG;AAAA,SAchD,GAAG;AAAA,MACNK,EAAYL,EAAK,QAAQ,cAAc;AAAA,OACtCE,EAAW,EAAI,GAAGC,EAAoBI,GAAW,MAAMC,EAAYT,GAAa,OAAO,CAAC9G,OAC/EiH,EAAW,GAAGC,EAAoB,SAASoB,GAAY;AAAA,QAC7D,KAAKtI,EAAM;AAAA,MACVA,GAAAA,CAAK,GAAG,MAAM,EAAE,EACpB,GAAG,GAAG;AAAA,OACN,CAAC;AAAA,EAEN;AAEA,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index31.js","sources":["../src/components/BaseSelect/BaseSelect.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, withCtx as _withCtx, createBlock as _createBlock, vModelDynamic as _vModelDynamic, createElementVNode as _createElementVNode, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle, Teleport as _Teleport, createVNode as _createVNode, mergeProps as _mergeProps } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-select__input-container\" }\nconst _hoisted_2 = [\"autocomplete\", \"autofocus\", \"disabled\", \"id\", \"placeholder\", \"readonly\"]\nconst _hoisted_3 = {\n key: 0,\n class: \"bb-base-select__loading-container\"\n}\nconst _hoisted_4 = {\n key: 1,\n class: \"bb-base-select__no-data-container\"\n}\nconst _hoisted_5 = [\"aria-selected\", \"id\"]\nconst _hoisted_6 = { class: \"bb-base-select-option__content\" }\nconst _hoisted_7 = { class: \"bb-base-select-option__text\" }\nconst _hoisted_8 = { class: \"bb-base-select__chevron\" }\nconst _hoisted_9 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 16 8\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z\",\n fill: \"currentColor\"\n })\n], -1)\n\nimport BbChip from \"../BbChip/BbChip.vue\";\nimport BbSpinner from \"../BbSpinner/BbSpinner.vue\";\nimport {\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from \"@floating-ui/dom\";\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport { deepEqual } from \"fast-equals\";\nimport { head } from \"@/utilities/functions/head\";\nimport { isNotNil } from \"@/utilities/functions/isNotNil\";\nimport { last } from \"@/utilities/functions/last\";\nimport { useItemText } from \"@/composables/useItemText\";\nimport { useItemValue } from \"@/composables/useItemValue\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport { waitFor } from \"@/utilities/functions/waitFor\";\nimport { when } from \"@/utilities/functions/when\";\nimport type { ComputedRef, HTMLAttributes, InputHTMLAttributes } from \"vue\";\nimport type { NestedKeyOf } from \"@/types/NestedKeyOf\";\n\nexport type BaseSelectProps<T> = {\n /**\n * Allows typing into the input.\n */\n allowWriting?: boolean;\n \n /**\n * Guides to the browser as to the type of information expected in the field.\n */\n autocomplete?: InputHTMLAttributes[\"autocomplete\"];\n\n /**\n * Sets autofocus on page load.\n */\n autofocus?: InputHTMLAttributes[\"autofocus\"];\n\n /**\n * Defines an array of dependencies that will trigger actions in the component upon change.\n */\n dependencies?: any[];\n\n /**\n * Timeout used to debounce response to changes to dependencies.\n */\n depsDebounceTime?: number;\n\n /**\n * Disables the component\n */\n disabled?: boolean;\n\n /**\n * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n *\n * e.g. You cannot set v-model to a user that is not present in the items passed.\n *\n * modelValue will be reset upon incoherence.\n */\n enforceCoherence?: boolean;\n\n /**\n * Define if the component should be in an error state.\n * It usually attaches a CSS class for styling purposes.\n */\n hasErrors?: boolean;\n\n /**\n * The identifier of the component.\n */\n id?: HTMLAttributes[\"id\"];\n\n /**\n * String displayed while items are being loaded.\n */\n loadingText?: string;\n\n /**\n * Defines the strategy used to understand whether an option has been selected.\n * `string` is 40% faster but relies on property order.\n * `equality` is more reliable but is slower.\n */\n matchStrategy?: \"string\" | \"equality\";\n\n /**\n * Timeout used to debounce response to changes to modelValue.\n */\n modelValueDebounceTime?: number;\n\n /**\n * Allows the selection of multiple items.\n */\n multiple?: boolean;\n\n /**\n * Defines the name of the input.\n */\n name?: InputHTMLAttributes[\"name\"];\n\n /**\n * String displayed when there are no items to display.\n */\n noDataText?: string;\n\n /**\n * String displayed when there's no data.\n */\n placeholder?: InputHTMLAttributes[\"placeholder\"];\n\n /**\n * Sets the input in a readonly state.\n */\n readonly?: InputHTMLAttributes[\"readonly\"];\n\n /**\n * How long the transition has to last in milliseconds\n */\n transitionDuration?: number;\n /**\n * Used to retrieve items can be an array or a function.\n */\n items:\n | T[]\n | ((query: string, prefill: boolean, modelValue: any) => Promise<T[]>)\n | ((query: string, prefill: boolean, modelValue: any) => T[]);\n\n /**\n * Defines a path that returns a property of the object to use as text or a function that returns a string\n */\n itemText?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => string) | undefined;\n\n /**\n * Defines a path that returns a property of the object to use as value or a function that returns any value\n */\n itemValue?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => any) | undefined;\n /**\n * Used by v-model. Can be any serializable type.\n */\n modelValue: any;\n\n /**\n * Allows the user to add options to the list by\n * inserting text in the input and pressing ENTER.\n * The value and text of the option generated is a\n * string equal to what has been inserted.\n */\n addOptions?: boolean;\n /**\n * Sets the display model for selected values to a list\n * of comma separated string. In this mode the user\n * cannot deselect an option by pressing the close button.\n */\n comma?: boolean;\n /**\n * Defines how the filtering should work.\n * In any case options are always filtered by the text displayed but\n * they can also take into account other properties of the\n * passed elements when this property is a string or an array of string.\n * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n * You can also pass false to not filter anything or a function for more granular control.\n *\n */\n filterBy?:\n | string\n | string[]\n | false\n | ((value: any, item: T) => boolean)\n | null;\n /**\n * Defines the prefill strategy for the input. By default the input will prefill\n * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n */\n prefill?: boolean | \"focus\";\n /**\n * Time to wait when the users stops writing in the input before querying data.\n * Especially useful when searching live data on big datasets.\n */\n queryDebounceTime?: number;\n /**\n * If `true` when in multiple selection, reset the query immediately\n * upon selecting an option. By default the query is\n * not reset until focus is lost so the user can search\n * for \"Cath\" and select \"Cathy\" and then write more to\n * search for \"Catherine\"\n */\n resetQueryOnOptionSelected?: boolean;\n /**\n * Adds a stash to accumulate selected values. Especially\n * useful when searching in a big database of items.\n * E.g. if you search for \"John\" and then search for \"Richard\"\n * you either always return the previous items or you stash them passing `true` to this option.\n */\n stash?: boolean;\n /**\n * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n */\n updateOnAnimationFrame?: boolean;\n};\n\nexport type BaseOption<T> = {\n id: string;\n jsonValue: string;\n manual: boolean;\n original: T;\n text: string;\n value: any;\n disabled: boolean;\n};\n\nexport type Option<T> = BaseOption<T> & {\n index: number;\n selected: boolean;\n};\n\nexport type FilteredOption<T> = Option<T> & {\n focused: boolean;\n};\n\nexport type BaseSelectEvents = {\n (e: \"blur\", event: FocusEvent): void;\n (e: \"change\", event: Event): void;\n (e: \"click\", event: MouseEvent): void;\n (e: \"focus\", event: FocusEvent): void;\n (e: \"inactive\"): void;\n (e: \"input\", event: Event): void;\n (e: \"update:modelValue\", value: any): void;\n};\n\nexport type BaseSelectSlots<T> = {\n \"prepend-outer\"?: (props: {}) => any;\n prepend?: (props: {}) => any;\n \"options:prepend\"?: (props: {}) => any;\n loading?: (props: { query: string }) => any;\n \"no-data\"?: (props: { query: string }) => any;\n \"option:prepend\"?: (props: { item: T }) => any;\n chip?: (props: {\n disabled: boolean;\n hasErrors?: boolean;\n index: number;\n item: T;\n loading: boolean;\n manual: boolean;\n selected: boolean;\n text: string;\n value: any;\n }) => any;\n option?: (props: {\n disabled: boolean;\n focused: boolean;\n hasErrors?: boolean;\n index: number;\n item: T;\n loading: boolean;\n manual: boolean;\n selected: boolean;\n text: string;\n value: any;\n }) => any;\n \"option:append\"?: (props: { item: T }) => any;\n \"options:append\"?: (props: {}) => any;\n chevron?: (props: { loading: boolean; shown: boolean }) => any;\n append?: (props: {}) => any;\n spinner?: (props: { loading: boolean }) => any;\n \"append-outer\"?: (props: {}) => any;\n};\n\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseSelect',\n props: {\n allowWriting: { type: Boolean, default: true },\n autocomplete: {},\n autofocus: {},\n dependencies: {},\n depsDebounceTime: { default: 0 },\n disabled: { type: Boolean },\n enforceCoherence: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n loadingText: { default: \"Caricamento...\" },\n matchStrategy: { default: \"string\" },\n modelValueDebounceTime: { default: 0 },\n multiple: { type: Boolean },\n name: {},\n noDataText: { default: \"Nessun elemento da visualizzare\" },\n placeholder: {},\n readonly: {},\n transitionDuration: { default: 200 },\n items: {},\n itemText: {},\n itemValue: {},\n modelValue: {},\n addOptions: { type: Boolean },\n comma: { type: Boolean },\n filterBy: { type: [String, Array, Boolean, Function, null], default: () => [] },\n prefill: { type: [Boolean, String], default: \"focus\" },\n queryDebounceTime: { default: 500 },\n resetQueryOnOptionSelected: { type: Boolean },\n stash: { type: Boolean },\n updateOnAnimationFrame: { type: Boolean, default: false }\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"inactive\", \"input\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n throw new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst optionsContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst query = ref<string>(\"\");\nconst computedPlaceholder = computed(() => {\n if (selectedOptions.value.length) return \"\";\n else return props.placeholder;\n});\n/**\n * Use a number accumulator because if the fn takes 5 seconds\n * and after 2 seconds another search is run\n * When the first returns the second is still out for 2 seconds\n * and we want to track them both.\n * Debounce will not be enough.\n */\nconst loading = ref(0);\nconst transitionDuration = props.transitionDuration / 1000 + \"s\";\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n if (innerContainer.value && optionsContainer.value) {\n cleanUpPositioning = autoUpdate(\n innerContainer.value,\n optionsContainer.value,\n displayOptions,\n {\n ancestorResize: true,\n ancestorScroll: true,\n animationFrame: props.updateOnAnimationFrame,\n elementResize: true,\n }\n );\n }\n});\nonBeforeUnmount(() => {\n cleanUpPositioning();\n});\n\nconst internalItems = ref<T[]>([]);\nconst stash = ref<BaseOption<T>[]>([]);\nconst manualItems = ref<BaseOption<T>[]>([]);\nconst { getItemText } = useItemText();\nconst { getItemValue } = useItemValue();\n\nconst internalOptions = computed<BaseOption<T>[]>(() => {\n return internalItems.value.map((item: any, _) => {\n const text = getItemText(item, props.itemText as any);\n const value = getItemValue(item, props.itemValue);\n\n // Undefined is not JSONable\n if (value === undefined)\n throw new Error(\n 'The result of extracting \"value\" from option was undefined. Affected item is ' +\n JSON.stringify(item) +\n \" please check itemValue property is correct.\"\n );\n\n const jsonValue = JSON.stringify(value);\n return {\n disabled: !!item.disabled,\n id: \"option_\" + jsonValue.replace(/\\W/g, \"_\"),\n jsonValue,\n manual: false,\n original: item,\n text,\n value,\n };\n });\n});\n\nconst options = computed<Option<T>[]>(() => {\n let fromOptions = internalOptions.value.reduce(\n (acc: { [key: string]: BaseOption<T> }, curr: BaseOption<T>) => {\n acc[curr.id] = curr;\n return acc;\n },\n {}\n );\n const withManual: { [key: string]: BaseOption<T> } = manualItems.value.reduce(\n (acc, curr) => {\n if (!acc[curr.id]) acc[curr.id] = curr as any;\n return acc;\n },\n fromOptions\n );\n const withStash: { [key: string]: BaseOption<T> } = stash.value.reduce(\n (acc, curr) => {\n if (!acc[curr.id]) acc[curr.id] = curr as any;\n return acc;\n },\n withManual\n );\n return Object.values(withStash).map<Option<T>>(\n (option: BaseOption<T>, index) => {\n return {\n ...option,\n selected: isNotNil(modelValueIndexed.value.get(option.value)),\n index,\n };\n }\n );\n});\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<FilteredOption<T>[]>(() => {\n let base = [];\n /** Only filter when a value is being searched not when the query is fully set on a selected option text */\n if (\n query.value &&\n !selectedOptions.value.some(\n (option: Option<T>) => option.text === query.value\n )\n ) {\n base = options.value.filter((item: Option<T>) => {\n let matchedAnything = false;\n if (!props.filterBy) return true;\n else if (typeof props.filterBy === \"function\")\n matchedAnything = props.filterBy(item.value, item.original);\n else if (props.filterBy.length) {\n const keys = ([] as string[]).concat(props.filterBy);\n for (let index = 0; index < keys.length; index++) {\n const propName = keys[index];\n matchedAnything =\n matchedAnything ||\n ((item.original as any)[propName] &&\n (item.original as any)[propName]\n .toLowerCase()\n .includes(query.value.toLowerCase()));\n }\n }\n return (\n matchedAnything ||\n item.text.toLowerCase().includes(query.value.toLowerCase())\n );\n });\n /** Otherwise defaul;t to the whole set of options */\n } else base = options.value;\n /** This is done here so that only visible options are highlighted */\n return base.map((option: Option<T>, index) => ({\n ...option,\n focused: normalizedFocusedIndex.value === index,\n }));\n});\n\n/**\n * Indexes options by id for retrieval\n */\n\nconst optionsIndexedById = computed<{\n [key: string]: Option<T>;\n}>(() =>\n options.value.reduce(\n (acc, curr) => ({\n ...acc,\n [curr.id]: curr,\n }),\n {}\n )\n);\n\n/**\n * Indexes options by their value\n * (using JSON to circumvent identical objects not being equal in JS)\n */\nconst optionsIndexedByValue = computed(() => {\n if (props.matchStrategy === \"string\") {\n let indexed = options.value.reduce(\n (acc: { [key: string]: Option<T> }, curr: Option<T>) => {\n acc[curr.jsonValue] = curr;\n return acc;\n },\n {}\n );\n return {\n get: (key: any) => {\n return indexed[JSON.stringify(key)];\n },\n };\n } else if (props.matchStrategy === \"equality\") {\n let indexed: [any, Option<T>][] = options.value.map((option) => [\n option.value,\n option,\n ]);\n\n return {\n get: (key: any) => {\n return indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n});\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\nconst modelValueIndexed = computed(() => {\n if (props.matchStrategy === \"string\") {\n let map: { [key: string]: number } = {};\n [].concat(props.modelValue).forEach((value: any, index: number) => {\n map[JSON.stringify(value)] = index;\n });\n return {\n get: (value: any) => map[JSON.stringify(value)],\n };\n } else if (props.matchStrategy === \"equality\") {\n const map = []\n .concat(props.modelValue)\n .filter(isNotNil)\n .map((value, index) => [value, index]);\n\n return {\n get: (key: any) => {\n return map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n});\n\n/**\n * For every item in modelValue find the linked option if it exists.\n * This is used to display chips.\n */\nconst selectedOptions = computed(() => {\n return [].concat(props.modelValue).reduce((acc: Option<T>[], curr: any) => {\n const linkedOption = optionsIndexedByValue.value.get(curr);\n if (linkedOption) acc.push(linkedOption);\n return acc;\n }, []);\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option<T>) => {\n let valueToEmit;\n focusedIndex.value = option.index;\n /**\n * For single selection:\n * If the option was already selected - restore the value to default, clean the stash, manual items, and query.\n * If the option was not selected - use its value, save the option in the stash and display it's text as query\n * The stash is used to remove the complexity of stashing items when searching for identifying information,\n * like searching an address would not return the option that was used to selected a previous address in another country.\n * Or when searching users by username would not return the previous ones.\n * We save it so the user hasn't to.\n */\n if (!props.multiple) {\n if (option.selected) {\n if (option.manual) {\n manualItems.value = manualItems.value.filter(\n (current: any) => current.id !== option.id\n );\n }\n valueToEmit = null;\n if (props.stash) {\n stash.value = [];\n }\n query.value = \"\";\n } else {\n valueToEmit = option.value;\n if (props.stash) {\n stash.value = [option as any];\n }\n query.value = option.text;\n }\n /**\n * For multiple selection\n * If the option was selected remove it from modelValue, if it is a mnaual iutem also remove it from there.\n * In the stash we can search for the id of the option.\n * If the option was not selected we can just add it to modelValue and the stash.\n */\n } else {\n if (option.selected) {\n if (option.manual) {\n manualItems.value = manualItems.value.filter(\n (current: any) => current.id !== option.id\n );\n }\n valueToEmit = props.modelValue.filter(\n (value: any) => JSON.stringify(value) !== option.jsonValue\n );\n if (props.stash) {\n stash.value = stash.value.filter((stashed) => stashed.id !== option.id);\n }\n } else {\n valueToEmit = props.modelValue.concat(option.value);\n if (props.stash) {\n stash.value = stash.value.concat(option as any);\n }\n }\n if (props.resetQueryOnOptionSelected) {\n query.value = \"\";\n }\n }\n emit(\"update:modelValue\", valueToEmit);\n};\n\nconst getOptions = async ({ prefill = false }) => {\n let items: T[] = [];\n if (Array.isArray(props.items)) {\n items = props.items;\n } else {\n if (typeof props.items === \"function\") {\n loading.value++;\n items = await props.items(query.value, prefill, props.modelValue);\n loading.value--;\n }\n }\n internalItems.value = items as any;\n};\n\n/**\n * Add an option to the manual items and then reset the query\n */\nconst addOption = () => {\n const text = query.value;\n const value = query.value;\n const jsonValue = JSON.stringify(value);\n const option = {\n text,\n value,\n jsonValue,\n id: \"option_\" + jsonValue.replace(/\\W/g, \"_\"),\n original: value,\n manual: true,\n disabled: false,\n };\n manualItems.value = manualItems.value.concat(option as any);\n query.value = \"\";\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n props.prefill === true ||\n (!props.multiple && isNotNil(props.modelValue)) ||\n (props.multiple && !!props.modelValue.length);\n/**\n * When modelValue changes split behavior for single and multiple selection:\n */\nlet modelValueTimeout: ReturnType<typeof setTimeout>;\nlet hasRunOnce = false;\nwatch(\n () => props.modelValue,\n (current, previous) => {\n if (modelValueTimeout) clearTimeout(modelValueTimeout);\n modelValueTimeout = setTimeout(\n async () => {\n /**\n * For single selection if the value is already in the option (most likely you are using\n * static items) just use it.\n * If the value is not in the options try searching for it (outside dependencies may fix it).\n * If at last the value cannot be found even after searching\n * reset value to the default value when coherence is enforced\n * or at least do not display the old query\n */\n if (!props.multiple) {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (\n (!found && isNotNil(props.modelValue)) ||\n previous === undefined\n ) {\n const currentQuery = query.value;\n query.value = \"\";\n await getOptions({ prefill: true });\n query.value = currentQuery;\n }\n found = optionsIndexedByValue.value.get(props.modelValue);\n if (found) {\n query.value = found.text;\n if (props.stash) {\n stash.value = [found as any];\n }\n } else {\n if (props.enforceCoherence && isNotNil(current)) {\n query.value = \"\";\n if (props.stash) {\n stash.value = [];\n }\n emit(\"update:modelValue\", null);\n } else {\n query.value = \"\";\n }\n }\n /**\n * For multiple selection if every value is already in the options (most likely you are using\n * static items) just use them.\n * If not all the values are in the current options or is prefilling try searching (outside depencencies may fix the situation).\n * If the values are still not in the available options and coherence is enforced\n * discard the ones that are invalid.\n *\n */\n } else {\n if (!Array.isArray(props.modelValue)) {\n throw new Error(\"props.modelValue is not an array.\");\n }\n let allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n if (!allFound || previous === undefined) {\n await getOptions({ prefill: true });\n allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n }\n if (allFound) {\n if (props.stash) {\n stash.value = props.modelValue.map(\n (value: any) => optionsIndexedByValue.value.get(value)!\n ) as any;\n }\n } else {\n let coherentStash: Option<T>[] = [];\n const coherent = current.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n if (found) coherentStash.push(found);\n return found;\n });\n if (props.stash) {\n stash.value = coherentStash as any;\n }\n if (props.enforceCoherence) {\n emit(\"update:modelValue\", coherent);\n }\n }\n }\n },\n shouldPrefill ? 0 : props.modelValueDebounceTime\n );\n },\n // Prefill when asked or when items are static\n { immediate: shouldPrefill, deep: true }\n);\n\n/**\n * This is triggered to refresh static items whenever the passed array changes.\n * If the parent defines an array in the template this is triggered\n * at every render so we take counter measures\n * Even if the entire array changes all the previously selected values are still in the stash.\n */\nwatch(\n () => props.items,\n async (current, previous) => {\n if (\n typeof current === \"function\" ||\n // Circumvent arrays defined in the template by the parent\n JSON.stringify(current) !== JSON.stringify(previous)\n ) {\n await getOptions({ prefill: false });\n if (props.multiple) {\n const allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n\n if (!allFound) {\n if (props.enforceCoherence) {\n const coherent = props.modelValue.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n return found;\n });\n emit(\"update:modelValue\", coherent);\n }\n }\n } else {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n emit(\"update:modelValue\", null);\n }\n focusedIndex.value = null;\n }\n }\n }\n);\n\n/**\n * When dependencies change\n * If the input has not been prefilled yet just return\n * Check dependencies are the same by value and not reference\n * Otherwise we search again for options as they might be different base on dependencies.\n * If coherence is enforced we set the state accordingly\n */\nlet depsTimeout: ReturnType<typeof setTimeout>;\nwatch(\n () => props.dependencies,\n (current, previous) => {\n if (!shouldPrefill && props.prefill === \"focus\" && isFirstFocus) {\n return;\n }\n // Circumvent array defined in the template by the parent\n if (JSON.stringify(current) === JSON.stringify(previous)) {\n return;\n }\n\n if (depsTimeout) clearTimeout(depsTimeout);\n depsTimeout = setTimeout(async () => {\n if (JSON.stringify(current) !== JSON.stringify(previous)) {\n // Only reset the stash if we are going to enforce coherence\n if (props.enforceCoherence) {\n if (props.stash) {\n stash.value = [];\n }\n }\n // Momentarily reset query\n let currentQuery = query.value;\n query.value = \"\";\n await getOptions({ prefill: true });\n query.value = currentQuery;\n if (!props.multiple) {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n query.value = \"\";\n if (props.stash) {\n stash.value = [];\n }\n emit(\"update:modelValue\", null);\n }\n } else {\n let allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n if (!allFound && props.enforceCoherence) {\n let coherentStash: Option<T>[] = [];\n const coherent = props.modelValue.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n if (found) coherentStash.push(found);\n return found;\n });\n if (props.stash) {\n stash.value = coherentStash as any;\n }\n emit(\"update:modelValue\", coherent);\n }\n }\n }\n }, props.depsDebounceTime);\n },\n { deep: true }\n);\n\n/**\n * This is used to position the option container.\n * When the linked item (outerContainer) updates its position\n * this is rerun by floating-UI\n */\nconst displayOptions = () => {\n if (innerContainer.value && optionsContainer.value) {\n computePosition(innerContainer.value, optionsContainer.value, {\n placement: \"bottom\",\n middleware: [offset(6), flip(), shift()],\n }).then((data) => {\n if (optionsContainer.value) {\n optionsContainer.value.style.left = `${data.x}px`;\n optionsContainer.value.style.top = `${data.y}px`;\n optionsContainer.value.style.width = `${innerContainer.value?.offsetWidth}px`;\n }\n });\n }\n};\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n hidden.value = false;\n showing.value = true;\n await wait(props.transitionDuration);\n showing.value = false;\n shown.value = true;\n};\n\nconst close = async () => {\n shown.value = false;\n hiding.value = true;\n await wait(props.transitionDuration);\n hiding.value = false;\n hidden.value = true;\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nlet isFirstFocus = true;\nconst onInputFocus = async (event: FocusEvent) => {\n emit(\"focus\", event);\n active.value = true;\n document.addEventListener(\"click\", onClickOutside);\n document.addEventListener(\"focusin\", onFocusOutside);\n if (input.value instanceof HTMLInputElement) input.value.select();\n if (props.prefill === \"focus\" && isFirstFocus && !shouldPrefill) {\n await getOptions({ prefill: true });\n isFirstFocus = false;\n }\n};\n\nconst onFocusOutside = (event: FocusEvent) => {\n if (event.target instanceof Node) {\n if (outerContainer.value && optionsContainer.value) {\n if (\n !outerContainer.value.contains(event.target) &&\n !optionsContainer.value.contains(event.target)\n ) {\n close();\n emit(\"inactive\");\n document.removeEventListener(\"focusin\", onFocusOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\n/**\n * On single selection restore the query that might be partially altered by the user.\n * Input can blur either by clicking outside or clicking on an option.\n * We do nothing if the user has selected an option. And we restore the\n * query to its text if the user has moved focus\n */\nconst onInputBlur = async (event: FocusEvent) => {\n emit(\"blur\", event);\n if (!props.multiple) {\n let noop = false;\n const currentModelValue = props.modelValue;\n await Promise.race([\n wait(250),\n waitFor(() => {\n return currentModelValue !== props.modelValue;\n }).then(() => {\n noop = true;\n }),\n ]);\n if (!noop) {\n const found = optionsIndexedByValue.value.get(props.modelValue);\n if (found) {\n query.value = found.text;\n }\n }\n }\n};\n\nconst onInputChange = (event: Event) => emit(\"change\", event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n emit(\"input\", event);\n if (query.value === \"\") {\n if (!props.multiple) {\n emit(\"update:modelValue\", null);\n }\n }\n if (typeof props.items === \"function\") {\n searchByQuery();\n }\n};\n\n// This is the vertical index used to highlight options in the container\nconst focusedIndex = ref<number | null>(null);\n/**\n * Normalize the index using the displayed options so we can start over when reaching the end.\n * Please watch out for the side effect it is used to avoid the\n * complexity of using modulo over negative numbers\n */\nconst normalizedFocusedIndex: ComputedRef<number | null> = computed(() => {\n if (Number.isInteger(focusedIndex.value) && focusedIndex.value) {\n if (focusedIndex.value === -1) {\n focusedIndex.value = filteredOptions.value.length - 1;\n }\n return focusedIndex.value % filteredOptions.value.length;\n }\n return focusedIndex.value;\n});\n\n// This is the horizontal index used to highlight selected options\nconst selectedOptionsFocusedIndex = ref<number | null>(null);\n\n/**\n * Increment the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnNextOption = () => {\n if (focusedIndex.value !== null) focusedIndex.value++;\n else {\n focusedIndex.value = 0;\n }\n nextTick().then(() => {\n if (normalizedFocusedIndex.value !== null) {\n const foundOption = optionsContainer.value?.querySelector(\n `#${options.value[normalizedFocusedIndex.value].id}`\n );\n if (foundOption instanceof HTMLElement)\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n }\n });\n};\n\n/**\n * Decrement the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnPreviousOption = () => {\n if (focusedIndex.value !== null) focusedIndex.value--;\n else focusedIndex.value = options.value.length - 1;\n\n nextTick().then(() => {\n if (normalizedFocusedIndex.value !== null) {\n const foundOption = optionsContainer.value?.querySelector(\n `#${options.value[normalizedFocusedIndex.value].id}`\n );\n if (foundOption instanceof HTMLElement)\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n }\n });\n};\n\n/**\n * This is handled separately from input because it has a lot to do with user\n * interaction and control characters than it has with the query.\n */\nconst onInputKeyDown = async (event: KeyboardEvent) => {\n if (props.readonly || props.disabled) {\n event.preventDefault();\n return;\n }\n switch (event.key) {\n /**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\n case \"ArrowUp\":\n {\n event.preventDefault();\n if (loading.value) return;\n selectedOptionsFocusedIndex.value = null;\n if (shown.value) {\n focusOnPreviousOption();\n } else {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n await open();\n }\n }\n break;\n /**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\n case \"ArrowDown\":\n {\n event.preventDefault();\n if (loading.value) return;\n selectedOptionsFocusedIndex.value = null;\n if (shown.value) {\n focusOnNextOption();\n } else {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n await open();\n }\n }\n break;\n /**\n * When moving horizontally\n * Cycle from rightmost, next, or input focus.\n * If the focus lands on an option align the vertical focus as well\n */\n case \"ArrowLeft\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value =\n selectedOptions.value.length - 1;\n } else if (selectedOptionsFocusedIndex.value > 0) {\n selectedOptionsFocusedIndex.value--;\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n\n if (selectedOptionsFocusedIndex.value !== null) {\n let linkedOption =\n selectedOptions.value[selectedOptionsFocusedIndex.value];\n let foundOption = optionsContainer.value?.querySelector(\n `#${linkedOption.id}`\n );\n if (foundOption) {\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n\n focusedIndex.value =\n optionsIndexedById.value[\n selectedOptions.value[selectedOptionsFocusedIndex.value].id\n ].index;\n }\n }\n }\n }\n }\n break;\n /**\n * When moving horizontally\n * Cycle from leftmost, next, or input focus.\n * If the focus lands on an option align the vertical focus as well\n */\n case \"ArrowRight\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value = 0;\n } else if (\n selectedOptionsFocusedIndex.value <\n selectedOptions.value.length - 1\n ) {\n selectedOptionsFocusedIndex.value++;\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n\n if (selectedOptionsFocusedIndex.value !== null) {\n let linkedOption =\n selectedOptions.value[selectedOptionsFocusedIndex.value];\n let foundOption = optionsContainer.value?.querySelector(\n `#${linkedOption.id}`\n );\n if (foundOption) {\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n\n focusedIndex.value =\n optionsIndexedById.value[\n selectedOptions.value[selectedOptionsFocusedIndex.value].id\n ].index;\n }\n }\n }\n }\n }\n break;\n /**\n * If the panel is closed focus on the first selected option.\n * If the panel was already open select/deselect the currently focused option\n * and close the panel of single selection is enabled\n */\n case \"Enter\":\n {\n event.preventDefault();\n if (loading.value) return;\n if (!shown.value) {\n if (filteredOptions.value.length) {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n }\n await open();\n } else {\n if (normalizedFocusedIndex.value !== null) {\n if (filteredOptions.value[normalizedFocusedIndex.value].disabled)\n return;\n if (!props.multiple) {\n await close();\n }\n onOptionSelected(\n filteredOptions.value[normalizedFocusedIndex.value]\n );\n } else {\n if (props.addOptions) {\n if (props.itemText || props.itemValue) {\n console.error(\n `Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n );\n return;\n }\n addOption();\n const added = last(manualItems.value);\n onOptionSelected(optionsIndexedById.value[added.id]);\n }\n }\n }\n }\n break;\n /**\n * When moving away from the component reset focus both vertically and horizontally\n */\n case \"Tab\":\n case \"Escape\":\n {\n if (shown.value) {\n await close();\n }\n emit(\"inactive\");\n selectedOptionsFocusedIndex.value = null;\n focusedIndex.value = null;\n }\n break;\n // Prevent shift from opening the panel\n case \"Shift\":\n {\n if (loading.value) return;\n }\n break;\n /**\n * Delete behavior is different when query is empty\n * If query is empty\n * If no chip is selected - select rightmost chip\n * If a chip is selected - deselect that option\n * If any option remains move focus to that or reset\n */\n case \"Backspace\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value =\n selectedOptions.value.length - 1;\n } else {\n onOptionSelected(\n selectedOptions.value[selectedOptionsFocusedIndex.value]\n );\n if (selectedOptions.value.length) {\n selectedOptionsFocusedIndex.value = Math.max(\n Math.min(\n selectedOptionsFocusedIndex.value,\n selectedOptions.value.length - 2\n ),\n 0\n );\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n }\n }\n }\n await open();\n }\n break;\n /**\n * Open the panel on writing and reset horizontal focus\n */\n default:\n {\n selectedOptionsFocusedIndex.value = null;\n focusedIndex.value = null;\n await open();\n }\n break;\n }\n};\n\n/**\n * Triggered on input when items is a function.\n */\n\nlet timeout: ReturnType<typeof setTimeout>;\nconst searchByQuery = () => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(async () => {\n try {\n await getOptions({ prefill: false });\n } catch (error) {\n console.error(error);\n }\n }, props.queryDebounceTime);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n emit(\"click\", event);\n if (props.disabled || props.readonly) return;\n if (input.value instanceof HTMLElement) {\n input.value.focus();\n }\n open();\n};\n\n/**\n * When an option is clicked wait for it to bubble to the option container to avoid slot event problems.\n * Select / deselect the option and then move focus to the input.\n * If it is single selection mode close the panel\n */\nconst onOptionClicked = (event: Event) => {\n if (event.currentTarget instanceof HTMLElement) {\n if (event.currentTarget.classList.contains(\"bb-base-select-option\")) {\n const option = optionsIndexedById.value[event.currentTarget.id];\n if (option.disabled) return;\n onOptionSelected(option);\n if (input.value instanceof HTMLInputElement) {\n input.value.focus();\n }\n if (!props.multiple) close();\n }\n }\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onClickOutside = (event: Event) => {\n if (event.target instanceof Node) {\n if (outerContainer.value) {\n if (!outerContainer.value.contains(event.target)) {\n close();\n emit(\"inactive\");\n document.removeEventListener(\"click\", onClickOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n (item: unknown) => typeof item !== \"string\",\n JSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n return [].concat(props.modelValue).map((current) => {\n const value = makeInputValue(current);\n return {\n disabled: props.disabled,\n name: props.name,\n type: \"hidden\",\n value: value,\n };\n });\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-select': true,\n 'bb-base-select--active': active.value,\n 'bb-base-select--loading': loading.value,\n 'bb-base-select--disabled': _ctx.disabled,\n 'bb-base-select--errors': _ctx.hasErrors,\n 'bb-base-select--readonly': _ctx.readonly,\n }),\n onClick: onOuterContainerClick,\n ref_key: \"outerContainer\",\n ref: outerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n class: \"bb-base-select__inner-container\",\n ref_key: \"innerContainer\",\n ref: innerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.multiple)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_ctx.comma)\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-select__selected': true,\n 'bb-base-select__selected--comma': true,\n 'bb-base-select__selected--focused':\n index === selectedOptionsFocusedIndex.value,\n }),\n key: option.id\n }, _toDisplayString(option.text) + _toDisplayString(index < selectedOptions.value.length - 1 ? \",\" : \"\"), 3))\n }), 128))\n : (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createBlock(BbChip, {\n class: _normalizeClass({\n 'bb-base-select__selected': true,\n 'bb-base-select__selected--chip': true,\n 'bb-base-select__selected--focused':\n index === selectedOptionsFocusedIndex.value,\n }),\n clearable: true,\n key: option.id,\n text: option.text,\n \"onClick:clear\": _withModifiers(($event: any) => (onOptionSelected(option)), [\"stop\"])\n }, {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"chip\", {\n disabled: option.disabled,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createTextVNode(_toDisplayString(option.text), 1)\n ])\n ]),\n _: 2\n }, 1032, [\"class\", \"text\", \"onClick:clear\"]))\n }), 128))\n ], 64))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createElementVNode(\"input\", {\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n class: _normalizeClass('bb-base-select__text-input'),\n disabled: _ctx.disabled,\n id: _ctx.id,\n placeholder: computedPlaceholder.value,\n readonly: _ctx.readonly || !_ctx.allowWriting,\n type: 'text',\n onBlur: _withModifiers(onInputBlur, [\"stop\"]),\n onFocus: _withModifiers(onInputFocus, [\"stop\"]),\n onChange: _withModifiers(onInputChange, [\"stop\"]),\n onInput: _withModifiers(onInputInput, [\"stop\"]),\n onKeydown: _withModifiers(onInputKeyDown, [\"stop\"]),\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((query).value = $event)),\n ref_key: \"input\",\n ref: input\n }, null, 40, _hoisted_2), [\n [_vModelDynamic, query.value]\n ]),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass({\n 'bb-base-select__options-container': true,\n 'bb-base-select__options-container--shown': shown.value,\n 'bb-base-select__options-container--showing': showing.value,\n 'bb-base-select__options-container--hiding': hiding.value,\n 'bb-base-select__options-container--hidden': hidden.value,\n }),\n role: 'listbox',\n style: _normalizeStyle({ transitionDuration: transitionDuration }),\n tabindex: -1,\n ref_key: \"optionsContainer\",\n ref: optionsContainer\n }, [\n _renderSlot(_ctx.$slots, \"options:prepend\"),\n (!filteredOptions.value.length && loading.value)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_3, [\n _renderSlot(_ctx.$slots, 'loading', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.loadingText), 1)\n ])\n ]))\n : (!filteredOptions.value.length)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_4, [\n _renderSlot(_ctx.$slots, 'no-data', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.noDataText), 1)\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(filteredOptions.value, (option) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: option.id\n }, [\n _renderSlot(_ctx.$slots, \"option:prepend\", {\n item: option.original\n }),\n _createElementVNode(\"span\", {\n \"aria-selected\": option.selected,\n class: _normalizeClass({\n 'bb-base-select-option': true,\n 'bb-base-select-option--selected': option.selected,\n 'bb-base-select-option--focused': option.focused,\n 'bb-base-select-option--disabled': option.disabled,\n }),\n id: option.id,\n role: 'option',\n onClick: _withModifiers(onOptionClicked, [\"stop\"])\n }, [\n _renderSlot(_ctx.$slots, \"option\", {\n disabled: option.disabled,\n focused: option.focused,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createElementVNode(\"span\", _hoisted_6, [\n _createElementVNode(\"span\", _hoisted_7, _toDisplayString(option.text), 1)\n ])\n ])\n ], 10, _hoisted_5),\n _renderSlot(_ctx.$slots, \"option:append\", {\n item: option.original\n })\n ], 64))\n }), 128)),\n _renderSlot(_ctx.$slots, \"options:append\")\n ], 6)\n ]))\n ]),\n _createElementVNode(\"span\", _hoisted_8, [\n _renderSlot(_ctx.$slots, \"chevron\", {\n loading: !!loading.value,\n shown: shown.value\n }, () => [\n _hoisted_9\n ])\n ]),\n (!loading.value)\n ? _renderSlot(_ctx.$slots, \"append\", { key: 0 })\n : (_openBlock(), _createElementBlock(\"span\", {\n key: 1,\n class: _normalizeClass({\n 'bb-base-select__spinner': true,\n 'bb-base-select__spinner--loading': loading.value,\n })\n }, [\n _renderSlot(_ctx.$slots, 'spinner', {\n loading: !!loading.value\n }, () => [\n _createVNode(BbSpinner, { size: 'sm' })\n ])\n ], 2))\n ], 512),\n _renderSlot(_ctx.$slots, \"append-outer\"),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(hiddenInputs.value, (input) => {\n return (_openBlock(), _createElementBlock(\"input\", _mergeProps({\n key: input.value\n }, input), null, 16))\n }), 128))\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_sfc_main","_defineComponent","__props","__emit","props","emit","outerContainer","ref","innerContainer","optionsContainer","input","query","computedPlaceholder","computed","selectedOptions","loading","transitionDuration","cleanUpPositioning","onMounted","autoUpdate","displayOptions","onBeforeUnmount","internalItems","stash","manualItems","getItemText","useItemText","getItemValue","useItemValue","internalOptions","item","_","text","value","jsonValue","options","fromOptions","acc","curr","withManual","withStash","option","index","isNotNil","modelValueIndexed","filteredOptions","base","matchedAnything","keys","propName","normalizedFocusedIndex","optionsIndexedById","optionsIndexedByValue","indexed","key","_a","pairs","deepEqual","map","linkedOption","onOptionSelected","valueToEmit","focusedIndex","current","stashed","getOptions","prefill","items","addOption","shouldPrefill","modelValueTimeout","watch","previous","allFound","coherentStash","coherent","found","currentQuery","depsTimeout","isFirstFocus","computePosition","offset","flip","shift","data","shown","showing","hiding","hidden","open","wait","close","active","onInputFocus","event","onClickOutside","onFocusOutside","onInputBlur","noop","currentModelValue","waitFor","onInputChange","onInputInput","searchByQuery","selectedOptionsFocusedIndex","focusOnNextOption","nextTick","foundOption","focusOnPreviousOption","onInputKeyDown","head","_b","added","last","timeout","error","onOuterContainerClick","onOptionClicked","makeInputValue","when","hiddenInputs","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_Fragment","_renderList","_toDisplayString","_createBlock","BbChip","_withModifiers","$event","_withCtx","_createTextVNode","_createCommentVNode","_withDirectives","_vModelDynamic","_Teleport","_normalizeStyle","_createVNode","BbSpinner","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,qCACtBC,KAAa,CAAC,gBAAgB,aAAa,YAAY,MAAM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KtI,EAAM;AAAA,MACVA,GAAAA,CAAK,GAAG,MAAM,EAAE,EACpB,GAAG,GAAG;AAAA,OACN,CAAC;AAAA,EAEN;AAEA,CAAC;"}
|
package/dist/index33.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as R, ref as l, onMounted as S, watchEffect as z, computed as y, openBlock as D, createElementBlock as F, mergeProps as h, renderSlot as g, createElementVNode as t, normalizeProps as H, guardReactiveProps as T, normalizeStyle as E, unref as X } from "vue";
|
|
2
2
|
import { clamp as K } from "./index196.js";
|
|
3
|
-
import { isCssColor as w } from "./
|
|
3
|
+
import { isCssColor as w } from "./index201.js";
|
|
4
4
|
import { isNil as O } from "./index120.js";
|
|
5
5
|
import { transposeValue as L } from "./index121.js";
|
|
6
6
|
const Y = { class: "bb-base-slider__slider-container" }, j = ["disabled", "id", "name", "readonly", "value"], q = ["aria-readonly", "aria-valuemax", "aria-valuemin", "aria-valuenow", "tabindex"], W = /* @__PURE__ */ R({
|
package/dist/index35.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as I, ref as b, computed as n, watch as F, openBlock as m, createElementBlock as p, normalizeClass as N, normalizeProps as c, mergeProps as h, createCommentVNode as S, createElementVNode as l, renderSlot as x, guardReactiveProps as f } from "vue";
|
|
2
|
-
import { isCssColor as V } from "./
|
|
3
|
-
import { when as A } from "./
|
|
2
|
+
import { isCssColor as V } from "./index201.js";
|
|
3
|
+
import { when as A } from "./index202.js";
|
|
4
4
|
const J = { class: "bb-base-switch-container" }, M = /* @__PURE__ */ l("span", { class: "bb-base-switch-container__icon-thumb" }, null, -1), O = [
|
|
5
5
|
M
|
|
6
6
|
], H = /* @__PURE__ */ I({
|
package/dist/index47.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as p, computed as u, ref as d, watch as f, openBlock as a, createElementBlock as l, normalizeProps as b, guardReactiveProps as z, createElementVNode as v, renderSlot as g, createCommentVNode as h } from "vue";
|
|
2
|
-
import { isCssColor as _ } from "./
|
|
2
|
+
import { isCssColor as _ } from "./index201.js";
|
|
3
3
|
const k = { class: "bb-avatar__fallback" }, C = ["alt", "src", "srcset", "sizes"], B = /* @__PURE__ */ p({
|
|
4
4
|
__name: "BbAvatar",
|
|
5
5
|
props: {
|
package/dist/index49.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as p, useSlots as d, computed as n, openBlock as m, createElementBlock as u, normalizeClass as g, createElementVNode as s, renderSlot as l, mergeProps as f, createTextVNode as _, toDisplayString as y } from "vue";
|
|
2
|
-
import { isCssColor as r } from "./
|
|
2
|
+
import { isCssColor as r } from "./index201.js";
|
|
3
3
|
import { isNil as B } from "./index120.js";
|
|
4
4
|
const C = { class: "bb-badge__wrapper" }, h = { class: "bb-badge__content-inner" }, S = /* @__PURE__ */ p({
|
|
5
5
|
__name: "BbBadge",
|
package/dist/index65.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as Y, computed as M, ref as v, openBlock as D, createElementBlock as H, mergeProps as S, createElementVNode as h, renderSlot as y, normalizeProps as Z, guardReactiveProps as ee, unref as c, createBlock as te, Teleport as oe, normalizeClass as ne, normalizeStyle as z, Fragment as N, renderList as ae, createVNode as le, withCtx as se, createCommentVNode as ie } from "vue";
|
|
2
|
-
import { findRightIndex as I } from "./
|
|
3
|
-
import { useFloating as re, arrow as ue } from "./
|
|
2
|
+
import { findRightIndex as I } from "./index222.js";
|
|
3
|
+
import { useFloating as re, arrow as ue } from "./index223.js";
|
|
4
4
|
import { useId as de } from "./index7.js";
|
|
5
5
|
import { wait as U } from "./index122.js";
|
|
6
6
|
import ce from "./index9.js";
|
|
7
7
|
import "./index10.js";
|
|
8
|
-
import V from "./
|
|
9
|
-
import { autoUpdate as fe, flip as pe, shift as be } from "./
|
|
10
|
-
import { offset as me } from "./
|
|
8
|
+
import V from "./index218.js";
|
|
9
|
+
import { autoUpdate as fe, flip as pe, shift as be } from "./index214.js";
|
|
10
|
+
import { offset as me } from "./index219.js";
|
|
11
11
|
const ve = ["aria-labelledby", "id"], we = { class: "bb-dropdown__items-container" }, Me = /* @__PURE__ */ Y({
|
|
12
12
|
__name: "BbDropdown",
|
|
13
13
|
props: {
|
package/dist/index69.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as H, ref as h, watch as M, computed as m, openBlock as z, createBlock as N, resolveDynamicComponent as R, normalizeClass as j, withCtx as _, createElementVNode as d, withModifiers as g, renderSlot as G, normalizeProps as K, guardReactiveProps as O, createTextVNode as U, unref as Y, createVNode as Z, createElementBlock as x, Fragment as J, renderList as Q, toDisplayString as W } from "vue";
|
|
2
|
-
import { findInTree as X } from "./
|
|
2
|
+
import { findInTree as X } from "./index225.js";
|
|
3
3
|
import { useId as ee } from "./index7.js";
|
|
4
4
|
import te from "./index118.js";
|
|
5
5
|
import "./index183.js";
|
|
@@ -52,7 +52,7 @@ const re = ["accept", "autofocus", "disabled", "multiple"], ae = {
|
|
|
52
52
|
if (a.includes("/"))
|
|
53
53
|
e.push(a);
|
|
54
54
|
else {
|
|
55
|
-
y || (y = await import("./
|
|
55
|
+
y || (y = await import("./index224.js").then((s) => s.i));
|
|
56
56
|
const o = y.getType(a);
|
|
57
57
|
if (!o)
|
|
58
58
|
throw new Error(
|
package/dist/index72.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
|
|
2
|
-
import { throttle as c } from "./
|
|
2
|
+
import { throttle as c } from "./index198.js";
|
|
3
3
|
const M = /* @__PURE__ */ h({
|
|
4
4
|
__name: "BbIntersection",
|
|
5
5
|
props: {
|
package/dist/index75.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as q, ref as s, useAttrs as G, computed as m, onMounted as J, watch as Q, onBeforeUnmount as X, openBlock as y, createBlock as Y, Teleport as Z, createElementVNode as o, mergeProps as N, createElementBlock as w, renderSlot as l, createTextVNode as ee, toDisplayString as z, createCommentVNode as B, nextTick as te } from "vue";
|
|
2
|
-
import { useFocusTrap as oe } from "./
|
|
2
|
+
import { useFocusTrap as oe } from "./index199.js";
|
|
3
3
|
import { useId as L } from "./index7.js";
|
|
4
4
|
import { wait as O } from "./index122.js";
|
|
5
5
|
const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__content" }, ne = { class: "bb-offcanvas-close__label" }, le = /* @__PURE__ */ o("span", { class: "bb-offcanvas-close__icon" }, [
|