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' ;
2
2
3
3
function isNullish ( val ) {
4
4
return [ null , undefined ] . indexOf ( val ) !== - 1
@@ -1891,10 +1891,10 @@ function useScroll (props, context, dep)
1891
1891
// ============ DEPENDENCIES ============
1892
1892
1893
1893
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 ;
1898
1898
1899
1899
// ================ DATA ================
1900
1900
@@ -1930,37 +1930,10 @@ function useScroll (props, context, dep)
1930
1930
}
1931
1931
} ) ;
1932
1932
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
- }
1958
1933
1959
- return texts . join ( ', ' )
1960
- } ) ;
1961
1934
1962
1935
const ariaPlaceholder = computed ( ( ) => {
1963
- return ariaLabel . value
1936
+ return placeholder . value
1964
1937
} ) ;
1965
1938
1966
1939
const ariaMultiselectable = computed ( ( ) => {
@@ -2029,7 +2002,6 @@ function useScroll (props, context, dep)
2029
2002
2030
2003
return {
2031
2004
ariaOwns,
2032
- ariaLabel,
2033
2005
ariaPlaceholder,
2034
2006
ariaMultiselectable,
2035
2007
ariaActiveDescendant,
@@ -2341,6 +2313,11 @@ var script = {
2341
2313
required : false ,
2342
2314
default : false ,
2343
2315
} ,
2316
+ aria : {
2317
+ required : false ,
2318
+ type : Object ,
2319
+ default : ( ) => ( { } ) ,
2320
+ } ,
2344
2321
} ,
2345
2322
setup ( props , context )
2346
2323
{
@@ -2361,11 +2338,11 @@ var script = {
2361
2338
}
2362
2339
} ;
2363
2340
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" ] ;
2366
2343
const _hoisted_3 = [ "onKeyup" , "aria-label" ] ;
2367
2344
const _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" ] ;
2369
2346
const _hoisted_6 = [ "innerHTML" ] ;
2370
2347
const _hoisted_7 = [ "innerHTML" ] ;
2371
2348
const _hoisted_8 = [ "id" ] ;
@@ -2384,25 +2361,24 @@ const _hoisted_20 = ["name", "value"];
2384
2361
const _hoisted_21 = [ "name" , "value" ] ;
2385
2362
2386
2363
function render ( _ctx , _cache , $props , $setup , $data , $options ) {
2387
- return ( openBlock ( ) , createElementBlock ( "div" , {
2364
+ return ( openBlock ( ) , createElementBlock ( "div" , mergeProps ( {
2388
2365
ref : "multiselect" ,
2389
2366
tabindex : _ctx . tabindex ,
2390
- class : normalizeClass ( _ctx . classList . container ) ,
2367
+ class : _ctx . classList . container ,
2391
2368
id : $props . searchable ? undefined : $props . id ,
2392
2369
dir : $props . rtl ? 'rtl' : undefined ,
2393
2370
onFocusin : _cache [ 9 ] || ( _cache [ 9 ] = ( ...args ) => ( _ctx . handleFocusIn && _ctx . handleFocusIn ( ...args ) ) ) ,
2394
2371
onFocusout : _cache [ 10 ] || ( _cache [ 10 ] = ( ...args ) => ( _ctx . handleFocusOut && _ctx . handleFocusOut ( ...args ) ) ) ,
2395
2372
onKeydown : _cache [ 11 ] || ( _cache [ 11 ] = ( ...args ) => ( _ctx . handleKeydown && _ctx . handleKeydown ( ...args ) ) ) ,
2396
2373
onKeyup : _cache [ 12 ] || ( _cache [ 12 ] = ( ...args ) => ( _ctx . handleKeyup && _ctx . handleKeyup ( ...args ) ) ) ,
2397
2374
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 : { } ) , [
2406
2382
createCommentVNode ( " Search " ) ,
2407
2383
( $props . mode !== 'tags' && $props . searchable && ! $props . disabled )
2408
2384
? ( openBlock ( ) , createElementBlock ( "input" , mergeProps ( {
@@ -2412,19 +2388,20 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2412
2388
value : _ctx . search ,
2413
2389
class : _ctx . classList . search ,
2414
2390
autocomplete : $props . autocomplete ,
2415
- id : $props . searchable ? $props . id : undefined
2416
- } , $props . attrs , {
2391
+ id : $props . searchable ? $props . id : undefined ,
2417
2392
onInput : _cache [ 0 ] || ( _cache [ 0 ] = ( ...args ) => ( _ctx . handleSearchInput && _ctx . handleSearchInput ( ...args ) ) ) ,
2418
2393
onKeypress : _cache [ 1 ] || ( _cache [ 1 ] = ( ...args ) => ( _ctx . handleKeypress && _ctx . handleKeypress ( ...args ) ) ) ,
2419
2394
onPaste : _cache [ 2 ] || ( _cache [ 2 ] = withModifiers ( ( ...args ) => ( _ctx . handlePaste && _ctx . handlePaste ( ...args ) ) , [ "stop" ] ) ) ,
2420
2395
ref : "input" ,
2421
2396
"aria-owns" : _ctx . ariaOwns ,
2422
- "aria-label" : _ctx . ariaLabel ,
2423
2397
"aria-placeholder" : _ctx . ariaPlaceholder ,
2424
2398
"aria-expanded" : _ctx . isOpen ,
2425
2399
"aria-activedescendant" : _ctx . ariaActiveDescendant ,
2426
2400
"aria-multiselectable" : _ctx . ariaMultiselectable ,
2427
2401
role : "listbox"
2402
+ } , {
2403
+ ...$props . attrs ,
2404
+ ...$props . aria ,
2428
2405
} ) , null , 16 /* FULL_PROPS */ , _hoisted_2 ) )
2429
2406
: createCommentVNode ( "v-if" , true ) ,
2430
2407
createCommentVNode ( " Tags (with search) " ) ,
@@ -2479,20 +2456,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2479
2456
value : _ctx . search ,
2480
2457
class : _ctx . classList . tagsSearch ,
2481
2458
id : $props . searchable ? $props . id : undefined ,
2482
- autocomplete : $props . autocomplete
2483
- } , $props . attrs , {
2459
+ autocomplete : $props . autocomplete ,
2484
2460
onInput : _cache [ 3 ] || ( _cache [ 3 ] = ( ...args ) => ( _ctx . handleSearchInput && _ctx . handleSearchInput ( ...args ) ) ) ,
2485
2461
onKeypress : _cache [ 4 ] || ( _cache [ 4 ] = ( ...args ) => ( _ctx . handleKeypress && _ctx . handleKeypress ( ...args ) ) ) ,
2486
2462
onPaste : _cache [ 5 ] || ( _cache [ 5 ] = withModifiers ( ( ...args ) => ( _ctx . handlePaste && _ctx . handlePaste ( ...args ) ) , [ "stop" ] ) ) ,
2487
2463
ref : "input" ,
2488
2464
"aria-owns" : _ctx . ariaOwns ,
2489
- "aria-label" : _ctx . ariaLabel ,
2490
2465
"aria-placeholder" : _ctx . ariaPlaceholder ,
2491
2466
"aria-expanded" : _ctx . isOpen ,
2492
2467
"aria-activedescendant" : _ctx . ariaActiveDescendant ,
2493
2468
"aria-multiselectable" : _ctx . ariaMultiselectable ,
2494
2469
role : "listbox"
2495
- } ) , null , 16 /* FULL_PROPS */ , _hoisted_5 ) )
2470
+ } , {
2471
+ ...$props . attrs ,
2472
+ ...$props . aria ,
2473
+ } ) , null , 16 /* FULL_PROPS */ , _hoisted_5 ) )
2496
2474
: createCommentVNode ( "v-if" , true )
2497
2475
] , 2 /* CLASS */ )
2498
2476
] , 2 /* CLASS */ ) )
@@ -2735,7 +2713,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2735
2713
createElementVNode ( "div" , {
2736
2714
class : normalizeClass ( _ctx . classList . spacer )
2737
2715
} , null , 2 /* CLASS */ )
2738
- ] , 42 /* CLASS, PROPS, HYDRATE_EVENTS */ , _hoisted_1 ) )
2716
+ ] , 16 /* FULL_PROPS */ , _hoisted_1 ) )
2739
2717
}
2740
2718
2741
2719
script . render = render ;
0 commit comments