@ansible/ansible-ui-framework 2.4.538 → 2.4.540

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -37046,7 +37046,7 @@ function g2e(e) {
37046
37046
  const { title: t, description: n, icon: r, button: i, footNote: a, image: o, variant: l, style: s } = e;
37047
37047
  return /* @__PURE__ */ v.jsxs(yh, { variant: l || H$.full, style: s, isFullHeight: !0, children: [
37048
37048
  r && /* @__PURE__ */ v.jsx(_h, { icon: r }),
37049
- /* @__PURE__ */ v.jsx(bh, { titleText: /* @__PURE__ */ v.jsx(v.Fragment, { children: t }), headingLevel: "h4" }),
37049
+ /* @__PURE__ */ v.jsx(bh, { titleText: /* @__PURE__ */ v.jsx(v.Fragment, { children: t }), headingLevel: "h4", "data-cy": "empty-state-title" }),
37050
37050
  /* @__PURE__ */ v.jsx(no, { "data-cy": e.description, children: n }),
37051
37051
  /* @__PURE__ */ v.jsxs(xh, { children: [
37052
37052
  i && /* @__PURE__ */ v.jsx(kv, { children: i }),
package/index.umd.cjs CHANGED
@@ -377,7 +377,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
377
377
  row-gap: 16px;
378
378
  justify-content: end;
379
379
  }
380
- `;function Hk(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:l,filterState:s,setFilterState:c,openColumnModal:u,sort:f,setSort:d,sortDirection:h,setSortDirection:m,sortOptions:p,clearAllFilters:y,perPageOptions:_}=e,b=x.useCallback(()=>{y?y():c&&c({})},[c,y]),S=Tn("md"),{viewType:C,setViewType:w}=e;let{toolbarActions:E}=e;E=E??[];const A=x.useCallback((M,L)=>i?i(L):null,[i]),k=x.useCallback((M,L)=>a?a(L):null,[a]),D=o!==void 0,$=E!==void 0&&E.length>0,P=e.showSelect===!0||l!==void 0&&E&&E.find(M=>"selection"in M&&M.selection===vt.Multiple);return P||D||$?t===void 0?v.jsx(T.Toolbar,{className:"page-table-toolbar border-bottom",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8},children:v.jsx(Vk,{children:v.jsx(T.ToolbarItem,{style:{width:"100%"},children:v.jsx(T.Skeleton,{height:"36px"})})})}):v.jsx(T.Toolbar,{clearAllFilters:b,className:"page-table-toolbar border-bottom",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8},inset:{default:"insetMd",sm:"insetMd",md:"insetMd",lg:"insetMd",xl:"insetLg","2xl":"insetLg"},children:v.jsxs(Vk,{children:[P&&v.jsx(T.ToolbarGroup,{children:v.jsx(T.ToolbarItem,{variant:"bulk-select",children:v.jsx(Fk,{...e})})}),s&&c&&v.jsx(Bk,{toolbarFilters:o,filterState:s,setFilterState:c}),e.toolbarContent,v.jsx(T.ToolbarGroup,{variant:"button-group",children:v.jsx(So,{actions:E,selectedItems:l,wrapper:T.ToolbarItem})}),v.jsxs(rve,{children:[v.jsx(Q0e,{sort:f,setSort:d,sortDirection:h,setSortDirection:m,sortOptions:p}),C&&w&&v.jsx(nve,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:C,setViewType:w,openColumnModal:u}),!e.disablePagination&&v.jsx(T.ToolbarItem,{visibility:{default:"hidden","2xl":"visible"},style:{marginLeft:24,alignSelf:"center"},children:v.jsx(T.Pagination,{variant:T.PaginationVariant.top,isCompact:!0,itemCount:t,perPage:r,page:n,onSetPage:A,onPerPageSelect:k,perPageOptions:_,style:{marginTop:-8,marginBottom:-8}})})]})]})}):v.jsx(x.Fragment,{})}function ive(e){const{t}=xt(),n=t("Something went wrong"),r=t("Please refresh the page by using the button below."),i=t("Refresh"),{titleProp:a,message:o}=e;return v.jsxs(T.EmptyState,{isFullHeight:!0,children:[v.jsx(T.EmptyStateHeader,{titleText:v.jsx(v.Fragment,{children:a||n}),icon:v.jsx(T.EmptyStateIcon,{icon:Ae.ExclamationCircleIcon,color:"var(--pf-v5-global--danger-color--100)"}),headingLevel:"h2"}),v.jsx(T.EmptyStateBody,{children:o}),v.jsxs(T.EmptyStateFooter,{children:[v.jsx(T.EmptyStateBody,{children:r}),v.jsx(T.Button,{variant:"primary",onClick:()=>window.location.reload(),children:i})]})]})}function ave(e){const{title:t,description:n,icon:r,button:i,footNote:a,image:o,variant:l,style:s}=e;return v.jsxs(T.EmptyState,{variant:l||T.EmptyStateVariant.full,style:s,isFullHeight:!0,children:[r&&v.jsx(T.EmptyStateIcon,{icon:r}),v.jsx(T.EmptyStateHeader,{titleText:v.jsx(v.Fragment,{children:t}),headingLevel:"h4"}),v.jsx(T.EmptyStateBody,{"data-cy":e.description,children:n}),v.jsxs(T.EmptyStateFooter,{children:[i&&v.jsx(T.EmptyStateActions,{children:i}),o&&v.jsxs(v.Fragment,{children:[" ",v.jsx("br",{})," ",v.jsx(T.EmptyStateBody,{children:o})]}),a&&v.jsx(T.EmptyStateBody,{children:a})]})]})}function ove(e){const{button:t,description:n,title:r,variant:i}=e;return v.jsx(ave,{icon:t?Ae.PlusCircleIcon:Ae.CubesIcon,title:r,description:n,button:t,variant:i})}function Fy(e,t,n){var r,i,a,o,l;t==null&&(t=100);function s(){var u=Date.now()-o;u<t&&u>=0?r=setTimeout(s,t-u):(r=null,n||(l=e.apply(a,i),a=i=null))}var c=function(){a=this,i=arguments,o=Date.now();var u=n&&!r;return r||(r=setTimeout(s,t)),u&&(l=e.apply(a,i),a=i=null),l};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(l=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},c}Fy.debounce=Fy;var lve=Fy;const sve=je(lve);function cve(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:l,unselectAll:s,allSelected:c}=Ny(e,t),{sorted:u,sort:f,setSort:d}=Ry(e),{filtered:h,setFilterFn:m}=zy(u,t),{searched:p,search:y,setSearch:_,setSearchFn:b}=uve(h,t,n==null?void 0:n.search),{paged:S,page:C,setPage:w,perPage:E,setPerPage:A}=gc(p),k=x.useCallback(()=>l(S),[S,l]),D=x.useCallback(()=>l(p),[p,l]);return x.useMemo(()=>({allSelected:c,filtered:h,isSelected:o,page:C,paged:S,perPage:E,search:y,searched:p,selectAll:D,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:m,setPage:w,setPerPage:A,setSearch:_,setSearchFn:b,setSort:d,sort:f,sorted:u,unselectAll:s,unselectItem:a}),[c,h,o,C,S,E,y,p,D,i,k,r,m,w,A,_,b,d,f,u,s,a])}function Ny(e,t,n){const[r,i]=x.useState(()=>n?n.reduce((m,p)=>(m[t(p)]=p,m),{}):{});x.useEffect(()=>{i(m=>{let p=!1;return e.forEach(y=>{const _=t(y);m[_]&&m[_]!==y&&(p=!0,m[_]=y)}),p?{...m}:m})},[e,t]);const a=x.useCallback(m=>{i(p=>{const y=t(m);return p[y]!==m&&(p={...p},p[y]=m),p})},[t]),o=x.useCallback(m=>{i(p=>{const y=t(m);return p[y]&&(p={...p},delete p[y]),p})},[t]),l=x.useCallback(m=>{const p=t(m);return r[p]!==void 0},[t,r]),s=x.useCallback(m=>{i(p=>{p={...p};for(const y of m){const _=t(y);p[_]=y}return p})},[t]),c=x.useCallback(()=>s(e),[e,s]),u=x.useCallback(m=>{for(const p of m)o(p)},[o]),f=x.useCallback(()=>{i(m=>Object.keys(m).length>0?{}:m)},[]),d=x.useMemo(()=>Object.values(r),[r]),h=x.useMemo(()=>d.length===e.length,[e.length,d.length]);return x.useMemo(()=>({selectedItems:d,selectItem:a,unselectItem:o,isSelected:l,selectItems:s,selectAll:c,unselectAll:f,allSelected:h,keyFn:t,unselectItems:u}),[h,l,t,c,a,s,d,f,o,u])}function Uk(e,t){const[n,r]=x.useState({});x.useEffect(()=>{r(h=>{let m=!1;const p=e?e.reduce((b,S)=>{const C=t(S);return b[C]=S,h[C]&&h[C]!==S&&(m=!0,h[C]=S),b},{}):{},y={};for(const b in h)p[b]||(y[b]=!0);const _=Object.keys(y);if(_.length){m=!0;for(const b of _)delete h[b]}return m?{...h}:h})},[e,t]);const i=x.useCallback(h=>{r(m=>{const p=t(h);return m[p]!==h&&(m={...m},m[p]=h),m})},[t]),a=x.useCallback(h=>{r(m=>{const p=t(h);return m[p]&&(m={...m},delete m[p]),m})},[t]),o=x.useCallback(h=>{for(const m of h)a(m)},[a]),l=x.useCallback(h=>{const m=t(h);return n[m]!==void 0},[t,n]),s=x.useCallback(h=>{r(m=>{m={...m};for(const p of h){const y=t(p);m[y]=p}return m})},[t]),c=x.useCallback(()=>{s(e??[])},[e,s]),u=x.useCallback(()=>{r(h=>Object.keys(h).length>0?{}:h)},[]),f=x.useMemo(()=>Object.values(n),[n]),d=x.useMemo(()=>f.length===(e==null?void 0:e.length),[e,f.length]);return x.useMemo(()=>({selectedItems:f,selectItem:i,unselectItem:a,isSelected:l,selectItems:s,selectAll:c,unselectAll:u,allSelected:d,keyFn:t,unselectItems:o}),[d,l,t,c,i,s,f,u,a,o])}function Ry(e){const[t,n]=x.useState(),{direction:r,sortFn:i}=t??{},a=x.useMemo(()=>e?i?r==="asc"?[...e.sort(i)]:[...e.sort(i).reverse()]:e:[],[r,e,i]);return x.useMemo(()=>({sorted:a,sort:t,setSort:n}),[t,a])}function zy(e,t){const n=x.useRef({map:{}}),[r,i]=x.useState(),a=x.useCallback(c=>i(()=>c),[]),[o,l]=x.useState([]);x.useEffect(()=>{n.current.map={}},[r]);const s=x.useCallback(c=>{const u=t(c);let f=n.current.map[u];return f?f.item!==c&&(f.item=c,f.passes=r?r(c):!0):(f={item:c,passes:r?r(c):!0},n.current.map[u]=f),f.passes},[r,t]);return x.useEffect(()=>{l(r?e.filter(s):e)},[e,r,s]),x.useMemo(function(){return{filtered:o,setFilterFn:a}},[o,a])}function uve(e,t,n){const r=x.useRef({map:{}}),[i,a]=x.useState(),o=x.useCallback(h=>a(()=>h),[]),[l,s]=x.useState([]),[c,u]=x.useState(n??""),f=x.useCallback(sve(h=>u(h),200),[]);x.useEffect(()=>{r.current.map={}},[c,i]);const d=x.useCallback(h=>{const m=t(h);let p=r.current.map[m];return p?p.item!==h&&(p.item=h,p.score=i?i(h,c):0):(p={item:h,score:i?i(h,c):0},r.current.map[m]=p),p},[t,i,c]);return x.useEffect(()=>{s(i&&c?e.map(d).filter(h=>h.score<.5).sort((h,m)=>h.score-m.score).map(h=>h.item):e)},[c,e,i,d]),x.useMemo(function(){return{searched:l,search:c,setSearch:f,setSearchFn:o}},[l,c,f,o])}function gc(e){const[t,n]=x.useState([]),[r,i]=x.useState(1),[a,o]=x.useState(10);return x.useEffect(()=>{n(l=>{const s=e.slice((r-1)*a,r*a);if(l.length!==s.length)return s;let c=0;for(const u of s)if(l[c++]!==u)return s;return l})},[r,a,e]),x.useEffect(()=>{r>Math.ceil(e.length/a)&&i(1)},[r,a,e.length]),x.useMemo(()=>({paged:t,page:r,setPage:i,perPage:a,setPerPage:o}),[r,t,a])}const EOe="",By={button:"pf-v5-c-button",checkInput:"pf-v5-c-check__input",dirRtl:"pf-v5-m-dir-rtl",modifiers:{hidden:"pf-m-hidden",hiddenOnSm:"pf-m-hidden-on-sm",visibleOnSm:"pf-m-visible-on-sm",hiddenOnMd:"pf-m-hidden-on-md",visibleOnMd:"pf-m-visible-on-md",hiddenOnLg:"pf-m-hidden-on-lg",visibleOnLg:"pf-m-visible-on-lg",hiddenOnXl:"pf-m-hidden-on-xl",visibleOnXl:"pf-m-visible-on-xl",hiddenOn_2xl:"pf-m-hidden-on-2xl",visibleOn_2xl:"pf-m-visible-on-2xl",fixed:"pf-m-fixed",stickyHeader:"pf-m-sticky-header",nestedColumnHeader:"pf-m-nested-column-header",borderRow:"pf-m-border-row",striped:"pf-m-striped",expandable:"pf-m-expandable",stripedEven:"pf-m-striped-even",ghostRow:"pf-m-ghost-row",center:"pf-m-center",help:"pf-m-help",favorite:"pf-m-favorite",borderRight:"pf-m-border-right",borderLeft:"pf-m-border-left",expanded:"pf-m-expanded",truncate:"pf-m-truncate",wrap:"pf-m-wrap",nowrap:"pf-m-nowrap",fitContent:"pf-m-fit-content",breakWord:"pf-m-break-word",noBorderRows:"pf-m-no-border-rows",clickable:"pf-m-clickable",selected:"pf-m-selected",firstCellOffsetReset:"pf-m-first-cell-offset-reset",dragOver:"pf-m-drag-over",favorited:"pf-m-favorited",noPadding:"pf-m-no-padding",compact:"pf-m-compact",width_10:"pf-m-width-10",width_15:"pf-m-width-15",width_20:"pf-m-width-20",width_25:"pf-m-width-25",width_30:"pf-m-width-30",width_35:"pf-m-width-35",width_40:"pf-m-width-40",width_45:"pf-m-width-45",width_50:"pf-m-width-50",width_60:"pf-m-width-60",width_70:"pf-m-width-70",width_80:"pf-m-width-80",width_90:"pf-m-width-90",width_100:"pf-m-width-100"},table:"pf-v5-c-table",tableAction:"pf-v5-c-table__action",tableButton:"pf-v5-c-table__button",tableButtonContent:"pf-v5-c-table__button-content",tableCaption:"pf-v5-c-table__caption",tableCheck:"pf-v5-c-table__check",tableColumnHelp:"pf-v5-c-table__column-help",tableColumnHelpAction:"pf-v5-c-table__column-help-action",tableCompoundExpansionToggle:"pf-v5-c-table__compound-expansion-toggle",tableControlRow:"pf-v5-c-table__control-row",tableDraggable:"pf-v5-c-table__draggable",tableExpandableRow:"pf-v5-c-table__expandable-row",tableExpandableRowContent:"pf-v5-c-table__expandable-row-content",tableFavorite:"pf-v5-c-table__favorite",tableIcon:"pf-v5-c-table__icon",tableIconInline:"pf-v5-c-table__icon-inline",tableInlineEditAction:"pf-v5-c-table__inline-edit-action",tableSort:"pf-v5-c-table__sort",tableSortIndicator:"pf-v5-c-table__sort-indicator",tableSubhead:"pf-v5-c-table__subhead",tableTbody:"pf-v5-c-table__tbody",tableTd:"pf-v5-c-table__td",tableText:"pf-v5-c-table__text",tableTh:"pf-v5-c-table__th",tableThead:"pf-v5-c-table__thead",tableToggle:"pf-v5-c-table__toggle",tableToggleIcon:"pf-v5-c-table__toggle-icon",tableTr:"pf-v5-c-table__tr",themeDark:"pf-v5-theme-dark"};function fve(e){const{t}=xt(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:l,unselectItem:s,allSelected:c,selectAll:u,unselectAll:f,hideColumnHeaders:d,isSelectableWithCheckbox:h}=e,[m,p]=x.useState(null),[y,_]=x.useState(null),[b,S]=x.useState(!1),C=x.useRef(null),w=L=>{if(C.current){const z=C.current.getBoundingClientRect();return L.clientX>z.x&&L.clientX<z.x+z.width&&L.clientY>z.y&&L.clientY<z.y+z.height}return!1},E=L=>{w(L)||A()},A=()=>{C.current&&Array.from(C.current.children).forEach(L=>{L.classList.remove(By.modifiers.ghostRow),L.setAttribute("aria-pressed","false")}),_(null),p(null),S(!1)},k=L=>{L.preventDefault();const z=L.target.closest("tr");if(!z||!(C.current&&C.current.contains(z))||z.id===y)return null;{const te=z.id,Q=Array.from(C.current.children).findIndex(Y=>Y.id===te);if(Q!==m&&y){const Y=D([...i],y,Q);a(Y)}}return null},D=(L,z,te)=>{const Q=L.findIndex(X=>r(X)===z);if(Q===te)return L;const Y=L.splice(Q,1);return L.splice(te,0,Y[0]),L},$=L=>{w(L)||p(null)},P=L=>{const z=L.target;z.classList.remove(By.modifiers.ghostRow),z.setAttribute("aria-pressed","false"),_(null),p(null),S(!1)},j=L=>{if(C.current){L.dataTransfer.effectAllowed="move";const z=L.currentTarget.id,te=Array.from(C.current.children).findIndex(Q=>Q.id===L.currentTarget.id);L.currentTarget.setAttribute("aria-pressed","true"),_(z),p(te)}},M=x.useCallback(L=>{const z=i.findIndex(Q=>r(Q)===r(L)),te=[...i];te[z]=L,a(te)},[i,a,r]);return v.jsxs(Re.Table,{"aria-label":t("Table with draggable rows"),className:b?By.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&v.jsx(Re.Thead,{children:v.jsxs(Re.Tr,{children:[v.jsx(Re.Th,{}),h&&v.jsx(Re.Th,{select:{onSelect:(L,z)=>{z?u():f()},isSelected:c}}),n.map((L,z)=>v.jsx(Re.Th,{children:L.header},z))]})}),v.jsx(Re.Tbody,{ref:C,onDragOver:k,onDragLeave:$,children:i.map((L,z)=>{const te=r(L);return v.jsxs(Re.Tr,{id:te.toString(),draggable:!0,onDrop:E,onDragEnd:P,onDragStart:j,children:[v.jsx(Re.Td,{draggableRow:{id:`draggable-row-${te.toString()}`}}),h&&v.jsx(Re.Td,{select:{rowIndex:z,variant:"checkbox",onSelect:(Q,Y)=>{Y?l(L):s(L)},isSelected:o(L)}}),n.map(Q=>v.jsx(Re.Td,{children:Q.cell(L,M)},Q.header))]},te)})})]})}function dve(e){const[t,n]=Ur(),[r]=x.useState(()=>e.keyFn),[i]=x.useState(()=>e.saveFn),[a]=x.useState(()=>e.loadFn),[o,l]=x.useState(()=>{try{const d=localStorage.getItem(e.id);if(typeof d=="string"){const h=JSON.parse(d);if(Array.isArray(h)&&h.every(m=>typeof m=="object")&&h.every(m=>"key"in m&&"enabled"in m))return h}}catch{}}),s=x.useMemo(()=>o?e.items.map(d=>{if(a){const h=o.find(m=>m.key===r(d));h&&h.state&&a(d,h.state)}return d}).sort((d,h)=>{const m=o.findIndex(y=>y.key===r(d)),p=o.findIndex(y=>y.key===r(h));return m===-1&&p===-1?0:m===-1?1:p===-1?-1:m-p}):e.items,[o,r,a,e.items]),c=x.useMemo(()=>o?s.filter(d=>{const h=o.find(m=>m.key===r(d));return h?h.enabled:!0}):s,[s,o,r]),u=x.useCallback((d,h)=>{const m=d.map(p=>({key:r(p),enabled:h.includes(p),state:i?i(p):void 0}));l(m),localStorage.setItem(e.id,JSON.stringify(m))},[r,e.id,i]);return{openManageItems:()=>n(v.jsx(hve,{...e,keyFn:r,items:s,defaultSelectedItems:c,onApplyChanges:u})),managedItems:c}}function hve(e){const{t}=xt(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=x.useState(()=>e.keyFn),[l,s]=Ur(),c=()=>s(void 0),[u,f]=x.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:m,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b}=Ny(u,o,e.defaultSelectedItems),S=()=>{a(u,d),s(void 0)};return v.jsxs(T.Modal,{title:n,"aria-label":n,ouiaId:n,description:v.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??T.ModalVariant.medium,isOpen:!0,onClose:c,actions:[v.jsx(T.Button,{variant:"primary",onClick:S,children:t`Apply`},"apply"),v.jsx(T.Button,{variant:"link",onClick:c,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[v.jsx(T.Divider,{}),v.jsx(T.ModalBoxBody,{style:{padding:0},children:v.jsx(fve,{keyFn:o,items:u,setItems:f,columns:i,isSelected:h,selectItem:m,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b,hideColumnHeaders:e.hideColumnHeaders,isSelectableWithCheckbox:e.hideSelection!==!0})}),v.jsx(T.Divider,{})]})}function mve(e,t,n,r,i){const{t:a}=xt(),o=x.useMemo(()=>{const f=[{header:a("Column Name"),cell:d=>d.header}];return n||f.push({header:a("Table View"),cell:(d,h)=>v.jsx(Zn,{value:d.table??"",onSelect:m=>{switch(m){case"":h({...d,table:void 0});break;case ha.Description:case ha.Expanded:case ha.Hidden:h({...d,table:m});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:ha.Description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:ha.Expanded,label:a("Expanded"),description:a("Show the column when the item is expanded as a detail.")},{value:ha.Hidden,label:a("Hidden"),description:a("Hide the column.")}]})}),r||f.push({header:a("List View"),cell:(d,h)=>v.jsx(Zn,{value:d.list??"",onSelect:m=>{switch(m){case"":h({...d,list:void 0});break;case"name":case"subtitle":case"description":case"primary":case"secondary":case"hidden":h({...d,list:m});break}},options:[{value:"name",label:a("Name"),description:a("Show the column as the name of the list item.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the list.")},{value:"description",label:a("Description"),description:a("Show the column as the list item description.")},{value:"",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"primary",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"secondary",label:a("Right side"),description:a("Show the column on the right side of the list.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the list.")}],placeholder:a("Left side")})}),i||f.push({header:a("Card View"),cell:(d,h)=>v.jsx(Zn,{value:d.card??"",onSelect:m=>{switch(m){case"":h({...d,card:void 0});break;case"name":case"subtitle":case"description":case"hidden":h({...d,card:m});break}},placeholder:a("Detail"),options:[{value:"name",label:a("Name"),description:a("Show the column as the name on the card.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the card.")},{value:"description",label:a("Description"),description:a("Show the column as the card description.")},{value:"",label:a("Detail"),description:a("Show the column one of the details on the card.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the card.")}]})}),f},[i,r,n,a]),l=x.useCallback((f,d)=>{typeof d=="object"&&d!==null&&("table"in d&&typeof d.table=="string"?f.table=d.table:f.table=void 0,"list"in d&&typeof d.list=="string"?f.list=d.list:f.list=void 0,"card"in d&&typeof d.card=="string"?f.card=d.card:f.card=void 0)},[]),s=x.useCallback(f=>{const{table:d,list:h,card:m}=f;return{table:d,list:h,card:m}},[]),{openManageItems:c,managedItems:u}=dve({id:e,title:a("Manage Columns"),description:a("Manage the order, placement, and format of columns."),items:t,keyFn:f=>f.id??f.header,columns:o,loadFn:l,saveFn:s,hideSelection:!0});return{openColumnManagement:c,managedColumns:u}}const AOe="";function pve(){return v.jsx(Re.Table,{gridBreakPoint:"",className:"page-table",children:v.jsx(Re.Tbody,{children:new Array(10).fill(0).map((e,t)=>v.jsx(Re.Tr,{children:v.jsx(Re.Td,{children:v.jsx(T.Skeleton,{height:"27px"})})},t))})})}function gve(e){const{setPage:t,setPerPage:n}=e,r=x.useCallback((o,l)=>t(l),[t]),i=x.useCallback((o,l)=>n(l),[n]),a=!Tn("md");return v.jsx(T.Pagination,{variant:T.PaginationVariant.bottom,itemCount:e.itemCount,page:e.page,perPage:e.perPage,onSetPage:r,onPerPageSelect:i,perPageOptions:e.perPageOptions,style:{...e.style,boxShadow:"none",zIndex:400,paddingTop:a?4:6,paddingBottom:a?4:6},className:"border-top bg-lighten"})}function vve(e){const t=e.size??350,n=x.useRef(null),[r,i]=x.useState("1fr"),a=x.useCallback(l=>{let s=Math.min(e.maxColumns??12,Math.max(Math.floor(l/t),1));s<1&&(s=1),i(()=>new Array(s).fill("1fr").join(" "))},[e.maxColumns,t]);Io(n,l=>a(l.contentRect.width)),x.useLayoutEffect(()=>{var l;a(((l=n.current)==null?void 0:l.clientWidth)??0)},[a]);const o=16;return v.jsx("div",{ref:n,style:{display:"grid",gridAutoRows:"1fr",gridTemplateColumns:r,gap:o},children:e.children})}const yve=Ge.small`
380
+ `;function Hk(e){const{itemCount:t,page:n,perPage:r,setPage:i,setPerPage:a,toolbarFilters:o,selectedItems:l,filterState:s,setFilterState:c,openColumnModal:u,sort:f,setSort:d,sortDirection:h,setSortDirection:m,sortOptions:p,clearAllFilters:y,perPageOptions:_}=e,b=x.useCallback(()=>{y?y():c&&c({})},[c,y]),S=Tn("md"),{viewType:C,setViewType:w}=e;let{toolbarActions:E}=e;E=E??[];const A=x.useCallback((M,L)=>i?i(L):null,[i]),k=x.useCallback((M,L)=>a?a(L):null,[a]),D=o!==void 0,$=E!==void 0&&E.length>0,P=e.showSelect===!0||l!==void 0&&E&&E.find(M=>"selection"in M&&M.selection===vt.Multiple);return P||D||$?t===void 0?v.jsx(T.Toolbar,{className:"page-table-toolbar border-bottom",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8},children:v.jsx(Vk,{children:v.jsx(T.ToolbarItem,{style:{width:"100%"},children:v.jsx(T.Skeleton,{height:"36px"})})})}):v.jsx(T.Toolbar,{clearAllFilters:b,className:"page-table-toolbar border-bottom",style:{paddingBottom:S?void 0:8,paddingTop:S?void 0:8},inset:{default:"insetMd",sm:"insetMd",md:"insetMd",lg:"insetMd",xl:"insetLg","2xl":"insetLg"},children:v.jsxs(Vk,{children:[P&&v.jsx(T.ToolbarGroup,{children:v.jsx(T.ToolbarItem,{variant:"bulk-select",children:v.jsx(Fk,{...e})})}),s&&c&&v.jsx(Bk,{toolbarFilters:o,filterState:s,setFilterState:c}),e.toolbarContent,v.jsx(T.ToolbarGroup,{variant:"button-group",children:v.jsx(So,{actions:E,selectedItems:l,wrapper:T.ToolbarItem})}),v.jsxs(rve,{children:[v.jsx(Q0e,{sort:f,setSort:d,sortDirection:h,setSortDirection:m,sortOptions:p}),C&&w&&v.jsx(nve,{disableTableView:e.disableTableView,disableListView:e.disableListView,disableCardView:e.disableCardView,viewType:C,setViewType:w,openColumnModal:u}),!e.disablePagination&&v.jsx(T.ToolbarItem,{visibility:{default:"hidden","2xl":"visible"},style:{marginLeft:24,alignSelf:"center"},children:v.jsx(T.Pagination,{variant:T.PaginationVariant.top,isCompact:!0,itemCount:t,perPage:r,page:n,onSetPage:A,onPerPageSelect:k,perPageOptions:_,style:{marginTop:-8,marginBottom:-8}})})]})]})}):v.jsx(x.Fragment,{})}function ive(e){const{t}=xt(),n=t("Something went wrong"),r=t("Please refresh the page by using the button below."),i=t("Refresh"),{titleProp:a,message:o}=e;return v.jsxs(T.EmptyState,{isFullHeight:!0,children:[v.jsx(T.EmptyStateHeader,{titleText:v.jsx(v.Fragment,{children:a||n}),icon:v.jsx(T.EmptyStateIcon,{icon:Ae.ExclamationCircleIcon,color:"var(--pf-v5-global--danger-color--100)"}),headingLevel:"h2"}),v.jsx(T.EmptyStateBody,{children:o}),v.jsxs(T.EmptyStateFooter,{children:[v.jsx(T.EmptyStateBody,{children:r}),v.jsx(T.Button,{variant:"primary",onClick:()=>window.location.reload(),children:i})]})]})}function ave(e){const{title:t,description:n,icon:r,button:i,footNote:a,image:o,variant:l,style:s}=e;return v.jsxs(T.EmptyState,{variant:l||T.EmptyStateVariant.full,style:s,isFullHeight:!0,children:[r&&v.jsx(T.EmptyStateIcon,{icon:r}),v.jsx(T.EmptyStateHeader,{titleText:v.jsx(v.Fragment,{children:t}),headingLevel:"h4","data-cy":"empty-state-title"}),v.jsx(T.EmptyStateBody,{"data-cy":e.description,children:n}),v.jsxs(T.EmptyStateFooter,{children:[i&&v.jsx(T.EmptyStateActions,{children:i}),o&&v.jsxs(v.Fragment,{children:[" ",v.jsx("br",{})," ",v.jsx(T.EmptyStateBody,{children:o})]}),a&&v.jsx(T.EmptyStateBody,{children:a})]})]})}function ove(e){const{button:t,description:n,title:r,variant:i}=e;return v.jsx(ave,{icon:t?Ae.PlusCircleIcon:Ae.CubesIcon,title:r,description:n,button:t,variant:i})}function Fy(e,t,n){var r,i,a,o,l;t==null&&(t=100);function s(){var u=Date.now()-o;u<t&&u>=0?r=setTimeout(s,t-u):(r=null,n||(l=e.apply(a,i),a=i=null))}var c=function(){a=this,i=arguments,o=Date.now();var u=n&&!r;return r||(r=setTimeout(s,t)),u&&(l=e.apply(a,i),a=i=null),l};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(l=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},c}Fy.debounce=Fy;var lve=Fy;const sve=je(lve);function cve(e,t,n){const{selectedItems:r,selectItem:i,unselectItem:a,isSelected:o,selectItems:l,unselectAll:s,allSelected:c}=Ny(e,t),{sorted:u,sort:f,setSort:d}=Ry(e),{filtered:h,setFilterFn:m}=zy(u,t),{searched:p,search:y,setSearch:_,setSearchFn:b}=uve(h,t,n==null?void 0:n.search),{paged:S,page:C,setPage:w,perPage:E,setPerPage:A}=gc(p),k=x.useCallback(()=>l(S),[S,l]),D=x.useCallback(()=>l(p),[p,l]);return x.useMemo(()=>({allSelected:c,filtered:h,isSelected:o,page:C,paged:S,perPage:E,search:y,searched:p,selectAll:D,selectItem:i,selectPage:k,selectedItems:r,setFilterFn:m,setPage:w,setPerPage:A,setSearch:_,setSearchFn:b,setSort:d,sort:f,sorted:u,unselectAll:s,unselectItem:a}),[c,h,o,C,S,E,y,p,D,i,k,r,m,w,A,_,b,d,f,u,s,a])}function Ny(e,t,n){const[r,i]=x.useState(()=>n?n.reduce((m,p)=>(m[t(p)]=p,m),{}):{});x.useEffect(()=>{i(m=>{let p=!1;return e.forEach(y=>{const _=t(y);m[_]&&m[_]!==y&&(p=!0,m[_]=y)}),p?{...m}:m})},[e,t]);const a=x.useCallback(m=>{i(p=>{const y=t(m);return p[y]!==m&&(p={...p},p[y]=m),p})},[t]),o=x.useCallback(m=>{i(p=>{const y=t(m);return p[y]&&(p={...p},delete p[y]),p})},[t]),l=x.useCallback(m=>{const p=t(m);return r[p]!==void 0},[t,r]),s=x.useCallback(m=>{i(p=>{p={...p};for(const y of m){const _=t(y);p[_]=y}return p})},[t]),c=x.useCallback(()=>s(e),[e,s]),u=x.useCallback(m=>{for(const p of m)o(p)},[o]),f=x.useCallback(()=>{i(m=>Object.keys(m).length>0?{}:m)},[]),d=x.useMemo(()=>Object.values(r),[r]),h=x.useMemo(()=>d.length===e.length,[e.length,d.length]);return x.useMemo(()=>({selectedItems:d,selectItem:a,unselectItem:o,isSelected:l,selectItems:s,selectAll:c,unselectAll:f,allSelected:h,keyFn:t,unselectItems:u}),[h,l,t,c,a,s,d,f,o,u])}function Uk(e,t){const[n,r]=x.useState({});x.useEffect(()=>{r(h=>{let m=!1;const p=e?e.reduce((b,S)=>{const C=t(S);return b[C]=S,h[C]&&h[C]!==S&&(m=!0,h[C]=S),b},{}):{},y={};for(const b in h)p[b]||(y[b]=!0);const _=Object.keys(y);if(_.length){m=!0;for(const b of _)delete h[b]}return m?{...h}:h})},[e,t]);const i=x.useCallback(h=>{r(m=>{const p=t(h);return m[p]!==h&&(m={...m},m[p]=h),m})},[t]),a=x.useCallback(h=>{r(m=>{const p=t(h);return m[p]&&(m={...m},delete m[p]),m})},[t]),o=x.useCallback(h=>{for(const m of h)a(m)},[a]),l=x.useCallback(h=>{const m=t(h);return n[m]!==void 0},[t,n]),s=x.useCallback(h=>{r(m=>{m={...m};for(const p of h){const y=t(p);m[y]=p}return m})},[t]),c=x.useCallback(()=>{s(e??[])},[e,s]),u=x.useCallback(()=>{r(h=>Object.keys(h).length>0?{}:h)},[]),f=x.useMemo(()=>Object.values(n),[n]),d=x.useMemo(()=>f.length===(e==null?void 0:e.length),[e,f.length]);return x.useMemo(()=>({selectedItems:f,selectItem:i,unselectItem:a,isSelected:l,selectItems:s,selectAll:c,unselectAll:u,allSelected:d,keyFn:t,unselectItems:o}),[d,l,t,c,i,s,f,u,a,o])}function Ry(e){const[t,n]=x.useState(),{direction:r,sortFn:i}=t??{},a=x.useMemo(()=>e?i?r==="asc"?[...e.sort(i)]:[...e.sort(i).reverse()]:e:[],[r,e,i]);return x.useMemo(()=>({sorted:a,sort:t,setSort:n}),[t,a])}function zy(e,t){const n=x.useRef({map:{}}),[r,i]=x.useState(),a=x.useCallback(c=>i(()=>c),[]),[o,l]=x.useState([]);x.useEffect(()=>{n.current.map={}},[r]);const s=x.useCallback(c=>{const u=t(c);let f=n.current.map[u];return f?f.item!==c&&(f.item=c,f.passes=r?r(c):!0):(f={item:c,passes:r?r(c):!0},n.current.map[u]=f),f.passes},[r,t]);return x.useEffect(()=>{l(r?e.filter(s):e)},[e,r,s]),x.useMemo(function(){return{filtered:o,setFilterFn:a}},[o,a])}function uve(e,t,n){const r=x.useRef({map:{}}),[i,a]=x.useState(),o=x.useCallback(h=>a(()=>h),[]),[l,s]=x.useState([]),[c,u]=x.useState(n??""),f=x.useCallback(sve(h=>u(h),200),[]);x.useEffect(()=>{r.current.map={}},[c,i]);const d=x.useCallback(h=>{const m=t(h);let p=r.current.map[m];return p?p.item!==h&&(p.item=h,p.score=i?i(h,c):0):(p={item:h,score:i?i(h,c):0},r.current.map[m]=p),p},[t,i,c]);return x.useEffect(()=>{s(i&&c?e.map(d).filter(h=>h.score<.5).sort((h,m)=>h.score-m.score).map(h=>h.item):e)},[c,e,i,d]),x.useMemo(function(){return{searched:l,search:c,setSearch:f,setSearchFn:o}},[l,c,f,o])}function gc(e){const[t,n]=x.useState([]),[r,i]=x.useState(1),[a,o]=x.useState(10);return x.useEffect(()=>{n(l=>{const s=e.slice((r-1)*a,r*a);if(l.length!==s.length)return s;let c=0;for(const u of s)if(l[c++]!==u)return s;return l})},[r,a,e]),x.useEffect(()=>{r>Math.ceil(e.length/a)&&i(1)},[r,a,e.length]),x.useMemo(()=>({paged:t,page:r,setPage:i,perPage:a,setPerPage:o}),[r,t,a])}const EOe="",By={button:"pf-v5-c-button",checkInput:"pf-v5-c-check__input",dirRtl:"pf-v5-m-dir-rtl",modifiers:{hidden:"pf-m-hidden",hiddenOnSm:"pf-m-hidden-on-sm",visibleOnSm:"pf-m-visible-on-sm",hiddenOnMd:"pf-m-hidden-on-md",visibleOnMd:"pf-m-visible-on-md",hiddenOnLg:"pf-m-hidden-on-lg",visibleOnLg:"pf-m-visible-on-lg",hiddenOnXl:"pf-m-hidden-on-xl",visibleOnXl:"pf-m-visible-on-xl",hiddenOn_2xl:"pf-m-hidden-on-2xl",visibleOn_2xl:"pf-m-visible-on-2xl",fixed:"pf-m-fixed",stickyHeader:"pf-m-sticky-header",nestedColumnHeader:"pf-m-nested-column-header",borderRow:"pf-m-border-row",striped:"pf-m-striped",expandable:"pf-m-expandable",stripedEven:"pf-m-striped-even",ghostRow:"pf-m-ghost-row",center:"pf-m-center",help:"pf-m-help",favorite:"pf-m-favorite",borderRight:"pf-m-border-right",borderLeft:"pf-m-border-left",expanded:"pf-m-expanded",truncate:"pf-m-truncate",wrap:"pf-m-wrap",nowrap:"pf-m-nowrap",fitContent:"pf-m-fit-content",breakWord:"pf-m-break-word",noBorderRows:"pf-m-no-border-rows",clickable:"pf-m-clickable",selected:"pf-m-selected",firstCellOffsetReset:"pf-m-first-cell-offset-reset",dragOver:"pf-m-drag-over",favorited:"pf-m-favorited",noPadding:"pf-m-no-padding",compact:"pf-m-compact",width_10:"pf-m-width-10",width_15:"pf-m-width-15",width_20:"pf-m-width-20",width_25:"pf-m-width-25",width_30:"pf-m-width-30",width_35:"pf-m-width-35",width_40:"pf-m-width-40",width_45:"pf-m-width-45",width_50:"pf-m-width-50",width_60:"pf-m-width-60",width_70:"pf-m-width-70",width_80:"pf-m-width-80",width_90:"pf-m-width-90",width_100:"pf-m-width-100"},table:"pf-v5-c-table",tableAction:"pf-v5-c-table__action",tableButton:"pf-v5-c-table__button",tableButtonContent:"pf-v5-c-table__button-content",tableCaption:"pf-v5-c-table__caption",tableCheck:"pf-v5-c-table__check",tableColumnHelp:"pf-v5-c-table__column-help",tableColumnHelpAction:"pf-v5-c-table__column-help-action",tableCompoundExpansionToggle:"pf-v5-c-table__compound-expansion-toggle",tableControlRow:"pf-v5-c-table__control-row",tableDraggable:"pf-v5-c-table__draggable",tableExpandableRow:"pf-v5-c-table__expandable-row",tableExpandableRowContent:"pf-v5-c-table__expandable-row-content",tableFavorite:"pf-v5-c-table__favorite",tableIcon:"pf-v5-c-table__icon",tableIconInline:"pf-v5-c-table__icon-inline",tableInlineEditAction:"pf-v5-c-table__inline-edit-action",tableSort:"pf-v5-c-table__sort",tableSortIndicator:"pf-v5-c-table__sort-indicator",tableSubhead:"pf-v5-c-table__subhead",tableTbody:"pf-v5-c-table__tbody",tableTd:"pf-v5-c-table__td",tableText:"pf-v5-c-table__text",tableTh:"pf-v5-c-table__th",tableThead:"pf-v5-c-table__thead",tableToggle:"pf-v5-c-table__toggle",tableToggleIcon:"pf-v5-c-table__toggle-icon",tableTr:"pf-v5-c-table__tr",themeDark:"pf-v5-theme-dark"};function fve(e){const{t}=xt(),{columns:n,keyFn:r,items:i,setItems:a,isSelected:o,selectItem:l,unselectItem:s,allSelected:c,selectAll:u,unselectAll:f,hideColumnHeaders:d,isSelectableWithCheckbox:h}=e,[m,p]=x.useState(null),[y,_]=x.useState(null),[b,S]=x.useState(!1),C=x.useRef(null),w=L=>{if(C.current){const z=C.current.getBoundingClientRect();return L.clientX>z.x&&L.clientX<z.x+z.width&&L.clientY>z.y&&L.clientY<z.y+z.height}return!1},E=L=>{w(L)||A()},A=()=>{C.current&&Array.from(C.current.children).forEach(L=>{L.classList.remove(By.modifiers.ghostRow),L.setAttribute("aria-pressed","false")}),_(null),p(null),S(!1)},k=L=>{L.preventDefault();const z=L.target.closest("tr");if(!z||!(C.current&&C.current.contains(z))||z.id===y)return null;{const te=z.id,Q=Array.from(C.current.children).findIndex(Y=>Y.id===te);if(Q!==m&&y){const Y=D([...i],y,Q);a(Y)}}return null},D=(L,z,te)=>{const Q=L.findIndex(X=>r(X)===z);if(Q===te)return L;const Y=L.splice(Q,1);return L.splice(te,0,Y[0]),L},$=L=>{w(L)||p(null)},P=L=>{const z=L.target;z.classList.remove(By.modifiers.ghostRow),z.setAttribute("aria-pressed","false"),_(null),p(null),S(!1)},j=L=>{if(C.current){L.dataTransfer.effectAllowed="move";const z=L.currentTarget.id,te=Array.from(C.current.children).findIndex(Q=>Q.id===L.currentTarget.id);L.currentTarget.setAttribute("aria-pressed","true"),_(z),p(te)}},M=x.useCallback(L=>{const z=i.findIndex(Q=>r(Q)===r(L)),te=[...i];te[z]=L,a(te)},[i,a,r]);return v.jsxs(Re.Table,{"aria-label":t("Table with draggable rows"),className:b?By.modifiers.dragOver:"",variant:"compact",gridBreakPoint:"",children:[!d&&v.jsx(Re.Thead,{children:v.jsxs(Re.Tr,{children:[v.jsx(Re.Th,{}),h&&v.jsx(Re.Th,{select:{onSelect:(L,z)=>{z?u():f()},isSelected:c}}),n.map((L,z)=>v.jsx(Re.Th,{children:L.header},z))]})}),v.jsx(Re.Tbody,{ref:C,onDragOver:k,onDragLeave:$,children:i.map((L,z)=>{const te=r(L);return v.jsxs(Re.Tr,{id:te.toString(),draggable:!0,onDrop:E,onDragEnd:P,onDragStart:j,children:[v.jsx(Re.Td,{draggableRow:{id:`draggable-row-${te.toString()}`}}),h&&v.jsx(Re.Td,{select:{rowIndex:z,variant:"checkbox",onSelect:(Q,Y)=>{Y?l(L):s(L)},isSelected:o(L)}}),n.map(Q=>v.jsx(Re.Td,{children:Q.cell(L,M)},Q.header))]},te)})})]})}function dve(e){const[t,n]=Ur(),[r]=x.useState(()=>e.keyFn),[i]=x.useState(()=>e.saveFn),[a]=x.useState(()=>e.loadFn),[o,l]=x.useState(()=>{try{const d=localStorage.getItem(e.id);if(typeof d=="string"){const h=JSON.parse(d);if(Array.isArray(h)&&h.every(m=>typeof m=="object")&&h.every(m=>"key"in m&&"enabled"in m))return h}}catch{}}),s=x.useMemo(()=>o?e.items.map(d=>{if(a){const h=o.find(m=>m.key===r(d));h&&h.state&&a(d,h.state)}return d}).sort((d,h)=>{const m=o.findIndex(y=>y.key===r(d)),p=o.findIndex(y=>y.key===r(h));return m===-1&&p===-1?0:m===-1?1:p===-1?-1:m-p}):e.items,[o,r,a,e.items]),c=x.useMemo(()=>o?s.filter(d=>{const h=o.find(m=>m.key===r(d));return h?h.enabled:!0}):s,[s,o,r]),u=x.useCallback((d,h)=>{const m=d.map(p=>({key:r(p),enabled:h.includes(p),state:i?i(p):void 0}));l(m),localStorage.setItem(e.id,JSON.stringify(m))},[r,e.id,i]);return{openManageItems:()=>n(v.jsx(hve,{...e,keyFn:r,items:s,defaultSelectedItems:c,onApplyChanges:u})),managedItems:c}}function hve(e){const{t}=xt(),{title:n,description:r,columns:i,onApplyChanges:a}=e,[o]=x.useState(()=>e.keyFn),[l,s]=Ur(),c=()=>s(void 0),[u,f]=x.useState(()=>e.items),{selectedItems:d,isSelected:h,selectItem:m,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b}=Ny(u,o,e.defaultSelectedItems),S=()=>{a(u,d),s(void 0)};return v.jsxs(T.Modal,{title:n,"aria-label":n,ouiaId:n,description:v.jsx("div",{style:{marginBottom:16},children:r}),variant:e.variant??T.ModalVariant.medium,isOpen:!0,onClose:c,actions:[v.jsx(T.Button,{variant:"primary",onClick:S,children:t`Apply`},"apply"),v.jsx(T.Button,{variant:"link",onClick:c,children:t`Cancel`},"cancel")],hasNoBodyWrapper:!0,children:[v.jsx(T.Divider,{}),v.jsx(T.ModalBoxBody,{style:{padding:0},children:v.jsx(fve,{keyFn:o,items:u,setItems:f,columns:i,isSelected:h,selectItem:m,unselectItem:p,allSelected:y,selectAll:_,unselectAll:b,hideColumnHeaders:e.hideColumnHeaders,isSelectableWithCheckbox:e.hideSelection!==!0})}),v.jsx(T.Divider,{})]})}function mve(e,t,n,r,i){const{t:a}=xt(),o=x.useMemo(()=>{const f=[{header:a("Column Name"),cell:d=>d.header}];return n||f.push({header:a("Table View"),cell:(d,h)=>v.jsx(Zn,{value:d.table??"",onSelect:m=>{switch(m){case"":h({...d,table:void 0});break;case ha.Description:case ha.Expanded:case ha.Hidden:h({...d,table:m});break}},placeholder:a("Column"),options:[{value:"",label:a("Column"),description:a("Show the column in the table.")},{value:ha.Description,label:a("Description"),description:a("Show the column when the item is expanded as a full width description.")},{value:ha.Expanded,label:a("Expanded"),description:a("Show the column when the item is expanded as a detail.")},{value:ha.Hidden,label:a("Hidden"),description:a("Hide the column.")}]})}),r||f.push({header:a("List View"),cell:(d,h)=>v.jsx(Zn,{value:d.list??"",onSelect:m=>{switch(m){case"":h({...d,list:void 0});break;case"name":case"subtitle":case"description":case"primary":case"secondary":case"hidden":h({...d,list:m});break}},options:[{value:"name",label:a("Name"),description:a("Show the column as the name of the list item.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the list.")},{value:"description",label:a("Description"),description:a("Show the column as the list item description.")},{value:"",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"primary",label:a("Left side"),description:a("Show the column on the left side of the list.")},{value:"secondary",label:a("Right side"),description:a("Show the column on the right side of the list.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the list.")}],placeholder:a("Left side")})}),i||f.push({header:a("Card View"),cell:(d,h)=>v.jsx(Zn,{value:d.card??"",onSelect:m=>{switch(m){case"":h({...d,card:void 0});break;case"name":case"subtitle":case"description":case"hidden":h({...d,card:m});break}},placeholder:a("Detail"),options:[{value:"name",label:a("Name"),description:a("Show the column as the name on the card.")},{value:"subtitle",label:a("Subtitle"),description:a("Show the column as the subtitle under the name on the card.")},{value:"description",label:a("Description"),description:a("Show the column as the card description.")},{value:"",label:a("Detail"),description:a("Show the column one of the details on the card.")},{value:"hidden",label:a("Hidden"),description:a("Hide the column on the card.")}]})}),f},[i,r,n,a]),l=x.useCallback((f,d)=>{typeof d=="object"&&d!==null&&("table"in d&&typeof d.table=="string"?f.table=d.table:f.table=void 0,"list"in d&&typeof d.list=="string"?f.list=d.list:f.list=void 0,"card"in d&&typeof d.card=="string"?f.card=d.card:f.card=void 0)},[]),s=x.useCallback(f=>{const{table:d,list:h,card:m}=f;return{table:d,list:h,card:m}},[]),{openManageItems:c,managedItems:u}=dve({id:e,title:a("Manage Columns"),description:a("Manage the order, placement, and format of columns."),items:t,keyFn:f=>f.id??f.header,columns:o,loadFn:l,saveFn:s,hideSelection:!0});return{openColumnManagement:c,managedColumns:u}}const AOe="";function pve(){return v.jsx(Re.Table,{gridBreakPoint:"",className:"page-table",children:v.jsx(Re.Tbody,{children:new Array(10).fill(0).map((e,t)=>v.jsx(Re.Tr,{children:v.jsx(Re.Td,{children:v.jsx(T.Skeleton,{height:"27px"})})},t))})})}function gve(e){const{setPage:t,setPerPage:n}=e,r=x.useCallback((o,l)=>t(l),[t]),i=x.useCallback((o,l)=>n(l),[n]),a=!Tn("md");return v.jsx(T.Pagination,{variant:T.PaginationVariant.bottom,itemCount:e.itemCount,page:e.page,perPage:e.perPage,onSetPage:r,onPerPageSelect:i,perPageOptions:e.perPageOptions,style:{...e.style,boxShadow:"none",zIndex:400,paddingTop:a?4:6,paddingBottom:a?4:6},className:"border-top bg-lighten"})}function vve(e){const t=e.size??350,n=x.useRef(null),[r,i]=x.useState("1fr"),a=x.useCallback(l=>{let s=Math.min(e.maxColumns??12,Math.max(Math.floor(l/t),1));s<1&&(s=1),i(()=>new Array(s).fill("1fr").join(" "))},[e.maxColumns,t]);Io(n,l=>a(l.contentRect.width)),x.useLayoutEffect(()=>{var l;a(((l=n.current)==null?void 0:l.clientWidth)??0)},[a]);const o=16;return v.jsx("div",{ref:n,style:{display:"grid",gridAutoRows:"1fr",gridTemplateColumns:r,gap:o},children:e.children})}const yve=Ge.small`
381
381
  opacity: 0.7;
382
382
  `,bve=Ge.div`
383
383
  display: flex;
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.538",
4
+ "version": "2.4.540",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",