1- import { toRefs , getCurrentInstance , ref , computed , watch , nextTick , onMounted , openBlock , createElementBlock , normalizeClass , createCommentVNode , mergeProps , withModifiers , Fragment , renderList , renderSlot , withKeys , createTextVNode , toDisplayString , createElementVNode } from 'vue' ;
1+ import { toRefs , getCurrentInstance , ref , computed , watch , nextTick , onMounted , openBlock , createElementBlock , mergeProps , createCommentVNode , withModifiers , normalizeClass , Fragment , renderList , renderSlot , withKeys , createTextVNode , toDisplayString , createElementVNode } from 'vue' ;
22
33function isNullish ( val ) {
44 return [ null , undefined ] . indexOf ( val ) !== - 1
@@ -1891,10 +1891,10 @@ function useScroll (props, context, dep)
18911891 // ============ DEPENDENCIES ============
18921892
18931893 const pointer = dep . pointer ;
1894- const iv = dep . iv ;
1895- const hasSelected = dep . hasSelected ;
1896- const multipleLabelText = dep . multipleLabelText ;
1897- const isOpen = dep . isOpen ;
1894+ dep . iv ;
1895+ dep . hasSelected ;
1896+ dep . multipleLabelText ;
1897+ dep . isOpen ;
18981898
18991899 // ================ DATA ================
19001900
@@ -1930,37 +1930,10 @@ function useScroll (props, context, dep)
19301930 }
19311931 } ) ;
19321932
1933- const ariaLabel = computed ( ( ) => {
1934- let texts = [ ] ;
1935-
1936- /* istanbul ignore next */
1937- if ( label . value ) {
1938- texts . push ( label . value ) ;
1939- }
1940-
1941- if ( ! pointer . value || ! isOpen . value ) {
1942- if ( placeholder . value && ! hasSelected . value ) {
1943- texts . push ( placeholder . value ) ;
1944- }
1945-
1946- if ( mode . value === 'single' && iv . value && iv . value [ labelProp . value ] !== undefined ) {
1947- texts . push ( iv . value [ labelProp . value ] ) ;
1948- }
1949-
1950- if ( mode . value === 'multiple' && hasSelected . value ) {
1951- texts . push ( multipleLabelText . value ) ;
1952- }
1953-
1954- if ( mode . value === 'tags' && hasSelected . value ) {
1955- texts . push ( ...iv . value . map ( v => v [ labelProp . value ] ) ) ;
1956- }
1957- }
19581933
1959- return texts . join ( ', ' )
1960- } ) ;
19611934
19621935 const ariaPlaceholder = computed ( ( ) => {
1963- return ariaLabel . value
1936+ return placeholder . value
19641937 } ) ;
19651938
19661939 const ariaMultiselectable = computed ( ( ) => {
@@ -2029,7 +2002,6 @@ function useScroll (props, context, dep)
20292002
20302003 return {
20312004 ariaOwns,
2032- ariaLabel,
20332005 ariaPlaceholder,
20342006 ariaMultiselectable,
20352007 ariaActiveDescendant,
@@ -2341,6 +2313,11 @@ var script = {
23412313 required : false ,
23422314 default : false ,
23432315 } ,
2316+ aria : {
2317+ required : false ,
2318+ type : Object ,
2319+ default : ( ) => ( { } ) ,
2320+ } ,
23442321 } ,
23452322 setup ( props , context )
23462323 {
@@ -2361,11 +2338,11 @@ var script = {
23612338 }
23622339 } ;
23632340
2364- const _hoisted_1 = [ "tabindex" , "id" , "dir" , "aria-owns" , "aria-label" , "aria- placeholder", "aria-expanded" , "aria-activedescendant" , "aria-multiselectable" ] ;
2365- const _hoisted_2 = [ "type" , "modelValue" , "value" , "autocomplete" , "id" , "aria-owns" , "aria-label" , "aria- placeholder", "aria-expanded" , "aria-activedescendant" , "aria-multiselectable" ] ;
2341+ const _hoisted_1 = [ "tabindex" , "id" , "dir" , "aria-owns" , "aria-placeholder" , "aria-expanded" , "aria-activedescendant" , "aria-multiselectable" , "role "] ;
2342+ const _hoisted_2 = [ "type" , "modelValue" , "value" , "autocomplete" , "id" , "aria-owns" , "aria-placeholder" , "aria-expanded" , "aria-activedescendant" , "aria-multiselectable" ] ;
23662343const _hoisted_3 = [ "onKeyup" , "aria-label" ] ;
23672344const _hoisted_4 = [ "onClick" ] ;
2368- const _hoisted_5 = [ "type" , "modelValue" , "value" , "id" , "autocomplete" , "aria-owns" , "aria-label" , "aria- placeholder", "aria-expanded" , "aria-activedescendant" , "aria-multiselectable" ] ;
2345+ const _hoisted_5 = [ "type" , "modelValue" , "value" , "id" , "autocomplete" , "aria-owns" , "aria-placeholder" , "aria-expanded" , "aria-activedescendant" , "aria-multiselectable" ] ;
23692346const _hoisted_6 = [ "innerHTML" ] ;
23702347const _hoisted_7 = [ "innerHTML" ] ;
23712348const _hoisted_8 = [ "id" ] ;
@@ -2384,25 +2361,24 @@ const _hoisted_20 = ["name", "value"];
23842361const _hoisted_21 = [ "name" , "value" ] ;
23852362
23862363function render ( _ctx , _cache , $props , $setup , $data , $options ) {
2387- return ( openBlock ( ) , createElementBlock ( "div" , {
2364+ return ( openBlock ( ) , createElementBlock ( "div" , mergeProps ( {
23882365 ref : "multiselect" ,
23892366 tabindex : _ctx . tabindex ,
2390- class : normalizeClass ( _ctx . classList . container ) ,
2367+ class : _ctx . classList . container ,
23912368 id : $props . searchable ? undefined : $props . id ,
23922369 dir : $props . rtl ? 'rtl' : undefined ,
23932370 onFocusin : _cache [ 9 ] || ( _cache [ 9 ] = ( ...args ) => ( _ctx . handleFocusIn && _ctx . handleFocusIn ( ...args ) ) ) ,
23942371 onFocusout : _cache [ 10 ] || ( _cache [ 10 ] = ( ...args ) => ( _ctx . handleFocusOut && _ctx . handleFocusOut ( ...args ) ) ) ,
23952372 onKeydown : _cache [ 11 ] || ( _cache [ 11 ] = ( ...args ) => ( _ctx . handleKeydown && _ctx . handleKeydown ( ...args ) ) ) ,
23962373 onKeyup : _cache [ 12 ] || ( _cache [ 12 ] = ( ...args ) => ( _ctx . handleKeyup && _ctx . handleKeyup ( ...args ) ) ) ,
23972374 onMousedown : _cache [ 13 ] || ( _cache [ 13 ] = ( ...args ) => ( _ctx . handleMousedown && _ctx . handleMousedown ( ...args ) ) ) ,
2398- "aria-owns" : _ctx . ariaOwns ,
2399- "aria-label" : _ctx . ariaLabel ,
2400- "aria-placeholder" : _ctx . ariaPlaceholder ,
2401- "aria-expanded" : _ctx . isOpen ,
2402- "aria-activedescendant" : _ctx . ariaActiveDescendant ,
2403- "aria-multiselectable" : _ctx . ariaMultiselectable ,
2404- role : "listbox"
2405- } , [
2375+ "aria-owns" : ! $props . searchable ? _ctx . ariaOwns : undefined ,
2376+ "aria-placeholder" : ! $props . searchable ? _ctx . ariaPlaceholder : undefined ,
2377+ "aria-expanded" : ! $props . searchable ? _ctx . isOpen : undefined ,
2378+ "aria-activedescendant" : ! $props . searchable ? _ctx . ariaActiveDescendant : undefined ,
2379+ "aria-multiselectable" : ! $props . searchable ? _ctx . ariaMultiselectable : undefined ,
2380+ role : ! $props . searchable ? 'listbox' : undefined
2381+ } , ! $props . searchable ? $props . aria : { } ) , [
24062382 createCommentVNode ( " Search " ) ,
24072383 ( $props . mode !== 'tags' && $props . searchable && ! $props . disabled )
24082384 ? ( openBlock ( ) , createElementBlock ( "input" , mergeProps ( {
@@ -2412,19 +2388,20 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
24122388 value : _ctx . search ,
24132389 class : _ctx . classList . search ,
24142390 autocomplete : $props . autocomplete ,
2415- id : $props . searchable ? $props . id : undefined
2416- } , $props . attrs , {
2391+ id : $props . searchable ? $props . id : undefined ,
24172392 onInput : _cache [ 0 ] || ( _cache [ 0 ] = ( ...args ) => ( _ctx . handleSearchInput && _ctx . handleSearchInput ( ...args ) ) ) ,
24182393 onKeypress : _cache [ 1 ] || ( _cache [ 1 ] = ( ...args ) => ( _ctx . handleKeypress && _ctx . handleKeypress ( ...args ) ) ) ,
24192394 onPaste : _cache [ 2 ] || ( _cache [ 2 ] = withModifiers ( ( ...args ) => ( _ctx . handlePaste && _ctx . handlePaste ( ...args ) ) , [ "stop" ] ) ) ,
24202395 ref : "input" ,
24212396 "aria-owns" : _ctx . ariaOwns ,
2422- "aria-label" : _ctx . ariaLabel ,
24232397 "aria-placeholder" : _ctx . ariaPlaceholder ,
24242398 "aria-expanded" : _ctx . isOpen ,
24252399 "aria-activedescendant" : _ctx . ariaActiveDescendant ,
24262400 "aria-multiselectable" : _ctx . ariaMultiselectable ,
24272401 role : "listbox"
2402+ } , {
2403+ ...$props . attrs ,
2404+ ...$props . aria ,
24282405 } ) , null , 16 /* FULL_PROPS */ , _hoisted_2 ) )
24292406 : createCommentVNode ( "v-if" , true ) ,
24302407 createCommentVNode ( " Tags (with search) " ) ,
@@ -2479,20 +2456,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
24792456 value : _ctx . search ,
24802457 class : _ctx . classList . tagsSearch ,
24812458 id : $props . searchable ? $props . id : undefined ,
2482- autocomplete : $props . autocomplete
2483- } , $props . attrs , {
2459+ autocomplete : $props . autocomplete ,
24842460 onInput : _cache [ 3 ] || ( _cache [ 3 ] = ( ...args ) => ( _ctx . handleSearchInput && _ctx . handleSearchInput ( ...args ) ) ) ,
24852461 onKeypress : _cache [ 4 ] || ( _cache [ 4 ] = ( ...args ) => ( _ctx . handleKeypress && _ctx . handleKeypress ( ...args ) ) ) ,
24862462 onPaste : _cache [ 5 ] || ( _cache [ 5 ] = withModifiers ( ( ...args ) => ( _ctx . handlePaste && _ctx . handlePaste ( ...args ) ) , [ "stop" ] ) ) ,
24872463 ref : "input" ,
24882464 "aria-owns" : _ctx . ariaOwns ,
2489- "aria-label" : _ctx . ariaLabel ,
24902465 "aria-placeholder" : _ctx . ariaPlaceholder ,
24912466 "aria-expanded" : _ctx . isOpen ,
24922467 "aria-activedescendant" : _ctx . ariaActiveDescendant ,
24932468 "aria-multiselectable" : _ctx . ariaMultiselectable ,
24942469 role : "listbox"
2495- } ) , null , 16 /* FULL_PROPS */ , _hoisted_5 ) )
2470+ } , {
2471+ ...$props . attrs ,
2472+ ...$props . aria ,
2473+ } ) , null , 16 /* FULL_PROPS */ , _hoisted_5 ) )
24962474 : createCommentVNode ( "v-if" , true )
24972475 ] , 2 /* CLASS */ )
24982476 ] , 2 /* CLASS */ ) )
@@ -2735,7 +2713,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
27352713 createElementVNode ( "div" , {
27362714 class : normalizeClass ( _ctx . classList . spacer )
27372715 } , null , 2 /* CLASS */ )
2738- ] , 42 /* CLASS, PROPS, HYDRATE_EVENTS */ , _hoisted_1 ) )
2716+ ] , 16 /* FULL_PROPS */ , _hoisted_1 ) )
27392717}
27402718
27412719script . render = render ;
0 commit comments