@ansible/ansible-ui-framework 2.4.2611 → 2.4.2613

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -29316,8 +29316,8 @@ function bk(e) {
29316
29316
  style: { marginTop: -4, marginBottom: -4 },
29317
29317
  children: b.length
29318
29318
  }
29319
- ) : /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
29320
- /* @__PURE__ */ m.jsx(wC, { numChips: 99, children: b.map((j) => /* @__PURE__ */ m.jsx(
29319
+ ) : /* @__PURE__ */ m.jsxs(wC, { numChips: 99, children: [
29320
+ b.map((j) => /* @__PURE__ */ m.jsx(
29321
29321
  Om,
29322
29322
  {
29323
29323
  isReadOnly: e.disableClearChips,
@@ -29329,7 +29329,7 @@ function bk(e) {
29329
29329
  children: j.label
29330
29330
  },
29331
29331
  j.label
29332
- )) }),
29332
+ )),
29333
29333
  !c && /* @__PURE__ */ m.jsx(
29334
29334
  Wc,
29335
29335
  {
package/index.umd.cjs CHANGED
@@ -360,7 +360,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[ru]+=1);const iu=De.button`
360
360
  opacity: 0.8;
361
361
  `;function tE(e){const{disablePadding:t,alertPrompts:n}=e,r=Bo(),i=e.labelOrientation??r.formLayout,o=e.numberOfColumns?e.numberOfColumns:r.formColumns,a=e.isCompact;let s=m.jsxs(uce,{variant:"light",padding:{default:"noPadding"},children:[n&&n.length>0&&n.map((l,c)=>m.jsx(C.Alert,{style:{margin:12},isInline:!0,title:l,variant:"warning","data-cy":l},c)),m.jsx(C.DescriptionList,{orientation:{sm:i,md:i,lg:i,xl:i,"2xl":i},columnModifier:o==="multiple"?{default:"1Col",sm:"1Col",md:"2Col",lg:"2Col",xl:"3Col","2xl":"3Col"}:o==="two"?{default:"1Col",sm:"1Col",md:"2Col",lg:"2Col",xl:"3Col","2xl":"2Col"}:void 0,style:{maxWidth:1200,padding:t?void 0:24},isCompact:a,children:e.children})]});return e.disableScroll||(s=m.jsx(Zn,{children:s})),s}const uce=De(C.PageSection)`
362
362
  background-color: transparent;
363
- `;var tt=(e=>(e.Table="table",e.List="list",e.Cards="cards",e))(tt||{}),yo=(e=>(e.description="description",e.expanded="expanded",e.hidden="hidden",e))(yo||{}),nE=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e.primary="primary",e.secondary="secondary",e))(nE||{}),rE=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e))(rE||{}),iE=(e=>(e.hidden="hidden",e))(iE||{}),oE=(e=>(e.hidden="hidden",e))(oE||{}),kf=(e=>(e.last="last",e))(kf||{});function nn(e){var r;const{item:t,column:n}=e;if(!n)return m.jsx(m.Fragment,{});switch(n.type){case"text":return m.jsx(d1,{text:n.value(t),to:(r=n.to)==null?void 0:r.call(n,t)});case"description":return m.jsx("div",{style:{minWidth:200,whiteSpace:"normal"},children:n.value(t)});case"datetime":return m.jsx(c1,{value:n.value(t)});case"count":return m.jsx(m.Fragment,{children:n.value(t)??"-"});case"labels":return m.jsx(u1,{labels:n.value(t)??[]});default:return m.jsx(m.Fragment,{children:n.cell(t)})}}function Mp(e){return y.useMemo(()=>e.filter(t=>!(t.table==="hidden"||t.table==="description"||t.table==="expanded")),[e])}function aE(e){return y.useMemo(()=>e.filter(t=>t.list!=="hidden"),[e])}function sE(e){return y.useMemo(()=>e.filter(t=>t.card!=="hidden"),[e])}function Tf(e){return y.useMemo(()=>e.filter(t=>t.modal!=="hidden"),[e])}function dce(e){return e=y.useMemo(()=>e.filter(t=>t.dashboard!=="hidden"),[e]),e=uE(e),e=dE(e),e}function fce(e,t){const n=Mp(e),r=aE(e),i=sE(e);switch(t){case tt.Table:return n;case tt.List:return r;case tt.Cards:return i}}function lE(e){return y.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="description"),[e])}function cE(e){return y.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="expanded"),[e])}function uE(e){return y.useMemo(()=>e.map(t=>({...t,sort:void 0})),[e])}function dE(e){return y.useMemo(()=>e.map(t=>({...t,table:t.table==="expanded"?void 0:t.table})),[e])}function fE(e){const{item:t,columns:n,children:r}=e,i=y.useMemo(()=>n.filter(s=>{if(!t)return!1;if("value"in s&&s.value){const l=s.value(t);if(l==null||typeof l=="string"&&l.trim().length===0)return!1}return!0}),[n,t]),o=y.useMemo(()=>i.filter(s=>s.priority!==kf.last),[i]),a=y.useMemo(()=>i.filter(s=>s.priority===kf.last),[i]);return!t||!i.length?null:m.jsxs(m.Fragment,{children:[o.map(s=>m.jsx(Os,{helpText:s.helpText,label:s.header,children:m.jsx(nn,{column:s,item:t})},s.id??s.header)),r||null,a.map(s=>m.jsx(Os,{label:s.header,children:m.jsx(nn,{column:s,item:t})},s.id??s.header))]})}class hce{constructor(t){ce(this,"value");ce(this,"next");this.value=t}}class mce{constructor(){vh(this,pr);vh(this,pa);vh(this,ya);this.clear()}enqueue(t){const n=new hce(t);ai(this,pr)?(ai(this,pa).next=n,Ui(this,pa,n)):(Ui(this,pr,n),Ui(this,pa,n)),sv(this,ya)._++}dequeue(){const t=ai(this,pr);if(t)return Ui(this,pr,ai(this,pr).next),sv(this,ya)._--,t.value}peek(){if(ai(this,pr))return ai(this,pr).value}clear(){Ui(this,pr,void 0),Ui(this,pa,void 0),Ui(this,ya,0)}get size(){return ai(this,ya)}*[Symbol.iterator](){let t=ai(this,pr);for(;t;)yield t.value,t=t.next}}pr=new WeakMap,pa=new WeakMap,ya=new WeakMap;function gce(e){hE(e);const t=new mce;let n=0;const r=()=>{n<e&&t.size>0&&(t.dequeue()(),n++)},i=()=>{n--,r()},o=async(l,c,u)=>{const d=(async()=>l(...u))();c(d);try{await d}catch{}i()},a=(l,c,u)=>{new Promise(d=>{t.enqueue(d)}).then(o.bind(void 0,l,c,u)),(async()=>(await Promise.resolve(),n<e&&r()))()},s=(l,...c)=>new Promise(u=>{a(l,u,c)});return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(l){hE(l),e=l,queueMicrotask(()=>{for(;n<e&&t.size>0;)r()})}}}),s}function hE(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const Ql=e=>{const t=["json"],n=["non_field_errors"],r=[],i=[];switch(typeof e){case"string":r.push({message:e});break;case"object":if(e===null)break;if(Array.isArray(e)){for(const o of e)typeof o=="string"&&r.push({message:o});break}for(const o of t)if(o in e&&typeof e[o]=="object"&&e[o]!==null)for(const a in e[o]){const s=e[o][a];if(n.includes(a)){if(typeof s=="string")r.push({message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&r.push({message:l})}else if(typeof s=="string")a==="detail"?r.push({message:s}):i.push({name:a,message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&i.push({name:a,message:l})}else e instanceof Error&&r.push({message:e.message});break}return{genericErrors:r,fieldErrors:i}};function Af(e,t){const[n,r]=y.useState(()=>e);y.useEffect(()=>r(e),[e]);const i=y.useCallback(o=>{t?t(o):r(o)},[t]);return[n,i]}function mE(e){const{t}=Me(),{id:n,icon:r,placeholder:i,values:o,onSelect:a,options:s,variant:l,disableClearSelection:c,maxChipSize:u,queryLabel:d,compareOptionValues:f}=e,[h,g]=Af(e.open??!1,e.setOpen),[p,v]=Af(e.searchValue??"",e.setSearchValue),b=y.useRef(null),x=y.useMemo(()=>{const D=[];for(const j of o??[]){const A=s.find(M=>f?f(M.value,j):M.value===j);A?D.push(A):d&&j!==void 0&&D.push({label:d(j),value:j})}return D},[s,d,o,f]),S=D=>m.jsx(C.Tooltip,{content:e.isDisabled,trigger:e.isDisabled?void 0:"manual",children:m.jsx(C.MenuToggle,{id:n,ref:D,onClick:()=>g(!h),isExpanded:h,onKeyDown:j=>{switch(j.key){case"Tab":case"Enter":case"Shift":break;default:g(!0),setTimeout(()=>{E.current&&(E.current.focus(),E.current.value=j.key)},1);break}},"data-cy":n,icon:r,isDisabled:!!e.isDisabled,isFullWidth:!0,style:{paddingTop:2,paddingBottom:4,minHeight:36},children:x.length>0?m.jsx(m.Fragment,{children:l==="count"?m.jsx(C.Chip,{isReadOnly:c,onClick:()=>a(()=>[]),style:{marginTop:-4,marginBottom:-4},children:x.length}):m.jsxs(m.Fragment,{children:[m.jsx(C.ChipGroup,{numChips:99,children:x.map(j=>m.jsx(C.Chip,{isReadOnly:e.disableClearChips,textMaxWidth:u,style:{marginTop:-2,marginBottom:-2},onClick:()=>a(A=>A==null?void 0:A.filter(M=>M!==j.value)),children:j.label},j.label))}),!c&&m.jsx(ve.TimesIcon,{role:"button","aria-hidden":!0,onClick:()=>a(()=>[]),style:{verticalAlign:"middle",marginLeft:8}})]})}):m.jsx("span",{style:{opacity:.7},children:i})})}),w=y.useMemo(()=>x.map(D=>D.label),[x]),_=y.useCallback((D,j)=>{a(A=>{const M=s.find(P=>P.key!==void 0?P.key===j:P.label===j);return M&&((A==null?void 0:A.find(P=>f?f(P,M.value):P===M.value))!==void 0?A=A.filter(P=>f?!f(P,M.value):P!==M.value):(A=A?[...A]:[],A.push(M.value))),A})},[a,s,f]),E=y.useRef(null);y.useEffect(()=>{h||v("")},[h,v]);const O=y.useMemo(()=>{const D=s.filter(j=>p===""?!0:j.label.toLowerCase().includes(p.toLowerCase()));return e.disableSortOptions||D.sort((j,A)=>j.label.toLowerCase().localeCompare(A.label.toLowerCase())),D},[s,e.disableSortOptions,p]),T=y.useMemo(()=>{if(s.some(j=>!!j.group)){const j={};for(const A of O){const M=A.group??"";j[M]||(j[M]=[]),j[M].push(A)}return j}},[s,O]);return m.jsxs(C.Select,{id:`${n}-select`,selected:w,onSelect:_,isOpen:h,onOpenChange:g,toggle:S,popperProps:{appendTo:()=>document.body,preventOverflow:!0,enableFlip:!0},innerRef:b,children:[m.jsx(C.MenuSearch,{children:m.jsx(C.MenuSearchInput,{"data-cy":"search-input",children:m.jsx(C.SearchInput,{id:`${n}-search`,ref:E,value:p,onChange:(D,j)=>v(j),onClear:D=>{D.stopPropagation(),v("")},resultsCount:O.length!==s.length?`${O.length} / ${s.length}`:void 0,onKeyDown:D=>{var j;switch(D.key){case"ArrowDown":case"Tab":{D.preventDefault(),D.stopPropagation();const A=(j=b==null?void 0:b.current)==null?void 0:j.querySelector("li button:not(:disabled),li input:not(:disabled)");A&&A.focus();break}}}})})}),m.jsx(C.Divider,{}),O.length===0?m.jsx(m.Fragment,{children:e.isLoading?m.jsx(C.Bullseye,{style:{padding:16},children:m.jsx(C.Spinner,{size:"lg"})}):m.jsx(C.SelectOption,{isDisabled:!0,children:t("No results found")},"no result")}):m.jsx(pce,{children:T?m.jsx(m.Fragment,{children:Object.keys(T).map(D=>m.jsx(C.SelectGroup,{label:D,children:m.jsx(gE,{searchRef:E,options:O,selectedOptions:x})},D))}):m.jsx(gE,{searchRef:E,options:O,selectedOptions:x})}),e.footer&&m.jsx(C.MenuFooter,{children:e.footer})]})}function gE(e){return m.jsx(C.SelectList,{onKeyDown:t=>{var n;switch(t.key){case"Tab":t.preventDefault(),t.stopPropagation(),(n=e.searchRef.current)==null||n.focus();break}},children:e.options.map(t=>{const n=Br(t);return m.jsx(C.SelectOption,{id:n,icon:t.icon,value:t.key!==void 0?t.key:t.label,description:t.description?m.jsx("div",{style:{maxWidth:300},children:t.description}):void 0,hasCheckbox:!0,isSelected:e.selectedOptions.includes(t),"data-cy":n,children:t.label},t.key!==void 0?t.key:t.label)})})}const pce=De(Zn)`
363
+ `;var tt=(e=>(e.Table="table",e.List="list",e.Cards="cards",e))(tt||{}),yo=(e=>(e.description="description",e.expanded="expanded",e.hidden="hidden",e))(yo||{}),nE=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e.primary="primary",e.secondary="secondary",e))(nE||{}),rE=(e=>(e.name="name",e.subtitle="subtitle",e.description="description",e.hidden="hidden",e))(rE||{}),iE=(e=>(e.hidden="hidden",e))(iE||{}),oE=(e=>(e.hidden="hidden",e))(oE||{}),kf=(e=>(e.last="last",e))(kf||{});function nn(e){var r;const{item:t,column:n}=e;if(!n)return m.jsx(m.Fragment,{});switch(n.type){case"text":return m.jsx(d1,{text:n.value(t),to:(r=n.to)==null?void 0:r.call(n,t)});case"description":return m.jsx("div",{style:{minWidth:200,whiteSpace:"normal"},children:n.value(t)});case"datetime":return m.jsx(c1,{value:n.value(t)});case"count":return m.jsx(m.Fragment,{children:n.value(t)??"-"});case"labels":return m.jsx(u1,{labels:n.value(t)??[]});default:return m.jsx(m.Fragment,{children:n.cell(t)})}}function Mp(e){return y.useMemo(()=>e.filter(t=>!(t.table==="hidden"||t.table==="description"||t.table==="expanded")),[e])}function aE(e){return y.useMemo(()=>e.filter(t=>t.list!=="hidden"),[e])}function sE(e){return y.useMemo(()=>e.filter(t=>t.card!=="hidden"),[e])}function Tf(e){return y.useMemo(()=>e.filter(t=>t.modal!=="hidden"),[e])}function dce(e){return e=y.useMemo(()=>e.filter(t=>t.dashboard!=="hidden"),[e]),e=uE(e),e=dE(e),e}function fce(e,t){const n=Mp(e),r=aE(e),i=sE(e);switch(t){case tt.Table:return n;case tt.List:return r;case tt.Cards:return i}}function lE(e){return y.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="description"),[e])}function cE(e){return y.useMemo(()=>e.filter(t=>t.table==="hidden"?!1:t.table==="expanded"),[e])}function uE(e){return y.useMemo(()=>e.map(t=>({...t,sort:void 0})),[e])}function dE(e){return y.useMemo(()=>e.map(t=>({...t,table:t.table==="expanded"?void 0:t.table})),[e])}function fE(e){const{item:t,columns:n,children:r}=e,i=y.useMemo(()=>n.filter(s=>{if(!t)return!1;if("value"in s&&s.value){const l=s.value(t);if(l==null||typeof l=="string"&&l.trim().length===0)return!1}return!0}),[n,t]),o=y.useMemo(()=>i.filter(s=>s.priority!==kf.last),[i]),a=y.useMemo(()=>i.filter(s=>s.priority===kf.last),[i]);return!t||!i.length?null:m.jsxs(m.Fragment,{children:[o.map(s=>m.jsx(Os,{helpText:s.helpText,label:s.header,children:m.jsx(nn,{column:s,item:t})},s.id??s.header)),r||null,a.map(s=>m.jsx(Os,{label:s.header,children:m.jsx(nn,{column:s,item:t})},s.id??s.header))]})}class hce{constructor(t){ce(this,"value");ce(this,"next");this.value=t}}class mce{constructor(){vh(this,pr);vh(this,pa);vh(this,ya);this.clear()}enqueue(t){const n=new hce(t);ai(this,pr)?(ai(this,pa).next=n,Ui(this,pa,n)):(Ui(this,pr,n),Ui(this,pa,n)),sv(this,ya)._++}dequeue(){const t=ai(this,pr);if(t)return Ui(this,pr,ai(this,pr).next),sv(this,ya)._--,t.value}peek(){if(ai(this,pr))return ai(this,pr).value}clear(){Ui(this,pr,void 0),Ui(this,pa,void 0),Ui(this,ya,0)}get size(){return ai(this,ya)}*[Symbol.iterator](){let t=ai(this,pr);for(;t;)yield t.value,t=t.next}}pr=new WeakMap,pa=new WeakMap,ya=new WeakMap;function gce(e){hE(e);const t=new mce;let n=0;const r=()=>{n<e&&t.size>0&&(t.dequeue()(),n++)},i=()=>{n--,r()},o=async(l,c,u)=>{const d=(async()=>l(...u))();c(d);try{await d}catch{}i()},a=(l,c,u)=>{new Promise(d=>{t.enqueue(d)}).then(o.bind(void 0,l,c,u)),(async()=>(await Promise.resolve(),n<e&&r()))()},s=(l,...c)=>new Promise(u=>{a(l,u,c)});return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(l){hE(l),e=l,queueMicrotask(()=>{for(;n<e&&t.size>0;)r()})}}}),s}function hE(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const Ql=e=>{const t=["json"],n=["non_field_errors"],r=[],i=[];switch(typeof e){case"string":r.push({message:e});break;case"object":if(e===null)break;if(Array.isArray(e)){for(const o of e)typeof o=="string"&&r.push({message:o});break}for(const o of t)if(o in e&&typeof e[o]=="object"&&e[o]!==null)for(const a in e[o]){const s=e[o][a];if(n.includes(a)){if(typeof s=="string")r.push({message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&r.push({message:l})}else if(typeof s=="string")a==="detail"?r.push({message:s}):i.push({name:a,message:s});else if(Array.isArray(s))for(const l of s)typeof l=="string"&&i.push({name:a,message:l})}else e instanceof Error&&r.push({message:e.message});break}return{genericErrors:r,fieldErrors:i}};function Af(e,t){const[n,r]=y.useState(()=>e);y.useEffect(()=>r(e),[e]);const i=y.useCallback(o=>{t?t(o):r(o)},[t]);return[n,i]}function mE(e){const{t}=Me(),{id:n,icon:r,placeholder:i,values:o,onSelect:a,options:s,variant:l,disableClearSelection:c,maxChipSize:u,queryLabel:d,compareOptionValues:f}=e,[h,g]=Af(e.open??!1,e.setOpen),[p,v]=Af(e.searchValue??"",e.setSearchValue),b=y.useRef(null),x=y.useMemo(()=>{const D=[];for(const j of o??[]){const A=s.find(M=>f?f(M.value,j):M.value===j);A?D.push(A):d&&j!==void 0&&D.push({label:d(j),value:j})}return D},[s,d,o,f]),S=D=>m.jsx(C.Tooltip,{content:e.isDisabled,trigger:e.isDisabled?void 0:"manual",children:m.jsx(C.MenuToggle,{id:n,ref:D,onClick:()=>g(!h),isExpanded:h,onKeyDown:j=>{switch(j.key){case"Tab":case"Enter":case"Shift":break;default:g(!0),setTimeout(()=>{E.current&&(E.current.focus(),E.current.value=j.key)},1);break}},"data-cy":n,icon:r,isDisabled:!!e.isDisabled,isFullWidth:!0,style:{paddingTop:2,paddingBottom:4,minHeight:36},children:x.length>0?m.jsx(m.Fragment,{children:l==="count"?m.jsx(C.Chip,{isReadOnly:c,onClick:()=>a(()=>[]),style:{marginTop:-4,marginBottom:-4},children:x.length}):m.jsxs(C.ChipGroup,{numChips:99,children:[x.map(j=>m.jsx(C.Chip,{isReadOnly:e.disableClearChips,textMaxWidth:u,style:{marginTop:-2,marginBottom:-2},onClick:()=>a(A=>A==null?void 0:A.filter(M=>M!==j.value)),children:j.label},j.label)),!c&&m.jsx(ve.TimesIcon,{role:"button","aria-hidden":!0,onClick:()=>a(()=>[]),style:{verticalAlign:"middle",marginLeft:8}})]})}):m.jsx("span",{style:{opacity:.7},children:i})})}),w=y.useMemo(()=>x.map(D=>D.label),[x]),_=y.useCallback((D,j)=>{a(A=>{const M=s.find(P=>P.key!==void 0?P.key===j:P.label===j);return M&&((A==null?void 0:A.find(P=>f?f(P,M.value):P===M.value))!==void 0?A=A.filter(P=>f?!f(P,M.value):P!==M.value):(A=A?[...A]:[],A.push(M.value))),A})},[a,s,f]),E=y.useRef(null);y.useEffect(()=>{h||v("")},[h,v]);const O=y.useMemo(()=>{const D=s.filter(j=>p===""?!0:j.label.toLowerCase().includes(p.toLowerCase()));return e.disableSortOptions||D.sort((j,A)=>j.label.toLowerCase().localeCompare(A.label.toLowerCase())),D},[s,e.disableSortOptions,p]),T=y.useMemo(()=>{if(s.some(j=>!!j.group)){const j={};for(const A of O){const M=A.group??"";j[M]||(j[M]=[]),j[M].push(A)}return j}},[s,O]);return m.jsxs(C.Select,{id:`${n}-select`,selected:w,onSelect:_,isOpen:h,onOpenChange:g,toggle:S,popperProps:{appendTo:()=>document.body,preventOverflow:!0,enableFlip:!0},innerRef:b,children:[m.jsx(C.MenuSearch,{children:m.jsx(C.MenuSearchInput,{"data-cy":"search-input",children:m.jsx(C.SearchInput,{id:`${n}-search`,ref:E,value:p,onChange:(D,j)=>v(j),onClear:D=>{D.stopPropagation(),v("")},resultsCount:O.length!==s.length?`${O.length} / ${s.length}`:void 0,onKeyDown:D=>{var j;switch(D.key){case"ArrowDown":case"Tab":{D.preventDefault(),D.stopPropagation();const A=(j=b==null?void 0:b.current)==null?void 0:j.querySelector("li button:not(:disabled),li input:not(:disabled)");A&&A.focus();break}}}})})}),m.jsx(C.Divider,{}),O.length===0?m.jsx(m.Fragment,{children:e.isLoading?m.jsx(C.Bullseye,{style:{padding:16},children:m.jsx(C.Spinner,{size:"lg"})}):m.jsx(C.SelectOption,{isDisabled:!0,children:t("No results found")},"no result")}):m.jsx(pce,{children:T?m.jsx(m.Fragment,{children:Object.keys(T).map(D=>m.jsx(C.SelectGroup,{label:D,children:m.jsx(gE,{searchRef:E,options:O,selectedOptions:x})},D))}):m.jsx(gE,{searchRef:E,options:O,selectedOptions:x})}),e.footer&&m.jsx(C.MenuFooter,{children:e.footer})]})}function gE(e){return m.jsx(C.SelectList,{onKeyDown:t=>{var n;switch(t.key){case"Tab":t.preventDefault(),t.stopPropagation(),(n=e.searchRef.current)==null||n.focus();break}},children:e.options.map(t=>{const n=Br(t);return m.jsx(C.SelectOption,{id:n,icon:t.icon,value:t.key!==void 0?t.key:t.label,description:t.description?m.jsx("div",{style:{maxWidth:300},children:t.description}):void 0,hasCheckbox:!0,isSelected:e.selectedOptions.includes(t),"data-cy":n,children:t.label},t.key!==void 0?t.key:t.label)})})}const pce=De(Zn)`
364
364
  max-height: 40vh;
365
365
  `;function yce(e){const{t}=Me(),[n,r]=y.useState(!1),[i,o]=y.useState(!1),[a,s]=y.useState(),[l,c]=y.useState(0),[u,d]=y.useState(),[f,h]=y.useState(!1),g=y.useRef(),[p,v]=y.useState(""),b=y.useCallback(C.debounce(T=>v(T),200),[]),x=y.useRef(e.queryOptions).current,S=y.useRef(null),w=y.useCallback(()=>{S.current&&S.current.abort();const T=new AbortController;return S.current=T,r(()=>(o(!1),s(void 0),d(D=>{if(D)return D}),x({next:g.current,signal:T.signal,search:p}).then(D=>{T.signal.aborted||(g.current=D.next,D.remaining||o(!0),d(j=>{if(T.signal.aborted)return j;let A=[...j??[],...D.options];const M=new Set;return A=A.filter(P=>M.has(P.value)?!1:(M.add(P.value),!0)),A.sort((P,$)=>{const L=P.label.toLowerCase(),H=$.label.toLowerCase();return L<H?-1:L>H?1:0}),c(D.remaining+A.length),A}))}).catch(D=>{T.signal.aborted||s(D instanceof Error?D:new Error(t("Unknown error")))}).finally(()=>{T.signal.aborted||r(!1)}),!0)),()=>T.abort()},[x,p,t]),_=y.useCallback(T=>{T.preventDefault(),T.stopPropagation(),w()},[w]),E=y.useCallback(T=>{T.preventDefault(),T.stopPropagation(),c(0),d([]),g.current=void 0,w()},[w]);y.useEffect(()=>{f&&(c(0),d([]),g.current=void 0,w())},[f,w]);const O=m.jsxs(C.Stack,{hasGutter:!0,children:[m.jsxs(C.Flex,{children:[m.jsx(C.FlexItem,{grow:{default:"grow"},children:m.jsxs(C.ActionList,{children:[e.onBrowse&&m.jsx(C.ActionListItem,{children:m.jsx(C.Button,{id:"browse",onClick:T=>{var D;T.preventDefault(),T.stopPropagation(),h(!1),(D=e.onBrowse)==null||D.call(e)},children:t("Browse")})}),!i&&m.jsx(C.ActionListItem,{children:m.jsx(C.Button,{id:"load-more",isLoading:n,onClick:_,isDisabled:n,children:t(n?"Loading...":"Load more")})})]})}),!i&&l!==0&&m.jsx(C.FlexItem,{children:t("Loaded {{count}} of {{total}}",{count:(u==null?void 0:u.length)??0,total:l})})]}),e.footer]});return a?m.jsx(vce,{id:e.id,variant:"secondary",isDanger:!0,icon:m.jsx(ve.SyncAltIcon,{}),iconPosition:"right",onClick:E,children:typeof e.queryErrorText=="function"?e.queryErrorText(a):e.queryErrorText??t("Error loading options")}):m.jsx(mE,{id:e.id,icon:e.icon,placeholder:e.placeholder,options:u??[],values:e.values,onSelect:e.onSelect,variant:e.variant,footer:O,open:f,setOpen:h,searchValue:p,setSearchValue:b,isLoading:n,disableClearSelection:e.disableClearSelection,disableClearChips:e.disableClearChips,queryLabel:e.queryLabel,compareOptionValues:e.compareOptionValues})}const vce=De(C.Button)`
366
366
  width: 100%;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansible/ansible-ui-framework",
3
3
  "description": "A framework for building applications using PatternFly.",
4
- "version": "2.4.2611",
4
+ "version": "2.4.2613",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
package/useView.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
- import { IFilterState } from './PageToolbar/PageToolbarFilter';
3
- import { ITableColumn, IToolbarFilter } from '../framework';
2
+ import { ITableColumn } from './PageTable/PageTableColumn';
3
+ import { IFilterState, IToolbarFilter } from './PageToolbar/PageToolbarFilter';
4
4
  export interface IView {
5
5
  page: number;
6
6
  setPage: (page: number) => void;