PageSourceSearch

https://www.netherlandsandyou.nl/o/frontend-taglib-clay/__liferay__/exports/@clayui$multi-select.js

js netherlandsandyou.nl collected 2026-10-02 03:52:10 UTC 11,391 bytes, 2 lines download raw bytes

1var Ce=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var Fe=Object.prototype.hasOwnProperty;var R=(c,s)=>{for(var u in s)Ce(c,u,{get:s[u],enumerable:!0})},ve=(c,s,u,m)=>{if(s&&typeof s=="object"||typeof s=="function")for(let v of De(s))!Fe.call(c,v)&&v!==u&&Ce(c,v,{get:()=>s[v],enumerable:!(m=Re(s,v))||m.enumerable});return c},o=(c,s,u)=>(ve(c,s,"default"),u&&ve(u,s,"default"));var pe={};R(pe,{default:()=>qe,itemLabelFilter:()=>ke});var h={};R(h,{default:()=>ce});o(h,ze);import*as ze from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$autocomplete.js";import Ne from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$autocomplete.js";var ce=Ne;var D={};R(D,{default:()=>Be});o(D,We);import*as We from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$button.js";import Se from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$button.js";var Be=Se;var b={};R(b,{default:()=>Ve});o(b,Qe);import*as Qe from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$form.js";import Pe from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$form.js";var Ve=Pe;var t={};o(t,Xe);import*as Xe from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$shared.js";var V={};R(V,{default:()=>ie});o(V,et);import*as et from"../../../frontend-js-react-web/__liferay__/exports/classnames.js";import Ke from"../../../frontend-js-react-web/__liferay__/exports/classnames.js";var ie=Ke;var n={};R(n,{default:()=>a});o(n,lt);import*as lt from"../../../frontend-js-react-web/__liferay__/exports/react.js";import Me from"../../../frontend-js-react-web/__liferay__/exports/react.js";var a=Me;var K={};R(K,{default:()=>me});o(K,ot);import*as ot from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$icon.js";import Te from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$icon.js";var me=Te;var M={};R(M,{default:()=>Q});o(M,rt);import*as rt from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$label.js";import Oe from"../../../frontend-taglib-clay/__liferay__/exports/@clayui$label.js";var Q=Oe;function de(){return de=Object.assign?Object.assign.bind():function(c){for(var s=1;s<arguments.length;s++){var u=arguments[s];for(var m in u)({}).hasOwnProperty.call(u,m)&&(c[m]=u[m])}return c},de.apply(null,arguments)}var $e=["Enter",","],je=[t.Keys.Left,t.Keys.Right,t.Keys.Up,t.Keys.Down],Ee=[t.Keys.Left,t.Keys.Right],Ie=0,_e=a.forwardRef(function(s,u){let{allowDuplicateValues:m=!0,allowsCustomLabel:v,"aria-activedescendant":T,ariaDescriptionId:ae,closeButtonAriaLabel:N,disabled:O,inputName:X,insetAfter:be,labels:E,lastChangesRef:Z,locator:I,onChange:$,onFocusChange:ee,onLabelsChange:j,placeholder:oe,spritemap:ne,suggestionList:re,value:_,...g}=s,d=(0,n.useRef)(null),L=(0,n.useRef)(null),y=(0,n.useRef)(null),[S,te]=(0,n.useState)(null),[A,x]=(0,n.useState)(null),B=u||d,q=(0,t.useId)(),se=e=>re.find(l=>(0,t.getLocatorValue)({item:l,locator:I.label})===e),G=e=>{Ie++;let l=typeof I.label=="function"?"label":I.label,r=typeof I.value=="function"?"value":I.value;return se(e)||{key:`key_${Ie}`,[l]:e,[r]:e}},f=(0,n.useCallback)((e,l)=>{if(L.current){let r=Array.from(L.current.querySelectorAll("button")),p=document.activeElement.tagName==="SPAN"?document.activeElement.querySelector("button"):document.activeElement,i=r.indexOf(p),C=r[r.length-1>i?i+1:i-1];C?(C.focus(),x(C.getAttribute("id"))):(B.current?.focus(),x(null))}Z.current={action:"removed",label:e},j(E.filter((r,p)=>p!==l))},[E]);return(0,n.useEffect)(()=>{if(L.current){let e=Array.from(L.current.querySelectorAll(".label [aria-describedby]")),l=e[e.length-1];l&&x(l.getAttribute("id"))}},[E]),a.createElement(b.ClayInput.GroupItem,null,a.createElement(b.ClayInput.Group,null,a.createElement(b.ClayInput.GroupItem,{"aria-labelledby":g["aria-labelledby"],className:"d-contents",onFocus:e=>x(e.target.getAttribute("id")),onKeyDown:e=>{if(je.includes(e.key)){e.preventDefault();let l=Array.from(e.currentTarget.querySelectorAll(Ee.includes(e.key)?"[role=gridcell][tabindex], button":A?.includes("span")?"[role=gridcell][tabindex]":"button")),r=l.indexOf(document.activeElement),p=Ee.includes(e.ke
1y)?t.Keys.Left:t.Keys.Up,i=l[e.key===p?r-1:r+1];i&&(x(i.getAttribute("id")),i.focus())}if(e.key===t.Keys.Home||e.key===t.Keys.End){e.preventDefault();let l=A.includes("span");if(l&&e.key===t.Keys.Home||!l&&e.key===t.Keys.End)return;let r=e.currentTarget.querySelector(`[id=${A?.replace(l?"span":"close",e.key===t.Keys.Home?"span":"close")}]`);r&&(x(r.getAttribute("id")),r.focus())}},prepend:!0,ref:e=>{L.current=e},role:"grid",shrink:!0},E.map((e,l)=>{let r=(0,t.getLocatorValue)({item:e,locator:I.value}),p=(0,t.getLocatorValue)({item:e,locator:I.id})??r,i=`${q}-label-${p}-span`,C=`${q}-label-${p}-close`,P=(0,t.getLocatorValue)({item:e,locator:I.label});return a.createElement(a.Fragment,{key:i},a.createElement(Q,{className:S===i?"focus":void 0,onKeyDown:U=>{let{key:w}=U;w===t.Keys.Backspace&&f(P||"",l)},role:"row",spritemap:ne,tabIndex:-1,withClose:!1},a.createElement(Q.ItemExpand,{"aria-describedby":ae,id:i,onBlur:()=>te(null),onFocus:()=>te(i),role:"gridcell",style:{outline:"none"},tabIndex:A===null&&l===0||A===i?0:-1},P),a.createElement(Q.ItemAfter,{role:"gridcell"},a.createElement("button",{"aria-label":(0,t.sub)(N,[P||""]),className:"close",disabled:O,id:C,onClick:()=>f(P||"",l),ref:U=>{l===E.length-1&&(y.current=U)},tabIndex:A===C?0:-1,type:"button"},a.createElement(me,{spritemap:ne,symbol:"times-small"})))),X&&a.createElement("input",{name:X,type:"hidden",value:r}))})),a.createElement(b.ClayInput.GroupItem,{prepend:!0},a.createElement("input",de({},g,{"aria-activedescendant":T,className:"form-control-inset",disabled:O,onBlur:e=>{g.onBlur&&g.onBlur(e),ee(!1)},onChange:e=>{let{value:l}=e.target;e.target.value=v?l.replace(",",""):l,$(e)},onFocus:e=>{g.onFocus&&g.onFocus(e),ee(!0)},onKeyDown:e=>{g.onKeyDown&&g.onKeyDown(e);let{key:l}=e;if(l===t.Keys.Backspace&&!_&&e.preventDefault(),!(l===t.Keys.Enter&&T))if(v&&_.trim()&&$e.includes(l)){if(!m&&_&&E.find(r=>r.label?.toLowerCase()===`${_}`.toLowerCase())){$({target:{value:""}});return}e.preventDefault(),Z.current={action:"added",label:_},j([...E,G(_)]),$({target:{value:""}})}else!_&&l===t.Keys.Backspace&&B.current&&y.current&&(B.current.blur(),y.current.focus())},onPaste:e=>{if(g.onPaste&&g.onPaste(e),e.defaultPrevented)return;let r=e.clipboardData.getData("Text").split(",").map(p=>G(p.trim())).filter(Boolean);v&&r.length>0&&(e.preventDefault(),j([...E,...r]))},placeholder:E.length?void 0:oe,ref:B,type:"text",value:_})))))});function fe(){return fe=Object.assign?Object.assign.bind():function(c){for(var s=1;s<arguments.length;s++){var u=arguments[s];for(var m in u)({}).hasOwnProperty.call(u,m)&&(c[m]=u[m])}return c},fe.apply(null,arguments)}var xe=a.forwardRef(function(s,u){let{active:m,allowsCustomLabel:v=!0,allowDuplicateValues:T=!0,alignmentByViewport:ae,children:N,clearAllTitle:O="Clear All",closeButtonAriaLabel:X="Remove {0}",defaultActive:be=!1,defaultItems:E=[],defaultValue:Z="",disabled:I,disabledClearAll:$,hotkeysDescription:ee,inputName:j,inputValue:oe,isLoading:ne,isValid:re=!0,items:_,liveRegion:g,locator:d={id:"key",label:"label",value:"value"},loadingState:L,menuRenderer:y,messages:S={hotkeys:"Press backspace to delete the current row.",labelAdded:"Label {0} added to the list",labelRemoved:"Label {0} removed to the list",listCount:"{0} option available.",listCountPlural:"{0} options available.",loading:"Loading...",notFound:"No results found"},onActiveChange:te,onChange:A,onClearAllButtonClick:x,onItemsChange:B,onLoadMore:q,placeholder:se,size:G,sourceItems:f=null,spritemap:e,value:l,...r}=s,p=(0,n.useRef)(null),i=(0,n.useRef)(null),C=(0,n.useRef)(null),[P,U]=(0,n.useState)(!1),[w,H]=(0,t.useControlledState)({defaultName:"defaultItems",defaultValue:E,handleName:"onItemsChange",name:"items",onChange:B,value:_}),[F,le]=(0,t.useControlledState)({defaultName:"defaultValue",defaultValue:Z,handleName:"onChange",name:"value",onChange:A,value:l??oe}),[ge,z]=(0,t.useControlledState)({defaultName:"defaultActive",defaultValue:be,handleName:"onActiveChange",name:"active",onChange:te,value:m}),Y=u||i,ye=(0,t.useId)(),ue=!!q||typeof L=="number",Le=y?t.FocusScope:a.Fragment,Ae=y?{arrowKeysUpDown:!1}:{};(0,n.useEffect)(()=>{y&&console.warn("<ClayMultiSelect />: You are using 'menuRenderer' which is deprecated and missing the new features and improvements that have been implemented in the component try to migrate to the new composition based API to custom list items."),v&&(typeof d.label=="function"||typeof d.value=="function")&&console.warn("<ClayMultiSelect />: Custom labels cannot be created because the expected structure of the label is unknown. Please disable allowsCustomLabel or update the locators to be strings rather than functions.")},[]),(0,n.useEffect)(()=>{y&&f&&z(!!F&&f.length!==0)},[F,f]);let we=(0,n.useCallback)(k=>{let he=W=>{W.preventDefault(),z(!1),!(!T&&w.find(J=>(0,t.getLocatorValue)({item:J,locator:d.value})===(0,t.getLocatorValue)({item:k,locator:d.value})))&&(H([...w,k]),le(""))};if(N&&typeof N=="function"){let W=N(k);return a.cloneElement(W,{onClick:J=>
1{W.props.onClick&&W.props.onClick(J),!J.defaultPrevented&&he(J)}})}return a.createElement(h.Item,{key:(0,t.getLocatorValue)({item:k,locator:d.value}),onClick:he},(0,t.getLocatorValue)({item:k,locator:d.label}))},[N,d,w,H,T]);return a.createElement(Le,Ae,a.createElement("div",{className:ie("form-control form-control-tag-group input-group",{focus:P&&re,[`form-control-tag-group-${G}`]:G}),ref:p},a.createElement(h.Autocomplete,fe({},r,{UNSAFE_loadingShrink:!0,active:y?!1:ge,allowsCustomLabel:typeof d.label=="function"||typeof d.value=="function"?!1:v,ariaDescriptionId:ye,as:_e,closeButtonAriaLabel:X,containerElementRef:p,defaultItems:ue?void 0:f,disabled:I,filterKey:d.label,inputName:j,items:ue?f:void 0,labels:w,lastChangesRef:C,loadingState:L,locator:d,menuTrigger:"focus",messages:S,onActiveChange:y?()=>{}:z,onChange:le,onFocus:y&&f?k=>{r.onFocus&&r.onFocus(k),z(!!F&&f.length!==0)}:r.onFocus,onFocusChange:U,onItemsChange:ue?()=>{}:void 0,onLabelsChange:H,onLoadMore:q,placeholder:se,ref:Y,spritemap:e,suggestionList:f??[],value:F}),we),f&&y&&f.length>0&&a.createElement(ce.DropDown,{active:ge,alignElementRef:p,alignmentByViewport:ae,onActiveChange:z},a.createElement(y,{inputValue:F,locator:d,onItemClick:k=>{H([...w,k]),le(""),Y.current&&Y.current.focus()},sourceItems:f,value:F})),!I&&!$&&(F||w.length>0)&&a.createElement(b.ClayInput.GroupItem,{shrink:!0},a.createElement(D.ClayButtonWithIcon,{"aria-label":O,borderless:!0,className:"component-action",displayType:"secondary",onClick:()=>{x?x():(H([]),le("")),Y.current&&Y.current.focus()},outline:!0,spritemap:e,symbol:"times-circle",title:O})),a.createElement("div",{className:"sr-only"},a.createElement("span",{id:ye},ee??S.hotkeys),a.createElement("span",{"aria-live":"polite","aria-relevant":"text"},C.current?(0,t.sub)(g?g[C.current.action]:C.current.action==="added"?S.labelAdded:S.labelRemoved,[C.current.label]):null))))}),ke=function(c,s){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"label";return c};var qe=Object.assign(xe,{Item:h.Item});var{default:Ge,itemLabelFilter:_t,__esModule:xt}=pe;var kt=Ge;export{xt as __esModule,kt as default,_t as itemLabelFilter};
2//# sourceMappingURL=@clayui$multi-select.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.