Module 27270

1,411 characters · in no known chunk
Dependencies
Required by (1)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{O:()=>h});var r=n(567359),i=n(301982),s=n(723906),a=n(807177),o=n(290424),l=n(132716),u=n(803082),c=n(885714),d=n(946020),_=n(795122),f=n(47276);function p(e){return e&&e.__esModule?e.default:e}function h(e,t,n){let{item:h}=e,m=(0,f.o)(p(i.A),"@react-aria/tag"),E=(0,s.Bi)(),{onRemove:g}=r.O.get(t)||{},{rowProps:A,gridCellProps:I,...T}=(0,_.n)({node:h},t,n),{descriptionProps:S,...y}=T,v=t.disabledKeys.has(h.key)||h.props.isDisabled,N=e=>{("Delete"===e.key||"Backspace"===e.key)&&(v||(e.preventDefault(),t.selectionManager.isSelected(h.key)?null==g||g(new Set(t.selectionManager.selectedKeys)):null==g||g(new Set([h.key]))))},C=(0,c.lb)();"virtual"===C&&"u">typeof window&&"ontouchstart"in window&&(C="pointer");let R=g&&("keyboard"===C||"virtual"===C)?m.format("removeDescription"):"",O=(0,a.I)(R),b=h.key===t.selectionManager.focusedKey,D=null!=t.selectionManager.focusedKey,L=-1;v||!b&&D||(L=0);let w=(0,o.$)(h.props),M=(0,l.HI)(h.props),{focusableProps:P}=(0,d.Wc)({isDisabled:v},n);return{removeButtonProps:{"aria-label":m.format("removeButtonLabel"),"aria-labelledby":`${E} ${A.id}`,isDisabled:v,id:E,onPress:()=>g?g(new Set([h.key])):null},rowProps:(0,u.v)(P,A,w,M,{tabIndex:L,onKeyDown:g?N:void 0,"aria-describedby":O["aria-describedby"]}),gridCellProps:(0,u.v)(I,{"aria-errormessage":e["aria-errormessage"],"aria-label":e["aria-label"]}),...y,allowsRemoving:!!g}}}